staging: rtl8723au: Remove a bunch of calls via indirect HAL interface and call funct...
authorJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 9 Apr 2014 21:20:14 +0000 (23:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Apr 2014 15:28:58 +0000 (08:28 -0700)
The 'HW' variable interface is confusing and simply obfuscates the
code, so this is the first patch in a series to remove it and make
direct calls to the functions in place.

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/rtl8723a_hal_init.c
drivers/staging/rtl8723au/include/hal_intf.h
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
drivers/staging/rtl8723au/os_dep/os_intfs.c

index 4c753639ea5a64b27ada4d02ea1d343bf16ada04..7be834f996abf81ed7d3566a8767bb6f403d926f 100644 (file)
@@ -7561,7 +7561,7 @@ unsigned int send_beacon23a(struct rtw_adapter *padapter)
        unsigned long start = jiffies;
        unsigned int passing_time;
 
-       rtw_hal_set_hwreg23a(padapter, HW_VAR_BCN_VALID, NULL);
+       rtl8723a_bcn_valid(padapter);
        do {
                issue_beacon23a(padapter, 100);
                issue++;
@@ -8832,7 +8832,7 @@ void mlmeext_sta_del_event_callback23a(struct rtw_adapter *padapter)
        {
                /* set_opmode_cmd(padapter, infra_client_with_mlme); */
 
-               rtw_hal_set_hwreg23a(padapter, HW_VAR_MLME_DISCONNECT, NULL);
+               hw_var_set_mlme_disconnect(padapter);
                rtw_hal_set_hwreg23a(padapter, HW_VAR_BSSID, null_addr);
 
                /* restore to initial setting. */
@@ -9305,7 +9305,7 @@ u8 join_cmd_hdl23a(struct rtw_adapter *padapter, u8 *pbuf)
                /* Set_MSR23a(padapter, _HW_STATE_NOLINK_); */
                Set_MSR23a(padapter, _HW_STATE_STATION_);
 
-               rtw_hal_set_hwreg23a(padapter, HW_VAR_MLME_DISCONNECT, NULL);
+               hw_var_set_mlme_disconnect(padapter);
        }
 
        rtw_joinbss_reset23a(padapter);
@@ -9424,7 +9424,7 @@ u8 disconnect_hdl23a(struct rtw_adapter *padapter, unsigned char *pbuf)
 
        /* pmlmeinfo->state = WIFI_FW_NULL_STATE; */
 
-       rtw_hal_set_hwreg23a(padapter, HW_VAR_MLME_DISCONNECT, NULL);
+       hw_var_set_mlme_disconnect(padapter);
        rtw_hal_set_hwreg23a(padapter, HW_VAR_BSSID, null_addr);
 
        /* restore to initial setting. */
@@ -9644,7 +9644,7 @@ u8 setkey_hdl23a(struct rtw_adapter *padapter, u8 *pbuf)
        write_cam23a(padapter, pparm->keyid, ctrl, null_sta, pparm->key);
 
        /* allow multicast packets to driver */
-        padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_ON_RCR_AM, null_addr);
+       rtl8723a_on_rcr_am(padapter);
 
        return H2C_SUCCESS;
 }
index 0dfcfbce3b521f7fc241c3ead72136c0be75710d..3ed3beb2e6d31afb3afc48fdd7f332da38ba693e 100644 (file)
@@ -490,7 +490,7 @@ void CAM_empty_entry23a(struct rtw_adapter *Adapter, u8 ucIndex)
 
 void invalidate_cam_all23a(struct rtw_adapter *padapter)
 {
-       rtw_hal_set_hwreg23a(padapter, HW_VAR_CAM_INVALID_ALL, NULL);
+       rtl8723a_cam_invalid_all(padapter);
 }
 
 void write_cam23a(struct rtw_adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key)
@@ -561,7 +561,7 @@ void flush_all_cam_entry23a(struct rtw_adapter *padapter)
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
-       rtw_hal_set_hwreg23a(padapter, HW_VAR_CAM_INVALID_ALL, NULL);
+       rtl8723a_cam_invalid_all(padapter);
 
        memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info));
 }
