From fa3324c985708cfe0407fd5aee2955e2f5b88426 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Wed, 24 Aug 2011 08:53:33 +0000 Subject: [PATCH] This patch fixes beacon frame sequence number generation. The code didn't set a sequence number; it didn't show up earlier because the hardware most people use for hostap (ie, AR5212 series stuff) sets the sequence numbers up in hardware. Later hardware (AR5416, etc) which can do 11n and aggregation require sequence numbers to be generated in software. Submitted by: paradyse@gmail.com Approved by: re (kib) --- sys/net80211/ieee80211_output.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 6020144ef7c..bcd3c2bdac5 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -2792,6 +2792,8 @@ ieee80211_beacon_update(struct ieee80211_node *ni, struct ieee80211com *ic = ni->ni_ic; int len_changed = 0; uint16_t capinfo; + struct ieee80211_frame *wh; + ieee80211_seq seqno; IEEE80211_LOCK(ic); /* @@ -2823,6 +2825,12 @@ ieee80211_beacon_update(struct ieee80211_node *ni, return 1; /* just assume length changed */ } + wh = mtod(m, struct ieee80211_frame *); + seqno = ni->ni_txseqs[IEEE80211_NONQOS_TID]++; + *(uint16_t *)&wh->i_seq[0] = + htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); + M_SEQNO_SET(m, seqno); + /* XXX faster to recalculate entirely or just changes? */ capinfo = ieee80211_getcapinfo(vap, ni->ni_chan); *bo->bo_caps = htole16(capinfo);