patch for the linux kernel 4.13-rc3 IEEE80211_TX_CTL_REQ_TX_STATUS IEEE80211_TX_INTFL_MLME_CONN_TX

From: tibaldiamos
Date: Wed Aug 02 2017 - 19:04:39 EST


tibaldi@debian910:~/Desktop/linux-4.13-rc3/net/mac80211$ file mlme.c
mlme.c: C source, ASCII text
tibaldi@debian910:~/Desktop/linux-4.13-rc3/net/mac80211$

my proposed patch for the 4.13-rc3 kernel is the following - Amos Tibaldi www.amostibaldi.it

static int ieee80211_auth(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_local *local = sdata->local;
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
struct ieee80211_mgd_auth_data *auth_data = ifmgd->auth_data;
u32 tx_flags = 0;
u16 trans = 1;
u16 status = 0;

sdata_assert_lock(sdata);

if (WARN_ON_ONCE(!auth_data))
return -EINVAL;

auth_data->tries++;

if(auth_data->tries > IEEE80211_AUTH_MAX_TRIES) {
sdata_info(sdata, "authentication with %pM timed out\n",
auth_data->bss->bssid);
/*
* Most likely AP is not in the range so remove the
* bss struct for that AP.
*/
cfg80211_unlink_bss(local->hw.wiphy, auth_data->bss);

return -ETIMEDOUT;
}

drv_mgd_prepare_tx(local, sdata);

sdata_info(sdata, "send auth to %pM (try %d/%d)\n",
auth_data->bss->bssid, auth_data->tries,
IEEE80211_AUTH_MAX_TRIES);

auth_data->expected_transaction = 2;

if (auth_data->algorithm == WLAN_AUTH_SAE) {
trans = auth_data->sae_trans;
status = auth_data->sae_status;
auth_data->expected_transaction = trans;
}

if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS))
tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | (IEEE80211_TX_INTFL_MLME_CONN_TX &&
(!(IEEE80211_TX_CTL_REQ_TX_STATUS)));

ieee80211_send_auth(sdata, trans, auth_data->algorithm, status,
auth_data->data, auth_data->data_len,
auth_data->bss->bssid,
auth_data->bss->bssid, NULL, 0, 0,
tx_flags);

if (tx_flags == 0) {
auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
auth_data->timeout_started = true;
run_again(sdata, auth_data->timeout);
} else {
auth_data->timeout =
round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG);
auth_data->timeout_started = true;
run_again(sdata, auth_data->timeout);
}

return 0;
}

static int ieee80211_do_assoc(struct ieee80211_sub_if_data *sdata)
{