diff options
Diffstat (limited to 'drivers/net/wireless/b43legacy')
-rw-r--r-- | drivers/net/wireless/b43legacy/Kconfig | 2 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/b43legacy.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/dma.c | 38 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/dma.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/leds.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 70 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/phy.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/pio.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/pio.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/rfkill.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/xmit.c | 1 |
11 files changed, 51 insertions, 107 deletions
diff --git a/drivers/net/wireless/b43legacy/Kconfig b/drivers/net/wireless/b43legacy/Kconfig index 94a463478053..1ffa28835c58 100644 --- a/drivers/net/wireless/b43legacy/Kconfig +++ b/drivers/net/wireless/b43legacy/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config B43LEGACY | 1 | config B43LEGACY |
2 | tristate "Broadcom 43xx-legacy wireless support (mac80211 stack)" | 2 | tristate "Broadcom 43xx-legacy wireless support (mac80211 stack)" |
3 | depends on SSB_POSSIBLE && MAC80211 && WLAN_80211 && HAS_DMA | 3 | depends on SSB_POSSIBLE && MAC80211 && HAS_DMA |
4 | select SSB | 4 | select SSB |
5 | select FW_LOADER | 5 | select FW_LOADER |
6 | ---help--- | 6 | ---help--- |
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h index 038baa8869e2..89fe2f972c72 100644 --- a/drivers/net/wireless/b43legacy/b43legacy.h +++ b/drivers/net/wireless/b43legacy/b43legacy.h | |||
@@ -29,8 +29,6 @@ | |||
29 | 29 | ||
30 | #define B43legacy_IRQWAIT_MAX_RETRIES 20 | 30 | #define B43legacy_IRQWAIT_MAX_RETRIES 20 |
31 | 31 | ||
32 | #define B43legacy_RX_MAX_SSI 60 /* best guess at max ssi */ | ||
33 | |||
34 | /* MMIO offsets */ | 32 | /* MMIO offsets */ |
35 | #define B43legacy_MMIO_DMA0_REASON 0x20 | 33 | #define B43legacy_MMIO_DMA0_REASON 0x20 |
36 | #define B43legacy_MMIO_DMA0_IRQ_MASK 0x24 | 34 | #define B43legacy_MMIO_DMA0_IRQ_MASK 0x24 |
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c index 866403415811..e91520d0312e 100644 --- a/drivers/net/wireless/b43legacy/dma.c +++ b/drivers/net/wireless/b43legacy/dma.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/pci.h> | 37 | #include <linux/pci.h> |
38 | #include <linux/delay.h> | 38 | #include <linux/delay.h> |
39 | #include <linux/skbuff.h> | 39 | #include <linux/skbuff.h> |
40 | #include <linux/slab.h> | ||
40 | #include <net/dst.h> | 41 | #include <net/dst.h> |
41 | 42 | ||
42 | /* 32bit DMA ops. */ | 43 | /* 32bit DMA ops. */ |
@@ -1240,8 +1241,9 @@ struct b43legacy_dmaring *parse_cookie(struct b43legacy_wldev *dev, | |||
1240 | } | 1241 | } |
1241 | 1242 | ||
1242 | static int dma_tx_fragment(struct b43legacy_dmaring *ring, | 1243 | static int dma_tx_fragment(struct b43legacy_dmaring *ring, |
1243 | struct sk_buff *skb) | 1244 | struct sk_buff **in_skb) |
1244 | { | 1245 | { |
1246 | struct sk_buff *skb = *in_skb; | ||
1245 | const struct b43legacy_dma_ops *ops = ring->ops; | 1247 | const struct b43legacy_dma_ops *ops = ring->ops; |
1246 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 1248 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
1247 | u8 *header; | 1249 | u8 *header; |
@@ -1305,8 +1307,14 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring, | |||
1305 | } | 1307 | } |
1306 | 1308 | ||
1307 | memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len); | 1309 | memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len); |
1310 | memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb)); | ||
1311 | bounce_skb->dev = skb->dev; | ||
1312 | skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb)); | ||
1313 | info = IEEE80211_SKB_CB(bounce_skb); | ||
1314 | |||
1308 | dev_kfree_skb_any(skb); | 1315 | dev_kfree_skb_any(skb); |
1309 | skb = bounce_skb; | 1316 | skb = bounce_skb; |
1317 | *in_skb = bounce_skb; | ||
1310 | meta->skb = skb; | 1318 | meta->skb = skb; |
1311 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); | 1319 | meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); |
1312 | if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { | 1320 | if (b43legacy_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { |
@@ -1360,8 +1368,10 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev, | |||
1360 | struct sk_buff *skb) | 1368 | struct sk_buff *skb) |
1361 | { | 1369 | { |
1362 | struct b43legacy_dmaring *ring; | 1370 | struct b43legacy_dmaring *ring; |
1371 | struct ieee80211_hdr *hdr; | ||
1363 | int err = 0; | 1372 | int err = 0; |
1364 | unsigned long flags; | 1373 | unsigned long flags; |
1374 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
1365 | 1375 | ||
1366 | ring = priority_to_txring(dev, skb_get_queue_mapping(skb)); | 1376 | ring = priority_to_txring(dev, skb_get_queue_mapping(skb)); |
1367 | spin_lock_irqsave(&ring->lock, flags); | 1377 | spin_lock_irqsave(&ring->lock, flags); |
@@ -1386,7 +1396,11 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev, | |||
1386 | goto out_unlock; | 1396 | goto out_unlock; |
1387 | } | 1397 | } |
1388 | 1398 | ||
1389 | err = dma_tx_fragment(ring, skb); | 1399 | /* dma_tx_fragment might reallocate the skb, so invalidate pointers pointing |
1400 | * into the skb data or cb now. */ | ||
1401 | hdr = NULL; | ||
1402 | info = NULL; | ||
1403 | err = dma_tx_fragment(ring, &skb); | ||
1390 | if (unlikely(err == -ENOKEY)) { | 1404 | if (unlikely(err == -ENOKEY)) { |
1391 | /* Drop this packet, as we don't have the encryption key | 1405 | /* Drop this packet, as we don't have the encryption key |
1392 | * anymore and must not transmit it unencrypted. */ | 1406 | * anymore and must not transmit it unencrypted. */ |
@@ -1398,7 +1412,6 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev, | |||
1398 | b43legacyerr(dev->wl, "DMA tx mapping failure\n"); | 1412 | b43legacyerr(dev->wl, "DMA tx mapping failure\n"); |
1399 | goto out_unlock; | 1413 | goto out_unlock; |
1400 | } | 1414 | } |
1401 | ring->nr_tx_packets++; | ||
1402 | if ((free_slots(ring) < SLOTS_PER_PACKET) || | 1415 | if ((free_slots(ring) < SLOTS_PER_PACKET) || |
1403 | should_inject_overflow(ring)) { | 1416 | should_inject_overflow(ring)) { |
1404 | /* This TX ring is full. */ | 1417 | /* This TX ring is full. */ |
@@ -1514,25 +1527,6 @@ void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, | |||
1514 | spin_unlock(&ring->lock); | 1527 | spin_unlock(&ring->lock); |
1515 | } | 1528 | } |
1516 | 1529 | ||
1517 | void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev, | ||
1518 | struct ieee80211_tx_queue_stats *stats) | ||
1519 | { | ||
1520 | const int nr_queues = dev->wl->hw->queues; | ||
1521 | struct b43legacy_dmaring *ring; | ||
1522 | unsigned long flags; | ||
1523 | int i; | ||
1524 | |||
1525 | for (i = 0; i < nr_queues; i++) { | ||
1526 | ring = priority_to_txring(dev, i); | ||
1527 | |||
1528 | spin_lock_irqsave(&ring->lock, flags); | ||
1529 | stats[i].len = ring->used_slots / SLOTS_PER_PACKET; | ||
1530 | stats[i].limit = ring->nr_slots / SLOTS_PER_PACKET; | ||
1531 | stats[i].count = ring->nr_tx_packets; | ||
1532 | spin_unlock_irqrestore(&ring->lock, flags); | ||
1533 | } | ||
1534 | } | ||
1535 | |||
1536 | static void dma_rx(struct b43legacy_dmaring *ring, | 1530 | static void dma_rx(struct b43legacy_dmaring *ring, |
1537 | int *slot) | 1531 | int *slot) |
1538 | { | 1532 | { |
diff --git a/drivers/net/wireless/b43legacy/dma.h b/drivers/net/wireless/b43legacy/dma.h index 2f186003c31e..f9681041c2d8 100644 --- a/drivers/net/wireless/b43legacy/dma.h +++ b/drivers/net/wireless/b43legacy/dma.h | |||
@@ -243,8 +243,6 @@ struct b43legacy_dmaring { | |||
243 | int used_slots; | 243 | int used_slots; |
244 | /* Currently used slot in the ring. */ | 244 | /* Currently used slot in the ring. */ |
245 | int current_slot; | 245 | int current_slot; |
246 | /* Total number of packets sent. Statistics only. */ | ||
247 | unsigned int nr_tx_packets; | ||
248 | /* Frameoffset in octets. */ | 246 | /* Frameoffset in octets. */ |
249 | u32 frameoffset; | 247 | u32 frameoffset; |
250 | /* Descriptor buffer size. */ | 248 | /* Descriptor buffer size. */ |
@@ -292,9 +290,6 @@ void b43legacy_dma_free(struct b43legacy_wldev *dev); | |||
292 | void b43legacy_dma_tx_suspend(struct b43legacy_wldev *dev); | 290 | void b43legacy_dma_tx_suspend(struct b43legacy_wldev *dev); |
293 | void b43legacy_dma_tx_resume(struct b43legacy_wldev *dev); | 291 | void b43legacy_dma_tx_resume(struct b43legacy_wldev *dev); |
294 | 292 | ||
295 | void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev, | ||
296 | struct ieee80211_tx_queue_stats *stats); | ||
297 | |||
298 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, | 293 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, |
299 | struct sk_buff *skb); | 294 | struct sk_buff *skb); |
300 | void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, | 295 | void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, |
@@ -315,11 +310,6 @@ void b43legacy_dma_free(struct b43legacy_wldev *dev) | |||
315 | { | 310 | { |
316 | } | 311 | } |
317 | static inline | 312 | static inline |
318 | void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev, | ||
319 | struct ieee80211_tx_queue_stats *stats) | ||
320 | { | ||
321 | } | ||
322 | static inline | ||
323 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, | 313 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, |
324 | struct sk_buff *skb) | 314 | struct sk_buff *skb) |
325 | { | 315 | { |
diff --git a/drivers/net/wireless/b43legacy/leds.h b/drivers/net/wireless/b43legacy/leds.h index 82167a90088f..9ff6750dc57f 100644 --- a/drivers/net/wireless/b43legacy/leds.h +++ b/drivers/net/wireless/b43legacy/leds.h | |||
@@ -45,7 +45,7 @@ enum b43legacy_led_behaviour { | |||
45 | void b43legacy_leds_init(struct b43legacy_wldev *dev); | 45 | void b43legacy_leds_init(struct b43legacy_wldev *dev); |
46 | void b43legacy_leds_exit(struct b43legacy_wldev *dev); | 46 | void b43legacy_leds_exit(struct b43legacy_wldev *dev); |
47 | 47 | ||
48 | #else /* CONFIG_B43EGACY_LEDS */ | 48 | #else /* CONFIG_B43LEGACY_LEDS */ |
49 | /* LED support disabled */ | 49 | /* LED support disabled */ |
50 | 50 | ||
51 | struct b43legacy_led { | 51 | struct b43legacy_led { |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 4b60148a5e61..bb2dd9329aa0 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/sched.h> | 40 | #include <linux/sched.h> |
41 | #include <linux/skbuff.h> | 41 | #include <linux/skbuff.h> |
42 | #include <linux/dma-mapping.h> | 42 | #include <linux/dma-mapping.h> |
43 | #include <linux/slab.h> | ||
43 | #include <net/dst.h> | 44 | #include <net/dst.h> |
44 | #include <asm/unaligned.h> | 45 | #include <asm/unaligned.h> |
45 | 46 | ||
@@ -61,6 +62,8 @@ MODULE_AUTHOR("Michael Buesch"); | |||
61 | MODULE_LICENSE("GPL"); | 62 | MODULE_LICENSE("GPL"); |
62 | 63 | ||
63 | MODULE_FIRMWARE(B43legacy_SUPPORTED_FIRMWARE_ID); | 64 | MODULE_FIRMWARE(B43legacy_SUPPORTED_FIRMWARE_ID); |
65 | MODULE_FIRMWARE("b43legacy/ucode2.fw"); | ||
66 | MODULE_FIRMWARE("b43legacy/ucode4.fw"); | ||
64 | 67 | ||
65 | #if defined(CONFIG_B43LEGACY_DMA) && defined(CONFIG_B43LEGACY_PIO) | 68 | #if defined(CONFIG_B43LEGACY_DMA) && defined(CONFIG_B43LEGACY_PIO) |
66 | static int modparam_pio; | 69 | static int modparam_pio; |
@@ -2277,7 +2280,7 @@ static void do_periodic_work(struct b43legacy_wldev *dev) | |||
2277 | /* Periodic work locking policy: | 2280 | /* Periodic work locking policy: |
2278 | * The whole periodic work handler is protected by | 2281 | * The whole periodic work handler is protected by |
2279 | * wl->mutex. If another lock is needed somewhere in the | 2282 | * wl->mutex. If another lock is needed somewhere in the |
2280 | * pwork callchain, it's aquired in-place, where it's needed. | 2283 | * pwork callchain, it's acquired in-place, where it's needed. |
2281 | */ | 2284 | */ |
2282 | static void b43legacy_periodic_work_handler(struct work_struct *work) | 2285 | static void b43legacy_periodic_work_handler(struct work_struct *work) |
2283 | { | 2286 | { |
@@ -2444,29 +2447,6 @@ static int b43legacy_op_conf_tx(struct ieee80211_hw *hw, u16 queue, | |||
2444 | return 0; | 2447 | return 0; |
2445 | } | 2448 | } |
2446 | 2449 | ||
2447 | static int b43legacy_op_get_tx_stats(struct ieee80211_hw *hw, | ||
2448 | struct ieee80211_tx_queue_stats *stats) | ||
2449 | { | ||
2450 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | ||
2451 | struct b43legacy_wldev *dev = wl->current_dev; | ||
2452 | unsigned long flags; | ||
2453 | int err = -ENODEV; | ||
2454 | |||
2455 | if (!dev) | ||
2456 | goto out; | ||
2457 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
2458 | if (likely(b43legacy_status(dev) >= B43legacy_STAT_STARTED)) { | ||
2459 | if (b43legacy_using_pio(dev)) | ||
2460 | b43legacy_pio_get_tx_stats(dev, stats); | ||
2461 | else | ||
2462 | b43legacy_dma_get_tx_stats(dev, stats); | ||
2463 | err = 0; | ||
2464 | } | ||
2465 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
2466 | out: | ||
2467 | return err; | ||
2468 | } | ||
2469 | |||
2470 | static int b43legacy_op_get_stats(struct ieee80211_hw *hw, | 2450 | static int b43legacy_op_get_stats(struct ieee80211_hw *hw, |
2471 | struct ieee80211_low_level_stats *stats) | 2451 | struct ieee80211_low_level_stats *stats) |
2472 | { | 2452 | { |
@@ -2677,7 +2657,7 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw, | |||
2677 | if (conf->channel->hw_value != phy->channel) | 2657 | if (conf->channel->hw_value != phy->channel) |
2678 | b43legacy_radio_selectchannel(dev, conf->channel->hw_value, 0); | 2658 | b43legacy_radio_selectchannel(dev, conf->channel->hw_value, 0); |
2679 | 2659 | ||
2680 | dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_RADIOTAP); | 2660 | dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_MONITOR); |
2681 | 2661 | ||
2682 | /* Adjust the desired TX power level. */ | 2662 | /* Adjust the desired TX power level. */ |
2683 | if (conf->power_level != 0) { | 2663 | if (conf->power_level != 0) { |
@@ -2921,6 +2901,7 @@ static int b43legacy_wireless_core_start(struct b43legacy_wldev *dev) | |||
2921 | goto out; | 2901 | goto out; |
2922 | } | 2902 | } |
2923 | /* We are ready to run. */ | 2903 | /* We are ready to run. */ |
2904 | ieee80211_wake_queues(dev->wl->hw); | ||
2924 | b43legacy_set_status(dev, B43legacy_STAT_STARTED); | 2905 | b43legacy_set_status(dev, B43legacy_STAT_STARTED); |
2925 | 2906 | ||
2926 | /* Start data flow (TX/RX) */ | 2907 | /* Start data flow (TX/RX) */ |
@@ -3341,6 +3322,7 @@ static int b43legacy_wireless_core_init(struct b43legacy_wldev *dev) | |||
3341 | b43legacy_security_init(dev); | 3322 | b43legacy_security_init(dev); |
3342 | b43legacy_rng_init(wl); | 3323 | b43legacy_rng_init(wl); |
3343 | 3324 | ||
3325 | ieee80211_wake_queues(dev->wl->hw); | ||
3344 | b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED); | 3326 | b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED); |
3345 | 3327 | ||
3346 | b43legacy_leds_init(dev); | 3328 | b43legacy_leds_init(dev); |
@@ -3361,7 +3343,7 @@ err_kfree_lo_control: | |||
3361 | } | 3343 | } |
3362 | 3344 | ||
3363 | static int b43legacy_op_add_interface(struct ieee80211_hw *hw, | 3345 | static int b43legacy_op_add_interface(struct ieee80211_hw *hw, |
3364 | struct ieee80211_if_init_conf *conf) | 3346 | struct ieee80211_vif *vif) |
3365 | { | 3347 | { |
3366 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 3348 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
3367 | struct b43legacy_wldev *dev; | 3349 | struct b43legacy_wldev *dev; |
@@ -3370,23 +3352,23 @@ static int b43legacy_op_add_interface(struct ieee80211_hw *hw, | |||
3370 | 3352 | ||
3371 | /* TODO: allow WDS/AP devices to coexist */ | 3353 | /* TODO: allow WDS/AP devices to coexist */ |
3372 | 3354 | ||
3373 | if (conf->type != NL80211_IFTYPE_AP && | 3355 | if (vif->type != NL80211_IFTYPE_AP && |
3374 | conf->type != NL80211_IFTYPE_STATION && | 3356 | vif->type != NL80211_IFTYPE_STATION && |
3375 | conf->type != NL80211_IFTYPE_WDS && | 3357 | vif->type != NL80211_IFTYPE_WDS && |
3376 | conf->type != NL80211_IFTYPE_ADHOC) | 3358 | vif->type != NL80211_IFTYPE_ADHOC) |
3377 | return -EOPNOTSUPP; | 3359 | return -EOPNOTSUPP; |
3378 | 3360 | ||
3379 | mutex_lock(&wl->mutex); | 3361 | mutex_lock(&wl->mutex); |
3380 | if (wl->operating) | 3362 | if (wl->operating) |
3381 | goto out_mutex_unlock; | 3363 | goto out_mutex_unlock; |
3382 | 3364 | ||
3383 | b43legacydbg(wl, "Adding Interface type %d\n", conf->type); | 3365 | b43legacydbg(wl, "Adding Interface type %d\n", vif->type); |
3384 | 3366 | ||
3385 | dev = wl->current_dev; | 3367 | dev = wl->current_dev; |
3386 | wl->operating = 1; | 3368 | wl->operating = 1; |
3387 | wl->vif = conf->vif; | 3369 | wl->vif = vif; |
3388 | wl->if_type = conf->type; | 3370 | wl->if_type = vif->type; |
3389 | memcpy(wl->mac_addr, conf->mac_addr, ETH_ALEN); | 3371 | memcpy(wl->mac_addr, vif->addr, ETH_ALEN); |
3390 | 3372 | ||
3391 | spin_lock_irqsave(&wl->irq_lock, flags); | 3373 | spin_lock_irqsave(&wl->irq_lock, flags); |
3392 | b43legacy_adjust_opmode(dev); | 3374 | b43legacy_adjust_opmode(dev); |
@@ -3403,18 +3385,18 @@ static int b43legacy_op_add_interface(struct ieee80211_hw *hw, | |||
3403 | } | 3385 | } |
3404 | 3386 | ||
3405 | static void b43legacy_op_remove_interface(struct ieee80211_hw *hw, | 3387 | static void b43legacy_op_remove_interface(struct ieee80211_hw *hw, |
3406 | struct ieee80211_if_init_conf *conf) | 3388 | struct ieee80211_vif *vif) |
3407 | { | 3389 | { |
3408 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 3390 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
3409 | struct b43legacy_wldev *dev = wl->current_dev; | 3391 | struct b43legacy_wldev *dev = wl->current_dev; |
3410 | unsigned long flags; | 3392 | unsigned long flags; |
3411 | 3393 | ||
3412 | b43legacydbg(wl, "Removing Interface type %d\n", conf->type); | 3394 | b43legacydbg(wl, "Removing Interface type %d\n", vif->type); |
3413 | 3395 | ||
3414 | mutex_lock(&wl->mutex); | 3396 | mutex_lock(&wl->mutex); |
3415 | 3397 | ||
3416 | B43legacy_WARN_ON(!wl->operating); | 3398 | B43legacy_WARN_ON(!wl->operating); |
3417 | B43legacy_WARN_ON(wl->vif != conf->vif); | 3399 | B43legacy_WARN_ON(wl->vif != vif); |
3418 | wl->vif = NULL; | 3400 | wl->vif = NULL; |
3419 | 3401 | ||
3420 | wl->operating = 0; | 3402 | wl->operating = 0; |
@@ -3509,7 +3491,6 @@ static const struct ieee80211_ops b43legacy_hw_ops = { | |||
3509 | .bss_info_changed = b43legacy_op_bss_info_changed, | 3491 | .bss_info_changed = b43legacy_op_bss_info_changed, |
3510 | .configure_filter = b43legacy_op_configure_filter, | 3492 | .configure_filter = b43legacy_op_configure_filter, |
3511 | .get_stats = b43legacy_op_get_stats, | 3493 | .get_stats = b43legacy_op_get_stats, |
3512 | .get_tx_stats = b43legacy_op_get_tx_stats, | ||
3513 | .start = b43legacy_op_start, | 3494 | .start = b43legacy_op_start, |
3514 | .stop = b43legacy_op_stop, | 3495 | .stop = b43legacy_op_stop, |
3515 | .set_tim = b43legacy_op_beacon_set_tim, | 3496 | .set_tim = b43legacy_op_beacon_set_tim, |
@@ -3593,7 +3574,7 @@ static int b43legacy_wireless_core_attach(struct b43legacy_wldev *dev) | |||
3593 | { | 3574 | { |
3594 | struct b43legacy_wl *wl = dev->wl; | 3575 | struct b43legacy_wl *wl = dev->wl; |
3595 | struct ssb_bus *bus = dev->dev->bus; | 3576 | struct ssb_bus *bus = dev->dev->bus; |
3596 | struct pci_dev *pdev = bus->host_pci; | 3577 | struct pci_dev *pdev = (bus->bustype == SSB_BUSTYPE_PCI) ? bus->host_pci : NULL; |
3597 | int err; | 3578 | int err; |
3598 | int have_bphy = 0; | 3579 | int have_bphy = 0; |
3599 | int have_gphy = 0; | 3580 | int have_gphy = 0; |
@@ -3707,7 +3688,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev, | |||
3707 | 3688 | ||
3708 | if (!list_empty(&wl->devlist)) { | 3689 | if (!list_empty(&wl->devlist)) { |
3709 | /* We are not the first core on this chip. */ | 3690 | /* We are not the first core on this chip. */ |
3710 | pdev = dev->bus->host_pci; | 3691 | pdev = (dev->bus->bustype == SSB_BUSTYPE_PCI) ? dev->bus->host_pci : NULL; |
3711 | /* Only special chips support more than one wireless | 3692 | /* Only special chips support more than one wireless |
3712 | * core, although some of the other chips have more than | 3693 | * core, although some of the other chips have more than |
3713 | * one wireless core as well. Check for this and | 3694 | * one wireless core as well. Check for this and |
@@ -3960,7 +3941,7 @@ static struct ssb_driver b43legacy_ssb_driver = { | |||
3960 | 3941 | ||
3961 | static void b43legacy_print_driverinfo(void) | 3942 | static void b43legacy_print_driverinfo(void) |
3962 | { | 3943 | { |
3963 | const char *feat_pci = "", *feat_leds = "", *feat_rfkill = "", | 3944 | const char *feat_pci = "", *feat_leds = "", |
3964 | *feat_pio = "", *feat_dma = ""; | 3945 | *feat_pio = "", *feat_dma = ""; |
3965 | 3946 | ||
3966 | #ifdef CONFIG_B43LEGACY_PCI_AUTOSELECT | 3947 | #ifdef CONFIG_B43LEGACY_PCI_AUTOSELECT |
@@ -3969,9 +3950,6 @@ static void b43legacy_print_driverinfo(void) | |||
3969 | #ifdef CONFIG_B43LEGACY_LEDS | 3950 | #ifdef CONFIG_B43LEGACY_LEDS |
3970 | feat_leds = "L"; | 3951 | feat_leds = "L"; |
3971 | #endif | 3952 | #endif |
3972 | #ifdef CONFIG_B43LEGACY_RFKILL | ||
3973 | feat_rfkill = "R"; | ||
3974 | #endif | ||
3975 | #ifdef CONFIG_B43LEGACY_PIO | 3953 | #ifdef CONFIG_B43LEGACY_PIO |
3976 | feat_pio = "I"; | 3954 | feat_pio = "I"; |
3977 | #endif | 3955 | #endif |
@@ -3979,9 +3957,9 @@ static void b43legacy_print_driverinfo(void) | |||
3979 | feat_dma = "D"; | 3957 | feat_dma = "D"; |
3980 | #endif | 3958 | #endif |
3981 | printk(KERN_INFO "Broadcom 43xx-legacy driver loaded " | 3959 | printk(KERN_INFO "Broadcom 43xx-legacy driver loaded " |
3982 | "[ Features: %s%s%s%s%s, Firmware-ID: " | 3960 | "[ Features: %s%s%s%s, Firmware-ID: " |
3983 | B43legacy_SUPPORTED_FIRMWARE_ID " ]\n", | 3961 | B43legacy_SUPPORTED_FIRMWARE_ID " ]\n", |
3984 | feat_pci, feat_leds, feat_rfkill, feat_pio, feat_dma); | 3962 | feat_pci, feat_leds, feat_pio, feat_dma); |
3985 | } | 3963 | } |
3986 | 3964 | ||
3987 | static int __init b43legacy_init(void) | 3965 | static int __init b43legacy_init(void) |
diff --git a/drivers/net/wireless/b43legacy/phy.c b/drivers/net/wireless/b43legacy/phy.c index aaf227203a98..35033dd342ce 100644 --- a/drivers/net/wireless/b43legacy/phy.c +++ b/drivers/net/wireless/b43legacy/phy.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/pci.h> | 33 | #include <linux/pci.h> |
34 | #include <linux/sched.h> | 34 | #include <linux/sched.h> |
35 | #include <linux/slab.h> | ||
35 | #include <linux/types.h> | 36 | #include <linux/types.h> |
36 | 37 | ||
37 | #include "b43legacy.h" | 38 | #include "b43legacy.h" |
diff --git a/drivers/net/wireless/b43legacy/pio.c b/drivers/net/wireless/b43legacy/pio.c index 51866c9a2769..b033b0ed4ca0 100644 --- a/drivers/net/wireless/b43legacy/pio.c +++ b/drivers/net/wireless/b43legacy/pio.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "xmit.h" | 29 | #include "xmit.h" |
30 | 30 | ||
31 | #include <linux/delay.h> | 31 | #include <linux/delay.h> |
32 | #include <linux/slab.h> | ||
32 | 33 | ||
33 | 34 | ||
34 | static void tx_start(struct b43legacy_pioqueue *queue) | 35 | static void tx_start(struct b43legacy_pioqueue *queue) |
@@ -477,7 +478,6 @@ int b43legacy_pio_tx(struct b43legacy_wldev *dev, | |||
477 | 478 | ||
478 | list_move_tail(&packet->list, &queue->txqueue); | 479 | list_move_tail(&packet->list, &queue->txqueue); |
479 | queue->nr_txfree--; | 480 | queue->nr_txfree--; |
480 | queue->nr_tx_packets++; | ||
481 | B43legacy_WARN_ON(queue->nr_txfree >= B43legacy_PIO_MAXTXPACKETS); | 481 | B43legacy_WARN_ON(queue->nr_txfree >= B43legacy_PIO_MAXTXPACKETS); |
482 | 482 | ||
483 | tasklet_schedule(&queue->txtask); | 483 | tasklet_schedule(&queue->txtask); |
@@ -546,18 +546,6 @@ void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | |||
546 | tasklet_schedule(&queue->txtask); | 546 | tasklet_schedule(&queue->txtask); |
547 | } | 547 | } |
548 | 548 | ||
549 | void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev, | ||
550 | struct ieee80211_tx_queue_stats *stats) | ||
551 | { | ||
552 | struct b43legacy_pio *pio = &dev->pio; | ||
553 | struct b43legacy_pioqueue *queue; | ||
554 | |||
555 | queue = pio->queue1; | ||
556 | stats[0].len = B43legacy_PIO_MAXTXPACKETS - queue->nr_txfree; | ||
557 | stats[0].limit = B43legacy_PIO_MAXTXPACKETS; | ||
558 | stats[0].count = queue->nr_tx_packets; | ||
559 | } | ||
560 | |||
561 | static void pio_rx_error(struct b43legacy_pioqueue *queue, | 549 | static void pio_rx_error(struct b43legacy_pioqueue *queue, |
562 | int clear_buffers, | 550 | int clear_buffers, |
563 | const char *error) | 551 | const char *error) |
diff --git a/drivers/net/wireless/b43legacy/pio.h b/drivers/net/wireless/b43legacy/pio.h index 464fec05a06d..8e6773ea6e75 100644 --- a/drivers/net/wireless/b43legacy/pio.h +++ b/drivers/net/wireless/b43legacy/pio.h | |||
@@ -74,10 +74,6 @@ struct b43legacy_pioqueue { | |||
74 | * posted to the device. We are waiting for the txstatus. | 74 | * posted to the device. We are waiting for the txstatus. |
75 | */ | 75 | */ |
76 | struct list_head txrunning; | 76 | struct list_head txrunning; |
77 | /* Total number or packets sent. | ||
78 | * (This counter can obviously wrap). | ||
79 | */ | ||
80 | unsigned int nr_tx_packets; | ||
81 | struct tasklet_struct txtask; | 77 | struct tasklet_struct txtask; |
82 | struct b43legacy_pio_txpacket | 78 | struct b43legacy_pio_txpacket |
83 | tx_packets_cache[B43legacy_PIO_MAXTXPACKETS]; | 79 | tx_packets_cache[B43legacy_PIO_MAXTXPACKETS]; |
@@ -106,8 +102,6 @@ int b43legacy_pio_tx(struct b43legacy_wldev *dev, | |||
106 | struct sk_buff *skb); | 102 | struct sk_buff *skb); |
107 | void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | 103 | void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, |
108 | const struct b43legacy_txstatus *status); | 104 | const struct b43legacy_txstatus *status); |
109 | void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev, | ||
110 | struct ieee80211_tx_queue_stats *stats); | ||
111 | void b43legacy_pio_rx(struct b43legacy_pioqueue *queue); | 105 | void b43legacy_pio_rx(struct b43legacy_pioqueue *queue); |
112 | 106 | ||
113 | /* Suspend TX queue in hardware. */ | 107 | /* Suspend TX queue in hardware. */ |
@@ -140,11 +134,6 @@ void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | |||
140 | { | 134 | { |
141 | } | 135 | } |
142 | static inline | 136 | static inline |
143 | void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev, | ||
144 | struct ieee80211_tx_queue_stats *stats) | ||
145 | { | ||
146 | } | ||
147 | static inline | ||
148 | void b43legacy_pio_rx(struct b43legacy_pioqueue *queue) | 137 | void b43legacy_pio_rx(struct b43legacy_pioqueue *queue) |
149 | { | 138 | { |
150 | } | 139 | } |
diff --git a/drivers/net/wireless/b43legacy/rfkill.c b/drivers/net/wireless/b43legacy/rfkill.c index 8783022db11e..d579df72b783 100644 --- a/drivers/net/wireless/b43legacy/rfkill.c +++ b/drivers/net/wireless/b43legacy/rfkill.c | |||
@@ -34,6 +34,13 @@ bool b43legacy_is_hw_radio_enabled(struct b43legacy_wldev *dev) | |||
34 | & B43legacy_MMIO_RADIO_HWENABLED_HI_MASK)) | 34 | & B43legacy_MMIO_RADIO_HWENABLED_HI_MASK)) |
35 | return 1; | 35 | return 1; |
36 | } else { | 36 | } else { |
37 | /* To prevent CPU fault on PPC, do not read a register | ||
38 | * unless the interface is started; however, on resume | ||
39 | * for hibernation, this routine is entered early. When | ||
40 | * that happens, unconditionally return TRUE. | ||
41 | */ | ||
42 | if (b43legacy_status(dev) < B43legacy_STAT_STARTED) | ||
43 | return 1; | ||
37 | if (b43legacy_read16(dev, B43legacy_MMIO_RADIO_HWENABLED_LO) | 44 | if (b43legacy_read16(dev, B43legacy_MMIO_RADIO_HWENABLED_LO) |
38 | & B43legacy_MMIO_RADIO_HWENABLED_LO_MASK) | 45 | & B43legacy_MMIO_RADIO_HWENABLED_LO_MASK) |
39 | return 1; | 46 | return 1; |
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c index 103f3c9e7f58..9c8882d9275e 100644 --- a/drivers/net/wireless/b43legacy/xmit.c +++ b/drivers/net/wireless/b43legacy/xmit.c | |||
@@ -549,7 +549,6 @@ void b43legacy_rx(struct b43legacy_wldev *dev, | |||
549 | (phystat0 & B43legacy_RX_PHYST0_GAINCTL), | 549 | (phystat0 & B43legacy_RX_PHYST0_GAINCTL), |
550 | (phystat3 & B43legacy_RX_PHYST3_TRSTATE)); | 550 | (phystat3 & B43legacy_RX_PHYST3_TRSTATE)); |
551 | status.noise = dev->stats.link_noise; | 551 | status.noise = dev->stats.link_noise; |
552 | status.qual = (jssi * 100) / B43legacy_RX_MAX_SSI; | ||
553 | /* change to support A PHY */ | 552 | /* change to support A PHY */ |
554 | if (phystat0 & B43legacy_RX_PHYST0_OFDM) | 553 | if (phystat0 & B43legacy_RX_PHYST0_OFDM) |
555 | status.rate_idx = b43legacy_plcp_get_bitrate_idx_ofdm(plcp, false); | 554 | status.rate_idx = b43legacy_plcp_get_bitrate_idx_ofdm(plcp, false); |