Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src-draft/trunk]: src/sys/dev/usb Fix access to QOS data
details: https://anonhg.NetBSD.org/src-all/rev/9c44dd4329ee
branches: trunk
changeset: 378020:9c44dd4329ee
user: Martin Husemann <martin%NetBSD.org@localhost>
date: Mon Aug 15 17:21:30 2022 +0200
description:
Fix access to QOS data
diffstat:
sys/dev/usb/usbwifi.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (33 lines):
diff -r a6df1235aafc -r 9c44dd4329ee sys/dev/usb/usbwifi.c
--- a/sys/dev/usb/usbwifi.c Mon Aug 15 17:19:43 2022 +0200
+++ b/sys/dev/usb/usbwifi.c Mon Aug 15 17:21:30 2022 +0200
@@ -811,8 +811,12 @@ usbwifi_tx_prio_start(struct usbwifi *uw
qid = WME_AC_BE;
if (IEEE80211_QOS_HAS_SEQ(wh)) {
/* data frames in 11n mode */
- struct ieee80211_qosframe *qwh = (void *)wh;
- uint8_t tid = qwh->i_qos[0] & IEEE80211_QOS_TID;
+ uint8_t *frm, tid;
+ uint16_t qos;
+
+ frm = ieee80211_getqos(wh);
+ qos = le16toh(*(const uint16_t *)frm);
+ tid = qos & IEEE80211_QOS_TID;
qid = TID_TO_WME_AC(tid);
} else if (type != IEEE80211_FC0_TYPE_DATA) {
qid = WME_AC_VO;
@@ -909,8 +913,12 @@ usbwifi_transmit(struct ieee80211com *ic
qid = WME_AC_BE;
if (IEEE80211_QOS_HAS_SEQ(wh)) {
/* data frames in 11n mode */
- struct ieee80211_qosframe *qwh = (void *)wh;
- uint8_t tid = qwh->i_qos[0] & IEEE80211_QOS_TID;
+ uint8_t *frm, tid;
+ uint16_t qos;
+
+ frm = ieee80211_getqos(wh);
+ qos = le16toh(*(const uint16_t *)frm);
+ tid = qos & IEEE80211_QOS_TID;
qid = TID_TO_WME_AC(tid);
} else if (type != IEEE80211_FC0_TYPE_DATA) {
qid = WME_AC_VO;
Home |
Main Index |
Thread Index |
Old Index