Linux 2.6.24 disallows arbitrary values of ctl_name in sysctl tables.
Remove all references to such values, namely CTL_AUTO and DEV_ATH.
Implicitly initialize ctl_name with 0 (CTL_UNNUMBERED) instead for all
non-standard names.
Use extra2 instead of ctl_name to identify ath_sysctl_template entries
in ath_sysctl_halparam().
Please test on older kernels, especially Linux 2.4.x.
Index: net80211/ieee80211_linux.c
===================================================================
--- net80211/ieee80211_linux.c (revision 2796)
+++ net80211/ieee80211_linux.c (working copy)
@@ -670,43 +670,41 @@
return ret;
}
-#define CTL_AUTO -2 /* cannot be CTL_ANY or CTL_NONE */
-
static const ctl_table ieee80211_sysctl_template[] = {
#ifdef IEEE80211_DEBUG
- { .ctl_name = CTL_AUTO,
+ {
.procname = "debug",
.mode = 0644,
.proc_handler = ieee80211_sysctl_debug
},
#endif
- { .ctl_name = CTL_AUTO,
+ {
.procname = "dev_type",
.mode = 0644,
.proc_handler = ieee80211_sysctl_dev_type
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "monitor_nods_only",
.mode = 0644,
.proc_handler = ieee80211_sysctl_monitor_nods_only
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "monitor_txf_len",
.mode = 0644,
.proc_handler = ieee80211_sysctl_monitor_txf_len
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "monitor_phy_errors",
.mode = 0644,
.proc_handler = ieee80211_sysctl_monitor_phy_errors
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "monitor_crc_errors",
.mode = 0644,
.proc_handler = ieee80211_sysctl_monitor_crc_errors
},
/* NB: must be last entry before NULL */
- { .ctl_name = CTL_AUTO,
+ {
.procname = "%parent",
.maxlen = IFNAMSIZ,
.mode = 0444,
@@ -766,7 +764,6 @@
vap->iv_sysctls[0].mode = 0555;
vap->iv_sysctls[0].child = &vap->iv_sysctls[2];
/* [1] is NULL terminator */
- vap->iv_sysctls[2].ctl_name = CTL_AUTO;
vap->iv_sysctls[2].procname = devname; /* XXX bad idea? */
vap->iv_sysctls[2].mode = 0555;
vap->iv_sysctls[2].child = &vap->iv_sysctls[4];
@@ -776,7 +773,7 @@
sizeof(ieee80211_sysctl_template));
/* add in dynamic data references */
- for (i = 4; vap->iv_sysctls[i].ctl_name; i++)
+ for (i = 4; vap->iv_sysctls[i].procname; i++)
if (vap->iv_sysctls[i].extra1 == NULL)
vap->iv_sysctls[i].extra1 = vap;
Index: ath_rate/onoe/onoe.c
===================================================================
--- ath_rate/onoe/onoe.c (revision 2796)
+++ ath_rate/onoe/onoe.c (working copy)
@@ -434,17 +434,11 @@
static int minpercent = 0; /* 0% */
static int maxint = 0x7fffffff; /* 32-bit big */
-#define CTL_AUTO -2 /* cannot be CTL_ANY or CTL_NONE */
-
/*
* Static (i.e. global) sysctls.
*/
-enum {
- DEV_ATH = 9, /* XXX known by many */
-};
-
static ctl_table ath_rate_static_sysctls[] = {
- { .ctl_name = CTL_AUTO,
+ {
.procname = "interval",
.mode = 0644,
.data = &ath_rateinterval,
@@ -453,7 +447,7 @@
.extra2 = &maxint,
.proc_handler = proc_dointvec_minmax
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "raise",
.mode = 0644,
.data = &ath_rate_raise,
@@ -462,7 +456,7 @@
.extra2 = &maxpercent,
.proc_handler = proc_dointvec_minmax
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "raise_threshold",
.mode = 0644,
.data = &ath_rate_raise_threshold,
@@ -472,14 +466,14 @@
{ 0 }
};
static ctl_table ath_rate_table[] = {
- { .ctl_name = CTL_AUTO,
+ {
.procname = "rate",
.mode = 0555,
.child = ath_rate_static_sysctls
}, { 0 }
};
static ctl_table ath_ath_table[] = {
- { .ctl_name = DEV_ATH,
+ {
.procname = "ath",
.mode = 0555,
.child = ath_rate_table
Index: ath_rate/amrr/amrr.c
===================================================================
--- ath_rate/amrr/amrr.c (revision 2796)
+++ ath_rate/amrr/amrr.c (working copy)
@@ -485,17 +485,12 @@
static int maxint = 0x7fffffff; /* 32-bit big */
static int min_threshold = 1;
-#define CTL_AUTO -2 /* cannot be CTL_ANY or CTL_NONE */
-
/*
* Static (i.e. global) sysctls.
*/
-enum {
- DEV_ATH = 9, /* XXX known by many */
-};
static ctl_table ath_rate_static_sysctls[] = {
- { .ctl_name = CTL_AUTO,
+ {
.procname = "interval",
.mode = 0644,
.data = &ath_rateinterval,
@@ -504,7 +499,7 @@
.extra2 = &maxint,
.proc_handler = proc_dointvec_minmax
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "max_success_threshold",
.mode = 0644,
.data = &ath_rate_max_success_threshold,
@@ -513,7 +508,7 @@
.extra2 = &maxint,
.proc_handler = proc_dointvec_minmax
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "min_success_threshold",
.mode = 0644,
.data = &ath_rate_min_success_threshold,
@@ -525,14 +520,14 @@
{ 0 }
};
static ctl_table ath_rate_table[] = {
- { .ctl_name = CTL_AUTO,
+ {
.procname = "rate",
.mode = 0555,
.child = ath_rate_static_sysctls
}, { 0 }
};
static ctl_table ath_ath_table[] = {
- { .ctl_name = DEV_ATH,
+ {
.procname = "ath",
.mode = 0555,
.child = ath_rate_table
Index: ath_hal/ah_os.c
===================================================================
--- ath_hal/ah_os.c (revision 2796)
+++ ath_hal/ah_os.c (working copy)
@@ -453,15 +453,9 @@
}
EXPORT_SYMBOL(ath_hal_memcmp);
-enum {
- DEV_ATH = 9, /* XXX must match driver */
-};
-
-#define CTL_AUTO -2 /* cannot be CTL_ANY or CTL_NONE */
-
static ctl_table ath_hal_sysctls[] = {
#ifdef AH_DEBUG
- { .ctl_name = CTL_AUTO,
+ {
.procname = "debug",
.mode = 0644,
.data = &ath_hal_debug,
@@ -469,21 +463,21 @@
.proc_handler = proc_dointvec
},
#endif
- { .ctl_name = CTL_AUTO,
+ {
.procname = "dma_beacon_response_time",
.data = &ath_hal_dma_beacon_response_time,
.maxlen = sizeof(ath_hal_dma_beacon_response_time),
.mode = 0644,
.proc_handler = proc_dointvec
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "sw_beacon_response_time",
.mode = 0644,
.data = &ath_hal_sw_beacon_response_time,
.maxlen = sizeof(ath_hal_sw_beacon_response_time),
.proc_handler = proc_dointvec
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "swba_backoff",
.mode = 0644,
.data = &ath_hal_additional_swba_backoff,
@@ -491,19 +485,19 @@
.proc_handler = proc_dointvec
},
#ifdef AH_DEBUG_ALQ
- { .ctl_name = CTL_AUTO,
+ {
.procname = "alq",
.mode = 0644,
.proc_handler = sysctl_hw_ath_hal_log
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "alq_size",
.mode = 0644,
.data = &ath_hal_alq_qsize,
.maxlen = sizeof(ath_hal_alq_qsize),
.proc_handler = proc_dointvec
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "alq_lost",
.mode = 0644,
.data = &ath_hal_alq_lost,
@@ -514,14 +508,14 @@
{ 0 }
};
static ctl_table ath_hal_table[] = {
- { .ctl_name = CTL_AUTO,
+ {
.procname = "hal",
.mode = 0555,
.child = ath_hal_sysctls
}, { 0 }
};
static ctl_table ath_ath_table[] = {
- { .ctl_name = DEV_ATH,
+ {
.procname = "ath",
.mode = 0555,
.child = ath_hal_table
Index: ath/if_ath.c
===================================================================
--- ath/if_ath.c (revision 2796)
+++ ath/if_ath.c (working copy)
@@ -9403,7 +9403,7 @@
if (write) {
ret = ATH_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos);
if (ret == 0) {
- switch (ctl->ctl_name) {
+ switch ((long)ctl->extra2) {
case ATH_SLOTTIME:
if (val > 0) {
if (!ath_hal_setslottime(ah, val))
@@ -9515,7 +9515,7 @@
}
}
} else {
- switch (ctl->ctl_name) {
+ switch ((long)ctl->extra2) {
case ATH_SLOTTIME:
val = ath_hal_getslottime(ah);
break;
@@ -9581,89 +9581,87 @@
static int mincalibrate = 1; /* once a second */
static int maxint = 0x7fffffff; /* 32-bit big */
-#define CTL_AUTO -2 /* cannot be CTL_ANY or CTL_NONE */
-
static const ctl_table ath_sysctl_template[] = {
- { .ctl_name = ATH_SLOTTIME,
+ { .extra2 = (void *)ATH_SLOTTIME,
.procname = "slottime",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_ACKTIMEOUT,
+ { .extra2 = (void *)ATH_ACKTIMEOUT,
.procname = "acktimeout",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_CTSTIMEOUT,
+ { .extra2 = (void *)ATH_CTSTIMEOUT,
.procname = "ctstimeout",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_SOFTLED,
+ { .extra2 = (void *)ATH_SOFTLED,
.procname = "softled",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_LEDPIN,
+ { .extra2 = (void *)ATH_LEDPIN,
.procname = "ledpin",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_COUNTRYCODE,
+ { .extra2 = (void *)ATH_COUNTRYCODE,
.procname = "countrycode",
.mode = 0444,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_REGDOMAIN,
+ { .extra2 = (void *)ATH_REGDOMAIN,
.procname = "regdomain",
.mode = 0444,
.proc_handler = ath_sysctl_halparam
},
#ifdef AR_DEBUG
- { .ctl_name = ATH_DEBUG,
+ { .extra2 = (void *)ATH_DEBUG,
.procname = "debug",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
#endif
- { .ctl_name = ATH_TXANTENNA,
+ { .extra2 = (void *)ATH_TXANTENNA,
.procname = "txantenna",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_RXANTENNA,
+ { .extra2 = (void *)ATH_RXANTENNA,
.procname = "rxantenna",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_DIVERSITY,
+ { .extra2 = (void *)ATH_DIVERSITY,
.procname = "diversity",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_TXINTRPERIOD,
+ { .extra2 = (void *)ATH_TXINTRPERIOD,
.procname = "txintrperiod",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_FFTXQMIN,
+ { .extra2 = (void *)ATH_FFTXQMIN,
.procname = "fftxqmin",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
#ifdef ATH_SUPERG_XR
- { .ctl_name = ATH_XR_POLL_PERIOD,
+ { .extra2 = (void *)ATH_XR_POLL_PERIOD,
.procname = "xrpollperiod",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
- { .ctl_name = ATH_XR_POLL_COUNT,
+ { .extra2 = (void *)ATH_XR_POLL_COUNT,
.procname = "xrpollcount",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
},
#endif
- { .ctl_name = ATH_ACKRATE,
+ { .extra2 = (void *)ATH_ACKRATE,
.procname = "ackrate",
.mode = 0644,
.proc_handler = ath_sysctl_halparam
@@ -9705,7 +9703,6 @@
sc->sc_sysctls[0].mode = 0555;
sc->sc_sysctls[0].child = &sc->sc_sysctls[2];
/* [1] is NULL terminator */
- sc->sc_sysctls[2].ctl_name = CTL_AUTO;
sc->sc_sysctls[2].procname = dev_name;
sc->sc_sysctls[2].mode = 0555;
sc->sc_sysctls[2].child = &sc->sc_sysctls[4];
@@ -9715,7 +9712,7 @@
sizeof(ath_sysctl_template));
/* add in dynamic data references */
- for (i = 4; sc->sc_sysctls[i].ctl_name; i++)
+ for (i = 4; sc->sc_sysctls[i].procname; i++)
if (sc->sc_sysctls[i].extra1 == NULL)
sc->sc_sysctls[i].extra1 = sc;
@@ -9803,16 +9800,11 @@
}
/*
- * Static (i.e. global) sysctls. Note that the HAL sysctls
- * are located under ours by sharing the setting for DEV_ATH.
+ * Static (i.e. global) sysctls.
*/
-enum {
- DEV_ATH = 9, /* XXX known by HAL */
-};
-
static ctl_table ath_static_sysctls[] = {
#ifdef AR_DEBUG
- { .ctl_name = CTL_AUTO,
+ {
.procname = "debug",
.mode = 0644,
.data = &ath_debug,
@@ -9820,28 +9812,28 @@
.proc_handler = proc_dointvec
},
#endif
- { .ctl_name = CTL_AUTO,
+ {
.procname = "countrycode",
.mode = 0444,
.data = &ath_countrycode,
.maxlen = sizeof(ath_countrycode),
.proc_handler = proc_dointvec
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "outdoor",
.mode = 0444,
.data = &ath_outdoor,
.maxlen = sizeof(ath_outdoor),
.proc_handler = proc_dointvec
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "xchanmode",
.mode = 0444,
.data = &ath_xchanmode,
.maxlen = sizeof(ath_xchanmode),
.proc_handler = proc_dointvec
},
- { .ctl_name = CTL_AUTO,
+ {
.procname = "calibrate",
.mode = 0644,
.data = &ath_calinterval,
@@ -9853,7 +9845,7 @@
{ 0 }
};
static ctl_table ath_ath_table[] = {
- { .ctl_name = DEV_ATH,
+ {
.procname = "ath",
.mode = 0555,
.child = ath_static_sysctls
--
Regards,
Pavel Roskin
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Madwifi-devel mailing list
Madwifi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/madwifi-devel| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Andrew Morton | -mm merge plans for 2.6.23 |
| Can E. Acar | Re: Wasting our Freedom |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| PJ Waskiewicz | [ANNOUNCE] ixgbe: Data Center Bridging (DCB) support for ixgbe |
