Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Stefanik Gábor" <netrolller.3d@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: "Johannes Berg" <johannes@sipsolutions.net>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: [RFC 2/3] mac80211: Make use of the new F_TX_NOACK and F_TX_NOSEQ Radiotap TX flags
Date: Fri, 12 Dec 2008 23:32:38 +0100	[thread overview]
Message-ID: <69e28c910812121432n6e84de41s94a887110051a1dd@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2551 bytes --]

Honor the 2 new flags in the "TX Flags" Radiotap field, introduced in
the previous commit.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>

---

Patch also available as an attachment in case Gmail decides to damage it.

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 155a204..141099a 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -143,6 +143,8 @@ typedef unsigned __bitwise__ ieee80211_tx_result;
 #define IEEE80211_TX_FRAGMENTED		BIT(0)
 #define IEEE80211_TX_UNICAST		BIT(1)
 #define IEEE80211_TX_PS_BUFFERED	BIT(2)
+#define IEEE80211_TX_MON_NO_SEQ		BIT(3)
+#define IEEE80211_TX_MON_NO_ACK		BIT(4)

 struct ieee80211_tx_data {
 	struct sk_buff *skb;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0855cac..d08a25e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -614,14 +614,12 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
 	 * number, if we have no matching interface then we
 	 * neither assign one ourselves nor ask the driver to.
 	 */
-	if (unlikely(!info->control.vif))
+	if (unlikely(!info->control.vif ||
+		     tx->flags & IEEE80211_TX_MON_NO_SEQ ||
+		     ieee80211_is_ctl(hdr->frame_control)) ||
+		     ieee80211_hdrlen(hdr->frame_control) < 24)
 		return TX_CONTINUE;

-	if (unlikely(ieee80211_is_ctl(hdr->frame_control)))
-		return TX_CONTINUE;
-
-	if (ieee80211_hdrlen(hdr->frame_control) < 24)
-		return TX_CONTINUE;

 	/*
 	 * Anything but QoS data that has a sequence number field
@@ -913,13 +911,17 @@ __ieee80211_parse_tx_radiotap(struct
ieee80211_tx_data *tx,
 			if (*iterator.this_arg & IEEE80211_RADIOTAP_F_FRAG)
 				tx->flags |= IEEE80211_TX_FRAGMENTED;
 			break;
-
+		case IEEE80211_RADIOTAP_TX_FLAGS:
+			if (*iterator.this_arg & IEEE80211_RADIOTAP_F_TX_NOACK)
+				tx->flags |= IEEE80211_TX_MON_NO_ACK;
+			if (*iterator.this_arg & IEEE80211_RADIOTAP_F_TX_NOSEQ)
+				tx->flags |= IEEE80211_TX_MON_NO_SEQ;
+			break;
 		/*
 		 * Please update the file
 		 * Documentation/networking/mac80211-injection.txt
 		 * when parsing new fields here.
 		 */
-
 		default:
 			break;
 		}
@@ -1000,6 +1002,9 @@ __ieee80211_tx_prepare(struct ieee80211_tx_data *tx,
 		info->flags &= ~IEEE80211_TX_CTL_NO_ACK;
 	}

+	if (tx->flags & IEEE80211_TX_MON_NO_ACK)
+		info->flags |= IEEE80211_TX_CTL_NO_ACK;
+
 	if (tx->flags & IEEE80211_TX_FRAGMENTED) {
 		if ((tx->flags & IEEE80211_TX_UNICAST) &&
 		    skb->len + FCS_LEN > local->fragmentation_threshold &&

[-- Attachment #2: 0002-mac80211-make-use-of-the-new-no-ack-and-no-seq-renumbering-tx-flags.patch --]
[-- Type: application/octet-stream, Size: 2250 bytes --]

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 155a204..141099a 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -143,6 +143,8 @@ typedef unsigned __bitwise__ ieee80211_tx_result;
 #define IEEE80211_TX_FRAGMENTED		BIT(0)
 #define IEEE80211_TX_UNICAST		BIT(1)
 #define IEEE80211_TX_PS_BUFFERED	BIT(2)
+#define IEEE80211_TX_MON_NO_SEQ		BIT(3)
+#define IEEE80211_TX_MON_NO_ACK		BIT(4)
 
 struct ieee80211_tx_data {
 	struct sk_buff *skb;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0855cac..d08a25e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -614,14 +614,12 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
 	 * number, if we have no matching interface then we
 	 * neither assign one ourselves nor ask the driver to.
 	 */
-	if (unlikely(!info->control.vif))
+	if (unlikely(!info->control.vif ||
+		     tx->flags & IEEE80211_TX_MON_NO_SEQ ||
+		     ieee80211_is_ctl(hdr->frame_control)) ||
+		     ieee80211_hdrlen(hdr->frame_control) < 24)
 		return TX_CONTINUE;
 
-	if (unlikely(ieee80211_is_ctl(hdr->frame_control)))
-		return TX_CONTINUE;
-
-	if (ieee80211_hdrlen(hdr->frame_control) < 24)
-		return TX_CONTINUE;
 
 	/*
 	 * Anything but QoS data that has a sequence number field
@@ -913,13 +911,17 @@ __ieee80211_parse_tx_radiotap(struct ieee80211_tx_data *tx,
 			if (*iterator.this_arg & IEEE80211_RADIOTAP_F_FRAG)
 				tx->flags |= IEEE80211_TX_FRAGMENTED;
 			break;
-
+		case IEEE80211_RADIOTAP_TX_FLAGS:
+			if (*iterator.this_arg & IEEE80211_RADIOTAP_F_TX_NOACK)
+				tx->flags |= IEEE80211_TX_MON_NO_ACK;
+			if (*iterator.this_arg & IEEE80211_RADIOTAP_F_TX_NOSEQ)
+				tx->flags |= IEEE80211_TX_MON_NO_SEQ;
+			break;
 		/*
 		 * Please update the file
 		 * Documentation/networking/mac80211-injection.txt
 		 * when parsing new fields here.
 		 */
-
 		default:
 			break;
 		}
@@ -1000,6 +1002,9 @@ __ieee80211_tx_prepare(struct ieee80211_tx_data *tx,
 		info->flags &= ~IEEE80211_TX_CTL_NO_ACK;
 	}
 
+	if (tx->flags & IEEE80211_TX_MON_NO_ACK)
+		info->flags |= IEEE80211_TX_CTL_NO_ACK;
+
 	if (tx->flags & IEEE80211_TX_FRAGMENTED) {
 		if ((tx->flags & IEEE80211_TX_UNICAST) &&
 		    skb->len + FCS_LEN > local->fragmentation_threshold &&

             reply	other threads:[~2008-12-12 22:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-12 22:32 Stefanik Gábor [this message]
2008-12-12 22:39 ` [RFC 2/3] mac80211: Make use of the new F_TX_NOACK and F_TX_NOSEQ Radiotap TX flags Johannes Berg
2008-12-12 22:43   ` Stefanik Gábor
2008-12-12 22:45     ` Johannes Berg
2008-12-12 22:51       ` Stefanik Gábor
2008-12-12 22:52         ` Johannes Berg
2008-12-12 23:00           ` Stefanik Gábor
2008-12-12 23:01             ` Johannes Berg
2008-12-12 22:56         ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69e28c910812121432n6e84de41s94a887110051a1dd@mail.gmail.com \
    --to=netrolller.3d@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox