diff options
author | Martin Kaiser <martin@kaiser.cx> | 2022-05-08 18:14:48 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-19 17:40:56 +0200 |
commit | 5b3903d555d4ed45277883012325173c96b7dc2f (patch) | |
tree | a74bcaabfc43935a34810306125f9ebeeb086fdf /drivers/staging/r8188eu | |
parent | 5108b9838a76a9c5cee07b4c4a1bc4bb4024ceeb (diff) | |
download | lwn-5b3903d555d4ed45277883012325173c96b7dc2f.tar.gz lwn-5b3903d555d4ed45277883012325173c96b7dc2f.zip |
staging: r8188eu: don't check the category in OnAction_back
Do not check the category in OnAction_back. OnAction has already checked
the category before calling OnAction_back.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/r8188eu')
-rw-r--r-- | drivers/staging/r8188eu/core/rtw_mlme_ext.c | 76 |
1 files changed, 37 insertions, 39 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 2f67e3c08191..1543ba17c559 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1471,7 +1471,7 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr struct sta_info *psta = NULL; struct recv_reorder_ctrl *preorder_ctrl; unsigned char *frame_body; - unsigned char category, action; + unsigned char action; unsigned short tid, status; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; @@ -1492,47 +1492,45 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); - category = frame_body[0]; - if (category == WLAN_CATEGORY_BACK) { /* representing Block Ack */ - if (!pmlmeinfo->HT_enable) - return _SUCCESS; - action = frame_body[1]; - switch (action) { - case RTW_WLAN_ACTION_ADDBA_REQ: /* ADDBA request */ - memcpy(&pmlmeinfo->ADDBA_req, &frame_body[2], sizeof(struct ADDBA_request)); - process_addba_req(padapter, (u8 *)&pmlmeinfo->ADDBA_req, mgmt->sa); + if (!pmlmeinfo->HT_enable) + return _SUCCESS; + action = frame_body[1]; + switch (action) { + case RTW_WLAN_ACTION_ADDBA_REQ: /* ADDBA request */ + memcpy(&pmlmeinfo->ADDBA_req, &frame_body[2], sizeof(struct ADDBA_request)); + process_addba_req(padapter, (u8 *)&pmlmeinfo->ADDBA_req, mgmt->sa); - if (pmlmeinfo->bAcceptAddbaReq) - issue_action_BA(padapter, mgmt->sa, RTW_WLAN_ACTION_ADDBA_RESP, 0); - else - issue_action_BA(padapter, mgmt->sa, RTW_WLAN_ACTION_ADDBA_RESP, 37);/* reject ADDBA Req */ - break; - case RTW_WLAN_ACTION_ADDBA_RESP: /* ADDBA response */ - status = get_unaligned_le16(&frame_body[3]); - tid = ((frame_body[5] >> 2) & 0x7); - if (status == 0) { /* successful */ - psta->htpriv.agg_enable_bitmap |= 1 << tid; - psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); - } else { - psta->htpriv.agg_enable_bitmap &= ~BIT(tid); - } - break; - case RTW_WLAN_ACTION_DELBA: /* DELBA */ - if ((frame_body[3] & BIT(3)) == 0) { - psta->htpriv.agg_enable_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf)); - psta->htpriv.candidate_tid_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf)); - } else if ((frame_body[3] & BIT(3)) == BIT(3)) { - tid = (frame_body[3] >> 4) & 0x0F; - preorder_ctrl = &psta->recvreorder_ctrl[tid]; - preorder_ctrl->enable = false; - preorder_ctrl->indicate_seq = 0xffff; - } - /* todo: how to notify the host while receiving DELETE BA */ - break; - default: - break; + if (pmlmeinfo->bAcceptAddbaReq) + issue_action_BA(padapter, mgmt->sa, RTW_WLAN_ACTION_ADDBA_RESP, 0); + else + issue_action_BA(padapter, mgmt->sa, RTW_WLAN_ACTION_ADDBA_RESP, 37);/* reject ADDBA Req */ + break; + case RTW_WLAN_ACTION_ADDBA_RESP: /* ADDBA response */ + status = get_unaligned_le16(&frame_body[3]); + tid = ((frame_body[5] >> 2) & 0x7); + if (status == 0) { /* successful */ + psta->htpriv.agg_enable_bitmap |= 1 << tid; + psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); + } else { + psta->htpriv.agg_enable_bitmap &= ~BIT(tid); } + break; + case RTW_WLAN_ACTION_DELBA: /* DELBA */ + if ((frame_body[3] & BIT(3)) == 0) { + psta->htpriv.agg_enable_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf)); + psta->htpriv.candidate_tid_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf)); + } else if ((frame_body[3] & BIT(3)) == BIT(3)) { + tid = (frame_body[3] >> 4) & 0x0F; + preorder_ctrl = &psta->recvreorder_ctrl[tid]; + preorder_ctrl->enable = false; + preorder_ctrl->indicate_seq = 0xffff; + } + /* todo: how to notify the host while receiving DELETE BA */ + break; + default: + break; } + return _SUCCESS; } |