staging: r8188eu: use ieee80211 helper for qos bit
authorMartin Kaiser <martin@kaiser.cx>
Sun, 27 Feb 2022 16:41:43 +0000 (17:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Mar 2022 21:34:15 +0000 (22:34 +0100)
Use the ieee80211_is_data_qos helper function to read the qos bit.

This helper function returns a bool. Change the qos field in struct
rx_pkt_attrib from u8 to bool and fix up the other places where it
is used.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220227164147.1168847-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_recv.c
drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c
drivers/staging/r8188eu/include/rtw_recv.h

index 364bf78..3a92d26 100644 (file)
@@ -1012,7 +1012,7 @@ static int validate_recv_data_frame(struct adapter *adapter,
        pattrib->amsdu = 0;
        pattrib->ack_policy = 0;
        /* parsing QC field */
-       if (pattrib->qos == 1) {
+       if (pattrib->qos) {
                pattrib->priority = GetPriority((ptr + 24));
                pattrib->ack_policy = GetAckpolicy((ptr + 24));
                pattrib->amsdu = GetAMsdu((ptr + 24));
@@ -1057,7 +1057,6 @@ static int validate_recv_frame(struct adapter *adapter, struct recv_frame *precv
 
        /* then call check if rx seq/frag. duplicated. */
 
-       u8 subtype;
        int retval = _FAIL;
        u8 bDumpRxPkt;
        struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
@@ -1076,8 +1075,6 @@ static int validate_recv_frame(struct adapter *adapter, struct recv_frame *precv
        if (ver != 0)
                return _FAIL;
 
-       subtype = GetFrameSubType(ptr); /* bit(7)~bit(2) */
-
        pattrib->to_fr_ds = get_tofr_ds(ptr);
 
        pattrib->frag_num = GetFragNum(ptr);
@@ -1099,7 +1096,7 @@ static int validate_recv_frame(struct adapter *adapter, struct recv_frame *precv
                validate_recv_ctrl_frame(adapter, precv_frame);
        else if (ieee80211_is_data(fc)) {
                rtw_led_control(adapter, LED_CTL_RX);
-               pattrib->qos = (subtype & BIT(7)) ? 1 : 0;
+               pattrib->qos = ieee80211_is_data_qos(fc);
                retval = validate_recv_data_frame(adapter, precv_frame);
                if (retval == _FAIL) {
                        struct recv_priv *precvpriv = &adapter->recvpriv;
@@ -1599,7 +1596,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, struct recv_frame
                /* s1. */
                wlanhdr_to_ethhdr(prframe);
 
-               if (pattrib->qos != 1) {
+               if (!pattrib->qos) {
                        if (!padapter->bDriverStopped &&
                            !padapter->bSurpriseRemoved) {
                                rtw_recv_indicatepkt(padapter, prframe);
index bf93ff3..1010913 100644 (file)
@@ -84,7 +84,7 @@ void update_recvframe_attrib_88e(struct recv_frame *precvframe, struct recv_stat
                pattrib->bdecrypted = (le32_to_cpu(report.rxdw0) & BIT(27)) ? 0 : 1;/* u8)(prxreport->swdec ? 0 : 1); */
                pattrib->encrypt = (u8)((le32_to_cpu(report.rxdw0) >> 20) & 0x7);/* u8)prxreport->security; */
 
-               pattrib->qos = (u8)((le32_to_cpu(report.rxdw0) >> 23) & 0x1);/* u8)prxreport->qos; */
+               pattrib->qos = (le32_to_cpu(report.rxdw0) >> 23) & 0x1;/* prxreport->qos; */
                pattrib->priority = (u8)((le32_to_cpu(report.rxdw1) >> 8) & 0xf);/* u8)prxreport->tid; */
 
                pattrib->amsdu = (u8)((le32_to_cpu(report.rxdw1) >> 13) & 0x1);/* u8)prxreport->amsdu; */
index 6a6f637..d2f1c71 100644 (file)
@@ -82,7 +82,7 @@ struct rx_pkt_attrib {
        u8      hdrlen; /* the WLAN Header Len */
        u8      to_fr_ds;
        u8      amsdu;
-       u8      qos;
+       bool    qos;
        u8      priority;
        u8      pw_save;
        u8      mdata;