summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2018-04-20 06:49:25 -0400
committerJohannes Berg <johannes.berg@intel.com>2018-05-23 05:06:10 -0400
commitd4e36e5554eb92f3ec7fedad3efb602570584df4 (patch)
treeaeae9acd7293f9fd07778f1a68ac39d8b000e33b /net/mac80211/mlme.c
parentdd8070bff204a67fcb6585f18047841a895b68d7 (diff)
mac80211: Support adding duration for prepare_tx() callback
There are specific cases, such as SAE authentication exchange, that might require long duration to complete. For such cases, add support for indicating to the driver the required duration of the prepare_tx() operation, so the driver would still be able to complete the frame exchange. Currently, indicate the duration only for SAE authentication exchange, as SAE authentication can take up to 2000 msec (as defined in IEEE P802.11-REVmd D1.0 p. 3504). As the patch modified the prepare_tx() callback API, also modify the relevant code in iwlwifi. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 233068756502..a59187c016e0 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -864,7 +864,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
864 return; 864 return;
865 } 865 }
866 866
867 drv_mgd_prepare_tx(local, sdata); 867 drv_mgd_prepare_tx(local, sdata, 0);
868 868
869 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; 869 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
870 if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) 870 if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS))
@@ -2022,7 +2022,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
2022 */ 2022 */
2023 if (ieee80211_hw_check(&local->hw, DEAUTH_NEED_MGD_TX_PREP) && 2023 if (ieee80211_hw_check(&local->hw, DEAUTH_NEED_MGD_TX_PREP) &&
2024 !ifmgd->have_beacon) 2024 !ifmgd->have_beacon)
2025 drv_mgd_prepare_tx(sdata->local, sdata); 2025 drv_mgd_prepare_tx(sdata->local, sdata, 0);
2026 2026
2027 ieee80211_send_deauth_disassoc(sdata, ifmgd->bssid, stype, 2027 ieee80211_send_deauth_disassoc(sdata, ifmgd->bssid, stype,
2028 reason, tx, frame_buf); 2028 reason, tx, frame_buf);
@@ -2560,7 +2560,7 @@ static void ieee80211_auth_challenge(struct ieee80211_sub_if_data *sdata,
2560 if (!elems.challenge) 2560 if (!elems.challenge)
2561 return; 2561 return;
2562 auth_data->expected_transaction = 4; 2562 auth_data->expected_transaction = 4;
2563 drv_mgd_prepare_tx(sdata->local, sdata); 2563 drv_mgd_prepare_tx(sdata->local, sdata, 0);
2564 if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) 2564 if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS))
2565 tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | 2565 tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS |
2566 IEEE80211_TX_INTFL_MLME_CONN_TX; 2566 IEEE80211_TX_INTFL_MLME_CONN_TX;
@@ -3769,6 +3769,7 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata)
3769 u32 tx_flags = 0; 3769 u32 tx_flags = 0;
3770 u16 trans = 1; 3770 u16 trans = 1;
3771 u16 status = 0; 3771 u16 status = 0;
3772 u16 prepare_tx_duration = 0;
3772 3773
3773 sdata_assert_lock(sdata); 3774 sdata_assert_lock(sdata);
3774 3775
@@ -3790,7 +3791,11 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata)
3790 return -ETIMEDOUT; 3791 return -ETIMEDOUT;
3791 } 3792 }
3792 3793
3793 drv_mgd_prepare_tx(local, sdata); 3794 if (auth_data->algorithm == WLAN_AUTH_SAE)
3795 prepare_tx_duration =
3796 jiffies_to_msecs(IEEE80211_AUTH_TIMEOUT_SAE);
3797
3798 drv_mgd_prepare_tx(local, sdata, prepare_tx_duration);
3794 3799
3795 sdata_info(sdata, "send auth to %pM (try %d/%d)\n", 3800 sdata_info(sdata, "send auth to %pM (try %d/%d)\n",
3796 auth_data->bss->bssid, auth_data->tries, 3801 auth_data->bss->bssid, auth_data->tries,
@@ -4994,7 +4999,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
4994 req->bssid, req->reason_code, 4999 req->bssid, req->reason_code,
4995 ieee80211_get_reason_code_string(req->reason_code)); 5000 ieee80211_get_reason_code_string(req->reason_code));
4996 5001
4997 drv_mgd_prepare_tx(sdata->local, sdata); 5002 drv_mgd_prepare_tx(sdata->local, sdata, 0);
4998 ieee80211_send_deauth_disassoc(sdata, req->bssid, 5003 ieee80211_send_deauth_disassoc(sdata, req->bssid,
4999 IEEE80211_STYPE_DEAUTH, 5004 IEEE80211_STYPE_DEAUTH,
5000 req->reason_code, tx, 5005 req->reason_code, tx,
@@ -5014,7 +5019,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
5014 req->bssid, req->reason_code, 5019 req->bssid, req->reason_code,
5015 ieee80211_get_reason_code_string(req->reason_code)); 5020 ieee80211_get_reason_code_string(req->reason_code));
5016 5021
5017 drv_mgd_prepare_tx(sdata->local, sdata); 5022 drv_mgd_prepare_tx(sdata->local, sdata, 0);
5018 ieee80211_send_deauth_disassoc(sdata, req->bssid, 5023 ieee80211_send_deauth_disassoc(sdata, req->bssid,
5019 IEEE80211_STYPE_DEAUTH, 5024 IEEE80211_STYPE_DEAUTH,
5020 req->reason_code, tx, 5025 req->reason_code, tx,