aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2010-08-25 14:51:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-25 14:51:42 -0400
commite569aa78ba01f7f66e016a4d57310fd041524d17 (patch)
treeeaedc03d42ee2bf6200fc07b080a99bad103def3 /drivers/net/wireless/b43
parent4562487a00445eab96311365ba15c41dc4d043cd (diff)
parent268bae0b6879f238ba57f5f801958d1254e136f7 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts: drivers/net/wireless/libertas/if_sdio.c
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r--drivers/net/wireless/b43/main.c30
-rw-r--r--drivers/net/wireless/b43/phy_n.c60
2 files changed, 75 insertions, 15 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 20631ae2ddd7..a1186525c70d 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2280,6 +2280,7 @@ out:
2280 2280
2281static int b43_upload_microcode(struct b43_wldev *dev) 2281static int b43_upload_microcode(struct b43_wldev *dev)
2282{ 2282{
2283 struct wiphy *wiphy = dev->wl->hw->wiphy;
2283 const size_t hdr_len = sizeof(struct b43_fw_header); 2284 const size_t hdr_len = sizeof(struct b43_fw_header);
2284 const __be32 *data; 2285 const __be32 *data;
2285 unsigned int i, len; 2286 unsigned int i, len;
@@ -2405,6 +2406,10 @@ static int b43_upload_microcode(struct b43_wldev *dev)
2405 } 2406 }
2406 } 2407 }
2407 2408
2409 snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "%u.%u",
2410 dev->fw.rev, dev->fw.patch);
2411 wiphy->hw_version = dev->dev->id.coreid;
2412
2408 if (b43_is_old_txhdr_format(dev)) { 2413 if (b43_is_old_txhdr_format(dev)) {
2409 /* We're over the deadline, but we keep support for old fw 2414 /* We're over the deadline, but we keep support for old fw
2410 * until it turns out to be in major conflict with something new. */ 2415 * until it turns out to be in major conflict with something new. */
@@ -3754,17 +3759,17 @@ static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3754 } 3759 }
3755 3760
3756 err = -EINVAL; 3761 err = -EINVAL;
3757 switch (key->alg) { 3762 switch (key->cipher) {
3758 case ALG_WEP: 3763 case WLAN_CIPHER_SUITE_WEP40:
3759 if (key->keylen == WLAN_KEY_LEN_WEP40) 3764 algorithm = B43_SEC_ALGO_WEP40;
3760 algorithm = B43_SEC_ALGO_WEP40; 3765 break;
3761 else 3766 case WLAN_CIPHER_SUITE_WEP104:
3762 algorithm = B43_SEC_ALGO_WEP104; 3767 algorithm = B43_SEC_ALGO_WEP104;
3763 break; 3768 break;
3764 case ALG_TKIP: 3769 case WLAN_CIPHER_SUITE_TKIP:
3765 algorithm = B43_SEC_ALGO_TKIP; 3770 algorithm = B43_SEC_ALGO_TKIP;
3766 break; 3771 break;
3767 case ALG_CCMP: 3772 case WLAN_CIPHER_SUITE_CCMP:
3768 algorithm = B43_SEC_ALGO_AES; 3773 algorithm = B43_SEC_ALGO_AES;
3769 break; 3774 break;
3770 default: 3775 default:
@@ -4250,6 +4255,10 @@ static void b43_wireless_core_exit(struct b43_wldev *dev)
4250 B43_WARN_ON(dev && b43_status(dev) > B43_STAT_INITIALIZED); 4255 B43_WARN_ON(dev && b43_status(dev) > B43_STAT_INITIALIZED);
4251 if (!dev || b43_status(dev) != B43_STAT_INITIALIZED) 4256 if (!dev || b43_status(dev) != B43_STAT_INITIALIZED)
4252 return; 4257 return;
4258
4259 /* Unregister HW RNG driver */
4260 b43_rng_exit(dev->wl);
4261
4253 b43_set_status(dev, B43_STAT_UNINIT); 4262 b43_set_status(dev, B43_STAT_UNINIT);
4254 4263
4255 /* Stop the microcode PSM. */ 4264 /* Stop the microcode PSM. */
@@ -4379,6 +4388,9 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
4379 4388
4380 b43_set_status(dev, B43_STAT_INITIALIZED); 4389 b43_set_status(dev, B43_STAT_INITIALIZED);
4381 4390
4391 /* Register HW RNG driver */
4392 b43_rng_init(dev->wl);
4393
4382out: 4394out:
4383 return err; 4395 return err;
4384 4396
@@ -4984,7 +4996,6 @@ static int b43_probe(struct ssb_device *dev, const struct ssb_device_id *id)
4984 if (err) 4996 if (err)
4985 goto err_one_core_detach; 4997 goto err_one_core_detach;
4986 b43_leds_register(wl->current_dev); 4998 b43_leds_register(wl->current_dev);
4987 b43_rng_init(wl);
4988 } 4999 }
4989 5000
4990 out: 5001 out:
@@ -5020,7 +5031,6 @@ static void b43_remove(struct ssb_device *dev)
5020 b43_one_core_detach(dev); 5031 b43_one_core_detach(dev);
5021 5032
5022 if (list_empty(&wl->devlist)) { 5033 if (list_empty(&wl->devlist)) {
5023 b43_rng_exit(wl);
5024 b43_leds_unregister(wl); 5034 b43_leds_unregister(wl);
5025 /* Last core on the chip unregistered. 5035 /* Last core on the chip unregistered.
5026 * We can destroy common struct b43_wl. 5036 * We can destroy common struct b43_wl.
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index e288c559481d..d116229c3347 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -893,7 +893,7 @@ static void b43_nphy_adjust_lna_gain_table(struct b43_wldev *dev)
893} 893}
894 894
895/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/WorkaroundsGainCtrl */ 895/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/WorkaroundsGainCtrl */
896static void b43_nphy_gain_crtl_workarounds(struct b43_wldev *dev) 896static void b43_nphy_gain_ctrl_workarounds(struct b43_wldev *dev)
897{ 897{
898 struct b43_phy_n *nphy = dev->phy.n; 898 struct b43_phy_n *nphy = dev->phy.n;
899 u8 i, j; 899 u8 i, j;
@@ -1094,11 +1094,12 @@ static void b43_nphy_workarounds(struct b43_wldev *dev)
1094 b43_nphy_set_rf_sequence(dev, 0, events1, delays1, 7); 1094 b43_nphy_set_rf_sequence(dev, 0, events1, delays1, 7);
1095 b43_nphy_set_rf_sequence(dev, 1, events2, delays2, 7); 1095 b43_nphy_set_rf_sequence(dev, 1, events2, delays2, 7);
1096 1096
1097 b43_nphy_gain_crtl_workarounds(dev); 1097 b43_nphy_gain_ctrl_workarounds(dev);
1098 1098
1099 if (dev->phy.rev < 2) { 1099 if (dev->phy.rev < 2) {
1100 if (b43_phy_read(dev, B43_NPHY_RXCTL) & 0x2) 1100 if (b43_phy_read(dev, B43_NPHY_RXCTL) & 0x2)
1101 ; /*TODO: b43_mhf(dev, 2, 0x0010, 0x0010, 3);*/ 1101 b43_hf_write(dev, b43_hf_read(dev) |
1102 B43_HF_MLADVW);
1102 } else if (dev->phy.rev == 2) { 1103 } else if (dev->phy.rev == 2) {
1103 b43_phy_write(dev, B43_NPHY_CRSCHECK2, 0); 1104 b43_phy_write(dev, B43_NPHY_CRSCHECK2, 0);
1104 b43_phy_write(dev, B43_NPHY_CRSCHECK3, 0); 1105 b43_phy_write(dev, B43_NPHY_CRSCHECK3, 0);
@@ -3073,6 +3074,55 @@ static int b43_nphy_cal_rx_iq(struct b43_wldev *dev,
3073 return b43_nphy_rev2_cal_rx_iq(dev, target, type, debug); 3074 return b43_nphy_rev2_cal_rx_iq(dev, target, type, debug);
3074} 3075}
3075 3076
3077/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/MacPhyClkSet */
3078static void b43_nphy_mac_phy_clock_set(struct b43_wldev *dev, bool on)
3079{
3080 u32 tmslow = ssb_read32(dev->dev, SSB_TMSLOW);
3081 if (on)
3082 tmslow |= SSB_TMSLOW_PHYCLK;
3083 else
3084 tmslow &= ~SSB_TMSLOW_PHYCLK;
3085 ssb_write32(dev->dev, SSB_TMSLOW, tmslow);
3086}
3087
3088/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RxCoreSetState */
3089static void b43_nphy_set_rx_core_state(struct b43_wldev *dev, u8 mask)
3090{
3091 struct b43_phy *phy = &dev->phy;
3092 struct b43_phy_n *nphy = phy->n;
3093 u16 buf[16];
3094
3095 if (0 /* FIXME clk */)
3096 return;
3097
3098 b43_mac_suspend(dev);
3099
3100 if (nphy->hang_avoid)
3101 b43_nphy_stay_in_carrier_search(dev, true);
3102
3103 b43_phy_maskset(dev, B43_NPHY_RFSEQCA, ~B43_NPHY_RFSEQCA_RXEN,
3104 (mask & 0x3) << B43_NPHY_RFSEQCA_RXEN_SHIFT);
3105
3106 if (mask & 0x3 != 0x3) {
3107 b43_phy_write(dev, B43_NPHY_HPANT_SWTHRES, 1);
3108 if (dev->phy.rev >= 3) {
3109 /* TODO */
3110 }
3111 } else {
3112 b43_phy_write(dev, B43_NPHY_HPANT_SWTHRES, 0x1E);
3113 if (dev->phy.rev >= 3) {
3114 /* TODO */
3115 }
3116 }
3117
3118 b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RESET2RX);
3119
3120 if (nphy->hang_avoid)
3121 b43_nphy_stay_in_carrier_search(dev, false);
3122
3123 b43_mac_enable(dev);
3124}
3125
3076/* 3126/*
3077 * Init N-PHY 3127 * Init N-PHY
3078 * http://bcm-v4.sipsolutions.net/802.11/PHY/Init/N 3128 * http://bcm-v4.sipsolutions.net/802.11/PHY/Init/N
@@ -3173,7 +3223,7 @@ int b43_phy_initn(struct b43_wldev *dev)
3173 b43_phy_write(dev, B43_NPHY_BBCFG, tmp & ~B43_NPHY_BBCFG_RSTCCA); 3223 b43_phy_write(dev, B43_NPHY_BBCFG, tmp & ~B43_NPHY_BBCFG_RSTCCA);
3174 b43_nphy_bmac_clock_fgc(dev, 0); 3224 b43_nphy_bmac_clock_fgc(dev, 0);
3175 3225
3176 /* TODO N PHY MAC PHY Clock Set with argument 1 */ 3226 b43_nphy_mac_phy_clock_set(dev, true);
3177 3227
3178 b43_nphy_pa_override(dev, false); 3228 b43_nphy_pa_override(dev, false);
3179 b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RX2TX); 3229 b43_nphy_force_rf_sequence(dev, B43_RFSEQ_RX2TX);
@@ -3199,7 +3249,7 @@ int b43_phy_initn(struct b43_wldev *dev)
3199 } 3249 }
3200 3250
3201 if (nphy->phyrxchain != 3) 3251 if (nphy->phyrxchain != 3)
3202 ;/* TODO N PHY RX Core Set State with phyrxchain as argument */ 3252 b43_nphy_set_rx_core_state(dev, nphy->phyrxchain);
3203 if (nphy->mphase_cal_phase_id > 0) 3253 if (nphy->mphase_cal_phase_id > 0)
3204 ;/* TODO PHY Periodic Calibration Multi-Phase Restart */ 3254 ;/* TODO PHY Periodic Calibration Multi-Phase Restart */
3205 3255