staging: rtl8723au: Eliminate HW_VAR_RF_TYPE usage

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jes Sorensen 2014-04-09 23:20:53 +02:00 committed by Greg Kroah-Hartman
parent b54e880440
commit c2370e83ab
10 changed files with 20 additions and 23 deletions

View 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))

View 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,

View 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

View 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)
{

View 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++) {

View 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;
}

View 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. */

View 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__ */

View 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,

View 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);