Allow MLME frames to be sent without expecting an ACK (no retries)
In some situations it might be benefical to send a unicast frame without the need for getting it ACKed (probe responses for example). In order to achieve this add a new noack parameter to the drivers send_mlme callback that can be used to advise the driver to not wait for an ACK for this frame. Signed-hostap: Helmut Schaa <helmut.schaa@googlemail.com>
This commit is contained in:
parent
3f56f3a496
commit
8cfa3527e1
13 changed files with 30 additions and 27 deletions
|
@ -573,11 +573,11 @@ int hostapd_drv_set_key(const char *ifname, struct hostapd_data *hapd,
|
|||
|
||||
|
||||
int hostapd_drv_send_mlme(struct hostapd_data *hapd,
|
||||
const void *msg, size_t len)
|
||||
const void *msg, size_t len, int noack)
|
||||
{
|
||||
if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
|
||||
return 0;
|
||||
return hapd->driver->send_mlme(hapd->drv_priv, msg, len);
|
||||
return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ int hostapd_drv_set_key(const char *ifname,
|
|||
const u8 *seq, size_t seq_len,
|
||||
const u8 *key, size_t key_len);
|
||||
int hostapd_drv_send_mlme(struct hostapd_data *hapd,
|
||||
const void *msg, size_t len);
|
||||
const void *msg, size_t len, int noack);
|
||||
int hostapd_drv_sta_deauth(struct hostapd_data *hapd,
|
||||
const u8 *addr, int reason);
|
||||
int hostapd_drv_sta_disassoc(struct hostapd_data *hapd,
|
||||
|
|
|
@ -407,7 +407,7 @@ void handle_probe_req(struct hostapd_data *hapd,
|
|||
pos = hostapd_eid_p2p_manage(hapd, pos);
|
||||
#endif /* CONFIG_P2P_MANAGER */
|
||||
|
||||
if (hostapd_drv_send_mlme(hapd, resp, pos - (u8 *) resp) < 0)
|
||||
if (hostapd_drv_send_mlme(hapd, resp, pos - (u8 *) resp, 0) < 0)
|
||||
perror("handle_probe_req: send");
|
||||
|
||||
os_free(resp);
|
||||
|
|
|
@ -269,7 +269,7 @@ static void send_auth_reply(struct hostapd_data *hapd,
|
|||
" auth_alg=%d auth_transaction=%d resp=%d (IE len=%lu)",
|
||||
MAC2STR(dst), auth_alg, auth_transaction,
|
||||
resp, (unsigned long) ies_len);
|
||||
if (hostapd_drv_send_mlme(hapd, reply, rlen) < 0)
|
||||
if (hostapd_drv_send_mlme(hapd, reply, rlen, 0) < 0)
|
||||
perror("send_auth_reply: send");
|
||||
|
||||
os_free(buf);
|
||||
|
@ -805,7 +805,7 @@ static void send_deauth(struct hostapd_data *hapd, const u8 *addr,
|
|||
send_len = IEEE80211_HDRLEN + sizeof(reply.u.deauth);
|
||||
reply.u.deauth.reason_code = host_to_le16(reason_code);
|
||||
|
||||
if (hostapd_drv_send_mlme(hapd, &reply, send_len) < 0)
|
||||
if (hostapd_drv_send_mlme(hapd, &reply, send_len, 0) < 0)
|
||||
wpa_printf(MSG_INFO, "Failed to send deauth: %s",
|
||||
strerror(errno));
|
||||
}
|
||||
|
@ -910,7 +910,7 @@ static void send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta,
|
|||
|
||||
send_len += p - reply->u.assoc_resp.variable;
|
||||
|
||||
if (hostapd_drv_send_mlme(hapd, reply, send_len) < 0)
|
||||
if (hostapd_drv_send_mlme(hapd, reply, send_len, 0) < 0)
|
||||
wpa_printf(MSG_INFO, "Failed to send assoc resp: %s",
|
||||
strerror(errno));
|
||||
}
|
||||
|
@ -1322,7 +1322,7 @@ static void handle_action(struct hostapd_data *hapd,
|
|||
os_memcpy(resp->bssid, hapd->own_addr, ETH_ALEN);
|
||||
resp->u.action.category |= 0x80;
|
||||
|
||||
hostapd_drv_send_mlme(hapd, resp, len);
|
||||
hostapd_drv_send_mlme(hapd, resp, len, 0);
|
||||
os_free(resp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ void ieee802_11_send_sa_query_req(struct hostapd_data *hapd,
|
|||
os_memcpy(mgmt.u.action.u.sa_query_req.trans_id, trans_id,
|
||||
WLAN_SA_QUERY_TR_ID_LEN);
|
||||
end = mgmt.u.action.u.sa_query_req.trans_id + WLAN_SA_QUERY_TR_ID_LEN;
|
||||
if (hostapd_drv_send_mlme(hapd, &mgmt, end - (u8 *) &mgmt) < 0)
|
||||
if (hostapd_drv_send_mlme(hapd, &mgmt, end - (u8 *) &mgmt, 0) < 0)
|
||||
perror("ieee802_11_send_sa_query_req: send");
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ static void ieee802_11_send_sa_query_resp(struct hostapd_data *hapd,
|
|||
os_memcpy(resp.u.action.u.sa_query_req.trans_id, trans_id,
|
||||
WLAN_SA_QUERY_TR_ID_LEN);
|
||||
end = resp.u.action.u.sa_query_req.trans_id + WLAN_SA_QUERY_TR_ID_LEN;
|
||||
if (hostapd_drv_send_mlme(hapd, &resp, end - (u8 *) &resp) < 0)
|
||||
if (hostapd_drv_send_mlme(hapd, &resp, end - (u8 *) &resp, 0) < 0)
|
||||
perror("ieee80211_mgmt_sa_query_request: send");
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ static void wmm_send_action(struct hostapd_data *hapd, const u8 *addr,
|
|||
os_memcpy(t, tspec, sizeof(struct wmm_tspec_element));
|
||||
len = ((u8 *) (t + 1)) - buf;
|
||||
|
||||
if (hostapd_drv_send_mlme(hapd, m, len) < 0)
|
||||
if (hostapd_drv_send_mlme(hapd, m, len, 0) < 0)
|
||||
perror("wmm_send_action: send");
|
||||
}
|
||||
|
||||
|
|
|
@ -416,7 +416,7 @@ static int hostapd_wpa_auth_send_ft_action(void *ctx, const u8 *dst,
|
|||
os_memcpy(m->bssid, hapd->own_addr, ETH_ALEN);
|
||||
os_memcpy(&m->u, data, data_len);
|
||||
|
||||
res = hostapd_drv_send_mlme(hapd, (u8 *) m, mlen);
|
||||
res = hostapd_drv_send_mlme(hapd, (u8 *) m, mlen, 0);
|
||||
os_free(m);
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue