diff options
Diffstat (limited to 'drivers/net/wireless/b43legacy')
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 38 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/phy.c | 36 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/rfkill.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/xmit.c | 12 |
4 files changed, 48 insertions, 56 deletions
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 1cb77db5c292..c66d57560e7c 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -888,13 +888,13 @@ generate_new: | |||
888 | 888 | ||
889 | static void handle_irq_tbtt_indication(struct b43legacy_wldev *dev) | 889 | static void handle_irq_tbtt_indication(struct b43legacy_wldev *dev) |
890 | { | 890 | { |
891 | if (b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_AP)) { | 891 | if (b43legacy_is_mode(dev->wl, NL80211_IFTYPE_AP)) { |
892 | /* TODO: PS TBTT */ | 892 | /* TODO: PS TBTT */ |
893 | } else { | 893 | } else { |
894 | if (1/*FIXME: the last PSpoll frame was sent successfully */) | 894 | if (1/*FIXME: the last PSpoll frame was sent successfully */) |
895 | b43legacy_power_saving_ctl_bits(dev, -1, -1); | 895 | b43legacy_power_saving_ctl_bits(dev, -1, -1); |
896 | } | 896 | } |
897 | if (b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS)) | 897 | if (b43legacy_is_mode(dev->wl, NL80211_IFTYPE_ADHOC)) |
898 | dev->dfq_valid = 1; | 898 | dev->dfq_valid = 1; |
899 | } | 899 | } |
900 | 900 | ||
@@ -1201,7 +1201,7 @@ static void handle_irq_beacon(struct b43legacy_wldev *dev) | |||
1201 | struct b43legacy_wl *wl = dev->wl; | 1201 | struct b43legacy_wl *wl = dev->wl; |
1202 | u32 cmd; | 1202 | u32 cmd; |
1203 | 1203 | ||
1204 | if (!b43legacy_is_mode(wl, IEEE80211_IF_TYPE_AP)) | 1204 | if (!b43legacy_is_mode(wl, NL80211_IFTYPE_AP)) |
1205 | return; | 1205 | return; |
1206 | 1206 | ||
1207 | /* This is the bottom half of the asynchronous beacon update. */ | 1207 | /* This is the bottom half of the asynchronous beacon update. */ |
@@ -1936,9 +1936,9 @@ static void b43legacy_adjust_opmode(struct b43legacy_wldev *dev) | |||
1936 | ctl &= ~B43legacy_MACCTL_BEACPROMISC; | 1936 | ctl &= ~B43legacy_MACCTL_BEACPROMISC; |
1937 | ctl |= B43legacy_MACCTL_INFRA; | 1937 | ctl |= B43legacy_MACCTL_INFRA; |
1938 | 1938 | ||
1939 | if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_AP)) | 1939 | if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP)) |
1940 | ctl |= B43legacy_MACCTL_AP; | 1940 | ctl |= B43legacy_MACCTL_AP; |
1941 | else if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_IBSS)) | 1941 | else if (b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)) |
1942 | ctl &= ~B43legacy_MACCTL_INFRA; | 1942 | ctl &= ~B43legacy_MACCTL_INFRA; |
1943 | 1943 | ||
1944 | if (wl->filter_flags & FIF_CONTROL) | 1944 | if (wl->filter_flags & FIF_CONTROL) |
@@ -2646,7 +2646,7 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw, | |||
2646 | b43legacy_mgmtframe_txantenna(dev, antenna_tx); | 2646 | b43legacy_mgmtframe_txantenna(dev, antenna_tx); |
2647 | 2647 | ||
2648 | /* Update templates for AP mode. */ | 2648 | /* Update templates for AP mode. */ |
2649 | if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_AP)) | 2649 | if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP)) |
2650 | b43legacy_set_beacon_int(dev, conf->beacon_int); | 2650 | b43legacy_set_beacon_int(dev, conf->beacon_int); |
2651 | 2651 | ||
2652 | 2652 | ||
@@ -2733,12 +2733,12 @@ static int b43legacy_op_config_interface(struct ieee80211_hw *hw, | |||
2733 | else | 2733 | else |
2734 | memset(wl->bssid, 0, ETH_ALEN); | 2734 | memset(wl->bssid, 0, ETH_ALEN); |
2735 | if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) { | 2735 | if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) { |
2736 | if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_AP)) { | 2736 | if (b43legacy_is_mode(wl, NL80211_IFTYPE_AP)) { |
2737 | B43legacy_WARN_ON(vif->type != IEEE80211_IF_TYPE_AP); | 2737 | B43legacy_WARN_ON(vif->type != NL80211_IFTYPE_AP); |
2738 | b43legacy_set_ssid(dev, conf->ssid, conf->ssid_len); | 2738 | b43legacy_set_ssid(dev, conf->ssid, conf->ssid_len); |
2739 | if (conf->changed & IEEE80211_IFCC_BEACON) | 2739 | if (conf->changed & IEEE80211_IFCC_BEACON) |
2740 | b43legacy_update_templates(wl); | 2740 | b43legacy_update_templates(wl); |
2741 | } else if (b43legacy_is_mode(wl, IEEE80211_IF_TYPE_IBSS)) { | 2741 | } else if (b43legacy_is_mode(wl, NL80211_IFTYPE_ADHOC)) { |
2742 | if (conf->changed & IEEE80211_IFCC_BEACON) | 2742 | if (conf->changed & IEEE80211_IFCC_BEACON) |
2743 | b43legacy_update_templates(wl); | 2743 | b43legacy_update_templates(wl); |
2744 | } | 2744 | } |
@@ -3020,7 +3020,7 @@ static void b43legacy_set_synth_pu_delay(struct b43legacy_wldev *dev, | |||
3020 | bool idle) { | 3020 | bool idle) { |
3021 | u16 pu_delay = 1050; | 3021 | u16 pu_delay = 1050; |
3022 | 3022 | ||
3023 | if (b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS) || idle) | 3023 | if (b43legacy_is_mode(dev->wl, NL80211_IFTYPE_ADHOC) || idle) |
3024 | pu_delay = 500; | 3024 | pu_delay = 500; |
3025 | if ((dev->phy.radio_ver == 0x2050) && (dev->phy.radio_rev == 8)) | 3025 | if ((dev->phy.radio_ver == 0x2050) && (dev->phy.radio_rev == 8)) |
3026 | pu_delay = max(pu_delay, (u16)2400); | 3026 | pu_delay = max(pu_delay, (u16)2400); |
@@ -3035,7 +3035,7 @@ static void b43legacy_set_pretbtt(struct b43legacy_wldev *dev) | |||
3035 | u16 pretbtt; | 3035 | u16 pretbtt; |
3036 | 3036 | ||
3037 | /* The time value is in microseconds. */ | 3037 | /* The time value is in microseconds. */ |
3038 | if (b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_IBSS)) | 3038 | if (b43legacy_is_mode(dev->wl, NL80211_IFTYPE_ADHOC)) |
3039 | pretbtt = 2; | 3039 | pretbtt = 2; |
3040 | else | 3040 | else |
3041 | pretbtt = 250; | 3041 | pretbtt = 250; |
@@ -3259,10 +3259,10 @@ static int b43legacy_op_add_interface(struct ieee80211_hw *hw, | |||
3259 | 3259 | ||
3260 | /* TODO: allow WDS/AP devices to coexist */ | 3260 | /* TODO: allow WDS/AP devices to coexist */ |
3261 | 3261 | ||
3262 | if (conf->type != IEEE80211_IF_TYPE_AP && | 3262 | if (conf->type != NL80211_IFTYPE_AP && |
3263 | conf->type != IEEE80211_IF_TYPE_STA && | 3263 | conf->type != NL80211_IFTYPE_STATION && |
3264 | conf->type != IEEE80211_IF_TYPE_WDS && | 3264 | conf->type != NL80211_IFTYPE_WDS && |
3265 | conf->type != IEEE80211_IF_TYPE_IBSS) | 3265 | conf->type != NL80211_IFTYPE_ADHOC) |
3266 | return -EOPNOTSUPP; | 3266 | return -EOPNOTSUPP; |
3267 | 3267 | ||
3268 | mutex_lock(&wl->mutex); | 3268 | mutex_lock(&wl->mutex); |
@@ -3403,7 +3403,7 @@ out_unlock: | |||
3403 | } | 3403 | } |
3404 | 3404 | ||
3405 | static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, | 3405 | static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, |
3406 | int aid, int set) | 3406 | struct ieee80211_sta *sta, bool set) |
3407 | { | 3407 | { |
3408 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 3408 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
3409 | unsigned long flags; | 3409 | unsigned long flags; |
@@ -3704,7 +3704,13 @@ static int b43legacy_wireless_init(struct ssb_device *dev) | |||
3704 | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | | 3704 | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | |
3705 | IEEE80211_HW_SIGNAL_DBM | | 3705 | IEEE80211_HW_SIGNAL_DBM | |
3706 | IEEE80211_HW_NOISE_DBM; | 3706 | IEEE80211_HW_NOISE_DBM; |
3707 | hw->wiphy->interface_modes = | ||
3708 | BIT(NL80211_IFTYPE_AP) | | ||
3709 | BIT(NL80211_IFTYPE_STATION) | | ||
3710 | BIT(NL80211_IFTYPE_WDS) | | ||
3711 | BIT(NL80211_IFTYPE_ADHOC); | ||
3707 | hw->queues = 1; /* FIXME: hardware has more queues */ | 3712 | hw->queues = 1; /* FIXME: hardware has more queues */ |
3713 | hw->max_altrates = 1; | ||
3708 | SET_IEEE80211_DEV(hw, dev->dev); | 3714 | SET_IEEE80211_DEV(hw, dev->dev); |
3709 | if (is_valid_ether_addr(sprom->et1mac)) | 3715 | if (is_valid_ether_addr(sprom->et1mac)) |
3710 | SET_IEEE80211_PERM_ADDR(hw, sprom->et1mac); | 3716 | SET_IEEE80211_PERM_ADDR(hw, sprom->et1mac); |
diff --git a/drivers/net/wireless/b43legacy/phy.c b/drivers/net/wireless/b43legacy/phy.c index 768cccb9b1ba..4c9442b16f3f 100644 --- a/drivers/net/wireless/b43legacy/phy.c +++ b/drivers/net/wireless/b43legacy/phy.c | |||
@@ -103,7 +103,7 @@ void b43legacy_phy_lock(struct b43legacy_wldev *dev) | |||
103 | if (dev->dev->id.revision < 3) { | 103 | if (dev->dev->id.revision < 3) { |
104 | b43legacy_mac_suspend(dev); | 104 | b43legacy_mac_suspend(dev); |
105 | } else { | 105 | } else { |
106 | if (!b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_AP)) | 106 | if (!b43legacy_is_mode(dev->wl, NL80211_IFTYPE_AP)) |
107 | b43legacy_power_saving_ctl_bits(dev, -1, 1); | 107 | b43legacy_power_saving_ctl_bits(dev, -1, 1); |
108 | } | 108 | } |
109 | } | 109 | } |
@@ -118,7 +118,7 @@ void b43legacy_phy_unlock(struct b43legacy_wldev *dev) | |||
118 | if (dev->dev->id.revision < 3) { | 118 | if (dev->dev->id.revision < 3) { |
119 | b43legacy_mac_enable(dev); | 119 | b43legacy_mac_enable(dev); |
120 | } else { | 120 | } else { |
121 | if (!b43legacy_is_mode(dev->wl, IEEE80211_IF_TYPE_AP)) | 121 | if (!b43legacy_is_mode(dev->wl, NL80211_IFTYPE_AP)) |
122 | b43legacy_power_saving_ctl_bits(dev, -1, -1); | 122 | b43legacy_power_saving_ctl_bits(dev, -1, -1); |
123 | } | 123 | } |
124 | } | 124 | } |
@@ -595,12 +595,14 @@ static void b43legacy_phy_initb5(struct b43legacy_wldev *dev) | |||
595 | 0x0035) & 0xFFC0) | 0x0064); | 595 | 0x0035) & 0xFFC0) | 0x0064); |
596 | b43legacy_phy_write(dev, 0x005D, (b43legacy_phy_read(dev, | 596 | b43legacy_phy_write(dev, 0x005D, (b43legacy_phy_read(dev, |
597 | 0x005D) & 0xFF80) | 0x000A); | 597 | 0x005D) & 0xFF80) | 0x000A); |
598 | b43legacy_phy_write(dev, 0x5B, 0x0000); | ||
599 | b43legacy_phy_write(dev, 0x5C, 0x0000); | ||
598 | } | 600 | } |
599 | 601 | ||
600 | if (dev->bad_frames_preempt) | 602 | if (dev->bad_frames_preempt) |
601 | b43legacy_phy_write(dev, B43legacy_PHY_RADIO_BITFIELD, | 603 | b43legacy_phy_write(dev, B43legacy_PHY_RADIO_BITFIELD, |
602 | b43legacy_phy_read(dev, | 604 | b43legacy_phy_read(dev, |
603 | B43legacy_PHY_RADIO_BITFIELD) | (1 << 11)); | 605 | B43legacy_PHY_RADIO_BITFIELD) | (1 << 12)); |
604 | 606 | ||
605 | if (phy->analog == 1) { | 607 | if (phy->analog == 1) { |
606 | b43legacy_phy_write(dev, 0x0026, 0xCE00); | 608 | b43legacy_phy_write(dev, 0x0026, 0xCE00); |
@@ -753,7 +755,7 @@ static void b43legacy_phy_initb6(struct b43legacy_wldev *dev) | |||
753 | b43legacy_radio_write16(dev, 0x0050, 0x0020); | 755 | b43legacy_radio_write16(dev, 0x0050, 0x0020); |
754 | } | 756 | } |
755 | if (phy->radio_rev <= 2) { | 757 | if (phy->radio_rev <= 2) { |
756 | b43legacy_radio_write16(dev, 0x007C, 0x0020); | 758 | b43legacy_radio_write16(dev, 0x0050, 0x0020); |
757 | b43legacy_radio_write16(dev, 0x005A, 0x0070); | 759 | b43legacy_radio_write16(dev, 0x005A, 0x0070); |
758 | b43legacy_radio_write16(dev, 0x005B, 0x007B); | 760 | b43legacy_radio_write16(dev, 0x005B, 0x007B); |
759 | b43legacy_radio_write16(dev, 0x005C, 0x00B0); | 761 | b43legacy_radio_write16(dev, 0x005C, 0x00B0); |
@@ -771,7 +773,7 @@ static void b43legacy_phy_initb6(struct b43legacy_wldev *dev) | |||
771 | b43legacy_phy_write(dev, 0x002A, 0x8AC0); | 773 | b43legacy_phy_write(dev, 0x002A, 0x8AC0); |
772 | b43legacy_phy_write(dev, 0x0038, 0x0668); | 774 | b43legacy_phy_write(dev, 0x0038, 0x0668); |
773 | b43legacy_radio_set_txpower_bg(dev, 0xFFFF, 0xFFFF, 0xFFFF); | 775 | b43legacy_radio_set_txpower_bg(dev, 0xFFFF, 0xFFFF, 0xFFFF); |
774 | if (phy->radio_rev <= 5) | 776 | if (phy->radio_rev == 4 || phy->radio_rev == 5) |
775 | b43legacy_phy_write(dev, 0x005D, (b43legacy_phy_read(dev, | 777 | b43legacy_phy_write(dev, 0x005D, (b43legacy_phy_read(dev, |
776 | 0x005D) & 0xFF80) | 0x0003); | 778 | 0x005D) & 0xFF80) | 0x0003); |
777 | if (phy->radio_rev <= 2) | 779 | if (phy->radio_rev <= 2) |
@@ -1010,7 +1012,7 @@ static void b43legacy_phy_initg(struct b43legacy_wldev *dev) | |||
1010 | b43legacy_phy_initb5(dev); | 1012 | b43legacy_phy_initb5(dev); |
1011 | else | 1013 | else |
1012 | b43legacy_phy_initb6(dev); | 1014 | b43legacy_phy_initb6(dev); |
1013 | if (phy->rev >= 2 || phy->gmode) | 1015 | if (phy->rev >= 2 && phy->gmode) |
1014 | b43legacy_phy_inita(dev); | 1016 | b43legacy_phy_inita(dev); |
1015 | 1017 | ||
1016 | if (phy->rev >= 2) { | 1018 | if (phy->rev >= 2) { |
@@ -1025,18 +1027,22 @@ static void b43legacy_phy_initg(struct b43legacy_wldev *dev) | |||
1025 | b43legacy_phy_write(dev, 0x0811, 0x0400); | 1027 | b43legacy_phy_write(dev, 0x0811, 0x0400); |
1026 | b43legacy_phy_write(dev, 0x0015, 0x00C0); | 1028 | b43legacy_phy_write(dev, 0x0015, 0x00C0); |
1027 | } | 1029 | } |
1028 | if (phy->rev >= 2 || phy->gmode) { | 1030 | if (phy->gmode) { |
1029 | tmp = b43legacy_phy_read(dev, 0x0400) & 0xFF; | 1031 | tmp = b43legacy_phy_read(dev, 0x0400) & 0xFF; |
1030 | if (tmp == 3 || tmp == 5) { | 1032 | if (tmp == 3) { |
1033 | b43legacy_phy_write(dev, 0x04C2, 0x1816); | ||
1034 | b43legacy_phy_write(dev, 0x04C3, 0x8606); | ||
1035 | } | ||
1036 | if (tmp == 4 || tmp == 5) { | ||
1031 | b43legacy_phy_write(dev, 0x04C2, 0x1816); | 1037 | b43legacy_phy_write(dev, 0x04C2, 0x1816); |
1032 | b43legacy_phy_write(dev, 0x04C3, 0x8006); | 1038 | b43legacy_phy_write(dev, 0x04C3, 0x8006); |
1033 | if (tmp == 5) | 1039 | b43legacy_phy_write(dev, 0x04CC, |
1034 | b43legacy_phy_write(dev, 0x04CC, | 1040 | (b43legacy_phy_read(dev, |
1035 | (b43legacy_phy_read(dev, | 1041 | 0x04CC) & 0x00FF) | |
1036 | 0x04CC) & 0x00FF) | | 1042 | 0x1F00); |
1037 | 0x1F00); | ||
1038 | } | 1043 | } |
1039 | b43legacy_phy_write(dev, 0x047E, 0x0078); | 1044 | if (phy->rev >= 2) |
1045 | b43legacy_phy_write(dev, 0x047E, 0x0078); | ||
1040 | } | 1046 | } |
1041 | if (phy->radio_rev == 8) { | 1047 | if (phy->radio_rev == 8) { |
1042 | b43legacy_phy_write(dev, 0x0801, b43legacy_phy_read(dev, 0x0801) | 1048 | b43legacy_phy_write(dev, 0x0801, b43legacy_phy_read(dev, 0x0801) |
@@ -1078,7 +1084,7 @@ static void b43legacy_phy_initg(struct b43legacy_wldev *dev) | |||
1078 | else | 1084 | else |
1079 | b43legacy_phy_write(dev, 0x002F, 0x0202); | 1085 | b43legacy_phy_write(dev, 0x002F, 0x0202); |
1080 | } | 1086 | } |
1081 | if (phy->gmode || phy->rev >= 2) { | 1087 | if (phy->gmode) { |
1082 | b43legacy_phy_lo_adjust(dev, 0); | 1088 | b43legacy_phy_lo_adjust(dev, 0); |
1083 | b43legacy_phy_write(dev, 0x080F, 0x8078); | 1089 | b43legacy_phy_write(dev, 0x080F, 0x8078); |
1084 | } | 1090 | } |
diff --git a/drivers/net/wireless/b43legacy/rfkill.c b/drivers/net/wireless/b43legacy/rfkill.c index 476add97e974..b32bf6a94f19 100644 --- a/drivers/net/wireless/b43legacy/rfkill.c +++ b/drivers/net/wireless/b43legacy/rfkill.c | |||
@@ -44,23 +44,6 @@ static bool b43legacy_is_hw_radio_enabled(struct b43legacy_wldev *dev) | |||
44 | return 0; | 44 | return 0; |
45 | } | 45 | } |
46 | 46 | ||
47 | /* Update the rfkill state */ | ||
48 | static void b43legacy_rfkill_update_state(struct b43legacy_wldev *dev) | ||
49 | { | ||
50 | struct b43legacy_rfkill *rfk = &(dev->wl->rfkill); | ||
51 | |||
52 | if (!dev->radio_hw_enable) { | ||
53 | rfk->rfkill->state = RFKILL_STATE_HARD_BLOCKED; | ||
54 | return; | ||
55 | } | ||
56 | |||
57 | if (!dev->phy.radio_on) | ||
58 | rfk->rfkill->state = RFKILL_STATE_SOFT_BLOCKED; | ||
59 | else | ||
60 | rfk->rfkill->state = RFKILL_STATE_UNBLOCKED; | ||
61 | |||
62 | } | ||
63 | |||
64 | /* The poll callback for the hardware button. */ | 47 | /* The poll callback for the hardware button. */ |
65 | static void b43legacy_rfkill_poll(struct input_polled_dev *poll_dev) | 48 | static void b43legacy_rfkill_poll(struct input_polled_dev *poll_dev) |
66 | { | 49 | { |
@@ -78,7 +61,6 @@ static void b43legacy_rfkill_poll(struct input_polled_dev *poll_dev) | |||
78 | if (unlikely(enabled != dev->radio_hw_enable)) { | 61 | if (unlikely(enabled != dev->radio_hw_enable)) { |
79 | dev->radio_hw_enable = enabled; | 62 | dev->radio_hw_enable = enabled; |
80 | report_change = 1; | 63 | report_change = 1; |
81 | b43legacy_rfkill_update_state(dev); | ||
82 | b43legacyinfo(wl, "Radio hardware status changed to %s\n", | 64 | b43legacyinfo(wl, "Radio hardware status changed to %s\n", |
83 | enabled ? "ENABLED" : "DISABLED"); | 65 | enabled ? "ENABLED" : "DISABLED"); |
84 | } | 66 | } |
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c index 68e1f8c78727..65e833781608 100644 --- a/drivers/net/wireless/b43legacy/xmit.c +++ b/drivers/net/wireless/b43legacy/xmit.c | |||
@@ -193,7 +193,6 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
193 | { | 193 | { |
194 | const struct ieee80211_hdr *wlhdr; | 194 | const struct ieee80211_hdr *wlhdr; |
195 | int use_encryption = !!info->control.hw_key; | 195 | int use_encryption = !!info->control.hw_key; |
196 | u16 fctl; | ||
197 | u8 rate; | 196 | u8 rate; |
198 | struct ieee80211_rate *rate_fb; | 197 | struct ieee80211_rate *rate_fb; |
199 | int rate_ofdm; | 198 | int rate_ofdm; |
@@ -204,7 +203,6 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
204 | struct ieee80211_rate *tx_rate; | 203 | struct ieee80211_rate *tx_rate; |
205 | 204 | ||
206 | wlhdr = (const struct ieee80211_hdr *)fragment_data; | 205 | wlhdr = (const struct ieee80211_hdr *)fragment_data; |
207 | fctl = le16_to_cpu(wlhdr->frame_control); | ||
208 | 206 | ||
209 | memset(txhdr, 0, sizeof(*txhdr)); | 207 | memset(txhdr, 0, sizeof(*txhdr)); |
210 | 208 | ||
@@ -212,7 +210,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
212 | 210 | ||
213 | rate = tx_rate->hw_value; | 211 | rate = tx_rate->hw_value; |
214 | rate_ofdm = b43legacy_is_ofdm_rate(rate); | 212 | rate_ofdm = b43legacy_is_ofdm_rate(rate); |
215 | rate_fb = ieee80211_get_alt_retry_rate(dev->wl->hw, info) ? : tx_rate; | 213 | rate_fb = ieee80211_get_alt_retry_rate(dev->wl->hw, info, 0) ? : tx_rate; |
216 | rate_fb_ofdm = b43legacy_is_ofdm_rate(rate_fb->hw_value); | 214 | rate_fb_ofdm = b43legacy_is_ofdm_rate(rate_fb->hw_value); |
217 | 215 | ||
218 | txhdr->mac_frame_ctl = wlhdr->frame_control; | 216 | txhdr->mac_frame_ctl = wlhdr->frame_control; |
@@ -245,7 +243,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
245 | 243 | ||
246 | if (key->enabled) { | 244 | if (key->enabled) { |
247 | /* Hardware appends ICV. */ | 245 | /* Hardware appends ICV. */ |
248 | plcp_fragment_len += info->control.icv_len; | 246 | plcp_fragment_len += info->control.hw_key->icv_len; |
249 | 247 | ||
250 | key_idx = b43legacy_kidx_to_fw(dev, key_idx); | 248 | key_idx = b43legacy_kidx_to_fw(dev, key_idx); |
251 | mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) & | 249 | mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) & |
@@ -253,8 +251,8 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
253 | mac_ctl |= (key->algorithm << | 251 | mac_ctl |= (key->algorithm << |
254 | B43legacy_TX4_MAC_KEYALG_SHIFT) & | 252 | B43legacy_TX4_MAC_KEYALG_SHIFT) & |
255 | B43legacy_TX4_MAC_KEYALG; | 253 | B43legacy_TX4_MAC_KEYALG; |
256 | wlhdr_len = ieee80211_get_hdrlen(fctl); | 254 | wlhdr_len = ieee80211_hdrlen(wlhdr->frame_control); |
257 | iv_len = min((size_t)info->control.iv_len, | 255 | iv_len = min((size_t)info->control.hw_key->iv_len, |
258 | ARRAY_SIZE(txhdr->iv)); | 256 | ARRAY_SIZE(txhdr->iv)); |
259 | memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); | 257 | memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); |
260 | } else { | 258 | } else { |
@@ -626,7 +624,7 @@ void b43legacy_handle_hwtxstatus(struct b43legacy_wldev *dev, | |||
626 | tmp = hw->count; | 624 | tmp = hw->count; |
627 | status.frame_count = (tmp >> 4); | 625 | status.frame_count = (tmp >> 4); |
628 | status.rts_count = (tmp & 0x0F); | 626 | status.rts_count = (tmp & 0x0F); |
629 | tmp = hw->flags; | 627 | tmp = hw->flags << 1; |
630 | status.supp_reason = ((tmp & 0x1C) >> 2); | 628 | status.supp_reason = ((tmp & 0x1C) >> 2); |
631 | status.pm_indicated = !!(tmp & 0x80); | 629 | status.pm_indicated = !!(tmp & 0x80); |
632 | status.intermediate = !!(tmp & 0x40); | 630 | status.intermediate = !!(tmp & 0x40); |