staging: r8188eu: use mgmt to set delba params
authorMartin Kaiser <martin@kaiser.cx>
Thu, 2 Jun 2022 19:37:22 +0000 (21:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Jun 2022 06:08:35 +0000 (08:08 +0200)
Use the mgmt struct to set the delba parameters. Use the exact same value
for the parameters as the current code.

Remove a dead increment of pframe, we don't use pframe for the delba
message any more.

Tested-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220602193726.280922-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_mlme_ext.c

index dd9f7f2..46b770e 100644 (file)
@@ -5366,8 +5366,6 @@ exit:
 void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short status)
 {
        u16 start_seq;
-       u16 BA_para_set;
-       __le16  le_tmp;
        u16 BA_starting_seqctrl = 0;
        struct xmit_frame *pmgntframe;
        struct pkt_attrib *pattrib;
@@ -5403,7 +5401,6 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
        mgmt->seq_ctrl = cpu_to_le16(pmlmeext->mgnt_seq);
        pmlmeext->mgnt_seq++;
 
-       pframe += sizeof(struct ieee80211_hdr_3addr);
        pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
 
        mgmt->u.action.category = WLAN_CATEGORY_BACK;
@@ -5452,10 +5449,8 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
        case WLAN_ACTION_DELBA:
                mgmt->u.action.u.delba.action_code = WLAN_ACTION_DELBA;
                pattrib->pktlen++;
-               BA_para_set = (status & 0x1F) << 3;
-               le_tmp = cpu_to_le16(BA_para_set);
-               pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
-
+               mgmt->u.action.u.delba.params = cpu_to_le16((status & 0x1F) << 3);
+               pattrib->pktlen += 2;
                mgmt->u.action.u.delba.reason_code = cpu_to_le16(WLAN_STATUS_REQUEST_DECLINED);
                pattrib->pktlen += 2;
                break;