P2P: Send Listen state Probe Response frames without retries
authorJouni Malinen <j@w1.fi>
Sat, 19 Nov 2011 17:15:10 +0000 (19:15 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 19 Nov 2011 17:15:10 +0000 (19:15 +0200)
Use the no-ACK send_mlme request to transmit Probe Response frames
in P2P Listen state. This reduces number of unnecessary transmissions
if the peer device has already moved away from the channel. It will most
likely go through Search state multiple times anyway, so even if the
response were to be lost, a new retry will happen at higher layer.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/driver_i.h
wpa_supplicant/p2p_supplicant.c

index 847bf80..8b584db 100644 (file)
@@ -262,11 +262,11 @@ static inline int wpa_drv_set_country(struct wpa_supplicant *wpa_s,
 }
 
 static inline int wpa_drv_send_mlme(struct wpa_supplicant *wpa_s,
-                                   const u8 *data, size_t data_len)
+                                   const u8 *data, size_t data_len, int noack)
 {
        if (wpa_s->driver->send_mlme)
                return wpa_s->driver->send_mlme(wpa_s->drv_priv,
-                                               data, data_len, 0);
+                                               data, data_len, noack);
        return -1;
 }
 
index 9cb385f..c6484af 100644 (file)
@@ -1045,7 +1045,7 @@ static void wpas_stop_listen(void *ctx)
 static int wpas_send_probe_resp(void *ctx, const struct wpabuf *buf)
 {
        struct wpa_supplicant *wpa_s = ctx;
-       return wpa_drv_send_mlme(wpa_s, wpabuf_head(buf), wpabuf_len(buf));
+       return wpa_drv_send_mlme(wpa_s, wpabuf_head(buf), wpabuf_len(buf), 1);
 }