From patchwork Thu Nov 10 15:21:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 124905 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 6BC671007D1 for ; Fri, 11 Nov 2011 02:22:12 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A8C0917C010; Thu, 10 Nov 2011 10:22:05 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EYIDdKBq1TEs; Thu, 10 Nov 2011 10:22:05 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B026717C024; Thu, 10 Nov 2011 10:21:41 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B32FF17C024 for ; Thu, 10 Nov 2011 10:21:40 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i9p5OVobA4II for ; Thu, 10 Nov 2011 10:21:36 -0500 (EST) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 8AB0B17C010 for ; Thu, 10 Nov 2011 10:21:26 -0500 (EST) Received: by mail-fx0-f44.google.com with SMTP id s12so4787016faa.17 for ; Thu, 10 Nov 2011 07:21:26 -0800 (PST) Received: by 10.223.58.8 with SMTP id e8mr12575245fah.27.1320938486156; Thu, 10 Nov 2011 07:21:26 -0800 (PST) Received: from localhost.localdomain (port-92-198-130-130.static.qsc.de. [92.198.130.130]) by mx.google.com with ESMTPS id y2sm11443907fag.12.2011.11.10.07.21.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Nov 2011 07:21:25 -0800 (PST) From: Helmut Schaa To: hostap@lists.shmoo.com Subject: [PATCH 3/3] Implement noack policy in nl80211 Date: Thu, 10 Nov 2011 16:21:21 +0100 Message-Id: <1320938481-23936-3-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1320938481-23936-2-git-send-email-helmut.schaa@googlemail.com> References: <1320938481-23936-1-git-send-email-helmut.schaa@googlemail.com> <1320938481-23936-2-git-send-email-helmut.schaa@googlemail.com> X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Signed-hostap: Helmut Schaa --- src/drivers/driver_nl80211.c | 14 ++++++++++---- src/utils/radiotap.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 4c806c5..84abfb8 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4152,7 +4152,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, const void *data, size_t len, - int encrypt) + int encrypt, int noack) { __u8 rtap_hdr[] = { 0x00, 0x00, /* radiotap version */ @@ -4183,6 +4183,7 @@ static int wpa_driver_nl80211_send_frame(struct wpa_driver_nl80211_data *drv, .msg_flags = 0, }; int res; + u16 txflags = 0; if (encrypt) rtap_hdr[8] |= IEEE80211_RADIOTAP_F_WEP; @@ -4193,6 +4194,10 @@ static int wpa_driver_nl80211_send_frame(struct wpa_driver_nl80211_data *drv, 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); if (res < 0) { wpa_printf(MSG_INFO, "nl80211: sendmsg: %s", strerror(errno)); @@ -4245,7 +4250,8 @@ static int wpa_driver_nl80211_send_mlme(void *priv, const u8 *data, 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); } @@ -5188,7 +5194,7 @@ static int wpa_driver_nl80211_hapd_send_eapol( pos += 2; 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) { wpa_printf(MSG_ERROR, "i802_send_eapol - packet len: %lu - " "failed: %d (%s)", @@ -7237,7 +7243,7 @@ static int nl80211_send_frame(void *priv, const u8 *data, size_t data_len, { struct i802_bss *bss = priv; 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); } diff --git a/src/utils/radiotap.h b/src/utils/radiotap.h index 508264c..137288f 100644 --- a/src/utils/radiotap.h +++ b/src/utils/radiotap.h @@ -238,5 +238,6 @@ enum ieee80211_radiotap_type { * retries */ #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_NOACK 0x0008 /* don't expect an ACK */ #endif /* IEEE80211_RADIOTAP_H */