staging: r8188eu: merge process_addba_req into OnAction_back
The process_addba_req function is called only by OnAction_back. Merge the two functions. OnAction_back has already checked that psta != NULL, we can drop the check in process_addba_req before merging the functions. We can also simplify the parsing of the tid by using struct ieee80211. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220514164740.282552-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cfed805f82
commit
d4170582c8
|
@ -1497,7 +1497,11 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr
|
|||
switch (mgmt->u.action.u.addba_req.action_code) {
|
||||
case WLAN_ACTION_ADDBA_REQ:
|
||||
memcpy(&pmlmeinfo->ADDBA_req, &frame_body[2], sizeof(struct ADDBA_request));
|
||||
process_addba_req(padapter, (u8 *)&pmlmeinfo->ADDBA_req, mgmt->sa);
|
||||
tid = u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_req.capab),
|
||||
IEEE80211_ADDBA_PARAM_TID_MASK);
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[tid];
|
||||
preorder_ctrl->indicate_seq = 0xffff;
|
||||
preorder_ctrl->enable = pmlmeinfo->bAcceptAddbaReq;
|
||||
|
||||
if (pmlmeinfo->bAcceptAddbaReq)
|
||||
issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, 0);
|
||||
|
|
|
@ -1464,28 +1464,6 @@ int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_l
|
|||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr)
|
||||
{
|
||||
struct sta_info *psta;
|
||||
u16 tid;
|
||||
u16 param;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct ADDBA_request *preq = (struct ADDBA_request *)paddba_req;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, addr);
|
||||
|
||||
if (psta) {
|
||||
param = le16_to_cpu(preq->BA_para_set);
|
||||
tid = (param >> 2) & 0x0f;
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[tid];
|
||||
preorder_ctrl->indicate_seq = 0xffff;
|
||||
preorder_ctrl->enable = pmlmeinfo->bAcceptAddbaReq;
|
||||
}
|
||||
}
|
||||
|
||||
void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
|
||||
{
|
||||
u8 *pIE;
|
||||
|
|
|
@ -592,8 +592,6 @@ void addba_timer_hdl(struct sta_info *psta);
|
|||
bool cckrates_included(unsigned char *rate, int ratelen);
|
||||
bool cckratesonly_included(unsigned char *rate, int ratelen);
|
||||
|
||||
void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr);
|
||||
|
||||
void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
|
||||
void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext);
|
||||
|
||||
|
|
Loading…
Reference in New Issue