nl80211: Implement noack policy for send_mlme

Signed-hostap: Helmut Schaa <helmut.schaa@googlemail.com>
This commit is contained in:
Helmut Schaa 2011-11-19 19:22:13 +02:00 committed by Jouni Malinen
parent 9dbf53fe35
commit fab2533604
2 changed files with 11 additions and 4 deletions

View file

@ -4158,7 +4158,7 @@ wpa_driver_nl80211_get_hw_feature_data(void *priv, u16 *num_modes, u16 *flags)
static int wpa_driver_nl80211_send_frame(struct wpa_driver_nl80211_data *drv, static int wpa_driver_nl80211_send_frame(struct wpa_driver_nl80211_data *drv,
const void *data, size_t len, const void *data, size_t len,
int encrypt) int encrypt, int noack)
{ {
__u8 rtap_hdr[] = { __u8 rtap_hdr[] = {
0x00, 0x00, /* radiotap version */ 0x00, 0x00, /* radiotap version */
@ -4189,6 +4189,7 @@ static int wpa_driver_nl80211_send_frame(struct wpa_driver_nl80211_data *drv,
.msg_flags = 0, .msg_flags = 0,
}; };
int res; int res;
u16 txflags = 0;
if (encrypt) if (encrypt)
rtap_hdr[8] |= IEEE80211_RADIOTAP_F_WEP; rtap_hdr[8] |= IEEE80211_RADIOTAP_F_WEP;
@ -4199,6 +4200,10 @@ static int wpa_driver_nl80211_send_frame(struct wpa_driver_nl80211_data *drv,
return -1; return -1;
} }
if (noack)
txflags |= IEEE80211_RADIOTAP_F_TX_NOACK;
*(le16 *) &rtap_hdr[12] = host_to_le16(txflags);
res = sendmsg(drv->monitor_sock, &msg, 0); res = sendmsg(drv->monitor_sock, &msg, 0);
if (res < 0) { if (res < 0) {
wpa_printf(MSG_INFO, "nl80211: sendmsg: %s", strerror(errno)); wpa_printf(MSG_INFO, "nl80211: sendmsg: %s", strerror(errno));
@ -4251,7 +4256,8 @@ static int wpa_driver_nl80211_send_mlme(void *priv, const u8 *data,
encrypt = 0; encrypt = 0;
} }
return wpa_driver_nl80211_send_frame(drv, data, data_len, encrypt); return wpa_driver_nl80211_send_frame(drv, data, data_len, encrypt,
noack);
} }
@ -5211,7 +5217,7 @@ static int wpa_driver_nl80211_hapd_send_eapol(
pos += 2; pos += 2;
memcpy(pos, data, data_len); memcpy(pos, data, data_len);
res = wpa_driver_nl80211_send_frame(drv, (u8 *) hdr, len, encrypt); res = wpa_driver_nl80211_send_frame(drv, (u8 *) hdr, len, encrypt, 0);
if (res < 0) { if (res < 0) {
wpa_printf(MSG_ERROR, "i802_send_eapol - packet len: %lu - " wpa_printf(MSG_ERROR, "i802_send_eapol - packet len: %lu - "
"failed: %d (%s)", "failed: %d (%s)",
@ -7300,7 +7306,7 @@ static int nl80211_send_frame(void *priv, const u8 *data, size_t data_len,
{ {
struct i802_bss *bss = priv; struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv; struct wpa_driver_nl80211_data *drv = bss->drv;
return wpa_driver_nl80211_send_frame(drv, data, data_len, encrypt); return wpa_driver_nl80211_send_frame(drv, data, data_len, encrypt, 0);
} }

View file

@ -238,5 +238,6 @@ enum ieee80211_radiotap_type {
* retries */ * retries */
#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */ #define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */
#define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */ #define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */
#define IEEE80211_RADIOTAP_F_TX_NOACK 0x0008 /* don't expect an ACK */
#endif /* IEEE80211_RADIOTAP_H */ #endif /* IEEE80211_RADIOTAP_H */