Commit a428a69e authored by Art Haas's avatar Art Haas Committed by Linus Torvalds

[PATCH] C99 initializers for drivers/net/arlan-proc.c

parent 948bc323
......@@ -816,14 +816,18 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
/* Place files in /proc/sys/dev/arlan */
#define CTBLN(num,card,nam) \
{num , #nam, &(arlan_conf[card].nam), \
sizeof(int), 0600, NULL, &proc_dointvec}
{ .ctl_name = num,\
.procname = #nam,\
.data = &(arlan_conf[card].nam),\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec}
#ifdef ARLAN_DEBUGGING
#define ARLAN_PROC_DEBUG_ENTRIES {48, "entry_exit_debug", &arlan_entry_and_exit_debug, \
sizeof(int), 0600, NULL, &proc_dointvec},\
{49, "debug", &arlan_debug, \
sizeof(int), 0600, NULL, &proc_dointvec},
#define ARLAN_PROC_DEBUG_ENTRIES \
{ .ctl_name = 48, .procname = "entry_exit_debug",\
.data = &arlan_entry_and_exit_debug,\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},\
{ .ctl_name = 49, .procname = "debug", .data = &arlan_debug,\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},
#else
#define ARLAN_PROC_DEBUG_ENTRIES
#endif
......@@ -858,8 +862,9 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
CTBLN(27,cardNo, txTimeoutMs),\
CTBLN(28,cardNo, waitCardTimeout),\
CTBLN(29,cardNo, channelSet), \
{30, "name", arlan_conf[cardNo].siteName, \
16, 0600, NULL, &proc_dostring},\
{.ctl_name = 30, .procname = "name",\
.data = arlan_conf[cardNo].siteName,\
.maxlen = 16, .mode = 0600, .proc_handler = &proc_dostring},\
CTBLN(31,cardNo,waitTime),\
CTBLN(32,cardNo,lParameter),\
CTBLN(33,cardNo,_15),\
......@@ -897,22 +902,64 @@ static ctl_table arlan_conf_table0[] =
ARLAN_SYSCTL_TABLE_TOTAL(0)
#ifdef ARLAN_PROC_SHM_DUMP
{150, "arlan0-txRing", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_infotxRing},
{151, "arlan0-rxRing", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_inforxRing},
{152, "arlan0-18", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info18},
{153, "arlan0-ring", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info161719},
{154, "arlan0-shm-cpy", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info},
{
.ctl_name = 150,
.procname = "arlan0-txRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing,
},
{
.ctl_name = 151,
.procname = "arlan0-rxRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing,
},
{
.ctl_name = 152,
.procname = "arlan0-18",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info18,
},
{
.ctl_name = 153,
.procname = "arlan0-ring",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info161719,
},
{
.ctl_name = 154,
.procname = "arlan0-shm-cpy",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info,
},
#endif
{155, "config0", &conf_reset_result, \
100, 0400, NULL, &arlan_configure}, \
{156, "reset0", &conf_reset_result, \
100, 0400, NULL, &arlan_sysctl_reset}, \
{0}
{
.ctl_name = 155,
.procname = "config0",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_configure
},
{
.ctl_name = 156,
.procname = "reset0",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_sysctl_reset,
},
{ .ctl_name = 0 }
};
static ctl_table arlan_conf_table1[] =
......@@ -921,22 +968,64 @@ static ctl_table arlan_conf_table1[] =
ARLAN_SYSCTL_TABLE_TOTAL(1)
#ifdef ARLAN_PROC_SHM_DUMP
{150, "arlan1-txRing", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_infotxRing},
{151, "arlan1-rxRing", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_inforxRing},
{152, "arlan1-18", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info18},
{153, "arlan1-ring", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info161719},
{154, "arlan1-shm-cpy", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info},
{
.ctl_name = 150,
.procname = "arlan1-txRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing,
},
{
.ctl_name = 151,
.procname = "arlan1-rxRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing,
},
{
.ctl_name = 152,
.procname = "arlan1-18",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info18,
},
{
.ctl_name = 153,
.procname = "arlan1-ring",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info161719,
},
{
.ctl_name = 154,
.procname = "arlan1-shm-cpy",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info,
},
#endif
{155, "config1", &conf_reset_result,
100, 0400, NULL, &arlan_configure},
{156, "reset1", &conf_reset_result,
100, 0400, NULL, &arlan_sysctl_reset},
{0}
{
.ctl_name = 155,
.procname = "config1",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_configure,
},
{
.ctl_name = 156,
.procname = "reset1",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_sysctl_reset,
},
{ .ctl_name = 0 }
};
static ctl_table arlan_conf_table2[] =
......@@ -945,22 +1034,64 @@ static ctl_table arlan_conf_table2[] =
ARLAN_SYSCTL_TABLE_TOTAL(2)
#ifdef ARLAN_PROC_SHM_DUMP
{150, "arlan2-txRing", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_infotxRing},
{151, "arlan2-rxRing", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_inforxRing},
{152, "arlan2-18", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info18},
{153, "arlan2-ring", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info161719},
{154, "arlan2-shm-cpy", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info},
{
.ctl_name = 150,
.procname = "arlan2-txRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing,
},
{
.ctl_name = 151,
.procname = "arlan2-rxRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing,
},
{
.ctl_name = 152,
.procname = "arlan2-18",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info18,
},
{
.ctl_name = 153,
.procname = "arlan2-ring",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info161719,
},
{
.ctl_name = 154,
.procname = "arlan2-shm-cpy",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info,
},
#endif
{155, "config2", &conf_reset_result,
100, 0400, NULL, &arlan_configure},
{156, "reset2", &conf_reset_result,
100, 0400, NULL, &arlan_sysctl_reset},
{0}
{
.ctl_name = 155,
.procname = "config2",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_configure,
},
{
.ctl_name = 156,
.procname = "reset2",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_sysctl_reset,
},
{ .ctl_name = 0 }
};
static ctl_table arlan_conf_table3[] =
......@@ -969,47 +1100,113 @@ static ctl_table arlan_conf_table3[] =
ARLAN_SYSCTL_TABLE_TOTAL(3)
#ifdef ARLAN_PROC_SHM_DUMP
{150, "arlan3-txRing", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_infotxRing},
{151, "arlan3-rxRing", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_inforxRing},
{152, "arlan3-18", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info18},
{153, "arlan3-ring", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info161719},
{154, "arlan3-shm-cpy", &arlan_drive_info,
ARLAN_STR_SIZE, 0400, NULL, &arlan_sysctl_info},
{
.ctl_name = 150,
.procname = "arlan3-txRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing,
},
{
.ctl_name = 151,
.procname = "arlan3-rxRing",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing,
},
{
.ctl_name = 152,
.procname = "arlan3-18",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info18,
},
{
.ctl_name = 153,
.procname = "arlan3-ring",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info161719,
},
{
.ctl_name = 154,
.procname = "arlan3-shm-cpy",
.data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE,
.mode = 0400,
.proc_handler = &arlan_sysctl_info,
},
#endif
{155, "config3", &conf_reset_result,
100, 0400, NULL, &arlan_configure},
{156, "reset3", &conf_reset_result,
100, 0400, NULL, &arlan_sysctl_reset},
{0}
{
.ctl_name = 155,
.procname = "config3",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_configure,
},
{
.ctl_name = 156,
.procname = "reset3",
.data = &conf_reset_result,
.maxlen = 100,
.mode = 0400,
.proc_handler = &arlan_sysctl_reset,
},
{ .ctl_name = 0 }
};
static ctl_table arlan_table[] =
{
{0, "arlan0", NULL, 0, 0600, arlan_conf_table0},
{0, "arlan1", NULL, 0, 0600, arlan_conf_table1},
{0, "arlan2", NULL, 0, 0600, arlan_conf_table2},
{0, "arlan3", NULL, 0, 0600, arlan_conf_table3},
{0}
{
.ctl_name = 0,
.procname = "arlan0",
.maxlen = 0,
.mode = 0600,
.child = arlan_conf_table0,
},
{
.ctl_name = 0,
.procname = "arlan1",
.maxlen = 0,
.mode = 0600,
.child = arlan_conf_table1,
},
{
.ctl_name = 0,
.procname = "arlan2",
.maxlen = 0,
.mode = 0600,
.child = arlan_conf_table2,
},
{
.ctl_name = 0,
.procname = "arlan3",
.maxlen = 0,
.mode = 0600,
.child = arlan_conf_table3,
},
{ .ctl_name = 0 }
};
#else
static ctl_table arlan_table[MAX_ARLANS + 1] =
{
{0}
{ .ctl_name = 0 }
};
#endif
#else
static ctl_table arlan_table[MAX_ARLANS + 1] =
{
{0}
{ .ctl_name = 0 }
};
#endif
......@@ -1018,8 +1215,14 @@ static ctl_table arlan_table[MAX_ARLANS + 1] =
static ctl_table arlan_root_table[] =
{
{254, "arlan", NULL, 0, 0555, arlan_table},
{0}
{
.ctl_name = 254,
.procname = "arlan",
.maxlen = 0,
.mode = 0555,
.child = arlan_table,
},
{ .ctl_name = 0 }
};
/* Make sure that /proc/sys/dev is there */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment