aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-10-10 07:21:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:12 -0400
commit94778280fabdb6bc76db5509bd95859f1141385b (patch)
tree795a20eed458dacab69a345c33467523a2a8dbe1 /net/mac80211
parent2e20cc3986cbee410fbe8e3e116bdcb12d70fcce (diff)
mac80211: provide sequence numbers
I've come to think that not providing sequence numbers for the normal STA mode case was a mistake, at least two drivers now had to implement code they wouldn't otherwise need, and I believe at76_usb and adm8211 might be broken. This patch makes mac80211 assign a sequence number to all those frames that need one except beacons. That means that if a driver only implements modes that do not do beaconing it need not worry about the sequence number. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/tx.c10
2 files changed, 12 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 1deb787ff8dc..819844726dd4 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -438,6 +438,8 @@ struct ieee80211_sub_if_data {
438 struct ieee80211_key *keys[NUM_DEFAULT_KEYS]; 438 struct ieee80211_key *keys[NUM_DEFAULT_KEYS];
439 struct ieee80211_key *default_key; 439 struct ieee80211_key *default_key;
440 440
441 u16 sequence_number;
442
441 /* BSS configuration for this interface. */ 443 /* BSS configuration for this interface. */
442 struct ieee80211_bss_conf bss_conf; 444 struct ieee80211_bss_conf bss_conf;
443 445
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 22494bcf488a..8bcabefa86e0 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -600,8 +600,18 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
600 if (ieee80211_hdrlen(hdr->frame_control) < 24) 600 if (ieee80211_hdrlen(hdr->frame_control) < 24)
601 return TX_CONTINUE; 601 return TX_CONTINUE;
602 602
603 /*
604 * Anything but QoS data that has a sequence number field
605 * (is long enough) gets a sequence number from the global
606 * counter.
607 */
603 if (!ieee80211_is_data_qos(hdr->frame_control)) { 608 if (!ieee80211_is_data_qos(hdr->frame_control)) {
609 /* driver should assign sequence number */
604 info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; 610 info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
611 /* for pure STA mode without beacons, we can do it */
612 hdr->seq_ctrl = cpu_to_le16(tx->sdata->sequence_number);
613 tx->sdata->sequence_number += 0x10;
614 tx->sdata->sequence_number &= IEEE80211_SCTL_SEQ;
605 return TX_CONTINUE; 615 return TX_CONTINUE;
606 } 616 }
607 617