diff options
author | Andriy Voskoboinyk <avos@FreeBSD.org> | 2019-02-10 23:58:56 +0000 |
---|---|---|
committer | Andriy Voskoboinyk <avos@FreeBSD.org> | 2019-02-10 23:58:56 +0000 |
commit | f3f08e16a3a8a661dc6b603f7045bc0be18c28e5 (patch) | |
tree | d8f6f7470997455a0a477da1064a24f5d6726d7a /sys/dev/mwl/if_mwl.c | |
parent | 0020c845a086766b3315372f006363f8ad76ac54 (diff) | |
download | src-f3f08e16a3a8a661dc6b603f7045bc0be18c28e5.tar.gz src-f3f08e16a3a8a661dc6b603f7045bc0be18c28e5.zip |
net80211(4): hide casts for 'i_seq' field offset calculation inside
ieee80211_getqos() and reuse it in various places.
Checked with RTL8188EE, HOSTAP mode + RTL8188CUS, STA mode.
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=343990
Diffstat (limited to 'sys/dev/mwl/if_mwl.c')
-rw-r--r-- | sys/dev/mwl/if_mwl.c | 20 |
1 files changed, 4 insertions, 16 deletions
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; |