2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 14:43:58 +08:00

wl1251: fix channel switching in monitor mode

Use the ENABLE_RX command for channel switching when no interface is present
(monitor mode only).
The advantage of ENABLE_RX is that it leaves the tx data path disabled in
firmware, whereas the usual JOIN command seems to transmit some frames at
firmware level.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
David Gnedt 2014-01-07 13:09:42 +01:00 committed by John W. Linville
parent dd4a560f0a
commit ed3213c913

View File

@ -615,8 +615,19 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
if (channel != wl->channel) {
wl->channel = channel;
ret = wl1251_join(wl, wl->bss_type, wl->channel,
wl->beacon_int, wl->dtim_period);
/*
* Use ENABLE_RX command for channel switching when no
* interface is present (monitor mode only).
* This leaves the tx path disabled in firmware, whereas
* the usual JOIN command seems to transmit some frames
* at firmware level.
*/
if (wl->vif == NULL) {
ret = wl1251_cmd_data_path_rx(wl, wl->channel, 1);
} else {
ret = wl1251_join(wl, wl->bss_type, wl->channel,
wl->beacon_int, wl->dtim_period);
}
if (ret < 0)
goto out_sleep;
}