@@ -1726,9 +1726,10 @@ void update_TSF23a(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
        pmlmeext->TSFValue |= le32_to_cpu(*pbuf);
 }
 
-void correct_TSF23a(struct rtw_adapter *padapter, struct mlme_ext_priv *pmlmeext)
+void correct_TSF23a(struct rtw_adapter *padapter,
+                   struct mlme_ext_priv *pmlmeext)
 {
-       rtw_hal_set_hwreg23a(padapter, HW_VAR_CORRECT_TSF, NULL);
+       hw_var_set_correct_tsf(padapter);
 }
 
 void beacon_timing_control23a(struct rtw_adapter *padapter)
index 0982b0a4ab9b37791ddcbe810330963ec836f5f1..a09716907569039357de57d051af3b45636ba9fa 100644 (file)
@@ -3018,7 +3018,7 @@ static void hw_var_set_bssid(struct rtw_adapter *padapter, u8 *val)
                rtw_write8(padapter, (reg_bssid + idx), val[idx]);
 }
 
-static void hw_var_set_correct_tsf(struct rtw_adapter *padapter)
+void hw_var_set_correct_tsf(struct rtw_adapter *padapter)
 {
        u64 tsf;
        u32 reg_tsftr;
@@ -3055,7 +3055,7 @@ static void hw_var_set_correct_tsf(struct rtw_adapter *padapter)
                ResumeTxBeacon(padapter);
 }
 
-static void hw_var_set_mlme_disconnect(struct rtw_adapter *padapter)
+void hw_var_set_mlme_disconnect(struct rtw_adapter *padapter)
 {
        /*  reject all data frames */
        rtw_write16(padapter, REG_RXFLTMAP2, 0);
@@ -3167,18 +3167,10 @@ void SetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val)
                rtl8723a_set_bcn_func(padapter, *val);
                break;
 
-       case HW_VAR_CORRECT_TSF:
-               hw_var_set_correct_tsf(padapter);
-               break;
-
        case HW_VAR_CHECK_BSSID:
                rtl8723a_check_bssid(padapter, *val);
                break;
 
-       case HW_VAR_MLME_DISCONNECT:
-               hw_var_set_mlme_disconnect(padapter);
-               break;
-
        case HW_VAR_MLME_SITESURVEY:
                rtl8723a_mlme_sitesurvey(padapter, *val);
                break;
@@ -3187,14 +3179,6 @@ void SetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val)
                hw_var_set_mlme_join(padapter, *val);
                break;
 
-       case HW_VAR_ON_RCR_AM:
-               rtl8723a_on_rcr_am(padapter);
-               break;
-
-       case HW_VAR_OFF_RCR_AM:
-               rtl8723a_off_rcr_am(padapter);
-               break;
-
        case HW_VAR_BEACON_INTERVAL:
                rtl8723a_set_beacon_interval(padapter, *((u16 *) val));
                break;
@@ -3234,10 +3218,6 @@ void SetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val)
                rtl8723a_cam_empty_entry(padapter, *val);
                break;
 
-       case HW_VAR_CAM_INVALID_ALL:
-               rtl8723a_cam_invalid_all(padapter);
-               break;
-
        case HW_VAR_CAM_WRITE:
                rtl8723a_cam_write(padapter, val32[0], val32[1]);
                break;
@@ -3297,9 +3277,6 @@ void SetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val)
        case HW_VAR_EFUSE_BT_BYTES:
                pHalData->BTEfuseUsedBytes = *((u16 *) val);
                break;
-       case HW_VAR_FIFO_CLEARN_UP:
-               rtl8723a_fifo_cleanup(padapter);
-               break;
        case HW_VAR_CHECK_TXBUF:
                break;
        case HW_VAR_APFM_ON_MAC:
@@ -3309,9 +3286,6 @@ void SetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val)
        case HW_VAR_NAV_UPPER:
                rtl8723a_set_nav_upper(padapter, *val32);
                break;
-       case HW_VAR_BCN_VALID:
-               rtl8723a_bcn_valid(padapter);
-               break;
        default:
                break;
        }
