staging: rtl8723au: Eliminate HW_VAR_CAM_WRITE and clean up all the wrapping around it
authorJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 9 Apr 2014 21:20:29 +0000 (23:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Apr 2014 15:29:03 +0000 (08:29 -0700)
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_wlan_util.c
drivers/staging/rtl8723au/hal/hal_com.c
drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
drivers/staging/rtl8723au/include/hal_com.h
drivers/staging/rtl8723au/include/hal_intf.h
drivers/staging/rtl8723au/include/rtw_mlme_ext.h

index 068203e62688bd8b0ee89a2d73c5ddd20813ddcc..a40bb035187f462fdf2c8b5d2579d1aa59066f35 100644 (file)
@@ -9614,7 +9614,7 @@ u8 setkey_hdl23a(struct rtw_adapter *padapter, u8 *pbuf)
 
        DBG_8723A_LEVEL(_drv_always_, "set group key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) "
                        "keyid:%d\n", pparm->algorithm, pparm->keyid);
-       write_cam23a(padapter, pparm->keyid, ctrl, null_sta, pparm->key);
+       rtl8723a_cam_write(padapter, pparm->keyid, ctrl, null_sta, pparm->key);
 
        /* allow multicast packets to driver */
        rtl8723a_on_rcr_am(padapter);
@@ -9678,7 +9678,8 @@ u8 set_stakey_hdl23a(struct rtw_adapter *padapter, u8 *pbuf)
                                                pparm->addr[1], pparm->addr[2], pparm->addr[3], pparm->addr[4],
                                                pparm->addr[5], cam_id);
 
-                       write_cam23a(padapter, cam_id, ctrl, pparm->addr, pparm->key);
+                       rtl8723a_cam_write(padapter, cam_id, ctrl,
+                                          pparm->addr, pparm->key);
 
                        return H2C_SUCCESS_RSP;
 
@@ -9701,7 +9702,7 @@ u8 set_stakey_hdl23a(struct rtw_adapter *padapter, u8 *pbuf)
 
        ctrl = BIT(15) | ((pparm->algorithm) << 2);
 
-       write_cam23a(padapter, cam_id, ctrl, pparm->addr, pparm->key);
+       rtl8723a_cam_write(padapter, cam_id, ctrl, pparm->addr, pparm->key);
 
        pmlmeinfo->enc_algo = pparm->algorithm;
 
index 1e538854dbb473c7b96b727f3bab7cac07610e7e..221184457b7196b5a7703d4711d57f2a46f59003 100644 (file)
@@ -483,50 +483,13 @@ void invalidate_cam_all23a(struct rtw_adapter *padapter)
        rtl8723a_cam_invalid_all(padapter);
 }
 
-void write_cam23a(struct rtw_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key)
-{
-       unsigned int    i, val, addr;
-       int j;
-       u32     cam_val[2];
-
-       addr = entry << 3;
-
-       for (j = 5; j >= 0; j--) {
-               switch (j) {
-               case 0:
-                       val = (ctrl | (mac[0] << 16) | (mac[1] << 24));
-                       break;
-               case 1:
-                       val = (mac[2] | (mac[3] << 8) | (mac[4] << 16) | (mac[5] << 24));
-                       break;
-               default:
-                       i = (j - 2) << 2;
-                       val = (key[i] | (key[i+1] << 8) | (key[i+2] << 16) | (key[i+3] << 24));
-                       break;
-               }
-
-               cam_val[0] = val;
-               cam_val[1] = addr + (unsigned int)j;
-
-               rtw_hal_set_hwreg23a(padapter, HW_VAR_CAM_WRITE, (u8 *)cam_val);
-
-               /* rtw_write32(padapter, WCAMI, val); */
-
-               /* cmd = CAM_POLLINIG | CAM_WRITE | (addr + j); */
-               /* rtw_write32(padapter, RWCAM, cmd); */
-
-               /* DBG_8723A("%s => cam write: %x, %x\n", __func__, cmd, val); */
-
-       }
-}
-
 void clear_cam_entry23a(struct rtw_adapter *padapter, u8 entry)
 {
        unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
        unsigned char null_key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
-       write_cam23a(padapter, entry, 0, null_sta, null_key);
+       rtl8723a_cam_write(padapter, entry, 0, null_sta, null_key);
 }
 
 int allocate_fw_sta_entry23a(struct rtw_adapter *padapter)
index 06ea165ceddda8f1e8c92d606d458f7995aa3ae6..5d4e51c493e687ba8dcd2680a609b52bcfe7abc5 100644 (file)
@@ -685,14 +685,37 @@ void rtl8723a_cam_invalid_all(struct rtw_adapter *padapter)
        rtw_write32(padapter, RWCAM, BIT(31) | BIT(30));
 }
 
