1 Subject: mac80211: remove writable debugs mesh parameters
3 These parameters shouldn't be configurable via debugfs, if they
4 need to be configurable nl80211 support has to be added, if not
5 then they don't need to be writable here either.
7 Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
8 Cc: Javier Cardona <javier@cozybit.com>
9 Cc: Luis Carlos Cobo <luisca@cozybit.com>
11 net/mac80211/debugfs_netdev.c | 112 +++++++++---------------------------------
12 1 file changed, 24 insertions(+), 88 deletions(-)
14 --- everything.orig/net/mac80211/debugfs_netdev.c 2008-10-07 20:05:28.000000000 +0200
15 +++ everything/net/mac80211/debugfs_netdev.c 2008-10-07 20:06:40.000000000 +0200
16 @@ -41,29 +41,6 @@ static ssize_t ieee80211_if_read(
20 -#ifdef CONFIG_MAC80211_MESH
21 -static ssize_t ieee80211_if_write(
22 - struct ieee80211_sub_if_data *sdata,
23 - char const __user *userbuf,
24 - size_t count, loff_t *ppos,
25 - int (*format)(struct ieee80211_sub_if_data *, char *))
30 - memset(buf, 0x00, sizeof(buf));
31 - buf_size = min(count, (sizeof(buf)-1));
32 - if (copy_from_user(buf, userbuf, buf_size))
34 - read_lock(&dev_base_lock);
35 - if (sdata->dev->reg_state == NETREG_REGISTERED)
36 - (*format)(sdata, buf);
37 - read_unlock(&dev_base_lock);
43 #define IEEE80211_IF_FMT(name, field, format_string) \
44 static ssize_t ieee80211_if_fmt_##name( \
45 const struct ieee80211_sub_if_data *sdata, char *buf, \
46 @@ -71,19 +48,6 @@ static ssize_t ieee80211_if_fmt_##name(
48 return scnprintf(buf, buflen, format_string, sdata->field); \
50 -#define IEEE80211_IF_WFMT(name, field, type) \
51 -static int ieee80211_if_wfmt_##name( \
52 - struct ieee80211_sub_if_data *sdata, char *buf) \
54 - unsigned long tmp; \
57 - tmp = simple_strtoul(buf, &endp, 0); \
58 - if ((endp == buf) || ((type)tmp != tmp)) \
60 - sdata->field = tmp; \
63 #define IEEE80211_IF_FMT_DEC(name, field) \
64 IEEE80211_IF_FMT(name, field, "%d\n")
65 #define IEEE80211_IF_FMT_HEX(name, field) \
66 @@ -126,34 +90,6 @@ static const struct file_operations name
67 IEEE80211_IF_FMT_##format(name, field) \
68 __IEEE80211_IF_FILE(name)
70 -#define __IEEE80211_IF_WFILE(name) \
71 -static ssize_t ieee80211_if_read_##name(struct file *file, \
72 - char __user *userbuf, \
73 - size_t count, loff_t *ppos) \
75 - return ieee80211_if_read(file->private_data, \
76 - userbuf, count, ppos, \
77 - ieee80211_if_fmt_##name); \
79 -static ssize_t ieee80211_if_write_##name(struct file *file, \
80 - const char __user *userbuf, \
81 - size_t count, loff_t *ppos) \
83 - return ieee80211_if_write(file->private_data, \
84 - userbuf, count, ppos, \
85 - ieee80211_if_wfmt_##name); \
87 -static const struct file_operations name##_ops = { \
88 - .read = ieee80211_if_read_##name, \
89 - .write = ieee80211_if_write_##name, \
90 - .open = mac80211_open_file_generic, \
93 -#define IEEE80211_IF_WFILE(name, field, format, type) \
94 - IEEE80211_IF_FMT_##format(name, field) \
95 - IEEE80211_IF_WFMT(name, field, type) \
96 - __IEEE80211_IF_WFILE(name)
98 /* common attributes */
99 IEEE80211_IF_FILE(drop_unencrypted, drop_unencrypted, DEC);
100 IEEE80211_IF_FILE(force_unicast_rateidx, force_unicast_rateidx, DEC);
101 @@ -212,30 +148,30 @@ IEEE80211_IF_FILE(dropped_frames_no_rout
102 IEEE80211_IF_FILE(estab_plinks, u.mesh.mshstats.estab_plinks, ATOMIC);
104 /* Mesh parameters */
105 -IEEE80211_IF_WFILE(dot11MeshMaxRetries,
106 - u.mesh.mshcfg.dot11MeshMaxRetries, DEC, u8);
107 -IEEE80211_IF_WFILE(dot11MeshRetryTimeout,
108 - u.mesh.mshcfg.dot11MeshRetryTimeout, DEC, u16);
109 -IEEE80211_IF_WFILE(dot11MeshConfirmTimeout,
110 - u.mesh.mshcfg.dot11MeshConfirmTimeout, DEC, u16);
111 -IEEE80211_IF_WFILE(dot11MeshHoldingTimeout,
112 - u.mesh.mshcfg.dot11MeshHoldingTimeout, DEC, u16);
113 -IEEE80211_IF_WFILE(dot11MeshTTL, u.mesh.mshcfg.dot11MeshTTL, DEC, u8);
114 -IEEE80211_IF_WFILE(auto_open_plinks, u.mesh.mshcfg.auto_open_plinks, DEC, u8);
115 -IEEE80211_IF_WFILE(dot11MeshMaxPeerLinks,
116 - u.mesh.mshcfg.dot11MeshMaxPeerLinks, DEC, u16);
117 -IEEE80211_IF_WFILE(dot11MeshHWMPactivePathTimeout,
118 - u.mesh.mshcfg.dot11MeshHWMPactivePathTimeout, DEC, u32);
119 -IEEE80211_IF_WFILE(dot11MeshHWMPpreqMinInterval,
120 - u.mesh.mshcfg.dot11MeshHWMPpreqMinInterval, DEC, u16);
121 -IEEE80211_IF_WFILE(dot11MeshHWMPnetDiameterTraversalTime,
122 - u.mesh.mshcfg.dot11MeshHWMPnetDiameterTraversalTime, DEC, u16);
123 -IEEE80211_IF_WFILE(dot11MeshHWMPmaxPREQretries,
124 - u.mesh.mshcfg.dot11MeshHWMPmaxPREQretries, DEC, u8);
125 -IEEE80211_IF_WFILE(path_refresh_time,
126 - u.mesh.mshcfg.path_refresh_time, DEC, u32);
127 -IEEE80211_IF_WFILE(min_discovery_timeout,
128 - u.mesh.mshcfg.min_discovery_timeout, DEC, u16);
129 +IEEE80211_IF_FILE(dot11MeshMaxRetries,
130 + u.mesh.mshcfg.dot11MeshMaxRetries, DEC);
131 +IEEE80211_IF_FILE(dot11MeshRetryTimeout,
132 + u.mesh.mshcfg.dot11MeshRetryTimeout, DEC);
133 +IEEE80211_IF_FILE(dot11MeshConfirmTimeout,
134 + u.mesh.mshcfg.dot11MeshConfirmTimeout, DEC);
135 +IEEE80211_IF_FILE(dot11MeshHoldingTimeout,
136 + u.mesh.mshcfg.dot11MeshHoldingTimeout, DEC);
137 +IEEE80211_IF_FILE(dot11MeshTTL, u.mesh.mshcfg.dot11MeshTTL, DEC);
138 +IEEE80211_IF_FILE(auto_open_plinks, u.mesh.mshcfg.auto_open_plinks, DEC);
139 +IEEE80211_IF_FILE(dot11MeshMaxPeerLinks,
140 + u.mesh.mshcfg.dot11MeshMaxPeerLinks, DEC);
141 +IEEE80211_IF_FILE(dot11MeshHWMPactivePathTimeout,
142 + u.mesh.mshcfg.dot11MeshHWMPactivePathTimeout, DEC);
143 +IEEE80211_IF_FILE(dot11MeshHWMPpreqMinInterval,
144 + u.mesh.mshcfg.dot11MeshHWMPpreqMinInterval, DEC);
145 +IEEE80211_IF_FILE(dot11MeshHWMPnetDiameterTraversalTime,
146 + u.mesh.mshcfg.dot11MeshHWMPnetDiameterTraversalTime, DEC);
147 +IEEE80211_IF_FILE(dot11MeshHWMPmaxPREQretries,
148 + u.mesh.mshcfg.dot11MeshHWMPmaxPREQretries, DEC);
149 +IEEE80211_IF_FILE(path_refresh_time,
150 + u.mesh.mshcfg.path_refresh_time, DEC);
151 +IEEE80211_IF_FILE(min_discovery_timeout,
152 + u.mesh.mshcfg.min_discovery_timeout, DEC);