diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index e2d6edd2fcd2..884f82b63219 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -1333,14 +1333,6 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) | |||
1333 | wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", | 1333 | wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)", |
1334 | wl->chip.id); | 1334 | wl->chip.id); |
1335 | 1335 | ||
1336 | /* | ||
1337 | * 'end-of-transaction flag' and 'LPD mode flag' | ||
1338 | * should be set in wl127x AP mode only | ||
1339 | */ | ||
1340 | if (wl->bss_type == BSS_TYPE_AP_BSS) | ||
1341 | wl->quirks |= (WL12XX_QUIRK_END_OF_TRANSACTION | | ||
1342 | WL12XX_QUIRK_LPD_MODE); | ||
1343 | |||
1344 | ret = wl1271_setup(wl); | 1336 | ret = wl1271_setup(wl); |
1345 | if (ret < 0) | 1337 | if (ret < 0) |
1346 | goto out; | 1338 | goto out; |
@@ -2222,6 +2214,11 @@ static int wl1271_unjoin(struct wl1271 *wl) | |||
2222 | { | 2214 | { |
2223 | int ret; | 2215 | int ret; |
2224 | 2216 | ||
2217 | if (test_and_clear_bit(WL1271_FLAG_CS_PROGRESS, &wl->flags)) { | ||
2218 | wl12xx_cmd_stop_channel_switch(wl); | ||
2219 | ieee80211_chswitch_done(wl->vif, false); | ||
2220 | } | ||
2221 | |||
2225 | /* to stop listening to a channel, we disconnect */ | 2222 | /* to stop listening to a channel, we disconnect */ |
2226 | ret = wl12xx_cmd_role_stop_sta(wl); | 2223 | ret = wl12xx_cmd_role_stop_sta(wl); |
2227 | if (ret < 0) | 2224 | if (ret < 0) |
@@ -4130,6 +4127,37 @@ static int wl12xx_set_bitrate_mask(struct ieee80211_hw *hw, | |||
4130 | return 0; | 4127 | return 0; |
4131 | } | 4128 | } |
4132 | 4129 | ||
4130 | static void wl12xx_op_channel_switch(struct ieee80211_hw *hw, | ||
4131 | struct ieee80211_channel_switch *ch_switch) | ||
4132 | { | ||
4133 | struct wl1271 *wl = hw->priv; | ||
4134 | int ret; | ||
4135 | |||
4136 | wl1271_debug(DEBUG_MAC80211, "mac80211 channel switch"); | ||
4137 | |||
4138 | mutex_lock(&wl->mutex); | ||
4139 | |||
4140 | if (unlikely(wl->state == WL1271_STATE_OFF)) { | ||
4141 | mutex_unlock(&wl->mutex); | ||
4142 | ieee80211_chswitch_done(wl->vif, false); | ||
4143 | return; | ||
4144 | } | ||
4145 | |||
4146 | ret = wl1271_ps_elp_wakeup(wl); | ||
4147 | if (ret < 0) | ||
4148 | goto out; | ||
4149 | |||
4150 | ret = wl12xx_cmd_channel_switch(wl, ch_switch); | ||
4151 | |||
4152 | if (!ret) | ||
4153 | set_bit(WL1271_FLAG_CS_PROGRESS, &wl->flags); | ||
4154 | |||
4155 | wl1271_ps_elp_sleep(wl); | ||
4156 | |||
4157 | out: | ||
4158 | mutex_unlock(&wl->mutex); | ||
4159 | } | ||
4160 | |||
4133 | static bool wl1271_tx_frames_pending(struct ieee80211_hw *hw) | 4161 | static bool wl1271_tx_frames_pending(struct ieee80211_hw *hw) |
4134 | { | 4162 | { |
4135 | struct wl1271 *wl = hw->priv; | 4163 | struct wl1271 *wl = hw->priv; |
@@ -4406,6 +4434,7 @@ static const struct ieee80211_ops wl1271_ops = { | |||
4406 | .ampdu_action = wl1271_op_ampdu_action, | 4434 | .ampdu_action = wl1271_op_ampdu_action, |
4407 | .tx_frames_pending = wl1271_tx_frames_pending, | 4435 | .tx_frames_pending = wl1271_tx_frames_pending, |
4408 | .set_bitrate_mask = wl12xx_set_bitrate_mask, | 4436 | .set_bitrate_mask = wl12xx_set_bitrate_mask, |
4437 | .channel_switch = wl12xx_op_channel_switch, | ||
4409 | CFG80211_TESTMODE_CMD(wl1271_tm_cmd) | 4438 | CFG80211_TESTMODE_CMD(wl1271_tm_cmd) |
4410 | }; | 4439 | }; |
4411 | 4440 | ||
@@ -4679,6 +4708,9 @@ int wl1271_init_ieee80211(struct wl1271 *wl) | |||
4679 | wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_DFLT_SIZE - | 4708 | wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_DFLT_SIZE - |
4680 | sizeof(struct ieee80211_header); | 4709 | sizeof(struct ieee80211_header); |
4681 | 4710 | ||
4711 | wl->hw->wiphy->max_sched_scan_ie_len = WL1271_CMD_TEMPL_DFLT_SIZE - | ||
4712 | sizeof(struct ieee80211_header); | ||
4713 | |||
4682 | wl->hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; | 4714 | wl->hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; |
4683 | 4715 | ||
4684 | /* make sure all our channels fit in the scanned_ch bitmask */ | 4716 | /* make sure all our channels fit in the scanned_ch bitmask */ |