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/09539a6ac37b
branches:  trunk
changeset: 375258:09539a6ac37b
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 797ac1db0ab0 -r 09539a6ac37b 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