diff options
Diffstat (limited to 'drivers/net/wireless/b43legacy/main.c')
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 70 |
1 files changed, 24 insertions, 46 deletions
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) |