-void rtl8723a_cam_write(struct rtw_adapter *padapter, u32 val1, u32 val2)
+void rtl8723a_cam_write(struct rtw_adapter *padapter,
+                       u8 entry, u16 ctrl, u8 *mac, u8 *key)
 {
        u32 cmd;
+       unsigned int i, val, addr;
+       int j;
 
-       rtw_write32(padapter, WCAMI, val1);
+       addr = entry << 3;
 
-       cmd = CAM_POLLINIG | CAM_WRITE | val2;
-       rtw_write32(padapter, RWCAM, cmd);
+       for (j = 5; j >= 0; j--) {
+               switch (j) {
+               case 0:
+                       val = ctrl | (mac[0] << 16) | (mac[1] << 24);
+                       break;
+               case 1:
+                       val = mac[2] | (mac[3] << 8) |
+                               (mac[4] << 16) | (mac[5] << 24);
+                       break;
+               default:
+                       i = (j - 2) << 2;
+                       val = key[i] | (key[i+1] << 8) |
+                               (key[i+2] << 16) | (key[i+3] << 24);
+                       break;
+               }
+
+               rtw_write32(padapter, WCAMI, val);
+               cmd = CAM_POLLINIG | CAM_WRITE | (addr + j);
+               rtw_write32(padapter, RWCAM, cmd);
+
+               /* DBG_8723A("%s => cam write: %x, %x\n", __func__, cmd, val);*/
+       }
 }
 
 void rtl8723a_fifo_cleanup(struct rtw_adapter *padapter)
index 3de077b3ed5b5bf0377c8ad8d7893d64ed437011..69041efe5c361d32f45bc6f728769faaa1577c74 100644 (file)
@@ -11219,7 +11219,9 @@ void HALBT_SetKey(struct rtw_adapter *padapter, u8 EntryNum)
        pBtAssocEntry->HwCAMIndex = BT_HWCAM_STAR + EntryNum;
 
        usConfig = CAM_VALID | (CAM_AES << 2);
-       write_cam23a(padapter, pBtAssocEntry->HwCAMIndex, usConfig, pBtAssocEntry->BTRemoteMACAddr, pBtAssocEntry->PTK + TKIP_ENC_KEY_POS);
+       rtl8723a_cam_write(padapter, pBtAssocEntry->HwCAMIndex, usConfig,
+                          pBtAssocEntry->BTRemoteMACAddr,
+                          pBtAssocEntry->PTK + TKIP_ENC_KEY_POS);
 }
 
 void HALBT_RemoveKey(struct rtw_adapter *padapter, u8 EntryNum)
index cfc9eb1276eae5030c705adce0c18f0db6087ccc..ba58bab2a3f66b48e2c172a8b813fdff45ac3646 100644 (file)
@@ -3157,10 +3157,6 @@ void SetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val)
                rtl8723a_odm_support_ability_clr(padapter, *val32);
                break;
 
-       case HW_VAR_CAM_WRITE:
-               rtl8723a_cam_write(padapter, val32[0], val32[1]);
-               break;
-
        case HW_VAR_AC_PARAM_VO:
                rtl8723a_set_ac_param_vo(padapter, *val32);
                break;
index b62ca2d4b5b4daae98fd31865719f167be90a5d4..9d036132ac4f446577ed9f9bb6f577289132980f 100644 (file)
@@ -183,7 +183,8 @@ void rtl8723a_ack_preamble(struct rtw_adapter *padapter, u8 bShortPreamble);
 void rtl8723a_set_sec_cfg(struct rtw_adapter *padapter, u8 sec);
 void rtl8723a_cam_empty_entry(struct rtw_adapter *padapter, u8 ucIndex);
 void rtl8723a_cam_invalid_all(struct rtw_adapter *padapter);
-void rtl8723a_cam_write(struct rtw_adapter *padapter, u32 val1, u32 val2);
+void rtl8723a_cam_write(struct rtw_adapter *padapter,
+                       u8 entry, u16 ctrl, u8 *mac, u8 *key);
 void rtl8723a_fifo_cleanup(struct rtw_adapter *padapter);
 void rtl8723a_set_apfm_on_mac(struct rtw_adapter *padapter, u8 val);
 void rtl8723a_bcn_valid(struct rtw_adapter *padapter);
index 72da07444212bdea9d6023ecab84438360be0b07..64fed853c2faab5598311a84e3fba1b23cd4fda4 100644 (file)
@@ -44,7 +44,6 @@ enum HW_VARIABLES {
        HW_VAR_DM_FUNC_OP,
        HW_VAR_DM_FUNC_SET,
        HW_VAR_DM_FUNC_CLR,
-       HW_VAR_CAM_WRITE,
        HW_VAR_CAM_READ,
        HW_VAR_AC_PARAM_VO,
        HW_VAR_AC_PARAM_VI,
index 060de9f3de836b051bd90b1d81dbe9f7ad66051c..b61fc95b1037946f284dbf4f2e5a993c2dbc04eb 100644 (file)
@@ -495,8 +495,6 @@ void SetBWMode23a(struct rtw_adapter *padapter, unsigned short bwmode,
 
 unsigned int decide_wait_for_beacon_timeout23a(unsigned int bcn_interval);
 
-void write_cam23a(struct rtw_adapter *padapter, u8 entry, u16 ctrl,
-              u8 *mac, u8 *key);
 void clear_cam_entry23a(struct rtw_adapter *padapter, u8 entry);
 
 void invalidate_cam_all23a(struct rtw_adapter *padapter);