From: Ben Greear <greearb@xxxxxxxxxxxxxxx> In some cases, one might wish to have more retries before giving up on auth. For instance, ath10k 9984 radios take about 270ms to (re)calibrate when moving channels, and auth will not go out during that calibration period. I think that might be part of the issue I see with roaming stations on that radio. Signed-off-by: Ben Greear <greearb@xxxxxxxxxxxxxxx> --- net/mac80211/mlme.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 6a458aac331d..64336433925d 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -35,13 +35,17 @@ #define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2) #define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10) #define IEEE80211_AUTH_TIMEOUT_SAE (HZ * 2) -#define IEEE80211_AUTH_MAX_TRIES 3 #define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5) #define IEEE80211_ASSOC_TIMEOUT (HZ / 5) #define IEEE80211_ASSOC_TIMEOUT_LONG (HZ / 2) #define IEEE80211_ASSOC_TIMEOUT_SHORT (HZ / 10) #define IEEE80211_ASSOC_MAX_TRIES 3 +static int max_auth_tries = 3; +module_param(max_auth_tries, int, 0644); +MODULE_PARM_DESC(max_auth_tries, + "Maximum auth tries before giving up (default is 3)."); + static int max_nullfunc_tries = 2; module_param(max_nullfunc_tries, int, 0644); MODULE_PARM_DESC(max_nullfunc_tries, @@ -4189,9 +4193,9 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) auth_data->tries++; - if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { - sdata_info(sdata, "authentication with %pM timed out\n", - auth_data->bss->bssid); + if (auth_data->tries > max_auth_tries) { + sdata_info(sdata, "authentication with %pM timed out after %d tries\n", + auth_data->bss->bssid, max_auth_tries); /* * Most likely AP is not in the range so remove the @@ -4210,7 +4214,7 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) sdata_info(sdata, "send auth to %pM (try %d/%d)\n", auth_data->bss->bssid, auth_data->tries, - IEEE80211_AUTH_MAX_TRIES); + max_auth_tries); auth_data->expected_transaction = 2; -- 2.20.1