From: Jes Sorensen Date: Wed, 9 Apr 2014 21:20:53 +0000 (+0200) Subject: staging: rtl8723au: Eliminate HW_VAR_RF_TYPE usage X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2370e83ab5432e2d32e9c097930c69366d27b4c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: rtl8723au: Eliminate HW_VAR_RF_TYPE usage Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index e68d13aa5db5..131d787dac78 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -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)) diff --git a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c index 30d7185e5637..1f9d3a3d4920 100644 --- a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c @@ -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, diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index 717ba10c66a5..f72bae42dcb0 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -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 diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index ff7ff9eb2403..ae6ef6532af0 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -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) { diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c index 227280230dee..e364d7afc08d 100644 --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c @@ -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++) { diff --git a/drivers/staging/rtl8723au/hal/hal_com.c b/drivers/staging/rtl8723au/hal/hal_com.c index 38fef52c6020..c41781e6a5e5 100644 --- a/drivers/staging/rtl8723au/hal/hal_com.c +++ b/drivers/staging/rtl8723au/hal/hal_com.c @@ -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; +} diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index f8ceeb27fb76..b3d398a75512 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -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. */ diff --git a/drivers/staging/rtl8723au/include/hal_com.h b/drivers/staging/rtl8723au/include/hal_com.h index 832cbac4ac9e..d2e372c302f7 100644 --- a/drivers/staging/rtl8723au/include/hal_com.h +++ b/drivers/staging/rtl8723au/include/hal_com.h @@ -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__ */ diff --git a/drivers/staging/rtl8723au/include/hal_intf.h b/drivers/staging/rtl8723au/include/hal_intf.h index d38a670ca431..5bdf34b0e3d6 100644 --- a/drivers/staging/rtl8723au/include/hal_intf.h +++ b/drivers/staging/rtl8723au/include/hal_intf.h @@ -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, diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 58366236777f..fadc53cf6266 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -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);