staging: rtl8723au: Eliminate HW_VAR_RF_TYPE usage
authorJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 9 Apr 2014 21:20:53 +0000 (23:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Apr 2014 15:29:12 +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_ap.c
drivers/staging/rtl8723au/core/rtw_ioctl_set.c
drivers/staging/rtl8723au/core/rtw_mlme.c
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_hal_init.c
drivers/staging/rtl8723au/include/hal_com.h
drivers/staging/rtl8723au/include/hal_intf.h
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c

index e68d13aa5db5b64e32bc01446bdf00419802f92b..131d787dac78cd50a2a145d36ec952583638996d 100644 (file)
@@ -374,9 +374,9 @@ void add_RATid23a(struct rtw_adapter *padapter, struct sta_info *psta, u8 rssi_l
                        tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value23a(psta->bssrateset[i]&0x7f);
        }
        /* n mode ra_bitmap */
-       if (psta_ht->ht_option)
-       {
-               rtw23a_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
+       if (psta_ht->ht_option) {
+               rf_type = rtl8723a_get_rf_type(padapter);
+
                if (rf_type == RF_2T2R)
                        limit = 16;/*  2R */
                else
@@ -989,7 +989,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf,  int len)
                ht_cap = true;
                network_type |= WIRELESS_11_24N;
 
-               rtw23a_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
+               rf_type = rtl8723a_get_rf_type(padapter);
 
                if ((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
                    (psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP))
index 30d7185e5637d719b1b27593a39282f4e14b202d..1f9d3a3d49200bfdbf3274f53c403d250e62d0ca 100644 (file)
@@ -577,8 +577,7 @@ u16 rtw_get_cur_max_rate23a(struct rtw_adapter *adapter)
                        short_GI_20 = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info&IEEE80211_HT_CAP_SGI_20) ? 1:0;
                        short_GI_40 = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info&IEEE80211_HT_CAP_SGI_40) ? 1:0;
 
-                       rtw23a_hal_get_hwreg(adapter, HW_VAR_RF_TYPE,
-                                         (u8 *)(&rf_type));
+                       rf_type = rtl8723a_get_rf_type(adapter);
                        max_rate = rtw_mcs_rate23a(rf_type, bw_40MHz &
                                                pregistrypriv->cbw40_enable,
                                                short_GI_20, short_GI_40,
index 717ba10c66a5c6c12d34a501af544f93f1381f03..f72bae42dcb007a95b5e81a7ea035246133de61a 100644 (file)
@@ -2305,16 +2305,14 @@ void rtw_update_ht_cap23a(struct rtw_adapter *padapter, u8 *pie, uint ie_len)
        /* update cur_bwmode & cur_ch_offset */
        if ((pregistrypriv->cbw40_enable) &&
                (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & BIT(1)) &&
-               (pmlmeinfo->HT_info.infos[0] & BIT(2)))
-       {
+               (pmlmeinfo->HT_info.infos[0] & BIT(2))) {
                int i;
-               u8      rf_type;
+               u8 rf_type;
 
-               padapter->HalFunc.GetHwRegHandler(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
+               rf_type = rtl8723a_get_rf_type(padapter);
 
                /* update the MCS rates */
-               for (i = 0; i < 16; i++)
-               {
+               for (i = 0; i < 16; i++) {
                        if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R))
                                pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R23A[i];
                        else
index ff7ff9eb240389f231204a02ed29ee2c5f807ebf..ae6ef6532af0832381c07544b3a7003950e0721f 100644 (file)
@@ -6454,8 +6454,7 @@ void issue_assocreq23a(struct rtw_adapter *padapter)
                        pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |=
                                0x000c;
 
-                       rtw23a_hal_get_hwreg(padapter, HW_VAR_RF_TYPE,
-                                            (u8 *)(&rf_type));
+                       rf_type = rtl8723a_get_rf_type(padapter);
                        /* switch (pregpriv->rf_config) */
                        switch (rf_type)
                        {
index 227280230deeb45434ac131ad86e7f73e58d6f3a..e364d7afc08d6497e4699ac1bbd48e3bbd9113a1 100644 (file)
@@ -770,7 +770,7 @@ void HT_caps_handler23a(struct rtw_adapter *padapter, struct ndis_802_11_var_ies
        pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info = le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info);
        pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps = le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps);
 
-       rtw23a_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
+       rf_type = rtl8723a_get_rf_type(padapter);
 
        /* update the MCS rates */
        for (i = 0; i < 16; i++) {
index 38fef52c60207322a48f0ceb84f38c9075500c52..c41781e6a5e52b446985e50dfc345b7e07ddb1ab 100644 (file)
@@ -889,3 +889,10 @@ void rtl8723a_set_rpwm(struct rtw_adapter *padapter, u8 val)
 {
        rtw_write8(padapter, REG_USB_HRPWM, val);
 }
+
+u8 rtl8723a_get_rf_type(struct rtw_adapter *padapter)
+{
+       struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
+
+       return pHalData->rf_type;
+}
index f8ceeb27fb767bd01e16f89c6f81f796c22eb73c..b3d398a75512198cd63024b521395f87423c01a6 100644 (file)
@@ -3134,13 +3134,7 @@ void hw_var_set_mlme_join(struct rtw_adapter *padapter, u8 type)
 
 void GetHwReg8723A(struct rtw_adapter *padapter, u8 variable, u8 *val)
 {
-       struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
-
        switch (variable) {
-       case HW_VAR_RF_TYPE:
-               *val = pHalData->rf_type;
-               break;
-
        case HW_VAR_FWLPS_RF_ON:
        {
                /*  When we halt NIC, we should check if FW LPS is leave. */
index 832cbac4ac9ed8f410c5a4bb6a594fac7cc23dde..d2e372c302f7eb19ea4f9f0084187b8166446be4 100644 (file)
@@ -207,5 +207,6 @@ void rtl8723a_odm_support_ability_set(struct rtw_adapter *padapter, u32 val);
 void rtl8723a_odm_support_ability_clr(struct rtw_adapter *padapter, u32 val);
 
 void rtl8723a_set_rpwm(struct rtw_adapter *padapter, u8 val);
+u8 rtl8723a_get_rf_type(struct rtw_adapter *padapter);
 
 #endif /* __HAL_COMMON_H__ */
index d38a670ca431d126b987c1f02eebfbc7eb134179..5bdf34b0e3d6a9e685b9a1974281954c84471ccb 100644 (file)
@@ -37,7 +37,6 @@ enum _CHIP_TYPE {
 
 enum HW_VARIABLES {
        HW_VAR_INIT_RTS_RATE,
-       HW_VAR_RF_TYPE,
        HW_VAR_CAM_READ,
        HW_VAR_FWLPS_RF_ON,
        HW_VAR_TDLS_WRCR,
index 58366236777f17183a15b63c7fd267f11d3f0086..fadc53cf6266399462ccee3d3b23bee0f2114a21 100644 (file)
@@ -4347,7 +4347,7 @@ void rtw_cfg80211_init_wiphy(struct rtw_adapter *padapter)
        struct wireless_dev *pwdev = padapter->rtw_wdev;
        struct wiphy *wiphy = pwdev->wiphy;
 
-       rtw23a_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
+       rf_type = rtl8723a_get_rf_type(padapter);
 
        DBG_8723A("%s:rf_type =%d\n", __func__, rf_type);