forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mac80211: Call mgd_prep_tx before transmitting deauthentication
In multi channel scenarios, when disassociating from the AP before a beacon was heard from the AP, it is not guaranteed that the virtual interface is granted air time for the transmission of the deauthentication frame. This in turn can lead to various issues as the AP might never get the deauthentication frame. To mitigate such possible issues, add a HW flag indicating that the driver requires mac80211 to call the mgd_prep_tx() driver callback to make sure that the virtual interface is granted immediate airtime to be able to transmit the frame, in case that no beacon was heard from the AP. Signed-off-by: Ilan Peer <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
- Loading branch information
1 parent
a1f2ba0
commit 94ba927
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
* Copyright 2007-2010 Johannes Berg <[email protected]> | ||
* Copyright 2013-2014 Intel Mobile Communications GmbH | ||
* Copyright (C) 2015 - 2017 Intel Deutschland GmbH | ||
* Copyright (C) 2018 Intel Corporation | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
|
@@ -2069,6 +2070,14 @@ struct ieee80211_txq { | |
* @IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA: Hardware supports buffer STA on | ||
* TDLS links. | ||
* | ||
* @IEEE80211_HW_DEAUTH_NEED_MGD_TX_PREP: The driver requires the | ||
* mgd_prepare_tx() callback to be called before transmission of a | ||
* deauthentication frame in case the association was completed but no | ||
* beacon was heard. This is required in multi-channel scenarios, where the | ||
* virtual interface might not be given air time for the transmission of | ||
* the frame, as it is not synced with the AP/P2P GO yet, and thus the | ||
* deauthentication frame might not be transmitted. | ||
* | ||
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays | ||
*/ | ||
enum ieee80211_hw_flags { | ||
|
@@ -2112,6 +2121,7 @@ enum ieee80211_hw_flags { | |
IEEE80211_HW_REPORTS_LOW_ACK, | ||
IEEE80211_HW_SUPPORTS_TX_FRAG, | ||
IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA, | ||
IEEE80211_HW_DEAUTH_NEED_MGD_TX_PREP, | ||
|
||
/* keep last, obviously */ | ||
NUM_IEEE80211_HW_FLAGS | ||
|
@@ -3356,6 +3366,9 @@ enum ieee80211_reconfig_type { | |
* management frame prior to having successfully associated to allow the | ||
* driver to give it channel time for the transmission, to get a response | ||
* and to be able to synchronize with the GO. | ||
* For drivers that set %IEEE80211_HW_DEAUTH_NEED_MGD_TX_PREP, mac80211 | ||
* would also call this function before transmitting a deauthentication | ||
* frame in case that no beacon was heard from the AP/P2P GO. | ||
* The callback will be called before each transmission and upon return | ||
* mac80211 will transmit the frame right away. | ||
* The callback is optional and can (should!) sleep. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
* Copyright 2007, Michael Wu <[email protected]> | ||
* Copyright 2013-2014 Intel Mobile Communications GmbH | ||
* Copyright (C) 2015 - 2017 Intel Deutschland GmbH | ||
* Copyright (C) 2018 Intel Corporation | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
|
@@ -2008,9 +2009,22 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |
ieee80211_flush_queues(local, sdata, true); | ||
|
||
/* deauthenticate/disassociate now */ | ||
if (tx || frame_buf) | ||
if (tx || frame_buf) { | ||
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | ||
|
||
/* | ||
* In multi channel scenarios guarantee that the virtual | ||
* interface is granted immediate airtime to transmit the | ||
* deauthentication frame by calling mgd_prepare_tx, if the | ||
* driver requested so. | ||
*/ | ||
if (ieee80211_hw_check(&local->hw, DEAUTH_NEED_MGD_TX_PREP) && | ||
!ifmgd->have_beacon) | ||
drv_mgd_prepare_tx(sdata->local, sdata); | ||
|
||
ieee80211_send_deauth_disassoc(sdata, ifmgd->bssid, stype, | ||
reason, tx, frame_buf); | ||
} | ||
|
||
/* flush out frame - make sure the deauth was actually sent */ | ||
if (tx) | ||
|