staging: rtl8723au: tid is 4 bits, so we need a 16 bit value to hold a bitmap
authorJes Sorensen <Jes.Sorensen@redhat.com>
Fri, 9 May 2014 13:04:14 +0000 (15:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 May 2014 20:12:02 +0000 (13:12 -0700)
Remove unused add_enable_bitmap and candidate_tid_bitmap from struct
mlme_ext_info.

In addition we don't need to use CHKBIT when we know we are dealing
with a value in the range 0-15.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_mlme_ext.c
drivers/staging/rtl8723au/core/rtw_xmit.c
drivers/staging/rtl8723au/include/rtw_ht.h
drivers/staging/rtl8723au/include/rtw_mlme_ext.h

index 6106b6a9e87fd52dc41cb154826a9b856d058f44..475b0de0fe2455f2ba229458fe29da141660d8fa 100644 (file)
@@ -2034,11 +2034,10 @@ static int OnAction23a_back23a(struct rtw_adapter *padapter,
                        tid = (capab & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2;
                        if (status == 0) {      /* successful */
                                DBG_8723A("agg_enable for TID =%d\n", tid);
-                               psta->htpriv.agg_enable_bitmap |= 1 << tid;
-                               psta->htpriv.candidate_tid_bitmap &=
-                                       ~CHKBIT(tid);
+                               psta->htpriv.agg_enable_bitmap |= BIT(tid);
+                               psta->htpriv.candidate_tid_bitmap &= ~BIT(tid);
                        } else
-                               psta->htpriv.agg_enable_bitmap &= ~CHKBIT(tid);
+                               psta->htpriv.agg_enable_bitmap &= ~BIT(tid);
                        break;
 
                case WLAN_ACTION_DELBA: /* DELBA */
@@ -2051,14 +2050,11 @@ static int OnAction23a_back23a(struct rtw_adapter *padapter,
                                preorder_ctrl->enable = false;
                                preorder_ctrl->indicate_seq = 0xffff;
                        } else {
-                               psta->htpriv.agg_enable_bitmap &= ~(1 << tid);
-                               psta->htpriv.candidate_tid_bitmap &=
-                                       ~(1 << tid);
+                               psta->htpriv.agg_enable_bitmap &= ~BIT(tid);
+                               psta->htpriv.candidate_tid_bitmap &= ~BIT(tid);
                        }
                        reason_code = get_unaligned_le16(
                                &mgmt->u.action.u.delba.reason_code);
-                       DBG_8723A("%s(): DELBA: %x(%x)\n", __func__,
-                                 pmlmeinfo->agg_enable_bitmap, reason_code);
                        /* todo: how to notify the host while receiving
                           DELETE BA */
                        break;
@@ -5875,8 +5871,6 @@ u8 createbss_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
                pmlmeinfo->HT_enable = 0;
                pmlmeinfo->HT_caps_enable = 0;
                pmlmeinfo->HT_info_enable = 0;
-               pmlmeinfo->agg_enable_bitmap = 0;
-               pmlmeinfo->candidate_tid_bitmap = 0;
 
                /* disable dynamic functions, such as high power, DIG */
                rtl8723a_odm_support_ability_backup(padapter);
@@ -5944,8 +5938,6 @@ u8 join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
        pmlmeinfo->HT_enable = 0;
        pmlmeinfo->HT_caps_enable = 0;
        pmlmeinfo->HT_info_enable = 0;
-       pmlmeinfo->agg_enable_bitmap = 0;
-       pmlmeinfo->candidate_tid_bitmap = 0;
        pmlmeinfo->bwmode_updated = false;
        /* pmlmeinfo->assoc_AP_vendor = HT_IOT_PEER_MAX; */
 
index 829283f58a3bb8022cc49bdb647e00c86cf034ce..2e508987009acb731a429316d1f5e080ba2eddab 100644 (file)
@@ -952,8 +952,13 @@ s32 rtw_make_wlanhdr23a(struct rtw_adapter *padapter, u8 *hdr,
                        SetSeqNum(hdr, pattrib->seqnum);
                        /* check if enable ampdu */
                        if (pattrib->ht_en && psta->htpriv.ampdu_enable) {
-                               if (psta->htpriv.agg_enable_bitmap & CHKBIT(pattrib->priority))
-                               pattrib->ampdu_en = true;
+                               if (pattrib->priority >= 16)
+                                       printk(KERN_WARNING "%s: Invalid "
+                                              "pattrib->priority %i\n",
+                                              __func__, pattrib->priority);
+                               if (psta->htpriv.agg_enable_bitmap &
+                                   BIT(pattrib->priority))
+                                       pattrib->ampdu_en = true;
                        }
                        /* re-check if enable ampdu by BA_starting_seqctrl */
                        if (pattrib->ampdu_en) {
index 7fe0aa46f707eeec0899153de6d17bdb06713732..86ce86b6b69b049aeb8a79dc6f0285f11cbd1b85 100644 (file)
@@ -33,9 +33,9 @@ struct ht_priv
        u8      sgi;/* short GI */
 
        /* for processing Tx A-MPDU */
-       u     agg_enable_bitmap;
+       u16     agg_enable_bitmap;
        /* u8   ADDBA_retry_count; */
-       u     candidate_tid_bitmap;
+       u16     candidate_tid_bitmap;
 
        struct ieee80211_ht_cap ht_cap;
 };
index 6a4aa2b11808ac1a945d457f8f4b05b2206698a8..d185748ecd091df324478ffd513d5d837deb15d7 100644 (file)
@@ -357,9 +357,7 @@ struct mlme_ext_info
        u8      turboMode_cts2self;
        u8      turboMode_rtsen;
        u8      SM_PS;
-       u8      agg_enable_bitmap;
        u8      ADDBA_retry_count;
-       u8      candidate_tid_bitmap;
        u8      dialogToken;
        /*  Accept ADDBA Request */
        bool bAcceptAddbaReq;