diff options
Diffstat (limited to 'drivers/net/wireless/b43/main.c')
| -rw-r--r-- | drivers/net/wireless/b43/main.c | 66 |
1 files changed, 54 insertions, 12 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index d2661aaff50f..d2b1d1fe202b 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
| @@ -66,7 +66,6 @@ MODULE_AUTHOR("Michael Buesch"); | |||
| 66 | MODULE_AUTHOR("Gábor Stefanik"); | 66 | MODULE_AUTHOR("Gábor Stefanik"); |
| 67 | MODULE_LICENSE("GPL"); | 67 | MODULE_LICENSE("GPL"); |
| 68 | 68 | ||
| 69 | MODULE_FIRMWARE(B43_SUPPORTED_FIRMWARE_ID); | ||
| 70 | MODULE_FIRMWARE("b43/ucode11.fw"); | 69 | MODULE_FIRMWARE("b43/ucode11.fw"); |
| 71 | MODULE_FIRMWARE("b43/ucode13.fw"); | 70 | MODULE_FIRMWARE("b43/ucode13.fw"); |
| 72 | MODULE_FIRMWARE("b43/ucode14.fw"); | 71 | MODULE_FIRMWARE("b43/ucode14.fw"); |
| @@ -108,7 +107,7 @@ int b43_modparam_verbose = B43_VERBOSITY_DEFAULT; | |||
| 108 | module_param_named(verbose, b43_modparam_verbose, int, 0644); | 107 | module_param_named(verbose, b43_modparam_verbose, int, 0644); |
| 109 | MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug"); | 108 | MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug"); |
| 110 | 109 | ||
| 111 | static int b43_modparam_pio = B43_PIO_DEFAULT; | 110 | static int b43_modparam_pio = 0; |
| 112 | module_param_named(pio, b43_modparam_pio, int, 0644); | 111 | module_param_named(pio, b43_modparam_pio, int, 0644); |
| 113 | MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO"); | 112 | MODULE_PARM_DESC(pio, "Use PIO accesses by default: 0=DMA, 1=PIO"); |
| 114 | 113 | ||
| @@ -320,6 +319,10 @@ static void b43_wireless_core_exit(struct b43_wldev *dev); | |||
| 320 | static int b43_wireless_core_init(struct b43_wldev *dev); | 319 | static int b43_wireless_core_init(struct b43_wldev *dev); |
| 321 | static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev); | 320 | static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev); |
| 322 | static int b43_wireless_core_start(struct b43_wldev *dev); | 321 | static int b43_wireless_core_start(struct b43_wldev *dev); |
| 322 | static void b43_op_bss_info_changed(struct ieee80211_hw *hw, | ||
| 323 | struct ieee80211_vif *vif, | ||
| 324 | struct ieee80211_bss_conf *conf, | ||
| 325 | u32 changed); | ||
| 323 | 326 | ||
| 324 | static int b43_ratelimit(struct b43_wl *wl) | 327 | static int b43_ratelimit(struct b43_wl *wl) |
| 325 | { | 328 | { |
| @@ -2510,6 +2513,12 @@ static int b43_upload_microcode(struct b43_wldev *dev) | |||
| 2510 | } | 2513 | } |
| 2511 | dev->fw.rev = fwrev; | 2514 | dev->fw.rev = fwrev; |
| 2512 | dev->fw.patch = fwpatch; | 2515 | dev->fw.patch = fwpatch; |
| 2516 | if (dev->fw.rev >= 598) | ||
| 2517 | dev->fw.hdr_format = B43_FW_HDR_598; | ||
| 2518 | else if (dev->fw.rev >= 410) | ||
| 2519 | dev->fw.hdr_format = B43_FW_HDR_410; | ||
| 2520 | else | ||
| 2521 | dev->fw.hdr_format = B43_FW_HDR_351; | ||
| 2513 | dev->fw.opensource = (fwdate == 0xFFFF); | 2522 | dev->fw.opensource = (fwdate == 0xFFFF); |
| 2514 | 2523 | ||
| 2515 | /* Default to use-all-queues. */ | 2524 | /* Default to use-all-queues. */ |
| @@ -2557,7 +2566,7 @@ static int b43_upload_microcode(struct b43_wldev *dev) | |||
| 2557 | dev->fw.rev, dev->fw.patch); | 2566 | dev->fw.rev, dev->fw.patch); |
| 2558 | wiphy->hw_version = dev->dev->core_id; | 2567 | wiphy->hw_version = dev->dev->core_id; |
| 2559 | 2568 | ||
| 2560 | if (b43_is_old_txhdr_format(dev)) { | 2569 | if (dev->fw.hdr_format == B43_FW_HDR_351) { |
| 2561 | /* We're over the deadline, but we keep support for old fw | 2570 | /* We're over the deadline, but we keep support for old fw |
| 2562 | * until it turns out to be in major conflict with something new. */ | 2571 | * until it turns out to be in major conflict with something new. */ |
| 2563 | b43warn(dev->wl, "You are using an old firmware image. " | 2572 | b43warn(dev->wl, "You are using an old firmware image. " |
| @@ -2943,6 +2952,7 @@ static void b43_rate_memory_init(struct b43_wldev *dev) | |||
| 2943 | case B43_PHYTYPE_G: | 2952 | case B43_PHYTYPE_G: |
| 2944 | case B43_PHYTYPE_N: | 2953 | case B43_PHYTYPE_N: |
| 2945 | case B43_PHYTYPE_LP: | 2954 | case B43_PHYTYPE_LP: |
| 2955 | case B43_PHYTYPE_HT: | ||
| 2946 | b43_rate_memory_write(dev, B43_OFDM_RATE_6MB, 1); | 2956 | b43_rate_memory_write(dev, B43_OFDM_RATE_6MB, 1); |
| 2947 | b43_rate_memory_write(dev, B43_OFDM_RATE_12MB, 1); | 2957 | b43_rate_memory_write(dev, B43_OFDM_RATE_12MB, 1); |
| 2948 | b43_rate_memory_write(dev, B43_OFDM_RATE_18MB, 1); | 2958 | b43_rate_memory_write(dev, B43_OFDM_RATE_18MB, 1); |
| @@ -3778,14 +3788,24 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed) | |||
| 3778 | struct ieee80211_conf *conf = &hw->conf; | 3788 | struct ieee80211_conf *conf = &hw->conf; |
| 3779 | int antenna; | 3789 | int antenna; |
| 3780 | int err = 0; | 3790 | int err = 0; |
| 3791 | bool reload_bss = false; | ||
| 3781 | 3792 | ||
| 3782 | mutex_lock(&wl->mutex); | 3793 | mutex_lock(&wl->mutex); |
| 3783 | 3794 | ||
| 3795 | dev = wl->current_dev; | ||
| 3796 | |||
| 3784 | /* Switch the band (if necessary). This might change the active core. */ | 3797 | /* Switch the band (if necessary). This might change the active core. */ |
| 3785 | err = b43_switch_band(wl, conf->channel); | 3798 | err = b43_switch_band(wl, conf->channel); |
| 3786 | if (err) | 3799 | if (err) |
| 3787 | goto out_unlock_mutex; | 3800 | goto out_unlock_mutex; |
| 3788 | dev = wl->current_dev; | 3801 | |
| 3802 | /* Need to reload all settings if the core changed */ | ||
| 3803 | if (dev != wl->current_dev) { | ||
| 3804 | dev = wl->current_dev; | ||
| 3805 | changed = ~0; | ||
| 3806 | reload_bss = true; | ||
| 3807 | } | ||
| 3808 | |||
| 3789 | phy = &dev->phy; | 3809 | phy = &dev->phy; |
| 3790 | 3810 | ||
| 3791 | if (conf_is_ht(conf)) | 3811 | if (conf_is_ht(conf)) |
| @@ -3846,6 +3866,9 @@ out_mac_enable: | |||
| 3846 | out_unlock_mutex: | 3866 | out_unlock_mutex: |
| 3847 | mutex_unlock(&wl->mutex); | 3867 | mutex_unlock(&wl->mutex); |
| 3848 | 3868 | ||
| 3869 | if (wl->vif && reload_bss) | ||
| 3870 | b43_op_bss_info_changed(hw, wl->vif, &wl->vif->bss_conf, ~0); | ||
| 3871 | |||
| 3849 | return err; | 3872 | return err; |
| 3850 | } | 3873 | } |
| 3851 | 3874 | ||
| @@ -3934,7 +3957,8 @@ static void b43_op_bss_info_changed(struct ieee80211_hw *hw, | |||
| 3934 | if (changed & BSS_CHANGED_BEACON_INT && | 3957 | if (changed & BSS_CHANGED_BEACON_INT && |
| 3935 | (b43_is_mode(wl, NL80211_IFTYPE_AP) || | 3958 | (b43_is_mode(wl, NL80211_IFTYPE_AP) || |
| 3936 | b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) || | 3959 | b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) || |
| 3937 | b43_is_mode(wl, NL80211_IFTYPE_ADHOC))) | 3960 | b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) && |
| 3961 | conf->beacon_int) | ||
| 3938 | b43_set_beacon_int(dev, conf->beacon_int); | 3962 | b43_set_beacon_int(dev, conf->beacon_int); |
| 3939 | 3963 | ||
| 3940 | if (changed & BSS_CHANGED_BASIC_RATES) | 3964 | if (changed & BSS_CHANGED_BASIC_RATES) |
| @@ -4629,8 +4653,13 @@ static int b43_wireless_core_init(struct b43_wldev *dev) | |||
| 4629 | b43_shm_write16(dev, B43_SHM_SCRATCH, B43_SHM_SC_MAXCONT, 0x3FF); | 4653 | b43_shm_write16(dev, B43_SHM_SCRATCH, B43_SHM_SC_MAXCONT, 0x3FF); |
| 4630 | 4654 | ||
| 4631 | if (b43_bus_host_is_pcmcia(dev->dev) || | 4655 | if (b43_bus_host_is_pcmcia(dev->dev) || |
| 4632 | b43_bus_host_is_sdio(dev->dev) || | 4656 | b43_bus_host_is_sdio(dev->dev)) { |
| 4633 | dev->use_pio) { | 4657 | dev->__using_pio_transfers = 1; |
| 4658 | err = b43_pio_init(dev); | ||
| 4659 | } else if (dev->use_pio) { | ||
| 4660 | b43warn(dev->wl, "Forced PIO by use_pio module parameter. " | ||
| 4661 | "This should not be needed and will result in lower " | ||
| 4662 | "performance.\n"); | ||
| 4634 | dev->__using_pio_transfers = 1; | 4663 | dev->__using_pio_transfers = 1; |
| 4635 | err = b43_pio_init(dev); | 4664 | err = b43_pio_init(dev); |
| 4636 | } else { | 4665 | } else { |
| @@ -4702,6 +4731,9 @@ static int b43_op_add_interface(struct ieee80211_hw *hw, | |||
| 4702 | out_mutex_unlock: | 4731 | out_mutex_unlock: |
| 4703 | mutex_unlock(&wl->mutex); | 4732 | mutex_unlock(&wl->mutex); |
| 4704 | 4733 | ||
| 4734 | if (err == 0) | ||
| 4735 | b43_op_bss_info_changed(hw, vif, &vif->bss_conf, ~0); | ||
| 4736 | |||
| 4705 | return err; | 4737 | return err; |
| 4706 | } | 4738 | } |
| 4707 | 4739 | ||
| @@ -4772,6 +4804,9 @@ static int b43_op_start(struct ieee80211_hw *hw) | |||
| 4772 | out_mutex_unlock: | 4804 | out_mutex_unlock: |
| 4773 | mutex_unlock(&wl->mutex); | 4805 | mutex_unlock(&wl->mutex); |
| 4774 | 4806 | ||
| 4807 | /* reload configuration */ | ||
| 4808 | b43_op_config(hw, ~0); | ||
| 4809 | |||
| 4775 | return err; | 4810 | return err; |
| 4776 | } | 4811 | } |
| 4777 | 4812 | ||
| @@ -4928,10 +4963,18 @@ out: | |||
| 4928 | if (err) | 4963 | if (err) |
| 4929 | wl->current_dev = NULL; /* Failed to init the dev. */ | 4964 | wl->current_dev = NULL; /* Failed to init the dev. */ |
| 4930 | mutex_unlock(&wl->mutex); | 4965 | mutex_unlock(&wl->mutex); |
| 4931 | if (err) | 4966 | |
| 4967 | if (err) { | ||
| 4932 | b43err(wl, "Controller restart FAILED\n"); | 4968 | b43err(wl, "Controller restart FAILED\n"); |
| 4933 | else | 4969 | return; |
| 4934 | b43info(wl, "Controller restarted\n"); | 4970 | } |
| 4971 | |||
| 4972 | /* reload configuration */ | ||
| 4973 | b43_op_config(wl->hw, ~0); | ||
| 4974 | if (wl->vif) | ||
| 4975 | b43_op_bss_info_changed(wl->hw, wl->vif, &wl->vif->bss_conf, ~0); | ||
| 4976 | |||
| 4977 | b43info(wl, "Controller restarted\n"); | ||
| 4935 | } | 4978 | } |
| 4936 | 4979 | ||
| 4937 | static int b43_setup_bands(struct b43_wldev *dev, | 4980 | static int b43_setup_bands(struct b43_wldev *dev, |
| @@ -5416,8 +5459,7 @@ static void b43_print_driverinfo(void) | |||
| 5416 | feat_sdio = "S"; | 5459 | feat_sdio = "S"; |
| 5417 | #endif | 5460 | #endif |
| 5418 | printk(KERN_INFO "Broadcom 43xx driver loaded " | 5461 | printk(KERN_INFO "Broadcom 43xx driver loaded " |
| 5419 | "[ Features: %s%s%s%s%s, Firmware-ID: " | 5462 | "[ Features: %s%s%s%s%s ]\n", |
| 5420 | B43_SUPPORTED_FIRMWARE_ID " ]\n", | ||
| 5421 | feat_pci, feat_pcmcia, feat_nphy, | 5463 | feat_pci, feat_pcmcia, feat_nphy, |
| 5422 | feat_leds, feat_sdio); | 5464 | feat_leds, feat_sdio); |
| 5423 | } | 5465 | } |