index d183f4ba1ecb295cc62992bc251c39fa5559cadc..5bd47136def7d9da04651ad4f05b65e23c75910c 100644 (file)
@@ -45,13 +45,9 @@ enum HW_VARIABLES {
        HW_VAR_BASIC_RATE,
        HW_VAR_TXPAUSE,
        HW_VAR_BCN_FUNC,
-       HW_VAR_CORRECT_TSF,
        HW_VAR_CHECK_BSSID,
-       HW_VAR_MLME_DISCONNECT,
        HW_VAR_MLME_SITESURVEY,
        HW_VAR_MLME_JOIN,
-       HW_VAR_ON_RCR_AM,
-       HW_VAR_OFF_RCR_AM,
        HW_VAR_BEACON_INTERVAL,
        HW_VAR_SLOT_TIME,
        HW_VAR_RESP_SIFS,
@@ -64,7 +60,6 @@ enum HW_VARIABLES {
        HW_VAR_DM_FUNC_SET,
        HW_VAR_DM_FUNC_CLR,
        HW_VAR_CAM_EMPTY_ENTRY,
-       HW_VAR_CAM_INVALID_ALL,
        HW_VAR_CAM_WRITE,
        HW_VAR_CAM_READ,
        HW_VAR_AC_PARAM_VO,
@@ -94,7 +89,6 @@ enum HW_VARIABLES {
        HW_VAR_SWITCH_EPHY_WoWLAN,
        HW_VAR_EFUSE_BYTES,
        HW_VAR_EFUSE_BT_BYTES,
-       HW_VAR_FIFO_CLEARN_UP,
        HW_VAR_CHECK_TXBUF,
        HW_VAR_APFM_ON_MAC, /* Auto FSM to Turn On, include clock, isolation, power control for MAC only */
        /*  The valid upper nav range for the HW updating, if the true value is larger than the upper range, the HW won't update it. */
@@ -388,5 +382,7 @@ void rtw_hal_reset_security_engine23a(struct rtw_adapter *adapter);
 
 s32 rtw_hal_c2h_handler23a(struct rtw_adapter *adapter, struct c2h_evt_hdr *c2h_evt);
 c2h_id_filter rtw_hal_c2h_id_filter_ccx23a(struct rtw_adapter *adapter);
+void hw_var_set_correct_tsf(struct rtw_adapter *padapter);
+void hw_var_set_mlme_disconnect(struct rtw_adapter *padapter);
 
 #endif /* __HAL_INTF_H__ */
index 50840b9a11fa06075ba0d58386a449957c5aa192..58366236777f17183a15b63c7fd267f11d3f0086 100644 (file)
@@ -1883,7 +1883,6 @@ static int rtw_cfg80211_set_wpa_ie(struct rtw_adapter *padapter, const u8 *pie,
        int wpa_ielen = 0;
        int wpa2_ielen = 0;
        u8 *pwpa, *pwpa2;
-       u8 null_addr[] = { 0, 0, 0, 0, 0, 0 };
        int i;
 
        if (!pie || !ielen) {
@@ -2097,7 +2096,7 @@ static int rtw_cfg80211_set_wpa_ie(struct rtw_adapter *padapter, const u8 *pie,
            padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
                /* WPS open need to enable multicast */
                /* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true)*/
-               rtw_hal_set_hwreg23a(padapter, HW_VAR_OFF_RCR_AM, null_addr);
+               rtl8723a_off_rcr_am(padapter);
 
        RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
                 ("rtw_set_wpa_ie: pairwise_cipher = 0x%08x padapter->"
index 57eca7a45672b94674677f88cfef688ca403c386..eab40d21fb3dbaf840704171677da2966c881d77 100644 (file)
@@ -887,7 +887,7 @@ void rtw_ips_pwr_down23a(struct rtw_adapter *padapter)
 
 void rtw_ips_dev_unload23a(struct rtw_adapter *padapter)
 {
-       rtw_hal_set_hwreg23a(padapter, HW_VAR_FIFO_CLEARN_UP, NULL);
+       rtl8723a_fifo_cleanup(padapter);
 
        if (padapter->intf_stop)
                padapter->intf_stop(padapter);