diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-09-12 11:43:28 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-12 11:43:28 -0400 |
commit | c925f1ea9ec20a95d46f57810f4a4d69db74580e (patch) | |
tree | 150d09324f1cf6b231bbe1f3791a75f9169470dd /drivers/net | |
parent | 8083e1656211eb1487329923d592ee061d08d7b3 (diff) | |
parent | 884d3a2bad7293e56fe99d9322a1090bfdfd7c4e (diff) |
Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_main.c | 78 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_main.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c | 74 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_cs.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/isl_ioctl.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_ieee80211.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_mac.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.h | 14 |
11 files changed, 169 insertions, 48 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h index 62fd7e237789..6d4ea36bc564 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx.h | |||
@@ -306,6 +306,13 @@ | |||
306 | #define BCM43xx_SBF_TIME_UPDATE 0x10000000 | 306 | #define BCM43xx_SBF_TIME_UPDATE 0x10000000 |
307 | #define BCM43xx_SBF_80000000 0x80000000 /*FIXME: fix name*/ | 307 | #define BCM43xx_SBF_80000000 0x80000000 /*FIXME: fix name*/ |
308 | 308 | ||
309 | /* Microcode */ | ||
310 | #define BCM43xx_UCODE_REVISION 0x0000 | ||
311 | #define BCM43xx_UCODE_PATCHLEVEL 0x0002 | ||
312 | #define BCM43xx_UCODE_DATE 0x0004 | ||
313 | #define BCM43xx_UCODE_TIME 0x0006 | ||
314 | #define BCM43xx_UCODE_STATUS 0x0040 | ||
315 | |||
309 | /* MicrocodeFlagsBitfield (addr + lo-word values?)*/ | 316 | /* MicrocodeFlagsBitfield (addr + lo-word values?)*/ |
310 | #define BCM43xx_UCODEFLAGS_OFFSET 0x005E | 317 | #define BCM43xx_UCODEFLAGS_OFFSET 0x005E |
311 | 318 | ||
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 966815be6955..cb9a3ae8463a 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -519,6 +519,7 @@ static int bcm43xx_disable_interrupts_sync(struct bcm43xx_private *bcm) | |||
519 | return -EBUSY; | 519 | return -EBUSY; |
520 | } | 520 | } |
521 | bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL); | 521 | bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL); |
522 | bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_MASK); /* flush */ | ||
522 | spin_unlock_irqrestore(&bcm->irq_lock, flags); | 523 | spin_unlock_irqrestore(&bcm->irq_lock, flags); |
523 | bcm43xx_synchronize_irq(bcm); | 524 | bcm43xx_synchronize_irq(bcm); |
524 | 525 | ||
@@ -1545,17 +1546,7 @@ static void handle_irq_noise(struct bcm43xx_private *bcm) | |||
1545 | else | 1546 | else |
1546 | average -= 48; | 1547 | average -= 48; |
1547 | 1548 | ||
1548 | /* FIXME: This is wrong, but people want fancy stats. well... */ | 1549 | bcm->stats.noise = average; |
1549 | bcm->stats.noise = average; | ||
1550 | if (average > -65) | ||
1551 | bcm->stats.link_quality = 0; | ||
1552 | else if (average > -75) | ||
1553 | bcm->stats.link_quality = 1; | ||
1554 | else if (average > -85) | ||
1555 | bcm->stats.link_quality = 2; | ||
1556 | else | ||
1557 | bcm->stats.link_quality = 3; | ||
1558 | // dprintk(KERN_INFO PFX "Link Quality: %u (avg was %d)\n", bcm->stats.link_quality, average); | ||
1559 | drop_calculation: | 1550 | drop_calculation: |
1560 | bcm->noisecalc.calculation_running = 0; | 1551 | bcm->noisecalc.calculation_running = 0; |
1561 | return; | 1552 | return; |
@@ -2393,6 +2384,33 @@ static int bcm43xx_chip_init(struct bcm43xx_private *bcm) | |||
2393 | } | 2384 | } |
2394 | bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); /* dummy read */ | 2385 | bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); /* dummy read */ |
2395 | 2386 | ||
2387 | value16 = bcm43xx_shm_read16(bcm, BCM43xx_SHM_SHARED, | ||
2388 | BCM43xx_UCODE_REVISION); | ||
2389 | |||
2390 | dprintk(KERN_INFO PFX "Microcode rev 0x%x, pl 0x%x " | ||
2391 | "(20%.2i-%.2i-%.2i %.2i:%.2i:%.2i)\n", value16, | ||
2392 | bcm43xx_shm_read16(bcm, BCM43xx_SHM_SHARED, | ||
2393 | BCM43xx_UCODE_PATCHLEVEL), | ||
2394 | (bcm43xx_shm_read16(bcm, BCM43xx_SHM_SHARED, | ||
2395 | BCM43xx_UCODE_DATE) >> 12) & 0xf, | ||
2396 | (bcm43xx_shm_read16(bcm, BCM43xx_SHM_SHARED, | ||
2397 | BCM43xx_UCODE_DATE) >> 8) & 0xf, | ||
2398 | bcm43xx_shm_read16(bcm, BCM43xx_SHM_SHARED, | ||
2399 | BCM43xx_UCODE_DATE) & 0xff, | ||
2400 | (bcm43xx_shm_read16(bcm, BCM43xx_SHM_SHARED, | ||
2401 | BCM43xx_UCODE_TIME) >> 11) & 0x1f, | ||
2402 | (bcm43xx_shm_read16(bcm, BCM43xx_SHM_SHARED, | ||
2403 | BCM43xx_UCODE_TIME) >> 5) & 0x3f, | ||
2404 | bcm43xx_shm_read16(bcm, BCM43xx_SHM_SHARED, | ||
2405 | BCM43xx_UCODE_TIME) & 0x1f); | ||
2406 | |||
2407 | if ( value16 > 0x128 ) { | ||
2408 | dprintk(KERN_ERR PFX | ||
2409 | "Firmware: no support for microcode rev > 0x128\n"); | ||
2410 | err = -1; | ||
2411 | goto err_release_fw; | ||
2412 | } | ||
2413 | |||
2396 | err = bcm43xx_gpio_init(bcm); | 2414 | err = bcm43xx_gpio_init(bcm); |
2397 | if (err) | 2415 | if (err) |
2398 | goto err_release_fw; | 2416 | goto err_release_fw; |
@@ -3150,6 +3168,7 @@ static void bcm43xx_periodic_work_handler(void *d) | |||
3150 | /* Periodic work will take a long time, so we want it to | 3168 | /* Periodic work will take a long time, so we want it to |
3151 | * be preemtible. | 3169 | * be preemtible. |
3152 | */ | 3170 | */ |
3171 | mutex_lock(&bcm->mutex); | ||
3153 | netif_stop_queue(bcm->net_dev); | 3172 | netif_stop_queue(bcm->net_dev); |
3154 | synchronize_net(); | 3173 | synchronize_net(); |
3155 | spin_lock_irqsave(&bcm->irq_lock, flags); | 3174 | spin_lock_irqsave(&bcm->irq_lock, flags); |
@@ -3158,7 +3177,6 @@ static void bcm43xx_periodic_work_handler(void *d) | |||
3158 | bcm43xx_pio_freeze_txqueues(bcm); | 3177 | bcm43xx_pio_freeze_txqueues(bcm); |
3159 | savedirqs = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL); | 3178 | savedirqs = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL); |
3160 | spin_unlock_irqrestore(&bcm->irq_lock, flags); | 3179 | spin_unlock_irqrestore(&bcm->irq_lock, flags); |
3161 | mutex_lock(&bcm->mutex); | ||
3162 | bcm43xx_synchronize_irq(bcm); | 3180 | bcm43xx_synchronize_irq(bcm); |
3163 | } else { | 3181 | } else { |
3164 | /* Periodic work should take short time, so we want low | 3182 | /* Periodic work should take short time, so we want low |
@@ -3172,13 +3190,11 @@ static void bcm43xx_periodic_work_handler(void *d) | |||
3172 | 3190 | ||
3173 | if (badness > BADNESS_LIMIT) { | 3191 | if (badness > BADNESS_LIMIT) { |
3174 | spin_lock_irqsave(&bcm->irq_lock, flags); | 3192 | spin_lock_irqsave(&bcm->irq_lock, flags); |
3175 | if (likely(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED)) { | 3193 | tasklet_enable(&bcm->isr_tasklet); |
3176 | tasklet_enable(&bcm->isr_tasklet); | 3194 | bcm43xx_interrupt_enable(bcm, savedirqs); |
3177 | bcm43xx_interrupt_enable(bcm, savedirqs); | 3195 | if (bcm43xx_using_pio(bcm)) |
3178 | if (bcm43xx_using_pio(bcm)) | 3196 | bcm43xx_pio_thaw_txqueues(bcm); |
3179 | bcm43xx_pio_thaw_txqueues(bcm); | 3197 | bcm43xx_mac_enable(bcm); |
3180 | bcm43xx_mac_enable(bcm); | ||
3181 | } | ||
3182 | netif_wake_queue(bcm->net_dev); | 3198 | netif_wake_queue(bcm->net_dev); |
3183 | } | 3199 | } |
3184 | mmiowb(); | 3200 | mmiowb(); |
@@ -3186,12 +3202,12 @@ static void bcm43xx_periodic_work_handler(void *d) | |||
3186 | mutex_unlock(&bcm->mutex); | 3202 | mutex_unlock(&bcm->mutex); |
3187 | } | 3203 | } |
3188 | 3204 | ||
3189 | static void bcm43xx_periodic_tasks_delete(struct bcm43xx_private *bcm) | 3205 | void bcm43xx_periodic_tasks_delete(struct bcm43xx_private *bcm) |
3190 | { | 3206 | { |
3191 | cancel_rearming_delayed_work(&bcm->periodic_work); | 3207 | cancel_rearming_delayed_work(&bcm->periodic_work); |
3192 | } | 3208 | } |
3193 | 3209 | ||
3194 | static void bcm43xx_periodic_tasks_setup(struct bcm43xx_private *bcm) | 3210 | void bcm43xx_periodic_tasks_setup(struct bcm43xx_private *bcm) |
3195 | { | 3211 | { |
3196 | struct work_struct *work = &(bcm->periodic_work); | 3212 | struct work_struct *work = &(bcm->periodic_work); |
3197 | 3213 | ||
@@ -3539,14 +3555,13 @@ static int bcm43xx_init_board(struct bcm43xx_private *bcm) | |||
3539 | err = bcm43xx_select_wireless_core(bcm, -1); | 3555 | err = bcm43xx_select_wireless_core(bcm, -1); |
3540 | if (err) | 3556 | if (err) |
3541 | goto err_crystal_off; | 3557 | goto err_crystal_off; |
3542 | |||
3543 | bcm43xx_periodic_tasks_setup(bcm); | ||
3544 | err = bcm43xx_sysfs_register(bcm); | 3558 | err = bcm43xx_sysfs_register(bcm); |
3545 | if (err) | 3559 | if (err) |
3546 | goto err_wlshutdown; | 3560 | goto err_wlshutdown; |
3547 | err = bcm43xx_rng_init(bcm); | 3561 | err = bcm43xx_rng_init(bcm); |
3548 | if (err) | 3562 | if (err) |
3549 | goto err_sysfs_unreg; | 3563 | goto err_sysfs_unreg; |
3564 | bcm43xx_periodic_tasks_setup(bcm); | ||
3550 | 3565 | ||
3551 | /*FIXME: This should be handled by softmac instead. */ | 3566 | /*FIXME: This should be handled by softmac instead. */ |
3552 | schedule_work(&bcm->softmac->associnfo.work); | 3567 | schedule_work(&bcm->softmac->associnfo.work); |
@@ -3969,6 +3984,7 @@ static int bcm43xx_net_stop(struct net_device *net_dev) | |||
3969 | err = bcm43xx_disable_interrupts_sync(bcm); | 3984 | err = bcm43xx_disable_interrupts_sync(bcm); |
3970 | assert(!err); | 3985 | assert(!err); |
3971 | bcm43xx_free_board(bcm); | 3986 | bcm43xx_free_board(bcm); |
3987 | flush_scheduled_work(); | ||
3972 | 3988 | ||
3973 | return 0; | 3989 | return 0; |
3974 | } | 3990 | } |
@@ -4119,11 +4135,16 @@ static void bcm43xx_chip_reset(void *_bcm) | |||
4119 | { | 4135 | { |
4120 | struct bcm43xx_private *bcm = _bcm; | 4136 | struct bcm43xx_private *bcm = _bcm; |
4121 | struct bcm43xx_phyinfo *phy; | 4137 | struct bcm43xx_phyinfo *phy; |
4122 | int err; | 4138 | int err = -ENODEV; |
4123 | 4139 | ||
4124 | mutex_lock(&(bcm)->mutex); | 4140 | mutex_lock(&(bcm)->mutex); |
4125 | phy = bcm43xx_current_phy(bcm); | 4141 | if (bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED) { |
4126 | err = bcm43xx_select_wireless_core(bcm, phy->type); | 4142 | bcm43xx_periodic_tasks_delete(bcm); |
4143 | phy = bcm43xx_current_phy(bcm); | ||
4144 | err = bcm43xx_select_wireless_core(bcm, phy->type); | ||
4145 | if (!err) | ||
4146 | bcm43xx_periodic_tasks_setup(bcm); | ||
4147 | } | ||
4127 | mutex_unlock(&(bcm)->mutex); | 4148 | mutex_unlock(&(bcm)->mutex); |
4128 | 4149 | ||
4129 | printk(KERN_ERR PFX "Controller restart%s\n", | 4150 | printk(KERN_ERR PFX "Controller restart%s\n", |
@@ -4132,11 +4153,12 @@ static void bcm43xx_chip_reset(void *_bcm) | |||
4132 | 4153 | ||
4133 | /* Hard-reset the chip. | 4154 | /* Hard-reset the chip. |
4134 | * This can be called from interrupt or process context. | 4155 | * This can be called from interrupt or process context. |
4156 | * bcm->irq_lock must be locked. | ||
4135 | */ | 4157 | */ |
4136 | void bcm43xx_controller_restart(struct bcm43xx_private *bcm, const char *reason) | 4158 | void bcm43xx_controller_restart(struct bcm43xx_private *bcm, const char *reason) |
4137 | { | 4159 | { |
4138 | assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED); | 4160 | if (bcm43xx_status(bcm) != BCM43xx_STAT_INITIALIZED) |
4139 | bcm43xx_set_status(bcm, BCM43xx_STAT_RESTARTING); | 4161 | return; |
4140 | printk(KERN_ERR PFX "Controller RESET (%s) ...\n", reason); | 4162 | printk(KERN_ERR PFX "Controller RESET (%s) ...\n", reason); |
4141 | INIT_WORK(&bcm->restart_work, bcm43xx_chip_reset, bcm); | 4163 | INIT_WORK(&bcm->restart_work, bcm43xx_chip_reset, bcm); |
4142 | schedule_work(&bcm->restart_work); | 4164 | schedule_work(&bcm->restart_work); |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.h b/drivers/net/wireless/bcm43xx/bcm43xx_main.h index 505c86e2007a..f76357178e4d 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.h | |||
@@ -141,6 +141,9 @@ void bcm43xx_wireless_core_reset(struct bcm43xx_private *bcm, int connect_phy); | |||
141 | void bcm43xx_mac_suspend(struct bcm43xx_private *bcm); | 141 | void bcm43xx_mac_suspend(struct bcm43xx_private *bcm); |
142 | void bcm43xx_mac_enable(struct bcm43xx_private *bcm); | 142 | void bcm43xx_mac_enable(struct bcm43xx_private *bcm); |
143 | 143 | ||
144 | void bcm43xx_periodic_tasks_delete(struct bcm43xx_private *bcm); | ||
145 | void bcm43xx_periodic_tasks_setup(struct bcm43xx_private *bcm); | ||
146 | |||
144 | void bcm43xx_controller_restart(struct bcm43xx_private *bcm, const char *reason); | 147 | void bcm43xx_controller_restart(struct bcm43xx_private *bcm, const char *reason); |
145 | 148 | ||
146 | int bcm43xx_sprom_read(struct bcm43xx_private *bcm, u16 *sprom); | 149 | int bcm43xx_sprom_read(struct bcm43xx_private *bcm, u16 *sprom); |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c index ece335178f6a..c71b998a3694 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_sysfs.c | |||
@@ -176,7 +176,6 @@ static ssize_t bcm43xx_attr_interfmode_show(struct device *dev, | |||
176 | char *buf) | 176 | char *buf) |
177 | { | 177 | { |
178 | struct bcm43xx_private *bcm = dev_to_bcm(dev); | 178 | struct bcm43xx_private *bcm = dev_to_bcm(dev); |
179 | int err; | ||
180 | ssize_t count = 0; | 179 | ssize_t count = 0; |
181 | 180 | ||
182 | if (!capable(CAP_NET_ADMIN)) | 181 | if (!capable(CAP_NET_ADMIN)) |
@@ -197,11 +196,10 @@ static ssize_t bcm43xx_attr_interfmode_show(struct device *dev, | |||
197 | default: | 196 | default: |
198 | assert(0); | 197 | assert(0); |
199 | } | 198 | } |
200 | err = 0; | ||
201 | 199 | ||
202 | mutex_unlock(&bcm->mutex); | 200 | mutex_unlock(&bcm->mutex); |
203 | 201 | ||
204 | return err ? err : count; | 202 | return count; |
205 | 203 | ||
206 | } | 204 | } |
207 | 205 | ||
@@ -259,7 +257,6 @@ static ssize_t bcm43xx_attr_preamble_show(struct device *dev, | |||
259 | char *buf) | 257 | char *buf) |
260 | { | 258 | { |
261 | struct bcm43xx_private *bcm = dev_to_bcm(dev); | 259 | struct bcm43xx_private *bcm = dev_to_bcm(dev); |
262 | int err; | ||
263 | ssize_t count; | 260 | ssize_t count; |
264 | 261 | ||
265 | if (!capable(CAP_NET_ADMIN)) | 262 | if (!capable(CAP_NET_ADMIN)) |
@@ -272,10 +269,9 @@ static ssize_t bcm43xx_attr_preamble_show(struct device *dev, | |||
272 | else | 269 | else |
273 | count = snprintf(buf, PAGE_SIZE, "0 (Short Preamble disabled)\n"); | 270 | count = snprintf(buf, PAGE_SIZE, "0 (Short Preamble disabled)\n"); |
274 | 271 | ||
275 | err = 0; | ||
276 | mutex_unlock(&bcm->mutex); | 272 | mutex_unlock(&bcm->mutex); |
277 | 273 | ||
278 | return err ? err : count; | 274 | return count; |
279 | } | 275 | } |
280 | 276 | ||
281 | static ssize_t bcm43xx_attr_preamble_store(struct device *dev, | 277 | static ssize_t bcm43xx_attr_preamble_store(struct device *dev, |
@@ -284,7 +280,6 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev, | |||
284 | { | 280 | { |
285 | struct bcm43xx_private *bcm = dev_to_bcm(dev); | 281 | struct bcm43xx_private *bcm = dev_to_bcm(dev); |
286 | unsigned long flags; | 282 | unsigned long flags; |
287 | int err; | ||
288 | int value; | 283 | int value; |
289 | 284 | ||
290 | if (!capable(CAP_NET_ADMIN)) | 285 | if (!capable(CAP_NET_ADMIN)) |
@@ -298,11 +293,10 @@ static ssize_t bcm43xx_attr_preamble_store(struct device *dev, | |||
298 | 293 | ||
299 | bcm->short_preamble = !!value; | 294 | bcm->short_preamble = !!value; |
300 | 295 | ||
301 | err = 0; | ||
302 | spin_unlock_irqrestore(&bcm->irq_lock, flags); | 296 | spin_unlock_irqrestore(&bcm->irq_lock, flags); |
303 | mutex_unlock(&bcm->mutex); | 297 | mutex_unlock(&bcm->mutex); |
304 | 298 | ||
305 | return err ? err : count; | 299 | return count; |
306 | } | 300 | } |
307 | 301 | ||
308 | static DEVICE_ATTR(shortpreamble, 0644, | 302 | static DEVICE_ATTR(shortpreamble, 0644, |
@@ -333,8 +327,11 @@ static ssize_t bcm43xx_attr_phymode_store(struct device *dev, | |||
333 | goto out; | 327 | goto out; |
334 | } | 328 | } |
335 | 329 | ||
330 | bcm43xx_periodic_tasks_delete(bcm); | ||
336 | mutex_lock(&(bcm)->mutex); | 331 | mutex_lock(&(bcm)->mutex); |
337 | err = bcm43xx_select_wireless_core(bcm, phytype); | 332 | err = bcm43xx_select_wireless_core(bcm, phytype); |
333 | if (!err) | ||
334 | bcm43xx_periodic_tasks_setup(bcm); | ||
338 | mutex_unlock(&(bcm)->mutex); | 335 | mutex_unlock(&(bcm)->mutex); |
339 | if (err == -ESRCH) | 336 | if (err == -ESRCH) |
340 | err = -ENODEV; | 337 | err = -ENODEV; |
@@ -373,6 +370,59 @@ static DEVICE_ATTR(phymode, 0644, | |||
373 | bcm43xx_attr_phymode_show, | 370 | bcm43xx_attr_phymode_show, |
374 | bcm43xx_attr_phymode_store); | 371 | bcm43xx_attr_phymode_store); |
375 | 372 | ||
373 | static ssize_t bcm43xx_attr_microcode_show(struct device *dev, | ||
374 | struct device_attribute *attr, | ||
375 | char *buf) | ||
376 | { | ||
377 | unsigned long flags; | ||
378 | struct bcm43xx_private *bcm = dev_to_bcm(dev); | ||
379 | ssize_t count = 0; | ||
380 | u16 status; | ||
381 | |||
382 | if (!capable(CAP_NET_ADMIN)) | ||
383 | return -EPERM; | ||
384 | |||
385 | mutex_lock(&(bcm)->mutex); | ||
386 | spin_lock_irqsave(&bcm->irq_lock, flags); | ||
387 | status = bcm43xx_shm_read16(bcm, BCM43xx_SHM_SHARED, | ||
388 | BCM43xx_UCODE_STATUS); | ||
389 | |||
390 | spin_unlock_irqrestore(&bcm->irq_lock, flags); | ||
391 | mutex_unlock(&(bcm)->mutex); | ||
392 | switch (status) { | ||
393 | case 0x0000: | ||
394 | count = snprintf(buf, PAGE_SIZE, "0x%.4x (invalid)\n", | ||
395 | status); | ||
396 | break; | ||
397 | case 0x0001: | ||
398 | count = snprintf(buf, PAGE_SIZE, "0x%.4x (init)\n", | ||
399 | status); | ||
400 | break; | ||
401 | case 0x0002: | ||
402 | count = snprintf(buf, PAGE_SIZE, "0x%.4x (active)\n", | ||
403 | status); | ||
404 | break; | ||
405 | case 0x0003: | ||
406 | count = snprintf(buf, PAGE_SIZE, "0x%.4x (suspended)\n", | ||
407 | status); | ||
408 | break; | ||
409 | case 0x0004: | ||
410 | count = snprintf(buf, PAGE_SIZE, "0x%.4x (asleep)\n", | ||
411 | status); | ||
412 | break; | ||
413 | default: | ||
414 | count = snprintf(buf, PAGE_SIZE, "0x%.4x (unknown)\n", | ||
415 | status); | ||
416 | break; | ||
417 | } | ||
418 | |||
419 | return count; | ||
420 | } | ||
421 | |||
422 | static DEVICE_ATTR(microcodestatus, 0444, | ||
423 | bcm43xx_attr_microcode_show, | ||
424 | NULL); | ||
425 | |||
376 | int bcm43xx_sysfs_register(struct bcm43xx_private *bcm) | 426 | int bcm43xx_sysfs_register(struct bcm43xx_private *bcm) |
377 | { | 427 | { |
378 | struct device *dev = &bcm->pci_dev->dev; | 428 | struct device *dev = &bcm->pci_dev->dev; |
@@ -392,9 +442,14 @@ int bcm43xx_sysfs_register(struct bcm43xx_private *bcm) | |||
392 | err = device_create_file(dev, &dev_attr_phymode); | 442 | err = device_create_file(dev, &dev_attr_phymode); |
393 | if (err) | 443 | if (err) |
394 | goto err_remove_shortpreamble; | 444 | goto err_remove_shortpreamble; |
445 | err = device_create_file(dev, &dev_attr_microcodestatus); | ||
446 | if (err) | ||
447 | goto err_remove_phymode; | ||
395 | 448 | ||
396 | out: | 449 | out: |
397 | return err; | 450 | return err; |
451 | err_remove_phymode: | ||
452 | device_remove_file(dev, &dev_attr_phymode); | ||
398 | err_remove_shortpreamble: | 453 | err_remove_shortpreamble: |
399 | device_remove_file(dev, &dev_attr_shortpreamble); | 454 | device_remove_file(dev, &dev_attr_shortpreamble); |
400 | err_remove_interfmode: | 455 | err_remove_interfmode: |
@@ -408,6 +463,7 @@ void bcm43xx_sysfs_unregister(struct bcm43xx_private *bcm) | |||
408 | { | 463 | { |
409 | struct device *dev = &bcm->pci_dev->dev; | 464 | struct device *dev = &bcm->pci_dev->dev; |
410 | 465 | ||
466 | device_remove_file(dev, &dev_attr_microcodestatus); | ||
411 | device_remove_file(dev, &dev_attr_phymode); | 467 | device_remove_file(dev, &dev_attr_phymode); |
412 | device_remove_file(dev, &dev_attr_shortpreamble); | 468 | device_remove_file(dev, &dev_attr_shortpreamble); |
413 | device_remove_file(dev, &dev_attr_interference); | 469 | device_remove_file(dev, &dev_attr_interference); |
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 52e6df5c1a92..686d895116de 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c | |||
@@ -847,6 +847,7 @@ static struct pcmcia_device_id hostap_cs_ids[] = { | |||
847 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), | 847 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), |
848 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), | 848 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), |
849 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010), | 849 | PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010), |
850 | PCMCIA_DEVICE_MANF_CARD(0x0126, 0x0002), | ||
850 | PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "INTERSIL", | 851 | PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "INTERSIL", |
851 | 0x74c5e40d), | 852 | 0x74c5e40d), |
852 | PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "Intersil", | 853 | PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "Intersil", |
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index 0c30fe7e8f7f..c09fbf733b3a 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c | |||
@@ -46,6 +46,10 @@ static size_t prism54_wpa_bss_ie_get(islpci_private *priv, u8 *bssid, u8 *wpa_ie | |||
46 | static int prism54_set_wpa(struct net_device *, struct iw_request_info *, | 46 | static int prism54_set_wpa(struct net_device *, struct iw_request_info *, |
47 | __u32 *, char *); | 47 | __u32 *, char *); |
48 | 48 | ||
49 | /* In 500 kbps */ | ||
50 | static const unsigned char scan_rate_list[] = { 2, 4, 11, 22, | ||
51 | 12, 18, 24, 36, | ||
52 | 48, 72, 96, 108 }; | ||
49 | 53 | ||
50 | /** | 54 | /** |
51 | * prism54_mib_mode_helper - MIB change mode helper function | 55 | * prism54_mib_mode_helper - MIB change mode helper function |
@@ -644,6 +648,32 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev, | |||
644 | current_ev = iwe_stream_add_point(current_ev, end_buf, | 648 | current_ev = iwe_stream_add_point(current_ev, end_buf, |
645 | &iwe, wpa_ie); | 649 | &iwe, wpa_ie); |
646 | } | 650 | } |
651 | /* Do the bitrates */ | ||
652 | { | ||
653 | char * current_val = current_ev + IW_EV_LCP_LEN; | ||
654 | int i; | ||
655 | int mask; | ||
656 | |||
657 | iwe.cmd = SIOCGIWRATE; | ||
658 | /* Those two flags are ignored... */ | ||
659 | iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0; | ||
660 | |||
661 | /* Parse the bitmask */ | ||
662 | mask = 0x1; | ||
663 | for(i = 0; i < sizeof(scan_rate_list); i++) { | ||
664 | if(bss->rates & mask) { | ||
665 | iwe.u.bitrate.value = (scan_rate_list[i] * 500000); | ||
666 | current_val = iwe_stream_add_value(current_ev, current_val, | ||
667 | end_buf, &iwe, | ||
668 | IW_EV_PARAM_LEN); | ||
669 | } | ||
670 | mask <<= 1; | ||
671 | } | ||
672 | /* Check if we added any event */ | ||
673 | if ((current_val - current_ev) > IW_EV_LCP_LEN) | ||
674 | current_ev = current_val; | ||
675 | } | ||
676 | |||
647 | return current_ev; | 677 | return current_ev; |
648 | } | 678 | } |
649 | 679 | ||
diff --git a/drivers/net/wireless/zd1211rw/zd_ieee80211.h b/drivers/net/wireless/zd1211rw/zd_ieee80211.h index 36329890dfec..f63245b0d966 100644 --- a/drivers/net/wireless/zd1211rw/zd_ieee80211.h +++ b/drivers/net/wireless/zd1211rw/zd_ieee80211.h | |||
@@ -64,7 +64,7 @@ struct cck_plcp_header { | |||
64 | u8 service; | 64 | u8 service; |
65 | __le16 length; | 65 | __le16 length; |
66 | __le16 crc16; | 66 | __le16 crc16; |
67 | } __attribute__((packed)); | 67 | }; |
68 | 68 | ||
69 | static inline u8 zd_cck_plcp_header_rate(const struct cck_plcp_header *header) | 69 | static inline u8 zd_cck_plcp_header_rate(const struct cck_plcp_header *header) |
70 | { | 70 | { |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 0ddccf893989..1989f1c05fbe 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -714,7 +714,7 @@ struct zd_rt_hdr { | |||
714 | u8 rt_rate; | 714 | u8 rt_rate; |
715 | u16 rt_channel; | 715 | u16 rt_channel; |
716 | u16 rt_chbitmask; | 716 | u16 rt_chbitmask; |
717 | } __attribute__((packed)); | 717 | }; |
718 | 718 | ||
719 | static void fill_rt_header(void *buffer, struct zd_mac *mac, | 719 | static void fill_rt_header(void *buffer, struct zd_mac *mac, |
720 | const struct ieee80211_rx_stats *stats, | 720 | const struct ieee80211_rx_stats *stats, |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h index 2b596cc8a41a..29b51fd7d4e5 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.h +++ b/drivers/net/wireless/zd1211rw/zd_mac.h | |||
@@ -82,7 +82,7 @@ struct zd_ctrlset { | |||
82 | struct rx_length_info { | 82 | struct rx_length_info { |
83 | __le16 length[3]; | 83 | __le16 length[3]; |
84 | __le16 tag; | 84 | __le16 tag; |
85 | } __attribute__((packed)); | 85 | }; |
86 | 86 | ||
87 | #define RX_LENGTH_INFO_TAG 0x697e | 87 | #define RX_LENGTH_INFO_TAG 0x697e |
88 | 88 | ||
@@ -93,7 +93,7 @@ struct rx_status { | |||
93 | u8 signal_quality_ofdm; | 93 | u8 signal_quality_ofdm; |
94 | u8 decryption_type; | 94 | u8 decryption_type; |
95 | u8 frame_status; | 95 | u8 frame_status; |
96 | } __attribute__((packed)); | 96 | }; |
97 | 97 | ||
98 | /* rx_status field decryption_type */ | 98 | /* rx_status field decryption_type */ |
99 | #define ZD_RX_NO_WEP 0 | 99 | #define ZD_RX_NO_WEP 0 |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 47489fe8ab52..31027e52b04b 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -44,6 +44,8 @@ static struct usb_device_id usb_ids[] = { | |||
44 | { USB_DEVICE(0x1740, 0x2000), .driver_info = DEVICE_ZD1211 }, | 44 | { USB_DEVICE(0x1740, 0x2000), .driver_info = DEVICE_ZD1211 }, |
45 | { USB_DEVICE(0x157e, 0x3204), .driver_info = DEVICE_ZD1211 }, | 45 | { USB_DEVICE(0x157e, 0x3204), .driver_info = DEVICE_ZD1211 }, |
46 | { USB_DEVICE(0x0586, 0x3402), .driver_info = DEVICE_ZD1211 }, | 46 | { USB_DEVICE(0x0586, 0x3402), .driver_info = DEVICE_ZD1211 }, |
47 | { USB_DEVICE(0x0b3b, 0x5630), .driver_info = DEVICE_ZD1211 }, | ||
48 | { USB_DEVICE(0x0b05, 0x170c), .driver_info = DEVICE_ZD1211 }, | ||
47 | /* ZD1211B */ | 49 | /* ZD1211B */ |
48 | { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, | 50 | { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, |
49 | { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, | 51 | { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h index 92746f76239a..ded39de5f72d 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.h +++ b/drivers/net/wireless/zd1211rw/zd_usb.h | |||
@@ -74,17 +74,17 @@ enum control_requests { | |||
74 | struct usb_req_read_regs { | 74 | struct usb_req_read_regs { |
75 | __le16 id; | 75 | __le16 id; |
76 | __le16 addr[0]; | 76 | __le16 addr[0]; |
77 | } __attribute__((packed)); | 77 | }; |
78 | 78 | ||
79 | struct reg_data { | 79 | struct reg_data { |
80 | __le16 addr; | 80 | __le16 addr; |
81 | __le16 value; | 81 | __le16 value; |
82 | } __attribute__((packed)); | 82 | }; |
83 | 83 | ||
84 | struct usb_req_write_regs { | 84 | struct usb_req_write_regs { |
85 | __le16 id; | 85 | __le16 id; |
86 | struct reg_data reg_writes[0]; | 86 | struct reg_data reg_writes[0]; |
87 | } __attribute__((packed)); | 87 | }; |
88 | 88 | ||
89 | enum { | 89 | enum { |
90 | RF_IF_LE = 0x02, | 90 | RF_IF_LE = 0x02, |
@@ -101,7 +101,7 @@ struct usb_req_rfwrite { | |||
101 | /* RF2595: 24 */ | 101 | /* RF2595: 24 */ |
102 | __le16 bit_values[0]; | 102 | __le16 bit_values[0]; |
103 | /* (CR203 & ~(RF_IF_LE | RF_CLK | RF_DATA)) | (bit ? RF_DATA : 0) */ | 103 | /* (CR203 & ~(RF_IF_LE | RF_CLK | RF_DATA)) | (bit ? RF_DATA : 0) */ |
104 | } __attribute__((packed)); | 104 | }; |
105 | 105 | ||
106 | /* USB interrupt */ | 106 | /* USB interrupt */ |
107 | 107 | ||
@@ -118,12 +118,12 @@ enum usb_int_flags { | |||
118 | struct usb_int_header { | 118 | struct usb_int_header { |
119 | u8 type; /* must always be 1 */ | 119 | u8 type; /* must always be 1 */ |
120 | u8 id; | 120 | u8 id; |
121 | } __attribute__((packed)); | 121 | }; |
122 | 122 | ||
123 | struct usb_int_regs { | 123 | struct usb_int_regs { |
124 | struct usb_int_header hdr; | 124 | struct usb_int_header hdr; |
125 | struct reg_data regs[0]; | 125 | struct reg_data regs[0]; |
126 | } __attribute__((packed)); | 126 | }; |
127 | 127 | ||
128 | struct usb_int_retry_fail { | 128 | struct usb_int_retry_fail { |
129 | struct usb_int_header hdr; | 129 | struct usb_int_header hdr; |
@@ -131,7 +131,7 @@ struct usb_int_retry_fail { | |||
131 | u8 _dummy; | 131 | u8 _dummy; |
132 | u8 addr[ETH_ALEN]; | 132 | u8 addr[ETH_ALEN]; |
133 | u8 ibss_wakeup_dest; | 133 | u8 ibss_wakeup_dest; |
134 | } __attribute__((packed)); | 134 | }; |
135 | 135 | ||
136 | struct read_regs_int { | 136 | struct read_regs_int { |
137 | struct completion completion; | 137 | struct completion completion; |