PERFORCE change 147246 for review
Sam Leffler
sam at FreeBSD.org
Tue Aug 12 16:33:13 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=147246
Change 147246 by sam at sam_ebb on 2008/08/12 16:32:53
correct multiple issues with ieee80211_send_bar; still needs
more work to be useful
Affected files ...
.. //depot/projects/vap/sys/net80211/ieee80211_ht.c#34 edit
.. //depot/projects/vap/sys/net80211/ieee80211_ht.h#17 edit
Differences ...
==== //depot/projects/vap/sys/net80211/ieee80211_ht.c#34 (text+ko) ====
@@ -1750,17 +1750,12 @@
*/
int
ieee80211_send_bar(struct ieee80211_node *ni,
- const struct ieee80211_tx_ampdu *tap)
+ struct ieee80211_tx_ampdu *tap, ieee80211_seq seq)
{
#define senderr(_x, _v) do { vap->iv_stats._v++; ret = _x; goto bad; } while (0)
-#define ADDSHORT(frm, v) do { \
- frm[0] = (v) & 0xff; \
- frm[1] = (v) >> 8; \
- frm += 2; \
-} while (0)
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
- struct ieee80211_frame_min *wh;
+ struct ieee80211_frame_bar *bar;
struct mbuf *m;
uint8_t *frm;
uint16_t barctl, barseqctl;
@@ -1768,19 +1763,17 @@
ieee80211_ref_node(ni);
- m = ieee80211_getmgtframe(&frm,
- ic->ic_headroom + sizeof(struct ieee80211_frame_min),
- sizeof(struct ieee80211_ba_request)
- );
+ m = ieee80211_getmgtframe(&frm, ic->ic_headroom,
+ sizeof(struct ieee80211_frame_bar));
if (m == NULL)
senderr(ENOMEM, is_tx_nobuf);
- wh = mtod(m, struct ieee80211_frame_min *);
- wh->i_fc[0] = IEEE80211_FC0_VERSION_0 |
+ bar = mtod(m, struct ieee80211_frame_bar *);
+ bar->i_fc[0] = IEEE80211_FC0_VERSION_0 |
IEEE80211_FC0_TYPE_CTL | IEEE80211_FC0_SUBTYPE_BAR;
- wh->i_fc[1] = 0;
- IEEE80211_ADDR_COPY(wh->i_addr1, ni->ni_macaddr);
- IEEE80211_ADDR_COPY(wh->i_addr2, vap->iv_myaddr);
+ bar->i_fc[1] = 0;
+ IEEE80211_ADDR_COPY(bar->i_ra, ni->ni_macaddr);
+ IEEE80211_ADDR_COPY(bar->i_ta, vap->iv_myaddr);
tid = WME_AC_TO_TID(tap->txa_ac);
barctl = (tap->txa_flags & IEEE80211_AGGR_IMMEDIATE ?
@@ -1789,26 +1782,26 @@
| SM(tid, IEEE80211_BAPS_TID)
| SM(tap->txa_wnd, IEEE80211_BAPS_BUFSIZ)
;
- barseqctl = SM(tap->txa_start, IEEE80211_BASEQ_START)
+ barseqctl = SM(seq, IEEE80211_BASEQ_START)
| SM(0, IEEE80211_BASEQ_FRAG)
;
- ADDSHORT(frm, barctl);
- ADDSHORT(frm, barseqctl);
- m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *);
+ /* NB: known to have proper alignment */
+ bar->i_ctl = htole16(barctl);
+ bar->i_seq = htole16(barseqctl);
+ m->m_pkthdr.len = m->m_len = sizeof(struct ieee80211_frame_bar);
M_WME_SETAC(m, WME_AC_VO);
IEEE80211_NODE_STAT(ni, tx_mgmt); /* XXX tx_ctl? */
- IEEE80211_NOTE(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_DUMPPKTS,
- ni, "send bar frame (tid %u start %u) on channel %u",
- tid, tap->txa_start, ieee80211_chan2ieee(ic, ic->ic_curchan));
+ IEEE80211_NOTE(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_11N,
+ ni, "send BAR: tid %u ctl 0x%x start %u (attempt %d)",
+ tid, barctl, seq, tap->txa_attempts);
return ic->ic_raw_xmit(ni, m, NULL);
bad:
ieee80211_free_node(ni);
return ret;
-#undef ADDSHORT
#undef senderr
}
==== //depot/projects/vap/sys/net80211/ieee80211_ht.h#17 (text+ko) ====
@@ -185,7 +185,7 @@
void ieee80211_ampdu_stop(struct ieee80211_node *,
struct ieee80211_tx_ampdu *, int);
int ieee80211_send_bar(struct ieee80211_node *,
- const struct ieee80211_tx_ampdu *);
+ struct ieee80211_tx_ampdu *tap, ieee80211_seq seq);
int ieee80211_send_action(struct ieee80211_node *,
int, int, uint16_t [4]);
uint8_t *ieee80211_add_htcap(uint8_t *, struct ieee80211_node *);
More information about the p4-projects
mailing list