From 4e305e82d022885fbf273631dd0456984e9e9aea Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Fri, 12 Dec 2014 22:32:07 -0600 Subject: [PATCH] rtl8188eu: Rework handling of BA_para_set Signed-off-by: Larry Finger --- core/rtw_mlme_ext.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index e2fbe32..d2f3832 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -6065,18 +6065,25 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch case 1: /* ADDBA rsp */ pframe = rtw_set_fixed_ie(pframe, 1, &(pmlmeinfo->ADDBA_req.dialog_token), &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&status), &(pattrib->pktlen)); - rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); BA_para_set = le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f; - if (MAX_AMPDU_FACTOR_64K == max_rx_ampdu_factor) + rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR, &max_rx_ampdu_factor); + switch (max_rx_ampdu_factor) { + case MAX_AMPDU_FACTOR_64K: BA_para_set |= 0x1000; /* 64 buffer size */ - else if (MAX_AMPDU_FACTOR_32K == max_rx_ampdu_factor) + break; + case MAX_AMPDU_FACTOR_32K: BA_para_set |= 0x0800; /* 32 buffer size */ - else if (MAX_AMPDU_FACTOR_16K == max_rx_ampdu_factor) + break; + case MAX_AMPDU_FACTOR_16K: BA_para_set |= 0x0400; /* 16 buffer size */ - else if (MAX_AMPDU_FACTOR_8K == max_rx_ampdu_factor) + break; + case MAX_AMPDU_FACTOR_8K: BA_para_set |= 0x0200; /* 8 buffer size */ - else + break; + default: BA_para_set |= 0x1000; /* 64 buffer size */ + break; + } if (pregpriv->ampdu_amsdu == 0)/* disabled */ BA_para_set = BA_para_set & ~BIT(0);