mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-25 22:13:41 +00:00
rtl8188eu: Remove code selected when CONFIG_CONCURRENT_MODE is defined
This parameter can only be set for RTL8192DU. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
1305b2dc4b
commit
020675ff42
28 changed files with 78 additions and 3708 deletions
106
Makefile
106
Makefile
|
@ -250,18 +250,6 @@ KSRC := /media/DATA-2/android-x86/ics-x86_20120130/out/target/product/generic_x8
|
|||
MODULE_NAME :=wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_JB_X86), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
|
||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
||||
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
|
||||
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
|
||||
ARCH := $(SUBARCH)
|
||||
CROSS_COMPILE := /home/android_sdk/android-x86_JB/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7/bin/i686-linux-android-
|
||||
KSRC := /home/android_sdk/android-x86_JB/out/target/product/x86/obj/kernel/
|
||||
MODULE_NAME :=wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_PXA2XX), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
ARCH := arm
|
||||
|
@ -373,32 +361,6 @@ KVER := 2.6.18
|
|||
KSRC := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/lsp/ti-davinci/linux-dm365
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_TEGRA3_CARDHU), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
# default setting for Android 4.1, 4.2
|
||||
EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
|
||||
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
|
||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
||||
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
|
||||
KSRC := /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/out/target/product/cardhu/obj/KERNEL
|
||||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_TEGRA4_DALMORE), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
# default setting for Android 4.1, 4.2
|
||||
EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
|
||||
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
|
||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
||||
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
|
||||
KSRC := /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/out/target/product/dalmore/obj/KERNEL
|
||||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_TCC8900), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
ARCH := arm
|
||||
|
@ -415,18 +377,6 @@ KSRC := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/kernel
|
|||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_TCC8920_JB42), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
# default setting for Android 4.1, 4.2
|
||||
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
|
||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
||||
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
|
||||
KSRC := /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/kernel
|
||||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_RK2818), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS -DCONFIG_MINIMAL_MEMORY_USAGE
|
||||
ARCH := arm
|
||||
|
@ -478,62 +428,6 @@ KSRC := /home/winuser/work/Plat_sLD2T_V3010/usr/src/linux-2.6.32.2
|
|||
INSTALL_PREFIX :=
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_SUNxI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ARM_SUNxI
|
||||
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
# default setting for Android 4.1, 4.2
|
||||
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
|
||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
||||
EXTRA_CFLAGS += -DDCONFIG_P2P_IPS
|
||||
# default setting for A10-EVB mmc0
|
||||
ARCH := arm
|
||||
#CROSS_COMPILE := arm-none-linux-gnueabi-
|
||||
CROSS_COMPILE=/home/android_sdk/Allwinner/a10/android-jb42/lichee-jb42/buildroot/output/external-toolchain/bin/arm-none-linux-gnueabi-
|
||||
KVER := 3.0.8
|
||||
#KSRC:= ../lichee/linux-3.0/
|
||||
KSRC=/home/android_sdk/Allwinner/a10/android-jb42/lichee-jb42/linux-3.0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_SUN6I), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN6I
|
||||
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
# default setting for A31-EVB mmc0
|
||||
|
||||
EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT
|
||||
# default setting for Android 4.1, 4.2
|
||||
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
|
||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
||||
EXTRA_CFLAGS += -DCONFIG_P2P_IPS -DCONFIG_QOS_OPTIMIZATION
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /home/android_sdk/Allwinner/a31/android-jb42/lichee/buildroot/output/external-toolchain/bin/arm-linux-gnueabi-
|
||||
KVER := 3.3.0
|
||||
#KSRC:= ../lichee/linux-3.3/
|
||||
KSRC :=/home/android_sdk/Allwinner/a31/android-jb42/lichee/linux-3.3
|
||||
MODULE_NAME := 8188eu_sw
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_SUN7I), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN7I
|
||||
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT
|
||||
# default setting for Android 4.1, 4.2
|
||||
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
|
||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
||||
EXTRA_CFLAGS += -DCONFIG_P2P_IPS -DCONFIG_QOS_OPTIMIZATION
|
||||
ARCH := arm
|
||||
# Cross compile setting for Android 4.2 SDK
|
||||
#CROSS_COMPILE := /home/android_sdk/Allwinner/a20/sugar/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi-
|
||||
#KVER := 3.3.0
|
||||
#KSRC :=/home/android_sdk/Allwinner/a20/sugar/lichee/linux-3.3
|
||||
# Cross compile setting for Android 4.3 SDK
|
||||
CROSS_COMPILE := /home/android_sdk/Allwinner/a20/android-jb43/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi-
|
||||
KVER := 3.4.39
|
||||
KSRC :=/home/android_sdk/Allwinner/a20/android-jb43/lichee/linux-3.4
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ACTIONS_ATV5201), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ACTIONS_ATV5201
|
||||
ARCH := mips
|
||||
|
|
119
core/rtw_ap.c
119
core/rtw_ap.c
|
@ -1018,11 +1018,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
|
|||
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pnetwork->MacAddress);
|
||||
|
||||
//Set EDCA param reg
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
acparm = 0x005ea42b;
|
||||
#else
|
||||
acparm = 0x002F3217; // VO
|
||||
#endif
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VO, (u8 *)(&acparm));
|
||||
acparm = 0x005E4317; // VI
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VI, (u8 *)(&acparm));
|
||||
|
@ -1045,37 +1041,8 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
|
|||
|
||||
if(pmlmepriv->cur_network.join_res != true) //setting only at first time
|
||||
{
|
||||
//u32 initialgain;
|
||||
|
||||
//initialgain = 0x1e;
|
||||
|
||||
|
||||
//disable dynamic functions, such as high power, DIG
|
||||
//Save_DM_Func_Flag(padapter);
|
||||
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->adapter_type > PRIMARY_ADAPTER)
|
||||
{
|
||||
if(rtw_buddy_adapter_up(padapter))
|
||||
{
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
|
||||
//turn on all dynamic functions on PRIMARY_ADAPTER, dynamic functions only runs at PRIMARY_ADAPTER
|
||||
Switch_DM_Func(pbuddy_adapter, DYNAMIC_ALL_FUNC_ENABLE, true);
|
||||
|
||||
//rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain));
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
//turn on all dynamic functions
|
||||
Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true);
|
||||
|
||||
//rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain));
|
||||
}
|
||||
|
||||
//turn on all dynamic functions
|
||||
Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true);
|
||||
}
|
||||
#ifdef CONFIG_80211N_HT
|
||||
//set channel, bwmode
|
||||
|
@ -1116,89 +1083,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
|
|||
#else
|
||||
//TODO: need to judge the phy parameters on concurrent mode for single phy
|
||||
//set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(!check_buddy_fwstate(padapter, _FW_LINKED|_FW_UNDER_LINKING|_FW_UNDER_SURVEY))
|
||||
{
|
||||
set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode);
|
||||
}
|
||||
else if(check_buddy_fwstate(padapter, _FW_LINKED)==true)//only second adapter can enter AP Mode
|
||||
{
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
|
||||
//To sync cur_channel/cur_bwmode/cur_ch_offset with primary adapter
|
||||
DBG_871X("primary iface is at linked state, sync cur_channel/cur_bwmode/cur_ch_offset\n");
|
||||
DBG_871X("primary adapter, CH=%d, BW=%d, offset=%d\n", pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_bwmode, pbuddy_mlmeext->cur_ch_offset);
|
||||
DBG_871X("second adapter, CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset);
|
||||
|
||||
cur_channel = pbuddy_mlmeext->cur_channel;
|
||||
if(cur_bwmode == HT_CHANNEL_WIDTH_40)
|
||||
{
|
||||
if(pht_info)
|
||||
pht_info->infos[0] &= ~(BIT(0)|BIT(1));
|
||||
|
||||
if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40)
|
||||
{
|
||||
cur_ch_offset = pbuddy_mlmeext->cur_ch_offset;
|
||||
|
||||
//to update cur_ch_offset value in beacon
|
||||
if(pht_info)
|
||||
{
|
||||
switch(cur_ch_offset)
|
||||
{
|
||||
case HAL_PRIME_CHNL_OFFSET_LOWER:
|
||||
pht_info->infos[0] |= 0x1;
|
||||
break;
|
||||
case HAL_PRIME_CHNL_OFFSET_UPPER:
|
||||
pht_info->infos[0] |= 0x3;
|
||||
break;
|
||||
case HAL_PRIME_CHNL_OFFSET_DONT_CARE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_20)
|
||||
{
|
||||
cur_bwmode = HT_CHANNEL_WIDTH_20;
|
||||
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
|
||||
if(cur_channel>0 && cur_channel<5)
|
||||
{
|
||||
if(pht_info)
|
||||
pht_info->infos[0] |= 0x1;
|
||||
|
||||
cur_bwmode = HT_CHANNEL_WIDTH_40;
|
||||
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
|
||||
}
|
||||
|
||||
if(cur_channel>7 && cur_channel<(14+1))
|
||||
{
|
||||
if(pht_info)
|
||||
pht_info->infos[0] |= 0x3;
|
||||
|
||||
cur_bwmode = HT_CHANNEL_WIDTH_40;
|
||||
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
|
||||
}
|
||||
|
||||
set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// to update channel value in beacon
|
||||
pnetwork->Configuration.DSConfig = cur_channel;
|
||||
p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
|
||||
if(p && ie_len>0)
|
||||
*(p + 2) = cur_channel;
|
||||
|
||||
if(pht_info)
|
||||
pht_info->primary_channel = cur_channel;
|
||||
}
|
||||
#else
|
||||
set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode);
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
DBG_871X("CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset);
|
||||
|
||||
|
|
|
@ -336,12 +336,6 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
|||
|
||||
cmd_obj->padapter = padapter;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
//change pcmdpriv to primary's pcmdpriv
|
||||
if (padapter->adapter_type != PRIMARY_ADAPTER && padapter->pbuddy_adapter)
|
||||
pcmdpriv = &(padapter->pbuddy_adapter->cmdpriv);
|
||||
#endif
|
||||
|
||||
if( _FAIL == (res=rtw_cmd_filter(pcmdpriv, cmd_obj)) ) {
|
||||
rtw_free_cmd_obj(cmd_obj);
|
||||
goto exit;
|
||||
|
@ -353,9 +347,6 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
|||
_rtw_up_sema(&pcmdpriv->cmd_queue_sema);
|
||||
|
||||
exit:
|
||||
|
||||
;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -1781,13 +1772,6 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter*padapter)
|
|||
struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
|
||||
u8 res=_SUCCESS;
|
||||
|
||||
;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->adapter_type != PRIMARY_ADAPTER && padapter->pbuddy_adapter)
|
||||
pcmdpriv = &(padapter->pbuddy_adapter->cmdpriv);
|
||||
#endif
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
res= _FAIL;
|
||||
|
@ -2061,15 +2045,6 @@ u8 rtw_event_polling_cmd(struct adapter*padapter)
|
|||
struct cmd_priv *pcmdpriv=&padapter->cmdpriv;
|
||||
u8 res=_SUCCESS;
|
||||
|
||||
;
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (padapter->adapter_type != PRIMARY_ADAPTER)
|
||||
{
|
||||
return _FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
res= _FAIL;
|
||||
|
@ -2371,21 +2346,9 @@ u8 rtw_lps_ctrl_wk_cmd(struct adapter*padapter, u8 lps_ctrl_type, u8 enqueue)
|
|||
struct cmd_obj *ph2c;
|
||||
struct drvextra_cmd_parm *pdrvextra_cmd_parm;
|
||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
//struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
|
||||
u8 res = _SUCCESS;
|
||||
|
||||
;
|
||||
|
||||
//if(!pwrctrlpriv->bLeisurePs)
|
||||
// return res;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->iface_type != IFACE_PORT0)
|
||||
return res;
|
||||
#endif
|
||||
|
||||
if(enqueue)
|
||||
{
|
||||
if(enqueue) {
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
res= _FAIL;
|
||||
|
@ -2587,12 +2550,6 @@ u8 rtw_ps_cmd(struct adapter*padapter)
|
|||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
|
||||
u8 res = _SUCCESS;
|
||||
;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->adapter_type != PRIMARY_ADAPTER)
|
||||
goto exit;
|
||||
#endif
|
||||
|
||||
ppscmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ppscmd==NULL){
|
||||
|
|
142
core/rtw_mlme.c
142
core/rtw_mlme.c
|
@ -1214,9 +1214,6 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
#endif // CONFIG_P2P_PS
|
||||
|
||||
rtw_os_xmit_schedule(adapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_os_xmit_schedule(adapter->pbuddy_adapter);
|
||||
#endif
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
dc_resume_xmit(adapter);
|
||||
#endif
|
||||
|
@ -1562,15 +1559,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
|
|||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
psta->aid = pnetwork->join_res;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
|
||||
if(PRIMARY_ADAPTER == padapter->adapter_type)
|
||||
psta->mac_id=0;
|
||||
else
|
||||
psta->mac_id=2;
|
||||
#else
|
||||
psta->mac_id=0;
|
||||
#endif
|
||||
|
||||
//sta mode
|
||||
rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,psta,true);
|
||||
|
@ -1884,21 +1873,13 @@ void rtw_joinbss_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
{
|
||||
struct wlan_network *pnetwork = (struct wlan_network *)pbuf;
|
||||
|
||||
;
|
||||
|
||||
mlmeext_joinbss_event_callback(adapter, pnetwork->join_res);
|
||||
|
||||
rtw_os_xmit_schedule(adapter);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_os_xmit_schedule(adapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
dc_resume_xmit(adapter);
|
||||
#endif
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
static u8 search_max_mac_id(struct adapter *padapter)
|
||||
|
@ -2351,32 +2332,6 @@ static void rtw_auto_scan_handler(struct adapter *padapter)
|
|||
pmlmepriv->scan_interval--;
|
||||
if(pmlmepriv->scan_interval==0)
|
||||
{
|
||||
/*
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true)
|
||||
{
|
||||
DBG_871X("exit %s when _FW_UNDER_SURVEY|_FW_UNDER_LINKING -> \n", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
if(pmlmepriv->sitesurveyctrl.traffic_busy == true)
|
||||
{
|
||||
DBG_871X("%s exit cause traffic_busy(%x)\n",__FUNCTION__, pmlmepriv->sitesurveyctrl.traffic_busy);
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (rtw_buddy_adapter_up(padapter))
|
||||
{
|
||||
if ((check_buddy_fwstate(padapter, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) ||
|
||||
(padapter->pbuddy_adapter->mlmepriv.LinkDetectInfo.bBusyTraffic == true))
|
||||
{
|
||||
DBG_871X("%s, but buddy_intf is under scanning or linking or BusyTraffic\n", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
rtw_set_802_11_bssid_list_scan(padapter, NULL, 0);
|
||||
|
@ -2395,20 +2350,12 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
|
|||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
#endif //CONFIG_AP_MODE
|
||||
struct registry_priv *pregistrypriv = &adapter->registrypriv;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = adapter->pbuddy_adapter;
|
||||
#endif
|
||||
|
||||
if(!adapter)
|
||||
return;
|
||||
#if defined(CONFIG_CHECK_BT_HANG) && defined(CONFIG_BT_COEXIST)
|
||||
if(adapter->HalFunc.hal_checke_bt_hang)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (adapter->adapter_type == PRIMARY_ADAPTER)
|
||||
#endif
|
||||
adapter->HalFunc.hal_checke_bt_hang(adapter);
|
||||
}
|
||||
adapter->HalFunc.hal_checke_bt_hang(adapter);
|
||||
#endif
|
||||
if(adapter->hw_init_completed == false)
|
||||
return;
|
||||
|
@ -2416,21 +2363,8 @@ void rtw_dynamic_check_timer_handlder(struct adapter *adapter)
|
|||
if ((adapter->bDriverStopped == true)||(adapter->bSurpriseRemoved== true))
|
||||
return;
|
||||
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(pbuddy_adapter)
|
||||
{
|
||||
if(adapter->net_closed == true && pbuddy_adapter->net_closed == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
if(adapter->net_closed == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
rtw_dynamic_chk_wk_cmd(adapter);
|
||||
|
||||
|
@ -2513,26 +2447,10 @@ void rtw_set_scan_deny_timer_hdl(struct adapter *adapter)
|
|||
void rtw_set_scan_deny(struct adapter *adapter, u32 ms)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &adapter->mlmepriv;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct mlme_priv *b_mlmepriv;
|
||||
#endif
|
||||
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
|
||||
ATOMIC_SET(&mlmepriv->set_scan_deny, 1);
|
||||
_set_timer(&mlmepriv->set_scan_deny_timer, ms);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (!adapter->pbuddy_adapter)
|
||||
return;
|
||||
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter->pbuddy_adapter));
|
||||
b_mlmepriv = &adapter->pbuddy_adapter->mlmepriv;
|
||||
ATOMIC_SET(&b_mlmepriv->set_scan_deny, 1);
|
||||
_set_timer(&b_mlmepriv->set_scan_deny_timer, ms);
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -3532,61 +3450,3 @@ sint rtw_linked_check(struct adapter *padapter)
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sint rtw_buddy_adapter_up(struct adapter *padapter)
|
||||
{
|
||||
sint res = false;
|
||||
|
||||
if(padapter == NULL)
|
||||
return res;
|
||||
|
||||
|
||||
if(padapter->pbuddy_adapter == NULL)
|
||||
{
|
||||
res = false;
|
||||
}
|
||||
else if( (padapter->pbuddy_adapter->bDriverStopped) || (padapter->pbuddy_adapter->bSurpriseRemoved) ||
|
||||
(padapter->pbuddy_adapter->bup == false) || (padapter->pbuddy_adapter->hw_init_completed == false))
|
||||
{
|
||||
res = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = true;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
sint check_buddy_fwstate(struct adapter *padapter, sint state)
|
||||
{
|
||||
if(padapter == NULL)
|
||||
return false;
|
||||
|
||||
if(padapter->pbuddy_adapter == NULL)
|
||||
return false;
|
||||
|
||||
if ((state == WIFI_FW_NULL_STATE) &&
|
||||
(padapter->pbuddy_adapter->mlmepriv.fw_state == WIFI_FW_NULL_STATE))
|
||||
return true;
|
||||
|
||||
if (padapter->pbuddy_adapter->mlmepriv.fw_state & state)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
u8 rtw_get_buddy_bBusyTraffic(struct adapter *padapter)
|
||||
{
|
||||
if(padapter == NULL)
|
||||
return false;
|
||||
|
||||
if(padapter->pbuddy_adapter == NULL)
|
||||
return false;
|
||||
|
||||
return padapter->pbuddy_adapter->mlmepriv.LinkDetectInfo.bBusyTraffic;
|
||||
}
|
||||
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
|
File diff suppressed because it is too large
Load diff
572
core/rtw_p2p.c
572
core/rtw_p2p.c
|
@ -899,28 +899,6 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel
|
|||
// Todo: to add the list of WFD device info descriptor in WFD group.
|
||||
|
||||
}
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
#ifdef CONFIG_TDLS
|
||||
if ( ( tunneled == 0 ) && ( padapter->pbuddy_adapter->wdinfo.wfd_tdls_enable == 1 ) )
|
||||
{
|
||||
// Alternative MAC Address ATTR
|
||||
// Type:
|
||||
wfdie[ wfdielen++ ] = WFD_ATTR_ALTER_MAC;
|
||||
|
||||
// Length:
|
||||
// Note: In the WFD specification, the size of length field is 2.
|
||||
RTW_PUT_BE16(wfdie + wfdielen, ETH_ALEN );
|
||||
wfdielen += 2;
|
||||
|
||||
// Value:
|
||||
// Alternative MAC Address
|
||||
_rtw_memcpy( wfdie + wfdielen, &padapter->pbuddy_adapter->eeprompriv.mac_addr[ 0 ], ETH_ALEN );
|
||||
// This mac address is used to make the WFD session when TDLS is enable.
|
||||
|
||||
wfdielen += ETH_ALEN;
|
||||
}
|
||||
#endif // CONFIG_TDLS
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
|
||||
|
||||
|
@ -2695,12 +2673,6 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
#endif // CONFIG_TDLS
|
||||
#endif // CONFIG_WFD
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = pwdinfo->padapter->pbuddy_adapter;
|
||||
struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo;
|
||||
struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
#endif
|
||||
__be16 be_tmp;
|
||||
|
||||
if ( (wpsie=rtw_get_wps_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen)) )
|
||||
|
@ -2850,16 +2822,6 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
if ( !rtw_p2p_is_channel_list_ok( pwdinfo->operating_channel,
|
||||
ch_list_inclusioned, ch_num_inclusioned) )
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_buddy_fwstate(padapter, _FW_LINKED ) )
|
||||
{
|
||||
DBG_871X( "[%s] desired channel NOT Found!\n", __FUNCTION__ );
|
||||
result = P2P_STATUS_FAIL_NO_COMMON_CH;
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_FAIL);
|
||||
break;
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
u8 operatingch_info[5] = { 0x00 }, peer_operating_ch = 0;
|
||||
attr_contentlen = 0;
|
||||
|
@ -3096,16 +3058,6 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
|
|||
if ( !rtw_p2p_is_channel_list_ok( pwdinfo->operating_channel,
|
||||
ch_list_inclusioned, ch_num_inclusioned) )
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_buddy_fwstate(padapter, _FW_LINKED ) )
|
||||
{
|
||||
DBG_871X( "[%s] desired channel NOT Found!\n", __FUNCTION__ );
|
||||
result = P2P_STATUS_FAIL_NO_COMMON_CH;
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_FAIL);
|
||||
break;
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
u8 operatingch_info[5] = { 0x00 }, peer_operating_ch = 0;
|
||||
attr_contentlen = 0;
|
||||
|
@ -3232,17 +3184,7 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf
|
|||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_GO);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_buddy_fwstate(pwdinfo->padapter , _FW_LINKED ) )
|
||||
{
|
||||
// Switch back to the AP channel soon.
|
||||
_set_timer( &pwdinfo->ap_p2p_switch_timer, 100 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DEVICE);
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_FAIL);
|
||||
break;
|
||||
|
@ -3326,33 +3268,13 @@ static void restore_p2p_state_handler( struct adapter* padapter )
|
|||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DEVICE);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_buddy_fwstate(padapter, _FW_LINKED ) )
|
||||
{
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_RSP))
|
||||
{
|
||||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
|
||||
issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo));
|
||||
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE))
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
p2p_concurrent_handler( padapter );
|
||||
#else
|
||||
// In the P2P client mode, the driver should not switch back to its listen channel
|
||||
// because this P2P client should stay at the operating channel of P2P GO.
|
||||
set_channel_bwmode( padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3389,124 +3311,6 @@ static void pre_tx_negoreq_handler( struct adapter* padapter )
|
|||
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
void p2p_concurrent_handler( struct adapter* padapter )
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
//struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
//struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo;
|
||||
//struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
//struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
u8 val8;
|
||||
|
||||
if ( check_buddy_fwstate(padapter, _FW_LINKED ) )
|
||||
{
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
|
||||
pwdinfo->operating_channel = pbuddy_mlmeext->cur_channel;
|
||||
|
||||
if( pwdinfo->driver_interface == DRIVER_CFG80211 )
|
||||
{
|
||||
DBG_871X("%s, switch ch back to buddy's cur_channel=%d\n", __func__, pbuddy_mlmeext->cur_channel);
|
||||
|
||||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
|
||||
issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500);
|
||||
}
|
||||
else if( pwdinfo->driver_interface == DRIVER_WEXT )
|
||||
{
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
|
||||
{
|
||||
// Now, the driver stays on the AP's channel.
|
||||
// If the pwdinfo->ext_listen_period = 0, that means the P2P listen state is not available on listen channel.
|
||||
if ( pwdinfo->ext_listen_period > 0 )
|
||||
{
|
||||
DBG_8192C( "[%s] P2P_STATE_IDLE, ext_listen_period = %d\n", __FUNCTION__, pwdinfo->ext_listen_period );
|
||||
|
||||
if ( pbuddy_mlmeext->cur_channel != pwdinfo->listen_channel )
|
||||
{
|
||||
// Will switch to listen channel so that need to send the NULL data with PW bit to AP.
|
||||
issue_nulldata(pbuddy_adapter, NULL, 1, 3, 500);
|
||||
set_channel_bwmode(padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
}
|
||||
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN);
|
||||
val8 = 1;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
|
||||
// Todo: To check the value of pwdinfo->ext_listen_period is equal to 0 or not.
|
||||
_set_timer( &pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_period );
|
||||
}
|
||||
}
|
||||
else if ( rtw_p2p_chk_state(pwdinfo, P2P_STATE_LISTEN) ||
|
||||
rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL) ||
|
||||
( rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) && pwdinfo->nego_req_info.benable == false ) ||
|
||||
rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_REQ) )
|
||||
{
|
||||
// Now, the driver is in the listen state of P2P mode.
|
||||
DBG_8192C( "[%s] P2P_STATE_IDLE, ext_listen_interval = %d\n", __FUNCTION__, pwdinfo->ext_listen_interval );
|
||||
|
||||
// Commented by Albert 2012/11/01
|
||||
// If the AP's channel is the same as the listen channel, we should still be in the listen state
|
||||
// Other P2P device is still able to find this device out even this device is in the AP's channel.
|
||||
// So, configure this device to be able to receive the probe request frame and set it to listen state.
|
||||
if ( pbuddy_mlmeext->cur_channel != pwdinfo->listen_channel )
|
||||
{
|
||||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
val8 = 0;
|
||||
padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_IDLE);
|
||||
issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500);
|
||||
}
|
||||
|
||||
// Todo: To check the value of pwdinfo->ext_listen_interval is equal to 0 or not.
|
||||
_set_timer( &pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_interval );
|
||||
}
|
||||
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_OK))
|
||||
{
|
||||
// The driver had finished the P2P handshake successfully.
|
||||
val8 = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500);
|
||||
}
|
||||
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ))
|
||||
{
|
||||
val8 = 1;
|
||||
set_channel_bwmode(padapter, pwdinfo->tx_prov_disc_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
issue_probereq_p2p(padapter, NULL);
|
||||
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
|
||||
}
|
||||
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) && pwdinfo->nego_req_info.benable == true)
|
||||
{
|
||||
val8 = 1;
|
||||
set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
issue_probereq_p2p(padapter, NULL);
|
||||
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
|
||||
}
|
||||
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ ) && pwdinfo->invitereq_info.benable == true)
|
||||
{
|
||||
/*
|
||||
val8 = 1;
|
||||
set_channel_bwmode(padapter, , HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
issue_probereq_p2p(padapter, NULL);
|
||||
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
set_channel_bwmode( padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
static void ro_ch_handler(struct adapter *padapter)
|
||||
{
|
||||
|
@ -3560,12 +3364,6 @@ static void ro_ch_timer_process (void *FunctionContext)
|
|||
struct adapter *adapter = (struct adapter *)FunctionContext;
|
||||
struct rtw_wdev_priv *pwdev_priv = wdev_to_priv(adapter->rtw_wdev);
|
||||
|
||||
//printk("%s \n", __FUNCTION__);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
ATOMIC_SET(&pwdev_priv->ro_ch_to, 1);
|
||||
#endif
|
||||
|
||||
p2p_protocol_wk_cmd( adapter, P2P_RO_CH_WK);
|
||||
}
|
||||
|
||||
|
@ -3641,143 +3439,17 @@ static void rtw_change_p2pie_ch_list(struct adapter *padapter, const u8 *frame_b
|
|||
static bool rtw_chk_p2pie_ch_list_with_buddy(struct adapter *padapter, const u8 *frame_body, u32 len)
|
||||
{
|
||||
bool fit = false;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 *ies, *p2p_ie;
|
||||
u32 ies_len, p2p_ielen;
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
u8 buddy_ch = pbuddy_mlmeext->cur_channel;
|
||||
|
||||
ies = (u8*)(frame_body + _PUBLIC_ACTION_IE_OFFSET_);
|
||||
ies_len = len - _PUBLIC_ACTION_IE_OFFSET_;
|
||||
|
||||
p2p_ie = rtw_get_p2p_ie( ies, ies_len, NULL, &p2p_ielen );
|
||||
|
||||
while (p2p_ie) {
|
||||
u32 attr_contentlen = 0;
|
||||
u8 *pattr = NULL;
|
||||
|
||||
//Check P2P_ATTR_CH_LIST
|
||||
if ((pattr=rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, (uint*)&attr_contentlen))!=NULL) {
|
||||
int i;
|
||||
u32 num_of_ch;
|
||||
u8 *pattr_temp = pattr + 3 ;
|
||||
|
||||
attr_contentlen -= 3;
|
||||
|
||||
while (attr_contentlen>0) {
|
||||
num_of_ch = *(pattr_temp+1);
|
||||
|
||||
for(i=0; i<num_of_ch; i++) {
|
||||
if (*(pattr_temp+2+i) == buddy_ch) {
|
||||
DBG_871X(FUNC_ADPT_FMT" ch_list fit buddy_ch:%u\n", FUNC_ADPT_ARG(padapter), buddy_ch);
|
||||
fit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pattr_temp += (2+num_of_ch);
|
||||
attr_contentlen -= (2+num_of_ch);
|
||||
}
|
||||
}
|
||||
|
||||
//Get the next P2P IE
|
||||
p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen);
|
||||
}
|
||||
#endif
|
||||
return fit;
|
||||
}
|
||||
|
||||
static bool rtw_chk_p2pie_op_ch_with_buddy(struct adapter *padapter, const u8 *frame_body, u32 len)
|
||||
{
|
||||
bool fit = false;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 *ies, *p2p_ie;
|
||||
u32 ies_len, p2p_ielen;
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
u8 buddy_ch = pbuddy_mlmeext->cur_channel;
|
||||
|
||||
ies = (u8*)(frame_body + _PUBLIC_ACTION_IE_OFFSET_);
|
||||
ies_len = len - _PUBLIC_ACTION_IE_OFFSET_;
|
||||
|
||||
p2p_ie = rtw_get_p2p_ie( ies, ies_len, NULL, &p2p_ielen );
|
||||
|
||||
while (p2p_ie) {
|
||||
u32 attr_contentlen = 0;
|
||||
u8 *pattr = NULL;
|
||||
|
||||
//Check P2P_ATTR_OPERATING_CH
|
||||
attr_contentlen = 0;
|
||||
pattr = NULL;
|
||||
if((pattr = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, (uint*)&attr_contentlen))!=NULL) {
|
||||
if (*(pattr+4) == buddy_ch) {
|
||||
DBG_871X(FUNC_ADPT_FMT" op_ch fit buddy_ch:%u\n", FUNC_ADPT_ARG(padapter), buddy_ch);
|
||||
fit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Get the next P2P IE
|
||||
p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen);
|
||||
}
|
||||
#endif
|
||||
return fit;
|
||||
}
|
||||
|
||||
static void rtw_cfg80211_adjust_p2pie_channel(struct adapter *padapter, const u8 *frame_body, u32 len)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 *ies, *p2p_ie;
|
||||
u32 ies_len, p2p_ielen;
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
|
||||
ies = (u8*)(frame_body + _PUBLIC_ACTION_IE_OFFSET_);
|
||||
ies_len = len - _PUBLIC_ACTION_IE_OFFSET_;
|
||||
|
||||
p2p_ie = rtw_get_p2p_ie( ies, ies_len, NULL, &p2p_ielen );
|
||||
|
||||
while ( p2p_ie )
|
||||
{
|
||||
u32 attr_contentlen = 0;
|
||||
u8 *pattr = NULL;
|
||||
|
||||
//Check P2P_ATTR_CH_LIST
|
||||
if((pattr=rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, (uint*)&attr_contentlen))!=NULL)
|
||||
{
|
||||
int i;
|
||||
u32 num_of_ch;
|
||||
u8 *pattr_temp = pattr + 3 ;
|
||||
|
||||
attr_contentlen -= 3;
|
||||
|
||||
while(attr_contentlen>0)
|
||||
{
|
||||
num_of_ch = *(pattr_temp+1);
|
||||
|
||||
for(i=0; i<num_of_ch; i++)
|
||||
*(pattr_temp+2+i) = pbuddy_mlmeext->cur_channel;//forcing to the same channel
|
||||
|
||||
pattr_temp += (2+num_of_ch);
|
||||
attr_contentlen -= (2+num_of_ch);
|
||||
}
|
||||
}
|
||||
|
||||
//Check P2P_ATTR_OPERATING_CH
|
||||
attr_contentlen = 0;
|
||||
pattr = NULL;
|
||||
if((pattr = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, (uint*)&attr_contentlen))!=NULL)
|
||||
{
|
||||
*(pattr+4) = pbuddy_mlmeext->cur_channel;//forcing to the same channel
|
||||
}
|
||||
|
||||
//Get the next P2P IE
|
||||
p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
|
@ -4010,14 +3682,6 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx
|
|||
if(pwdev_priv->provdisc_req_issued == false)
|
||||
rtw_cfg80211_issue_p2p_provision_request(padapter, buf, len);
|
||||
#endif //CONFIG_DRV_ISSUE_PROV_REQ
|
||||
|
||||
//pwdev_priv->provdisc_req_issued = false;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED)
|
||||
|| check_buddy_fwstate(padapter, WIFI_AP_STATE))
|
||||
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, &cont_len)))
|
||||
|
@ -4041,33 +3705,12 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx
|
|||
dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128);
|
||||
DBG_871X("RTW_%s:P2P_GO_NEGO_REQ, dialogToken=%d, intent:%u%s, listen_ch:%d, op_ch:%d, ch_list:%s\n",
|
||||
(tx==true)?"Tx":"Rx", dialogToken, (intent>>1), intent&0x1 ? "+" : "-", listen_ch, op_ch, ch_list_buf);
|
||||
|
||||
if (!tx) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if((check_buddy_fwstate(padapter, _FW_LINKED)
|
||||
|| check_buddy_fwstate(padapter, WIFI_AP_STATE))
|
||||
&& rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)) == false)
|
||||
{
|
||||
DBG_871X(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter));
|
||||
rtw_change_p2pie_ch_list(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr), 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case P2P_GO_NEGO_RESP:
|
||||
{
|
||||
struct rtw_wdev_nego_info* nego_info = &pwdev_priv->nego_info;
|
||||
|
||||
if (tx) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED)
|
||||
|| check_buddy_fwstate(padapter, WIFI_AP_STATE))
|
||||
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, &cont_len)))
|
||||
op_ch = *(cont+4);
|
||||
if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GO_INTENT, NULL, &cont_len)))
|
||||
|
@ -4092,15 +3735,6 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx
|
|||
|
||||
if (!tx) {
|
||||
pwdev_priv->provdisc_req_issued = false;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if((check_buddy_fwstate(padapter, _FW_LINKED)
|
||||
|| check_buddy_fwstate(padapter, WIFI_AP_STATE))
|
||||
&& rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)) == false)
|
||||
{
|
||||
DBG_871X(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter));
|
||||
rtw_change_p2pie_ch_list(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr), 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -4110,14 +3744,6 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx
|
|||
struct rtw_wdev_nego_info* nego_info = &pwdev_priv->nego_info;
|
||||
bool is_go = false;
|
||||
|
||||
if (tx) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED)
|
||||
|| check_buddy_fwstate(padapter, WIFI_AP_STATE))
|
||||
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, &cont_len)))
|
||||
op_ch = *(cont+4);
|
||||
if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, NULL, &cont_len)))
|
||||
|
@ -4141,10 +3767,6 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx
|
|||
dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128);
|
||||
DBG_871X("RTW_%s:P2P_GO_NEGO_CONF, dialogToken=%d, status:%d, op_ch:%d, ch_list:%s\n",
|
||||
(tx==true)?"Tx":"Rx", dialogToken, status, op_ch, ch_list_buf);
|
||||
|
||||
if (!tx) {
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case P2P_INVIT_REQ:
|
||||
|
@ -4152,14 +3774,6 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx
|
|||
struct rtw_wdev_invit_info* invit_info = &pwdev_priv->invit_info;
|
||||
int flags = -1;
|
||||
|
||||
if (tx) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED)
|
||||
|| check_buddy_fwstate(padapter, WIFI_AP_STATE))
|
||||
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_INVITATION_FLAGS, NULL, &cont_len)))
|
||||
flags = *cont;
|
||||
if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, &cont_len)))
|
||||
|
@ -4179,35 +3793,12 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx
|
|||
DBG_871X("RTW_%s:P2P_INVIT_REQ, dialogToken=%d, flags:0x%02x, op_ch:%d, ch_list:%s\n",
|
||||
(tx==true)?"Tx":"Rx", dialogToken, flags, op_ch, ch_list_buf);
|
||||
|
||||
if (!tx) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED)
|
||||
|| check_buddy_fwstate(padapter, WIFI_AP_STATE)) {
|
||||
if (op_ch != -1 && rtw_chk_p2pie_op_ch_with_buddy(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)) == false) {
|
||||
DBG_871X(FUNC_ADPT_FMT" op_ch:%u has no intersect with buddy\n", FUNC_ADPT_ARG(padapter), op_ch);
|
||||
rtw_change_p2pie_ch_list(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr), 0);
|
||||
} else if (rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)) == false) {
|
||||
DBG_871X(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter));
|
||||
rtw_change_p2pie_ch_list(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr), 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case P2P_INVIT_RESP:
|
||||
{
|
||||
struct rtw_wdev_invit_info* invit_info = &pwdev_priv->invit_info;
|
||||
|
||||
if (tx) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED)
|
||||
|| check_buddy_fwstate(padapter, WIFI_AP_STATE))
|
||||
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, NULL, &cont_len)))
|
||||
{
|
||||
#ifdef CONFIG_P2P_INVITE_IOT
|
||||
|
@ -4358,62 +3949,14 @@ void p2p_protocol_wk_hdl(struct adapter *padapter, int intCmdType)
|
|||
break;
|
||||
}
|
||||
case P2P_PRE_TX_PROVDISC_PROCESS_WK:
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_buddy_fwstate(padapter, _FW_LINKED ) )
|
||||
{
|
||||
p2p_concurrent_handler( padapter );
|
||||
}
|
||||
else
|
||||
{
|
||||
pre_tx_provdisc_handler( padapter );
|
||||
}
|
||||
#else
|
||||
pre_tx_provdisc_handler( padapter );
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case P2P_PRE_TX_INVITEREQ_PROCESS_WK:
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_buddy_fwstate(padapter, _FW_LINKED ) )
|
||||
{
|
||||
p2p_concurrent_handler( padapter );
|
||||
}
|
||||
else
|
||||
{
|
||||
pre_tx_invitereq_handler( padapter );
|
||||
}
|
||||
#else
|
||||
pre_tx_invitereq_handler( padapter );
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case P2P_PRE_TX_NEGOREQ_PROCESS_WK:
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_buddy_fwstate(padapter, _FW_LINKED ) )
|
||||
{
|
||||
p2p_concurrent_handler( padapter );
|
||||
}
|
||||
else
|
||||
{
|
||||
pre_tx_negoreq_handler( padapter );
|
||||
}
|
||||
#else
|
||||
pre_tx_negoreq_handler( padapter );
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#ifdef CONFIG_P2P
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
case P2P_AP_P2P_CH_SWITCH_PROCESS_WK:
|
||||
{
|
||||
p2p_concurrent_handler( padapter );
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
case P2P_RO_CH_WK:
|
||||
{
|
||||
|
@ -4445,10 +3988,6 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength)
|
|||
{
|
||||
return;
|
||||
}
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->iface_type != IFACE_PORT0)
|
||||
return;
|
||||
#endif
|
||||
if(IELength <= _BEACON_IE_OFFSET_)
|
||||
return;
|
||||
|
||||
|
@ -4603,14 +4142,8 @@ u8 p2p_ps_wk_cmd(struct adapter*padapter, u8 p2p_ps_state, u8 enqueue)
|
|||
u8 res = _SUCCESS;
|
||||
|
||||
|
||||
if ( rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
|| (padapter->iface_type != IFACE_PORT0)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if ( rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return res;
|
||||
}
|
||||
|
||||
if(enqueue)
|
||||
{
|
||||
|
@ -4753,26 +4286,6 @@ static void find_phase_timer_process (void *FunctionContext)
|
|||
p2p_protocol_wk_cmd( adapter, P2P_FIND_PHASE_WK );
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
void ap_p2p_switch_timer_process (void *FunctionContext)
|
||||
{
|
||||
struct adapter *adapter = (struct adapter *)FunctionContext;
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
struct rtw_wdev_priv *pwdev_priv = wdev_to_priv(adapter->rtw_wdev);
|
||||
#endif
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
ATOMIC_SET(&pwdev_priv->switch_ch_to, 1);
|
||||
#endif
|
||||
|
||||
p2p_protocol_wk_cmd( adapter, P2P_AP_P2P_CH_SWITCH_PROCESS_WK );
|
||||
}
|
||||
#endif
|
||||
|
||||
void reset_global_wifidirect_info( struct adapter* padapter )
|
||||
{
|
||||
struct wifidirect_info *pwdinfo;
|
||||
|
@ -4818,9 +4331,6 @@ void rtw_init_wifidirect_timers(struct adapter* padapter)
|
|||
_init_timer( &pwdinfo->pre_tx_scan_timer, padapter->pnetdev, pre_tx_scan_timer_process, padapter );
|
||||
_init_timer( &pwdinfo->reset_ch_sitesurvey, padapter->pnetdev, reset_ch_sitesurvey_timer_process, padapter );
|
||||
_init_timer( &pwdinfo->reset_ch_sitesurvey2, padapter->pnetdev, reset_ch_sitesurvey_timer_process2, padapter );
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_init_timer( &pwdinfo->ap_p2p_switch_timer, padapter->pnetdev, ap_p2p_switch_timer_process, padapter );
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtw_init_wifidirect_addrs(struct adapter* padapter, u8 *dev_addr, u8 *iface_addr)
|
||||
|
@ -4844,12 +4354,6 @@ void init_wifidirect_info( struct adapter* padapter, enum P2P_ROLE role)
|
|||
#ifdef CONFIG_WFD
|
||||
struct wifi_display_info *pwfd_info = &padapter->wfd_info;
|
||||
#endif
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct wifidirect_info *pbuddy_wdinfo;
|
||||
struct mlme_priv *pbuddy_mlmepriv;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext;
|
||||
#endif
|
||||
|
||||
pwdinfo = &padapter->wdinfo;
|
||||
|
||||
|
@ -4861,53 +4365,20 @@ void init_wifidirect_info( struct adapter* padapter, enum P2P_ROLE role)
|
|||
pwdinfo->social_chan[2] = 11;
|
||||
pwdinfo->social_chan[3] = 0; // channel 0 for scanning ending in site survey function.
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (pbuddy_adapter) {
|
||||
pbuddy_wdinfo = &pbuddy_adapter->wdinfo;
|
||||
pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
}
|
||||
// Use the channel 11 as the listen channel
|
||||
pwdinfo->listen_channel = 11;
|
||||
|
||||
if ( ( check_buddy_fwstate(padapter, _FW_LINKED ) == true ) &&
|
||||
( ( pbuddy_mlmeext->cur_channel == 1) || ( pbuddy_mlmeext->cur_channel == 6 ) || ( pbuddy_mlmeext->cur_channel == 11 ) )
|
||||
)
|
||||
{
|
||||
// Use the AP's channel as the listen channel
|
||||
// This will avoid the channel switch between AP's channel and listen channel.
|
||||
pwdinfo->listen_channel = pbuddy_mlmeext->cur_channel;
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
// Use the channel 11 as the listen channel
|
||||
pwdinfo->listen_channel = 11;
|
||||
}
|
||||
|
||||
if (role == P2P_ROLE_DEVICE)
|
||||
{
|
||||
if (role == P2P_ROLE_DEVICE) {
|
||||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DEVICE);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_buddy_fwstate(padapter, _FW_LINKED ) == true )
|
||||
{
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_IDLE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN);
|
||||
}
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN);
|
||||
pwdinfo->intent = 1;
|
||||
rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_LISTEN);
|
||||
}
|
||||
else if (role == P2P_ROLE_CLIENT)
|
||||
{
|
||||
} else if (role == P2P_ROLE_CLIENT) {
|
||||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT);
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_OK);
|
||||
pwdinfo->intent = 1;
|
||||
rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_GONEGO_OK);
|
||||
}
|
||||
else if (role == P2P_ROLE_GO)
|
||||
{
|
||||
} else if (role == P2P_ROLE_GO) {
|
||||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_GO);
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_OK);
|
||||
pwdinfo->intent = 15;
|
||||
|
@ -4967,17 +4438,6 @@ void init_wifidirect_info( struct adapter* padapter, enum P2P_ROLE role)
|
|||
_rtw_memset( pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, 0x00, 4 );
|
||||
_rtw_memset( pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, '0', 3 );
|
||||
_rtw_memset( &pwdinfo->groupid_info, 0x00, sizeof( struct group_id_info ) );
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
pwdinfo->ext_listen_interval = 1000; //The interval to be available with legacy AP during p2p0-find/scan
|
||||
pwdinfo->ext_listen_period = 3000; //The time period to be available for P2P during nego
|
||||
#else //!CONFIG_IOCTL_CFG80211
|
||||
//pwdinfo->ext_listen_interval = 3000;
|
||||
//pwdinfo->ext_listen_period = 400;
|
||||
pwdinfo->ext_listen_interval = 1000;
|
||||
pwdinfo->ext_listen_period = 1000;
|
||||
#endif //!CONFIG_IOCTL_CFG80211
|
||||
#endif
|
||||
|
||||
// Commented by Kurt 20130319
|
||||
// For WiDi purpose: Use CFG80211 interface but controled WFD/RDS frame by driver itself.
|
||||
|
@ -5147,19 +4607,6 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
|
|||
u8 channel, ch_offset;
|
||||
u16 bwmode;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo;
|
||||
// Commented by Albert 2011/12/30
|
||||
// The driver just supports 1 P2P group operation.
|
||||
// So, this function will do nothing if the buddy adapter had enabled the P2P function.
|
||||
if(!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE))
|
||||
{
|
||||
// The buddy adapter had enabled the P2P function.
|
||||
return ret;
|
||||
}
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
//leave IPS/Autosuspend
|
||||
if (_FAIL == rtw_pwr_wakeup(padapter)) {
|
||||
ret = _FAIL;
|
||||
|
@ -5207,9 +4654,6 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
|
|||
_cancel_timer_ex( &pwdinfo->reset_ch_sitesurvey2);
|
||||
reset_ch_sitesurvey_timer_process( padapter );
|
||||
reset_ch_sitesurvey_timer_process2( padapter );
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_cancel_timer_ex( &pwdinfo->ap_p2p_switch_timer);
|
||||
#endif
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_NONE);
|
||||
rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_NONE);
|
||||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DISABLE);
|
||||
|
|
|
@ -727,45 +727,10 @@ void LPS_Enter(struct adapter *padapter)
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct adapter *buddy = padapter->pbuddy_adapter;
|
||||
|
||||
;
|
||||
|
||||
// DBG_871X("+LeisurePSEnter\n");
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->iface_type != IFACE_PORT0)
|
||||
return; /* Skip power saving for concurrent mode port 1*/
|
||||
|
||||
/* consider buddy, if exist */
|
||||
if (buddy) {
|
||||
struct mlme_priv *b_pmlmepriv = &(buddy->mlmepriv);
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *b_pwdinfo = &(buddy->wdinfo);
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
struct cfg80211_wifidirect_info *b_pcfg80211_wdinfo = &buddy->cfg80211_wdinfo;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (check_fwstate(b_pmlmepriv, WIFI_ASOC_STATE|WIFI_SITE_MONITOR)
|
||||
|| check_fwstate(b_pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS)
|
||||
|| check_fwstate(b_pmlmepriv, WIFI_AP_STATE)
|
||||
|| check_fwstate(b_pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_ADHOC_STATE)
|
||||
#if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211) && defined(CONFIG_P2P_IPS)
|
||||
|| b_pcfg80211_wdinfo->is_ro_ch
|
||||
#elif defined(CONFIG_P2P)
|
||||
|| !rtw_p2p_chk_state(b_pwdinfo, P2P_STATE_NONE)
|
||||
#endif
|
||||
|| rtw_is_scan_deny(buddy)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (PS_RDY_CHECK(padapter) == false)
|
||||
return;
|
||||
|
||||
if (true == pwrpriv->bLeisurePs)
|
||||
{
|
||||
if (pwrpriv->bLeisurePs) {
|
||||
// Idle for a while if we connect to AP a while ago.
|
||||
if(pwrpriv->LpsIdleCount >= 2) // 4 Sec
|
||||
{
|
||||
|
@ -780,10 +745,6 @@ void LPS_Enter(struct adapter *padapter)
|
|||
else
|
||||
pwrpriv->LpsIdleCount++;
|
||||
}
|
||||
|
||||
// DBG_871X("-LeisurePSEnter\n");
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -798,19 +759,8 @@ void LPS_Leave(struct adapter *padapter)
|
|||
u32 start_time;
|
||||
u8 bAwake = false;
|
||||
|
||||
;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->iface_type != IFACE_PORT0)
|
||||
return; /* Skip power saving for concurrent mode port 1*/
|
||||
#endif
|
||||
|
||||
// DBG_871X("+LeisurePSLeave\n");
|
||||
|
||||
if (pwrpriv->bLeisurePs)
|
||||
{
|
||||
if(pwrpriv->pwr_mode != PS_MODE_ACTIVE)
|
||||
{
|
||||
if (pwrpriv->bLeisurePs) {
|
||||
if(pwrpriv->pwr_mode != PS_MODE_ACTIVE) {
|
||||
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0x40);
|
||||
|
||||
if(pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
|
@ -1400,13 +1350,6 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
|
|||
{
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (padapter->adapter_type != PRIMARY_ADAPTER)
|
||||
return;
|
||||
#endif
|
||||
|
||||
;
|
||||
|
||||
_init_pwrlock(&pwrctrlpriv->lock);
|
||||
pwrctrlpriv->rf_pwrstate = rf_on;
|
||||
pwrctrlpriv->ips_enter_cnts=0;
|
||||
|
@ -1483,16 +1426,6 @@ void rtw_free_pwrctrl_priv(struct adapter *adapter)
|
|||
{
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(adapter);
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (adapter->adapter_type != PRIMARY_ADAPTER)
|
||||
return;
|
||||
#endif
|
||||
|
||||
;
|
||||
|
||||
//_rtw_memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv));
|
||||
|
||||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
if (pwrctrlpriv->rtw_workqueue) {
|
||||
flush_workqueue(pwrctrlpriv->rtw_workqueue);
|
||||
|
@ -1506,8 +1439,6 @@ void rtw_free_pwrctrl_priv(struct adapter *adapter)
|
|||
#endif //CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER
|
||||
|
||||
_free_pwrlock(&pwrctrlpriv->lock);
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
|
@ -1678,16 +1609,6 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
int ret = _SUCCESS;
|
||||
u32 start = rtw_get_current_time();
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->pbuddy_adapter)
|
||||
LeaveAllPowerSaveMode(padapter->pbuddy_adapter);
|
||||
|
||||
if ((padapter->isprimary == false) && padapter->pbuddy_adapter){
|
||||
padapter = padapter->pbuddy_adapter;
|
||||
pmlmepriv = &padapter->mlmepriv;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pwrpriv->ips_deny_time < rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms))
|
||||
pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms);
|
||||
|
||||
|
|
|
@ -241,19 +241,6 @@ int rtw_free_recvframe(union recv_frame *precvframe, _queue *pfree_recv_queue)
|
|||
struct adapter *padapter=precvframe->u.hdr.adapter;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
|
||||
;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->adapter_type > PRIMARY_ADAPTER)
|
||||
{
|
||||
padapter = padapter->pbuddy_adapter;//get primary_padapter
|
||||
precvpriv = &padapter->recvpriv;
|
||||
pfree_recv_queue = &precvpriv->free_recv_queue;
|
||||
precvframe->u.hdr.adapter = padapter;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if(precvframe->u.hdr.pkt)
|
||||
{
|
||||
#ifdef CONFIG_BSD_RX_USE_MBUF
|
||||
|
@ -625,10 +612,6 @@ static union recv_frame *decryptor(struct adapter *padapter,union recv_frame *pr
|
|||
|
||||
if((prxattrib->encrypt>0) && ((prxattrib->bdecrypted==0) ||(psecuritypriv->sw_decrypt==true)))
|
||||
{
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(!IS_MCAST(prxattrib->ra))//bc/mc packets use sw decryption for concurrent mode
|
||||
#endif
|
||||
psecuritypriv->hw_decrypted=false;
|
||||
|
||||
#ifdef DBG_RX_DECRYPTOR
|
||||
|
@ -3675,11 +3658,6 @@ void rtw_signal_stat_timer_hdl(RTW_TIMER_HDL_ARGS){
|
|||
goto set_timer;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (check_buddy_fwstate(adapter, _FW_UNDER_SURVEY) == true)
|
||||
goto set_timer;
|
||||
#endif
|
||||
|
||||
//update value of signal_strength, rssi, signal_qual
|
||||
tmp_s = (avg_signal_strength+(_alpha-1)*recvpriv->signal_strength);
|
||||
if(tmp_s %_alpha)
|
||||
|
|
|
@ -291,9 +291,6 @@ void sreset_reset(struct adapter *padapter)
|
|||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
sreset_stop_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_stop_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
_ips_enter(padapter);
|
||||
|
@ -301,9 +298,6 @@ void sreset_reset(struct adapter *padapter)
|
|||
#endif
|
||||
|
||||
sreset_start_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_start_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
psrtpriv->silent_reset_inprogress = false;
|
||||
|
||||
|
|
|
@ -385,16 +385,7 @@ static void Set_NETYPE0_MSR(struct adapter *padapter, u8 type)
|
|||
|
||||
void Set_MSR(struct adapter *padapter, u8 type)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->iface_type == IFACE_PORT1)
|
||||
{
|
||||
Set_NETYPE1_MSR(padapter, type);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
Set_NETYPE0_MSR(padapter, type);
|
||||
}
|
||||
Set_NETYPE0_MSR(padapter, type);
|
||||
}
|
||||
|
||||
inline u8 rtw_get_oper_ch(struct adapter *adapter)
|
||||
|
@ -737,42 +728,7 @@ void flush_all_cam_entry(struct adapter *padapter)
|
|||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
//if(check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_))
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED) == false) {
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0);
|
||||
} else {
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
u8 cam_id;//cam_entry
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress);
|
||||
if(psta) {
|
||||
if(psta->state & WIFI_AP_STATE)
|
||||
{} //clear cam when ap free per sta_info
|
||||
else {
|
||||
if(psta->mac_id==2)
|
||||
cam_id = 5;
|
||||
else
|
||||
cam_id = 4;
|
||||
}
|
||||
//clear_cam_entry(padapter, cam_id);
|
||||
rtw_clearstakey_cmd(padapter, (u8*)psta, cam_id, false);
|
||||
}
|
||||
} else if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
|
||||
//clear cam when ap free per sta_info
|
||||
}
|
||||
}
|
||||
#else //CONFIG_CONCURRENT_MODE
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, NULL);
|
||||
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info));
|
||||
}
|
||||
|
||||
|
|
|
@ -899,27 +899,16 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib
|
|||
pattrib->bswenc = false;
|
||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("update_attrib: bswenc=false\n"));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if((pattrib->encrypt && bmcast) || (pattrib->encrypt ==_WEP40_) || (pattrib->encrypt ==_WEP104_))
|
||||
{
|
||||
pattrib->bswenc = true;//force using sw enc.
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if(pattrib->encrypt == _SMS4_)
|
||||
pattrib->bswenc = false;
|
||||
#endif
|
||||
|
||||
rtw_set_tx_chksum_offload(pkt, pattrib);
|
||||
|
||||
update_attrib_phy_info(pattrib, psta);
|
||||
|
||||
exit:
|
||||
|
||||
;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -3184,11 +3173,6 @@ static void do_queue_select(struct adapter *padapter, struct pkt_attrib *pattrib
|
|||
qsel = pattrib->priority;
|
||||
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("### do_queue_select priority=%d ,qsel = %d\n",pattrib->priority ,qsel));
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
// if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true)
|
||||
// qsel = 7;//
|
||||
#endif
|
||||
|
||||
pattrib->qsel = qsel;
|
||||
}
|
||||
|
||||
|
|
|
@ -315,10 +315,6 @@ Hal_MappingOutPipe(
|
|||
void hal_init_macaddr(struct adapter *adapter)
|
||||
{
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_MAC_ADDR, adapter->eeprompriv.mac_addr);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (adapter->pbuddy_adapter)
|
||||
rtw_hal_set_hwreg(adapter->pbuddy_adapter, HW_VAR_MAC_ADDR, adapter->pbuddy_adapter->eeprompriv.mac_addr);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -443,10 +443,6 @@ void rtw_hal_set_chan(struct adapter *padapter, u8 channel)
|
|||
|
||||
void rtw_hal_dm_watchdog(struct adapter *padapter)
|
||||
{
|
||||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (padapter->adapter_type != PRIMARY_ADAPTER)
|
||||
return;
|
||||
#endif
|
||||
if(padapter->HalFunc.hal_dm_watchdog)
|
||||
padapter->HalFunc.hal_dm_watchdog(padapter);
|
||||
}
|
||||
|
|
|
@ -315,11 +315,6 @@ rtl8188e_HalDmWatchDog(
|
|||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = Adapter->pbuddy_adapter;
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
;
|
||||
|
||||
hw_init_completed = Adapter->hw_init_completed;
|
||||
|
||||
|
@ -361,19 +356,11 @@ rtl8188e_HalDmWatchDog(
|
|||
if(rtw_linked_check(Adapter))
|
||||
bLinked = true;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(pbuddy_adapter && rtw_linked_check(pbuddy_adapter))
|
||||
bLinked = true;
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
ODM_CmnInfoUpdate(&pHalData->odmpriv ,ODM_CMNINFO_LINK, bLinked);
|
||||
|
||||
|
||||
if (check_fwstate(&Adapter->mlmepriv, WIFI_STATION_STATE))
|
||||
bsta_state = true;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(pbuddy_adapter && check_fwstate(&pbuddy_adapter->mlmepriv, WIFI_STATION_STATE))
|
||||
bsta_state = true;
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
ODM_CmnInfoUpdate(&pHalData->odmpriv ,ODM_CMNINFO_STATION_STATE, bsta_state);
|
||||
|
||||
ODM_DMWatchdog(&pHalData->odmpriv);
|
||||
|
|
|
@ -1088,30 +1088,15 @@ static s32 pre_xmitframe(struct adapter *padapter, struct xmit_frame *pxmitframe
|
|||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_priv *pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv);
|
||||
#endif
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
//DBG_8192C("==> %s \n",__FUNCTION__);
|
||||
|
||||
if (rtw_txframes_sta_ac_pending(padapter, pattrib) > 0)
|
||||
{
|
||||
//DBG_8192C("enqueue AC(%d)\n",pattrib->priority);
|
||||
goto enqueue;
|
||||
}
|
||||
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true)
|
||||
goto enqueue;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (check_fwstate(pbuddy_mlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true)
|
||||
goto enqueue;
|
||||
#endif
|
||||
|
||||
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
|
||||
if (pxmitbuf == NULL)
|
||||
goto enqueue;
|
||||
|
|
|
@ -299,11 +299,6 @@ _SetMacID(
|
|||
{
|
||||
u32 i;
|
||||
for(i=0 ; i< MAC_ADDR_LEN ; i++){
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
rtw_write32(Adapter, REG_MACID1+i, MacID[i]);
|
||||
else
|
||||
#endif
|
||||
rtw_write32(Adapter, REG_MACID+i, MacID[i]);
|
||||
}
|
||||
}
|
||||
|
@ -315,11 +310,6 @@ _SetBSSID(
|
|||
{
|
||||
u32 i;
|
||||
for(i=0 ; i< MAC_ADDR_LEN ; i++){
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
rtw_write32(Adapter, REG_BSSID1+i, BSSID[i]);
|
||||
else
|
||||
#endif
|
||||
rtw_write32(Adapter, REG_BSSID+i, BSSID[i]);
|
||||
}
|
||||
}
|
||||
|
@ -1581,7 +1571,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC02);
|
|||
rtw_write32(Adapter,REG_MACID_NO_LINK_0,0xFFFFFFFF);
|
||||
rtw_write32(Adapter,REG_MACID_NO_LINK_1,0xFFFFFFFF);
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_TX_MCAST2UNI)
|
||||
#if defined(CONFIG_TX_MCAST2UNI)
|
||||
|
||||
#ifdef CONFIG_CHECK_AC_LIFETIME
|
||||
// Enable lifetime check for the four ACs
|
||||
|
@ -1595,7 +1585,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC02);
|
|||
rtw_write16(Adapter, REG_PKT_VO_VI_LIFE_TIME, 0x3000); // unit: 256us. 3s
|
||||
rtw_write16(Adapter, REG_PKT_BE_BK_LIFE_TIME, 0x3000); // unit: 256us. 3s
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
#endif // CONFIG_CONCURRENT_MODE || CONFIG_TX_MCAST2UNI
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
|
||||
|
||||
#ifdef CONFIG_LED
|
||||
|
@ -2419,119 +2409,6 @@ static void hw_var_set_opmode(struct adapter *Adapter, u8 variable, u8* val)
|
|||
u8 mode = *((u8 *)val);
|
||||
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
{
|
||||
// disable Port1 TSF update
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)|BIT(4));
|
||||
|
||||
// set net_type
|
||||
val8 = rtw_read8(Adapter, MSR)&0x03;
|
||||
val8 |= (mode<<2);
|
||||
rtw_write8(Adapter, MSR, val8);
|
||||
|
||||
DBG_871X("%s()-%d mode = %d\n", __FUNCTION__, __LINE__, mode);
|
||||
|
||||
if((mode == _HW_STATE_STATION_) || (mode == _HW_STATE_NOLINK_))
|
||||
{
|
||||
if(!check_buddy_mlmeinfo_state(Adapter, WIFI_FW_AP_STATE))
|
||||
{
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN
|
||||
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
rtw_write8(Adapter, REG_DRVERLYINT, 0x05);//restore early int time to 5ms
|
||||
UpdateInterruptMask8188EU(Adapter,true, 0, IMR_BCNDMAINT0_88E);
|
||||
#endif // CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
UpdateInterruptMask8188EU(Adapter,true ,0, (IMR_TBDER_88E|IMR_TBDOK_88E));
|
||||
#endif// CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
|
||||
#endif //CONFIG_INTERRUPT_BASED_TXBCN
|
||||
|
||||
|
||||
StopTxBeacon(Adapter);
|
||||
}
|
||||
|
||||
rtw_write8(Adapter,REG_BCN_CTRL_1, 0x11);//disable atim wnd and disable beacon function
|
||||
//rtw_write8(Adapter,REG_BCN_CTRL_1, 0x18);
|
||||
}
|
||||
else if((mode == _HW_STATE_ADHOC_) /*|| (mode == _HW_STATE_AP_)*/)
|
||||
{
|
||||
ResumeTxBeacon(Adapter);
|
||||
rtw_write8(Adapter,REG_BCN_CTRL_1, 0x1a);
|
||||
//BIT4 - If set 0, hw will clr bcnq when tx becon ok/fail or port 1
|
||||
rtw_write8(Adapter, REG_MBID_NUM, rtw_read8(Adapter, REG_MBID_NUM)|BIT(3)|BIT(4));
|
||||
}
|
||||
else if(mode == _HW_STATE_AP_)
|
||||
{
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
UpdateInterruptMask8188EU(Adapter,true ,IMR_BCNDMAINT0_88E, 0);
|
||||
#endif//CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
UpdateInterruptMask8188EU(Adapter,true ,(IMR_TBDER_88E|IMR_TBDOK_88E), 0);
|
||||
#endif//CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
|
||||
#endif //CONFIG_INTERRUPT_BASED_TXBCN
|
||||
|
||||
ResumeTxBeacon(Adapter);
|
||||
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, 0x12);
|
||||
|
||||
//Set RCR
|
||||
//rtw_write32(padapter, REG_RCR, 0x70002a8e);//CBSSID_DATA must set to 0
|
||||
//rtw_write32(Adapter, REG_RCR, 0x7000228e);//CBSSID_DATA must set to 0
|
||||
rtw_write32(Adapter, REG_RCR, 0x7000208e);//CBSSID_DATA must set to 0,reject ICV_ERR packet
|
||||
//enable to rx data frame
|
||||
rtw_write16(Adapter, REG_RXFLTMAP2, 0xFFFF);
|
||||
//enable to rx ps-poll
|
||||
rtw_write16(Adapter, REG_RXFLTMAP1, 0x0400);
|
||||
|
||||
//Beacon Control related register for first time
|
||||
rtw_write8(Adapter, REG_BCNDMATIM, 0x02); // 2ms
|
||||
|
||||
//rtw_write8(Adapter, REG_BCN_MAX_ERR, 0xFF);
|
||||
rtw_write8(Adapter, REG_ATIMWND_1, 0x0a); // 10ms for port1
|
||||
rtw_write16(Adapter, REG_BCNTCFG, 0x00);
|
||||
rtw_write16(Adapter, REG_TBTT_PROHIBIT, 0xff04);
|
||||
rtw_write16(Adapter, REG_TSFTR_SYN_OFFSET, 0x7fff);// +32767 (~32ms)
|
||||
|
||||
//reset TSF2
|
||||
rtw_write8(Adapter, REG_DUAL_TSF_RST, BIT(1));
|
||||
|
||||
|
||||
//BIT4 - If set 0, hw will clr bcnq when tx becon ok/fail or port 1
|
||||
rtw_write8(Adapter, REG_MBID_NUM, rtw_read8(Adapter, REG_MBID_NUM)|BIT(3)|BIT(4));
|
||||
//enable BCN1 Function for if2
|
||||
//don't enable update TSF1 for if2 (due to TSF update when beacon/probe rsp are received)
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, (DIS_TSF_UDT0_NORMAL_CHIP|EN_BCN_FUNCTION | EN_TXBCN_RPT|BIT(1)));
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(Adapter, WIFI_FW_NULL_STATE))
|
||||
rtw_write8(Adapter, REG_BCN_CTRL,
|
||||
rtw_read8(Adapter, REG_BCN_CTRL) & ~EN_BCN_FUNCTION);
|
||||
#endif
|
||||
//BCN1 TSF will sync to BCN0 TSF with offset(0x518) if if1_sta linked
|
||||
//rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)|BIT(5));
|
||||
//rtw_write8(Adapter, REG_DUAL_TSF_RST, BIT(3));
|
||||
|
||||
//dis BCN0 ATIM WND if if1 is station
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)|BIT(0));
|
||||
|
||||
#ifdef CONFIG_TSF_RESET_OFFLOAD
|
||||
// Reset TSF for STA+AP concurrent mode
|
||||
if ( check_buddy_fwstate(Adapter, (WIFI_STATION_STATE|WIFI_ASOC_STATE)) ) {
|
||||
if (reset_tsf(Adapter, IFACE_PORT1) == false)
|
||||
DBG_871X("ERROR! %s()-%d: Reset port1 TSF fail\n",
|
||||
__FUNCTION__, __LINE__);
|
||||
}
|
||||
#endif // CONFIG_TSF_RESET_OFFLOAD
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
// disable Port0 TSF update
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)|BIT(4));
|
||||
|
@ -2545,23 +2422,18 @@ static void hw_var_set_opmode(struct adapter *Adapter, u8 variable, u8* val)
|
|||
|
||||
if((mode == _HW_STATE_STATION_) || (mode == _HW_STATE_NOLINK_))
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(!check_buddy_mlmeinfo_state(Adapter, WIFI_FW_AP_STATE))
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
rtw_write8(Adapter, REG_DRVERLYINT, 0x05);//restore early int time to 5ms
|
||||
UpdateInterruptMask8188EU(Adapter,true, 0, IMR_BCNDMAINT0_88E);
|
||||
#endif//CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
rtw_write8(Adapter, REG_DRVERLYINT, 0x05);//restore early int time to 5ms
|
||||
UpdateInterruptMask8188EU(Adapter,true, 0, IMR_BCNDMAINT0_88E);
|
||||
#endif//CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
UpdateInterruptMask8188EU(Adapter,true ,0, (IMR_TBDER_88E|IMR_TBDOK_88E));
|
||||
#endif //CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
UpdateInterruptMask8188EU(Adapter,true ,0, (IMR_TBDER_88E|IMR_TBDOK_88E));
|
||||
#endif //CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
|
||||
#endif //CONFIG_INTERRUPT_BASED_TXBCN
|
||||
StopTxBeacon(Adapter);
|
||||
}
|
||||
#endif //CONFIG_INTERRUPT_BASED_TXBCN
|
||||
StopTxBeacon(Adapter);
|
||||
|
||||
rtw_write8(Adapter,REG_BCN_CTRL, 0x19);//disable atim wnd
|
||||
//rtw_write8(Adapter,REG_BCN_CTRL, 0x18);
|
||||
|
@ -2624,12 +2496,6 @@ static void hw_var_set_opmode(struct adapter *Adapter, u8 variable, u8* val)
|
|||
rtw_write8(Adapter, REG_BCN_CTRL, (DIS_TSF_UDT0_NORMAL_CHIP|EN_BCN_FUNCTION |BIT(1)));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(Adapter, WIFI_FW_NULL_STATE))
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1,
|
||||
rtw_read8(Adapter, REG_BCN_CTRL_1) & ~EN_BCN_FUNCTION);
|
||||
#endif
|
||||
|
||||
//dis BCN1 ATIM WND if if2 is station
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)|BIT(0));
|
||||
#ifdef CONFIG_TSF_RESET_OFFLOAD
|
||||
|
@ -2650,22 +2516,10 @@ static void hw_var_set_macaddr(struct adapter *Adapter, u8 variable, u8* val)
|
|||
u8 idx = 0;
|
||||
u32 reg_macid;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
{
|
||||
reg_macid = REG_MACID1;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
reg_macid = REG_MACID;
|
||||
}
|
||||
reg_macid = REG_MACID;
|
||||
|
||||
for(idx = 0 ; idx < 6; idx++)
|
||||
{
|
||||
rtw_write8(Adapter, (reg_macid+idx), val[idx]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void hw_var_set_bssid(struct adapter *Adapter, u8 variable, u8* val)
|
||||
|
@ -2673,318 +2527,38 @@ static void hw_var_set_bssid(struct adapter *Adapter, u8 variable, u8* val)
|
|||
u8 idx = 0;
|
||||
u32 reg_bssid;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
{
|
||||
reg_bssid = REG_BSSID1;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
reg_bssid = REG_BSSID;
|
||||
}
|
||||
reg_bssid = REG_BSSID;
|
||||
|
||||
for(idx = 0 ; idx < 6; idx++)
|
||||
{
|
||||
rtw_write8(Adapter, (reg_bssid+idx), val[idx]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void hw_var_set_bcn_func(struct adapter *Adapter, u8 variable, u8* val)
|
||||
{
|
||||
u32 bcn_ctrl_reg;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
{
|
||||
bcn_ctrl_reg = REG_BCN_CTRL_1;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
bcn_ctrl_reg = REG_BCN_CTRL;
|
||||
}
|
||||
bcn_ctrl_reg = REG_BCN_CTRL;
|
||||
|
||||
if(*((u8 *)val))
|
||||
{
|
||||
rtw_write8(Adapter, bcn_ctrl_reg, (EN_BCN_FUNCTION | EN_TXBCN_RPT));
|
||||
}
|
||||
else
|
||||
{
|
||||
rtw_write8(Adapter, bcn_ctrl_reg, rtw_read8(Adapter, bcn_ctrl_reg)&(~(EN_BCN_FUNCTION | EN_TXBCN_RPT)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void hw_var_set_correct_tsf(struct adapter *Adapter, u8 variable, u8* val)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u64 tsf;
|
||||
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct adapter *pbuddy_adapter = Adapter->pbuddy_adapter;
|
||||
|
||||
//tsf = pmlmeext->TSFValue - ((u32)pmlmeext->TSFValue % (pmlmeinfo->bcn_interval*1024)) -1024; //us
|
||||
tsf = pmlmeext->TSFValue - rtw_modular64(pmlmeext->TSFValue, (pmlmeinfo->bcn_interval*1024)) -1024; //us
|
||||
|
||||
if(((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE))
|
||||
{
|
||||
//pHalData->RegTxPause |= STOP_BCNQ;BIT(6)
|
||||
//rtw_write8(Adapter, REG_TXPAUSE, (rtw_read8(Adapter, REG_TXPAUSE)|BIT(6)));
|
||||
StopTxBeacon(Adapter);
|
||||
}
|
||||
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
{
|
||||
//disable related TSF function
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)&(~BIT(3)));
|
||||
|
||||
rtw_write32(Adapter, REG_TSFTR1, tsf);
|
||||
rtw_write32(Adapter, REG_TSFTR1+4, tsf>>32);
|
||||
|
||||
|
||||
//enable related TSF function
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)|BIT(3));
|
||||
|
||||
// Update buddy port's TSF if it is SoftAP for beacon TX issue!
|
||||
if ( (pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE
|
||||
&& check_buddy_fwstate(Adapter, WIFI_AP_STATE)
|
||||
) {
|
||||
//disable related TSF function
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)&(~BIT(3)));
|
||||
|
||||
rtw_write32(Adapter, REG_TSFTR, tsf);
|
||||
rtw_write32(Adapter, REG_TSFTR+4, tsf>>32);
|
||||
|
||||
//enable related TSF function
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)|BIT(3));
|
||||
#ifdef CONFIG_TSF_RESET_OFFLOAD
|
||||
// Update buddy port's TSF(TBTT) if it is SoftAP for beacon TX issue!
|
||||
if (reset_tsf(Adapter, IFACE_PORT0) == false)
|
||||
DBG_871X("ERROR! %s()-%d: Reset port0 TSF fail\n",
|
||||
__FUNCTION__, __LINE__);
|
||||
|
||||
#endif // CONFIG_TSF_RESET_OFFLOAD
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//disable related TSF function
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)&(~BIT(3)));
|
||||
|
||||
rtw_write32(Adapter, REG_TSFTR, tsf);
|
||||
rtw_write32(Adapter, REG_TSFTR+4, tsf>>32);
|
||||
|
||||
//enable related TSF function
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)|BIT(3));
|
||||
|
||||
// Update buddy port's TSF if it is SoftAP for beacon TX issue!
|
||||
if ( (pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE
|
||||
&& check_buddy_fwstate(Adapter, WIFI_AP_STATE)
|
||||
) {
|
||||
//disable related TSF function
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)&(~BIT(3)));
|
||||
|
||||
rtw_write32(Adapter, REG_TSFTR1, tsf);
|
||||
rtw_write32(Adapter, REG_TSFTR1+4, tsf>>32);
|
||||
|
||||
//enable related TSF function
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)|BIT(3));
|
||||
#ifdef CONFIG_TSF_RESET_OFFLOAD
|
||||
// Update buddy port's TSF if it is SoftAP for beacon TX issue!
|
||||
if (reset_tsf(Adapter, IFACE_PORT1) == false)
|
||||
DBG_871X("ERROR! %s()-%d: Reset port1 TSF fail\n",
|
||||
__FUNCTION__, __LINE__);
|
||||
#endif // CONFIG_TSF_RESET_OFFLOAD
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE))
|
||||
{
|
||||
//pHalData->RegTxPause &= (~STOP_BCNQ);
|
||||
//rtw_write8(Adapter, REG_TXPAUSE, (rtw_read8(Adapter, REG_TXPAUSE)&(~BIT(6))));
|
||||
ResumeTxBeacon(Adapter);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void hw_var_set_mlme_disconnect(struct adapter *Adapter, u8 variable, u8* val)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct adapter *pbuddy_adapter = Adapter->pbuddy_adapter;
|
||||
|
||||
|
||||
if(check_buddy_mlmeinfo_state(Adapter, _HW_STATE_NOLINK_))
|
||||
rtw_write16(Adapter, REG_RXFLTMAP2, 0x00);
|
||||
|
||||
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
{
|
||||
//reset TSF1
|
||||
rtw_write8(Adapter, REG_DUAL_TSF_RST, BIT(1));
|
||||
|
||||
//disable update TSF1
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)|BIT(4));
|
||||
|
||||
// disable Port1's beacon function
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)&(~BIT(3)));
|
||||
}
|
||||
else
|
||||
{
|
||||
//reset TSF
|
||||
rtw_write8(Adapter, REG_DUAL_TSF_RST, BIT(0));
|
||||
|
||||
//disable update TSF
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)|BIT(4));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void hw_var_set_mlme_sitesurvey(struct adapter *Adapter, u8 variable, u8* val)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if(*((u8 *)val))//under sitesurvey
|
||||
{
|
||||
//config RCR to receive different BSSID & not to receive data frame
|
||||
u32 v = rtw_read32(Adapter, REG_RCR);
|
||||
v &= ~(RCR_CBSSID_BCN);
|
||||
rtw_write32(Adapter, REG_RCR, v);
|
||||
|
||||
//disable update TSF
|
||||
if((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
|
||||
{
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
{
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)|BIT(4));
|
||||
}
|
||||
else
|
||||
{
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)|BIT(4));
|
||||
}
|
||||
}
|
||||
|
||||
if(check_buddy_mlmeinfo_state(Adapter, WIFI_FW_AP_STATE) &&
|
||||
check_buddy_fwstate(Adapter, _FW_LINKED))
|
||||
{
|
||||
StopTxBeacon(Adapter);
|
||||
}
|
||||
}
|
||||
else//sitesurvey done
|
||||
{
|
||||
//enable to rx data frame
|
||||
//write32(Adapter, REG_RCR, read32(padapter, REG_RCR)|RCR_ADF);
|
||||
rtw_write16(Adapter, REG_RXFLTMAP2,0xFFFF);
|
||||
|
||||
//enable update TSF
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)&(~BIT(4)));
|
||||
else
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)&(~BIT(4)));
|
||||
|
||||
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|RCR_CBSSID_BCN);
|
||||
|
||||
if(check_buddy_mlmeinfo_state(Adapter, WIFI_FW_AP_STATE) &&
|
||||
check_buddy_fwstate(Adapter, _FW_LINKED))
|
||||
{
|
||||
ResumeTxBeacon(Adapter);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void hw_var_set_mlme_join(struct adapter *Adapter, u8 variable, u8* val)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 RetryLimit = 0x30;
|
||||
u8 type = *((u8 *)val);
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
|
||||
|
||||
if(type == 0) // prepare to join
|
||||
{
|
||||
if(check_buddy_mlmeinfo_state(Adapter, WIFI_FW_AP_STATE) &&
|
||||
check_buddy_fwstate(Adapter, _FW_LINKED))
|
||||
{
|
||||
StopTxBeacon(Adapter);
|
||||
}
|
||||
|
||||
//enable to rx data frame.Accept all data frame
|
||||
//rtw_write32(padapter, REG_RCR, rtw_read32(padapter, REG_RCR)|RCR_ADF);
|
||||
rtw_write16(Adapter, REG_RXFLTMAP2,0xFFFF);
|
||||
|
||||
if(check_buddy_mlmeinfo_state(Adapter, WIFI_FW_AP_STATE))
|
||||
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|RCR_CBSSID_BCN);
|
||||
else
|
||||
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|RCR_CBSSID_DATA|RCR_CBSSID_BCN);
|
||||
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
|
||||
{
|
||||
RetryLimit = (pHalData->CustomerID == RT_CID_CCX) ? 7 : 48;
|
||||
}
|
||||
else // Ad-hoc Mode
|
||||
{
|
||||
RetryLimit = 0x7;
|
||||
}
|
||||
}
|
||||
else if(type == 1) //joinbss_event call back when join res < 0
|
||||
{
|
||||
if(check_buddy_mlmeinfo_state(Adapter, _HW_STATE_NOLINK_))
|
||||
rtw_write16(Adapter, REG_RXFLTMAP2,0x00);
|
||||
|
||||
if(check_buddy_mlmeinfo_state(Adapter, WIFI_FW_AP_STATE) &&
|
||||
check_buddy_fwstate(Adapter, _FW_LINKED))
|
||||
{
|
||||
ResumeTxBeacon(Adapter);
|
||||
|
||||
//reset TSF 1/2 after ResumeTxBeacon
|
||||
rtw_write8(Adapter, REG_DUAL_TSF_RST, BIT(1)|BIT(0));
|
||||
|
||||
}
|
||||
}
|
||||
else if(type == 2) //sta add event call back
|
||||
{
|
||||
|
||||
//enable update TSF
|
||||
if(Adapter->iface_type == IFACE_PORT1)
|
||||
rtw_write8(Adapter, REG_BCN_CTRL_1, rtw_read8(Adapter, REG_BCN_CTRL_1)&(~BIT(4)));
|
||||
else
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)&(~BIT(4)));
|
||||
|
||||
|
||||
if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE))
|
||||
{
|
||||
//fixed beacon issue for 8191su...........
|
||||
rtw_write8(Adapter,0x542 ,0x02);
|
||||
RetryLimit = 0x7;
|
||||
}
|
||||
|
||||
|
||||
if(check_buddy_mlmeinfo_state(Adapter, WIFI_FW_AP_STATE) &&
|
||||
check_buddy_fwstate(Adapter, _FW_LINKED))
|
||||
{
|
||||
ResumeTxBeacon(Adapter);
|
||||
|
||||
//reset TSF 1/2 after ResumeTxBeacon
|
||||
rtw_write8(Adapter, REG_DUAL_TSF_RST, BIT(1)|BIT(0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
rtw_write16(Adapter, REG_RL, RetryLimit << RETRY_LIMIT_SHORT_SHIFT | RetryLimit << RETRY_LIMIT_LONG_SHIFT);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
|
||||
|
@ -3065,9 +2639,6 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
|
|||
hw_var_set_bcn_func(Adapter, variable, val);
|
||||
break;
|
||||
case HW_VAR_CORRECT_TSF:
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
hw_var_set_correct_tsf(Adapter, variable, val);
|
||||
#else
|
||||
{
|
||||
u64 tsf;
|
||||
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
|
||||
|
@ -3100,7 +2671,6 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
|
|||
ResumeTxBeacon(Adapter);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case HW_VAR_CHECK_BSSID:
|
||||
if(*((u8 *)val))
|
||||
|
@ -3119,9 +2689,6 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
|
|||
}
|
||||
break;
|
||||
case HW_VAR_MLME_DISCONNECT:
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
hw_var_set_mlme_disconnect(Adapter, variable, val);
|
||||
#else
|
||||
{
|
||||
//Set RCR to not to receive data frame when NO LINK state
|
||||
//rtw_write32(Adapter, REG_RCR, rtw_read32(padapter, REG_RCR) & ~RCR_ADF);
|
||||
|
@ -3134,12 +2701,8 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
|
|||
//disable update TSF
|
||||
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)|BIT(4));
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case HW_VAR_MLME_SITESURVEY:
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
hw_var_set_mlme_sitesurvey(Adapter, variable, val);
|
||||
#else
|
||||
if(*((u8 *)val))//under sitesurvey
|
||||
{
|
||||
//config RCR to receive different BSSID & not to receive data frame
|
||||
|
@ -3192,12 +2755,8 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case HW_VAR_MLME_JOIN:
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
hw_var_set_mlme_join(Adapter, variable, val);
|
||||
#else
|
||||
{
|
||||
u8 RetryLimit = 0x30;
|
||||
u8 type = *((u8 *)val);
|
||||
|
@ -3246,7 +2805,6 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
|
|||
|
||||
rtw_write16(Adapter, REG_RL, RetryLimit << RETRY_LIMIT_SHORT_SHIFT | RetryLimit << RETRY_LIMIT_LONG_SHIFT);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case HW_VAR_ON_RCR_AM:
|
||||
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|RCR_AM);
|
||||
|
@ -3319,11 +2877,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
|
|||
}
|
||||
break;
|
||||
case HW_VAR_SEC_CFG:
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_write8(Adapter, REG_SECCFG, 0x0c|BIT(5));// enable tx enc and rx dec engine, and no key search for MC/BC
|
||||
#else
|
||||
rtw_write8(Adapter, REG_SECCFG, *((u8 *)val));
|
||||
#endif
|
||||
break;
|
||||
case HW_VAR_DM_FLAG:
|
||||
podmpriv->SupportAbility = *((u8 *)val);
|
||||
|
@ -3690,20 +3244,6 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
|
|||
break;
|
||||
case HW_VAR_CHECK_TXBUF:
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i=0;i<1000;i++) {
|
||||
if(rtw_read32(Adapter, 0x200) != rtw_read32(Adapter, 0x204)) {
|
||||
rtw_msleep_os(10);
|
||||
} else {
|
||||
DBG_871X("no packet in tx packet buffer (%d)\n", i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case HW_VAR_APFM_ON_MAC:
|
||||
pHalData->bMacPwrCtrlOn = *val;
|
||||
|
@ -4008,20 +3548,12 @@ static u8 GetHalDefVar8188EUsb(
|
|||
u8 entry_id = *((u8*)pValue);
|
||||
u8 i;
|
||||
u8 bLinked = false;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = Adapter->pbuddy_adapter;
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
//if(check_fwstate(&Adapter->mlmepriv, _FW_LINKED)== true)
|
||||
|
||||
if(rtw_linked_check(Adapter))
|
||||
bLinked = true;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(pbuddy_adapter && rtw_linked_check(pbuddy_adapter))
|
||||
bLinked = true;
|
||||
#endif
|
||||
|
||||
if(bLinked){
|
||||
DBG_871X("============ RA status check ===================\n");
|
||||
if(Adapter->bRxRSSIDisplay >30)
|
||||
|
@ -4202,9 +3734,6 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
|
|||
switch (mac_id)
|
||||
{
|
||||
case 0:// for infra mode
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
case 2:// first station uses macid=0, second station uses macid=2
|
||||
#endif
|
||||
supportRateNum = rtw_get_rateset_len(cur_network->SupportedRates);
|
||||
networkType = judge_network_type(padapter, cur_network->SupportedRates, supportRateNum) & 0xf;
|
||||
//pmlmeext->cur_wireless_mode = networkType;
|
||||
|
@ -4336,11 +3865,6 @@ static void SetBeaconRelatedRegisters8188EUsb(struct adapter *padapter)
|
|||
//REG_BCN_CTRL //(0x550)
|
||||
|
||||
//BCN interval
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->iface_type == IFACE_PORT1){
|
||||
bcn_ctrl_reg = REG_BCN_CTRL_1;
|
||||
}
|
||||
#endif
|
||||
rtw_write16(padapter, REG_BCN_INTERVAL, pmlmeinfo->bcn_interval);
|
||||
rtw_write8(padapter, REG_ATIMWND, 0x02);// 2ms
|
||||
|
||||
|
@ -4427,19 +3951,12 @@ void rtl8188eu_set_hal_ops(struct adapter * padapter)
|
|||
{
|
||||
struct hal_ops *pHalFunc = &padapter->HalFunc;
|
||||
|
||||
;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->isprimary)
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
padapter->HalData = rtw_zmalloc(sizeof(HAL_DATA_TYPE));
|
||||
if(padapter->HalData == NULL){
|
||||
DBG_8192C("cant not alloc memory for HAL DATA \n");
|
||||
}
|
||||
padapter->HalData = rtw_zmalloc(sizeof(HAL_DATA_TYPE));
|
||||
if(padapter->HalData == NULL){
|
||||
DBG_8192C("cant not alloc memory for HAL DATA \n");
|
||||
}
|
||||
|
||||
//_rtw_memset(padapter->HalData, 0, sizeof(HAL_DATA_TYPE));
|
||||
padapter->hal_data_sz = sizeof(HAL_DATA_TYPE);
|
||||
|
||||
pHalFunc->hal_power_on = InitPowerOn_rtl8188eu;
|
||||
|
@ -4448,8 +3965,6 @@ void rtl8188eu_set_hal_ops(struct adapter * padapter)
|
|||
pHalFunc->hal_init = &rtl8188eu_hal_init;
|
||||
pHalFunc->hal_deinit = &rtl8188eu_hal_deinit;
|
||||
|
||||
//pHalFunc->free_hal_data = &rtl8192c_free_hal_data;
|
||||
|
||||
pHalFunc->inirp_init = &rtl8188eu_inirp_init;
|
||||
pHalFunc->inirp_deinit = &rtl8188eu_inirp_deinit;
|
||||
|
||||
|
|
|
@ -47,17 +47,6 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
|
|||
u8 tmp_buf[MAX_USB_IO_CTL_SIZE];
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->adapter_type > PRIMARY_ADAPTER)
|
||||
{
|
||||
padapter = padapter->pbuddy_adapter;
|
||||
pdvobjpriv = adapter_to_dvobj(padapter);
|
||||
udev = pdvobjpriv->pusbdev;
|
||||
}
|
||||
#endif
|
||||
|
||||
//DBG_871X("%s %s:%d\n",__FUNCTION__, current->comm, current->pid);
|
||||
|
||||
if ((padapter->bSurpriseRemoved) ||(dvobj_to_pwrctl(pdvobjpriv)->pnp_bstop_trx)){
|
||||
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usbctrl_vendorreq:(padapter->bSurpriseRemoved ||pwrctl->pnp_bstop_trx)!!!\n"));
|
||||
status = -EPERM;
|
||||
|
@ -371,13 +360,6 @@ static void interrupt_handler_8188eu(struct adapter *padapter,u16 pkt_len,u8 *pb
|
|||
if (pmlmepriv->update_bcn == true)
|
||||
set_tx_beacon_cmd(padapter);
|
||||
}
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (check_buddy_fwstate(padapter, WIFI_AP_STATE)) {
|
||||
//send_beacon(padapter);
|
||||
if (padapter->pbuddy_adapter->mlmepriv.update_bcn == true)
|
||||
set_tx_beacon_cmd(padapter->pbuddy_adapter);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif //CONFIG_INTERRUPT_BASED_TXBCN
|
||||
|
||||
|
@ -495,125 +477,7 @@ static u32 usb_read_interrupt(struct intf_hdl *pintfhdl, u32 addr)
|
|||
static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxstat, struct phy_stat *pphy_status)
|
||||
{
|
||||
s32 ret=_SUCCESS;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 *primary_myid, *secondary_myid, *paddr1;
|
||||
union recv_frame *precvframe_if2 = NULL;
|
||||
struct adapter *primary_padapter = precvframe->u.hdr.adapter;
|
||||
struct adapter *secondary_padapter = primary_padapter->pbuddy_adapter;
|
||||
struct recv_priv *precvpriv = &primary_padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &precvpriv->free_recv_queue;
|
||||
u8 *pbuf = precvframe->u.hdr.rx_data;
|
||||
|
||||
if (!secondary_padapter)
|
||||
return ret;
|
||||
|
||||
paddr1 = GetAddr1Ptr(precvframe->u.hdr.rx_data);
|
||||
|
||||
if (IS_MCAST(paddr1) == false)//unicast packets
|
||||
{
|
||||
//primary_myid = myid(&primary_padapter->eeprompriv);
|
||||
secondary_myid = myid(&secondary_padapter->eeprompriv);
|
||||
|
||||
if (_rtw_memcmp(paddr1, secondary_myid, ETH_ALEN))
|
||||
{
|
||||
//change to secondary interface
|
||||
precvframe->u.hdr.adapter = secondary_padapter;
|
||||
}
|
||||
|
||||
//ret = recv_entry(precvframe);
|
||||
|
||||
}
|
||||
else // Handle BC/MC Packets
|
||||
{
|
||||
u8 clone = true;
|
||||
|
||||
if (true == clone) {
|
||||
//clone/copy to if2
|
||||
u8 shift_sz = 0;
|
||||
u32 alloc_sz, skb_len;
|
||||
_pkt *pkt_copy = NULL;
|
||||
struct rx_pkt_attrib *pattrib = NULL;
|
||||
|
||||
precvframe_if2 = rtw_alloc_recvframe(pfree_recv_queue);
|
||||
if (precvframe_if2)
|
||||
{
|
||||
precvframe_if2->u.hdr.adapter = secondary_padapter;
|
||||
|
||||
_rtw_init_listhead(&precvframe_if2->u.hdr.list);
|
||||
precvframe_if2->u.hdr.precvbuf = NULL; //can't access the precvbuf for new arch.
|
||||
precvframe_if2->u.hdr.len=0;
|
||||
|
||||
_rtw_memcpy(&precvframe_if2->u.hdr.attrib, &precvframe->u.hdr.attrib, sizeof(struct rx_pkt_attrib));
|
||||
|
||||
pattrib = &precvframe_if2->u.hdr.attrib;
|
||||
|
||||
// Modified by Albert 20101213
|
||||
// For 8 bytes IP header alignment.
|
||||
if (pattrib->qos) // Qos data, wireless lan header length is 26
|
||||
{
|
||||
shift_sz = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
shift_sz = 0;
|
||||
}
|
||||
|
||||
skb_len = pattrib->pkt_len;
|
||||
|
||||
// for first fragment packet, driver need allocate 1536+drvinfo_sz+RXDESC_SIZE to defrag packet.
|
||||
// modify alloc_sz for recvive crc error packet by thomas 2011-06-02
|
||||
if ((pattrib->mfrag == 1)&&(pattrib->frag_num == 0)){
|
||||
//alloc_sz = 1664; //1664 is 128 alignment.
|
||||
if (skb_len <= 1650)
|
||||
alloc_sz = 1664;
|
||||
else
|
||||
alloc_sz = skb_len + 14;
|
||||
}
|
||||
else {
|
||||
alloc_sz = skb_len;
|
||||
// 6 is for IP header 8 bytes alignment in QoS packet case.
|
||||
// 8 is for skb->data 4 bytes alignment.
|
||||
alloc_sz += 14;
|
||||
}
|
||||
|
||||
pkt_copy = rtw_skb_alloc(alloc_sz);
|
||||
|
||||
if (pkt_copy)
|
||||
{
|
||||
pkt_copy->dev = secondary_padapter->pnetdev;
|
||||
precvframe_if2->u.hdr.pkt = pkt_copy;
|
||||
precvframe_if2->u.hdr.rx_head = pkt_copy->data;
|
||||
precvframe_if2->u.hdr.rx_end = pkt_copy->data + alloc_sz;
|
||||
skb_reserve( pkt_copy, 8 - ((SIZE_PTR)( pkt_copy->data ) & 7 ));//force pkt_copy->data at 8-byte alignment address
|
||||
skb_reserve( pkt_copy, shift_sz );//force ip_hdr at 8-byte alignment address according to shift_sz.
|
||||
_rtw_memcpy(pkt_copy->data, pbuf, skb_len);
|
||||
precvframe_if2->u.hdr.rx_data = precvframe_if2->u.hdr.rx_tail = pkt_copy->data;
|
||||
|
||||
|
||||
recvframe_put(precvframe_if2, skb_len);
|
||||
if (pattrib->physt)
|
||||
update_recvframe_phyinfo_88e(precvframe_if2, (struct phy_stat*)pphy_status);
|
||||
ret = rtw_recv_entry(precvframe_if2);
|
||||
|
||||
}
|
||||
else {
|
||||
rtw_free_recvframe(precvframe_if2, pfree_recv_queue);
|
||||
DBG_8192C("%s()-%d: alloc_skb() failed!\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (precvframe->u.hdr.attrib.physt)
|
||||
update_recvframe_phyinfo_88e(precvframe, (struct phy_stat*)pphy_status);
|
||||
ret = rtw_recv_entry(precvframe);
|
||||
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
|
@ -764,29 +628,15 @@ static int recvbuf2recvframe(struct adapter *padapter, struct recv_buf *precvbuf
|
|||
|
||||
if (pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (rtw_buddy_adapter_up(padapter))
|
||||
if (pattrib->physt)
|
||||
update_recvframe_phyinfo_88e(precvframe, (struct phy_stat*)pphy_status);
|
||||
if (rtw_recv_entry(precvframe) != _SUCCESS)
|
||||
{
|
||||
if (pre_recv_entry(precvframe, prxstat, pphy_status) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
("recvbuf2recvframe: recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (pattrib->physt)
|
||||
update_recvframe_phyinfo_88e(precvframe, (struct phy_stat*)pphy_status);
|
||||
if (rtw_recv_entry(precvframe) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
|
||||
}
|
||||
else{ // pkt_rpt_type == TX_REPORT1-CCX, TX_REPORT2-TX RTP,HIS_REPORT-USB HISR RTP
|
||||
} else{ // pkt_rpt_type == TX_REPORT1-CCX, TX_REPORT2-TX RTP,HIS_REPORT-USB HISR RTP
|
||||
|
||||
//enqueue recvframe to txrtp queue
|
||||
if (pattrib->pkt_rpt_type == TX_REPORT1){
|
||||
|
@ -1165,29 +1015,14 @@ static int recvbuf2recvframe(struct adapter *padapter, _pkt *pskb)
|
|||
|
||||
if (pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (rtw_buddy_adapter_up(padapter))
|
||||
if (pattrib->physt)
|
||||
update_recvframe_phyinfo_88e(precvframe, (struct phy_stat*)pphy_status);
|
||||
if (rtw_recv_entry(precvframe) != _SUCCESS)
|
||||
{
|
||||
if (pre_recv_entry(precvframe, prxstat, pphy_status) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
("recvbuf2recvframe: recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (pattrib->physt)
|
||||
update_recvframe_phyinfo_88e(precvframe, (struct phy_stat*)pphy_status);
|
||||
if (rtw_recv_entry(precvframe) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else{ // pkt_rpt_type == TX_REPORT1-CCX, TX_REPORT2-TX RTP,HIS_REPORT-USB HISR RTP
|
||||
|
||||
} else{ // pkt_rpt_type == TX_REPORT1-CCX, TX_REPORT2-TX RTP,HIS_REPORT-USB HISR RTP
|
||||
//enqueue recvframe to txrtp queue
|
||||
if (pattrib->pkt_rpt_type == TX_REPORT1){
|
||||
//DBG_8192C("rx CCX \n");
|
||||
|
|
|
@ -105,22 +105,11 @@
|
|||
#define CONFIG_HW_ANTENNA_DIVERSITY
|
||||
#endif
|
||||
|
||||
|
||||
//#define CONFIG_CONCURRENT_MODE
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
//#define CONFIG_HWPORT_SWAP //Port0->Sec , Port1 -> Pri
|
||||
//#define CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
|
||||
#define CONFIG_TSF_RESET_OFFLOAD // For 2 PORT TSF SYNC.
|
||||
#endif
|
||||
|
||||
#define CONFIG_IOL
|
||||
|
||||
#define CONFIG_AP_MODE
|
||||
#ifdef CONFIG_AP_MODE
|
||||
//#define CONFIG_INTERRUPT_BASED_TXBCN // Tx Beacon when driver BCN_OK ,BCN_ERR interrupt occurs
|
||||
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_INTERRUPT_BASED_TXBCN)
|
||||
#undef CONFIG_INTERRUPT_BASED_TXBCN
|
||||
#endif
|
||||
#ifdef CONFIG_INTERRUPT_BASED_TXBCN
|
||||
//#define CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
|
||||
#define CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
|
||||
|
|
|
@ -218,11 +218,7 @@ struct registry_priv
|
|||
#define BSSID_OFT(field) ((ULONG)FIELD_OFFSET(WLAN_BSSID_EX,field))
|
||||
#define BSSID_SZ(field) sizeof(((PWLAN_BSSID_EX) 0)->field)
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
#define is_primary_adapter(adapter) (adapter->adapter_type == PRIMARY_ADAPTER)
|
||||
#else
|
||||
#define is_primary_adapter(adapter) (1)
|
||||
#endif
|
||||
#define GET_PRIMARY_ADAPTER(padapter) (((struct adapter *)padapter)->dvobj->if1)
|
||||
|
||||
#define GET_IFACE_NUMS(padapter) (((struct adapter *)padapter)->dvobj->iface_nums)
|
||||
|
@ -486,7 +482,7 @@ struct adapter {
|
|||
|
||||
struct adapter *pbuddy_adapter;
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT)
|
||||
#if defined(CONFIG_DUALMAC_CONCURRENT)
|
||||
u8 isprimary; //is primary adapter or not
|
||||
//notes:
|
||||
// if isprimary is true, the adapter_type value is 0, iface_id is IFACE_ID0 for PRIMARY_ADAPTER
|
||||
|
|
|
@ -99,12 +99,6 @@ struct rtw_wdev_priv
|
|||
u8 bandroid_scan;
|
||||
bool block;
|
||||
bool power_mgmt;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
ATOMIC_T ro_ch_to;
|
||||
ATOMIC_T switch_ch_to;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#define wdev_to_priv(w) ((struct rtw_wdev_priv *)(wdev_priv(w)))
|
||||
|
|
|
@ -110,13 +110,6 @@ int rtw_ips_pwr_up(struct adapter *padapter);
|
|||
void rtw_ips_pwr_down(struct adapter *padapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct _io_ops;
|
||||
struct adapter *rtw_drv_if2_init(struct adapter *primary_padapter, void (*set_intf_ops)(struct _io_ops *pops));
|
||||
void rtw_drv_if2_free(struct adapter *if2);
|
||||
void rtw_drv_if2_stop(struct adapter *if2);
|
||||
#endif
|
||||
|
||||
int rtw_drv_register_netdev(struct adapter *padapter);
|
||||
void rtw_ndev_destructor(_nic_hdl ndev);
|
||||
|
||||
|
|
|
@ -759,11 +759,7 @@ Default: 00b.
|
|||
//#define IMR_RX_MASK (IMR_ROK_88E|IMR_RDU_88E|IMR_RXFOVW_88E)
|
||||
#define IMR_TX_MASK (IMR_VODOK_88E|IMR_VIDOK_88E|IMR_BEDOK_88E|IMR_BKDOK_88E|IMR_MGNTDOK_88E|IMR_HIGHDOK_88E|IMR_BCNDERR0_88E)
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
#define RT_IBSS_INT_MASKS (IMR_BCNDMAINT0_88E | IMR_TBDOK_88E | IMR_TBDER_88E | IMR_BCNDMAINT_E_88E)
|
||||
#else
|
||||
#define RT_IBSS_INT_MASKS (IMR_BCNDMAINT0_88E | IMR_TBDOK_88E | IMR_TBDER_88E)
|
||||
#endif
|
||||
|
||||
#define RT_AC_INT_MASKS (IMR_VIDOK_88E | IMR_VODOK_88E | IMR_BEDOK_88E|IMR_BKDOK_88E)
|
||||
#define RT_BSS_INT_MASKS (RT_IBSS_INT_MASKS)
|
||||
|
|
|
@ -274,10 +274,6 @@ struct wifidirect_info{
|
|||
_timer pre_tx_scan_timer;
|
||||
_timer reset_ch_sitesurvey;
|
||||
_timer reset_ch_sitesurvey2; // Just for resetting the scan limit function by using p2p nego
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
// Used to switch the channel between legacy AP and listen state.
|
||||
_timer ap_p2p_switch_timer;
|
||||
#endif
|
||||
struct tx_provdisc_req_info tx_prov_disc_info;
|
||||
struct rx_provdisc_req_info rx_prov_disc_info;
|
||||
struct tx_invite_req_info invitereq_info;
|
||||
|
@ -345,10 +341,6 @@ struct wifidirect_info{
|
|||
// We will use the channel_cnt and channel_list fields when constructing the group negotitation confirm frame.
|
||||
u8 driver_interface; // Indicate DRIVER_WEXT or DRIVER_CFG80211
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u16 ext_listen_interval; // The interval to be available with legacy AP (ms)
|
||||
u16 ext_listen_period; // The time period to be available for P2P listen state (ms)
|
||||
#endif
|
||||
#ifdef CONFIG_P2P_PS
|
||||
enum P2P_PS_MODE p2p_ps_mode; // indicate p2p ps mode
|
||||
enum P2P_PS_STATE p2p_ps_state; // indicate p2p ps state
|
||||
|
@ -594,10 +586,6 @@ struct mlme_priv {
|
|||
//such that it will cause p2p disabled. Use this flag to reject.
|
||||
#endif // CONFIG_INTEL_WIDI
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 scanning_via_buddy_intf;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FTP_PROTECT
|
||||
u8 ftp_lock_flag;
|
||||
#endif //CONFIG_FTP_PROTECT
|
||||
|
@ -720,12 +708,6 @@ __inline static void up_scanned_network(struct mlme_priv *pmlmepriv)
|
|||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sint rtw_buddy_adapter_up(struct adapter *padapter);
|
||||
sint check_buddy_fwstate(struct adapter *padapter, sint state);
|
||||
u8 rtw_get_buddy_bBusyTraffic(struct adapter *padapter);
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
__inline static void down_scanned_network(struct mlme_priv *pmlmepriv)
|
||||
{
|
||||
_irqL irqL;
|
||||
|
|
|
@ -381,14 +381,8 @@ struct FW_Sta_Info
|
|||
* 4. Back to channel 1 for 300 milliseconds
|
||||
* 5. ... and so on, till survey done.
|
||||
*/
|
||||
#if defined CONFIG_STA_MODE_SCAN_UNDER_AP_MODE && defined CONFIG_CONCURRENT_MODE
|
||||
#define RTW_SCAN_NUM_OF_CH 8
|
||||
#define RTW_STAY_AP_CH_MILLISECOND 3 // this value is a multiplier,for example, when this value is 3, it would stay AP's op ch for
|
||||
// 3 * SURVEY_TO millisecond.
|
||||
#endif //defined CONFIG_STA_MODE_SCAN_UNDER_AP_MODE && defined CONFIG_CONCURRENT_MODE
|
||||
|
||||
struct mlme_ext_info
|
||||
{
|
||||
struct mlme_ext_info {
|
||||
u32 state;
|
||||
u32 reauth_count;
|
||||
u32 reassoc_count;
|
||||
|
@ -772,11 +766,6 @@ extern void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
|
|||
extern void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext);
|
||||
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sint check_buddy_mlmeinfo_state(struct adapter *padapter, u32 state);
|
||||
void concurrent_chk_joinbss_done(struct adapter *padapter, int join_res);
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
void dc_SelectChannel(struct adapter *padapter, unsigned char channel);
|
||||
void dc_SetBWMode(struct adapter *padapter, unsigned short bwmode, unsigned char channel_offset);
|
||||
|
|
|
@ -1353,14 +1353,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
|
|||
DBG_871X(" ~~~~set sta key:groupkey\n");
|
||||
|
||||
padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->adapter_type == PRIMARY_ADAPTER)
|
||||
rtw_set_key(padapter,&padapter->securitypriv,param->u.crypt.idx, 1,true);
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_always_, "second interface do not set cam.\n");
|
||||
#else
|
||||
rtw_set_key(padapter,&padapter->securitypriv,param->u.crypt.idx, 1,true);
|
||||
#endif
|
||||
}
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
else if(strcmp(param->u.crypt.alg, "BIP") == 0)
|
||||
|
@ -1772,9 +1765,6 @@ exit:
|
|||
}
|
||||
|
||||
extern int netdev_open(struct net_device *pnetdev);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
extern int netdev_if2_open(struct net_device *pnetdev);
|
||||
#endif
|
||||
|
||||
/*
|
||||
enum nl80211_iftype {
|
||||
|
@ -1818,23 +1808,10 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->adapter_type == SECONDARY_ADAPTER)
|
||||
{
|
||||
DBG_871X(FUNC_NDEV_FMT" call netdev_if2_open\n", FUNC_NDEV_ARG(ndev));
|
||||
if(netdev_if2_open(ndev) != 0) {
|
||||
ret= -EPERM;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
else if(padapter->adapter_type == PRIMARY_ADAPTER)
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
DBG_871X(FUNC_NDEV_FMT" call netdev_open\n", FUNC_NDEV_ARG(ndev));
|
||||
if(netdev_open(ndev) != 0) {
|
||||
ret= -EPERM;
|
||||
goto exit;
|
||||
}
|
||||
DBG_871X(FUNC_NDEV_FMT" call netdev_open\n", FUNC_NDEV_ARG(ndev));
|
||||
if(netdev_open(ndev) != 0) {
|
||||
ret= -EPERM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if(_FAIL == rtw_pwr_wakeup(padapter)) {
|
||||
|
@ -2142,21 +2119,8 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
|
|||
struct cfg80211_ssid *ssids = request->ssids;
|
||||
int social_channel = 0, j = 0;
|
||||
bool need_indicate_scan_done = false;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
PADAPTER pbuddy_adapter = NULL;
|
||||
struct mlme_priv *pbuddy_mlmepriv = NULL;
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
//#ifdef CONFIG_DEBUG_CFG80211
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
//#endif
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->pbuddy_adapter) {
|
||||
pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
pbuddy_mlmepriv = &(pbuddy_adapter->mlmepriv);
|
||||
}
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
_enter_critical_bh(&pwdev_priv->scan_req_lock, &irqL);
|
||||
pwdev_priv->scan_request = request;
|
||||
|
@ -2249,31 +2213,6 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
|
|||
goto check_need_indicate_scan_done;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(pbuddy_mlmepriv && (pbuddy_mlmepriv->LinkDetectInfo.bBusyTraffic == true))
|
||||
{
|
||||
DBG_8192C("%s, bBusyTraffic == true at buddy_intf\n", __func__);
|
||||
need_indicate_scan_done = true;
|
||||
goto check_need_indicate_scan_done;
|
||||
}
|
||||
|
||||
if (check_buddy_fwstate(padapter,
|
||||
_FW_UNDER_SURVEY|_FW_UNDER_LINKING|WIFI_UNDER_WPS) == true)
|
||||
{
|
||||
if(check_buddy_fwstate(padapter, _FW_UNDER_SURVEY))
|
||||
{
|
||||
DBG_8192C("scanning_via_buddy_intf\n");
|
||||
pmlmepriv->scanning_via_buddy_intf = true;
|
||||
}
|
||||
|
||||
DBG_8192C("buddy_intf's mlme state:0x%x\n", pbuddy_mlmepriv->fw_state);
|
||||
|
||||
need_indicate_scan_done = true;
|
||||
goto check_need_indicate_scan_done;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
if( pwdinfo->driver_interface == DRIVER_CFG80211 )
|
||||
{
|
||||
|
@ -2756,17 +2695,6 @@ static int cfg80211_rtw_join_ibss(struct wiphy *wiphy, struct net_device *ndev,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (check_buddy_fwstate(padapter, _FW_UNDER_LINKING) == true) {
|
||||
DBG_8192C("%s, but buddy_intf is under linking\n", __FUNCTION__);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
if (check_buddy_fwstate(padapter, _FW_UNDER_SURVEY) == true) {
|
||||
rtw_scan_abort(padapter->pbuddy_adapter);
|
||||
}
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
if (!params->ssid || !params->ssid_len)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
|
@ -2869,17 +2797,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (check_buddy_fwstate(padapter, _FW_UNDER_LINKING) == true) {
|
||||
DBG_8192C("%s, but buddy_intf is under linking\n", __FUNCTION__);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
if (check_buddy_fwstate(padapter, _FW_UNDER_SURVEY) == true) {
|
||||
rtw_scan_abort(padapter->pbuddy_adapter);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!sme->ssid || !sme->ssid_len)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
|
@ -4459,10 +4376,6 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy,
|
|||
|
||||
_cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
ATOMIC_SET(&pwdev_priv->ro_ch_to, 1);
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
p2p_protocol_wk_hdl(padapter, P2P_RO_CH_WK);
|
||||
}
|
||||
|
||||
|
@ -4480,12 +4393,6 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy,
|
|||
pcfg80211_wdinfo->remain_on_ch_cookie= *cookie;
|
||||
|
||||
rtw_scan_abort(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter))
|
||||
rtw_scan_abort(padapter->pbuddy_adapter);
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
//if(!rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT) && !rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
{
|
||||
rtw_p2p_enable(padapter, P2P_ROLE_DEVICE);
|
||||
|
@ -4508,79 +4415,29 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy,
|
|||
duration = duration*3;//extend from exper.
|
||||
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED) &&
|
||||
(duration<pwdinfo->ext_listen_interval))
|
||||
{
|
||||
duration = duration + pwdinfo->ext_listen_interval;
|
||||
}
|
||||
#endif
|
||||
|
||||
pcfg80211_wdinfo->restore_channel = rtw_get_oper_ch(padapter);
|
||||
|
||||
if(rtw_ch_set_search_ch(pmlmeext->channel_set, remain_ch) >= 0) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_buddy_fwstate(padapter, _FW_LINKED ) )
|
||||
{
|
||||
PADAPTER pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
|
||||
if(remain_ch != pbuddy_mlmeext->cur_channel)
|
||||
{
|
||||
if(ATOMIC_READ(&pwdev_priv->switch_ch_to)==1 ||
|
||||
(remain_ch != pmlmeext->cur_channel))
|
||||
{
|
||||
DBG_8192C("%s, issue nulldata pwrbit=1\n", __func__);
|
||||
issue_nulldata(padapter->pbuddy_adapter, NULL, 1, 3, 500);
|
||||
|
||||
ATOMIC_SET(&pwdev_priv->switch_ch_to, 0);
|
||||
|
||||
DBG_8192C("%s, set switch ch timer, duration=%d\n", __func__, duration-pwdinfo->ext_listen_interval);
|
||||
_set_timer(&pwdinfo->ap_p2p_switch_timer, duration-pwdinfo->ext_listen_interval);
|
||||
}
|
||||
}
|
||||
|
||||
if(remain_ch != rtw_get_oper_ch(padapter) )
|
||||
ready_on_channel = true;
|
||||
//pmlmeext->cur_channel = remain_ch;
|
||||
//set_channel_bwmode(padapter, remain_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
}else
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
if(remain_ch != rtw_get_oper_ch(padapter) )
|
||||
{
|
||||
ready_on_channel = true;
|
||||
//pmlmeext->cur_channel = remain_ch;
|
||||
//set_channel_bwmode(padapter, remain_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
}
|
||||
} else {
|
||||
DBG_871X("%s remain_ch:%u not in channel plan!!!!\n", __FUNCTION__, remain_ch);
|
||||
}
|
||||
|
||||
|
||||
//call this after other things have been done
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(ATOMIC_READ(&pwdev_priv->ro_ch_to)==1 ||
|
||||
(remain_ch != rtw_get_oper_ch(padapter)))
|
||||
{
|
||||
u8 co_channel = 0xff;
|
||||
ATOMIC_SET(&pwdev_priv->ro_ch_to, 0);
|
||||
#endif
|
||||
|
||||
if(ready_on_channel == true)
|
||||
if(ready_on_channel == true) {
|
||||
if ( !check_fwstate(&padapter->mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
if ( !check_fwstate(&padapter->mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
pmlmeext->cur_channel = remain_ch;
|
||||
pmlmeext->cur_channel = remain_ch;
|
||||
|
||||
|
||||
set_channel_bwmode(padapter, remain_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
}
|
||||
set_channel_bwmode(padapter, remain_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
}
|
||||
DBG_8192C("%s, set ro ch timer, duration=%d\n", __func__, duration);
|
||||
_set_timer( &pcfg80211_wdinfo->remain_on_ch_timer, duration);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
}
|
||||
#endif
|
||||
DBG_8192C("%s, set ro ch timer, duration=%d\n", __func__, duration);
|
||||
_set_timer( &pcfg80211_wdinfo->remain_on_ch_timer, duration);
|
||||
|
||||
rtw_cfg80211_ready_on_channel(padapter, *cookie, channel, channel_type, duration, GFP_KERNEL);
|
||||
|
||||
|
@ -4610,9 +4467,6 @@ static s32 cfg80211_rtw_cancel_remain_on_channel(struct wiphy *wiphy,
|
|||
if (pcfg80211_wdinfo->is_ro_ch == true) {
|
||||
DBG_8192C("%s, cancel ro ch timer\n", __func__);
|
||||
_cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
ATOMIC_SET(&pwdev_priv->ro_ch_to, 1);
|
||||
#endif
|
||||
p2p_protocol_wk_hdl(padapter, P2P_RO_CH_WK);
|
||||
}
|
||||
|
||||
|
@ -4652,68 +4506,7 @@ static int _cfg80211_rtw_mgmt_tx(struct adapter *padapter, u8 tx_ch, const u8 *b
|
|||
rtw_set_scan_deny(padapter, 1000);
|
||||
|
||||
rtw_scan_abort(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter))
|
||||
rtw_scan_abort(padapter->pbuddy_adapter);
|
||||
#endif /* CONFIG_CONCURRENT_MODE */
|
||||
|
||||
if (padapter->cfg80211_wdinfo.is_ro_ch == true) {
|
||||
//DBG_8192C("%s, cancel ro ch timer\n", __func__);
|
||||
//_cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer);
|
||||
//padapter->cfg80211_wdinfo.is_ro_ch = false;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED ))
|
||||
{
|
||||
DBG_8192C("%s, extend ro ch time\n", __func__);
|
||||
_set_timer( &padapter->cfg80211_wdinfo.remain_on_ch_timer, pwdinfo->ext_listen_period);
|
||||
}
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (check_buddy_fwstate(padapter, _FW_LINKED )) {
|
||||
u8 co_channel=0xff;
|
||||
PADAPTER pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
|
||||
co_channel = rtw_get_oper_ch(padapter);
|
||||
|
||||
if (tx_ch != pbuddy_mlmeext->cur_channel) {
|
||||
|
||||
u16 ext_listen_period;
|
||||
|
||||
if (ATOMIC_READ(&pwdev_priv->switch_ch_to)==1) {
|
||||
DBG_8192C("%s, issue nulldata pwrbit=1\n", __func__);
|
||||
issue_nulldata(padapter->pbuddy_adapter, NULL, 1, 3, 500);
|
||||
|
||||
ATOMIC_SET(&pwdev_priv->switch_ch_to, 0);
|
||||
|
||||
//DBG_8192C("%s, set switch ch timer, period=%d\n", __func__, pwdinfo->ext_listen_period);
|
||||
//_set_timer(&pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_period);
|
||||
}
|
||||
|
||||
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED ))
|
||||
{
|
||||
ext_listen_period = 500;// 500ms
|
||||
}
|
||||
else
|
||||
{
|
||||
ext_listen_period = pwdinfo->ext_listen_period;
|
||||
}
|
||||
|
||||
DBG_8192C("%s, set switch ch timer, period=%d\n", __func__, ext_listen_period);
|
||||
_set_timer(&pwdinfo->ap_p2p_switch_timer, ext_listen_period);
|
||||
|
||||
}
|
||||
|
||||
if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED ))
|
||||
pmlmeext->cur_channel = tx_ch;
|
||||
|
||||
if (tx_ch != co_channel)
|
||||
set_channel_bwmode(padapter, tx_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
}else
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
//if (tx_ch != pmlmeext->cur_channel) {
|
||||
if(tx_ch != rtw_get_oper_ch(padapter)) {
|
||||
if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED ))
|
||||
pmlmeext->cur_channel = tx_ch;
|
||||
|
@ -5591,11 +5384,6 @@ int rtw_wdev_alloc(struct adapter *padapter, struct device *dev)
|
|||
else
|
||||
pwdev_priv->power_mgmt = false;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
ATOMIC_SET(&pwdev_priv->switch_ch_to, 1);
|
||||
ATOMIC_SET(&pwdev_priv->ro_ch_to, 1);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
|
||||
rtw_mfree((u8*)wdev, sizeof(struct wireless_dev));
|
||||
|
|
|
@ -1725,28 +1725,6 @@ static int rtw_wx_set_wap(struct net_device *dev,
|
|||
struct wlan_network *pnetwork = NULL;
|
||||
NDIS_802_11_AUTHENTICATION_MODE authmode;
|
||||
|
||||
;
|
||||
/*
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->iface_type > PRIMARY_IFACE)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (check_buddy_fwstate(padapter, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true)
|
||||
{
|
||||
DBG_871X("set bssid, but buddy_intf is under scanning or linking\n");
|
||||
|
||||
ret = -EINVAL;
|
||||
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
if (dc_check_fwstate(padapter, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)== true)
|
||||
{
|
||||
|
@ -1934,12 +1912,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
// When Busy Traffic, driver do not site survey. So driver return success.
|
||||
// wpa_supplicant will not issue SIOCSIWSCAN cmd again after scan timeout.
|
||||
// modify by thomas 2011-02-22.
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic == true
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
|| rtw_get_buddy_bBusyTraffic(padapter) == true
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
)
|
||||
{
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic == true) {
|
||||
indicate_wx_scan_complete_event(padapter);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1967,22 +1940,6 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (check_buddy_fwstate(padapter,
|
||||
_FW_UNDER_SURVEY|_FW_UNDER_LINKING|WIFI_UNDER_WPS) == true)
|
||||
{
|
||||
if(check_buddy_fwstate(padapter, _FW_UNDER_SURVEY))
|
||||
{
|
||||
DBG_871X("scanning_via_buddy_intf\n");
|
||||
pmlmepriv->scanning_via_buddy_intf = true;
|
||||
}
|
||||
|
||||
indicate_wx_scan_complete_event(padapter);
|
||||
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
if (dc_check_fwstate(padapter, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)== true)
|
||||
{
|
||||
|
@ -2164,15 +2121,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
DBG_871X("DBG_IOCTL %s:%d\n",__FUNCTION__, __LINE__);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->iface_type > PRIMARY_IFACE)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
if(adapter_to_pwrctl(padapter)->brfoffbyhw && padapter->bDriverStopped)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
|
@ -2199,21 +2147,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
}
|
||||
#endif //CONFIG_P2P
|
||||
|
||||
/*
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(pmlmepriv->scanning_via_buddy_intf == true)
|
||||
{
|
||||
pmlmepriv->scanning_via_buddy_intf = false;//reset
|
||||
|
||||
// change pointers to buddy interface
|
||||
padapter = pbuddy_adapter;
|
||||
pmlmepriv = pbuddy_mlmepriv;
|
||||
queue = &(pbuddy_mlmepriv->scanned_queue);
|
||||
|
||||
}
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
*/
|
||||
#if 1 // Wireless Extension use EAGAIN to try
|
||||
wait_status = _FW_UNDER_SURVEY
|
||||
#ifndef CONFIG_ANDROID
|
||||
| _FW_UNDER_LINKING
|
||||
|
@ -2224,31 +2157,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
{
|
||||
return -EAGAIN;
|
||||
}
|
||||
#else
|
||||
wait_status = _FW_UNDER_SURVEY
|
||||
#ifndef CONFIG_ANDROID
|
||||
|_FW_UNDER_LINKING
|
||||
#endif
|
||||
;
|
||||
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
while(dc_check_fwstate(padapter, wait_status)== true)
|
||||
{
|
||||
rtw_msleep_os(30);
|
||||
cnt++;
|
||||
if(cnt > wait_for_surveydone )
|
||||
break;
|
||||
}
|
||||
#endif // CONFIG_DUALMAC_CONCURRENT
|
||||
|
||||
while(check_fwstate(pmlmepriv, wait_status) == true)
|
||||
{
|
||||
rtw_msleep_os(30);
|
||||
cnt++;
|
||||
if(cnt > wait_for_surveydone )
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
|
||||
|
@ -2324,27 +2232,6 @@ static int rtw_wx_set_essid(struct net_device *dev,
|
|||
DBG_871X("DBG_IOCTL %s:%d\n",__FUNCTION__, __LINE__);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->iface_type > PRIMARY_IFACE)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (check_buddy_fwstate(padapter, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true)
|
||||
{
|
||||
DBG_871X("set ssid, but buddy_intf is under scanning or linking\n");
|
||||
|
||||
ret = -EINVAL;
|
||||
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
if (dc_check_fwstate(padapter, _FW_UNDER_SURVEY|_FW_UNDER_LINKING)== true)
|
||||
{
|
||||
|
@ -3999,33 +3886,7 @@ static int rtw_wext_p2p_enable(struct net_device *dev,
|
|||
pwdinfo->operating_channel = pwdinfo->listen_channel;
|
||||
ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
bwmode = HT_CHANNEL_WIDTH_20;
|
||||
}
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
|
||||
{
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
//struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo;
|
||||
struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
|
||||
_set_timer( &pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_interval );
|
||||
if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
pwdinfo->operating_channel = pbuddy_mlmeext->cur_channel;
|
||||
// How about the ch_offset and bwmode ??
|
||||
}
|
||||
else
|
||||
{
|
||||
pwdinfo->operating_channel = pwdinfo->listen_channel;
|
||||
}
|
||||
|
||||
channel = pbuddy_mlmeext->cur_channel;
|
||||
ch_offset = pbuddy_mlmeext->cur_ch_offset;
|
||||
bwmode = pbuddy_mlmeext->cur_bwmode;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
} else {
|
||||
pwdinfo->operating_channel = pmlmeext->cur_channel;
|
||||
|
||||
channel = pwdinfo->operating_channel;
|
||||
|
@ -4237,12 +4098,6 @@ static int rtw_p2p_get_status(struct net_device *dev,
|
|||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
|
||||
struct iw_point *pdata = &wrqu->data;
|
||||
struct wifidirect_info *pwdinfo = &( padapter->wdinfo );
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct wifidirect_info *pbuddy_wdinfo = &pbuddy_adapter->wdinfo;
|
||||
struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
#endif
|
||||
|
||||
if ( padapter->bShowGetP2PState )
|
||||
{
|
||||
|
@ -4913,11 +4768,6 @@ static int rtw_p2p_connect(struct net_device *dev,
|
|||
_queue *queue = &(pmlmepriv->scanned_queue);
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
uint uintPeerChannel = 0;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
// Commented by Albert 20110304
|
||||
// The input data contains two informations.
|
||||
|
@ -4967,15 +4817,7 @@ static int rtw_p2p_connect(struct net_device *dev,
|
|||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
|
||||
if ( uintPeerChannel )
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
_cancel_timer_ex( &pwdinfo->ap_p2p_switch_timer );
|
||||
}
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
if ( uintPeerChannel ) {
|
||||
_rtw_memset( &pwdinfo->nego_req_info, 0x00, sizeof( struct tx_nego_req_info ) );
|
||||
_rtw_memset( &pwdinfo->groupid_info, 0x00, sizeof( struct group_id_info ) );
|
||||
|
||||
|
@ -4993,34 +4835,10 @@ static int rtw_p2p_connect(struct net_device *dev,
|
|||
rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo));
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
// Have to enter the power saving with the AP
|
||||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
|
||||
issue_nulldata(pbuddy_adapter, NULL, 1, 3, 500);
|
||||
}
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
DBG_871X( "[%s] Start PreTx Procedure!\n", __FUNCTION__ );
|
||||
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
_set_timer( &pwdinfo->restore_p2p_state_timer, P2P_CONCURRENT_GO_NEGO_TIMEOUT );
|
||||
}
|
||||
else
|
||||
{
|
||||
_set_timer( &pwdinfo->restore_p2p_state_timer, P2P_GO_NEGO_TIMEOUT );
|
||||
}
|
||||
#else
|
||||
_set_timer( &pwdinfo->restore_p2p_state_timer, P2P_GO_NEGO_TIMEOUT );
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
DBG_871X( "[%s] Not Found in Scanning Queue~\n", __FUNCTION__ );
|
||||
ret = -1;
|
||||
}
|
||||
|
@ -5049,11 +4867,6 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
|||
uint p2pielen = 0, attr_contentlen = 0;
|
||||
_irqL irqL;
|
||||
struct tx_invite_req_info* pinvite_req_info = &pwdinfo->invitereq_info;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
struct wifi_display_info* pwfd_info = pwdinfo->wfd_info;
|
||||
|
@ -5183,15 +4996,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
|||
}
|
||||
#endif // CONFIG_WFD
|
||||
|
||||
if ( uintPeerChannel )
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
_cancel_timer_ex( &pwdinfo->ap_p2p_switch_timer );
|
||||
}
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
if ( uintPeerChannel ) {
|
||||
// Store the GO's bssid
|
||||
for( jj = 0, kk = 18; jj < ETH_ALEN; jj++, kk += 3 )
|
||||
{
|
||||
|
@ -5207,41 +5012,12 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
|||
rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo));
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_TX_INVITE_REQ);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
// Have to enter the power saving with the AP
|
||||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
|
||||
issue_nulldata(pbuddy_adapter, NULL, 1, 3, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_channel_bwmode(padapter, uintPeerChannel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
}
|
||||
#else
|
||||
set_channel_bwmode(padapter, uintPeerChannel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
#endif
|
||||
|
||||
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
_set_timer( &pwdinfo->restore_p2p_state_timer, P2P_CONCURRENT_INVITE_TIMEOUT );
|
||||
}
|
||||
else
|
||||
{
|
||||
_set_timer( &pwdinfo->restore_p2p_state_timer, P2P_INVITE_TIMEOUT );
|
||||
}
|
||||
#else
|
||||
_set_timer( &pwdinfo->restore_p2p_state_timer, P2P_INVITE_TIMEOUT );
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
DBG_871X( "[%s] NOT Found in the Scanning Queue!\n", __FUNCTION__ );
|
||||
}
|
||||
exit:
|
||||
|
@ -5271,11 +5047,6 @@ static int rtw_p2p_set_persistent(struct net_device *dev,
|
|||
uint p2pielen = 0, attr_contentlen = 0;
|
||||
_irqL irqL;
|
||||
struct tx_invite_req_info* pinvite_req_info = &pwdinfo->invitereq_info;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
struct wifi_display_info* pwfd_info = pwdinfo->wfd_info;
|
||||
|
@ -5411,10 +5182,6 @@ static int rtw_p2p_set_pc(struct net_device *dev,
|
|||
uint p2pielen = 0, attr_contentlen = 0;
|
||||
_irqL irqL;
|
||||
uint uintPeerChannel = 0;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
struct wifi_display_info* pwfd_info = pwdinfo->wfd_info;
|
||||
|
||||
// Commented by Albert 20120512
|
||||
|
@ -5713,11 +5480,6 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
|||
uint p2pielen = 0, attr_contentlen = 0;
|
||||
_irqL irqL;
|
||||
u8 ie_offset;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
struct wifi_display_info* pwfd_info = pwdinfo->wfd_info;
|
||||
|
@ -5900,12 +5662,6 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
|||
#endif // CONFIG_WFD
|
||||
|
||||
DBG_871X( "[%s] peer channel: %d!\n", __FUNCTION__, uintPeerChannel );
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
_cancel_timer_ex( &pwdinfo->ap_p2p_switch_timer );
|
||||
}
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
_rtw_memcpy( pwdinfo->tx_prov_disc_info.peerIFAddr, pnetwork->network.MacAddress, ETH_ALEN );
|
||||
_rtw_memcpy( pwdinfo->tx_prov_disc_info.peerDevAddr, peerMAC, ETH_ALEN );
|
||||
pwdinfo->tx_prov_disc_info.peer_channel_num[0] = ( u16 ) uintPeerChannel;
|
||||
|
@ -5923,40 +5679,12 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
|||
pwdinfo->tx_prov_disc_info.ssid.SsidLength= P2P_WILDCARD_SSID_LEN;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
// Have to enter the power saving with the AP
|
||||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
|
||||
issue_nulldata(pbuddy_adapter, NULL, 1, 3, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_channel_bwmode(padapter, uintPeerChannel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
}
|
||||
#else
|
||||
set_channel_bwmode(padapter, uintPeerChannel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
#endif
|
||||
|
||||
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ( check_fwstate( pbuddy_mlmepriv, _FW_LINKED ) )
|
||||
{
|
||||
_set_timer( &pwdinfo->restore_p2p_state_timer, P2P_CONCURRENT_PROVISION_TIMEOUT );
|
||||
}
|
||||
else
|
||||
{
|
||||
_set_timer( &pwdinfo->restore_p2p_state_timer, P2P_PROVISION_TIMEOUT );
|
||||
}
|
||||
#else
|
||||
_set_timer( &pwdinfo->restore_p2p_state_timer, P2P_PROVISION_TIMEOUT );
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
DBG_871X( "[%s] NOT Found in the Scanning Queue!\n", __FUNCTION__ );
|
||||
#ifdef CONFIG_INTEL_WIDI
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);
|
||||
|
@ -6305,18 +6033,12 @@ static int rtw_rereg_nd_name(struct net_device *dev,
|
|||
|
||||
if(rereg_priv->old_ifname[0] == 0) {
|
||||
char *reg_ifname;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->isprimary)
|
||||
reg_ifname = padapter->registrypriv.ifname;
|
||||
else
|
||||
#endif
|
||||
reg_ifname = padapter->registrypriv.if2name;
|
||||
|
||||
strncpy(rereg_priv->old_ifname, reg_ifname, IFNAMSIZ);
|
||||
rereg_priv->old_ifname[IFNAMSIZ-1] = 0;
|
||||
}
|
||||
|
||||
//DBG_871X("%s wrqu->data.length:%d\n", __FUNCTION__, wrqu->data.length);
|
||||
if(wrqu->data.length > IFNAMSIZ)
|
||||
return -EFAULT;
|
||||
|
||||
|
|
|
@ -715,18 +715,11 @@ u32 rtw_start_drv_threads(struct adapter *padapter)
|
|||
_status = _FAIL;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->isprimary == true)
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD");
|
||||
if(IS_ERR(padapter->cmdThread))
|
||||
_status = _FAIL;
|
||||
else
|
||||
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); //wait for cmd_thread to run
|
||||
}
|
||||
|
||||
padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD");
|
||||
if(IS_ERR(padapter->cmdThread))
|
||||
_status = _FAIL;
|
||||
else
|
||||
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); //wait for cmd_thread to run
|
||||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
padapter->evtThread = kthread_run(event_thread, padapter, "RTW_EVENT_THREAD");
|
||||
|
@ -774,12 +767,7 @@ void rtw_stop_drv_threads (struct adapter *padapter)
|
|||
{
|
||||
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+rtw_stop_drv_threads\n"));
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->isprimary == true)
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
rtw_stop_cmd_thread(padapter);
|
||||
}
|
||||
rtw_stop_cmd_thread(padapter);
|
||||
|
||||
#ifdef CONFIG_EVENT_THREAD_MODE
|
||||
_rtw_up_sema(&padapter->evtpriv.evt_notify);
|
||||
|
@ -1137,9 +1125,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
|
|||
_cancel_timer_ex( &pwdinfo->find_phase_timer );
|
||||
_cancel_timer_ex( &pwdinfo->restore_p2p_state_timer );
|
||||
_cancel_timer_ex( &pwdinfo->pre_tx_scan_timer);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_cancel_timer_ex( &pwdinfo->ap_p2p_switch_timer );
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_NONE);
|
||||
}
|
||||
}
|
||||
|
@ -1207,321 +1192,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
|
|||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
int _netdev_if2_open(struct net_device *pnetdev)
|
||||
{
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
|
||||
struct adapter *primary_padapter = padapter->pbuddy_adapter;
|
||||
|
||||
DBG_871X("+871x_drv - if2_open, bup=%d\n", padapter->bup);
|
||||
|
||||
if(primary_padapter->bup == false || primary_padapter->hw_init_completed == false)
|
||||
{
|
||||
_netdev_open(primary_padapter->pnetdev);
|
||||
}
|
||||
|
||||
if(padapter->bup == false && primary_padapter->bup == true &&
|
||||
primary_padapter->hw_init_completed == true)
|
||||
{
|
||||
int i;
|
||||
|
||||
padapter->bDriverStopped = false;
|
||||
padapter->bSurpriseRemoved = false;
|
||||
padapter->bCardDisableWOHSM = false;
|
||||
|
||||
padapter->bFWReady = primary_padapter->bFWReady;
|
||||
|
||||
//if (init_mlme_ext_priv(padapter) == _FAIL)
|
||||
// goto netdev_if2_open_error;
|
||||
|
||||
|
||||
if(rtw_start_drv_threads(padapter) == _FAIL)
|
||||
{
|
||||
goto netdev_if2_open_error;
|
||||
}
|
||||
|
||||
|
||||
if(padapter->intf_start)
|
||||
{
|
||||
padapter->intf_start(padapter);
|
||||
}
|
||||
|
||||
rtw_proc_init_one(pnetdev);
|
||||
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_cfg80211_init_wiphy(padapter);
|
||||
#endif
|
||||
|
||||
padapter->bup = true;
|
||||
|
||||
}
|
||||
|
||||
padapter->net_closed = false;
|
||||
|
||||
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||
|
||||
if(!rtw_netif_queue_stopped(pnetdev))
|
||||
rtw_netif_start_queue(pnetdev);
|
||||
else
|
||||
rtw_netif_wake_queue(pnetdev);
|
||||
|
||||
DBG_871X("-871x_drv - if2_open, bup=%d\n", padapter->bup);
|
||||
return 0;
|
||||
|
||||
netdev_if2_open_error:
|
||||
|
||||
padapter->bup = false;
|
||||
|
||||
netif_carrier_off(pnetdev);
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
|
||||
return (-1);
|
||||
|
||||
}
|
||||
|
||||
int netdev_if2_open(struct net_device *pnetdev)
|
||||
{
|
||||
int ret;
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
|
||||
|
||||
_enter_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL);
|
||||
ret = _netdev_if2_open(pnetdev);
|
||||
_exit_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int netdev_if2_close(struct net_device *pnetdev)
|
||||
{
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
|
||||
|
||||
padapter->net_closed = true;
|
||||
|
||||
if(pnetdev)
|
||||
{
|
||||
if (!rtw_netif_queue_stopped(pnetdev))
|
||||
rtw_netif_stop_queue(pnetdev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_scan_abort(padapter);
|
||||
wdev_to_priv(padapter->rtw_wdev)->bandroid_scan = false;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
|
||||
static const struct net_device_ops rtw_netdev_if2_ops = {
|
||||
.ndo_open = netdev_if2_open,
|
||||
.ndo_stop = netdev_if2_close,
|
||||
.ndo_start_xmit = rtw_xmit_entry,
|
||||
.ndo_set_mac_address = rtw_net_set_mac_address,
|
||||
.ndo_get_stats = rtw_net_get_stats,
|
||||
.ndo_do_ioctl = rtw_ioctl,
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
|
||||
.ndo_select_queue = rtw_select_queue,
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
struct adapter *rtw_drv_if2_init(struct adapter *primary_padapter, void (*set_intf_ops)(struct _io_ops *pops))
|
||||
{
|
||||
int res = _FAIL;
|
||||
struct net_device *pnetdev = NULL;
|
||||
struct adapter *padapter = NULL;
|
||||
struct dvobj_priv *pdvobjpriv;
|
||||
u8 mac[ETH_ALEN];
|
||||
|
||||
/****** init netdev ******/
|
||||
pnetdev = rtw_init_netdev(NULL);
|
||||
if (!pnetdev)
|
||||
goto error_rtw_drv_if2_init;
|
||||
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
|
||||
DBG_871X("register rtw_netdev_if2_ops to netdev_ops\n");
|
||||
pnetdev->netdev_ops = &rtw_netdev_if2_ops;
|
||||
#else
|
||||
pnetdev->open = netdev_if2_open;
|
||||
pnetdev->stop = netdev_if2_close;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NO_WIRELESS_HANDLERS
|
||||
pnetdev->wireless_handlers = NULL;
|
||||
#endif
|
||||
|
||||
/****** init adapter ******/
|
||||
padapter = rtw_netdev_priv(pnetdev);
|
||||
_rtw_memcpy(padapter, primary_padapter, sizeof(struct adapter));
|
||||
|
||||
//
|
||||
padapter->bup = false;
|
||||
padapter->net_closed = true;
|
||||
padapter->hw_init_completed = false;
|
||||
padapter->dir_dev = NULL;
|
||||
padapter->dir_odm = NULL;
|
||||
|
||||
//set adapter_type/iface type
|
||||
padapter->isprimary = false;
|
||||
padapter->adapter_type = SECONDARY_ADAPTER;
|
||||
padapter->pbuddy_adapter = primary_padapter;
|
||||
padapter->iface_id = IFACE_ID1;
|
||||
#ifndef CONFIG_HWPORT_SWAP //Port0 -> Pri , Port1 -> Sec
|
||||
padapter->iface_type = IFACE_PORT1;
|
||||
#else
|
||||
padapter->iface_type = IFACE_PORT0;
|
||||
#endif //CONFIG_HWPORT_SWAP
|
||||
//
|
||||
padapter->pnetdev = pnetdev;
|
||||
|
||||
/****** setup dvobj ******/
|
||||
pdvobjpriv = adapter_to_dvobj(padapter);
|
||||
pdvobjpriv->if2 = padapter;
|
||||
pdvobjpriv->padapters[pdvobjpriv->iface_nums++] = padapter;
|
||||
|
||||
SET_NETDEV_DEV(pnetdev, dvobj_to_dev(pdvobjpriv));
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_wdev_alloc(padapter, dvobj_to_dev(pdvobjpriv));
|
||||
#endif //CONFIG_IOCTL_CFG80211
|
||||
|
||||
//set interface_type/chip_type/HardwareType
|
||||
padapter->interface_type = primary_padapter->interface_type;
|
||||
padapter->chip_type = primary_padapter->chip_type;
|
||||
padapter->HardwareType = primary_padapter->HardwareType;
|
||||
|
||||
//step 2. hook HalFunc, allocate HalData
|
||||
hal_set_hal_ops(padapter);
|
||||
|
||||
padapter->HalFunc.inirp_init = NULL;
|
||||
padapter->HalFunc.inirp_deinit = NULL;
|
||||
|
||||
//
|
||||
padapter->intf_start = primary_padapter->intf_start;
|
||||
padapter->intf_stop = primary_padapter->intf_stop;
|
||||
|
||||
//step init_io_priv
|
||||
if ((rtw_init_io_priv(padapter, set_intf_ops)) == _FAIL) {
|
||||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,(" \n Can't init io_reqs\n"));
|
||||
}
|
||||
|
||||
//step read_chip_version
|
||||
rtw_hal_read_chip_version(padapter);
|
||||
|
||||
//step usb endpoint mapping
|
||||
rtw_hal_chip_configure(padapter);
|
||||
|
||||
|
||||
//init drv data
|
||||
if(rtw_init_drv_sw(padapter)!= _SUCCESS)
|
||||
goto error_rtw_drv_if2_init;
|
||||
|
||||
//get mac address from primary_padapter
|
||||
_rtw_memcpy(mac, primary_padapter->eeprompriv.mac_addr, ETH_ALEN);
|
||||
|
||||
if (((mac[0]==0xff) &&(mac[1]==0xff) && (mac[2]==0xff) &&
|
||||
(mac[3]==0xff) && (mac[4]==0xff) &&(mac[5]==0xff)) ||
|
||||
((mac[0]==0x0) && (mac[1]==0x0) && (mac[2]==0x0) &&
|
||||
(mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0)))
|
||||
{
|
||||
mac[0] = 0x00;
|
||||
mac[1] = 0xe0;
|
||||
mac[2] = 0x4c;
|
||||
mac[3] = 0x87;
|
||||
mac[4] = 0x11;
|
||||
mac[5] = 0x22;
|
||||
}
|
||||
else
|
||||
{
|
||||
//If the BIT1 is 0, the address is universally administered.
|
||||
//If it is 1, the address is locally administered
|
||||
mac[0] |= BIT(1); // locally administered
|
||||
|
||||
}
|
||||
|
||||
_rtw_memcpy(padapter->eeprompriv.mac_addr, mac, ETH_ALEN);
|
||||
rtw_init_wifidirect_addrs(padapter, padapter->eeprompriv.mac_addr, padapter->eeprompriv.mac_addr);
|
||||
|
||||
primary_padapter->pbuddy_adapter = padapter;
|
||||
|
||||
res = _SUCCESS;
|
||||
|
||||
return padapter;
|
||||
|
||||
|
||||
error_rtw_drv_if2_init:
|
||||
|
||||
if(padapter)
|
||||
rtw_free_drv_sw(padapter);
|
||||
|
||||
if (pnetdev)
|
||||
rtw_free_netdev(pnetdev);
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
void rtw_drv_if2_free(struct adapter *if2)
|
||||
{
|
||||
struct adapter *padapter = if2;
|
||||
struct net_device *pnetdev = NULL;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
pnetdev = padapter->pnetdev;
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_wdev_free(padapter->rtw_wdev);
|
||||
#endif /* CONFIG_IOCTL_CFG80211 */
|
||||
|
||||
|
||||
rtw_free_drv_sw(padapter);
|
||||
|
||||
rtw_free_netdev(pnetdev);
|
||||
|
||||
}
|
||||
|
||||
void rtw_drv_if2_stop(struct adapter *if2)
|
||||
{
|
||||
struct adapter *padapter = if2;
|
||||
//struct net_device *pnetdev = NULL;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
/*
|
||||
pnetdev = padapter->pnetdev;
|
||||
|
||||
if (pnetdev) {
|
||||
unregister_netdev(pnetdev); //will call netdev_close()
|
||||
rtw_proc_remove_one(pnetdev);
|
||||
}
|
||||
*/
|
||||
rtw_cancel_all_timer(padapter);
|
||||
|
||||
if (padapter->bup == true) {
|
||||
padapter->bDriverStopped = true;
|
||||
#ifdef CONFIG_XMIT_ACK
|
||||
if (padapter->xmitpriv.ack_tx)
|
||||
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_DRV_STOP);
|
||||
#endif
|
||||
|
||||
if(padapter->intf_stop)
|
||||
{
|
||||
padapter->intf_stop(padapter);
|
||||
}
|
||||
|
||||
rtw_stop_drv_threads(padapter);
|
||||
|
||||
padapter->bup = false;
|
||||
}
|
||||
/*
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_wdev_unregister(padapter->rtw_wdev);
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
#endif //end of CONFIG_CONCURRENT_MODE
|
||||
|
||||
#ifdef CONFIG_BR_EXT
|
||||
void netdev_br_init(struct net_device *netdev)
|
||||
{
|
||||
|
@ -1721,14 +1391,6 @@ int _netdev_open(struct net_device *pnetdev)
|
|||
|
||||
netdev_open_normal_process:
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
{
|
||||
struct adapter *sec_adapter = padapter->pbuddy_adapter;
|
||||
if(sec_adapter && (sec_adapter->bup == false))
|
||||
_netdev_if2_open(sec_adapter->pnetdev);
|
||||
}
|
||||
#endif
|
||||
|
||||
RT_TRACE(_module_os_intfs_c_,_drv_info_,("-871x_drv - dev_open\n"));
|
||||
DBG_871X("-871x_drv - drv_open, bup=%d\n", padapter->bup);
|
||||
|
||||
|
@ -2332,18 +1994,8 @@ int rtw_suspend_common(struct adapter *padapter)
|
|||
|
||||
rtw_suspend_free_assoc_resource(padapter);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter)){
|
||||
rtw_suspend_free_assoc_resource(padapter->pbuddy_adapter);
|
||||
}
|
||||
#endif
|
||||
rtw_led_control(padapter, LED_CTL_POWER_OFF);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter)){
|
||||
rtw_dev_unload(padapter->pbuddy_adapter);
|
||||
}
|
||||
#endif
|
||||
rtw_dev_unload(padapter);
|
||||
|
||||
exit:
|
||||
|
@ -2359,12 +2011,6 @@ int rtw_resume_common(struct adapter *padapter)
|
|||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
|
||||
;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_reset_drv_sw(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
rtw_reset_drv_sw(padapter);
|
||||
pwrpriv->bkeepfwalive = false;
|
||||
|
||||
|
@ -2378,16 +2024,6 @@ int rtw_resume_common(struct adapter *padapter)
|
|||
netif_device_attach(pnetdev);
|
||||
netif_carrier_on(pnetdev);
|
||||
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter)){
|
||||
pnetdev = padapter->pbuddy_adapter->pnetdev;
|
||||
|
||||
netif_device_attach(pnetdev);
|
||||
netif_carrier_on(pnetdev);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
|
||||
|
@ -2403,29 +2039,5 @@ int rtw_resume_common(struct adapter *padapter)
|
|||
} else {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - ???\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter))
|
||||
{
|
||||
mlmepriv = &padapter->pbuddy_adapter->mlmepriv;
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
|
||||
#ifdef CONFIG_LAYER2_ROAMING_RESUME
|
||||
rtw_roaming(padapter->pbuddy_adapter, NULL);
|
||||
#endif //CONFIG_LAYER2_ROAMING_RESUME
|
||||
|
||||
} else if (check_fwstate(mlmepriv, WIFI_AP_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
rtw_ap_restore_network(padapter->pbuddy_adapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_ADHOC_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_ADHOC_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
} else {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - ???\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -1245,7 +1245,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
|||
dvobj->padapters[dvobj->iface_nums++] = padapter;
|
||||
padapter->iface_id = IFACE_ID0;
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT)
|
||||
#if defined(CONFIG_DUALMAC_CONCURRENT)
|
||||
//set adapter_type/iface type for primary padapter
|
||||
padapter->isprimary = true;
|
||||
padapter->adapter_type = PRIMARY_ADAPTER;
|
||||
|
@ -1606,12 +1606,6 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
|
|||
goto free_dvobj;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if((if2 = rtw_drv_if2_init(if1, usb_set_intf_ops)) == NULL) {
|
||||
goto free_if1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INTEL_PROXIM
|
||||
rtw_sw_export=if1;
|
||||
#endif
|
||||
|
@ -1646,12 +1640,6 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
|
|||
status = _SUCCESS;
|
||||
|
||||
free_if2:
|
||||
if(status != _SUCCESS && if2) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_drv_if2_stop(if2);
|
||||
rtw_drv_if2_free(if2);
|
||||
#endif
|
||||
}
|
||||
free_if1:
|
||||
if (status != _SUCCESS && if1) {
|
||||
rtw_usb_if1_deinit(if1);
|
||||
|
@ -1699,16 +1687,8 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf)
|
|||
|
||||
LeaveAllPowerSaveMode(padapter);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_drv_if2_stop(dvobj->if2);
|
||||
#endif
|
||||
|
||||
rtw_usb_if1_deinit(padapter);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_drv_if2_free(dvobj->if2);
|
||||
#endif
|
||||
|
||||
usb_dvobj_deinit(pusb_intf);
|
||||
|
||||
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("-dev_remove()\n"));
|
||||
|
|
Loading…
Reference in a new issue