aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAndriy Voskoboinyk <avos@FreeBSD.org>2019-02-10 23:58:56 +0000
committerAndriy Voskoboinyk <avos@FreeBSD.org>2019-02-10 23:58:56 +0000
commitf3f08e16a3a8a661dc6b603f7045bc0be18c28e5 (patch)
treed8f6f7470997455a0a477da1064a24f5d6726d7a /sys/dev
parent0020c845a086766b3315372f006363f8ad76ac54 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/malo/if_malo.c20
-rw-r--r--sys/dev/mwl/if_mwl.c20
-rw-r--r--sys/dev/usb/wlan/if_run.c6
3 files changed, 9 insertions, 37 deletions
diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c
index 25f9ee33e74b..ce63c5322ab2 100644
--- a/sys/dev/malo/if_malo.c
+++ b/sys/dev/malo/if_malo.c
@@ -1051,13 +1051,9 @@ malo_tx_start(struct malo_softc *sc, struct ieee80211_node *ni,
copyhdrlen = hdrlen = ieee80211_anyhdrsize(wh);
pktlen = m0->m_pkthdr.len;
if (IEEE80211_QOS_HAS_SEQ(wh)) {
- if (IEEE80211_IS_DSTODS(wh)) {
- qos = *(uint16_t *)
- (((struct ieee80211_qosframe_addr4 *) wh)->i_qos);
+ qos = *(uint16_t *)ieee80211_getqos(wh);
+ if (IEEE80211_IS_DSTODS(wh))
copyhdrlen -= sizeof(qos);
- } else
- qos = *(uint16_t *)
- (((struct ieee80211_qosframe *) wh)->i_qos);
} else
qos = 0;
@@ -1952,7 +1948,6 @@ malo_rx_proc(void *arg, int npending)
struct malo_rxdesc *ds;
struct mbuf *m, *mnew;
struct ieee80211_qosframe *wh;
- struct ieee80211_qosframe_addr4 *wh4;
struct ieee80211_node *ni;
int off, len, hdrlen, pktlen, rssi, ntodo;
uint8_t *data, status;
@@ -2062,15 +2057,8 @@ malo_rx_proc(void *arg, int npending)
/* NB: don't need to do this sometimes but ... */
/* XXX special case so we can memcpy after m_devget? */
ovbcopy(data + sizeof(uint16_t), wh, hdrlen);
- if (IEEE80211_QOS_HAS_SEQ(wh)) {
- if (IEEE80211_IS_DSTODS(wh)) {
- wh4 = mtod(m,
- struct ieee80211_qosframe_addr4*);
- *(uint16_t *)wh4->i_qos = ds->qosctrl;
- } else {
- *(uint16_t *)wh->i_qos = ds->qosctrl;
- }
- }
+ if (IEEE80211_QOS_HAS_SEQ(wh))
+ *(uint16_t *)ieee80211_getqos(wh) = ds->qosctrl;
if (ieee80211_radiotap_active(ic)) {
sc->malo_rx_th.wr_flags = 0;
sc->malo_rx_th.wr_rate = ds->rate;
diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c
index b54dc7e8cb58..a33e49324968 100644
--- a/sys/dev/mwl/if_mwl.c
+++ b/sys/dev/mwl/if_mwl.c
@@ -2614,7 +2614,6 @@ mwl_rx_proc(void *arg, int npending)
struct mwl_rxdesc *ds;
struct mbuf *m;
struct ieee80211_qosframe *wh;
- struct ieee80211_qosframe_addr4 *wh4;
struct ieee80211_node *ni;
struct mwl_node *mn;
int off, len, hdrlen, pktlen, rssi, ntodo;
@@ -2761,15 +2760,8 @@ mwl_rx_proc(void *arg, int npending)
/* NB: don't need to do this sometimes but ... */
/* XXX special case so we can memcpy after m_devget? */
ovbcopy(data + sizeof(uint16_t), wh, hdrlen);
- if (IEEE80211_QOS_HAS_SEQ(wh)) {
- if (IEEE80211_IS_DSTODS(wh)) {
- wh4 = mtod(m,
- struct ieee80211_qosframe_addr4*);
- *(uint16_t *)wh4->i_qos = ds->QosCtrl;
- } else {
- *(uint16_t *)wh->i_qos = ds->QosCtrl;
- }
- }
+ if (IEEE80211_QOS_HAS_SEQ(wh))
+ *(uint16_t *)ieee80211_getqos(wh) = ds->QosCtrl;
/*
* The f/w strips WEP header but doesn't clear
* the WEP bit; mark the packet with M_WEP so
@@ -3100,13 +3092,9 @@ mwl_tx_start(struct mwl_softc *sc, struct ieee80211_node *ni, struct mwl_txbuf *
copyhdrlen = hdrlen;
pktlen = m0->m_pkthdr.len;
if (IEEE80211_QOS_HAS_SEQ(wh)) {
- if (IEEE80211_IS_DSTODS(wh)) {
- qos = *(uint16_t *)
- (((struct ieee80211_qosframe_addr4 *) wh)->i_qos);
+ qos = *(uint16_t *)ieee80211_getqos(wh);
+ if (IEEE80211_IS_DSTODS(wh))
copyhdrlen -= sizeof(qos);
- } else
- qos = *(uint16_t *)
- (((struct ieee80211_qosframe *) wh)->i_qos);
} else
qos = 0;
diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c
index 658a3e65f869..b64a994a276d 100644
--- a/sys/dev/usb/wlan/if_run.c
+++ b/sys/dev/usb/wlan/if_run.c
@@ -3369,11 +3369,7 @@ run_tx(struct run_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
if ((hasqos = IEEE80211_QOS_HAS_SEQ(wh))) {
uint8_t *frm;
- if(IEEE80211_HAS_ADDR4(wh))
- frm = ((struct ieee80211_qosframe_addr4 *)wh)->i_qos;
- else
- frm =((struct ieee80211_qosframe *)wh)->i_qos;
-
+ frm = ieee80211_getqos(wh);
qos = le16toh(*(const uint16_t *)frm);
tid = qos & IEEE80211_QOS_TID;
qid = TID_TO_WME_AC(tid);