aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2006-11-21 19:05:30 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-02 00:12:05 -0500
commit84bc715c465f76584fc5127955fca0c61592e04b (patch)
tree85205c39f49e3e62c72f3d2d98a1d87e56ad5095 /drivers/net/wireless
parent571d6eee9b5bce28fcbeb7588890ad5ca3f8c718 (diff)
[PATCH] zd1211rw: Remove IW_FREQ_AUTO support
http://bugzilla.kernel.org/show_bug.cgi?id=7399 zd1211rw's support for IW_FREQ_AUTO is broken: when specified, the driver tries to change to a channel specified in an uninitialized integer. As IW_FREQ_AUTO is hard to implement properly, the solution (at least for now) is to drop support for it and start ignoring the flags like all other wireless drivers do. This has the added advantage that kismet also starts working with zd1211rw, even though kismet requesting IW_FREQ_AUTO is also a bug (fixed in their svn) Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_ieee80211.c3
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c17
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.h6
-rw-r--r--drivers/net/wireless/zd1211rw/zd_netdev.c13
4 files changed, 6 insertions, 33 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_ieee80211.c b/drivers/net/wireless/zd1211rw/zd_ieee80211.c
index 66905f7b61ff..1b215a099745 100644
--- a/drivers/net/wireless/zd1211rw/zd_ieee80211.c
+++ b/drivers/net/wireless/zd1211rw/zd_ieee80211.c
@@ -133,9 +133,6 @@ int zd_find_channel(u8 *channel, const struct iw_freq *freq)
133 int i, r; 133 int i, r;
134 u32 mhz; 134 u32 mhz;
135 135
136 if (!(freq->flags & IW_FREQ_FIXED))
137 return 0;
138
139 if (freq->m < 1000) { 136 if (freq->m < 1000) {
140 if (freq->m > NUM_CHANNELS || freq->m == 0) 137 if (freq->m > NUM_CHANNELS || freq->m == 0)
141 return -EINVAL; 138 return -EINVAL;
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index e5fedf968c19..7845b6dac832 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -317,21 +317,12 @@ int zd_mac_request_channel(struct zd_mac *mac, u8 channel)
317 return 0; 317 return 0;
318} 318}
319 319
320int zd_mac_get_channel(struct zd_mac *mac, u8 *channel, u8 *flags) 320u8 zd_mac_get_channel(struct zd_mac *mac)
321{ 321{
322 struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac); 322 u8 channel = zd_chip_get_channel(&mac->chip);
323 323
324 *channel = zd_chip_get_channel(&mac->chip); 324 dev_dbg_f(zd_mac_dev(mac), "channel %u\n", channel);
325 if (ieee->iw_mode != IW_MODE_INFRA) { 325 return channel;
326 spin_lock_irq(&mac->lock);
327 *flags = *channel == mac->requested_channel ?
328 MAC_FIXED_CHANNEL : 0;
329 spin_unlock(&mac->lock);
330 } else {
331 *flags = 0;
332 }
333 dev_dbg_f(zd_mac_dev(mac), "channel %u flags %u\n", *channel, *flags);
334 return 0;
335} 326}
336 327
337/* If wrong rate is given, we are falling back to the slowest rate: 1MBit/s */ 328/* If wrong rate is given, we are falling back to the slowest rate: 1MBit/s */
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h
index e4dd40a6fec3..3feb292651df 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.h
+++ b/drivers/net/wireless/zd1211rw/zd_mac.h
@@ -116,10 +116,6 @@ struct rx_status {
116#define ZD_RX_CRC16_ERROR 0x40 116#define ZD_RX_CRC16_ERROR 0x40
117#define ZD_RX_ERROR 0x80 117#define ZD_RX_ERROR 0x80
118 118
119enum mac_flags {
120 MAC_FIXED_CHANNEL = 0x01,
121};
122
123struct housekeeping { 119struct housekeeping {
124 struct work_struct link_led_work; 120 struct work_struct link_led_work;
125}; 121};
@@ -180,7 +176,7 @@ int zd_mac_set_regdomain(struct zd_mac *zd_mac, u8 regdomain);
180u8 zd_mac_get_regdomain(struct zd_mac *zd_mac); 176u8 zd_mac_get_regdomain(struct zd_mac *zd_mac);
181 177
182int zd_mac_request_channel(struct zd_mac *mac, u8 channel); 178int zd_mac_request_channel(struct zd_mac *mac, u8 channel);
183int zd_mac_get_channel(struct zd_mac *mac, u8 *channel, u8 *flags); 179u8 zd_mac_get_channel(struct zd_mac *mac);
184 180
185int zd_mac_set_mode(struct zd_mac *mac, u32 mode); 181int zd_mac_set_mode(struct zd_mac *mac, u32 mode);
186int zd_mac_get_mode(struct zd_mac *mac, u32 *mode); 182int zd_mac_get_mode(struct zd_mac *mac, u32 *mode);
diff --git a/drivers/net/wireless/zd1211rw/zd_netdev.c b/drivers/net/wireless/zd1211rw/zd_netdev.c
index af3a7b36d078..60f1b0f6d45b 100644
--- a/drivers/net/wireless/zd1211rw/zd_netdev.c
+++ b/drivers/net/wireless/zd1211rw/zd_netdev.c
@@ -107,21 +107,10 @@ static int iw_get_freq(struct net_device *netdev,
107 struct iw_request_info *info, 107 struct iw_request_info *info,
108 union iwreq_data *req, char *extra) 108 union iwreq_data *req, char *extra)
109{ 109{
110 int r;
111 struct zd_mac *mac = zd_netdev_mac(netdev); 110 struct zd_mac *mac = zd_netdev_mac(netdev);
112 struct iw_freq *freq = &req->freq; 111 struct iw_freq *freq = &req->freq;
113 u8 channel;
114 u8 flags;
115
116 r = zd_mac_get_channel(mac, &channel, &flags);
117 if (r)
118 return r;
119 112
120 freq->flags = (flags & MAC_FIXED_CHANNEL) ? 113 return zd_channel_to_freq(freq, zd_mac_get_channel(mac));
121 IW_FREQ_FIXED : IW_FREQ_AUTO;
122 dev_dbg_f(zd_mac_dev(mac), "channel %s\n",
123 (flags & MAC_FIXED_CHANNEL) ? "fixed" : "auto");
124 return zd_channel_to_freq(freq, channel);
125} 114}
126 115
127static int iw_set_mode(struct net_device *netdev, 116static int iw_set_mode(struct net_device *netdev,