netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@suse.cz>
To: NetDev <netdev@oss.sgi.com>
Cc: LKML <linux-kernel@vger.kernel.org>, jgarzik@pobox.com, pavel@suse.cz
Subject: [5/5] ieee80211: add sequence numbers
Date: Tue, 24 May 2005 15:13:41 +0200	[thread overview]
Message-ID: <20050524151341.612245e8@griffin.suse.cz> (raw)
In-Reply-To: <20050524150711.01632672@griffin.suse.cz>

Adds sequence numbers to IEEE 802.11 headers.


Signed-off-by: Jiri Benc <jbenc@suse.cz>
Signed-off-by: Jirka Bohac <jbohac@suse.cz>

--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -711,6 +711,8 @@
 	unsigned int frag_next_idx;
 	u16 fts; /* Fragmentation Threshold */
 
+	u16 seq_number;	/* sequence number in transmitted frames */
+
 	/* Association info */
 	u8 bssid[IEEE80211_ALEN];
 
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -333,6 +333,7 @@
 
 	/* Default fragmentation threshold is maximum payload size */
 	ieee->fts = DEFAULT_FTS;
+	ieee->seq_number = 0;
 	ieee->scan_age = DEFAULT_MAX_SCAN_AGE;
 	ieee->open_wep = 1;
 
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -277,6 +277,13 @@
 	else
 		bytes_last_frag = bytes_per_frag;
 
+	if (nr_frags > 16) {
+		/* Should never happen */
+		printk(KERN_WARNING "%s: Fragmentation threshold too low\n",
+			dev->name);
+		goto failed;
+	}
+
 	/* When we allocate the TXB we allocate enough space for the reserve
 	 * and full fragment bytes (bytes_per_frag doesn't include prefix,
 	 * postfix, header, FCS, etc.) */
@@ -300,6 +307,8 @@
 		frag_hdr = (struct ieee80211_hdr *)skb_put(skb_frag, hdr_len);
 		memcpy(frag_hdr, header, hdr_len);
 
+		frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_number | i);
+
 		/* If this is not the last fragment, then add the MOREFRAGS
 		 * bit to the frame control */
 		if (i != nr_frags - 1) {
@@ -324,7 +333,7 @@
 		    (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS))
 			skb_put(skb_frag, 4);
 	}
-
+	ieee->seq_number += 0x10;
 
  success:
 	spin_unlock_irqrestore(&ieee->lock, flags);


--
Jiri Benc
SUSE Labs

  parent reply	other threads:[~2005-05-24 13:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-24 13:07 [0/5] Improvements to the ieee80211 layer Jiri Benc
2005-05-24 13:10 ` [1/5] ieee80211: cleanup Jiri Benc
2005-05-28  2:43   ` Jeff Garzik
2005-05-24 13:11 ` [2/5] ieee80211: ieee80211_device alignment fix and cleanup Jiri Benc
2005-05-28  3:37   ` Jeff Garzik
2005-05-31 13:30     ` Jiri Benc
2005-05-24 13:12 ` [3/5] netdev: HH_DATA_OFF bugfix Jiri Benc
2005-05-28  3:15   ` Jeff Garzik
2005-05-24 13:12 ` [4/5] ieee80211: ethernet independency Jiri Benc
2005-05-24 13:13 ` Jiri Benc [this message]
2005-05-24 13:15 ` [1-2/6] ipw2100, ipw2200: patches to merge to kernel Jiri Benc
2005-05-24 17:24   ` Dave Jones
2005-05-24 17:56     ` Thomas Graf
2005-05-24 13:16 ` [3/6] ipw2100: fix after "ieee80211: cleanup" Jiri Benc
2005-05-24 13:18 ` [4/6] ipw2100: fix after "ieee80211_device alignment fix" Jiri Benc
2005-05-24 18:58   ` Pavel Machek
2005-05-24 19:18     ` Jirka Bohac
2005-05-24 13:19 ` [5/6] ipw2200: " Jiri Benc
2005-05-24 13:20 ` [6/6] ipw2200: fix after "ieee80211: ethernet independency" Jiri Benc
2005-05-24 18:52 ` [0/5] Improvements to the ieee80211 layer Pavel Machek
2005-05-25  8:29   ` Jirka Bohac
2005-05-25  9:27     ` Pavel Machek
2005-05-25  9:42       ` Jiri Benc
2005-05-25  6:55 ` Zhu Yi
2005-05-25 11:20   ` Jiri Benc
2005-05-26  3:36     ` Zhu Yi
2005-05-28  3:18 ` Jeff Garzik

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=20050524151341.612245e8@griffin.suse.cz \
    --to=jbenc@suse.cz \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=pavel@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).