Commit 6ec26273 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Reduce number of duplicate defines for link state

We use the MSR bits to define link state anyway, so no point having an
additional two sets of defines for the same thing.
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ee225f0f
...@@ -52,7 +52,7 @@ void free_mlme_ap_info23a(struct rtw_adapter *padapter) ...@@ -52,7 +52,7 @@ void free_mlme_ap_info23a(struct rtw_adapter *padapter)
rtw_sta_flush23a(padapter); rtw_sta_flush23a(padapter);
pmlmeinfo->state = _HW_STATE_NOLINK_; pmlmeinfo->state = MSR_NOLINK;
/* free_assoc_sta_resources */ /* free_assoc_sta_resources */
rtw_free_all_stainfo23a(padapter); rtw_free_all_stainfo23a(padapter);
...@@ -688,7 +688,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) ...@@ -688,7 +688,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf)
} }
/* set MSR to AP_Mode */ /* set MSR to AP_Mode */
rtl8723a_set_media_status(padapter, _HW_STATE_AP_); rtl8723a_set_media_status(padapter, MSR_AP);
/* Set BSSID REG */ /* Set BSSID REG */
hw_var_set_bssid(padapter, pnetwork->MacAddress); hw_var_set_bssid(padapter, pnetwork->MacAddress);
...@@ -1703,7 +1703,7 @@ int rtw_ap_inform_ch_switch23a (struct rtw_adapter *padapter, u8 new_ch, u8 ch_o ...@@ -1703,7 +1703,7 @@ int rtw_ap_inform_ch_switch23a (struct rtw_adapter *padapter, u8 new_ch, u8 ch_o
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) if ((pmlmeinfo->state&0x03) != MSR_AP)
return ret; return ret;
DBG_8723A("%s(%s): with ch:%u, offset:%u\n", __func__, DBG_8723A("%s(%s): with ch:%u, offset:%u\n", __func__,
...@@ -1740,7 +1740,7 @@ int rtw_sta_flush23a(struct rtw_adapter *padapter) ...@@ -1740,7 +1740,7 @@ int rtw_sta_flush23a(struct rtw_adapter *padapter)
DBG_8723A("%s(%s)\n", __func__, padapter->pnetdev->name); DBG_8723A("%s(%s)\n", __func__, padapter->pnetdev->name);
if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) if ((pmlmeinfo->state&0x03) != MSR_AP)
return ret; return ret;
spin_lock_bh(&pstapriv->asoc_list_lock); spin_lock_bh(&pstapriv->asoc_list_lock);
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <drv_types.h> #include <drv_types.h>
#include <linux/ieee80211.h> #include <linux/ieee80211.h>
#include <wifi.h> #include <wifi.h>
#include <rtl8723a_spec.h>
static unsigned char ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f}; static unsigned char ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f};
static unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74}; static unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
...@@ -402,7 +403,7 @@ bool is_client_associated_to_ap23a(struct rtw_adapter *padapter) ...@@ -402,7 +403,7 @@ bool is_client_associated_to_ap23a(struct rtw_adapter *padapter)
pmlmeinfo = &pmlmeext->mlmext_info; pmlmeinfo = &pmlmeext->mlmext_info;
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS && if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS &&
(pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) (pmlmeinfo->state & 0x03) == MSR_INFRA)
return true; return true;
else else
return false; return false;
...@@ -414,7 +415,7 @@ bool is_client_associated_to_ibss23a(struct rtw_adapter *padapter) ...@@ -414,7 +415,7 @@ bool is_client_associated_to_ibss23a(struct rtw_adapter *padapter)
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS && if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS &&
(pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) (pmlmeinfo->state & 0x03) == MSR_ADHOC)
return true; return true;
else else
return false; return false;
......
...@@ -567,8 +567,8 @@ void rtl8723a_mlme_sitesurvey(struct rtw_adapter *padapter, u8 flag) ...@@ -567,8 +567,8 @@ void rtl8723a_mlme_sitesurvey(struct rtw_adapter *padapter, u8 flag)
pmlmeinfo = &pmlmeext->mlmext_info; pmlmeinfo = &pmlmeext->mlmext_info;
if ((is_client_associated_to_ap23a(padapter) == true) || if ((is_client_associated_to_ap23a(padapter) == true) ||
((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state & 0x03) == MSR_ADHOC) ||
((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) { ((pmlmeinfo->state & 0x03) == MSR_AP)) {
/* enable to rx data frame */ /* enable to rx data frame */
rtl8723au_write16(padapter, REG_RXFLTMAP2, 0xFFFF); rtl8723au_write16(padapter, REG_RXFLTMAP2, 0xFFFF);
......
...@@ -235,7 +235,7 @@ ConstructBeacon(struct rtw_adapter *padapter, u8 *pframe, u32 *pLength) ...@@ -235,7 +235,7 @@ ConstructBeacon(struct rtw_adapter *padapter, u8 *pframe, u32 *pLength)
pframe = mgmt->u.beacon.variable; pframe = mgmt->u.beacon.variable;
pktlen = offsetof(struct ieee80211_mgmt, u.beacon.variable); pktlen = offsetof(struct ieee80211_mgmt, u.beacon.variable);
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) { if ((pmlmeinfo->state&0x03) == MSR_AP) {
/* DBG_8723A("ie len =%d\n", cur_network->IELength); */ /* DBG_8723A("ie len =%d\n", cur_network->IELength); */
pktlen += cur_network->IELength; pktlen += cur_network->IELength;
memcpy(pframe, cur_network->IEs, pktlen); memcpy(pframe, cur_network->IEs, pktlen);
...@@ -259,7 +259,7 @@ ConstructBeacon(struct rtw_adapter *padapter, u8 *pframe, u32 *pLength) ...@@ -259,7 +259,7 @@ ConstructBeacon(struct rtw_adapter *padapter, u8 *pframe, u32 *pLength)
pframe = rtw_set_ie23a(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *) pframe = rtw_set_ie23a(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)
&cur_network->DSConfig, &pktlen); &cur_network->DSConfig, &pktlen);
if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) { if ((pmlmeinfo->state&0x03) == MSR_ADHOC) {
u32 ATIMWindow; u32 ATIMWindow;
/* IBSS Parameter Set... */ /* IBSS Parameter Set... */
/* ATIMWindow = cur->ATIMWindow; */ /* ATIMWindow = cur->ATIMWindow; */
......
...@@ -2300,18 +2300,18 @@ void hw_var_set_opmode(struct rtw_adapter *padapter, u8 mode) ...@@ -2300,18 +2300,18 @@ void hw_var_set_opmode(struct rtw_adapter *padapter, u8 mode)
{ {
u8 val8; u8 val8;
if ((mode == _HW_STATE_STATION_) || (mode == _HW_STATE_NOLINK_)) { if (mode == MSR_INFRA || mode == MSR_NOLINK) {
StopTxBeacon(padapter); StopTxBeacon(padapter);
/* disable atim wnd */ /* disable atim wnd */
val8 = DIS_TSF_UDT | EN_BCN_FUNCTION | DIS_ATIM; val8 = DIS_TSF_UDT | EN_BCN_FUNCTION | DIS_ATIM;
SetBcnCtrlReg23a(padapter, val8, ~val8); SetBcnCtrlReg23a(padapter, val8, ~val8);
} else if ((mode == _HW_STATE_ADHOC_) /*|| (mode == _HW_STATE_AP_) */) { } else if (mode == MSR_ADHOC) {
ResumeTxBeacon(padapter); ResumeTxBeacon(padapter);
val8 = DIS_TSF_UDT | EN_BCN_FUNCTION | DIS_BCNQ_SUB; val8 = DIS_TSF_UDT | EN_BCN_FUNCTION | DIS_BCNQ_SUB;
SetBcnCtrlReg23a(padapter, val8, ~val8); SetBcnCtrlReg23a(padapter, val8, ~val8);
} else if (mode == _HW_STATE_AP_) { } else if (mode == MSR_AP) {
/* add NULL Data and BT NULL Data Packets to FW RSVD Page */ /* add NULL Data and BT NULL Data Packets to FW RSVD Page */
rtl8723a_set_BTCoex_AP_mode_FwRsvdPkt_cmd(padapter); rtl8723a_set_BTCoex_AP_mode_FwRsvdPkt_cmd(padapter);
...@@ -2393,8 +2393,8 @@ void hw_var_set_correct_tsf(struct rtw_adapter *padapter) ...@@ -2393,8 +2393,8 @@ void hw_var_set_correct_tsf(struct rtw_adapter *padapter)
do_div(pmlmeext->TSFValue, do_div(pmlmeext->TSFValue,
(pmlmeinfo->bcn_interval * 1024)) - 1024; /* us */ (pmlmeinfo->bcn_interval * 1024)) - 1024; /* us */
if (((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) || if (((pmlmeinfo->state & 0x03) == MSR_ADHOC) ||
((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) { ((pmlmeinfo->state & 0x03) == MSR_AP)) {
/* pHalData->RegTxPause |= STOP_BCNQ;BIT(6) */ /* pHalData->RegTxPause |= STOP_BCNQ;BIT(6) */
/* rtl8723au_write8(padapter, REG_TXPAUSE, /* rtl8723au_write8(padapter, REG_TXPAUSE,
(rtl8723au_read8(Adapter, REG_TXPAUSE)|BIT(6))); */ (rtl8723au_read8(Adapter, REG_TXPAUSE)|BIT(6))); */
...@@ -2412,8 +2412,8 @@ void hw_var_set_correct_tsf(struct rtw_adapter *padapter) ...@@ -2412,8 +2412,8 @@ void hw_var_set_correct_tsf(struct rtw_adapter *padapter)
/* enable related TSF function */ /* enable related TSF function */
SetBcnCtrlReg23a(padapter, EN_BCN_FUNCTION, 0); SetBcnCtrlReg23a(padapter, EN_BCN_FUNCTION, 0);
if (((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) || if (((pmlmeinfo->state & 0x03) == MSR_ADHOC) ||
((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) ((pmlmeinfo->state & 0x03) == MSR_AP))
ResumeTxBeacon(padapter); ResumeTxBeacon(padapter);
} }
......
...@@ -282,16 +282,6 @@ struct ss_res ...@@ -282,16 +282,6 @@ struct ss_res
struct rtw_ieee80211_channel ch[RTW_CHANNEL_SCAN_AMOUNT]; struct rtw_ieee80211_channel ch[RTW_CHANNEL_SCAN_AMOUNT];
}; };
/* define AP_MODE 0x0C */
/* define STATION_MODE 0x08 */
/* define AD_HOC_MODE 0x04 */
/* define NO_LINK_MODE 0x00 */
#define WIFI_FW_NULL_STATE _HW_STATE_NOLINK_
#define WIFI_FW_STATION_STATE _HW_STATE_STATION_
#define WIFI_FW_AP_STATE _HW_STATE_AP_
#define WIFI_FW_ADHOC_STATE _HW_STATE_ADHOC_
#define WIFI_FW_AUTH_NULL 0x00000100 #define WIFI_FW_AUTH_NULL 0x00000100
#define WIFI_FW_AUTH_STATE 0x00000200 #define WIFI_FW_AUTH_STATE 0x00000200
#define WIFI_FW_AUTH_SUCCESS 0x00000400 #define WIFI_FW_AUTH_SUCCESS 0x00000400
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment