mirror of
https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
synced 2026-01-19 10:26:35 +00:00
Update to 5.6.1
This commit is contained in:
@@ -62,7 +62,7 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
|
||||
if (pAdapter->registrypriv.boffefusemask)
|
||||
return FALSE;
|
||||
|
||||
#if DEV_BUS_TYPE == RT_USB_INTERFACE
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
return (IS_MASKED(8188E, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
@@ -99,6 +99,10 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
|
||||
if (IS_HARDWARE_TYPE_8188F(pAdapter))
|
||||
return (IS_MASKED(8188F, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8188GTV)
|
||||
if (IS_HARDWARE_TYPE_8188GTV(pAdapter))
|
||||
return (IS_MASKED(8188GTV, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822B)
|
||||
if (IS_HARDWARE_TYPE_8822B(pAdapter))
|
||||
return (IS_MASKED(8822B, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
@@ -107,13 +111,22 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
|
||||
if (IS_HARDWARE_TYPE_8723D(pAdapter))
|
||||
return (IS_MASKED(8723D, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8710B)
|
||||
if (IS_HARDWARE_TYPE_8710B(pAdapter))
|
||||
return (IS_MASKED(8710B, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8821C)
|
||||
if (IS_HARDWARE_TYPE_8821CU(pAdapter))
|
||||
return (IS_MASKED(8821C, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
|
||||
#elif DEV_BUS_TYPE == RT_PCI_INTERFACE
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
if (IS_HARDWARE_TYPE_8192FU(pAdapter))
|
||||
return (IS_MASKED(8192F, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif /*CONFIG_USB_HCI*/
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
return (IS_MASKED(8188E, _MPCIE, Offset)) ? TRUE : FALSE;
|
||||
@@ -147,7 +160,13 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
|
||||
return (IS_MASKED(8821C, _MPCIE, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
|
||||
#elif DEV_BUS_TYPE == RT_SDIO_INTERFACE
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
if (IS_HARDWARE_TYPE_8192FE(pAdapter))
|
||||
return (IS_MASKED(8192F, _MPCIE, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif /*CONFIG_PCI_HCI*/
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#ifdef CONFIG_RTL8188E_SDIO
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
return (IS_MASKED(8188E, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
@@ -156,10 +175,14 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
|
||||
if (IS_HARDWARE_TYPE_8723BS(pAdapter))
|
||||
return (IS_MASKED(8723B, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188F_SDIO
|
||||
#ifdef CONFIG_RTL8188F
|
||||
if (IS_HARDWARE_TYPE_8188F(pAdapter))
|
||||
return (IS_MASKED(8188F, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188GTV
|
||||
if (IS_HARDWARE_TYPE_8188GTV(pAdapter))
|
||||
return (IS_MASKED(8188GTV, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8192E
|
||||
if (IS_HARDWARE_TYPE_8192ES(pAdapter))
|
||||
return (IS_MASKED(8192E, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
@@ -176,7 +199,11 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
|
||||
if (IS_HARDWARE_TYPE_8822B(pAdapter))
|
||||
return (IS_MASKED(8822B, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
if (IS_HARDWARE_TYPE_8192FS(pAdapter))
|
||||
return (IS_MASKED(8192F, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif /*CONFIG_SDIO_HCI*/
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -185,7 +212,7 @@ void rtw_efuse_mask_array(PADAPTER pAdapter, u8 *pArray)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
#if DEV_BUS_TYPE == RT_USB_INTERFACE
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
GET_MASK_ARRAY(8188E, _MUSB, pArray);
|
||||
@@ -214,6 +241,10 @@ void rtw_efuse_mask_array(PADAPTER pAdapter, u8 *pArray)
|
||||
if (IS_HARDWARE_TYPE_8188F(pAdapter))
|
||||
GET_MASK_ARRAY(8188F, _MUSB, pArray);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8188GTV)
|
||||
if (IS_HARDWARE_TYPE_8188GTV(pAdapter))
|
||||
GET_MASK_ARRAY(8188GTV, _MUSB, pArray);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8814A)
|
||||
if (IS_HARDWARE_TYPE_8814A(pAdapter))
|
||||
GET_MASK_ARRAY(8814A, _MUSB, pArray);
|
||||
@@ -226,9 +257,13 @@ void rtw_efuse_mask_array(PADAPTER pAdapter, u8 *pArray)
|
||||
if (IS_HARDWARE_TYPE_8821CU(pAdapter))
|
||||
GET_MASK_ARRAY(8821C, _MUSB, pArray);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
if (IS_HARDWARE_TYPE_8192FU(pAdapter))
|
||||
GET_MASK_ARRAY(8192F, _MUSB, pArray);
|
||||
#endif
|
||||
#endif /*CONFIG_USB_HCI*/
|
||||
|
||||
|
||||
#elif DEV_BUS_TYPE == RT_PCI_INTERFACE
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
GET_MASK_ARRAY(8188E, _MPCIE, pArray);
|
||||
@@ -261,9 +296,13 @@ void rtw_efuse_mask_array(PADAPTER pAdapter, u8 *pArray)
|
||||
if (IS_HARDWARE_TYPE_8821CE(pAdapter))
|
||||
GET_MASK_ARRAY(8821C, _MPCIE, pArray);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
if (IS_HARDWARE_TYPE_8192FE(pAdapter))
|
||||
GET_MASK_ARRAY(8192F, _MPCIE, pArray);
|
||||
#endif
|
||||
#endif /*CONFIG_PCI_HCI*/
|
||||
|
||||
|
||||
#elif DEV_BUS_TYPE == RT_SDIO_INTERFACE
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
GET_MASK_ARRAY(8188E, _MSDIO, pArray);
|
||||
@@ -276,6 +315,10 @@ void rtw_efuse_mask_array(PADAPTER pAdapter, u8 *pArray)
|
||||
if (IS_HARDWARE_TYPE_8188F(pAdapter))
|
||||
GET_MASK_ARRAY(8188F, _MSDIO, pArray);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8188GTV)
|
||||
if (IS_HARDWARE_TYPE_8188GTV(pAdapter))
|
||||
GET_MASK_ARRAY(8188GTV, _MSDIO, pArray);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192E)
|
||||
if (IS_HARDWARE_TYPE_8192ES(pAdapter))
|
||||
GET_MASK_ARRAY(8192E, _MSDIO, pArray);
|
||||
@@ -292,14 +335,18 @@ void rtw_efuse_mask_array(PADAPTER pAdapter, u8 *pArray)
|
||||
if (IS_HARDWARE_TYPE_8822B(pAdapter))
|
||||
GET_MASK_ARRAY(8822B , _MSDIO, pArray);
|
||||
#endif
|
||||
#endif /*#elif DEV_BUS_TYPE == RT_SDIO_INTERFACE*/
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
if (IS_HARDWARE_TYPE_8192FS(pAdapter))
|
||||
GET_MASK_ARRAY(8192F, _MSDIO, pArray);
|
||||
#endif
|
||||
#endif /*CONFIG_SDIO_HCI*/
|
||||
}
|
||||
|
||||
u16 rtw_get_efuse_mask_arraylen(PADAPTER pAdapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
#if DEV_BUS_TYPE == RT_USB_INTERFACE
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8188E, _MUSB);
|
||||
@@ -328,6 +375,10 @@ u16 rtw_get_efuse_mask_arraylen(PADAPTER pAdapter)
|
||||
if (IS_HARDWARE_TYPE_8188F(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8188F, _MUSB);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8188GTV)
|
||||
if (IS_HARDWARE_TYPE_8188GTV(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8188GTV, _MUSB);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8814A)
|
||||
if (IS_HARDWARE_TYPE_8814A(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8814A, _MUSB);
|
||||
@@ -340,9 +391,13 @@ u16 rtw_get_efuse_mask_arraylen(PADAPTER pAdapter)
|
||||
if (IS_HARDWARE_TYPE_8821CU(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8821C, _MUSB);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
if (IS_HARDWARE_TYPE_8192FU(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8192F, _MUSB);
|
||||
#endif
|
||||
#endif /*CONFIG_USB_HCI*/
|
||||
|
||||
|
||||
#elif DEV_BUS_TYPE == RT_PCI_INTERFACE
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8188E, _MPCIE);
|
||||
@@ -375,9 +430,13 @@ u16 rtw_get_efuse_mask_arraylen(PADAPTER pAdapter)
|
||||
if (IS_HARDWARE_TYPE_8821CE(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8821C, _MPCIE);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
if (IS_HARDWARE_TYPE_8192FE(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8192F, _MPCIE);
|
||||
#endif
|
||||
#endif /*CONFIG_PCI_HCI*/
|
||||
|
||||
|
||||
#elif DEV_BUS_TYPE == RT_SDIO_INTERFACE
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8188E, _MSDIO);
|
||||
@@ -390,6 +449,10 @@ u16 rtw_get_efuse_mask_arraylen(PADAPTER pAdapter)
|
||||
if (IS_HARDWARE_TYPE_8188F(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8188F, _MSDIO);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8188GTV)
|
||||
if (IS_HARDWARE_TYPE_8188GTV(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8188GTV, _MSDIO);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192E)
|
||||
if (IS_HARDWARE_TYPE_8192ES(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8192E, _MSDIO);
|
||||
@@ -406,7 +469,11 @@ u16 rtw_get_efuse_mask_arraylen(PADAPTER pAdapter)
|
||||
if (IS_HARDWARE_TYPE_8822B(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8822B, _MSDIO);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
if (IS_HARDWARE_TYPE_8192FS(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8192F, _MSDIO);
|
||||
#endif
|
||||
#endif/*CONFIG_SDIO_HCI*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -577,7 +644,7 @@ void rtw_efuse_analyze(PADAPTER padapter, u8 Type, u8 Fake)
|
||||
for (bank = startBank; bank <= endBank; bank++) {
|
||||
if (!hal_EfuseSwitchToBank(padapter, bank, bPseudoTest)) {
|
||||
RTW_INFO("EFUSE_SwitchToBank() Fail!!\n");
|
||||
return;
|
||||
goto out_free_buffer;
|
||||
}
|
||||
|
||||
eFuse_Addr = bank * EFUSE_MAX_BANK_SIZE;
|
||||
@@ -586,7 +653,7 @@ void rtw_efuse_analyze(PADAPTER padapter, u8 Type, u8 Fake)
|
||||
|
||||
if (efuseHeader == 0xFF && bank == startBank && Fake != TRUE) {
|
||||
RTW_INFO("Non-PGed Efuse\n");
|
||||
return;
|
||||
goto out_free_buffer;
|
||||
}
|
||||
RTW_INFO("EFUSE_REAL_CONTENT_LEN = %d\n", maprawlen);
|
||||
|
||||
@@ -719,6 +786,8 @@ void rtw_efuse_analyze(PADAPTER padapter, u8 Type, u8 Fake)
|
||||
);
|
||||
}
|
||||
_RTW_PRINT_SEL(RTW_DBGDUMP, "\n");
|
||||
|
||||
out_free_buffer:
|
||||
if (eFuseWord)
|
||||
rtw_mfree((u8 *)eFuseWord, EFUSE_MAX_SECTION_NUM * (EFUSE_MAX_WORD_UNIT * 2));
|
||||
}
|
||||
@@ -1997,6 +2066,14 @@ efuse_OneByteRead(
|
||||
return bResult;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTL8710B
|
||||
/* <20171208, Peter>, Dont do the following write16(0x34) */
|
||||
if (IS_HARDWARE_TYPE_8710B(pAdapter)) {
|
||||
bResult = pAdapter->hal_func.efuse_indirect_read4(pAdapter, addr, data);
|
||||
return bResult;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (IS_HARDWARE_TYPE_8723B(pAdapter) ||
|
||||
(IS_HARDWARE_TYPE_8192E(pAdapter) && (!IS_A_CUT(pHalData->version_id))) ||
|
||||
(IS_VENDOR_8188E_I_CUT_SERIES(pAdapter)) || (IS_CHIP_VENDOR_SMIC(pHalData->version_id))
|
||||
@@ -2687,31 +2764,6 @@ EFUSE_ShadowWrite(
|
||||
|
||||
} /* EFUSE_ShadowWrite */
|
||||
|
||||
VOID
|
||||
Efuse_InitSomeVar(
|
||||
IN PADAPTER pAdapter
|
||||
);
|
||||
VOID
|
||||
Efuse_InitSomeVar(
|
||||
IN PADAPTER pAdapter
|
||||
)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
_rtw_memset((PVOID)&fakeEfuseContent[0], 0xff, EFUSE_MAX_HW_SIZE);
|
||||
_rtw_memset((PVOID)&fakeEfuseInitMap[0], 0xff, EFUSE_MAX_MAP_LEN);
|
||||
_rtw_memset((PVOID)&fakeEfuseModifiedMap[0], 0xff, EFUSE_MAX_MAP_LEN);
|
||||
|
||||
for (i = 0; i < EFUSE_MAX_BT_BANK; i++)
|
||||
_rtw_memset((PVOID)&BTEfuseContent[i][0], EFUSE_MAX_HW_SIZE, 0xff);
|
||||
_rtw_memset((PVOID)&BTEfuseInitMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
|
||||
_rtw_memset((PVOID)&BTEfuseModifiedMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
|
||||
|
||||
for (i = 0; i < EFUSE_MAX_BT_BANK; i++)
|
||||
_rtw_memset((PVOID)&fakeBTEfuseContent[i][0], 0xff, EFUSE_MAX_HW_SIZE);
|
||||
_rtw_memset((PVOID)&fakeBTEfuseInitMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
|
||||
_rtw_memset((PVOID)&fakeBTEfuseModifiedMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
|
||||
}
|
||||
#endif /* !RTW_HALMAC */
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: efuse_ShadowRead1Byte
|
||||
|
||||
@@ -234,6 +234,259 @@ exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void rtw_mesh_bss_peering_status(WLAN_BSSID_EX *bss, u8 *nop, u8 *accept)
|
||||
{
|
||||
u8 *ie;
|
||||
int ie_len;
|
||||
|
||||
if (nop)
|
||||
*nop = 0;
|
||||
if (accept)
|
||||
*accept = 0;
|
||||
|
||||
ie = rtw_get_ie(BSS_EX_TLV_IES(bss), WLAN_EID_MESH_CONFIG, &ie_len,
|
||||
BSS_EX_TLV_IES_LEN(bss));
|
||||
if (!ie || ie_len != 7)
|
||||
goto exit;
|
||||
|
||||
if (nop)
|
||||
*nop = GET_MESH_CONF_ELE_NUM_OF_PEERINGS(ie + 2);
|
||||
if (accept)
|
||||
*accept = GET_MESH_CONF_ELE_ACCEPT_PEERINGS(ie + 2);
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
void rtw_mesh_update_scanned_acnode_status(_adapter *adapter, struct wlan_network *scanned)
|
||||
{
|
||||
bool acnode;
|
||||
u8 nop, accept;
|
||||
|
||||
rtw_mesh_bss_peering_status(&scanned->network, &nop, &accept);
|
||||
|
||||
acnode = !nop && accept;
|
||||
|
||||
if (acnode && scanned->acnode_stime == 0) {
|
||||
scanned->acnode_stime = rtw_get_current_time();
|
||||
if (scanned->acnode_stime == 0)
|
||||
scanned->acnode_stime++;
|
||||
} else if (!acnode) {
|
||||
scanned->acnode_stime = 0;
|
||||
scanned->acnode_notify_etime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool rtw_mesh_scanned_is_acnode_confirmed(_adapter *adapter, struct wlan_network *scanned)
|
||||
{
|
||||
return scanned->acnode_stime
|
||||
&& rtw_get_passing_time_ms(scanned->acnode_stime)
|
||||
> adapter->mesh_cfg.peer_sel_policy.acnode_conf_timeout_ms;
|
||||
}
|
||||
|
||||
static bool rtw_mesh_scanned_is_acnode_allow_notify(_adapter *adapter, struct wlan_network *scanned)
|
||||
{
|
||||
return scanned->acnode_notify_etime
|
||||
&& rtw_time_after(scanned->acnode_notify_etime, rtw_get_current_time());
|
||||
}
|
||||
|
||||
bool rtw_mesh_acnode_prevent_allow_sacrifice(_adapter *adapter)
|
||||
{
|
||||
struct rtw_mesh_cfg *mcfg = &adapter->mesh_cfg;
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
bool allow = 0;
|
||||
|
||||
if (!mcfg->peer_sel_policy.acnode_prevent
|
||||
|| mcfg->max_peer_links <= 1
|
||||
|| stapriv->asoc_list_cnt < mcfg->max_peer_links)
|
||||
goto exit;
|
||||
|
||||
#if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST
|
||||
if (rtw_mesh_cto_mgate_required(adapter))
|
||||
goto exit;
|
||||
#endif
|
||||
|
||||
allow = 1;
|
||||
|
||||
exit:
|
||||
return allow;
|
||||
}
|
||||
|
||||
static bool rtw_mesh_acnode_candidate_exist(_adapter *adapter)
|
||||
{
|
||||
struct rtw_mesh_cfg *mcfg = &adapter->mesh_cfg;
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
struct mlme_priv *mlme = &adapter->mlmepriv;
|
||||
_queue *queue = &(mlme->scanned_queue);
|
||||
_list *head, *list;
|
||||
_irqL irqL;
|
||||
struct wlan_network *scanned = NULL;
|
||||
struct sta_info *sta = NULL;
|
||||
bool need = 0;
|
||||
|
||||
_enter_critical_bh(&(mlme->scanned_queue.lock), &irqL);
|
||||
|
||||
head = get_list_head(queue);
|
||||
list = get_next(head);
|
||||
while (!rtw_end_of_queue_search(head, list)) {
|
||||
scanned = LIST_CONTAINOR(list, struct wlan_network, list);
|
||||
list = get_next(list);
|
||||
|
||||
if (rtw_get_passing_time_ms(scanned->last_scanned) < mcfg->peer_sel_policy.scanr_exp_ms
|
||||
&& rtw_mesh_scanned_is_acnode_confirmed(adapter, scanned)
|
||||
&& (!mcfg->rssi_threshold || mcfg->rssi_threshold <= scanned->network.Rssi)
|
||||
#if CONFIG_RTW_MACADDR_ACL
|
||||
&& rtw_access_ctrl(adapter, scanned->network.MacAddress) == _TRUE
|
||||
#endif
|
||||
&& rtw_bss_is_candidate_mesh_peer(&mlme->cur_network.network, &scanned->network, 1, 1)
|
||||
#if CONFIG_RTW_MESH_PEER_BLACKLIST
|
||||
&& !rtw_mesh_peer_blacklist_search(adapter, scanned->network.MacAddress)
|
||||
#endif
|
||||
#if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST
|
||||
&& rtw_mesh_cto_mgate_network_filter(adapter, scanned)
|
||||
#endif
|
||||
) {
|
||||
need = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(mlme->scanned_queue.lock), &irqL);
|
||||
|
||||
exit:
|
||||
return need;
|
||||
}
|
||||
|
||||
static int rtw_mesh_acnode_prevent_sacrifice_chk(_adapter *adapter, struct sta_info **sac, struct sta_info *com)
|
||||
{
|
||||
struct rtw_mesh_cfg *mcfg = &adapter->mesh_cfg;
|
||||
int updated = 0;
|
||||
|
||||
/*
|
||||
* TODO: compare next_hop reference cnt of forwarding info
|
||||
* don't sacrifice working next_hop or choose sta with least cnt
|
||||
*/
|
||||
|
||||
if (*sac == NULL) {
|
||||
updated = 1;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST
|
||||
if (mcfg->peer_sel_policy.cto_mgate_require
|
||||
&& !mcfg->dot11MeshGateAnnouncementProtocol
|
||||
) {
|
||||
if (IS_CTO_MGATE_CONF_TIMEOUT(com->plink)) {
|
||||
if (!IS_CTO_MGATE_CONF_TIMEOUT((*sac)->plink)) {
|
||||
/* blacklist > not blacklist */
|
||||
updated = 1;
|
||||
goto exit;
|
||||
}
|
||||
} else if (!IS_CTO_MGATE_CONF_DISABLED(com->plink)) {
|
||||
if (IS_CTO_MGATE_CONF_DISABLED((*sac)->plink)) {
|
||||
/* confirming > disabled */
|
||||
updated = 1;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
exit:
|
||||
if (updated)
|
||||
*sac = com;
|
||||
|
||||
return updated;
|
||||
}
|
||||
|
||||
struct sta_info *_rtw_mesh_acnode_prevent_pick_sacrifice(_adapter *adapter)
|
||||
{
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
_list *head, *list;
|
||||
struct sta_info *sta, *sacrifice = NULL;
|
||||
u8 nop;
|
||||
|
||||
head = &stapriv->asoc_list;
|
||||
list = get_next(head);
|
||||
while (rtw_end_of_queue_search(head, list) == _FALSE) {
|
||||
sta = LIST_CONTAINOR(list, struct sta_info, asoc_list);
|
||||
list = get_next(list);
|
||||
|
||||
if (!sta->plink || !sta->plink->scanned) {
|
||||
rtw_warn_on(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
rtw_mesh_bss_peering_status(&sta->plink->scanned->network, &nop, NULL);
|
||||
if (nop < 2)
|
||||
continue;
|
||||
|
||||
rtw_mesh_acnode_prevent_sacrifice_chk(adapter, &sacrifice, sta);
|
||||
}
|
||||
|
||||
return sacrifice;
|
||||
}
|
||||
|
||||
struct sta_info *rtw_mesh_acnode_prevent_pick_sacrifice(_adapter *adapter)
|
||||
{
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
struct sta_info *sacrifice = NULL;
|
||||
|
||||
enter_critical_bh(&stapriv->asoc_list_lock);
|
||||
|
||||
sacrifice = _rtw_mesh_acnode_prevent_pick_sacrifice(adapter);
|
||||
|
||||
exit_critical_bh(&stapriv->asoc_list_lock);
|
||||
|
||||
return sacrifice;
|
||||
}
|
||||
|
||||
static void rtw_mesh_acnode_rsvd_chk(_adapter *adapter)
|
||||
{
|
||||
struct rtw_mesh_info *minfo = &adapter->mesh_info;
|
||||
struct mesh_plink_pool *plink_ctl = &minfo->plink_ctl;
|
||||
u8 acnode_rsvd = 0;
|
||||
|
||||
if (rtw_mesh_acnode_prevent_allow_sacrifice(adapter)
|
||||
&& rtw_mesh_acnode_prevent_pick_sacrifice(adapter)
|
||||
&& rtw_mesh_acnode_candidate_exist(adapter))
|
||||
acnode_rsvd = 1;
|
||||
|
||||
if (plink_ctl->acnode_rsvd != acnode_rsvd) {
|
||||
plink_ctl->acnode_rsvd = acnode_rsvd;
|
||||
RTW_INFO(FUNC_ADPT_FMT" acnode_rsvd = %d\n", FUNC_ADPT_ARG(adapter), plink_ctl->acnode_rsvd);
|
||||
update_beacon(adapter, WLAN_EID_MESH_CONFIG, NULL, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void rtw_mesh_acnode_set_notify_etime(_adapter *adapter, u8 *rframe_whdr)
|
||||
{
|
||||
if (adapter->mesh_info.plink_ctl.acnode_rsvd) {
|
||||
struct wlan_network *scanned = rtw_find_network(&adapter->mlmepriv.scanned_queue, get_addr2_ptr(rframe_whdr));
|
||||
|
||||
if (rtw_mesh_scanned_is_acnode_confirmed(adapter, scanned)) {
|
||||
scanned->acnode_notify_etime = rtw_get_current_time()
|
||||
+ rtw_ms_to_systime(adapter->mesh_cfg.peer_sel_policy.acnode_notify_timeout_ms);
|
||||
if (scanned->acnode_notify_etime == 0)
|
||||
scanned->acnode_notify_etime++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dump_mesh_acnode_prevent_settings(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct mesh_peer_sel_policy *peer_sel_policy = &adapter->mesh_cfg.peer_sel_policy;
|
||||
|
||||
RTW_PRINT_SEL(sel, "%-6s %-12s %-14s\n"
|
||||
, "enable", "conf_timeout", "nofity_timeout");
|
||||
RTW_PRINT_SEL(sel, "%6u %12u %14u\n"
|
||||
, peer_sel_policy->acnode_prevent
|
||||
, peer_sel_policy->acnode_conf_timeout_ms
|
||||
, peer_sel_policy->acnode_notify_timeout_ms);
|
||||
}
|
||||
#endif /* CONFIG_RTW_MESH_ACNODE_PREVENT */
|
||||
|
||||
#if CONFIG_RTW_MESH_PEER_BLACKLIST
|
||||
int rtw_mesh_peer_blacklist_add(_adapter *adapter, const u8 *addr)
|
||||
{
|
||||
@@ -355,10 +608,9 @@ void dump_mesh_cto_mgate_blacklist_settings(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct mesh_peer_sel_policy *peer_sel_policy = &adapter->mesh_cfg.peer_sel_policy;
|
||||
|
||||
RTW_PRINT_SEL(sel, "%-7s %-12s %-17s\n"
|
||||
, "require", "conf_timeout", "blacklist_timeout");
|
||||
RTW_PRINT_SEL(sel, "%7u %12u %17u\n"
|
||||
, peer_sel_policy->cto_mgate_require
|
||||
RTW_PRINT_SEL(sel, "%-12s %-17s\n"
|
||||
, "conf_timeout", "blacklist_timeout");
|
||||
RTW_PRINT_SEL(sel, "%12u %17u\n"
|
||||
, peer_sel_policy->cto_mgate_conf_timeout_ms
|
||||
, peer_sel_policy->cto_mgate_blacklist_timeout_ms);
|
||||
}
|
||||
@@ -406,6 +658,7 @@ void rtw_chk_candidate_peer_notify(_adapter *adapter, struct wlan_network *scann
|
||||
struct rtw_mesh_info *minfo = &adapter->mesh_info;
|
||||
struct rtw_mesh_cfg *mcfg = &adapter->mesh_cfg;
|
||||
struct mesh_plink_pool *plink_ctl = &minfo->plink_ctl;
|
||||
bool acnode = 0;
|
||||
|
||||
if (IS_CH_WAITING(rfctl) && !IS_UNDER_CAC(rfctl))
|
||||
goto exit;
|
||||
@@ -413,8 +666,16 @@ void rtw_chk_candidate_peer_notify(_adapter *adapter, struct wlan_network *scann
|
||||
if (plink_ctl->num >= RTW_MESH_MAX_PEER_CANDIDATES)
|
||||
goto exit;
|
||||
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
if (plink_ctl->acnode_rsvd) {
|
||||
acnode = rtw_mesh_scanned_is_acnode_confirmed(adapter, scanned);
|
||||
if (acnode && !rtw_mesh_scanned_is_acnode_allow_notify(adapter, scanned))
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* wpa_supplicant's auto peer will initiate peering when candidate peer is reported without max_peer_links consideration */
|
||||
if (plink_ctl->num >= mcfg->max_peer_links)
|
||||
if (plink_ctl->num >= mcfg->max_peer_links + acnode ? 1 : 0)
|
||||
goto exit;
|
||||
|
||||
if (rtw_get_passing_time_ms(scanned->last_scanned) >= mcfg->peer_sel_policy.scanr_exp_ms
|
||||
@@ -433,6 +694,14 @@ void rtw_chk_candidate_peer_notify(_adapter *adapter, struct wlan_network *scann
|
||||
)
|
||||
goto exit;
|
||||
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
if (acnode) {
|
||||
scanned->acnode_notify_etime = 0;
|
||||
RTW_INFO(FUNC_ADPT_FMT" acnode "MAC_FMT"\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(scanned->network.MacAddress));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_cfg80211_notify_new_peer_candidate(adapter->rtw_wdev
|
||||
, scanned->network.MacAddress
|
||||
@@ -461,7 +730,7 @@ void rtw_mesh_peer_status_chk(_adapter *adapter)
|
||||
u8 cto_mgate, forwarding, mgate;
|
||||
#endif
|
||||
u8 flush;
|
||||
char flush_list[NUM_STA];
|
||||
s8 flush_list[NUM_STA];
|
||||
u8 flush_num = 0;
|
||||
int i;
|
||||
|
||||
@@ -579,14 +848,19 @@ flush_add:
|
||||
|
||||
exit_critical_bh(&(plink_ctl->lock));
|
||||
|
||||
for (i = 0; i < flush_num; i++) {
|
||||
if (flush_num) {
|
||||
u8 sta_addr[ETH_ALEN];
|
||||
u8 updated = _FALSE;
|
||||
|
||||
sta = rtw_get_stainfo_by_offset(stapriv, flush_list[i]);
|
||||
_rtw_memcpy(sta_addr, sta->cmn.mac_addr, ETH_ALEN);
|
||||
for (i = 0; i < flush_num; i++) {
|
||||
sta = rtw_get_stainfo_by_offset(stapriv, flush_list[i]);
|
||||
_rtw_memcpy(sta_addr, sta->cmn.mac_addr, ETH_ALEN);
|
||||
|
||||
ap_free_sta(adapter, sta, _TRUE, WLAN_REASON_DEAUTH_LEAVING, _FALSE);
|
||||
rtw_mesh_expire_peer(adapter, sta_addr);
|
||||
updated |= ap_free_sta(adapter, sta, _TRUE, WLAN_REASON_DEAUTH_LEAVING, _FALSE);
|
||||
rtw_mesh_expire_peer(adapter, sta_addr);
|
||||
}
|
||||
|
||||
associated_clients_update(adapter, updated, STA_INFO_UPDATE_ALL);
|
||||
}
|
||||
|
||||
#if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST
|
||||
@@ -594,6 +868,10 @@ flush_add:
|
||||
rtw_mesh_cto_mgate_blacklist_chk(adapter);
|
||||
#endif
|
||||
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
rtw_mesh_acnode_rsvd_chk(adapter);
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -651,10 +929,12 @@ u8 rtw_mesh_offch_candidate_accepted(_adapter *adapter)
|
||||
{
|
||||
struct rtw_mesh_info *minfo = &adapter->mesh_info;
|
||||
struct mesh_plink_pool *plink_ctl = &minfo->plink_ctl;
|
||||
u8 ret;
|
||||
u8 ret = 0;
|
||||
|
||||
ret = MLME_IS_MESH(adapter)
|
||||
&& check_fwstate(&adapter->mlmepriv, WIFI_ASOC_STATE) == _TRUE
|
||||
if (!adapter->mesh_cfg.peer_sel_policy.offch_cand)
|
||||
goto exit;
|
||||
|
||||
ret = MLME_IS_MESH(adapter) && MLME_IS_ASOC(adapter)
|
||||
&& (!plink_ctl->num || rtw_mesh_offch_cto_mgate_required(adapter))
|
||||
;
|
||||
|
||||
@@ -663,12 +943,12 @@ u8 rtw_mesh_offch_candidate_accepted(_adapter *adapter)
|
||||
struct mi_state mstate_no_self;
|
||||
|
||||
rtw_mi_status_no_self(adapter, &mstate_no_self);
|
||||
if (MSTATE_STA_LD_NUM(&mstate_no_self) || MSTATE_AP_LD_NUM(&mstate_no_self)
|
||||
|| MSTATE_ADHOC_LD_NUM(&mstate_no_self) || MSTATE_MESH_LD_NUM(&mstate_no_self))
|
||||
if (MSTATE_STA_LD_NUM(&mstate_no_self))
|
||||
ret = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -686,12 +966,15 @@ u8 rtw_mesh_select_operating_ch(_adapter *adapter)
|
||||
_irqL irqL;
|
||||
struct wlan_network *scanned = NULL;
|
||||
int i;
|
||||
/* statistics for candidate accept peering */
|
||||
u8 cand_ap_cnt[MAX_CHANNEL_NUM] = {0};
|
||||
u8 max_cand_ap_ch = 0;
|
||||
u8 max_cand_ap_cnt = 0;
|
||||
/* statistics for candidate including not accept peering */
|
||||
u8 cand_cnt[MAX_CHANNEL_NUM] = {0};
|
||||
u8 max_cand_ch = 0;
|
||||
u8 max_cand_cnt = 0;
|
||||
|
||||
for (i = 0; i < rfctl->max_chan_nums; i++)
|
||||
rfctl->channel_set[i].mesh_candidate_cnt = 0;
|
||||
|
||||
_enter_critical_bh(&(mlme->scanned_queue.lock), &irqL);
|
||||
|
||||
head = get_list_head(queue);
|
||||
@@ -705,7 +988,7 @@ u8 rtw_mesh_select_operating_ch(_adapter *adapter)
|
||||
#if CONFIG_RTW_MACADDR_ACL
|
||||
&& rtw_access_ctrl(adapter, scanned->network.MacAddress) == _TRUE
|
||||
#endif
|
||||
&& rtw_bss_is_candidate_mesh_peer(&mlme->cur_network.network, &scanned->network, 0, 1)
|
||||
&& rtw_bss_is_candidate_mesh_peer(&mlme->cur_network.network, &scanned->network, 0, 0)
|
||||
#if CONFIG_RTW_MESH_PEER_BLACKLIST
|
||||
&& !rtw_mesh_peer_blacklist_search(adapter, scanned->network.MacAddress)
|
||||
#endif
|
||||
@@ -718,18 +1001,38 @@ u8 rtw_mesh_select_operating_ch(_adapter *adapter)
|
||||
if (ch_set_idx >= 0
|
||||
&& !CH_IS_NON_OCP(&rfctl->channel_set[ch_set_idx])
|
||||
) {
|
||||
rfctl->channel_set[ch_set_idx].mesh_candidate_cnt++;
|
||||
if (max_cand_cnt < rfctl->channel_set[ch_set_idx].mesh_candidate_cnt) {
|
||||
max_cand_cnt = rfctl->channel_set[ch_set_idx].mesh_candidate_cnt;
|
||||
u8 nop, accept;
|
||||
|
||||
rtw_mesh_bss_peering_status(&scanned->network, &nop, &accept);
|
||||
cand_cnt[ch_set_idx]++;
|
||||
if (max_cand_cnt < cand_cnt[ch_set_idx]) {
|
||||
max_cand_cnt = cand_cnt[ch_set_idx];
|
||||
max_cand_ch = rfctl->channel_set[ch_set_idx].ChannelNum;
|
||||
}
|
||||
if (accept) {
|
||||
cand_ap_cnt[ch_set_idx]++;
|
||||
if (max_cand_ap_cnt < cand_ap_cnt[ch_set_idx]) {
|
||||
max_cand_ap_cnt = cand_ap_cnt[ch_set_idx];
|
||||
max_cand_ap_ch = rfctl->channel_set[ch_set_idx].ChannelNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(mlme->scanned_queue.lock), &irqL);
|
||||
|
||||
return max_cand_ch;
|
||||
return max_cand_ap_ch ? max_cand_ap_ch : max_cand_ch;
|
||||
}
|
||||
|
||||
void dump_mesh_offch_cand_settings(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct mesh_peer_sel_policy *peer_sel_policy = &adapter->mesh_cfg.peer_sel_policy;
|
||||
|
||||
RTW_PRINT_SEL(sel, "%-6s %-11s\n"
|
||||
, "enable", "find_int_ms");
|
||||
RTW_PRINT_SEL(sel, "%6u %11u\n"
|
||||
, peer_sel_policy->offch_cand, peer_sel_policy->offch_find_int_ms);
|
||||
}
|
||||
#endif /* CONFIG_RTW_MESH_OFFCH_CAND */
|
||||
|
||||
@@ -737,36 +1040,24 @@ void dump_mesh_peer_sel_policy(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct mesh_peer_sel_policy *peer_sel_policy = &adapter->mesh_cfg.peer_sel_policy;
|
||||
|
||||
#if CONFIG_RTW_MESH_OFFCH_CAND
|
||||
#define OFFCH_CAND_TITLE_FMT " %-17s"
|
||||
#define OFFCH_CAND_VALUE_FMT " %17u"
|
||||
#define OFFCH_CAND_TITLE_ARG , "offch_find_int_ms"
|
||||
#define OFFCH_CAND_VALUE_ARG , peer_sel_policy->offch_find_int_ms
|
||||
#else
|
||||
#define OFFCH_CAND_TITLE_FMT ""
|
||||
#define OFFCH_CAND_VALUE_FMT ""
|
||||
#define OFFCH_CAND_TITLE_ARG
|
||||
#define OFFCH_CAND_VALUE_ARG
|
||||
#endif
|
||||
|
||||
RTW_PRINT_SEL(sel,
|
||||
"%-12s"
|
||||
OFFCH_CAND_TITLE_FMT
|
||||
"\n"
|
||||
, "scanr_exp_ms"
|
||||
OFFCH_CAND_TITLE_ARG
|
||||
);
|
||||
RTW_PRINT_SEL(sel,
|
||||
"%12u"
|
||||
OFFCH_CAND_VALUE_FMT
|
||||
"\n"
|
||||
, peer_sel_policy->scanr_exp_ms
|
||||
OFFCH_CAND_VALUE_ARG
|
||||
);
|
||||
RTW_PRINT_SEL(sel, "%-12s\n", "scanr_exp_ms");
|
||||
RTW_PRINT_SEL(sel, "%12u\n", peer_sel_policy->scanr_exp_ms);
|
||||
}
|
||||
|
||||
void dump_mesh_networks(void *sel, _adapter *adapter)
|
||||
{
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
#define NSTATE_TITLE_FMT_ACN " %-5s"
|
||||
#define NSTATE_VALUE_FMT_ACN " %5d"
|
||||
#define NSTATE_TITLE_ARG_ACN , "acn"
|
||||
#define NSTATE_VALUE_ARG_ACN , (acn_ms < 99999 ? acn_ms : 99999)
|
||||
#else
|
||||
#define NSTATE_TITLE_FMT_ACN ""
|
||||
#define NSTATE_VALUE_FMT_ACN ""
|
||||
#define NSTATE_TITLE_ARG_ACN
|
||||
#define NSTATE_VALUE_ARG_ACN
|
||||
#endif
|
||||
|
||||
struct mlme_priv *mlme = &(adapter->mlmepriv);
|
||||
_queue *queue = &(mlme->scanned_queue);
|
||||
struct wlan_network *network;
|
||||
@@ -777,13 +1068,16 @@ void dump_mesh_networks(void *sel, _adapter *adapter)
|
||||
u8 blocked;
|
||||
u8 established;
|
||||
s32 age_ms;
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
s32 acn_ms;
|
||||
#endif
|
||||
u8 *mesh_conf_ie;
|
||||
sint mesh_conf_ie_len;
|
||||
struct wlan_network **mesh_networks;
|
||||
u8 mesh_network_cnt = 0;
|
||||
int i;
|
||||
|
||||
mesh_networks = rtw_zvmalloc(MAX_BSS_CNT * sizeof(struct wlan_network *));
|
||||
mesh_networks = rtw_zvmalloc(mlme->max_bss_cnt * sizeof(struct wlan_network *));
|
||||
if (!mesh_networks)
|
||||
return;
|
||||
|
||||
@@ -808,9 +1102,12 @@ void dump_mesh_networks(void *sel, _adapter *adapter)
|
||||
|
||||
exit_critical_bh(&queue->lock);
|
||||
|
||||
RTW_PRINT_SEL(sel, " %-17s %-3s %-4s %-5s %-32s %-3s %-3s %-3s\n"
|
||||
, "bssid", "ch", "rssi", "age", "mesh_id", "nop", "fwd", "cto");
|
||||
|
||||
RTW_PRINT_SEL(sel, " %-17s %-3s %-4s %-5s %-32s %-3s %-3s %-3s"
|
||||
NSTATE_TITLE_FMT_ACN
|
||||
"\n"
|
||||
, "bssid", "ch", "rssi", "age", "mesh_id", "nop", "fwd", "cto"
|
||||
NSTATE_TITLE_ARG_ACN
|
||||
);
|
||||
|
||||
for (i = 0; i < mesh_network_cnt; i++) {
|
||||
network = mesh_networks[i];
|
||||
@@ -824,6 +1121,12 @@ void dump_mesh_networks(void *sel, _adapter *adapter)
|
||||
continue;
|
||||
|
||||
age_ms = rtw_get_passing_time_ms(network->last_scanned);
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
if (network->acnode_stime == 0)
|
||||
acn_ms = 0;
|
||||
else
|
||||
acn_ms = rtw_get_passing_time_ms(network->acnode_stime);
|
||||
#endif
|
||||
same_mbss = 0;
|
||||
candidate = 0;
|
||||
plink = NULL;
|
||||
@@ -844,7 +1147,9 @@ void dump_mesh_networks(void *sel, _adapter *adapter)
|
||||
same_mbss = 1;
|
||||
}
|
||||
|
||||
RTW_PRINT_SEL(sel, "%c "MAC_FMT" %3d %4ld %5d %-32s %c%2u %3u %c%c \n"
|
||||
RTW_PRINT_SEL(sel, "%c "MAC_FMT" %3d %4ld %5d %-32s %c%2u %3u %c%c "
|
||||
NSTATE_VALUE_FMT_ACN
|
||||
"\n"
|
||||
, established ? 'E' : (blocked ? 'B' : (plink ? 'N' : (candidate ? 'C' : (same_mbss ? 'S' : ' '))))
|
||||
, MAC_ARG(network->network.MacAddress)
|
||||
, network->network.Configuration.DSConfig
|
||||
@@ -856,10 +1161,22 @@ void dump_mesh_networks(void *sel, _adapter *adapter)
|
||||
, GET_MESH_CONF_ELE_FORWARDING(mesh_conf_ie + 2)
|
||||
, GET_MESH_CONF_ELE_CTO_MGATE(mesh_conf_ie + 2) ? 'G' : ' '
|
||||
, GET_MESH_CONF_ELE_CTO_AS(mesh_conf_ie + 2) ? 'A' : ' '
|
||||
NSTATE_VALUE_ARG_ACN
|
||||
);
|
||||
}
|
||||
|
||||
rtw_vmfree(mesh_networks, MAX_BSS_CNT * sizeof(struct wlan_network *));
|
||||
rtw_vmfree(mesh_networks, mlme->max_bss_cnt * sizeof(struct wlan_network *));
|
||||
}
|
||||
|
||||
void rtw_mesh_adjust_chbw(u8 req_ch, u8 *req_bw, u8 *req_offset)
|
||||
{
|
||||
if (req_ch >= 5 && req_ch <= 9) {
|
||||
/* prevent secondary channel offset mismatch */
|
||||
if (*req_bw > CHANNEL_WIDTH_20) {
|
||||
*req_bw = CHANNEL_WIDTH_20;
|
||||
*req_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int rtw_sae_check_frames(_adapter *adapter, const u8 *buf, u32 len, u8 tx)
|
||||
@@ -1133,37 +1450,37 @@ struct mpm_frame_info {
|
||||
};
|
||||
|
||||
/*
|
||||
* pid:0x0000 llid:0x0000 chosen_pmk:0x00000000000000000000000000000000
|
||||
* aid:0x0000 pid:0x0000 llid:0x0000 plid:0x0000 chosen_pmk:0x00000000000000000000000000000000
|
||||
* pid:0x0000 llid:0x0000 plid:0x0000 reason:0x0000 chosen_pmk:0x00000000000000000000000000000000
|
||||
* pid:00000 llid:00000 chosen_pmk:0x00000000000000000000000000000000
|
||||
* aid:00000 pid:00000 llid:00000 plid:00000 chosen_pmk:0x00000000000000000000000000000000
|
||||
* pid:00000 llid:00000 plid:00000 reason:00000 chosen_pmk:0x00000000000000000000000000000000
|
||||
*/
|
||||
#define MPM_LOG_BUF_LEN 96 /* this length is limited for legal combination */
|
||||
#define MPM_LOG_BUF_LEN 92 /* this length is limited for legal combination */
|
||||
static void rtw_mpm_info_msg(struct mpm_frame_info *mpm_info, u8 *mpm_log_buf)
|
||||
{
|
||||
int cnt = 0;
|
||||
|
||||
if (mpm_info->aid) {
|
||||
cnt += snprintf(mpm_log_buf + cnt, MPM_LOG_BUF_LEN - cnt - 1, "aid:0x%04x ", mpm_info->aid_v);
|
||||
cnt += snprintf(mpm_log_buf + cnt, MPM_LOG_BUF_LEN - cnt - 1, "aid:%u ", mpm_info->aid_v);
|
||||
if (cnt >= MPM_LOG_BUF_LEN - 1)
|
||||
goto exit;
|
||||
}
|
||||
if (mpm_info->pid) {
|
||||
cnt += snprintf(mpm_log_buf + cnt, MPM_LOG_BUF_LEN - cnt - 1, "pid:0x%04x ", mpm_info->pid_v);
|
||||
cnt += snprintf(mpm_log_buf + cnt, MPM_LOG_BUF_LEN - cnt - 1, "pid:%u ", mpm_info->pid_v);
|
||||
if (cnt >= MPM_LOG_BUF_LEN - 1)
|
||||
goto exit;
|
||||
}
|
||||
if (mpm_info->llid) {
|
||||
cnt += snprintf(mpm_log_buf + cnt, MPM_LOG_BUF_LEN - cnt - 1, "llid:0x%04x ", mpm_info->llid_v);
|
||||
cnt += snprintf(mpm_log_buf + cnt, MPM_LOG_BUF_LEN - cnt - 1, "llid:%u ", mpm_info->llid_v);
|
||||
if (cnt >= MPM_LOG_BUF_LEN - 1)
|
||||
goto exit;
|
||||
}
|
||||
if (mpm_info->plid) {
|
||||
cnt += snprintf(mpm_log_buf + cnt, MPM_LOG_BUF_LEN - cnt - 1, "plid:0x%04x ", mpm_info->plid_v);
|
||||
cnt += snprintf(mpm_log_buf + cnt, MPM_LOG_BUF_LEN - cnt - 1, "plid:%u ", mpm_info->plid_v);
|
||||
if (cnt >= MPM_LOG_BUF_LEN - 1)
|
||||
goto exit;
|
||||
}
|
||||
if (mpm_info->reason) {
|
||||
cnt += snprintf(mpm_log_buf + cnt, MPM_LOG_BUF_LEN - cnt - 1, "reason:0x%04x ", mpm_info->reason_v);
|
||||
cnt += snprintf(mpm_log_buf + cnt, MPM_LOG_BUF_LEN - cnt - 1, "reason:%u ", mpm_info->reason_v);
|
||||
if (cnt >= MPM_LOG_BUF_LEN - 1)
|
||||
goto exit;
|
||||
}
|
||||
@@ -1345,6 +1662,40 @@ bypass_sync_bss:
|
||||
rtw_mesh_plink_set_peer_conf_timeout(adapter, peer_addr);
|
||||
|
||||
} else
|
||||
#endif
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
if (action == RTW_ACT_SELF_PROTECTED_MESH_CLOSE) {
|
||||
if (tx && mpm_info.reason && mpm_info.reason_v == WLAN_REASON_MESH_MAX_PEERS) {
|
||||
if (rtw_mesh_scanned_is_acnode_confirmed(adapter, plink->scanned)
|
||||
&& rtw_mesh_acnode_prevent_allow_sacrifice(adapter)
|
||||
) {
|
||||
struct sta_info *sac = rtw_mesh_acnode_prevent_pick_sacrifice(adapter);
|
||||
|
||||
if (sac) {
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
_irqL irqL;
|
||||
u8 sta_addr[ETH_ALEN];
|
||||
u8 updated = _FALSE;
|
||||
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
if (!rtw_is_list_empty(&sac->asoc_list)) {
|
||||
rtw_list_delete(&sac->asoc_list);
|
||||
stapriv->asoc_list_cnt--;
|
||||
STA_SET_MESH_PLINK(sac, NULL);
|
||||
}
|
||||
_exit_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
RTW_INFO(FUNC_ADPT_FMT" sacrifice "MAC_FMT" for acnode\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(sac->cmn.mac_addr));
|
||||
|
||||
_rtw_memcpy(sta_addr, sac->cmn.mac_addr, ETH_ALEN);
|
||||
updated = ap_free_sta(adapter, sac, 0, 0, 1);
|
||||
rtw_mesh_expire_peer(stapriv->padapter, sta_addr);
|
||||
|
||||
associated_clients_update(adapter, updated, STA_INFO_UPDATE_ALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (action == RTW_ACT_SELF_PROTECTED_MESH_CONF) {
|
||||
_irqL irqL;
|
||||
@@ -1475,6 +1826,31 @@ int rtw_mesh_check_frames_rx(_adapter *adapter, const u8 *buf, size_t len)
|
||||
return rtw_mesh_check_frames(adapter, &buf, &len, _FALSE);
|
||||
}
|
||||
|
||||
int rtw_mesh_on_auth(_adapter *adapter, union recv_frame *rframe)
|
||||
{
|
||||
u8 *whdr = rframe->u.hdr.rx_data;
|
||||
|
||||
#if CONFIG_RTW_MACADDR_ACL
|
||||
if (rtw_access_ctrl(adapter, get_addr2_ptr(whdr)) == _FALSE)
|
||||
return _SUCCESS;
|
||||
#endif
|
||||
|
||||
if (!rtw_mesh_plink_get(adapter, get_addr2_ptr(whdr))) {
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
rtw_mesh_acnode_set_notify_etime(adapter, whdr);
|
||||
#endif
|
||||
|
||||
if (adapter_to_rfctl(adapter)->offch_state == OFFCHS_NONE)
|
||||
issue_probereq(adapter, &adapter->mlmepriv.cur_network.network.mesh_id, get_addr2_ptr(whdr));
|
||||
|
||||
/* only peer being added (checked by notify conditions) is allowed */
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
rtw_cfg80211_rx_mframe(adapter, rframe, NULL);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
unsigned int on_action_self_protected(_adapter *adapter, union recv_frame *rframe)
|
||||
{
|
||||
unsigned int ret = _FAIL;
|
||||
@@ -1578,6 +1954,10 @@ bool rtw_mesh_update_bss_peering_status(_adapter *adapter, WLAN_BSSID_EX *bss)
|
||||
int ie_len;
|
||||
bool updated = 0;
|
||||
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
accept_peerings |= plink_ctl->acnode_rsvd;
|
||||
#endif
|
||||
|
||||
ie = rtw_get_ie(BSS_EX_TLV_IES(bss), WLAN_EID_MESH_CONFIG, &ie_len, BSS_EX_TLV_IES_LEN(bss));
|
||||
if (!ie || ie_len != 7) {
|
||||
rtw_warn_on(1);
|
||||
@@ -1945,6 +2325,9 @@ void dump_mesh_plink_ctl(void *sel, _adapter *adapter)
|
||||
int i;
|
||||
|
||||
RTW_PRINT_SEL(sel, "num:%u\n", plink_ctl->num);
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
RTW_PRINT_SEL(sel, "acnode_rsvd:%u\n", plink_ctl->acnode_rsvd);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < RTW_MESH_MAX_PEER_CANDIDATES; i++) {
|
||||
ent = &plink_ctl->ent[i];
|
||||
@@ -2076,6 +2459,10 @@ int rtw_mesh_peer_establish(_adapter *adapter, struct mesh_plink_ent *plink, str
|
||||
goto exit;
|
||||
|
||||
rtw_ap_parse_sta_wmm_ie(adapter, sta, tlv_ies, tlv_ieslen);
|
||||
#ifdef CONFIG_RTS_FULL_BW
|
||||
/*check vendor IE*/
|
||||
rtw_parse_sta_vendor_ie_8812(adapter, sta, tlv_ies, tlv_ieslen);
|
||||
#endif/*CONFIG_RTS_FULL_BW*/
|
||||
|
||||
rtw_ap_parse_sta_ht_ie(adapter, sta, &elems);
|
||||
rtw_ap_parse_sta_vht_ie(adapter, sta, &elems);
|
||||
@@ -2103,7 +2490,8 @@ int rtw_mesh_peer_establish(_adapter *adapter, struct mesh_plink_ent *plink, str
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
if (rtw_is_list_empty(&sta->asoc_list)) {
|
||||
STA_SET_MESH_PLINK(sta, plink);
|
||||
sta->expire_to = mcfg->plink_timeout / 2;
|
||||
/* TBD: up layer timeout mechanism */
|
||||
/* sta->expire_to = mcfg->plink_timeout / 2; */
|
||||
rtw_list_insert_tail(&sta->asoc_list, &stapriv->asoc_list);
|
||||
stapriv->asoc_list_cnt++;
|
||||
}
|
||||
@@ -2587,13 +2975,58 @@ static int rtw_mesh_decache(_adapter *adapter, const u8 *msa, u32 seq)
|
||||
return rtw_mrc_check(adapter, msa, seq);
|
||||
}
|
||||
|
||||
#ifndef RTW_MESH_SCAN_RESULT_EXP_MS
|
||||
#define RTW_MESH_SCAN_RESULT_EXP_MS (10 * 1000)
|
||||
#endif
|
||||
|
||||
#ifndef RTW_MESH_ACNODE_PREVENT
|
||||
#define RTW_MESH_ACNODE_PREVENT 0
|
||||
#endif
|
||||
#ifndef RTW_MESH_ACNODE_CONF_TIMEOUT_MS
|
||||
#define RTW_MESH_ACNODE_CONF_TIMEOUT_MS (20 * 1000)
|
||||
#endif
|
||||
#ifndef RTW_MESH_ACNODE_NOTIFY_TIMEOUT_MS
|
||||
#define RTW_MESH_ACNODE_NOTIFY_TIMEOUT_MS (2 * 1000)
|
||||
#endif
|
||||
|
||||
#ifndef RTW_MESH_OFFCH_CAND
|
||||
#define RTW_MESH_OFFCH_CAND 1
|
||||
#endif
|
||||
#ifndef RTW_MESH_OFFCH_CAND_FIND_INT_MS
|
||||
#define RTW_MESH_OFFCH_CAND_FIND_INT_MS (10 * 1000)
|
||||
#endif
|
||||
|
||||
#ifndef RTW_MESH_PEER_CONF_TIMEOUT_MS
|
||||
#define RTW_MESH_PEER_CONF_TIMEOUT_MS (20 * 1000)
|
||||
#endif
|
||||
#ifndef RTW_MESH_PEER_BLACKLIST_TIMEOUT_MS
|
||||
#define RTW_MESH_PEER_BLACKLIST_TIMEOUT_MS (20 * 1000)
|
||||
#endif
|
||||
|
||||
#ifndef RTW_MESH_CTO_MGATE_REQUIRE
|
||||
#define RTW_MESH_CTO_MGATE_REQUIRE 0
|
||||
#endif
|
||||
#ifndef RTW_MESH_CTO_MGATE_CONF_TIMEOUT_MS
|
||||
#define RTW_MESH_CTO_MGATE_CONF_TIMEOUT_MS (20 * 1000)
|
||||
#endif
|
||||
#ifndef RTW_MESH_CTO_MGATE_BLACKLIST_TIMEOUT_MS
|
||||
#define RTW_MESH_CTO_MGATE_BLACKLIST_TIMEOUT_MS (20 * 1000)
|
||||
#endif
|
||||
|
||||
void rtw_mesh_cfg_init_peer_sel_policy(struct rtw_mesh_cfg *mcfg)
|
||||
{
|
||||
struct mesh_peer_sel_policy *sel_policy = &mcfg->peer_sel_policy;
|
||||
|
||||
sel_policy->scanr_exp_ms = RTW_MESH_SCAN_RESULT_EXP_MS;
|
||||
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
sel_policy->acnode_prevent = RTW_MESH_ACNODE_PREVENT;
|
||||
sel_policy->acnode_conf_timeout_ms = RTW_MESH_ACNODE_CONF_TIMEOUT_MS;
|
||||
sel_policy->acnode_notify_timeout_ms = RTW_MESH_ACNODE_NOTIFY_TIMEOUT_MS;
|
||||
#endif
|
||||
|
||||
#if CONFIG_RTW_MESH_OFFCH_CAND
|
||||
sel_policy->offch_cand = RTW_MESH_OFFCH_CAND;
|
||||
sel_policy->offch_find_int_ms = RTW_MESH_OFFCH_CAND_FIND_INT_MS;
|
||||
#endif
|
||||
|
||||
@@ -2603,7 +3036,7 @@ void rtw_mesh_cfg_init_peer_sel_policy(struct rtw_mesh_cfg *mcfg)
|
||||
#endif
|
||||
|
||||
#if CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST
|
||||
sel_policy->cto_mgate_require = 0;
|
||||
sel_policy->cto_mgate_require = RTW_MESH_CTO_MGATE_REQUIRE;
|
||||
sel_policy->cto_mgate_conf_timeout_ms = RTW_MESH_CTO_MGATE_CONF_TIMEOUT_MS;
|
||||
sel_policy->cto_mgate_blacklist_timeout_ms = RTW_MESH_CTO_MGATE_BLACKLIST_TIMEOUT_MS;
|
||||
#endif
|
||||
@@ -2635,6 +3068,10 @@ void rtw_mesh_cfg_init(_adapter *adapter)
|
||||
mcfg->dot11MeshHWMPconfirmationInterval = RTW_MESH_ROOT_CONFIRMATION_INTERVAL;
|
||||
mcfg->path_gate_timeout_factor = 3;
|
||||
rtw_mesh_cfg_init_peer_sel_policy(mcfg);
|
||||
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
|
||||
mcfg->sane_metric_delta = RTW_MESH_SANE_METRIC_DELTA;
|
||||
mcfg->max_root_add_chk_cnt = RTW_MESH_MAX_ROOT_ADD_CHK_CNT;
|
||||
#endif
|
||||
|
||||
#if CONFIG_RTW_MESH_DATA_BMC_TO_UC
|
||||
mcfg->b2u_flags_msrc = 0;
|
||||
@@ -3337,7 +3774,8 @@ endlookup:
|
||||
#define RTW_MESH_DECACHE_BMC 1
|
||||
#define RTW_MESH_DECACHE_UC 0
|
||||
|
||||
#define RTW_MESH_FORWARD_MDA_SELF_COND 1
|
||||
#define RTW_MESH_FORWARD_MDA_SELF_COND 0
|
||||
#define DBG_RTW_MESH_FORWARD_MDA_SELF_COND 0
|
||||
int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe
|
||||
, const u8 *mda, const u8 *msa
|
||||
, const u8 *da, const u8 *sa
|
||||
@@ -3457,57 +3895,90 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe
|
||||
} else {
|
||||
/* mDA is self */
|
||||
#if RTW_MESH_FORWARD_MDA_SELF_COND
|
||||
u8 is_da_self = da == mda || _rtw_memcmp(da, adapter_mac_addr(adapter), ETH_ALEN);
|
||||
|
||||
if (is_da_self) {
|
||||
if (da == mda
|
||||
|| _rtw_memcmp(da, adapter_mac_addr(adapter), ETH_ALEN)
|
||||
) {
|
||||
/* DA is self, indicate */
|
||||
act |= RTW_RX_MSDU_ACT_INDICATE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* DA is not self */
|
||||
if (rtw_mesh_nexthop_lookup(adapter, da, msa, fwd_ra) == _SUCCESS) {
|
||||
if (rtw_get_iface_by_macddr(adapter, da)) {
|
||||
/* DA is buddy, indicate */
|
||||
act |= RTW_RX_MSDU_ACT_INDICATE;
|
||||
#if DBG_RTW_MESH_FORWARD_MDA_SELF_COND
|
||||
RTW_INFO(FUNC_ADPT_FMT" DA("MAC_FMT") is buddy("ADPT_FMT")\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(da), ADPT_ARG(rtw_get_iface_by_macddr(adapter, da)));
|
||||
#endif
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* DA is not self or buddy */
|
||||
if (rtw_mesh_nexthop_lookup(adapter, da, msa, fwd_ra) == 0) {
|
||||
/* DA is known in fwd info */
|
||||
if (!mcfg->dot11MeshForwarding) {
|
||||
/* path error to? */
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
#if defined(DBG_RX_DROP_FRAME) || DBG_RTW_MESH_FORWARD_MDA_SELF_COND
|
||||
RTW_INFO("DBG_RX_DROP_FRAME "FUNC_ADPT_FMT" DA("MAC_FMT") not self, !dot11MeshForwarding\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(da));
|
||||
#endif
|
||||
goto exit;
|
||||
}
|
||||
mda = da;
|
||||
#if DBG_RTW_MESH_FORWARD_MDA_SELF_COND
|
||||
RTW_INFO(FUNC_ADPT_FMT" fwd to DA("MAC_FMT"), fwd_RA("MAC_FMT")\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(da), MAC_ARG(fwd_ra));
|
||||
#endif
|
||||
goto fwd_chk;
|
||||
}
|
||||
|
||||
rtw_rcu_read_lock();
|
||||
mppath = rtw_mpp_path_lookup(adapter, da);
|
||||
if (mppath && _rtw_memcmp(mppath->mpp, adapter_mac_addr(adapter), ETH_ALEN) == _FALSE) {
|
||||
/* DA is reached by the other gate */
|
||||
if (!mcfg->dot11MeshForwarding) {
|
||||
/* path error to? */
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
RTW_INFO("DBG_RX_DROP_FRAME "FUNC_ADPT_FMT" DA("MAC_FMT") is reached by proxy("MAC_FMT"), !dot11MeshForwarding\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(da), MAC_ARG(mppath->mpp));
|
||||
#endif
|
||||
if (mppath) {
|
||||
if (_rtw_memcmp(mppath->mpp, adapter_mac_addr(adapter), ETH_ALEN) == _FALSE) {
|
||||
/* DA is proxied by others */
|
||||
if (!mcfg->dot11MeshForwarding) {
|
||||
/* path error to? */
|
||||
#if defined(DBG_RX_DROP_FRAME) || DBG_RTW_MESH_FORWARD_MDA_SELF_COND
|
||||
RTW_INFO("DBG_RX_DROP_FRAME "FUNC_ADPT_FMT" DA("MAC_FMT") is proxied by ("MAC_FMT"), !dot11MeshForwarding\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(da), MAC_ARG(mppath->mpp));
|
||||
#endif
|
||||
rtw_rcu_read_unlock();
|
||||
goto exit;
|
||||
}
|
||||
_rtw_memcpy(fwd_mpp, mppath->mpp, ETH_ALEN);
|
||||
mda = fwd_mpp;
|
||||
msa = adapter_mac_addr(adapter);
|
||||
rtw_rcu_read_unlock();
|
||||
goto exit;
|
||||
}
|
||||
_rtw_memcpy(fwd_mpp, mppath->mpp, ETH_ALEN);
|
||||
mda = fwd_mpp;
|
||||
msa = adapter_mac_addr(adapter);
|
||||
rtw_rcu_read_unlock();
|
||||
|
||||
/* resolve RA */
|
||||
if (rtw_mesh_nexthop_lookup(adapter, mda, msa, fwd_ra) != _SUCCESS) {
|
||||
minfo->mshstats.dropped_frames_no_route++;
|
||||
goto exit;
|
||||
/* resolve RA */
|
||||
if (rtw_mesh_nexthop_lookup(adapter, mda, msa, fwd_ra) != 0) {
|
||||
minfo->mshstats.dropped_frames_no_route++;
|
||||
#if defined(DBG_RX_DROP_FRAME) || DBG_RTW_MESH_FORWARD_MDA_SELF_COND
|
||||
RTW_INFO("DBG_RX_DROP_FRAME "FUNC_ADPT_FMT" DA("MAC_FMT") is proxied by ("MAC_FMT"), RA resolve fail\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(da), MAC_ARG(mppath->mpp));
|
||||
#endif
|
||||
goto exit;
|
||||
}
|
||||
#if DBG_RTW_MESH_FORWARD_MDA_SELF_COND
|
||||
RTW_INFO(FUNC_ADPT_FMT" DA("MAC_FMT") is proxied by ("MAC_FMT"), fwd_RA("MAC_FMT")\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(da), MAC_ARG(mppath->mpp), MAC_ARG(fwd_ra));
|
||||
#endif
|
||||
goto fwd_chk; /* forward to other gate */
|
||||
} else {
|
||||
#if DBG_RTW_MESH_FORWARD_MDA_SELF_COND
|
||||
RTW_INFO(FUNC_ADPT_FMT" DA("MAC_FMT") is proxied by self\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(da));
|
||||
#endif
|
||||
}
|
||||
goto fwd_chk; /* forward to other gate */
|
||||
}
|
||||
}
|
||||
rtw_rcu_read_unlock();
|
||||
|
||||
if (!mppath) {
|
||||
#if DBG_RTW_MESH_FORWARD_MDA_SELF_COND
|
||||
RTW_INFO(FUNC_ADPT_FMT" DA("MAC_FMT") unknown\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(da));
|
||||
#endif
|
||||
/* DA is unknown */
|
||||
#if 0 /* TODO: flags with AE bit */
|
||||
rtw_mesh_path_error_tx(adapter
|
||||
@@ -3521,7 +3992,7 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe
|
||||
|
||||
/*
|
||||
* indicate to DS for both cases:
|
||||
* 1.) DA is reached by self
|
||||
* 1.) DA is proxied by self
|
||||
* 2.) DA is unknown
|
||||
*/
|
||||
#endif /* RTW_MESH_FORWARD_MDA_SELF_COND */
|
||||
|
||||
@@ -19,25 +19,22 @@
|
||||
#error "CONFIG_RTW_MESH can't be enabled when CONFIG_AP_MODE is not defined\n"
|
||||
#endif
|
||||
|
||||
#ifndef RTW_MESH_SCAN_RESULT_EXP_MS
|
||||
#define RTW_MESH_SCAN_RESULT_EXP_MS (10 * 1000)
|
||||
#endif
|
||||
#ifndef RTW_MESH_OFFCH_CAND_FIND_INT_MS
|
||||
#define RTW_MESH_OFFCH_CAND_FIND_INT_MS (10 * 1000)
|
||||
#endif
|
||||
#define RTW_MESH_TTL 31
|
||||
#define RTW_MESH_PERR_MIN_INT 100
|
||||
#define RTW_MESH_TTL 31
|
||||
#define RTW_MESH_PERR_MIN_INT 100
|
||||
#define RTW_MESH_DEFAULT_ELEMENT_TTL 31
|
||||
#define RTW_MESH_RANN_INTERVAL 5000
|
||||
#define RTW_MESH_RANN_INTERVAL 5000
|
||||
#define RTW_MESH_PATH_TO_ROOT_TIMEOUT 6000
|
||||
#define RTW_MESH_DIAM_TRAVERSAL_TIME 50
|
||||
#define RTW_MESH_PATH_TIMEOUT 5000
|
||||
#define RTW_MESH_PREQ_MIN_INT 10
|
||||
#define RTW_MESH_MAX_PREQ_RETRIES 4
|
||||
#define RTW_MESH_PATH_TIMEOUT 5000
|
||||
#define RTW_MESH_PREQ_MIN_INT 10
|
||||
#define RTW_MESH_MAX_PREQ_RETRIES 4
|
||||
#define RTW_MESH_MIN_DISCOVERY_TIMEOUT (2 * RTW_MESH_DIAM_TRAVERSAL_TIME)
|
||||
#define RTW_MESH_ROOT_CONFIRMATION_INTERVAL 2000
|
||||
#define RTW_MESH_PATH_REFRESH_TIME 1000
|
||||
#define RTW_MESH_ROOT_INTERVAL 5000
|
||||
#define RTW_MESH_ROOT_CONFIRMATION_INTERVAL 2000
|
||||
#define RTW_MESH_PATH_REFRESH_TIME 1000
|
||||
#define RTW_MESH_ROOT_INTERVAL 5000
|
||||
|
||||
#define RTW_MESH_SANE_METRIC_DELTA 100
|
||||
#define RTW_MESH_MAX_ROOT_ADD_CHK_CNT 2
|
||||
|
||||
#define RTW_MESH_PLINK_UNKNOWN 0
|
||||
#define RTW_MESH_PLINK_LISTEN 1
|
||||
@@ -105,8 +102,10 @@ extern const char *_rtw_mesh_ps_str[];
|
||||
/* Max number of paths */
|
||||
#define RTW_MESH_MAX_PATHS 1024
|
||||
|
||||
#define RTW_PREQ_Q_F_START 0x1
|
||||
#define RTW_PREQ_Q_F_START 0x1
|
||||
#define RTW_PREQ_Q_F_REFRESH 0x2
|
||||
#define RTW_PREQ_Q_F_CHK 0x4
|
||||
#define RTW_PREQ_Q_F_PEER_AKA 0x8
|
||||
struct rtw_mesh_preq_queue {
|
||||
_list list;
|
||||
u8 dst[ETH_ALEN];
|
||||
@@ -242,6 +241,10 @@ struct mesh_plink_pool {
|
||||
u8 num; /* current ent being used */
|
||||
struct mesh_plink_ent ent[RTW_MESH_MAX_PEER_CANDIDATES];
|
||||
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
u8 acnode_rsvd;
|
||||
#endif
|
||||
|
||||
#if CONFIG_RTW_MESH_PEER_BLACKLIST
|
||||
_queue peer_blacklist;
|
||||
#endif
|
||||
@@ -250,16 +253,18 @@ struct mesh_plink_pool {
|
||||
#endif
|
||||
};
|
||||
|
||||
#define RTW_MESH_PEER_CONF_TIMEOUT_MS (20 * 1000)
|
||||
#define RTW_MESH_PEER_BLACKLIST_TIMEOUT_MS (20 * 1000)
|
||||
#define RTW_MESH_CTO_MGATE_CONF_TIMEOUT_MS (20 * 1000)
|
||||
#define RTW_MESH_CTO_MGATE_BLACKLIST_TIMEOUT_MS (20 * 1000)
|
||||
|
||||
struct mesh_peer_sel_policy {
|
||||
u32 scanr_exp_ms;
|
||||
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
u8 acnode_prevent;
|
||||
u32 acnode_conf_timeout_ms;
|
||||
u32 acnode_notify_timeout_ms;
|
||||
#endif
|
||||
|
||||
#if CONFIG_RTW_MESH_OFFCH_CAND
|
||||
u32 offch_find_int_ms; /* 0 means no offch find by driver */
|
||||
u8 offch_cand;
|
||||
u32 offch_find_int_ms; /* 0 means no offch find triggerred by driver self*/
|
||||
#endif
|
||||
|
||||
#if CONFIG_RTW_MESH_PEER_BLACKLIST
|
||||
@@ -293,6 +298,11 @@ struct mesh_peer_sel_policy {
|
||||
|| ((flags & RTW_MESH_B2U_IP_MCAST) && (IP_MCAST_MAC(mda) || ICMPV6_MCAST_MAC(mda))) \
|
||||
)
|
||||
|
||||
/**
|
||||
* @sane_metric_delta: Controlling if trigger additional path check mechanism
|
||||
* @max_root_add_chk_cnt: The retry cnt to send additional root confirmation
|
||||
* PREQ through old(last) path
|
||||
*/
|
||||
struct rtw_mesh_cfg {
|
||||
u8 max_peer_links; /* peering limit */
|
||||
u32 plink_timeout; /* seconds */
|
||||
@@ -315,6 +325,10 @@ struct rtw_mesh_cfg {
|
||||
u32 dot11MeshHWMPactivePathToRootTimeout;
|
||||
u16 dot11MeshHWMProotInterval;
|
||||
u8 path_gate_timeout_factor;
|
||||
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
|
||||
u16 sane_metric_delta;
|
||||
u8 max_root_add_chk_cnt;
|
||||
#endif
|
||||
|
||||
struct mesh_peer_sel_policy peer_sel_policy;
|
||||
|
||||
@@ -370,6 +384,8 @@ struct rtw_mesh_info {
|
||||
int mpp_paths_generation;
|
||||
|
||||
int num_gates;
|
||||
struct rtw_mesh_path *max_addr_gate;
|
||||
bool max_addr_gate_is_larger_than_self;
|
||||
|
||||
struct rtw_mesh_stats mshstats;
|
||||
|
||||
@@ -401,9 +417,18 @@ void rtw_chk_candidate_peer_notify(_adapter *adapter, struct wlan_network *scann
|
||||
|
||||
void rtw_mesh_peer_status_chk(_adapter *adapter);
|
||||
|
||||
#if CONFIG_RTW_MESH_ACNODE_PREVENT
|
||||
void rtw_mesh_update_scanned_acnode_status(_adapter *adapter, struct wlan_network *scanned);
|
||||
bool rtw_mesh_scanned_is_acnode_confirmed(_adapter *adapter, struct wlan_network *scanned);
|
||||
bool rtw_mesh_acnode_prevent_allow_sacrifice(_adapter *adapter);
|
||||
struct sta_info *rtw_mesh_acnode_prevent_pick_sacrifice(_adapter *adapter);
|
||||
void dump_mesh_acnode_prevent_settings(void *sel, _adapter *adapter);
|
||||
#endif
|
||||
|
||||
#if CONFIG_RTW_MESH_OFFCH_CAND
|
||||
u8 rtw_mesh_offch_candidate_accepted(_adapter *adapter);
|
||||
u8 rtw_mesh_select_operating_ch(_adapter *adapter);
|
||||
void dump_mesh_offch_cand_settings(void *sel, _adapter *adapter);
|
||||
#endif
|
||||
|
||||
#if CONFIG_RTW_MESH_PEER_BLACKLIST
|
||||
@@ -427,10 +452,13 @@ void dump_mesh_cto_mgate_blacklist_settings(void *sel, _adapter *adapter);
|
||||
void dump_mesh_peer_sel_policy(void *sel, _adapter *adapter);
|
||||
void dump_mesh_networks(void *sel, _adapter *adapter);
|
||||
|
||||
void rtw_mesh_adjust_chbw(u8 req_ch, u8 *req_bw, u8 *req_offset);
|
||||
|
||||
int rtw_sae_check_frames(_adapter *adapter, const u8 *buf, u32 len, u8 tx);
|
||||
int rtw_mesh_check_frames_tx(_adapter *adapter, const u8 **buf, size_t *len);
|
||||
int rtw_mesh_check_frames_rx(_adapter *adapter, const u8 *buf, size_t len);
|
||||
|
||||
int rtw_mesh_on_auth(_adapter *adapter, union recv_frame *rframe);
|
||||
unsigned int on_action_self_protected(_adapter *adapter, union recv_frame *rframe);
|
||||
|
||||
bool rtw_mesh_update_bss_peering_status(_adapter *adapter, WLAN_BSSID_EX *bss);
|
||||
|
||||
BIN
core/mesh/rtw_mesh.o
Normal file
BIN
core/mesh/rtw_mesh.o
Normal file
Binary file not shown.
@@ -826,14 +826,16 @@ static void rtw_hwmp_prep_frame_process(_adapter *adapter,
|
||||
target_addr = RTW_PREP_IE_TARGET_ADDR(prep_elem);
|
||||
path = rtw_mesh_path_lookup(adapter, target_addr);
|
||||
if (path && path->gate_asked) {
|
||||
enter_critical_bh(&path->state_lock);
|
||||
path->gate_asked = false;
|
||||
exit_critical_bh(&path->state_lock);
|
||||
flags = RTW_PREP_IE_FLAGS(prep_elem);
|
||||
if ((flags & BIT(7)) && !(flags & RTW_IEEE80211_PREQ_IS_GATE_FLAG)) {
|
||||
if (flags & BIT(7)) {
|
||||
enter_critical_bh(&path->state_lock);
|
||||
rtw_mesh_gate_del(adapter->mesh_info.mesh_paths, path);
|
||||
path->gate_asked = false;
|
||||
exit_critical_bh(&path->state_lock);
|
||||
if (!(flags & RTW_IEEE80211_PREQ_IS_GATE_FLAG)) {
|
||||
enter_critical_bh(&path->state_lock);
|
||||
rtw_mesh_gate_del(adapter->mesh_info.mesh_paths, path);
|
||||
exit_critical_bh(&path->state_lock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1000,9 +1002,26 @@ static void rtw_hwmp_rann_frame_process(_adapter *adapter,
|
||||
rtw_root_path_confirmation_jiffies(adapter)) ||
|
||||
rtw_time_before(rtw_get_current_time(), path->last_preq_to_root))) &&
|
||||
!(path->flags & RTW_MESH_PATH_FIXED) && (ttl != 0)) {
|
||||
u8 preq_node_flag = RTW_PREQ_Q_F_START | RTW_PREQ_Q_F_REFRESH;
|
||||
|
||||
RTW_HWMP_DBG("time to refresh root path "MAC_FMT"\n",
|
||||
MAC_ARG(originator_addr));
|
||||
rtw_mesh_queue_preq(path, RTW_PREQ_Q_F_START | RTW_PREQ_Q_F_REFRESH);
|
||||
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
|
||||
if (RTW_SN_LT(path->sn, originator_sn) &&
|
||||
(path->rann_metric + mshcfg->sane_metric_delta < metric) &&
|
||||
_rtw_memcmp(bcast_addr, path->rann_snd_addr, ETH_ALEN) == _FALSE) {
|
||||
RTW_HWMP_DBG("Trigger additional check for root "
|
||||
"confirm PREQ. rann_snd_addr = "MAC_FMT
|
||||
"add_chk_rann_snd_addr= "MAC_FMT"\n",
|
||||
MAC_ARG(mgmt->addr2),
|
||||
MAC_ARG(path->rann_snd_addr));
|
||||
_rtw_memcpy(path->add_chk_rann_snd_addr,
|
||||
path->rann_snd_addr, ETH_ALEN);
|
||||
preq_node_flag |= RTW_PREQ_Q_F_CHK;
|
||||
|
||||
}
|
||||
#endif
|
||||
rtw_mesh_queue_preq(path, preq_node_flag);
|
||||
path->last_preq_to_root = rtw_get_current_time();
|
||||
}
|
||||
|
||||
@@ -1138,6 +1157,13 @@ static u32 rtw_hwmp_route_info_get(_adapter *adapter,
|
||||
path->exp_time = rtw_time_after(path->exp_time, exp_time)
|
||||
? path->exp_time : exp_time;
|
||||
rtw_mesh_path_activate(path);
|
||||
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
|
||||
if (path->is_root && (action == RTW_MPATH_PREP)) {
|
||||
_rtw_memcpy(path->rann_snd_addr,
|
||||
mgmt->addr2, ETH_ALEN);
|
||||
path->rann_metric = new_metric;
|
||||
}
|
||||
#endif
|
||||
exit_critical_bh(&path->state_lock);
|
||||
rtw_mesh_path_tx_pending(path);
|
||||
} else
|
||||
@@ -1184,6 +1210,15 @@ static u32 rtw_hwmp_route_info_get(_adapter *adapter,
|
||||
return process ? new_metric : 0;
|
||||
}
|
||||
|
||||
static void rtw_mesh_rx_hwmp_frame_cnts(_adapter *adapter, u8 *addr)
|
||||
{
|
||||
struct sta_info *sta;
|
||||
|
||||
sta = rtw_get_stainfo(&adapter->stapriv, addr);
|
||||
if (sta)
|
||||
sta->sta_stats.rx_hwmp_pkts++;
|
||||
}
|
||||
|
||||
void rtw_mesh_rx_path_sel_frame(_adapter *adapter, union recv_frame *rframe)
|
||||
{
|
||||
struct mesh_plink_ent *plink = NULL;
|
||||
@@ -1200,6 +1235,8 @@ void rtw_mesh_rx_path_sel_frame(_adapter *adapter, union recv_frame *rframe)
|
||||
if (!plink || plink->plink_state != RTW_MESH_PLINK_ESTAB)
|
||||
return;
|
||||
|
||||
rtw_mesh_rx_hwmp_frame_cnts(adapter, get_addr2_ptr(pframe));
|
||||
|
||||
/* Mesh action frame IE offset = 2 */
|
||||
attrib->hdrlen = sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
left = frame_len - attrib->hdrlen - attrib->iv_len - attrib->icv_len - 2;
|
||||
@@ -1276,6 +1313,12 @@ void rtw_mesh_queue_preq(struct rtw_mesh_path *path, u8 flags)
|
||||
preq_node->flags = flags;
|
||||
|
||||
path->flags |= RTW_MESH_PATH_REQ_QUEUED;
|
||||
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
|
||||
if (flags & RTW_PREQ_Q_F_CHK)
|
||||
path->flags |= RTW_MESH_PATH_ROOT_ADD_CHK;
|
||||
#endif
|
||||
if (flags & RTW_PREQ_Q_F_PEER_AKA)
|
||||
path->flags |= RTW_MESH_PATH_PEER_AKA;
|
||||
_rtw_spinunlock(&path->state_lock);
|
||||
|
||||
rtw_list_insert_tail(&preq_node->list, &minfo->preq_queue.list);
|
||||
@@ -1291,7 +1334,27 @@ void rtw_mesh_queue_preq(struct rtw_mesh_path *path, u8 flags)
|
||||
rtw_mesh_work(&adapter->mesh_work);
|
||||
} else
|
||||
rtw_mod_timer(&adapter->mesh_path_timer, minfo->last_preq +
|
||||
rtw_min_preq_int_jiff(adapter));
|
||||
rtw_min_preq_int_jiff(adapter) + 1);
|
||||
}
|
||||
|
||||
static const u8 *rtw_hwmp_preq_da(struct rtw_mesh_path *path,
|
||||
BOOLEAN is_root_add_chk, BOOLEAN da_is_peer)
|
||||
{
|
||||
const u8 *da;
|
||||
|
||||
if (da_is_peer)
|
||||
da = path->dst;
|
||||
else if (path->is_root)
|
||||
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
|
||||
da = is_root_add_chk ? path->add_chk_rann_snd_addr:
|
||||
path->rann_snd_addr;
|
||||
#else
|
||||
da = path->rann_snd_addr;
|
||||
#endif
|
||||
else
|
||||
da = bcast_addr;
|
||||
|
||||
return da;
|
||||
}
|
||||
|
||||
void rtw_mesh_path_start_discovery(_adapter *adapter)
|
||||
@@ -1304,6 +1367,8 @@ void rtw_mesh_path_start_discovery(_adapter *adapter)
|
||||
const u8 *da;
|
||||
u32 lifetime;
|
||||
u8 flags = 0;
|
||||
BOOLEAN is_root_add_chk = _FALSE;
|
||||
BOOLEAN da_is_peer;
|
||||
|
||||
enter_critical_bh(&minfo->mesh_preq_queue_lock);
|
||||
if (!minfo->preq_queue_len ||
|
||||
@@ -1368,8 +1433,14 @@ void rtw_mesh_path_start_discovery(_adapter *adapter)
|
||||
else
|
||||
target_flags &= ~RTW_IEEE80211_PREQ_TO_FLAG;
|
||||
|
||||
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
|
||||
is_root_add_chk = !!(path->flags & RTW_MESH_PATH_ROOT_ADD_CHK);
|
||||
#endif
|
||||
da_is_peer = !!(path->flags & RTW_MESH_PATH_PEER_AKA);
|
||||
exit_critical_bh(&path->state_lock);
|
||||
da = (path->is_root) ? path->rann_snd_addr : bcast_addr;
|
||||
|
||||
da = rtw_hwmp_preq_da(path, is_root_add_chk, da_is_peer);
|
||||
|
||||
#ifdef CONFIG_RTW_MESH_ON_DMD_GANN
|
||||
flags = (mshcfg->dot11MeshGateAnnouncementProtocol)
|
||||
? RTW_IEEE80211_PREQ_IS_GATE_FLAG : 0;
|
||||
@@ -1389,7 +1460,10 @@ void rtw_mesh_path_timer(void *ctx)
|
||||
struct rtw_mesh_path *path = (void *) ctx;
|
||||
_adapter *adapter = path->adapter;
|
||||
int ret;
|
||||
|
||||
u8 retry = 0;
|
||||
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
|
||||
struct rtw_mesh_cfg *mshcfg = &adapter->mesh_cfg;
|
||||
#endif
|
||||
/* TBD: Proctect for suspend */
|
||||
#if 0
|
||||
if (suspending)
|
||||
@@ -1398,18 +1472,30 @@ void rtw_mesh_path_timer(void *ctx)
|
||||
enter_critical_bh(&path->state_lock);
|
||||
if (path->flags & RTW_MESH_PATH_RESOLVED ||
|
||||
(!(path->flags & RTW_MESH_PATH_RESOLVING))) {
|
||||
path->flags &= ~(RTW_MESH_PATH_RESOLVING | RTW_MESH_PATH_RESOLVED);
|
||||
path->flags &= ~(RTW_MESH_PATH_RESOLVING |
|
||||
RTW_MESH_PATH_RESOLVED |
|
||||
RTW_MESH_PATH_ROOT_ADD_CHK |
|
||||
RTW_MESH_PATH_PEER_AKA);
|
||||
exit_critical_bh(&path->state_lock);
|
||||
} else if (path->discovery_retries < rtw_max_preq_retries(adapter)) {
|
||||
++path->discovery_retries;
|
||||
path->discovery_timeout *= 2;
|
||||
path->flags &= ~RTW_MESH_PATH_REQ_QUEUED;
|
||||
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
|
||||
if (path->discovery_retries > mshcfg->max_root_add_chk_cnt)
|
||||
path->flags &= ~RTW_MESH_PATH_ROOT_ADD_CHK;
|
||||
#endif
|
||||
if (path->gate_asked)
|
||||
retry |= RTW_PREQ_Q_F_REFRESH;
|
||||
|
||||
exit_critical_bh(&path->state_lock);
|
||||
rtw_mesh_queue_preq(path, 0);
|
||||
rtw_mesh_queue_preq(path, retry);
|
||||
} else {
|
||||
path->flags &= ~(RTW_MESH_PATH_RESOLVING |
|
||||
RTW_MESH_PATH_RESOLVED |
|
||||
RTW_MESH_PATH_REQ_QUEUED);
|
||||
RTW_MESH_PATH_REQ_QUEUED |
|
||||
RTW_MESH_PATH_ROOT_ADD_CHK |
|
||||
RTW_MESH_PATH_PEER_AKA);
|
||||
path->exp_time = rtw_get_current_time();
|
||||
exit_critical_bh(&path->state_lock);
|
||||
if (!path->is_gate && rtw_mesh_gate_num(adapter) > 0) {
|
||||
@@ -1515,10 +1601,19 @@ void rtw_mesh_work_hdl(_workitem *work)
|
||||
{
|
||||
_adapter *adapter = container_of(work, _adapter, mesh_work);
|
||||
|
||||
if (adapter->mesh_info.preq_queue_len &&
|
||||
rtw_time_after(rtw_get_current_time(),
|
||||
adapter->mesh_info.last_preq + rtw_ms_to_systime(adapter->mesh_cfg.dot11MeshHWMPpreqMinInterval)))
|
||||
rtw_mesh_path_start_discovery(adapter);
|
||||
while(adapter->mesh_info.preq_queue_len) {
|
||||
if (rtw_time_after(rtw_get_current_time(),
|
||||
adapter->mesh_info.last_preq + rtw_min_preq_int_jiff(adapter)))
|
||||
/* It will consume preq_queue_len */
|
||||
rtw_mesh_path_start_discovery(adapter);
|
||||
else {
|
||||
struct rtw_mesh_info *minfo = &adapter->mesh_info;
|
||||
|
||||
rtw_mod_timer(&adapter->mesh_path_timer,
|
||||
minfo->last_preq + rtw_min_preq_int_jiff(adapter) + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (rtw_test_and_clear_bit(RTW_MESH_WORK_ROOT, &adapter->wrkq_flags))
|
||||
rtw_ieee80211_mesh_rootpath(adapter);
|
||||
|
||||
BIN
core/mesh/rtw_mesh_hwmp.o
Normal file
BIN
core/mesh/rtw_mesh_hwmp.o
Normal file
Binary file not shown.
@@ -374,6 +374,15 @@ int rtw_mesh_path_add_gate(struct rtw_mesh_path *mpath)
|
||||
ori_num_gates = minfo->num_gates;
|
||||
minfo->num_gates++;
|
||||
rtw_hlist_add_head_rcu(&mpath->gate_list, &tbl->known_gates);
|
||||
|
||||
if (ori_num_gates == 0
|
||||
|| rtw_macaddr_is_larger(mpath->dst, minfo->max_addr_gate->dst)
|
||||
) {
|
||||
minfo->max_addr_gate = mpath;
|
||||
minfo->max_addr_gate_is_larger_than_self =
|
||||
rtw_macaddr_is_larger(mpath->dst, adapter_mac_addr(mpath->adapter));
|
||||
}
|
||||
|
||||
_rtw_spinunlock(&tbl->gates_lock);
|
||||
|
||||
exit_critical_bh(&mpath->state_lock);
|
||||
@@ -414,6 +423,23 @@ void rtw_mesh_gate_del(struct rtw_mesh_table *tbl, struct rtw_mesh_path *mpath)
|
||||
rtw_hlist_del_rcu(&mpath->gate_list);
|
||||
ori_num_gates = minfo->num_gates;
|
||||
minfo->num_gates--;
|
||||
|
||||
if (ori_num_gates == 1) {
|
||||
minfo->max_addr_gate = NULL;
|
||||
minfo->max_addr_gate_is_larger_than_self = 0;
|
||||
} else if (minfo->max_addr_gate == mpath) {
|
||||
struct rtw_mesh_path *gate, *max_addr_gate = NULL;
|
||||
rtw_hlist_node *node;
|
||||
|
||||
rtw_hlist_for_each_entry_rcu(gate, node, &tbl->known_gates, gate_list) {
|
||||
if (!max_addr_gate || rtw_macaddr_is_larger(gate->dst, max_addr_gate->dst))
|
||||
max_addr_gate = gate;
|
||||
}
|
||||
minfo->max_addr_gate = max_addr_gate;
|
||||
minfo->max_addr_gate_is_larger_than_self =
|
||||
rtw_macaddr_is_larger(max_addr_gate->dst, adapter_mac_addr(mpath->adapter));
|
||||
}
|
||||
|
||||
exit_critical_bh(&tbl->gates_lock);
|
||||
|
||||
if (ori_num_gates == 1)
|
||||
@@ -458,6 +484,45 @@ int rtw_mesh_gate_num(_adapter *adapter)
|
||||
return adapter->mesh_info.num_gates;
|
||||
}
|
||||
|
||||
bool rtw_mesh_is_primary_gate(_adapter *adapter)
|
||||
{
|
||||
struct rtw_mesh_cfg *mcfg = &adapter->mesh_cfg;
|
||||
struct rtw_mesh_info *minfo = &adapter->mesh_info;
|
||||
|
||||
return mcfg->dot11MeshGateAnnouncementProtocol
|
||||
&& !minfo->max_addr_gate_is_larger_than_self;
|
||||
}
|
||||
|
||||
void dump_known_gates(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct rtw_mesh_info *minfo = &adapter->mesh_info;
|
||||
struct rtw_mesh_table *tbl;
|
||||
struct rtw_mesh_path *gate;
|
||||
rtw_hlist_node *node;
|
||||
|
||||
if (!rtw_mesh_gate_num(adapter))
|
||||
goto exit;
|
||||
|
||||
rtw_rcu_read_lock();
|
||||
|
||||
tbl = minfo->mesh_paths;
|
||||
if (!tbl)
|
||||
goto unlock;
|
||||
|
||||
RTW_PRINT_SEL(sel, "num:%d\n", rtw_mesh_gate_num(adapter));
|
||||
|
||||
rtw_hlist_for_each_entry_rcu(gate, node, &tbl->known_gates, gate_list) {
|
||||
RTW_PRINT_SEL(sel, "%c"MAC_FMT"\n"
|
||||
, gate == minfo->max_addr_gate ? '*' : ' '
|
||||
, MAC_ARG(gate->dst));
|
||||
}
|
||||
|
||||
unlock:
|
||||
rtw_rcu_read_unlock();
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
static
|
||||
struct rtw_mesh_path *rtw_mesh_path_new(_adapter *adapter,
|
||||
const u8 *dst)
|
||||
@@ -574,6 +639,34 @@ int rtw_mpp_path_add(_adapter *adapter,
|
||||
return ret;
|
||||
}
|
||||
|
||||
void dump_mpp(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct rtw_mesh_path *mpath;
|
||||
int idx = 0;
|
||||
char dst[ETH_ALEN];
|
||||
char mpp[ETH_ALEN];
|
||||
|
||||
RTW_PRINT_SEL(sel, "%-17s %-17s\n", "dst", "mpp");
|
||||
|
||||
do {
|
||||
rtw_rcu_read_lock();
|
||||
|
||||
mpath = rtw_mpp_path_lookup_by_idx(adapter, idx);
|
||||
if (mpath) {
|
||||
_rtw_memcpy(dst, mpath->dst, ETH_ALEN);
|
||||
_rtw_memcpy(mpp, mpath->mpp, ETH_ALEN);
|
||||
}
|
||||
|
||||
rtw_rcu_read_unlock();
|
||||
|
||||
if (mpath) {
|
||||
RTW_PRINT_SEL(sel, MAC_FMT" "MAC_FMT"\n"
|
||||
, MAC_ARG(dst), MAC_ARG(mpp));
|
||||
}
|
||||
|
||||
idx++;
|
||||
} while (mpath);
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_mesh_plink_broken - deactivates paths and sends perr when a link breaks
|
||||
|
||||
@@ -38,7 +38,11 @@
|
||||
* already queued up, waiting for the discovery process to start.
|
||||
* @RTW_MESH_PATH_DELETED: the mesh path has been deleted and should no longer
|
||||
* be used
|
||||
*
|
||||
* @RTW_MESH_PATH_ROOT_ADD_CHK: root additional check in root mode.
|
||||
* With this flag, It will try the last used rann_snd_addr
|
||||
* @RTW_MESH_PATH_PEER_AKA: only used toward a peer, only used in active keep
|
||||
* alive mechanism. PREQ's da = path dst
|
||||
*
|
||||
* RTW_MESH_PATH_RESOLVED is used by the mesh path timer to
|
||||
* decide when to stop or cancel the mesh path discovery.
|
||||
*/
|
||||
@@ -50,6 +54,8 @@ enum rtw_mesh_path_flags {
|
||||
RTW_MESH_PATH_RESOLVED = BIT(4),
|
||||
RTW_MESH_PATH_REQ_QUEUED = BIT(5),
|
||||
RTW_MESH_PATH_DELETED = BIT(6),
|
||||
RTW_MESH_PATH_ROOT_ADD_CHK = BIT(7),
|
||||
RTW_MESH_PATH_PEER_AKA = BIT(8),
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -111,6 +117,9 @@ struct rtw_mesh_path {
|
||||
enum rtw_mesh_path_flags flags;
|
||||
_lock state_lock;
|
||||
u8 rann_snd_addr[ETH_ALEN];
|
||||
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
|
||||
u8 add_chk_rann_snd_addr[ETH_ALEN];
|
||||
#endif
|
||||
u32 rann_metric;
|
||||
unsigned long last_preq_to_root;
|
||||
bool is_root;
|
||||
@@ -153,6 +162,8 @@ struct rtw_mesh_path *rtw_mpp_path_lookup(_adapter *adapter,
|
||||
const u8 *dst);
|
||||
int rtw_mpp_path_add(_adapter *adapter,
|
||||
const u8 *dst, const u8 *mpp);
|
||||
void dump_mpp(void *sel, _adapter *adapter);
|
||||
|
||||
struct rtw_mesh_path *
|
||||
rtw_mesh_path_lookup_by_idx(_adapter *adapter, int idx);
|
||||
struct rtw_mesh_path *
|
||||
@@ -168,6 +179,8 @@ void rtw_mesh_gate_del(struct rtw_mesh_table *tbl, struct rtw_mesh_path *mpath);
|
||||
bool rtw_mesh_gate_search(struct rtw_mesh_table *tbl, const u8 *addr);
|
||||
int rtw_mesh_path_send_to_gates(struct rtw_mesh_path *mpath);
|
||||
int rtw_mesh_gate_num(_adapter *adapter);
|
||||
bool rtw_mesh_is_primary_gate(_adapter *adapter);
|
||||
void dump_known_gates(void *sel, _adapter *adapter);
|
||||
|
||||
void rtw_mesh_plink_broken(struct sta_info *sta);
|
||||
|
||||
|
||||
BIN
core/mesh/rtw_mesh_pathtbl.o
Normal file
BIN
core/mesh/rtw_mesh_pathtbl.o
Normal file
Binary file not shown.
1571
core/rtw_ap.c
1571
core/rtw_ap.c
File diff suppressed because it is too large
Load Diff
@@ -1071,7 +1071,7 @@ static u8 _bfer_set_entry_gid(PADAPTER adapter, u8 *addr, u8 *gid, u8 *position)
|
||||
struct beamformer_entry bfer;
|
||||
|
||||
memset(&bfer, 0, sizeof(bfer));
|
||||
memcpy(bfer.mac_addr, addr, 6);
|
||||
memcpy(bfer.mac_addr, addr, ETH_ALEN);
|
||||
|
||||
/* Parsing Membership Status Array */
|
||||
memcpy(bfer.gid_valid, gid, 8);
|
||||
@@ -3047,7 +3047,7 @@ void beamforming_wk_hdl(_adapter *padapter, u8 type, u8 *pbuf)
|
||||
struct sta_info *psta = (PVOID)pbuf;
|
||||
u16 staIdx = psta->cmn.mac_id;
|
||||
|
||||
beamforming_enter(pDM_Odm, staIdx);
|
||||
beamforming_enter(pDM_Odm, staIdx, adapter_mac_addr(psta->padapter));
|
||||
break;
|
||||
}
|
||||
case BEAMFORMING_CTRL_LEAVE:
|
||||
|
||||
@@ -301,7 +301,7 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef SUPPORT_RX_UNI2MCAST
|
||||
static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
|
||||
{
|
||||
struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN);
|
||||
@@ -319,6 +319,7 @@ static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
|
||||
#endif
|
||||
}
|
||||
#endif /* CL_IPV6_PASS */
|
||||
#endif /* SUPPORT_RX_UNI2MCAST */
|
||||
|
||||
|
||||
static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
||||
|
||||
@@ -437,7 +437,6 @@ u8 rtw_btcoex_LPS_Leave(PADAPTER padapter)
|
||||
|
||||
if (pwrpriv->pwr_mode != PS_MODE_ACTIVE) {
|
||||
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "BTCOEX");
|
||||
LPS_RF_ON_check(padapter, 100);
|
||||
pwrpriv->bpower_saving = _FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,11 @@ void rtw_btcoex_wifionly_scan_notify(PADAPTER padapter)
|
||||
hal_btcoex_wifionly_scan_notify(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_wifionly_connect_notify(PADAPTER padapter)
|
||||
{
|
||||
hal_btcoex_wifionly_connect_notify(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_wifionly_hw_config(PADAPTER padapter)
|
||||
{
|
||||
hal_btcoex_wifionly_hw_config(padapter);
|
||||
|
||||
1184
core/rtw_chplan.c
Normal file
1184
core/rtw_chplan.c
Normal file
File diff suppressed because it is too large
Load Diff
179
core/rtw_chplan.h
Normal file
179
core/rtw_chplan.h
Normal file
@@ -0,0 +1,179 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2018 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __RTW_CHPLAN_H__
|
||||
#define __RTW_CHPLAN_H__
|
||||
|
||||
enum rtw_chplan_id {
|
||||
/* ===== 0x00 ~ 0x1F, legacy channel plan ===== */
|
||||
RTW_CHPLAN_FCC = 0x00,
|
||||
RTW_CHPLAN_IC = 0x01,
|
||||
RTW_CHPLAN_ETSI = 0x02,
|
||||
RTW_CHPLAN_SPAIN = 0x03,
|
||||
RTW_CHPLAN_FRANCE = 0x04,
|
||||
RTW_CHPLAN_MKK = 0x05,
|
||||
RTW_CHPLAN_MKK1 = 0x06,
|
||||
RTW_CHPLAN_ISRAEL = 0x07,
|
||||
RTW_CHPLAN_TELEC = 0x08,
|
||||
RTW_CHPLAN_GLOBAL_DOAMIN = 0x09,
|
||||
RTW_CHPLAN_WORLD_WIDE_13 = 0x0A,
|
||||
RTW_CHPLAN_TAIWAN = 0x0B,
|
||||
RTW_CHPLAN_CHINA = 0x0C,
|
||||
RTW_CHPLAN_SINGAPORE_INDIA_MEXICO = 0x0D,
|
||||
RTW_CHPLAN_KOREA = 0x0E,
|
||||
RTW_CHPLAN_TURKEY = 0x0F,
|
||||
RTW_CHPLAN_JAPAN = 0x10,
|
||||
RTW_CHPLAN_FCC_NO_DFS = 0x11,
|
||||
RTW_CHPLAN_JAPAN_NO_DFS = 0x12,
|
||||
RTW_CHPLAN_WORLD_WIDE_5G = 0x13,
|
||||
RTW_CHPLAN_TAIWAN_NO_DFS = 0x14,
|
||||
|
||||
/* ===== 0x20 ~ 0x7F, new channel plan ===== */
|
||||
RTW_CHPLAN_WORLD_NULL = 0x20,
|
||||
RTW_CHPLAN_ETSI1_NULL = 0x21,
|
||||
RTW_CHPLAN_FCC1_NULL = 0x22,
|
||||
RTW_CHPLAN_MKK1_NULL = 0x23,
|
||||
RTW_CHPLAN_ETSI2_NULL = 0x24,
|
||||
RTW_CHPLAN_FCC1_FCC1 = 0x25,
|
||||
RTW_CHPLAN_WORLD_ETSI1 = 0x26,
|
||||
RTW_CHPLAN_MKK1_MKK1 = 0x27,
|
||||
RTW_CHPLAN_WORLD_KCC1 = 0x28,
|
||||
RTW_CHPLAN_WORLD_FCC2 = 0x29,
|
||||
RTW_CHPLAN_FCC2_NULL = 0x2A,
|
||||
RTW_CHPLAN_IC1_IC2 = 0x2B,
|
||||
RTW_CHPLAN_MKK2_NULL = 0x2C,
|
||||
RTW_CHPLAN_WORLD_CHILE1= 0x2D,
|
||||
RTW_CHPLAN_WORLD1_WORLD1 = 0x2E,
|
||||
RTW_CHPLAN_WORLD_CHILE2 = 0x2F,
|
||||
RTW_CHPLAN_WORLD_FCC3 = 0x30,
|
||||
RTW_CHPLAN_WORLD_FCC4 = 0x31,
|
||||
RTW_CHPLAN_WORLD_FCC5 = 0x32,
|
||||
RTW_CHPLAN_WORLD_FCC6 = 0x33,
|
||||
RTW_CHPLAN_FCC1_FCC7 = 0x34,
|
||||
RTW_CHPLAN_WORLD_ETSI2 = 0x35,
|
||||
RTW_CHPLAN_WORLD_ETSI3 = 0x36,
|
||||
RTW_CHPLAN_MKK1_MKK2 = 0x37,
|
||||
RTW_CHPLAN_MKK1_MKK3 = 0x38,
|
||||
RTW_CHPLAN_FCC1_NCC1 = 0x39,
|
||||
RTW_CHPLAN_ETSI1_ETSI1 = 0x3A,
|
||||
RTW_CHPLAN_ETSI1_ACMA1 = 0x3B,
|
||||
RTW_CHPLAN_ETSI1_ETSI6 = 0x3C,
|
||||
RTW_CHPLAN_ETSI1_ETSI12 = 0x3D,
|
||||
RTW_CHPLAN_KCC1_KCC2 = 0x3E,
|
||||
RTW_CHPLAN_FCC1_NCC2 = 0x40,
|
||||
RTW_CHPLAN_GLOBAL_NULL = 0x41,
|
||||
RTW_CHPLAN_ETSI1_ETSI4 = 0x42,
|
||||
RTW_CHPLAN_FCC1_FCC2 = 0x43,
|
||||
RTW_CHPLAN_FCC1_NCC3 = 0x44,
|
||||
RTW_CHPLAN_WORLD_ACMA1 = 0x45,
|
||||
RTW_CHPLAN_FCC1_FCC8 = 0x46,
|
||||
RTW_CHPLAN_WORLD_ETSI6 = 0x47,
|
||||
RTW_CHPLAN_WORLD_ETSI7 = 0x48,
|
||||
RTW_CHPLAN_WORLD_ETSI8 = 0x49,
|
||||
RTW_CHPLAN_WORLD_ETSI9 = 0x50,
|
||||
RTW_CHPLAN_WORLD_ETSI10 = 0x51,
|
||||
RTW_CHPLAN_WORLD_ETSI11 = 0x52,
|
||||
RTW_CHPLAN_FCC1_NCC4 = 0x53,
|
||||
RTW_CHPLAN_WORLD_ETSI12 = 0x54,
|
||||
RTW_CHPLAN_FCC1_FCC9 = 0x55,
|
||||
RTW_CHPLAN_WORLD_ETSI13 = 0x56,
|
||||
RTW_CHPLAN_FCC1_FCC10 = 0x57,
|
||||
RTW_CHPLAN_MKK2_MKK4 = 0x58,
|
||||
RTW_CHPLAN_WORLD_ETSI14 = 0x59,
|
||||
RTW_CHPLAN_FCC1_FCC5 = 0x60,
|
||||
RTW_CHPLAN_FCC2_FCC7 = 0x61,
|
||||
RTW_CHPLAN_FCC2_FCC1 = 0x62,
|
||||
RTW_CHPLAN_WORLD_ETSI15 = 0x63,
|
||||
RTW_CHPLAN_MKK2_MKK5 = 0x64,
|
||||
RTW_CHPLAN_ETSI1_ETSI16 = 0x65,
|
||||
RTW_CHPLAN_FCC1_FCC14 = 0x66,
|
||||
RTW_CHPLAN_FCC1_FCC12 = 0x67,
|
||||
RTW_CHPLAN_FCC2_FCC14 = 0x68,
|
||||
RTW_CHPLAN_FCC2_FCC12 = 0x69,
|
||||
RTW_CHPLAN_ETSI1_ETSI17 = 0x6A,
|
||||
RTW_CHPLAN_WORLD_FCC16 = 0x6B,
|
||||
RTW_CHPLAN_WORLD_FCC13 = 0x6C,
|
||||
RTW_CHPLAN_FCC2_FCC15 = 0x6D,
|
||||
RTW_CHPLAN_WORLD_FCC12 = 0x6E,
|
||||
RTW_CHPLAN_NULL_ETSI8 = 0x6F,
|
||||
RTW_CHPLAN_NULL_ETSI18 = 0x70,
|
||||
RTW_CHPLAN_NULL_ETSI17 = 0x71,
|
||||
RTW_CHPLAN_NULL_ETSI19 = 0x72,
|
||||
RTW_CHPLAN_WORLD_FCC7 = 0x73,
|
||||
RTW_CHPLAN_FCC2_FCC17 = 0x74,
|
||||
RTW_CHPLAN_WORLD_ETSI20 = 0x75,
|
||||
RTW_CHPLAN_FCC2_FCC11 = 0x76,
|
||||
RTW_CHPLAN_WORLD_ETSI21 = 0x77,
|
||||
RTW_CHPLAN_FCC1_FCC18 = 0x78,
|
||||
RTW_CHPLAN_MKK2_MKK1 = 0x79,
|
||||
|
||||
RTW_CHPLAN_MAX,
|
||||
RTW_CHPLAN_REALTEK_DEFINE = 0x7F,
|
||||
RTW_CHPLAN_UNSPECIFIED = 0xFF,
|
||||
};
|
||||
|
||||
u8 rtw_chplan_get_default_regd(u8 id);
|
||||
bool rtw_chplan_is_empty(u8 id);
|
||||
#define rtw_is_channel_plan_valid(chplan) (((chplan) < RTW_CHPLAN_MAX || (chplan) == RTW_CHPLAN_REALTEK_DEFINE) && !rtw_chplan_is_empty(chplan))
|
||||
#define rtw_is_legacy_channel_plan(chplan) ((chplan) < 0x20)
|
||||
|
||||
struct _RT_CHANNEL_INFO;
|
||||
u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, struct _RT_CHANNEL_INFO *channel_set);
|
||||
|
||||
#define IS_ALPHA2_NO_SPECIFIED(_alpha2) ((*((u16 *)(_alpha2))) == 0xFFFF)
|
||||
|
||||
#define RTW_MODULE_RTL8821AE_HMC_M2 BIT0 /* RTL8821AE(HMC + M.2) */
|
||||
#define RTW_MODULE_RTL8821AU BIT1 /* RTL8821AU */
|
||||
#define RTW_MODULE_RTL8812AENF_NGFF BIT2 /* RTL8812AENF(8812AE+8761)_NGFF */
|
||||
#define RTW_MODULE_RTL8812AEBT_HMC BIT3 /* RTL8812AEBT(8812AE+8761)_HMC */
|
||||
#define RTW_MODULE_RTL8188EE_HMC_M2 BIT4 /* RTL8188EE(HMC + M.2) */
|
||||
#define RTW_MODULE_RTL8723BE_HMC_M2 BIT5 /* RTL8723BE(HMC + M.2) */
|
||||
#define RTW_MODULE_RTL8723BS_NGFF1216 BIT6 /* RTL8723BS(NGFF1216) */
|
||||
#define RTW_MODULE_RTL8192EEBT_HMC_M2 BIT7 /* RTL8192EEBT(8192EE+8761AU)_(HMC + M.2) */
|
||||
#define RTW_MODULE_RTL8723DE_NGFF1630 BIT8 /* RTL8723DE(NGFF1630) */
|
||||
#define RTW_MODULE_RTL8822BE BIT9 /* RTL8822BE */
|
||||
#define RTW_MODULE_RTL8821CE BIT10 /* RTL8821CE */
|
||||
|
||||
struct country_chplan {
|
||||
char alpha2[2];
|
||||
u8 chplan;
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
u8 en_11ac;
|
||||
#endif
|
||||
#if RTW_DEF_MODULE_REGULATORY_CERT
|
||||
u16 def_module_flags; /* RTW_MODULE_RTLXXX */
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
#define COUNTRY_CHPLAN_EN_11AC(_ent) ((_ent)->en_11ac)
|
||||
#else
|
||||
#define COUNTRY_CHPLAN_EN_11AC(_ent) 0
|
||||
#endif
|
||||
|
||||
#if RTW_DEF_MODULE_REGULATORY_CERT
|
||||
#define COUNTRY_CHPLAN_DEF_MODULE_FALGS(_ent) ((_ent)->def_module_flags)
|
||||
#else
|
||||
#define COUNTRY_CHPLAN_DEF_MODULE_FALGS(_ent) 0
|
||||
#endif
|
||||
|
||||
const struct country_chplan *rtw_get_chplan_from_country(const char *country_code);
|
||||
|
||||
void dump_country_chplan(void *sel, const struct country_chplan *ent);
|
||||
void dump_country_chplan_map(void *sel);
|
||||
void dump_chplan_id_list(void *sel);
|
||||
void dump_chplan_test(void *sel);
|
||||
void dump_chplan_ver(void *sel);
|
||||
|
||||
#endif /* __RTW_CHPLAN_H__ */
|
||||
1374
core/rtw_cmd.c
1374
core/rtw_cmd.c
File diff suppressed because it is too large
Load Diff
1301
core/rtw_debug.c
1301
core/rtw_debug.c
File diff suppressed because it is too large
Load Diff
@@ -127,6 +127,19 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
uint rtw_get_cckrate_size(u8 *rate, u32 rate_length)
|
||||
{
|
||||
int i = 0;
|
||||
while(i < rate_length){
|
||||
RTW_DBG("%s, rate[%d]=%u\n", __FUNCTION__, i, rate[i]);
|
||||
if (((rate[i] & 0x7f) == 2) || ((rate[i] & 0x7f) == 4) ||
|
||||
((rate[i] & 0x7f) == 11) || ((rate[i] & 0x7f) == 22))
|
||||
i++;
|
||||
else
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
uint rtw_is_cckrates_included(u8 *rate)
|
||||
{
|
||||
@@ -381,6 +394,52 @@ exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Returns: remove size OR _FAIL: not updated*/
|
||||
int rtw_remove_ie_g_rate(u8 *ie, uint *ie_len, uint offset, u8 eid)
|
||||
{
|
||||
int ret = _FAIL;
|
||||
u8 *tem_target_ie;
|
||||
u8 *target_ie;
|
||||
u32 target_ielen,temp_target_ielen,cck_rate_size,rm_size;
|
||||
u8 *start;
|
||||
uint search_len;
|
||||
u8 *remain_ies;
|
||||
uint remain_len;
|
||||
if (!ie || !ie_len || *ie_len <= offset)
|
||||
goto exit;
|
||||
|
||||
start = ie + offset;
|
||||
search_len = *ie_len - offset;
|
||||
|
||||
while (1) {
|
||||
tem_target_ie=rtw_get_ie(start,eid,&temp_target_ielen,search_len);
|
||||
|
||||
/*if(tem_target_ie)
|
||||
RTW_INFO("%s, tem_target_ie=%u\n", __FUNCTION__,*tem_target_ie);*/
|
||||
if (tem_target_ie && temp_target_ielen) {
|
||||
cck_rate_size = rtw_get_cckrate_size((tem_target_ie+2), temp_target_ielen);
|
||||
rm_size = temp_target_ielen - cck_rate_size;
|
||||
RTW_DBG("%s,cck_rate_size=%u rm_size=%u\n", __FUNCTION__, cck_rate_size, rm_size);
|
||||
temp_target_ielen=temp_target_ielen + 2;/*org size of Supposrted Rates(include id + length)*/
|
||||
/*RTW_INFO("%s, temp_target_ielen=%u\n", __FUNCTION__,temp_target_ielen);*/
|
||||
remain_ies = tem_target_ie + temp_target_ielen;
|
||||
remain_len = search_len - (remain_ies - start);
|
||||
target_ielen=cck_rate_size;/*discount g mode rate 6, 9 12,18Mbps,id , length*/
|
||||
*(tem_target_ie+1)=target_ielen;/*set new length to Supposrted Rates*/
|
||||
target_ie=tem_target_ie+target_ielen + 2;/*set target ie to address of rate 6Mbps */
|
||||
|
||||
_rtw_memmove(target_ie, remain_ies, remain_len);
|
||||
*ie_len = *ie_len - rm_size;
|
||||
ret = rm_size;
|
||||
|
||||
start = target_ie;
|
||||
search_len = remain_len;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
|
||||
{
|
||||
|
||||
@@ -496,7 +555,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
/* HT Cap. */
|
||||
if (((pregistrypriv->wireless_mode & WIRELESS_11_5N) || (pregistrypriv->wireless_mode & WIRELESS_11_24N))
|
||||
if (is_supported_ht(pregistrypriv->wireless_mode)
|
||||
&& (pregistrypriv->ht_enable == _TRUE)) {
|
||||
/* todo: */
|
||||
}
|
||||
@@ -677,7 +736,6 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
||||
|
||||
int rtw_rsne_info_parse(const u8 *ie, uint ie_len, struct rsne_info *info)
|
||||
{
|
||||
int i;
|
||||
const u8 *pos = ie;
|
||||
u16 cnt;
|
||||
|
||||
@@ -819,7 +877,7 @@ exit:
|
||||
int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len)
|
||||
{
|
||||
int len = 0;
|
||||
u8 authmode, i;
|
||||
u8 authmode;
|
||||
uint cnt;
|
||||
u8 wapi_oui1[4] = {0x0, 0x14, 0x72, 0x01};
|
||||
u8 wapi_oui2[4] = {0x0, 0x14, 0x72, 0x02};
|
||||
@@ -862,7 +920,7 @@ int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len)
|
||||
|
||||
int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, u16 *wpa_len)
|
||||
{
|
||||
u8 authmode, sec_idx, i;
|
||||
u8 authmode, sec_idx;
|
||||
u8 wpa_oui[4] = {0x0, 0x50, 0xf2, 0x01};
|
||||
uint cnt;
|
||||
|
||||
@@ -1543,10 +1601,6 @@ void dump_ht_cap_ie_content(void *sel, const u8 *buf, u32 buf_len)
|
||||
|
||||
void dump_ht_cap_ie(void *sel, const u8 *ie, u32 ie_len)
|
||||
{
|
||||
const u8 *pos = ie;
|
||||
u16 id;
|
||||
u16 len;
|
||||
|
||||
const u8 *ht_cap_ie;
|
||||
sint ht_cap_ielen;
|
||||
|
||||
@@ -1580,10 +1634,6 @@ void dump_ht_op_ie_content(void *sel, const u8 *buf, u32 buf_len)
|
||||
|
||||
void dump_ht_op_ie(void *sel, const u8 *ie, u32 ie_len)
|
||||
{
|
||||
const u8 *pos = ie;
|
||||
u16 id;
|
||||
u16 len;
|
||||
|
||||
const u8 *ht_op_ie;
|
||||
sint ht_op_ielen;
|
||||
|
||||
@@ -1841,7 +1891,7 @@ u32 rtw_get_p2p_merged_ies_len(u8 *in_ie, u32 in_len)
|
||||
PNDIS_802_11_VARIABLE_IEs pIE;
|
||||
u8 OUI[4] = { 0x50, 0x6f, 0x9a, 0x09 };
|
||||
int i = 0;
|
||||
int j = 0, len = 0;
|
||||
int len = 0;
|
||||
|
||||
while (i < in_len) {
|
||||
pIE = (PNDIS_802_11_VARIABLE_IEs)(in_ie + i);
|
||||
|
||||
@@ -419,9 +419,13 @@ u32 _rtw_write_port_and_wait(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem, int
|
||||
|
||||
ret = _rtw_write_port(adapter, addr, cnt, pmem);
|
||||
|
||||
if (ret == _SUCCESS)
|
||||
if (ret == _SUCCESS) {
|
||||
ret = rtw_sctx_wait(&sctx, __func__);
|
||||
|
||||
if (ret != _SUCCESS)
|
||||
pxmitbuf->sctx = NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,9 @@ u8 rtw_validate_bssid(u8 *bssid)
|
||||
|
||||
u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid)
|
||||
{
|
||||
#ifdef CONFIG_VALIDATE_SSID
|
||||
u8 i;
|
||||
#endif
|
||||
u8 ret = _TRUE;
|
||||
|
||||
|
||||
@@ -106,10 +108,17 @@ u8 rtw_do_join(_adapter *padapter)
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic == _FALSE
|
||||
|| rtw_to_roam(padapter) > 0
|
||||
) {
|
||||
/* submit site_survey_cmd */
|
||||
ret = rtw_sitesurvey_cmd(padapter, &parm);
|
||||
if (_SUCCESS != ret) {
|
||||
u8 ssc_chk = rtw_sitesurvey_condition_check(padapter, _FALSE);
|
||||
|
||||
if ((ssc_chk == SS_ALLOW) || (ssc_chk == SS_DENY_BUSY_TRAFFIC) ){
|
||||
/* submit site_survey_cmd */
|
||||
ret = rtw_sitesurvey_cmd(padapter, &parm);
|
||||
if (_SUCCESS != ret)
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
} else {
|
||||
/*if (ssc_chk == SS_DENY_BUDDY_UNDER_SURVEY)*/
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
ret = _FAIL;
|
||||
}
|
||||
} else {
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
@@ -155,26 +164,22 @@ u8 rtw_do_join(_adapter *padapter)
|
||||
/* can't associate ; reset under-linking */
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
||||
#if 0
|
||||
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)) {
|
||||
if (_rtw_memcmp(pmlmepriv->cur_network.network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength)) {
|
||||
/* for funk to do roaming */
|
||||
/* funk will reconnect, but funk will not sitesurvey before reconnect */
|
||||
if (pmlmepriv->sitesurveyctrl.traffic_busy == _FALSE)
|
||||
rtw_sitesurvey_cmd(padapter, &parm);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/* when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue */
|
||||
/* we try to issue sitesurvey firstly */
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic == _FALSE
|
||||
|| rtw_to_roam(padapter) > 0
|
||||
) {
|
||||
/* RTW_INFO("rtw_do_join() when no desired bss in scanning queue\n"); */
|
||||
ret = rtw_sitesurvey_cmd(padapter, &parm);
|
||||
if (_SUCCESS != ret) {
|
||||
u8 ssc_chk = rtw_sitesurvey_condition_check(padapter, _FALSE);
|
||||
|
||||
if ((ssc_chk == SS_ALLOW) || (ssc_chk == SS_DENY_BUSY_TRAFFIC)){
|
||||
/* RTW_INFO(("rtw_do_join() when no desired bss in scanning queue\n"); */
|
||||
ret = rtw_sitesurvey_cmd(padapter, &parm);
|
||||
if (_SUCCESS != ret)
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
} else {
|
||||
/*if (ssc_chk == SS_DENY_BUDDY_UNDER_SURVEY) {
|
||||
} else {*/
|
||||
ret = _FAIL;
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
}
|
||||
} else {
|
||||
@@ -307,7 +312,7 @@ u8 rtw_set_802_11_bssid(_adapter *padapter, u8 *bssid)
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
rtw_indicate_disconnect(padapter, 0, _FALSE);
|
||||
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
rtw_free_assoc_resources_cmd(padapter, _TRUE, 0);
|
||||
|
||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) {
|
||||
_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
|
||||
@@ -344,7 +349,6 @@ u8 rtw_set_802_11_ssid(_adapter *padapter, NDIS_802_11_SSID *ssid)
|
||||
{
|
||||
_irqL irqL;
|
||||
u8 status = _SUCCESS;
|
||||
u32 cur_time = 0;
|
||||
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct wlan_network *pnetwork = &pmlmepriv->cur_network;
|
||||
@@ -379,7 +383,7 @@ u8 rtw_set_802_11_ssid(_adapter *padapter, NDIS_802_11_SSID *ssid)
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
rtw_indicate_disconnect(padapter, 0, _FALSE);
|
||||
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
rtw_free_assoc_resources_cmd(padapter, _TRUE, 0);
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) {
|
||||
_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
|
||||
@@ -400,7 +404,7 @@ u8 rtw_set_802_11_ssid(_adapter *padapter, NDIS_802_11_SSID *ssid)
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
rtw_indicate_disconnect(padapter, 0, _FALSE);
|
||||
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
rtw_free_assoc_resources_cmd(padapter, _TRUE, 0);
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE) {
|
||||
_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
|
||||
@@ -442,7 +446,6 @@ u8 rtw_set_802_11_connect(_adapter *padapter, u8 *bssid, NDIS_802_11_SSID *ssid)
|
||||
{
|
||||
_irqL irqL;
|
||||
u8 status = _SUCCESS;
|
||||
u32 cur_time = 0;
|
||||
bool bssid_valid = _TRUE;
|
||||
bool ssid_valid = _TRUE;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
@@ -538,7 +541,7 @@ u8 rtw_set_802_11_infrastructure_mode(_adapter *padapter,
|
||||
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE))
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
rtw_free_assoc_resources_cmd(padapter, _TRUE, 0);
|
||||
|
||||
if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) {
|
||||
@@ -612,7 +615,7 @@ u8 rtw_set_802_11_disassociate(_adapter *padapter)
|
||||
rtw_disassoc_cmd(padapter, 0, 0);
|
||||
rtw_indicate_disconnect(padapter, 0, _FALSE);
|
||||
/* modify for CONFIG_IEEE80211W, none 11w can use it */
|
||||
rtw_free_assoc_resources_cmd(padapter);
|
||||
rtw_free_assoc_resources_cmd(padapter, _TRUE, 0);
|
||||
if (_FAIL == rtw_pwr_wakeup(padapter))
|
||||
RTW_INFO("%s(): rtw_pwr_wakeup fail !!!\n", __FUNCTION__);
|
||||
}
|
||||
@@ -768,10 +771,13 @@ exit:
|
||||
*/
|
||||
u16 rtw_get_cur_max_rate(_adapter *adapter)
|
||||
{
|
||||
int j;
|
||||
int i = 0;
|
||||
u16 rate = 0, max_rate = 0;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
WLAN_BSSID_EX *pcur_bss = &pmlmepriv->cur_network.network;
|
||||
int sta_bssrate_len = 0;
|
||||
unsigned char sta_bssrate[NumRates];
|
||||
struct sta_info *psta = NULL;
|
||||
u8 short_GI = 0;
|
||||
#ifdef CONFIG_80211N_HT
|
||||
@@ -811,16 +817,38 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
|
||||
else
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
{
|
||||
/*station mode show :station && ap support rate; softap :show ap support rate*/
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)
|
||||
get_rate_set(adapter, sta_bssrate, &sta_bssrate_len);/*get sta rate and length*/
|
||||
|
||||
|
||||
while ((pcur_bss->SupportedRates[i] != 0) && (pcur_bss->SupportedRates[i] != 0xFF)) {
|
||||
rate = pcur_bss->SupportedRates[i] & 0x7F;
|
||||
if (rate > max_rate)
|
||||
max_rate = rate;
|
||||
rate = pcur_bss->SupportedRates[i] & 0x7F;/*AP support rates*/
|
||||
/*RTW_INFO("%s rate=%02X \n", __func__, rate);*/
|
||||
|
||||
/*check STA support rate or not */
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE) {
|
||||
for (j = 0; j < sta_bssrate_len; j++) {
|
||||
/* Avoid the proprietary data rate (22Mbps) of Handlink WSG-4000 AP */
|
||||
if ((rate | IEEE80211_BASIC_RATE_MASK)
|
||||
== (sta_bssrate[j] | IEEE80211_BASIC_RATE_MASK)) {
|
||||
if (rate > max_rate) {
|
||||
max_rate = rate;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
if (rate > max_rate)
|
||||
max_rate = rate;
|
||||
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
max_rate = max_rate * 10 / 2;
|
||||
}
|
||||
|
||||
return max_rate;
|
||||
}
|
||||
|
||||
@@ -850,9 +878,6 @@ int rtw_set_scan_mode(_adapter *adapter, RT_SCAN_TYPE scan_mode)
|
||||
*/
|
||||
int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan)
|
||||
{
|
||||
struct registry_priv *pregistrypriv = &adapter->registrypriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
/* handle by cmd_thread to sync with scan operation */
|
||||
return rtw_set_chplan_cmd(adapter, RTW_CMDF_WAIT_ACK, channel_plan, 1);
|
||||
}
|
||||
|
||||
154
core/rtw_mi.c
154
core/rtw_mi.c
@@ -27,6 +27,7 @@ void rtw_mi_update_union_chan_inf(_adapter *adapter, u8 ch, u8 offset , u8 bw)
|
||||
iface_state->union_offset = offset;
|
||||
}
|
||||
|
||||
#ifdef DBG_IFACE_STATUS
|
||||
#ifdef CONFIG_P2P
|
||||
static u8 _rtw_mi_p2p_listen_scan_chk(_adapter *adapter)
|
||||
{
|
||||
@@ -46,6 +47,8 @@ static u8 _rtw_mi_p2p_listen_scan_chk(_adapter *adapter)
|
||||
return p2p_listen_scan_state;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
u8 rtw_mi_stayin_union_ch_chk(_adapter *adapter)
|
||||
{
|
||||
u8 rst = _TRUE;
|
||||
@@ -104,9 +107,8 @@ u8 rtw_mi_stayin_union_band_chk(_adapter *adapter)
|
||||
}
|
||||
|
||||
/* Find union about ch, bw, ch_offset of all linked/linking interfaces */
|
||||
int _rtw_mi_get_ch_setting_union(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset, bool include_self)
|
||||
int rtw_mi_get_ch_setting_union_by_ifbmp(struct dvobj_priv *dvobj, u8 ifbmp, u8 *ch, u8 *bw, u8 *offset)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
_adapter *iface;
|
||||
struct mlme_ext_priv *mlmeext;
|
||||
int i;
|
||||
@@ -124,6 +126,9 @@ int _rtw_mi_get_ch_setting_union(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset,
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
iface = dvobj->padapters[i];
|
||||
if (!iface || !(ifbmp & BIT(iface->iface_id)))
|
||||
continue;
|
||||
|
||||
mlmeext = &iface->mlmeextpriv;
|
||||
|
||||
if (!check_fwstate(&iface->mlmepriv, _FW_LINKED | _FW_UNDER_LINKING))
|
||||
@@ -132,9 +137,6 @@ int _rtw_mi_get_ch_setting_union(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset,
|
||||
if (check_fwstate(&iface->mlmepriv, WIFI_OP_CH_SWITCHING))
|
||||
continue;
|
||||
|
||||
if (include_self == _FALSE && adapter == iface)
|
||||
continue;
|
||||
|
||||
if (num == 0) {
|
||||
ch_ret = mlmeext->cur_channel;
|
||||
bw_ret = mlmeext->cur_bwmode;
|
||||
@@ -173,22 +175,17 @@ int _rtw_mi_get_ch_setting_union(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset,
|
||||
|
||||
inline int rtw_mi_get_ch_setting_union(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset)
|
||||
{
|
||||
return _rtw_mi_get_ch_setting_union(adapter, ch, bw, offset, 1);
|
||||
return rtw_mi_get_ch_setting_union_by_ifbmp(adapter_to_dvobj(adapter), 0xFF, ch, bw, offset);
|
||||
}
|
||||
|
||||
inline int rtw_mi_get_ch_setting_union_no_self(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset)
|
||||
{
|
||||
return _rtw_mi_get_ch_setting_union(adapter, ch, bw, offset, 0);
|
||||
return rtw_mi_get_ch_setting_union_by_ifbmp(adapter_to_dvobj(adapter), 0xFF & ~BIT(adapter->iface_id), ch, bw, offset);
|
||||
}
|
||||
|
||||
#define MI_STATUS_SELF_ONLY 0
|
||||
#define MI_STATUS_OTHERS_ONLY 1
|
||||
#define MI_STATUS_ALL 2
|
||||
|
||||
/* For now, not return union_ch/bw/offset */
|
||||
void _rtw_mi_status(_adapter *adapter, struct mi_state *mstate, u8 target_sel)
|
||||
void rtw_mi_status_by_ifbmp(struct dvobj_priv *dvobj, u8 ifbmp, struct mi_state *mstate)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
_adapter *iface;
|
||||
int i;
|
||||
|
||||
@@ -196,10 +193,7 @@ void _rtw_mi_status(_adapter *adapter, struct mi_state *mstate, u8 target_sel)
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
iface = dvobj->padapters[i];
|
||||
|
||||
if (target_sel == MI_STATUS_SELF_ONLY && iface != adapter)
|
||||
continue;
|
||||
if (target_sel == MI_STATUS_OTHERS_ONLY && iface == adapter)
|
||||
if (!iface || !(ifbmp & BIT(iface->iface_id)))
|
||||
continue;
|
||||
|
||||
if (check_fwstate(&iface->mlmepriv, WIFI_STATION_STATE) == _TRUE) {
|
||||
@@ -211,6 +205,10 @@ void _rtw_mi_status(_adapter *adapter, struct mi_state *mstate, u8 target_sel)
|
||||
if (iface->tdlsinfo.link_established == _TRUE)
|
||||
MSTATE_TDLS_LD_NUM(mstate)++;
|
||||
#endif
|
||||
#ifdef CONFIG_P2P
|
||||
if (MLME_IS_GC(iface))
|
||||
MSTATE_P2P_GC_NUM(mstate)++;
|
||||
#endif
|
||||
}
|
||||
if (check_fwstate(&iface->mlmepriv, _FW_UNDER_LINKING) == _TRUE)
|
||||
MSTATE_STA_LG_NUM(mstate)++;
|
||||
@@ -221,6 +219,10 @@ void _rtw_mi_status(_adapter *adapter, struct mi_state *mstate, u8 target_sel)
|
||||
MSTATE_AP_NUM(mstate)++;
|
||||
if (iface->stapriv.asoc_sta_count > 2)
|
||||
MSTATE_AP_LD_NUM(mstate)++;
|
||||
#ifdef CONFIG_P2P
|
||||
if (MLME_IS_GO(iface))
|
||||
MSTATE_P2P_GO_NUM(mstate)++;
|
||||
#endif
|
||||
} else
|
||||
MSTATE_AP_STARTING_NUM(mstate)++;
|
||||
#endif
|
||||
@@ -262,23 +264,26 @@ void _rtw_mi_status(_adapter *adapter, struct mi_state *mstate, u8 target_sel)
|
||||
MSTATE_ROCH_NUM(mstate)++;
|
||||
#endif
|
||||
#endif /* CONFIG_IOCTL_CFG80211 */
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
if (MLME_IS_PD(iface))
|
||||
MSTATE_P2P_DV_NUM(mstate)++;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_mi_status(_adapter *adapter, struct mi_state *mstate)
|
||||
{
|
||||
return _rtw_mi_status(adapter, mstate, MI_STATUS_ALL);
|
||||
return rtw_mi_status_by_ifbmp(adapter_to_dvobj(adapter), 0xFF, mstate);
|
||||
}
|
||||
|
||||
inline void rtw_mi_status_no_self(_adapter *adapter, struct mi_state *mstate)
|
||||
{
|
||||
return _rtw_mi_status(adapter, mstate, MI_STATUS_OTHERS_ONLY);
|
||||
return rtw_mi_status_by_ifbmp(adapter_to_dvobj(adapter), 0xFF & ~BIT(adapter->iface_id), mstate);
|
||||
}
|
||||
|
||||
inline void rtw_mi_status_no_others(_adapter *adapter, struct mi_state *mstate)
|
||||
{
|
||||
return _rtw_mi_status(adapter, mstate, MI_STATUS_SELF_ONLY);
|
||||
return rtw_mi_status_by_ifbmp(adapter_to_dvobj(adapter), BIT(adapter->iface_id), mstate);
|
||||
}
|
||||
|
||||
/* For now, not handle union_ch/bw/offset */
|
||||
@@ -332,7 +337,9 @@ void dump_mi_status(void *sel, struct dvobj_priv *dvobj)
|
||||
RTW_PRINT_SEL(sel, "linked_mesh_num:%d\n", DEV_MESH_LD_NUM(dvobj));
|
||||
#endif
|
||||
#ifdef CONFIG_P2P
|
||||
RTW_PRINT_SEL(sel, "p2p_device_num:%d\n", rtw_mi_stay_in_p2p_mode(dvobj_get_primary_adapter(dvobj)));
|
||||
RTW_PRINT_SEL(sel, "p2p_device_num:%d\n", DEV_P2P_DV_NUM(dvobj));
|
||||
RTW_PRINT_SEL(sel, "p2p_gc_num:%d\n", DEV_P2P_GC_NUM(dvobj));
|
||||
RTW_PRINT_SEL(sel, "p2p_go_num:%d\n", DEV_P2P_GO_NUM(dvobj));
|
||||
#endif
|
||||
RTW_PRINT_SEL(sel, "scan_num:%d\n", DEV_SCAN_NUM(dvobj));
|
||||
RTW_PRINT_SEL(sel, "under_wps_num:%d\n", DEV_WPS_NUM(dvobj));
|
||||
@@ -360,9 +367,7 @@ inline void rtw_mi_update_iface_status(struct mlme_priv *pmlmepriv, sint state)
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
struct mi_state *iface_state = &dvobj->iface_state;
|
||||
struct mi_state tmp_mstate;
|
||||
u8 i;
|
||||
u8 u_ch, u_offset, u_bw;
|
||||
_adapter *iface;
|
||||
|
||||
if (state == WIFI_MONITOR_STATE
|
||||
|| state == 0xFFFFFFFF
|
||||
@@ -748,6 +753,30 @@ void rtw_mi_buddy_intf_stop(_adapter *adapter)
|
||||
_rtw_mi_process(adapter, _TRUE, NULL, _rtw_mi_intf_stop);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NEW_NETDEV_HDL
|
||||
static u8 _rtw_mi_hal_iface_init(_adapter *padapter, void *data)
|
||||
{
|
||||
if (rtw_hal_iface_init(padapter) == _SUCCESS)
|
||||
return _TRUE;
|
||||
return _FALSE;
|
||||
}
|
||||
u8 rtw_mi_hal_iface_init(_adapter *padapter)
|
||||
{
|
||||
int i;
|
||||
_adapter *iface;
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
||||
|
||||
u8 ret = _TRUE;
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
iface = dvobj->padapters[i];
|
||||
if (iface && iface->netif_up)
|
||||
rtw_hal_iface_init(padapter);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
static u8 _rtw_mi_suspend_free_assoc_resource(_adapter *padapter, void *data)
|
||||
{
|
||||
return rtw_suspend_free_assoc_resource(padapter);
|
||||
@@ -864,7 +893,6 @@ u8 _rtw_mi_busy_traffic_check(_adapter *padapter, void *data)
|
||||
if (check_sc_interval) {
|
||||
/* Miracast can't do AP scan*/
|
||||
passtime = rtw_get_passing_time_ms(pmlmepriv->lastscantime);
|
||||
pmlmepriv->lastscantime = rtw_get_current_time();
|
||||
if (passtime > BUSY_TRAFFIC_SCAN_DENY_PERIOD) {
|
||||
RTW_INFO(ADPT_FMT" bBusyTraffic == _TRUE\n", ADPT_ARG(padapter));
|
||||
return _TRUE;
|
||||
@@ -1089,20 +1117,6 @@ u8 rtw_mi_buddy_dynamic_check_timer_handlder(_adapter *padapter)
|
||||
return _rtw_mi_process(padapter, _TRUE, NULL, _rtw_mi_dynamic_check_timer_handlder);
|
||||
}
|
||||
|
||||
static u8 _rtw_mi_dev_unload(_adapter *adapter, void *data)
|
||||
{
|
||||
rtw_dev_unload(adapter);
|
||||
return _TRUE;
|
||||
}
|
||||
u8 rtw_mi_dev_unload(_adapter *padapter)
|
||||
{
|
||||
return _rtw_mi_process(padapter, _FALSE, NULL, _rtw_mi_dev_unload);
|
||||
}
|
||||
u8 rtw_mi_buddy_dev_unload(_adapter *padapter)
|
||||
{
|
||||
return _rtw_mi_process(padapter, _TRUE, NULL, _rtw_mi_dev_unload);
|
||||
}
|
||||
|
||||
static u8 _rtw_mi_dynamic_chk_wk_hdl(_adapter *adapter, void *data)
|
||||
{
|
||||
rtw_iface_dynamic_chk_wk_hdl(adapter);
|
||||
@@ -1176,7 +1190,7 @@ static u8 _rtw_mi_tx_beacon_hdl(_adapter *adapter, void *data)
|
||||
) {
|
||||
adapter->mlmepriv.update_bcn = _TRUE;
|
||||
#ifndef CONFIG_INTERRUPT_BASED_TXBCN
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) || defined(CONFIG_PCI_BCN_POLLING)
|
||||
tx_beacon_hdl(adapter, NULL);
|
||||
#endif
|
||||
#endif
|
||||
@@ -1262,7 +1276,7 @@ _adapter *rtw_get_iface_by_id(_adapter *padapter, u8 iface_id)
|
||||
return dvobj->padapters[iface_id];
|
||||
}
|
||||
|
||||
_adapter *rtw_get_iface_by_macddr(_adapter *padapter, u8 *mac_addr)
|
||||
_adapter *rtw_get_iface_by_macddr(_adapter *padapter, const u8 *mac_addr)
|
||||
{
|
||||
int i;
|
||||
_adapter *iface = NULL;
|
||||
@@ -1354,9 +1368,10 @@ void rtw_dbg_skb_process(_adapter *padapter, union recv_frame *precvframe, union
|
||||
static s32 _rtw_mi_buddy_clone_bcmc_packet(_adapter *adapter, union recv_frame *precvframe, u8 *pphy_status, union recv_frame *pcloneframe)
|
||||
{
|
||||
s32 ret = _SUCCESS;
|
||||
#ifdef CONFIG_SKB_ALLOCATED
|
||||
u8 *pbuf = precvframe->u.hdr.rx_data;
|
||||
#endif
|
||||
struct rx_pkt_attrib *pattrib = NULL;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
|
||||
if (pcloneframe) {
|
||||
pcloneframe->u.hdr.adapter = adapter;
|
||||
@@ -1451,6 +1466,45 @@ _adapter *rtw_mi_get_ap_adapter(_adapter *padapter)
|
||||
}
|
||||
#endif
|
||||
|
||||
u8 rtw_mi_get_ld_sta_ifbmp(_adapter *adapter)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
int i;
|
||||
_adapter *iface = NULL;
|
||||
u8 ifbmp = 0;
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
iface = dvobj->padapters[i];
|
||||
if (!iface)
|
||||
continue;
|
||||
|
||||
if (MLME_IS_STA(iface) && MLME_IS_ASOC(iface))
|
||||
ifbmp |= BIT(i);
|
||||
}
|
||||
|
||||
return ifbmp;
|
||||
}
|
||||
|
||||
u8 rtw_mi_get_ap_mesh_ifbmp(_adapter *adapter)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
int i;
|
||||
_adapter *iface = NULL;
|
||||
u8 ifbmp = 0;
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
iface = dvobj->padapters[i];
|
||||
if (!iface)
|
||||
continue;
|
||||
|
||||
if (CHK_MLME_STATE(iface, WIFI_AP_STATE | WIFI_MESH_STATE)
|
||||
&& MLME_IS_ASOC(iface))
|
||||
ifbmp |= BIT(i);
|
||||
}
|
||||
|
||||
return ifbmp;
|
||||
}
|
||||
|
||||
void rtw_mi_update_ap_bmc_camid(_adapter *padapter, u8 camid_a, u8 camid_b)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
@@ -1476,3 +1530,19 @@ void rtw_mi_update_ap_bmc_camid(_adapter *padapter, u8 camid_a, u8 camid_b)
|
||||
#endif
|
||||
}
|
||||
|
||||
u8 rtw_mi_get_assoc_if_num(_adapter *adapter)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
u8 n_assoc_iface = 0;
|
||||
#if 1
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
if (check_fwstate(&(dvobj->padapters[i]->mlmepriv), WIFI_ASOC_STATE))
|
||||
n_assoc_iface++;
|
||||
}
|
||||
#else
|
||||
n_assoc_iface = DEV_STA_LD_NUM(dvobj) + DEV_AP_NUM(dvobj) + DEV_ADHOC_NUM(dvobj) + DEV_MESH_NUM(dvobj);
|
||||
#endif
|
||||
return n_assoc_iface;
|
||||
}
|
||||
|
||||
507
core/rtw_mlme.c
507
core/rtw_mlme.c
File diff suppressed because it is too large
Load Diff
1701
core/rtw_mlme_ext.c
1701
core/rtw_mlme_ext.c
File diff suppressed because it is too large
Load Diff
390
core/rtw_mp.c
390
core/rtw_mp.c
@@ -120,7 +120,7 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv)
|
||||
|
||||
pmp_priv->channel = 1;
|
||||
pmp_priv->bandwidth = CHANNEL_WIDTH_20;
|
||||
pmp_priv->prime_channel_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
|
||||
pmp_priv->prime_channel_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
pmp_priv->rateidx = RATE_1M;
|
||||
pmp_priv->txpoweridx = 0x2A;
|
||||
|
||||
@@ -147,6 +147,7 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv)
|
||||
pmp_priv->bloopback = _FALSE;
|
||||
|
||||
pmp_priv->bloadefusemap = _FALSE;
|
||||
pmp_priv->brx_filter_beacon = _FALSE;
|
||||
|
||||
pnetwork = &pmp_priv->mp_network.network;
|
||||
_rtw_memcpy(pnetwork->MacAddress, pmp_priv->network_macaddr, ETH_ALEN);
|
||||
@@ -222,6 +223,7 @@ static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
#if 0
|
||||
static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
|
||||
{
|
||||
int i, res;
|
||||
@@ -263,6 +265,7 @@ _exit_init_mp_priv:
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter)
|
||||
{
|
||||
@@ -298,6 +301,11 @@ static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter)
|
||||
|
||||
pattrib->pktlen = 1500;
|
||||
|
||||
if (pHalData->rf_type == RF_2T2R)
|
||||
pattrib->raid = RATEID_IDX_BGN_40M_2SS;
|
||||
else
|
||||
pattrib->raid = RATEID_IDX_BGN_40M_1SS;
|
||||
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
if (pHalData->rf_type == RF_1T1R)
|
||||
pattrib->raid = RATEID_IDX_VHT_1SS;
|
||||
@@ -363,7 +371,7 @@ void free_mp_priv(struct mp_priv *pmp_priv)
|
||||
pmp_priv->pmp_xmtframe_buf = NULL;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
static VOID PHY_IQCalibrate_default(
|
||||
IN PADAPTER pAdapter,
|
||||
IN BOOLEAN bReCovery
|
||||
@@ -386,7 +394,7 @@ static VOID PHY_SetRFPathSwitch_default(
|
||||
{
|
||||
RTW_INFO("%s\n", __func__);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void mpt_InitHWConfig(PADAPTER Adapter)
|
||||
{
|
||||
@@ -453,8 +461,8 @@ void mpt_InitHWConfig(PADAPTER Adapter)
|
||||
else if (IS_HARDWARE_TYPE_8821C(Adapter))
|
||||
PlatformEFIOWrite2Byte(Adapter, REG_RXFLTMAP1_8821C, 0x2000);
|
||||
#endif /* CONFIG_RTL8821C */
|
||||
#ifdef CONFIG_RTL8188F
|
||||
else if (IS_HARDWARE_TYPE_8188F(Adapter)) {
|
||||
#if defined(CONFIG_RTL8188F) || defined(CONFIG_RTL8188GTV)
|
||||
else if (IS_HARDWARE_TYPE_8188F(Adapter) || IS_HARDWARE_TYPE_8188GTV(Adapter)) {
|
||||
if (IS_A_CUT(hal->version_id) || IS_B_CUT(hal->version_id)) {
|
||||
RTW_INFO("%s() Active large power detection\n", __func__);
|
||||
phy_active_large_power_detection_8188f(&(GET_HAL_DATA(Adapter)->odmpriv));
|
||||
@@ -504,6 +512,10 @@ static u8 PHY_QueryRFPathSwitch(PADAPTER padapter)
|
||||
} else if (IS_HARDWARE_TYPE_8188F(padapter)) {
|
||||
#ifdef CONFIG_RTL8188F
|
||||
bmain = PHY_QueryRFPathSwitch_8188F(padapter);
|
||||
#endif
|
||||
} else if (IS_HARDWARE_TYPE_8188GTV(padapter)) {
|
||||
#ifdef CONFIG_RTL8188GTV
|
||||
bmain = PHY_QueryRFPathSwitch_8188GTV(padapter);
|
||||
#endif
|
||||
} else if (IS_HARDWARE_TYPE_8822B(padapter)) {
|
||||
#ifdef CONFIG_RTL8822B
|
||||
@@ -538,7 +550,7 @@ static void PHY_SetRFPathSwitch(PADAPTER padapter , BOOLEAN bMain) {
|
||||
#ifdef CONFIG_RTL8188E
|
||||
phy_set_rf_path_switch_8188e(phydm, bMain);
|
||||
#endif
|
||||
} else if (IS_HARDWARE_TYPE_8814A(padapter)) {
|
||||
} else if (IS_HARDWARE_TYPE_8814A(padapter)) {
|
||||
#ifdef CONFIG_RTL8814A
|
||||
phy_set_rf_path_switch_8814a(phydm, bMain);
|
||||
#endif
|
||||
@@ -554,9 +566,13 @@ static void PHY_SetRFPathSwitch(PADAPTER padapter , BOOLEAN bMain) {
|
||||
#ifdef CONFIG_RTL8703B
|
||||
phy_set_rf_path_switch_8703b(phydm, bMain);
|
||||
#endif
|
||||
} else if (IS_HARDWARE_TYPE_8188F(padapter)) {
|
||||
#ifdef CONFIG_RTL8188F
|
||||
} else if (IS_HARDWARE_TYPE_8188F(padapter) || IS_HARDWARE_TYPE_8188GTV(padapter)) {
|
||||
#if defined(CONFIG_RTL8188F) || defined(CONFIG_RTL8188GTV)
|
||||
phy_set_rf_path_switch_8188f(phydm, bMain);
|
||||
#endif
|
||||
} else if (IS_HARDWARE_TYPE_8192F(padapter)) {
|
||||
#ifdef CONFIG_RTL8192F
|
||||
phy_set_rf_path_switch_8192f(padapter, bMain);
|
||||
#endif
|
||||
} else if (IS_HARDWARE_TYPE_8822B(padapter)) {
|
||||
#ifdef CONFIG_RTL8822B
|
||||
@@ -575,17 +591,16 @@ static void PHY_SetRFPathSwitch(PADAPTER padapter , BOOLEAN bMain) {
|
||||
|
||||
|
||||
static void phy_switch_rf_path_set(PADAPTER padapter , u8 *prf_set_State) {
|
||||
|
||||
#ifdef CONFIG_RTL8821C
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct dm_struct *p_dm = &pHalData->odmpriv;
|
||||
|
||||
#ifdef CONFIG_RTL8821C
|
||||
if (IS_HARDWARE_TYPE_8821C(padapter)) {
|
||||
config_phydm_set_ant_path(p_dm, *prf_set_State, p_dm->current_ant_num_8821c);
|
||||
/* Do IQK when switching to BTG/WLG, requested by RF Binson */
|
||||
if (*prf_set_State == SWITCH_TO_BTG || *prf_set_State == SWITCH_TO_WLG)
|
||||
PHY_IQCalibrate(padapter, FALSE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -619,7 +634,6 @@ MPT_InitializeAdapter(
|
||||
s32 rtStatus = _SUCCESS;
|
||||
PMPT_CONTEXT pMptCtx = &pAdapter->mppriv.mpt_ctx;
|
||||
u32 ledsetting;
|
||||
struct mlme_priv *pmlmepriv = &pAdapter->mlmepriv;
|
||||
|
||||
pMptCtx->bMptDrvUnload = _FALSE;
|
||||
pMptCtx->bMassProdTest = _FALSE;
|
||||
@@ -644,9 +658,9 @@ MPT_InitializeAdapter(
|
||||
phy_set_bb_reg(pAdapter, 0xA00, BIT8, 0x0);
|
||||
PHY_SetRFPathSwitch(pAdapter, 1/*pHalData->bDefaultAntenna*/); /*default use Main*/
|
||||
|
||||
if (pHalData->PackageType == PACKAGE_DEFAULT)
|
||||
if (pHalData->PackageType == PACKAGE_DEFAULT)
|
||||
phy_set_rf_reg(pAdapter, RF_PATH_A, 0x51, bRFRegOffsetMask, 0x6B04E);
|
||||
else
|
||||
else
|
||||
phy_set_rf_reg(pAdapter, RF_PATH_A, 0x51, bRFRegOffsetMask, 0x6F10E);
|
||||
|
||||
}
|
||||
@@ -826,6 +840,9 @@ void MPT_PwrCtlDM(PADAPTER padapter, u32 bstart)
|
||||
else if (pDM_Odm->support_ic_type == ODM_RTL8723D) {
|
||||
(*c.odm_tx_pwr_track_set_pwr)(pDM_Odm, BBSWING, RF_PATH_A, chnl);
|
||||
SetTxPower(padapter);
|
||||
} else if (pDM_Odm->support_ic_type == ODM_RTL8192F) {
|
||||
(*c.odm_tx_pwr_track_set_pwr)(pDM_Odm, MIX_MODE, RF_PATH_A, chnl);
|
||||
(*c.odm_tx_pwr_track_set_pwr)(pDM_Odm, MIX_MODE, RF_PATH_B, chnl);
|
||||
} else {
|
||||
(*c.odm_tx_pwr_track_set_pwr)(pDM_Odm, BBSWING, RF_PATH_A, chnl);
|
||||
(*c.odm_tx_pwr_track_set_pwr)(pDM_Odm, BBSWING, RF_PATH_B, chnl);
|
||||
@@ -842,7 +859,6 @@ u32 mp_join(PADAPTER padapter, u8 mode)
|
||||
WLAN_BSSID_EX bssid;
|
||||
struct sta_info *psta;
|
||||
u32 length;
|
||||
u8 val8, join_type;
|
||||
_irqL irqL;
|
||||
s32 res = _SUCCESS;
|
||||
|
||||
@@ -853,9 +869,6 @@ u32 mp_join(PADAPTER padapter, u8 mode)
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX *)(&(pmlmeinfo->network));
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
struct wireless_dev *pwdev = padapter->rtw_wdev;
|
||||
#endif /* #ifdef CONFIG_IOCTL_CFG80211 */
|
||||
/* 1. initialize a new WLAN_BSSID_EX */
|
||||
_rtw_memset(&bssid, 0, sizeof(WLAN_BSSID_EX));
|
||||
RTW_INFO("%s ,pmppriv->network_macaddr=%x %x %x %x %x %x\n", __func__,
|
||||
@@ -894,7 +907,7 @@ u32 mp_join(PADAPTER padapter, u8 mode)
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) {
|
||||
rtw_disassoc_cmd(padapter, 500, 0);
|
||||
rtw_indicate_disconnect(padapter, 0, _FALSE);
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
rtw_free_assoc_resources_cmd(padapter, _TRUE, 0);
|
||||
}
|
||||
pmppriv->prev_fw_state = get_fwstate(pmlmepriv);
|
||||
/*pmlmepriv->fw_state = WIFI_MP_STATE;*/
|
||||
@@ -962,6 +975,9 @@ end_of_mp_start_test:
|
||||
s32 mp_start_test(PADAPTER padapter)
|
||||
{
|
||||
struct mp_priv *pmppriv = &padapter->mppriv;
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
PHAL_DATA_TYPE hal;
|
||||
#endif
|
||||
s32 res = _SUCCESS;
|
||||
|
||||
padapter->registrypriv.mp_mode = 1;
|
||||
@@ -985,6 +1001,9 @@ s32 mp_start_test(PADAPTER padapter)
|
||||
#ifdef CONFIG_RTL8188F
|
||||
rtl8188f_InitHalDm(padapter);
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188GTV
|
||||
rtl8188gtv_InitHalDm(padapter);
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188E
|
||||
rtl8188e_InitHalDm(padapter);
|
||||
#endif
|
||||
@@ -992,6 +1011,13 @@ s32 mp_start_test(PADAPTER padapter)
|
||||
rtl8723d_InitHalDm(padapter);
|
||||
#endif /* CONFIG_RTL8723D */
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
hal = GET_HAL_DATA(padapter);
|
||||
hal->pci_backdoor_ctrl = 0;
|
||||
rtw_pci_aspm_config(padapter);
|
||||
#endif
|
||||
|
||||
|
||||
/* 3 0. update mp_priv */
|
||||
|
||||
if (!RF_TYPE_VALID(padapter->registrypriv.rf_config)) {
|
||||
@@ -1031,6 +1057,10 @@ void mp_stop_test(PADAPTER padapter)
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct wlan_network *tgt_network = &pmlmepriv->cur_network;
|
||||
struct sta_info *psta;
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
struct registry_priv *registry_par = &padapter->registrypriv;
|
||||
PHAL_DATA_TYPE hal;
|
||||
#endif
|
||||
|
||||
_irqL irqL;
|
||||
|
||||
@@ -1044,7 +1074,7 @@ void mp_stop_test(PADAPTER padapter)
|
||||
rtw_indicate_disconnect(padapter, 0, _FALSE);
|
||||
|
||||
/* 3 2. clear psta used in mp test mode.
|
||||
* rtw_free_assoc_resources(padapter, 1); */
|
||||
* rtw_free_assoc_resources(padapter, _TRUE); */
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, tgt_network->network.MacAddress);
|
||||
if (psta)
|
||||
rtw_free_stainfo(padapter, psta);
|
||||
@@ -1062,6 +1092,12 @@ end_of_mp_stop_test:
|
||||
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
hal = GET_HAL_DATA(padapter);
|
||||
hal->pci_backdoor_ctrl = registry_par->pci_aspm_config;
|
||||
rtw_pci_aspm_config(padapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8812A
|
||||
rtl8812_InitHalDm(padapter);
|
||||
#endif
|
||||
@@ -1077,6 +1113,9 @@ end_of_mp_stop_test:
|
||||
#ifdef CONFIG_RTL8188F
|
||||
rtl8188f_InitHalDm(padapter);
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188GTV
|
||||
rtl8188gtv_InitHalDm(padapter);
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8723D
|
||||
rtl8723d_InitHalDm(padapter);
|
||||
#endif
|
||||
@@ -1142,6 +1181,7 @@ static VOID mpt_AdjustRFRegByRateByChan92CU(PADAPTER pAdapter, u8 RateIdx, u8 Ch
|
||||
* 01/09/2009 MHC Add CCK modification for 40MHZ. Suggestion from SD3.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
#if 0
|
||||
static void mpt_SwitchRfSetting(PADAPTER pAdapter)
|
||||
{
|
||||
hal_mpt_SwitchRfSetting(pAdapter);
|
||||
@@ -1153,6 +1193,7 @@ static void MPT_CCKTxPowerAdjust(PADAPTER Adapter, BOOLEAN bInCH14)
|
||||
{
|
||||
hal_mpt_CCKTxPowerAdjust(Adapter, bInCH14);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*---------------------------hal\rtl8192c\MPT_HelperFunc.c---------------------------*/
|
||||
|
||||
@@ -1231,6 +1272,7 @@ s32 SetThermalMeter(PADAPTER pAdapter, u8 target_ther)
|
||||
return hal_mpt_SetThermalMeter(pAdapter, target_ther);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void TriggerRFThermalMeter(PADAPTER pAdapter)
|
||||
{
|
||||
hal_mpt_TriggerRFThermalMeter(pAdapter);
|
||||
@@ -1240,6 +1282,7 @@ static u8 ReadRFThermalMeter(PADAPTER pAdapter)
|
||||
{
|
||||
return hal_mpt_ReadRFThermalMeter(pAdapter);
|
||||
}
|
||||
#endif
|
||||
|
||||
void GetThermalMeter(PADAPTER pAdapter, u8 *value)
|
||||
{
|
||||
@@ -1313,7 +1356,7 @@ static struct xmit_frame *alloc_mp_xmitframe(struct xmit_priv *pxmitpriv)
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCIE_HCI
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
static u8 check_nic_enough_desc(_adapter *padapter, struct pkt_attrib *pattrib)
|
||||
{
|
||||
u32 prio;
|
||||
@@ -1373,7 +1416,7 @@ static thread_return mp_xmit_packet_thread(thread_context context)
|
||||
RTW_INFO("%s:pkTx Start\n", __func__);
|
||||
while (1) {
|
||||
pxmitframe = alloc_mp_xmitframe(pxmitpriv);
|
||||
#ifdef CONFIG_PCIE_HCI
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
if(check_nic_enough_desc(padapter, &pmptx->attrib) == _FALSE) {
|
||||
rtw_usleep_os(1000);
|
||||
continue;
|
||||
@@ -1487,7 +1530,7 @@ void fill_tx_desc_8814a(PADAPTER padapter)
|
||||
|
||||
u32 pkt_size = pattrib->last_txcmdsz;
|
||||
s32 bmcast = IS_MCAST(pattrib->ra);
|
||||
u8 data_rate, pwr_status, offset;
|
||||
u8 offset;
|
||||
|
||||
/* SET_TX_DESC_FIRST_SEG_8814A(pDesc, 1); */
|
||||
SET_TX_DESC_LAST_SEG_8814A(pDesc, 1);
|
||||
@@ -1741,6 +1784,37 @@ void fill_tx_desc_8188f(PADAPTER padapter)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8188GTV)
|
||||
void fill_tx_desc_8188gtv(PADAPTER padapter)
|
||||
{
|
||||
struct mp_priv *pmp_priv = &padapter->mppriv;
|
||||
struct pkt_attrib *pattrib = &(pmp_priv->tx.attrib);
|
||||
u8 *ptxdesc = pmp_priv->tx.desc;
|
||||
|
||||
SET_TX_DESC_AGG_BREAK_8188GTV(ptxdesc, 1);
|
||||
SET_TX_DESC_MACID_8188GTV(ptxdesc, pattrib->mac_id);
|
||||
SET_TX_DESC_QUEUE_SEL_8188GTV(ptxdesc, pattrib->qsel);
|
||||
|
||||
SET_TX_DESC_RATE_ID_8188GTV(ptxdesc, pattrib->raid);
|
||||
SET_TX_DESC_SEQ_8188GTV(ptxdesc, pattrib->seqnum);
|
||||
SET_TX_DESC_HWSEQ_EN_8188GTV(ptxdesc, 1);
|
||||
SET_TX_DESC_USE_RATE_8188GTV(ptxdesc, 1);
|
||||
SET_TX_DESC_DISABLE_FB_8188GTV(ptxdesc, 1);
|
||||
|
||||
if (pmp_priv->preamble)
|
||||
if (HwRateToMPTRate(pmp_priv->rateidx) <= MPT_RATE_54M)
|
||||
SET_TX_DESC_DATA_SHORT_8188GTV(ptxdesc, 1);
|
||||
|
||||
if (pmp_priv->bandwidth == CHANNEL_WIDTH_40)
|
||||
SET_TX_DESC_DATA_BW_8188GTV(ptxdesc, 1);
|
||||
|
||||
SET_TX_DESC_TX_RATE_8188GTV(ptxdesc, pmp_priv->rateidx);
|
||||
|
||||
SET_TX_DESC_DATA_RATE_FB_LIMIT_8188GTV(ptxdesc, 0x1F);
|
||||
SET_TX_DESC_RTS_RATE_FB_LIMIT_8188GTV(ptxdesc, 0xF);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8723D)
|
||||
void fill_tx_desc_8723d(PADAPTER padapter)
|
||||
{
|
||||
@@ -1773,6 +1847,70 @@ void fill_tx_desc_8723d(PADAPTER padapter)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8710B)
|
||||
void fill_tx_desc_8710b(PADAPTER padapter)
|
||||
{
|
||||
struct mp_priv *pmp_priv = &padapter->mppriv;
|
||||
struct pkt_attrib *pattrib = &(pmp_priv->tx.attrib);
|
||||
u8 *ptxdesc = pmp_priv->tx.desc;
|
||||
|
||||
SET_TX_DESC_BK_8710B(ptxdesc, 1);
|
||||
SET_TX_DESC_MACID_8710B(ptxdesc, pattrib->mac_id);
|
||||
SET_TX_DESC_QUEUE_SEL_8710B(ptxdesc, pattrib->qsel);
|
||||
|
||||
SET_TX_DESC_RATE_ID_8710B(ptxdesc, pattrib->raid);
|
||||
SET_TX_DESC_SEQ_8710B(ptxdesc, pattrib->seqnum);
|
||||
SET_TX_DESC_HWSEQ_EN_8710B(ptxdesc, 1);
|
||||
SET_TX_DESC_USE_RATE_8710B(ptxdesc, 1);
|
||||
SET_TX_DESC_DISABLE_FB_8710B(ptxdesc, 1);
|
||||
|
||||
if (pmp_priv->preamble) {
|
||||
if (HwRateToMPTRate(pmp_priv->rateidx) <= MPT_RATE_54M)
|
||||
SET_TX_DESC_DATA_SHORT_8710B(ptxdesc, 1);
|
||||
}
|
||||
|
||||
if (pmp_priv->bandwidth == CHANNEL_WIDTH_40)
|
||||
SET_TX_DESC_DATA_BW_8710B(ptxdesc, 1);
|
||||
|
||||
SET_TX_DESC_TX_RATE_8710B(ptxdesc, pmp_priv->rateidx);
|
||||
|
||||
SET_TX_DESC_DATA_RATE_FB_LIMIT_8710B(ptxdesc, 0x1F);
|
||||
SET_TX_DESC_RTS_RATE_FB_LIMIT_8710B(ptxdesc, 0xF);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
void fill_tx_desc_8192f(PADAPTER padapter)
|
||||
{
|
||||
struct mp_priv *pmp_priv = &padapter->mppriv;
|
||||
struct pkt_attrib *pattrib = &(pmp_priv->tx.attrib);
|
||||
u8 *ptxdesc = pmp_priv->tx.desc;
|
||||
|
||||
SET_TX_DESC_BK_8192F(ptxdesc, 1);
|
||||
SET_TX_DESC_MACID_8192F(ptxdesc, pattrib->mac_id);
|
||||
SET_TX_DESC_QUEUE_SEL_8192F(ptxdesc, pattrib->qsel);
|
||||
|
||||
SET_TX_DESC_RATE_ID_8192F(ptxdesc, pattrib->raid);
|
||||
SET_TX_DESC_SEQ_8192F(ptxdesc, pattrib->seqnum);
|
||||
SET_TX_DESC_HWSEQ_EN_8192F(ptxdesc, 1);
|
||||
SET_TX_DESC_USE_RATE_8192F(ptxdesc, 1);
|
||||
SET_TX_DESC_DISABLE_FB_8192F(ptxdesc, 1);
|
||||
|
||||
if (pmp_priv->preamble) {
|
||||
if (HwRateToMPTRate(pmp_priv->rateidx) <= MPT_RATE_54M)
|
||||
SET_TX_DESC_DATA_SHORT_8192F(ptxdesc, 1);
|
||||
}
|
||||
|
||||
if (pmp_priv->bandwidth == CHANNEL_WIDTH_40)
|
||||
SET_TX_DESC_DATA_BW_8192F(ptxdesc, 1);
|
||||
|
||||
SET_TX_DESC_TX_RATE_8192F(ptxdesc, pmp_priv->rateidx);
|
||||
|
||||
SET_TX_DESC_DATA_RATE_FB_LIMIT_8192F(ptxdesc, 0x1F);
|
||||
SET_TX_DESC_RTS_RATE_FB_LIMIT_8192F(ptxdesc, 0xF);
|
||||
}
|
||||
|
||||
#endif
|
||||
static void Rtw_MPSetMacTxEDCA(PADAPTER padapter)
|
||||
{
|
||||
|
||||
@@ -1790,8 +1928,8 @@ static void Rtw_MPSetMacTxEDCA(PADAPTER padapter)
|
||||
|
||||
void SetPacketTx(PADAPTER padapter)
|
||||
{
|
||||
u8 *ptr, *pkt_start, *pkt_end, *fctrl;
|
||||
u32 pkt_size, offset, startPlace, i;
|
||||
u8 *ptr, *pkt_start, *pkt_end;
|
||||
u32 pkt_size, i;
|
||||
struct rtw_ieee80211_hdr *hdr;
|
||||
u8 payload;
|
||||
s32 bmcast;
|
||||
@@ -1812,7 +1950,7 @@ void SetPacketTx(PADAPTER padapter)
|
||||
_rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
|
||||
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
|
||||
bmcast = IS_MCAST(pattrib->ra);
|
||||
if (bmcast)
|
||||
if (bmcast)
|
||||
pattrib->psta = rtw_get_bcmc_stainfo(padapter);
|
||||
else
|
||||
pattrib->psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(&padapter->mlmepriv));
|
||||
@@ -1885,10 +2023,24 @@ void SetPacketTx(PADAPTER padapter)
|
||||
fill_tx_desc_8188f(padapter);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8188GTV)
|
||||
if (IS_HARDWARE_TYPE_8188GTV(padapter))
|
||||
fill_tx_desc_8188gtv(padapter);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8723D)
|
||||
if (IS_HARDWARE_TYPE_8723D(padapter))
|
||||
fill_tx_desc_8723d(padapter);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192F)
|
||||
if (IS_HARDWARE_TYPE_8192F(padapter))
|
||||
fill_tx_desc_8192f(padapter);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8710B)
|
||||
if (IS_HARDWARE_TYPE_8710B(padapter))
|
||||
fill_tx_desc_8710b(padapter);
|
||||
#endif
|
||||
|
||||
/* 3 4. make wlan header, make_wlanhdr() */
|
||||
hdr = (struct rtw_ieee80211_hdr *)pkt_start;
|
||||
@@ -1984,6 +2136,7 @@ void SetPacketRx(PADAPTER pAdapter, u8 bStartRx, u8 bAB)
|
||||
write_bbreg(pAdapter, 0x550, BIT3, bEnable);
|
||||
#endif
|
||||
rtw_write16(pAdapter, REG_RXFLTMAP0, 0xFFEF); /* REG_RXFLTMAP0 (RX Filter Map Group 0) */
|
||||
pmppriv->brx_filter_beacon = _TRUE;
|
||||
|
||||
} else {
|
||||
pHalData->ReceiveConfig |= RCR_ADF;
|
||||
@@ -2053,6 +2206,167 @@ u32 GetPhyRxPktCRC32Error(PADAPTER pAdapter)
|
||||
return OFDM_cnt + CCK_cnt + HT_cnt;
|
||||
}
|
||||
|
||||
struct psd_init_regs {
|
||||
/* 3 wire */
|
||||
int reg_88c;
|
||||
int reg_c00;
|
||||
int reg_e00;
|
||||
int reg_1800;
|
||||
int reg_1a00;
|
||||
/* cck */
|
||||
int reg_800;
|
||||
int reg_808;
|
||||
};
|
||||
|
||||
static int rtw_mp_psd_init(PADAPTER padapter, struct psd_init_regs *regs)
|
||||
{
|
||||
HAL_DATA_TYPE *phal_data = GET_HAL_DATA(padapter);
|
||||
|
||||
switch (phal_data->rf_type) {
|
||||
/* 1R */
|
||||
case RF_1T1R:
|
||||
if (hal_chk_proto_cap(padapter, PROTO_CAP_11AC)) {
|
||||
/* 11AC 1R PSD Setting 3wire & cck off */
|
||||
regs->reg_c00 = rtw_read32(padapter, 0xC00);
|
||||
phy_set_bb_reg(padapter, 0xC00, 0x3, 0x00);
|
||||
regs->reg_808 = rtw_read32(padapter, 0x808);
|
||||
phy_set_bb_reg(padapter, 0x808, 0x10000000, 0x0);
|
||||
} else {
|
||||
/* 11N 3-wire off 1 */
|
||||
regs->reg_88c = rtw_read32(padapter, 0x88C);
|
||||
phy_set_bb_reg(padapter, 0x88C, 0x300000, 0x3);
|
||||
/* 11N CCK off */
|
||||
regs->reg_800 = rtw_read32(padapter, 0x800);
|
||||
phy_set_bb_reg(padapter, 0x800, 0x1000000, 0x0);
|
||||
}
|
||||
break;
|
||||
|
||||
/* 2R */
|
||||
case RF_1T2R:
|
||||
case RF_2T2R:
|
||||
if (hal_chk_proto_cap(padapter, PROTO_CAP_11AC)) {
|
||||
/* 11AC 2R PSD Setting 3wire & cck off */
|
||||
regs->reg_c00 = rtw_read32(padapter, 0xC00);
|
||||
regs->reg_e00 = rtw_read32(padapter, 0xE00);
|
||||
phy_set_bb_reg(padapter, 0xC00, 0x3, 0x00);
|
||||
phy_set_bb_reg(padapter, 0xE00, 0x3, 0x00);
|
||||
regs->reg_808 = rtw_read32(padapter, 0x808);
|
||||
phy_set_bb_reg(padapter, 0x808, 0x10000000, 0x0);
|
||||
} else {
|
||||
/* 11N 3-wire off 2 */
|
||||
regs->reg_88c = rtw_read32(padapter, 0x88C);
|
||||
phy_set_bb_reg(padapter, 0x88C, 0xF00000, 0xF);
|
||||
/* 11N CCK off */
|
||||
regs->reg_800 = rtw_read32(padapter, 0x800);
|
||||
phy_set_bb_reg(padapter, 0x800, 0x1000000, 0x0);
|
||||
}
|
||||
break;
|
||||
|
||||
/* 3R */
|
||||
case RF_2T3R:
|
||||
case RF_3T3R:
|
||||
if (hal_chk_proto_cap(padapter, PROTO_CAP_11AC)) {
|
||||
/* 11AC 3R PSD Setting 3wire & cck off */
|
||||
regs->reg_c00 = rtw_read32(padapter, 0xC00);
|
||||
regs->reg_e00 = rtw_read32(padapter, 0xE00);
|
||||
regs->reg_1800 = rtw_read32(padapter, 0x1800);
|
||||
phy_set_bb_reg(padapter, 0xC00, 0x3, 0x00);
|
||||
phy_set_bb_reg(padapter, 0xE00, 0x3, 0x00);
|
||||
phy_set_bb_reg(padapter, 0x1800, 0x3, 0x00);
|
||||
regs->reg_808 = rtw_read32(padapter, 0x808);
|
||||
phy_set_bb_reg(padapter, 0x808, 0x10000000, 0x0);
|
||||
} else {
|
||||
RTW_ERR("%s: 11n don't support 3R\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
/* 4R */
|
||||
case RF_2T4R:
|
||||
case RF_3T4R:
|
||||
case RF_4T4R:
|
||||
if (hal_chk_proto_cap(padapter, PROTO_CAP_11AC)) {
|
||||
/* 11AC 4R PSD Setting 3wire & cck off */
|
||||
regs->reg_c00 = rtw_read32(padapter, 0xC00);
|
||||
regs->reg_e00 = rtw_read32(padapter, 0xE00);
|
||||
regs->reg_1800 = rtw_read32(padapter, 0x1800);
|
||||
regs->reg_1a00 = rtw_read32(padapter, 0x1A00);
|
||||
phy_set_bb_reg(padapter, 0xC00, 0x3, 0x00);
|
||||
phy_set_bb_reg(padapter, 0xE00, 0x3, 0x00);
|
||||
phy_set_bb_reg(padapter, 0x1800, 0x3, 0x00);
|
||||
phy_set_bb_reg(padapter, 0x1A00, 0x3, 0x00);
|
||||
regs->reg_808 = rtw_read32(padapter, 0x808);
|
||||
phy_set_bb_reg(padapter, 0x808, 0x10000000, 0x0);
|
||||
} else {
|
||||
RTW_ERR("%s: 11n don't support 4R\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
RTW_ERR("%s: unknown %d rf type\n", __func__, phal_data->rf_type);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Set PSD points, 0=128, 1=256, 2=512, 3=1024 */
|
||||
if (hal_chk_proto_cap(padapter, PROTO_CAP_11AC))
|
||||
phy_set_bb_reg(padapter, 0x910, 0xC000, 3);
|
||||
else
|
||||
phy_set_bb_reg(padapter, 0x808, 0xC000, 3);
|
||||
|
||||
RTW_INFO("%s: set %d rf type done\n", __func__, phal_data->rf_type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtw_mp_psd_close(PADAPTER padapter, struct psd_init_regs *regs)
|
||||
{
|
||||
HAL_DATA_TYPE *phal_data = GET_HAL_DATA(padapter);
|
||||
|
||||
|
||||
if (!hal_chk_proto_cap(padapter, PROTO_CAP_11AC)) {
|
||||
/* 11n 3wire restore */
|
||||
rtw_write32(padapter, 0x88C, regs->reg_88c);
|
||||
/* 11n cck restore */
|
||||
rtw_write32(padapter, 0x800, regs->reg_800);
|
||||
RTW_INFO("%s: restore %d rf type\n", __func__, phal_data->rf_type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 11ac 3wire restore */
|
||||
switch (phal_data->rf_type) {
|
||||
case RF_1T1R:
|
||||
rtw_write32(padapter, 0xC00, regs->reg_c00);
|
||||
break;
|
||||
case RF_1T2R:
|
||||
case RF_2T2R:
|
||||
rtw_write32(padapter, 0xC00, regs->reg_c00);
|
||||
rtw_write32(padapter, 0xE00, regs->reg_e00);
|
||||
break;
|
||||
case RF_2T3R:
|
||||
case RF_3T3R:
|
||||
rtw_write32(padapter, 0xC00, regs->reg_c00);
|
||||
rtw_write32(padapter, 0xE00, regs->reg_e00);
|
||||
rtw_write32(padapter, 0x1800, regs->reg_1800);
|
||||
break;
|
||||
case RF_2T4R:
|
||||
case RF_3T4R:
|
||||
case RF_4T4R:
|
||||
rtw_write32(padapter, 0xC00, regs->reg_c00);
|
||||
rtw_write32(padapter, 0xE00, regs->reg_e00);
|
||||
rtw_write32(padapter, 0x1800, regs->reg_1800);
|
||||
rtw_write32(padapter, 0x1A00, regs->reg_1a00);
|
||||
break;
|
||||
default:
|
||||
RTW_WARN("%s: unknown %d rf type\n", __func__, phal_data->rf_type);
|
||||
break;
|
||||
}
|
||||
|
||||
/* 11ac cck restore */
|
||||
rtw_write32(padapter, 0x808, regs->reg_808);
|
||||
RTW_INFO("%s: restore %d rf type done\n", __func__, phal_data->rf_type);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* reg 0x808[9:0]: FFT data x
|
||||
* reg 0x808[22]: 0 --> 1 to get 1 FFT data y
|
||||
* reg 0x8B4[15:0]: FFT data y report */
|
||||
@@ -2102,7 +2416,8 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data)
|
||||
{
|
||||
u32 i, psd_pts = 0, psd_start = 0, psd_stop = 0;
|
||||
u32 psd_data = 0;
|
||||
|
||||
struct psd_init_regs regs = {};
|
||||
int psd_analysis = 0;
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
if (!netif_running(pAdapter->pnetdev)) {
|
||||
@@ -2118,6 +2433,11 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data)
|
||||
psd_pts = 128;
|
||||
psd_start = 64;
|
||||
psd_stop = 128;
|
||||
} else if (strncmp(data, "analysis,", 9) == 0) {
|
||||
if (rtw_mp_psd_init(pAdapter, ®s) != 0)
|
||||
return 0;
|
||||
psd_analysis = 1;
|
||||
sscanf(data + 9, "pts=%d,start=%d,stop=%d", &psd_pts, &psd_start, &psd_stop);
|
||||
} else
|
||||
sscanf(data, "pts=%d,start=%d,stop=%d", &psd_pts, &psd_start, &psd_stop);
|
||||
|
||||
@@ -2139,6 +2459,9 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data)
|
||||
rtw_mdelay_os(100);
|
||||
#endif
|
||||
|
||||
if (psd_analysis)
|
||||
rtw_mp_psd_close(pAdapter, ®s);
|
||||
|
||||
return strlen(data) + 1;
|
||||
}
|
||||
|
||||
@@ -2735,7 +3058,6 @@ ULONG mpt_ProQueryCalTxPower(
|
||||
PMPT_CONTEXT pMptCtx = &(pAdapter->mppriv.mpt_ctx);
|
||||
|
||||
ULONG TxPower = 1;
|
||||
u1Byte rate = 0;
|
||||
struct txpwr_idx_comp tic;
|
||||
u8 mgn_rate = mpt_to_mgnt_rate(pMptCtx->mpt_rate_index);
|
||||
|
||||
@@ -2746,10 +3068,14 @@ ULONG mpt_ProQueryCalTxPower(
|
||||
, TxPower, tic.base, (tic.by_rate > tic.limit ? tic.limit : tic.by_rate), tic.by_rate, tic.limit, tic.tpt, tic.ebias);
|
||||
|
||||
pAdapter->mppriv.txpoweridx = (u8)TxPower;
|
||||
pMptCtx->TxPwrLevel[RF_PATH_A] = (u8)TxPower;
|
||||
pMptCtx->TxPwrLevel[RF_PATH_B] = (u8)TxPower;
|
||||
pMptCtx->TxPwrLevel[RF_PATH_C] = (u8)TxPower;
|
||||
pMptCtx->TxPwrLevel[RF_PATH_D] = (u8)TxPower;
|
||||
if (RfPath == RF_PATH_A)
|
||||
pMptCtx->TxPwrLevel[RF_PATH_A] = (u8)TxPower;
|
||||
else if (RfPath == RF_PATH_B)
|
||||
pMptCtx->TxPwrLevel[RF_PATH_B] = (u8)TxPower;
|
||||
else if (RfPath == RF_PATH_C)
|
||||
pMptCtx->TxPwrLevel[RF_PATH_C] = (u8)TxPower;
|
||||
else if (RfPath == RF_PATH_D)
|
||||
pMptCtx->TxPwrLevel[RF_PATH_D] = (u8)TxPower;
|
||||
hal_mpt_SetTxPower(pAdapter);
|
||||
|
||||
return TxPower;
|
||||
|
||||
@@ -103,43 +103,16 @@ void rtw_odm_adaptivity_mode_msg(void *sel, _adapter *adapter)
|
||||
_RTW_PRINT_SEL(sel, "INVALID\n");
|
||||
}
|
||||
|
||||
#define RTW_ADAPTIVITY_DML_DISABLE 0
|
||||
#define RTW_ADAPTIVITY_DML_ENABLE 1
|
||||
|
||||
void rtw_odm_adaptivity_dml_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct registry_priv *regsty = &adapter->registrypriv;
|
||||
|
||||
RTW_PRINT_SEL(sel, "RTW_ADAPTIVITY_DML_");
|
||||
|
||||
if (regsty->adaptivity_dml == RTW_ADAPTIVITY_DML_DISABLE)
|
||||
_RTW_PRINT_SEL(sel, "DISABLE\n");
|
||||
else if (regsty->adaptivity_dml == RTW_ADAPTIVITY_DML_ENABLE)
|
||||
_RTW_PRINT_SEL(sel, "ENABLE\n");
|
||||
else
|
||||
_RTW_PRINT_SEL(sel, "INVALID\n");
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_dc_backoff_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct registry_priv *regsty = &adapter->registrypriv;
|
||||
|
||||
RTW_PRINT_SEL(sel, "RTW_ADAPTIVITY_DC_BACKOFF:%u\n", regsty->adaptivity_dc_backoff);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_config_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
rtw_odm_adaptivity_ver_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_en_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_mode_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_dml_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_dc_backoff_msg(sel, adapter);
|
||||
}
|
||||
|
||||
bool rtw_odm_adaptivity_needed(_adapter *adapter)
|
||||
{
|
||||
struct registry_priv *regsty = &adapter->registrypriv;
|
||||
struct mlme_priv *mlme = &adapter->mlmepriv;
|
||||
bool ret = _FALSE;
|
||||
|
||||
if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_ENABLE)
|
||||
@@ -154,32 +127,20 @@ void rtw_odm_adaptivity_parm_msg(void *sel, _adapter *adapter)
|
||||
|
||||
rtw_odm_adaptivity_config_msg(sel, adapter);
|
||||
|
||||
RTW_PRINT_SEL(sel, "%10s %16s %16s %22s %12s\n"
|
||||
, "th_l2h_ini", "th_edcca_hl_diff", "th_l2h_ini_mode2", "th_edcca_hl_diff_mode2", "edcca_enable");
|
||||
RTW_PRINT_SEL(sel, "0x%-8x %-16d 0x%-14x %-22d %-12d\n"
|
||||
RTW_PRINT_SEL(sel, "%10s %16s\n"
|
||||
, "th_l2h_ini", "th_edcca_hl_diff");
|
||||
RTW_PRINT_SEL(sel, "0x%-8x %-16d\n"
|
||||
, (u8)odm->th_l2h_ini
|
||||
, odm->th_edcca_hl_diff
|
||||
, (u8)odm->th_l2h_ini_mode2
|
||||
, odm->th_edcca_hl_diff_mode2
|
||||
, odm->edcca_enable
|
||||
);
|
||||
|
||||
RTW_PRINT_SEL(sel, "%15s %9s\n", "AdapEnableState", "Adap_Flag");
|
||||
RTW_PRINT_SEL(sel, "%-15x %-9x\n"
|
||||
, odm->adaptivity_enable
|
||||
, odm->adaptivity_flag
|
||||
);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 th_l2h_ini, s8 th_edcca_hl_diff, s8 th_l2h_ini_mode2, s8 th_edcca_hl_diff_mode2, u8 edcca_enable)
|
||||
void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 th_l2h_ini, s8 th_edcca_hl_diff)
|
||||
{
|
||||
struct dm_struct *odm = adapter_to_phydm(adapter);
|
||||
|
||||
odm->th_l2h_ini = th_l2h_ini;
|
||||
odm->th_edcca_hl_diff = th_edcca_hl_diff;
|
||||
odm->th_l2h_ini_mode2 = th_l2h_ini_mode2;
|
||||
odm->th_edcca_hl_diff_mode2 = th_edcca_hl_diff_mode2;
|
||||
odm->edcca_enable = edcca_enable;
|
||||
}
|
||||
|
||||
void rtw_odm_get_perpkt_rssi(void *sel, _adapter *adapter)
|
||||
@@ -217,10 +178,10 @@ void rtw_odm_releasespinlock(_adapter *adapter, enum rt_spinlock_type type)
|
||||
}
|
||||
}
|
||||
|
||||
inline u8 rtw_odm_get_dfs_domain(_adapter *adapter)
|
||||
inline u8 rtw_odm_get_dfs_domain(struct dvobj_priv *dvobj)
|
||||
{
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
struct dm_struct *pDM_Odm = adapter_to_phydm(adapter);
|
||||
struct dm_struct *pDM_Odm = dvobj_to_phydm(dvobj);
|
||||
|
||||
return pDM_Odm->dfs_region_domain;
|
||||
#else
|
||||
@@ -228,10 +189,10 @@ inline u8 rtw_odm_get_dfs_domain(_adapter *adapter)
|
||||
#endif
|
||||
}
|
||||
|
||||
inline u8 rtw_odm_dfs_domain_unknown(_adapter *adapter)
|
||||
inline u8 rtw_odm_dfs_domain_unknown(struct dvobj_priv *dvobj)
|
||||
{
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
return rtw_odm_get_dfs_domain(adapter) == PHYDM_DFS_DOMAIN_UNKNOWN;
|
||||
return rtw_odm_get_dfs_domain(dvobj) == PHYDM_DFS_DOMAIN_UNKNOWN;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
@@ -258,6 +219,11 @@ inline BOOLEAN rtw_odm_radar_detect(_adapter *adapter)
|
||||
{
|
||||
return phydm_radar_detect(adapter_to_phydm(adapter));
|
||||
}
|
||||
|
||||
inline u8 rtw_odm_radar_detect_polling_int_ms(struct dvobj_priv *dvobj)
|
||||
{
|
||||
return phydm_dfs_polling_time(dvobj_to_phydm(dvobj));
|
||||
}
|
||||
#endif /* CONFIG_DFS_MASTER */
|
||||
|
||||
void rtw_odm_parse_rx_phy_status_chinfo(union recv_frame *rframe, u8 *phys)
|
||||
@@ -301,7 +267,7 @@ void rtw_odm_parse_rx_phy_status_chinfo(union recv_frame *rframe, u8 *phys)
|
||||
*/
|
||||
|
||||
if ((*phys & 0xf) == 0) {
|
||||
struct phy_status_rpt_jaguar2_type0 *phys_t0 = (struct phy_status_rpt_jaguar2_type0 *)phys;
|
||||
struct phy_sts_rpt_jgr2_type0 *phys_t0 = (struct phy_sts_rpt_jgr2_type0 *)phys;
|
||||
|
||||
if (DBG_RX_PHYSTATUS_CHINFO) {
|
||||
RTW_PRINT("phys_t%u ta="MAC_FMT" %s, %s(band:%u, ch:%u, l_rxsc:%u)\n"
|
||||
@@ -314,7 +280,7 @@ void rtw_odm_parse_rx_phy_status_chinfo(union recv_frame *rframe, u8 *phys)
|
||||
}
|
||||
|
||||
} else if ((*phys & 0xf) == 1) {
|
||||
struct phy_status_rpt_jaguar2_type1 *phys_t1 = (struct phy_status_rpt_jaguar2_type1 *)phys;
|
||||
struct phy_sts_rpt_jgr2_type1 *phys_t1 = (struct phy_sts_rpt_jgr2_type1 *)phys;
|
||||
u8 rxsc = (attrib->data_rate > DESC_RATE11M && attrib->data_rate < DESC_RATEMCS0) ? phys_t1->l_rxsc : phys_t1->ht_rxsc;
|
||||
u8 pkt_cch = 0;
|
||||
u8 pkt_bw = CHANNEL_WIDTH_20;
|
||||
@@ -435,7 +401,7 @@ type1_end:
|
||||
attrib->ch = pkt_cch;
|
||||
|
||||
} else {
|
||||
struct phy_status_rpt_jaguar2_type2 *phys_t2 = (struct phy_status_rpt_jaguar2_type2 *)phys;
|
||||
struct phy_sts_rpt_jgr2_type2 *phys_t2 = (struct phy_sts_rpt_jgr2_type2 *)phys;
|
||||
|
||||
if (DBG_RX_PHYSTATUS_CHINFO) {
|
||||
RTW_PRINT("phys_t%u ta="MAC_FMT" %s, %s(band:%u, ch:%u, l_rxsc:%u, ht_rxsc:%u)\n"
|
||||
|
||||
@@ -290,7 +290,6 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr,
|
||||
unsigned short *fctrl;
|
||||
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
|
||||
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
|
||||
@@ -2807,8 +2806,6 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
|
||||
u8 attr_content = 0x00;
|
||||
u32 attr_contentlen = 0;
|
||||
u8 operatingch_info[5] = { 0x00 };
|
||||
uint ch_cnt = 0;
|
||||
u8 ch_content[100] = { 0x00 };
|
||||
u8 groupid[38];
|
||||
u16 cap_attr;
|
||||
u8 peer_ch_list[100] = { 0x00 };
|
||||
@@ -2974,7 +2971,9 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
|
||||
|
||||
u8 process_p2p_group_negotation_confirm(struct wifidirect_info *pwdinfo, u8 *pframe, uint len)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_adapter *padapter = pwdinfo->padapter;
|
||||
#endif
|
||||
u8 *ies;
|
||||
u32 ies_len;
|
||||
u8 *p2p_ie;
|
||||
@@ -3097,8 +3096,6 @@ void p2p_concurrent_handler(_adapter *padapter);
|
||||
void restore_p2p_state_handler(_adapter *padapter)
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL))
|
||||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DEVICE);
|
||||
@@ -3295,16 +3292,15 @@ u8 roch_stay_in_cur_chan(_adapter *padapter)
|
||||
if (iface) {
|
||||
pmlmepriv = &iface->mlmepriv;
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING | WIFI_UNDER_WPS) == _TRUE) {
|
||||
RTW_ERR(ADPT_FMT"- _FW_UNDER_LINKING |WIFI_UNDER_WPS (mlme state:0x%x)\n",
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING | WIFI_UNDER_WPS | WIFI_UNDER_KEY_HANDSHAKE) == _TRUE) {
|
||||
RTW_INFO(ADPT_FMT"- _FW_UNDER_LINKING |WIFI_UNDER_WPS | WIFI_UNDER_KEY_HANDSHAKE (mlme state:0x%x)\n",
|
||||
ADPT_ARG(iface), get_fwstate(&iface->mlmepriv));
|
||||
rst = _TRUE;
|
||||
break;
|
||||
}
|
||||
#ifdef CONFIG_AP_MODE
|
||||
if (MLME_IS_AP(iface) || MLME_IS_MESH(iface)) {
|
||||
if (rtw_ap_sta_linking_state_check(iface) == _TRUE) {
|
||||
RTW_ERR(ADPT_FMT"- SoftAP/Mesh -have sta under linking\n", ADPT_ARG(iface));
|
||||
if (rtw_ap_sta_states_check(iface) == _TRUE) {
|
||||
rst = _TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -3322,8 +3318,12 @@ static int ro_ch_handler(_adapter *adapter, u8 *buf)
|
||||
struct p2p_roch_parm *roch_parm = (struct p2p_roch_parm *)buf;
|
||||
struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(adapter);
|
||||
struct cfg80211_wifidirect_info *pcfg80211_wdinfo = &adapter->cfg80211_wdinfo;
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
#ifdef RTW_ROCH_BACK_OP
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
#endif
|
||||
#endif
|
||||
u8 ready_on_channel = _FALSE;
|
||||
u8 remain_ch;
|
||||
unsigned int duration;
|
||||
@@ -3442,6 +3442,7 @@ static int cancel_ro_ch_handler(_adapter *padapter, u8 *buf)
|
||||
|
||||
#if defined(RTW_ROCH_BACK_OP) && defined(CONFIG_CONCURRENT_MODE)
|
||||
_cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer);
|
||||
ATOMIC_SET(&pwdev_priv->switch_ch_to, 1);
|
||||
#endif
|
||||
|
||||
if (rtw_mi_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) {
|
||||
@@ -3503,6 +3504,7 @@ static void ro_ch_timer_process(void *FunctionContext)
|
||||
p2p_cancel_roch_cmd(adapter, 0, NULL, 0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void rtw_change_p2pie_op_ch(_adapter *padapter, const u8 *frame_body, u32 len, u8 ch)
|
||||
{
|
||||
u8 *ies, *p2p_ie;
|
||||
@@ -3533,7 +3535,9 @@ static void rtw_change_p2pie_op_ch(_adapter *padapter, const u8 *frame_body, u32
|
||||
p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, ies_len - (p2p_ie - ies + p2p_ielen), NULL, &p2p_ielen);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
|
||||
static void rtw_change_p2pie_ch_list(_adapter *padapter, const u8 *frame_body, u32 len, u8 ch)
|
||||
{
|
||||
u8 *ies, *p2p_ie;
|
||||
@@ -3577,11 +3581,12 @@ static void rtw_change_p2pie_ch_list(_adapter *padapter, const u8 *frame_body, u
|
||||
p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, ies_len - (p2p_ie - ies + p2p_ielen), NULL, &p2p_ielen);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
|
||||
static bool rtw_chk_p2pie_ch_list_with_buddy(_adapter *padapter, const u8 *frame_body, u32 len)
|
||||
{
|
||||
bool fit = _FALSE;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 *ies, *p2p_ie;
|
||||
u32 ies_len, p2p_ielen;
|
||||
u8 union_ch = rtw_mi_get_union_chan(padapter);
|
||||
@@ -3623,14 +3628,14 @@ static bool rtw_chk_p2pie_ch_list_with_buddy(_adapter *padapter, const u8 *frame
|
||||
/* 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;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_P2P_INVITE_IOT)
|
||||
static bool rtw_chk_p2pie_op_ch_with_buddy(_adapter *padapter, const u8 *frame_body, u32 len)
|
||||
{
|
||||
bool fit = _FALSE;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 *ies, *p2p_ie;
|
||||
u32 ies_len, p2p_ielen;
|
||||
u8 union_ch = rtw_mi_get_union_chan(padapter);
|
||||
@@ -3659,13 +3664,13 @@ static bool rtw_chk_p2pie_op_ch_with_buddy(_adapter *padapter, const u8 *frame_b
|
||||
/* 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;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *frame_body, u32 len)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 *ies, *p2p_ie;
|
||||
u32 ies_len, p2p_ielen;
|
||||
u8 union_ch = rtw_mi_get_union_chan(padapter);
|
||||
@@ -3728,8 +3733,8 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
|
||||
@@ -3813,8 +3818,6 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
|
||||
bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe)
|
||||
{
|
||||
#define DBG_XFRAME_DEL_WFD_IE 0
|
||||
|
||||
_adapter *adapter = xframe->padapter;
|
||||
u8 *frame = xframe->buf_addr + TXDESC_OFFSET;
|
||||
u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
u8 *frame_tail = frame + xframe->attrib.pktlen;
|
||||
@@ -3861,12 +3864,9 @@ bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe)
|
||||
void rtw_xframe_chk_wfd_ie(struct xmit_frame *xframe)
|
||||
{
|
||||
_adapter *adapter = xframe->padapter;
|
||||
u8 *frame = xframe->buf_addr + TXDESC_OFFSET;
|
||||
u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
u8 *frame_tail = frame + xframe->attrib.pktlen;
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
struct wifidirect_info *wdinfo = &adapter->wdinfo;
|
||||
struct mlme_priv *mlme = &adapter->mlmepriv;
|
||||
#endif
|
||||
u8 build = 0;
|
||||
u8 del = 0;
|
||||
|
||||
@@ -3874,7 +3874,7 @@ void rtw_xframe_chk_wfd_ie(struct xmit_frame *xframe)
|
||||
del = 1;
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
if (_TRUE == wdinfo->wfd_info->wfd_enable)
|
||||
if (wdinfo->wfd_info->wfd_enable == _TRUE)
|
||||
#endif
|
||||
del = build = 1;
|
||||
|
||||
@@ -3894,7 +3894,6 @@ u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_len)
|
||||
int w_sz = 0;
|
||||
u8 ch_cnt = 0;
|
||||
u8 ch_list[40];
|
||||
bool continuous = _FALSE;
|
||||
|
||||
pattr = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, &attr_contentlen);
|
||||
if (pattr != NULL) {
|
||||
@@ -4353,7 +4352,6 @@ void rtw_init_cfg80211_wifidirect_info(_adapter *padapter)
|
||||
s32 p2p_protocol_wk_hdl(_adapter *padapter, int intCmdType, u8 *buf)
|
||||
{
|
||||
int ret = H2C_SUCCESS;
|
||||
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
|
||||
|
||||
switch (intCmdType) {
|
||||
case P2P_FIND_PHASE_WK:
|
||||
@@ -4430,7 +4428,6 @@ int process_p2p_cross_connect_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
|
||||
u8 p2p_attr[MAX_P2P_IE_LEN] = { 0x00 };/* NoA length should be n*(13) + 2 */
|
||||
u32 attr_contentlen = 0;
|
||||
|
||||
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
|
||||
|
||||
|
||||
if (IELength <= _BEACON_IE_OFFSET_)
|
||||
@@ -4553,7 +4550,6 @@ void p2p_ps_wk_hdl(_adapter *padapter, u8 p2p_ps_state)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
u32 ps_deny = 0;
|
||||
|
||||
/* Pre action for p2p state */
|
||||
@@ -4731,7 +4727,6 @@ static void pre_tx_scan_timer_process(void *FunctionContext)
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
_irqL irqL;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
u8 _status = 0;
|
||||
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return;
|
||||
@@ -5045,7 +5040,6 @@ void init_wifidirect_info(_adapter *padapter, enum P2P_ROLE role)
|
||||
#ifdef CONFIG_WFD
|
||||
struct wifi_display_info *pwfd_info = &padapter->wfd_info;
|
||||
#endif
|
||||
u8 union_ch = 0;
|
||||
pwdinfo = &padapter->wdinfo;
|
||||
|
||||
pwdinfo->padapter = padapter;
|
||||
@@ -5060,6 +5054,8 @@ void init_wifidirect_info(_adapter *padapter, enum P2P_ROLE role)
|
||||
&& pwdinfo->driver_interface != DRIVER_CFG80211
|
||||
) {
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 union_ch = 0;
|
||||
|
||||
if (rtw_mi_check_status(padapter, MI_LINKED))
|
||||
union_ch = rtw_mi_get_union_chan(padapter);
|
||||
|
||||
@@ -5195,6 +5191,14 @@ void init_wifidirect_info(_adapter *padapter, enum P2P_ROLE role)
|
||||
pwdinfo->p2p_info.scan_op_ch_only = 0;
|
||||
}
|
||||
|
||||
void _rtw_p2p_set_role(struct wifidirect_info *wdinfo, enum P2P_ROLE role)
|
||||
{
|
||||
if (wdinfo->role != role) {
|
||||
wdinfo->role = role;
|
||||
rtw_mi_update_iface_status(&(wdinfo->padapter->mlmepriv), 0);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DBG_P2P
|
||||
|
||||
/**
|
||||
@@ -5343,9 +5347,6 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role)
|
||||
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
|
||||
|
||||
if (role == P2P_ROLE_DEVICE || role == P2P_ROLE_CLIENT || role == P2P_ROLE_GO) {
|
||||
u8 channel, ch_offset;
|
||||
u16 bwmode;
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE) && (!defined(RTW_P2P_GROUP_INTERFACE) || !RTW_P2P_GROUP_INTERFACE)
|
||||
/* Commented by Albert 2011/12/30 */
|
||||
/* The driver just supports 1 P2P group operation. */
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
#include <hal_data.h>
|
||||
#include <hal_com_h2c.h>
|
||||
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
int rtw_fw_ps_state(PADAPTER padapter)
|
||||
{
|
||||
struct dvobj_priv *psdpriv = padapter->dvobj;
|
||||
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
|
||||
int ret = _FAIL, dont_care = 0;
|
||||
u16 fw_ps_state = 0;
|
||||
u32 start_time;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct registry_priv *registry_par = &padapter->registrypriv;
|
||||
|
||||
@@ -40,6 +40,15 @@ int rtw_fw_ps_state(PADAPTER padapter)
|
||||
, rtw_is_drv_stopped(padapter) ? "True" : "False");
|
||||
goto exit_fw_ps_state;
|
||||
}
|
||||
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C)
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_FW_PS_STATE, (u8 *)&fw_ps_state);
|
||||
if ((fw_ps_state & BIT_LPS_STATUS) == 0)
|
||||
ret = _SUCCESS;
|
||||
else {
|
||||
pdbgpriv->dbg_poll_fail_cnt++;
|
||||
RTW_INFO("%s: fw_ps_state=%04x\n", __FUNCTION__, fw_ps_state);
|
||||
}
|
||||
#else
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SET_REQ_FW_PS, (u8 *)&dont_care);
|
||||
{
|
||||
/* 4. if 0x88[7]=1, driver set cmd to leave LPS/IPS. */
|
||||
@@ -58,13 +67,13 @@ int rtw_fw_ps_state(PADAPTER padapter)
|
||||
RTW_INFO("%s: fw_ps_state=%04x\n", __FUNCTION__, fw_ps_state);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
exit_fw_ps_state:
|
||||
_exit_pwrlock(&pwrpriv->check_32k_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /*DBG_CHECK_FW_PS_STATE*/
|
||||
#ifdef CONFIG_IPS
|
||||
void _ips_enter(_adapter *padapter)
|
||||
{
|
||||
@@ -144,8 +153,10 @@ int _ips_leave(_adapter *padapter)
|
||||
int ips_leave(_adapter *padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
struct dvobj_priv *psdpriv = padapter->dvobj;
|
||||
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
if (!is_primary_adapter(padapter))
|
||||
@@ -263,9 +274,6 @@ exit:
|
||||
*/
|
||||
void rtw_ps_processor(_adapter *padapter)
|
||||
{
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
|
||||
#endif /* CONFIG_P2P */
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct dvobj_priv *psdpriv = padapter->dvobj;
|
||||
@@ -398,9 +406,69 @@ void pwr_state_check_handler(void *ctx)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
#ifdef CONFIG_CHECK_LEAVE_LPS
|
||||
#ifdef CONFIG_LPS_CHK_BY_TP
|
||||
void traffic_check_for_leave_lps_by_tp(PADAPTER padapter, u8 tx, struct sta_info *sta)
|
||||
{
|
||||
struct stainfo_stats *pstats = &sta->sta_stats;
|
||||
u64 cur_acc_tx_bytes = 0, cur_acc_rx_bytes = 0;
|
||||
u32 tx_tp_kbyte = 0, rx_tp_kbyte = 0;
|
||||
u32 tx_tp_th = 0, rx_tp_th = 0;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
u8 leave_lps = _FALSE;
|
||||
|
||||
if (tx) { /* from tx */
|
||||
cur_acc_tx_bytes = pstats->tx_bytes - pstats->acc_tx_bytes;
|
||||
tx_tp_kbyte = cur_acc_tx_bytes >> 10;
|
||||
tx_tp_th = pwrpriv->lps_tx_tp_th * 1024 / 8 * 2; /*KBytes @2s*/
|
||||
|
||||
if (tx_tp_kbyte >= tx_tp_th ||
|
||||
padapter->mlmepriv.LinkDetectInfo.NumTxOkInPeriod >= pwrpriv->lps_tx_pkts){
|
||||
if (pwrpriv->bLeisurePs
|
||||
&& (pwrpriv->pwr_mode != PS_MODE_ACTIVE)
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
&& (rtw_btcoex_IsBtControlLps(padapter) == _FALSE)
|
||||
#endif
|
||||
) {
|
||||
leave_lps = _TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
} else { /* from rx path */
|
||||
cur_acc_rx_bytes = pstats->rx_bytes - pstats->acc_rx_bytes;
|
||||
rx_tp_kbyte = cur_acc_rx_bytes >> 10;
|
||||
rx_tp_th = pwrpriv->lps_rx_tp_th * 1024 / 8 * 2;
|
||||
|
||||
if (rx_tp_kbyte>= rx_tp_th ||
|
||||
padapter->mlmepriv.LinkDetectInfo.NumRxUnicastOkInPeriod >= pwrpriv->lps_rx_pkts) {
|
||||
if (pwrpriv->bLeisurePs
|
||||
&& (pwrpriv->pwr_mode != PS_MODE_ACTIVE)
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
&& (rtw_btcoex_IsBtControlLps(padapter) == _FALSE)
|
||||
#endif
|
||||
) {
|
||||
leave_lps = _TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (leave_lps) {
|
||||
#ifdef DBG_LPS_CHK_BY_TP
|
||||
RTW_INFO("leave lps via %s, ", tx ? "Tx" : "Rx");
|
||||
if (tx)
|
||||
RTW_INFO("Tx = %d [%d] (KB)\n", tx_tp_kbyte, tx_tp_th);
|
||||
else
|
||||
RTW_INFO("Rx = %d [%d] (KB)\n", rx_tp_kbyte, rx_tp_th);
|
||||
#endif
|
||||
pwrpriv->lps_chk_cnt = pwrpriv->lps_chk_cnt_th;
|
||||
/* rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1); */
|
||||
rtw_lps_ctrl_wk_cmd(padapter, tx ? LPS_CTRL_TX_TRAFFIC_LEAVE : LPS_CTRL_RX_TRAFFIC_LEAVE, 1);
|
||||
}
|
||||
}
|
||||
#endif /*CONFIG_LPS_CHK_BY_TP*/
|
||||
|
||||
void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets)
|
||||
{
|
||||
#ifdef CONFIG_CHECK_LEAVE_LPS
|
||||
static systime start_time = 0;
|
||||
static u32 xmit_cnt = 0;
|
||||
u8 bLeaveLPS = _FALSE;
|
||||
@@ -450,62 +518,76 @@ void traffic_check_for_leave_lps(PADAPTER padapter, u8 tx, u32 tx_packets)
|
||||
/* rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1); */
|
||||
rtw_lps_ctrl_wk_cmd(padapter, tx ? LPS_CTRL_TX_TRAFFIC_LEAVE : LPS_CTRL_RX_TRAFFIC_LEAVE, tx ? 0 : 1);
|
||||
}
|
||||
#endif /* CONFIG_CHECK_LEAVE_LPS */
|
||||
}
|
||||
#endif /* CONFIG_CHECK_LEAVE_LPS */
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
u8 rtw_cpwm_polling(_adapter *adapter, u8 cpwm_orig)
|
||||
#define LPS_CPWM_TIMEOUT_MS 10 /*ms*/
|
||||
#define LPS_RPWM_RETRY_CNT 3
|
||||
|
||||
u8 rtw_cpwm_polling(_adapter *adapter, u8 rpwm, u8 cpwm_orig)
|
||||
{
|
||||
u8 result = _FAIL;
|
||||
u8 cpwm_now;
|
||||
u8 poll_cnt = 0;
|
||||
u8 rst = _FAIL;
|
||||
u8 cpwm_now = 0;
|
||||
systime start_time;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(adapter);
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
struct debug_priv *pdbgpriv = &(adapter_to_dvobj(adapter)->drv_dbg);
|
||||
#endif
|
||||
|
||||
/*RTW_INFO("%s.....\n", __func__);*/
|
||||
pwrpriv->rpwm_retry = 0;
|
||||
|
||||
start_time = rtw_get_current_time();
|
||||
|
||||
/* polling cpwm */
|
||||
do {
|
||||
rtw_msleep_os(1);
|
||||
poll_cnt++;
|
||||
cpwm_now = 0;
|
||||
rtw_hal_get_hwreg(adapter, HW_VAR_CPWM, &cpwm_now);
|
||||
start_time = rtw_get_current_time();
|
||||
do {
|
||||
rtw_msleep_os(1);
|
||||
rtw_hal_get_hwreg(adapter, HW_VAR_CPWM, &cpwm_now);
|
||||
|
||||
if ((cpwm_orig ^ cpwm_now) & 0x80) {
|
||||
pwrpriv->cpwm = PS_STATE_S4;
|
||||
pwrpriv->cpwm_tog = cpwm_now & PS_TOGGLE;
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
RTW_INFO("%s: polling cpwm OK! poll_cnt=%d, cpwm_orig=%02x, cpwm_now=%02x , 0x100=0x%x\n"
|
||||
, __func__, poll_cnt, cpwm_orig, cpwm_now, rtw_read8(adapter, REG_CR));
|
||||
if (rtw_fw_ps_state(adapter) == _FAIL) {
|
||||
RTW_INFO("leave 32k but fw state in 32k\n");
|
||||
pdbgpriv->dbg_rpwm_toogle_cnt++;
|
||||
if ((cpwm_orig ^ cpwm_now) & 0x80) {
|
||||
pwrpriv->cpwm = PS_STATE_S4;
|
||||
pwrpriv->cpwm_tog = cpwm_now & PS_TOGGLE;
|
||||
rst = _SUCCESS;
|
||||
break;
|
||||
}
|
||||
#endif /* DBG_CHECK_FW_PS_STATE */
|
||||
result = _SUCCESS;
|
||||
break;
|
||||
}
|
||||
} while (rtw_get_passing_time_ms(start_time) < LPS_CPWM_TIMEOUT_MS && !RTW_CANNOT_RUN(adapter));
|
||||
|
||||
if (rtw_get_passing_time_ms(start_time) > LPS_RPWM_WAIT_MS) {
|
||||
RTW_ERR("%s: polling cpwm timeout! poll_cnt=%d, cpwm_orig=%02x, cpwm_now=%02x\n"
|
||||
, __func__, poll_cnt, cpwm_orig, cpwm_now);
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
if (rtw_fw_ps_state(adapter) == _FAIL) {
|
||||
RTW_INFO("rpwm timeout and fw ps state in 32k\n");
|
||||
pdbgpriv->dbg_rpwm_timeout_fail_cnt++;
|
||||
}
|
||||
#endif /* DBG_CHECK_FW_PS_STATE */
|
||||
|
||||
#ifdef CONFIG_LPS_RPWM_TIMER
|
||||
_set_timer(&pwrpriv->pwr_rpwm_timer, 1);
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
if (rst == _SUCCESS)
|
||||
break;
|
||||
else {
|
||||
/* rpwm retry */
|
||||
cpwm_orig = cpwm_now;
|
||||
rpwm &= ~PS_TOGGLE;
|
||||
rpwm |= pwrpriv->tog;
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_SET_RPWM, (u8 *)(&rpwm));
|
||||
pwrpriv->tog += 0x80;
|
||||
}
|
||||
} while (1);
|
||||
return result;
|
||||
} while (pwrpriv->rpwm_retry++ < LPS_RPWM_RETRY_CNT && !RTW_CANNOT_RUN(adapter));
|
||||
|
||||
if (rst == _SUCCESS) {
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
RTW_INFO("%s: polling cpwm OK! rpwm_retry=%d, cpwm_orig=%02x, cpwm_now=%02x , 0x100=0x%x\n"
|
||||
, __func__, pwrpriv->rpwm_retry, cpwm_orig, cpwm_now, rtw_read8(adapter, REG_CR));
|
||||
if (rtw_fw_ps_state(adapter) == _FAIL) {
|
||||
RTW_INFO("leave 32k but fw state in 32k\n");
|
||||
pdbgpriv->dbg_rpwm_toogle_cnt++;
|
||||
}
|
||||
#endif /* DBG_CHECK_FW_PS_STATE */
|
||||
} else {
|
||||
RTW_ERR("%s: polling cpwm timeout! rpwm_retry=%d, cpwm_orig=%02x, cpwm_now=%02x\n"
|
||||
, __func__, pwrpriv->rpwm_retry, cpwm_orig, cpwm_now);
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
if (rtw_fw_ps_state(adapter) == _FAIL) {
|
||||
RTW_INFO("rpwm timeout and fw ps state in 32k\n");
|
||||
pdbgpriv->dbg_rpwm_timeout_fail_cnt++;
|
||||
}
|
||||
#endif /* DBG_CHECK_FW_PS_STATE */
|
||||
|
||||
#ifdef CONFIG_LPS_RPWM_TIMER
|
||||
_set_timer(&pwrpriv->pwr_rpwm_timer, 1);
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER */
|
||||
}
|
||||
|
||||
return rst;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
@@ -517,15 +599,13 @@ u8 rtw_cpwm_polling(_adapter *adapter, u8 cpwm_orig)
|
||||
* pslv power state level, only could be PS_STATE_S0 ~ PS_STATE_S4
|
||||
*
|
||||
*/
|
||||
void rtw_set_rpwm(PADAPTER padapter, u8 pslv)
|
||||
u8 rtw_set_rpwm(PADAPTER padapter, u8 pslv)
|
||||
{
|
||||
u8 rpwm;
|
||||
u8 rpwm = 0xFF;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
u8 cpwm_orig;
|
||||
#endif
|
||||
struct dvobj_priv *psdpriv = padapter->dvobj;
|
||||
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
|
||||
|
||||
pslv = PS_STATE(pslv);
|
||||
|
||||
@@ -541,7 +621,7 @@ void rtw_set_rpwm(PADAPTER padapter, u8 pslv)
|
||||
#endif
|
||||
|| (pwrpriv->lps_level == LPS_NORMAL)
|
||||
) {
|
||||
return;
|
||||
return rpwm;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -550,12 +630,12 @@ void rtw_set_rpwm(PADAPTER padapter, u8 pslv)
|
||||
|
||||
pwrpriv->cpwm = PS_STATE_S4;
|
||||
|
||||
return;
|
||||
return rpwm;
|
||||
}
|
||||
|
||||
if (rtw_is_drv_stopped(padapter))
|
||||
if (pslv < PS_STATE_S2)
|
||||
return;
|
||||
return rpwm;
|
||||
|
||||
rpwm = pslv | pwrpriv->tog;
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
@@ -573,9 +653,16 @@ void rtw_set_rpwm(PADAPTER padapter, u8 pslv)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_LPS_RPWM_TIMER) && !defined(CONFIG_DETECT_CPWM_BY_POLLING)
|
||||
if (rpwm & PS_ACK)
|
||||
_set_timer(&pwrpriv->pwr_rpwm_timer, LPS_RPWM_WAIT_MS);
|
||||
if (rpwm & PS_ACK) {
|
||||
#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) || defined(CONFIG_P2P_WOWLAN)
|
||||
if (pwrpriv->wowlan_mode != _TRUE &&
|
||||
pwrpriv->wowlan_ap_mode != _TRUE &&
|
||||
pwrpriv->wowlan_p2p_mode != _TRUE)
|
||||
#endif
|
||||
_set_timer(&pwrpriv->pwr_rpwm_timer, LPS_CPWM_TIMEOUT_MS);
|
||||
}
|
||||
#endif /* CONFIG_LPS_RPWM_TIMER & !CONFIG_DETECT_CPWM_BY_POLLING */
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SET_RPWM, (u8 *)(&rpwm));
|
||||
|
||||
pwrpriv->tog += 0x80;
|
||||
@@ -583,14 +670,14 @@ void rtw_set_rpwm(PADAPTER padapter, u8 pslv)
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
/* No LPS 32K, No Ack */
|
||||
if (rpwm & PS_ACK) {
|
||||
#ifdef CONFIG_DETECT_CPWM_BY_POLLING
|
||||
rtw_cpwm_polling(padapter, cpwm_orig);
|
||||
#ifdef CONFIG_DETECT_CPWM_BY_POLLING
|
||||
rtw_cpwm_polling(padapter, rpwm, cpwm_orig);
|
||||
#else
|
||||
#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) || defined(CONFIG_P2P_WOWLAN)
|
||||
if (pwrpriv->wowlan_mode == _TRUE ||
|
||||
pwrpriv->wowlan_ap_mode == _TRUE ||
|
||||
pwrpriv->wowlan_p2p_mode == _TRUE)
|
||||
rtw_cpwm_polling(padapter, cpwm_orig);
|
||||
rtw_cpwm_polling(padapter, rpwm, cpwm_orig);
|
||||
#endif /*#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) || defined(CONFIG_P2P_WOWLAN)*/
|
||||
#endif /*#ifdef CONFIG_DETECT_CPWM_BY_POLLING*/
|
||||
} else
|
||||
@@ -599,6 +686,7 @@ void rtw_set_rpwm(PADAPTER padapter, u8 pslv)
|
||||
pwrpriv->cpwm = pslv;
|
||||
}
|
||||
|
||||
return rpwm;
|
||||
}
|
||||
|
||||
u8 PS_RDY_CHECK(_adapter *padapter)
|
||||
@@ -606,12 +694,6 @@ u8 PS_RDY_CHECK(_adapter *padapter)
|
||||
u32 delta_ms;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
struct cfg80211_wifidirect_info *pcfg80211_wdinfo = &padapter->cfg80211_wdinfo;
|
||||
#endif /* CONFIG_IOCTL_CFG80211 */
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
|
||||
if (_TRUE == pwrpriv->bInSuspend && pwrpriv->wowlan_mode)
|
||||
@@ -642,6 +724,9 @@ u8 PS_RDY_CHECK(_adapter *padapter)
|
||||
/* TDLS link is established. */
|
||||
|| (padapter->tdlsinfo.link_established == _TRUE)
|
||||
#endif /* CONFIG_TDLS */
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
|| adapter_to_rfctl(padapter)->radar_detect_enabled
|
||||
#endif
|
||||
)
|
||||
return _FALSE;
|
||||
|
||||
@@ -777,9 +862,14 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
||||
void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode, const char *msg)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) || defined(CONFIG_P2P_WOWLAN)
|
||||
struct dvobj_priv *psdpriv = padapter->dvobj;
|
||||
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
|
||||
#endif
|
||||
#ifdef CONFIG_WMMPS_STA
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
#endif
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
|
||||
#endif /* CONFIG_P2P */
|
||||
@@ -907,11 +997,18 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_LPS_PG_HANDLE, (u8 *)(&lps_pg_hdl_id));
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if (pwrpriv->wowlan_mode == _TRUE)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_INACTIVE_IPS, (u8 *)(&ps_mode));
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode));
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_LPS_STATE_CHK, (u8 *)(&ps_mode));
|
||||
|
||||
|
||||
#ifdef CONFIG_LPS_PG
|
||||
if (pwrpriv->lps_level == LPS_PG) {
|
||||
lps_pg_hdl_id = LPS_PG_RESEND_H2C;
|
||||
lps_pg_hdl_id = LPS_PG_PHYDM_EN;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_LPS_PG_HANDLE, (u8 *)(&lps_pg_hdl_id));
|
||||
}
|
||||
#endif
|
||||
@@ -936,6 +1033,9 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode
|
||||
#ifdef CONFIG_P2P_WOWLAN
|
||||
|| (_TRUE == pwrpriv->wowlan_p2p_mode)
|
||||
#endif /* CONFIG_P2P_WOWLAN */
|
||||
#ifdef CONFIG_WOWLAN
|
||||
|| WOWLAN_IS_STA_MIX_MODE(padapter)
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
) {
|
||||
u8 pslv;
|
||||
|
||||
@@ -974,12 +1074,24 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode
|
||||
pwrpriv->pwr_mode = ps_mode;
|
||||
pwrpriv->smart_ps = smart_ps;
|
||||
pwrpriv->bcn_ant_mode = bcn_ant_mode;
|
||||
#ifdef CONFIG_LPS_PG
|
||||
if (pwrpriv->lps_level == LPS_PG) {
|
||||
lps_pg_hdl_id = LPS_PG_PHYDM_DIS;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_LPS_PG_HANDLE, (u8 *)(&lps_pg_hdl_id));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WMMPS_STA
|
||||
pwrpriv->wmm_smart_ps = pregistrypriv->wmm_smart_ps;
|
||||
#endif /* CONFIG_WMMPS_STA */
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode));
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode));
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if (pwrpriv->wowlan_mode == _TRUE)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_INACTIVE_IPS, (u8 *)(&ps_mode));
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
/* Set CTWindow after LPS */
|
||||
@@ -1015,42 +1127,6 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Return:
|
||||
* 0: Leave OK
|
||||
* -1: Timeout
|
||||
* -2: Other error
|
||||
*/
|
||||
s32 LPS_RF_ON_check(PADAPTER padapter, u32 delay_ms)
|
||||
{
|
||||
systime start_time;
|
||||
u8 bAwake = _FALSE;
|
||||
s32 err = 0;
|
||||
|
||||
|
||||
start_time = rtw_get_current_time();
|
||||
while (1) {
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_FWLPS_RF_ON, &bAwake);
|
||||
if (_TRUE == bAwake)
|
||||
break;
|
||||
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
err = -2;
|
||||
RTW_INFO("%s: device surprise removed!!\n", __FUNCTION__);
|
||||
break;
|
||||
}
|
||||
|
||||
if (rtw_get_passing_time_ms(start_time) > delay_ms) {
|
||||
err = -1;
|
||||
RTW_INFO("%s: Wait for FW LPS leave more than %u ms!!!\n", __FUNCTION__, delay_ms);
|
||||
break;
|
||||
}
|
||||
rtw_usleep_os(100);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Description:
|
||||
* Enter the leisure power save mode.
|
||||
@@ -1059,11 +1135,11 @@ void LPS_Enter(PADAPTER padapter, const char *msg)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
||||
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
int n_assoc_iface = 0;
|
||||
int i;
|
||||
char buf[32] = {0};
|
||||
|
||||
#ifdef DBG_LA_MODE
|
||||
struct registry_priv *registry_par = &(padapter->registrypriv);
|
||||
#endif
|
||||
|
||||
/* RTW_INFO("+LeisurePSEnter\n"); */
|
||||
if (GET_HAL_DATA(padapter)->bFWReady == _FALSE)
|
||||
@@ -1074,12 +1150,14 @@ void LPS_Enter(PADAPTER padapter, const char *msg)
|
||||
return;
|
||||
#endif
|
||||
|
||||
/* Skip lps enter request if number of assocated adapters is not 1 */
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
if (check_fwstate(&(dvobj->padapters[i]->mlmepriv), WIFI_ASOC_STATE))
|
||||
n_assoc_iface++;
|
||||
#ifdef DBG_LA_MODE
|
||||
if(registry_par->la_mode_en == 1) {
|
||||
RTW_INFO("%s LA debug mode lps_leave \n", __func__);
|
||||
return;
|
||||
}
|
||||
if (n_assoc_iface != 1)
|
||||
#endif
|
||||
/* Skip lps enter request if number of assocated adapters is not 1 */
|
||||
if (rtw_mi_get_assoc_if_num(padapter) != 1)
|
||||
return;
|
||||
|
||||
#ifndef CONFIG_FW_MULTI_PORT_SUPPORT
|
||||
@@ -1093,6 +1171,14 @@ void LPS_Enter(PADAPTER padapter, const char *msg)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CLIENT_PORT_CFG
|
||||
if ((rtw_hal_get_port(padapter) == CLT_PORT_INVALID) ||
|
||||
get_clt_num(padapter) > MAX_CLIENT_PORT_NUM){
|
||||
RTW_ERR(ADPT_FMT" cannot get client port or clt num(%d) over than 4\n", ADPT_ARG(padapter), get_clt_num(padapter));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
if (padapter->wdinfo.p2p_ps_mode == P2P_PS_NOA) {
|
||||
return;/* supporting p2p client ps NOA via H2C_8723B_P2P_PS_OFFLOAD */
|
||||
@@ -1136,10 +1222,10 @@ void LPS_Leave(PADAPTER padapter, const char *msg)
|
||||
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
||||
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj);
|
||||
u32 start_time;
|
||||
u8 bAwake = _FALSE;
|
||||
char buf[32] = {0};
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
struct debug_priv *pdbgpriv = &dvobj->drv_dbg;
|
||||
#endif
|
||||
|
||||
|
||||
/* RTW_INFO("+LeisurePSLeave\n"); */
|
||||
@@ -1163,9 +1249,6 @@ void LPS_Leave(PADAPTER padapter, const char *msg)
|
||||
#ifdef CONFIG_RTW_CFGVEDNOR_LLSTATS
|
||||
pwrpriv->pwr_saving_time += rtw_get_passing_time_ms(pwrpriv->pwr_saving_start_time);
|
||||
#endif /* CONFIG_RTW_CFGVEDNOR_LLSTATS */
|
||||
|
||||
if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
LPS_RF_ON_check(padapter, LPS_LEAVE_TIMEOUT_MS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1198,15 +1281,13 @@ void rtw_wow_lps_level_decide(_adapter *adapter, u8 wow_en)
|
||||
void LeaveAllPowerSaveModeDirect(PADAPTER Adapter)
|
||||
{
|
||||
PADAPTER pri_padapter = GET_PRIMARY_ADAPTER(Adapter);
|
||||
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(Adapter);
|
||||
struct dvobj_priv *psdpriv = Adapter->dvobj;
|
||||
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
#ifndef CONFIG_DETECT_CPWM_BY_POLLING
|
||||
u8 cpwm_orig, cpwm_now;
|
||||
systime start_time;
|
||||
u8 cpwm_orig;
|
||||
#endif /* CONFIG_DETECT_CPWM_BY_POLLING */
|
||||
|
||||
u8 rpwm;
|
||||
#endif
|
||||
|
||||
RTW_INFO("%s.....\n", __FUNCTION__);
|
||||
|
||||
@@ -1229,46 +1310,15 @@ void LeaveAllPowerSaveModeDirect(PADAPTER Adapter)
|
||||
cpwm_orig = 0;
|
||||
rtw_hal_get_hwreg(Adapter, HW_VAR_CPWM, &cpwm_orig);
|
||||
#endif /* CONFIG_DETECT_CPWM_BY_POLLING */
|
||||
rtw_set_rpwm(Adapter, PS_STATE_S4);
|
||||
rpwm = rtw_set_rpwm(Adapter, PS_STATE_S4);
|
||||
|
||||
#ifndef CONFIG_DETECT_CPWM_BY_POLLING
|
||||
|
||||
start_time = rtw_get_current_time();
|
||||
|
||||
/* polling cpwm */
|
||||
do {
|
||||
rtw_mdelay_os(1);
|
||||
|
||||
rtw_hal_get_hwreg(Adapter, HW_VAR_CPWM, &cpwm_now);
|
||||
if ((cpwm_orig ^ cpwm_now) & 0x80) {
|
||||
pwrpriv->cpwm = PS_STATE_S4;
|
||||
pwrpriv->cpwm_tog = cpwm_now & PS_TOGGLE;
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
RTW_INFO("%s: polling cpwm OK! cpwm_orig=%02x, cpwm_now=%02x, 0x100=0x%x\n"
|
||||
, __FUNCTION__, cpwm_orig, cpwm_now, rtw_read8(Adapter, REG_CR));
|
||||
if (rtw_fw_ps_state(Adapter) == _FAIL) {
|
||||
RTW_INFO("%s: leave 32k but fw state in 32k\n", __FUNCTION__);
|
||||
pdbgpriv->dbg_rpwm_toogle_cnt++;
|
||||
}
|
||||
#endif /* DBG_CHECK_FW_PS_STATE */
|
||||
break;
|
||||
}
|
||||
|
||||
if (rtw_get_passing_time_ms(start_time) > LPS_RPWM_WAIT_MS) {
|
||||
RTW_INFO("%s: polling cpwm timeout! cpwm_orig=%02x, cpwm_now=%02x\n", __FUNCTION__, cpwm_orig, cpwm_now);
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
if (rtw_fw_ps_state(Adapter) == _FAIL) {
|
||||
RTW_INFO("rpwm timeout and fw ps state in 32k\n");
|
||||
pdbgpriv->dbg_rpwm_timeout_fail_cnt++;
|
||||
}
|
||||
#endif /* DBG_CHECK_FW_PS_STATE */
|
||||
break;
|
||||
}
|
||||
} while (1);
|
||||
if (rpwm != 0xFF && rpwm & PS_ACK)
|
||||
rtw_cpwm_polling(Adapter, rpwm, cpwm_orig);
|
||||
#endif /* CONFIG_DETECT_CPWM_BY_POLLING */
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
#endif
|
||||
#endif/*CONFIG_LPS_LCLK*/
|
||||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
p2p_ps_wk_cmd(pri_padapter, P2P_PS_DISABLE, 0);
|
||||
@@ -1308,31 +1358,25 @@ void LeaveAllPowerSaveModeDirect(PADAPTER Adapter)
|
||||
void LeaveAllPowerSaveMode(IN PADAPTER Adapter)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(Adapter);
|
||||
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
|
||||
u8 enqueue = 0;
|
||||
int n_assoc_iface = 0;
|
||||
int i;
|
||||
|
||||
|
||||
/* RTW_INFO("%s.....\n",__FUNCTION__); */
|
||||
|
||||
#ifndef CONFIG_NEW_NETDEV_HDL
|
||||
if (_FALSE == Adapter->bup) {
|
||||
RTW_INFO(FUNC_ADPT_FMT ": bup=%d Skip!\n",
|
||||
FUNC_ADPT_ARG(Adapter), Adapter->bup);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* RTW_INFO(FUNC_ADPT_FMT "\n", FUNC_ADPT_ARG(Adapter));*/
|
||||
|
||||
if (rtw_is_surprise_removed(Adapter)) {
|
||||
RTW_INFO(FUNC_ADPT_FMT ": bSurpriseRemoved=_TRUE Skip!\n", FUNC_ADPT_ARG(Adapter));
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
if (check_fwstate(&(dvobj->padapters[i]->mlmepriv), WIFI_ASOC_STATE))
|
||||
n_assoc_iface++;
|
||||
}
|
||||
|
||||
if (n_assoc_iface) {
|
||||
if (rtw_mi_get_assoc_if_num(Adapter)) {
|
||||
/* connect */
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
enqueue = 1;
|
||||
@@ -1413,7 +1457,7 @@ void LPS_Leave_check(
|
||||
break;
|
||||
|
||||
if (rtw_get_passing_time_ms(start_time) > 100) {
|
||||
RTW_INFO("Wait for cpwm event than 100 ms!!!\n");
|
||||
RTW_ERR("Wait for cpwm event than 100 ms!!!\n");
|
||||
break;
|
||||
}
|
||||
rtw_msleep_os(1);
|
||||
@@ -1509,6 +1553,9 @@ static void rtw_cpwm_chk_fail_debug(_adapter *padapter)
|
||||
|
||||
RTW_INFO("[PS-DBG] Reg_10FC =0x%08x\n", cpu_state);
|
||||
RTW_INFO("[PS-DBG] Reg_10F8 =0x%08x\n", rtw_read32(padapter, 0x10F8));
|
||||
RTW_INFO("[PS-DBG] Reg_11F8 =0x%08x\n", rtw_read32(padapter, 0x11F8));
|
||||
RTW_INFO("[PS-DBG] Reg_4A4 =0x%08x\n", rtw_read32(padapter, 0x4A4));
|
||||
RTW_INFO("[PS-DBG] Reg_4A8 =0x%08x\n", rtw_read32(padapter, 0x4A8));
|
||||
|
||||
if (cpu_state == CPU_EXCEPTION_CODE) {
|
||||
RTW_INFO("[PS-DBG] Reg_48C =0x%08x\n", rtw_read32(padapter, 0x48C));
|
||||
@@ -1518,6 +1565,14 @@ static void rtw_cpwm_chk_fail_debug(_adapter *padapter)
|
||||
RTW_INFO("[PS-DBG] Reg_49C =0x%08x\n", rtw_read32(padapter, 0x49C));
|
||||
RTW_INFO("[PS-DBG] Reg_4A0 =0x%08x\n", rtw_read32(padapter, 0x4A0));
|
||||
RTW_INFO("[PS-DBG] Reg_1BC =0x%08x\n", rtw_read32(padapter, 0x1BC));
|
||||
|
||||
RTW_INFO("[PS-DBG] Reg_008 =0x%08x\n", rtw_read32(padapter, 0x08));
|
||||
RTW_INFO("[PS-DBG] Reg_2F0 =0x%08x\n", rtw_read32(padapter, 0x2F0));
|
||||
RTW_INFO("[PS-DBG] Reg_2F4 =0x%08x\n", rtw_read32(padapter, 0x2F4));
|
||||
RTW_INFO("[PS-DBG] Reg_2F8 =0x%08x\n", rtw_read32(padapter, 0x2F8));
|
||||
RTW_INFO("[PS-DBG] Reg_2FC =0x%08x\n", rtw_read32(padapter, 0x2FC));
|
||||
|
||||
rtw_dump_fifo(RTW_DBGDUMP, padapter, 5, 0, 3072);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1543,6 +1598,18 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work)
|
||||
RTW_INFO("%s: rpwm=0x%02X cpwm=0x%02X CPWM done!\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (pwrpriv->rpwm_retry++ < LPS_RPWM_RETRY_CNT) {
|
||||
u8 rpwm = (pwrpriv->rpwm | pwrpriv->tog | PS_ACK);
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SET_RPWM, (u8 *)(&rpwm));
|
||||
|
||||
pwrpriv->tog += 0x80;
|
||||
_set_timer(&pwrpriv->pwr_rpwm_timer, LPS_CPWM_TIMEOUT_MS);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pwrpriv->rpwm_retry = 0;
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
#if defined(DBG_CPWM_CHK_FAIL) && (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C))
|
||||
@@ -2030,9 +2097,12 @@ void rtw_unregister_evt_alive(PADAPTER padapter)
|
||||
void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
|
||||
#ifdef CONFIG_WOWLAN
|
||||
struct registry_priv *registry_par = &padapter->registrypriv;
|
||||
|
||||
#endif
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
u8 val8 = 0;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (!is_primary_adapter(padapter))
|
||||
@@ -2052,6 +2122,15 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
pwrctrlpriv->lps_enter_cnts = 0;
|
||||
pwrctrlpriv->lps_leave_cnts = 0;
|
||||
pwrctrlpriv->bips_processing = _FALSE;
|
||||
#ifdef CONFIG_LPS_CHK_BY_TP
|
||||
pwrctrlpriv->lps_chk_by_tp = padapter->registrypriv.lps_chk_by_tp;
|
||||
pwrctrlpriv->lps_tx_tp_th = LPS_TX_TP_TH;
|
||||
pwrctrlpriv->lps_rx_tp_th = LPS_RX_TP_TH;
|
||||
pwrctrlpriv->lps_bi_tp_th = LPS_BI_TP_TH;
|
||||
pwrctrlpriv->lps_chk_cnt = pwrctrlpriv->lps_chk_cnt_th = LPS_TP_CHK_CNT;
|
||||
pwrctrlpriv->lps_tx_pkts = LPS_CHK_PKTS_TX;
|
||||
pwrctrlpriv->lps_rx_pkts = LPS_CHK_PKTS_RX;
|
||||
#endif
|
||||
|
||||
pwrctrlpriv->ips_mode = padapter->registrypriv.ips_mode;
|
||||
pwrctrlpriv->ips_mode_req = padapter->registrypriv.ips_mode;
|
||||
@@ -2096,6 +2175,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
pwrctrlpriv->dtim = 0;
|
||||
|
||||
pwrctrlpriv->tog = 0x80;
|
||||
pwrctrlpriv->rpwm_retry = 0;
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SET_RPWM, (u8 *)(&pwrctrlpriv->rpwm));
|
||||
@@ -2131,8 +2211,12 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
/*default low active*/
|
||||
pwrctrlpriv->is_high_active = HIGH_ACTIVE;
|
||||
|
||||
pwrctrlpriv->is_high_active = HIGH_ACTIVE_DEV2HST;
|
||||
pwrctrlpriv->hst2dev_high_active = HIGH_ACTIVE_HST2DEV;
|
||||
#ifdef CONFIG_RTW_ONE_PIN_GPIO
|
||||
rtw_hal_switch_gpio_wl_ctrl(padapter, WAKEUP_GPIO_IDX, _TRUE);
|
||||
rtw_hal_set_input_gpio(padapter, WAKEUP_GPIO_IDX);
|
||||
#else
|
||||
#ifdef CONFIG_WAKEUP_GPIO_INPUT_MODE
|
||||
if (pwrctrlpriv->is_high_active == 0)
|
||||
rtw_hal_set_input_gpio(padapter, WAKEUP_GPIO_IDX);
|
||||
@@ -2140,11 +2224,11 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
rtw_hal_set_output_gpio(padapter, WAKEUP_GPIO_IDX, 0);
|
||||
#else
|
||||
val8 = (pwrctrlpriv->is_high_active == 0) ? 1 : 0;
|
||||
rtw_hal_switch_gpio_wl_ctrl(padapter, WAKEUP_GPIO_IDX, _TRUE);
|
||||
rtw_hal_set_output_gpio(padapter, WAKEUP_GPIO_IDX, val8);
|
||||
RTW_INFO("%s: set GPIO_%d %d as default.\n",
|
||||
__func__, WAKEUP_GPIO_IDX, val8);
|
||||
#endif /*CONFIG_WAKEUP_GPIO_INPUT_MODE*/
|
||||
#endif /* CONFIG_RTW_ONE_PIN_GPIO */
|
||||
#endif /* CONFIG_GPIO_WAKEUP */
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
@@ -2412,9 +2496,9 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
||||
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj);
|
||||
struct mlme_priv *pmlmepriv;
|
||||
int ret = _SUCCESS;
|
||||
int i;
|
||||
systime start = rtw_get_current_time();
|
||||
|
||||
/*RTW_INFO(FUNC_ADPT_FMT "===>\n", FUNC_ADPT_ARG(padapter));*/
|
||||
/* for LPS */
|
||||
LeaveAllPowerSaveMode(padapter);
|
||||
|
||||
@@ -2550,6 +2634,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
||||
exit:
|
||||
if (rtw_time_after(rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms), pwrpriv->ips_deny_time))
|
||||
pwrpriv->ips_deny_time = rtw_get_current_time() + rtw_ms_to_systime(ips_deffer_ms);
|
||||
/*RTW_INFO(FUNC_ADPT_FMT "<===\n", FUNC_ADPT_ARG(padapter));*/
|
||||
return ret;
|
||||
|
||||
}
|
||||
@@ -2612,8 +2697,6 @@ int rtw_pm_set_ips(_adapter *padapter, u8 mode)
|
||||
void rtw_ps_deny(PADAPTER padapter, PS_DENY_REASON reason)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
s32 ret;
|
||||
|
||||
|
||||
/* RTW_INFO("+" FUNC_ADPT_FMT ": Request PS deny for %d (0x%08X)\n",
|
||||
* FUNC_ADPT_ARG(padapter), reason, BIT(reason)); */
|
||||
@@ -2672,3 +2755,38 @@ u32 rtw_ps_deny_get(PADAPTER padapter)
|
||||
|
||||
return deny;
|
||||
}
|
||||
|
||||
static void _rtw_ssmps(_adapter *adapter, struct sta_info *sta)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if (MLME_IS_STA(adapter)) {
|
||||
issue_action_SM_PS_wait_ack(adapter , get_my_bssid(&(pmlmeinfo->network)),
|
||||
sta->cmn.sm_ps, 3 , 1);
|
||||
}
|
||||
else if (MLME_IS_AP(adapter)) {
|
||||
|
||||
}
|
||||
rtw_phydm_ra_registed(adapter, sta);
|
||||
}
|
||||
void rtw_ssmps_enter(_adapter *adapter, struct sta_info *sta)
|
||||
{
|
||||
if (sta->cmn.sm_ps == SM_PS_STATIC)
|
||||
return;
|
||||
|
||||
RTW_INFO(ADPT_FMT" STA [" MAC_FMT "]\n", ADPT_ARG(adapter), MAC_ARG(sta->cmn.mac_addr));
|
||||
|
||||
sta->cmn.sm_ps = SM_PS_STATIC;
|
||||
_rtw_ssmps(adapter, sta);
|
||||
}
|
||||
void rtw_ssmps_leave(_adapter *adapter, struct sta_info *sta)
|
||||
{
|
||||
if (sta->cmn.sm_ps == SM_PS_DISABLE)
|
||||
return;
|
||||
|
||||
RTW_INFO(ADPT_FMT" STA [" MAC_FMT "] \n", ADPT_ARG(adapter), MAC_ARG(sta->cmn.mac_addr));
|
||||
sta->cmn.sm_ps = SM_PS_DISABLE;
|
||||
_rtw_ssmps(adapter, sta);
|
||||
}
|
||||
|
||||
|
||||
239
core/rtw_recv.c
239
core/rtw_recv.c
@@ -44,6 +44,17 @@ u8 signal_stat_calc_profile[SIGNAL_STAT_CALC_PROFILE_MAX][2] = {
|
||||
|
||||
#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
|
||||
|
||||
u8 rtw_bridge_tunnel_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
|
||||
u8 rtw_rfc1042_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
|
||||
static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37};
|
||||
static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};
|
||||
#ifdef CONFIG_TDLS
|
||||
static u8 SNAP_ETH_TYPE_TDLS[2] = {0x89, 0x0d};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe);
|
||||
#endif
|
||||
void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
|
||||
{
|
||||
|
||||
@@ -814,12 +825,10 @@ sint recv_decache(union recv_frame *precv_frame, u16 *tid_rxseq)
|
||||
sint recv_ucast_pn_decache(union recv_frame *precv_frame);
|
||||
sint recv_ucast_pn_decache(union recv_frame *precv_frame)
|
||||
{
|
||||
_adapter *padapter = precv_frame->u.hdr.adapter;
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
struct sta_info *sta = precv_frame->u.hdr.psta;
|
||||
struct stainfo_rxcache *prxcache = &sta->sta_recvpriv.rxcache;
|
||||
u8 *pdata = precv_frame->u.hdr.rx_data;
|
||||
u32 data_len = precv_frame->u.hdr.len;
|
||||
sint tid = precv_frame->u.hdr.attrib.priority;
|
||||
u64 tmp_iv_hdr = 0;
|
||||
u64 curr_pn = 0, pkt_pn = 0;
|
||||
@@ -854,18 +863,17 @@ sint recv_bcast_pn_decache(union recv_frame *precv_frame)
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
u8 *pdata = precv_frame->u.hdr.rx_data;
|
||||
u32 data_len = precv_frame->u.hdr.len;
|
||||
u64 tmp_iv_hdr = 0;
|
||||
u64 curr_pn = 0, pkt_pn = 0;
|
||||
u8 key_id;
|
||||
|
||||
if ((pattrib->encrypt == _AES_) &&
|
||||
(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)) {
|
||||
(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)) {
|
||||
|
||||
tmp_iv_hdr = le64_to_cpu(*(u64*)(pdata + pattrib->hdrlen));
|
||||
key_id = CCMPH_2_KEYID(tmp_iv_hdr);
|
||||
pkt_pn = CCMPH_2_PN(tmp_iv_hdr);
|
||||
|
||||
|
||||
curr_pn = le64_to_cpu(*(u64*)psecuritypriv->iv_seq[key_id]);
|
||||
curr_pn &= 0x0000ffffffffffff;
|
||||
|
||||
@@ -883,8 +891,6 @@ void process_pwrbit_data(_adapter *padapter, union recv_frame *precv_frame, stru
|
||||
#ifdef CONFIG_AP_MODE
|
||||
unsigned char pwrbit;
|
||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
pwrbit = GetPwrMgt(ptr);
|
||||
|
||||
@@ -912,7 +918,6 @@ void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame, struc
|
||||
{
|
||||
#ifdef CONFIG_AP_MODE
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if (!(psta->tdls_sta_state & TDLS_LINKED_STATE)) {
|
||||
@@ -1088,8 +1093,6 @@ void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_in
|
||||
struct stainfo_stats *pstats = NULL;
|
||||
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
sz = get_recvframe_len(prframe);
|
||||
precvpriv->rx_bytes += sz;
|
||||
@@ -1128,11 +1131,19 @@ void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_in
|
||||
#ifdef CONFIG_DYNAMIC_SOML
|
||||
rtw_dyn_soml_byte_update(padapter, pattrib->data_rate, sz);
|
||||
#endif
|
||||
#if defined(CONFIG_CHECK_LEAVE_LPS) && defined(CONFIG_LPS_CHK_BY_TP)
|
||||
if (adapter_to_pwrctl(padapter)->lps_chk_by_tp)
|
||||
traffic_check_for_leave_lps_by_tp(padapter, _FALSE, psta);
|
||||
#endif /* CONFIG_LPS */
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CHECK_LEAVE_LPS
|
||||
traffic_check_for_leave_lps(padapter, _FALSE, 0);
|
||||
#endif /* CONFIG_LPS */
|
||||
#ifdef CONFIG_LPS_CHK_BY_TP
|
||||
if (!adapter_to_pwrctl(padapter)->lps_chk_by_tp)
|
||||
#endif
|
||||
traffic_check_for_leave_lps(padapter, _FALSE, 0);
|
||||
#endif /* CONFIG_CHECK_LEAVE_LPS */
|
||||
|
||||
}
|
||||
|
||||
@@ -1364,12 +1375,14 @@ sint ap2sta_data_frame(
|
||||
RTW_INFO("DBG_RX_DROP_FRAME "FUNC_ADPT_FMT" BSSID="MAC_FMT", mybssid="MAC_FMT"\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(pattrib->bssid), MAC_ARG(mybssid));
|
||||
#endif
|
||||
|
||||
if (!bmcast) {
|
||||
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
if (!bmcast
|
||||
&& !IS_RADAR_DETECTED(adapter_to_rfctl(adapter))
|
||||
) {
|
||||
RTW_INFO(ADPT_FMT" -issue_deauth to the nonassociated ap=" MAC_FMT " for the reason(7)\n", ADPT_ARG(adapter), MAC_ARG(pattrib->bssid));
|
||||
issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
|
||||
}
|
||||
|
||||
#endif
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
@@ -1475,21 +1488,13 @@ sint sta2ap_data_frame(
|
||||
|
||||
*psta = rtw_get_stainfo(pstapriv, pattrib->ta);
|
||||
if (*psta == NULL) {
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
|
||||
/* prevent RX tasklet blocks cmd_thread */
|
||||
if (rfctl->radar_detected == 1)
|
||||
goto bypass_deauth7;
|
||||
#endif
|
||||
|
||||
RTW_INFO("issue_deauth to sta=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->src));
|
||||
|
||||
issue_deauth(adapter, pattrib->src, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
|
||||
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
bypass_deauth7:
|
||||
if (!IS_RADAR_DETECTED(adapter_to_rfctl(adapter))) {
|
||||
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
RTW_INFO("issue_deauth to sta=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->src));
|
||||
issue_deauth(adapter, pattrib->src, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
|
||||
#endif
|
||||
}
|
||||
|
||||
ret = RTW_RX_HANDLED;
|
||||
goto exit;
|
||||
}
|
||||
@@ -1531,8 +1536,10 @@ bypass_deauth7:
|
||||
ret = RTW_RX_HANDLED;
|
||||
goto exit;
|
||||
}
|
||||
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
RTW_INFO("issue_deauth to sta=" MAC_FMT " for the reason(7)\n", MAC_ARG(pattrib->src));
|
||||
issue_deauth(adapter, pattrib->src, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
|
||||
#endif
|
||||
ret = RTW_RX_HANDLED;
|
||||
goto exit;
|
||||
}
|
||||
@@ -1770,7 +1777,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
|
||||
|
||||
if (subtype == WIFI_ACTION)
|
||||
category = *(ptr + sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
|
||||
|
||||
if (is_bmc) {
|
||||
/* broadcast cases */
|
||||
if (subtype == WIFI_ACTION) {
|
||||
@@ -2017,7 +2024,9 @@ sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_frame)
|
||||
#endif
|
||||
mgt_dispatcher(padapter, precv_frame);
|
||||
|
||||
#if defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH)
|
||||
exit:
|
||||
#endif
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
@@ -2028,7 +2037,6 @@ sint validate_recv_data_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
struct sta_info *psta = NULL;
|
||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
sint ret = _SUCCESS;
|
||||
|
||||
@@ -2083,7 +2091,9 @@ sint validate_recv_data_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
pre_validate_status_chk:
|
||||
#endif
|
||||
if (ret == _FAIL) {
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
RTW_INFO("DBG_RX_DROP_FRAME "FUNC_ADPT_FMT" case:%d, res:%d, ra="MAC_FMT", ta="MAC_FMT"\n"
|
||||
@@ -2473,6 +2483,11 @@ exiting:
|
||||
}
|
||||
|
||||
#else
|
||||
static u8 SNAP_ETH_TYPE_APPLETALK_DDP[2] = {0x80, 0x9b};
|
||||
/* Datagram Delivery Protocol */
|
||||
static u8 SNAP_HDR_APPLETALK_DDP[3] = {0x08, 0x00, 0x07};
|
||||
static u8 oui_8021h[] = {0x00, 0x00, 0xf8};
|
||||
static u8 oui_rfc1042[] = {0x00, 0x00, 0x00};
|
||||
|
||||
sint wlanhdr_to_ethhdr(union recv_frame *precvframe)
|
||||
{
|
||||
@@ -2745,7 +2760,7 @@ union recv_frame *recvframe_chk_defrag(PADAPTER padapter, union recv_frame *prec
|
||||
struct sta_priv *pstapriv;
|
||||
_list *phead;
|
||||
union recv_frame *prtnframe = NULL;
|
||||
_queue *pfree_recv_queue, *pdefrag_q;
|
||||
_queue *pfree_recv_queue, *pdefrag_q = NULL;
|
||||
|
||||
|
||||
pstapriv = &padapter->stapriv;
|
||||
@@ -2764,7 +2779,8 @@ union recv_frame *recvframe_chk_defrag(PADAPTER padapter, union recv_frame *prec
|
||||
u8 type = GetFrameType(pfhdr->rx_data);
|
||||
if (type != WIFI_DATA_TYPE) {
|
||||
psta = rtw_get_bcmc_stainfo(padapter);
|
||||
pdefrag_q = &psta->sta_recvpriv.defrag_q;
|
||||
if (psta)
|
||||
pdefrag_q = &psta->sta_recvpriv.defrag_q;
|
||||
} else
|
||||
pdefrag_q = NULL;
|
||||
} else
|
||||
@@ -2845,6 +2861,13 @@ static int rtw_recv_indicatepkt_check(union recv_frame *rframe, u8 *ehdr_pos, u3
|
||||
_adapter *adapter = rframe->u.hdr.adapter;
|
||||
struct recv_priv *recvpriv = &adapter->recvpriv;
|
||||
struct ethhdr *ehdr = (struct ethhdr *)ehdr_pos;
|
||||
#ifdef DBG_IP_R_MONITOR
|
||||
int i;
|
||||
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct wlan_network *cur_network = &(pmlmepriv->cur_network);
|
||||
#endif/*DBG_IP_R_MONITOR*/
|
||||
int ret = _FAIL;
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
@@ -2861,7 +2884,11 @@ static int rtw_recv_indicatepkt_check(union recv_frame *rframe, u8 *ehdr_pos, u3
|
||||
rtw_st_ctl_rx(rframe->u.hdr.psta, ehdr_pos);
|
||||
|
||||
if (ntohs(ehdr->h_proto) == 0x888e)
|
||||
RTW_PRINT("recv eapol packet\n");
|
||||
parsing_eapol_packet(adapter, ehdr_pos + ETH_HLEN, rframe->u.hdr.psta, 0);
|
||||
#ifdef DBG_ARP_DUMP
|
||||
else if (ntohs(ehdr->h_proto) == ETH_P_ARP)
|
||||
dump_arp_pkt(RTW_DBGDUMP, ehdr->h_dest, ehdr->h_source, ehdr_pos + ETH_HLEN, 0);
|
||||
#endif
|
||||
|
||||
if (recvpriv->sink_udpport > 0)
|
||||
rtw_sink_rtp_seq_dbg(adapter, ehdr_pos);
|
||||
@@ -2882,6 +2909,25 @@ static int rtw_recv_indicatepkt_check(union recv_frame *rframe, u8 *ehdr_pos, u3
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DBG_IP_R_MONITOR
|
||||
#define LEN_ARP_OP_HDR 7 /*ARP OERATION */
|
||||
if (ntohs(ehdr->h_proto) == ETH_P_ARP) {
|
||||
|
||||
if(check_fwstate(pmlmepriv, WIFI_ASOC_STATE) == _TRUE){
|
||||
if(_rtw_memcmp(pattrib->src, cur_network->network.MacAddress, ETH_ALEN)){
|
||||
if(ehdr_pos[ETHERNET_HEADER_SIZE+LEN_ARP_OP_HDR] == 2) {
|
||||
RTW_INFO("%s,[DBG_ARP] Rx ARP RSP Packet with Dst= "MAC_FMT" ;SeqNum = %d !\n",
|
||||
__FUNCTION__, MAC_ARG(pattrib->dst), pattrib->seq_num);
|
||||
for(i=0;i<(pkt_len -ETHERNET_HEADER_SIZE);i++)
|
||||
RTW_INFO("0x%x ",ehdr_pos[i+ETHERNET_HEADER_SIZE]);
|
||||
RTW_INFO("\n");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif/*DBG_IP_R_MONITOR*/
|
||||
|
||||
#ifdef CONFIG_AUTO_AP_MODE
|
||||
if (ntohs(ehdr->h_proto) == 0x8899)
|
||||
rtw_auto_ap_rx_msg_dump(adapter, rframe, ehdr_pos);
|
||||
@@ -2889,7 +2935,9 @@ static int rtw_recv_indicatepkt_check(union recv_frame *rframe, u8 *ehdr_pos, u3
|
||||
|
||||
ret = _SUCCESS;
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
exit:
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2918,6 +2966,7 @@ static void recv_free_fwd_resource(_adapter *adapter, struct xmit_frame *fwd_fra
|
||||
#endif /* CONFIG_RTW_MESH */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
static void recv_fwd_pkt_hdl(_adapter *adapter, _pkt *pkt
|
||||
, u8 act, struct xmit_frame *fwd_frame, _list *b2u_list)
|
||||
{
|
||||
@@ -2935,7 +2984,6 @@ static void recv_fwd_pkt_hdl(_adapter *adapter, _pkt *pkt
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
#if CONFIG_RTW_MESH_DATA_BMC_TO_UC
|
||||
if (!rtw_is_list_empty(b2u_list)) {
|
||||
_list *list = get_next(b2u_list);
|
||||
@@ -2959,7 +3007,6 @@ static void recv_fwd_pkt_hdl(_adapter *adapter, _pkt *pkt
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_RTW_MESH */
|
||||
|
||||
if (fwd_frame) {
|
||||
fwd_frame->pkt = fwd_pkt;
|
||||
@@ -2974,6 +3021,7 @@ static void recv_fwd_pkt_hdl(_adapter *adapter, _pkt *pkt
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_RTW_MESH */
|
||||
|
||||
int amsdu_to_msdu(_adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
@@ -3110,7 +3158,6 @@ move_to_next:
|
||||
|
||||
static int recv_process_mpdu(_adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
|
||||
int ret;
|
||||
@@ -3467,7 +3514,6 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct
|
||||
static int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
_irqL irql;
|
||||
int retval = _SUCCESS;
|
||||
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
|
||||
struct recv_reorder_ctrl *preorder_ctrl = prframe->u.hdr.preorder_ctrl;
|
||||
_queue *ppending_recvframe_queue = preorder_ctrl ? &preorder_ctrl->pending_recvframe_queue : NULL;
|
||||
@@ -3686,7 +3732,6 @@ static sint MPwlanhdr_to_ethhdr(union recv_frame *precvframe)
|
||||
|
||||
sint ret = _SUCCESS;
|
||||
_adapter *adapter = precvframe->u.hdr.adapter;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
u8 *ptr = get_recvframe_data(precvframe) ; /* point to frame_ctrl field */
|
||||
struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
|
||||
@@ -3754,7 +3799,6 @@ int mp_recv_frame(_adapter *padapter, union recv_frame *rframe)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
@@ -3932,8 +3976,6 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
||||
#endif
|
||||
|
||||
sint ret = _SUCCESS;
|
||||
_adapter *adapter = precvframe->u.hdr.adapter;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
|
||||
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
@@ -4004,9 +4046,9 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
||||
rt_len += 1;
|
||||
|
||||
/* rate */
|
||||
if (pattrib->data_rate < 12) {
|
||||
if (pattrib->data_rate <= DESC_RATE54M) {
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_RATE);
|
||||
if (pattrib->data_rate < 4) {
|
||||
if (pattrib->data_rate <= DESC_RATE11M) {
|
||||
/* CCK */
|
||||
hdr_buf[rt_len] = data_rate[pattrib->data_rate];
|
||||
} else {
|
||||
@@ -4031,8 +4073,8 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
||||
else
|
||||
tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_5GHZ);
|
||||
|
||||
if (pattrib->data_rate < 12) {
|
||||
if (pattrib->data_rate < 4) {
|
||||
if (pattrib->data_rate <= DESC_RATE54M) {
|
||||
if (pattrib->data_rate <= DESC_RATE11M) {
|
||||
/* CCK */
|
||||
tmp_16bit |= cpu_to_le16(IEEE80211_CHAN_CCK);
|
||||
} else {
|
||||
@@ -4075,7 +4117,7 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
||||
rt_len += 2;
|
||||
|
||||
/* MCS information */
|
||||
if (pattrib->data_rate >= 12 && pattrib->data_rate < 44) {
|
||||
if (pattrib->data_rate >= DESC_RATEMCS0 && pattrib->data_rate <= DESC_RATEMCS31) {
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_MCS);
|
||||
/* known, flag */
|
||||
hdr_buf[rt_len] |= BIT1; /* MCS index known */
|
||||
@@ -4100,7 +4142,7 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
||||
}
|
||||
|
||||
/* VHT */
|
||||
if (pattrib->data_rate >= 44 && pattrib->data_rate < 84) {
|
||||
if (pattrib->data_rate >= DESC_RATEVHTSS1MCS0 && pattrib->data_rate <= DESC_RATEVHTSS4MCS9) {
|
||||
rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_VHT);
|
||||
|
||||
/* known 16 bit, flag 8 bit */
|
||||
@@ -4142,16 +4184,16 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
||||
rt_len += 1;
|
||||
|
||||
/* mcs_nss */
|
||||
if (pattrib->data_rate >= 44 && pattrib->data_rate < 54) {
|
||||
if (pattrib->data_rate >= DESC_RATEVHTSS1MCS0 && pattrib->data_rate <= DESC_RATEVHTSS1MCS9) {
|
||||
hdr_buf[rt_len] |= 1;
|
||||
hdr_buf[rt_len] |= data_rate[pattrib->data_rate] << 4;
|
||||
} else if (pattrib->data_rate >= 54 && pattrib->data_rate < 64) {
|
||||
} else if (pattrib->data_rate >= DESC_RATEVHTSS2MCS0 && pattrib->data_rate <= DESC_RATEVHTSS2MCS9) {
|
||||
hdr_buf[rt_len + 1] |= 2;
|
||||
hdr_buf[rt_len + 1] |= data_rate[pattrib->data_rate] << 4;
|
||||
} else if (pattrib->data_rate >= 64 && pattrib->data_rate < 74) {
|
||||
} else if (pattrib->data_rate >= DESC_RATEVHTSS3MCS0 && pattrib->data_rate <= DESC_RATEVHTSS3MCS9) {
|
||||
hdr_buf[rt_len + 2] |= 3;
|
||||
hdr_buf[rt_len + 2] |= data_rate[pattrib->data_rate] << 4;
|
||||
} else if (pattrib->data_rate >= 74 && pattrib->data_rate < 84) {
|
||||
} else if (pattrib->data_rate >= DESC_RATEVHTSS4MCS0 && pattrib->data_rate <= DESC_RATEVHTSS4MCS9) {
|
||||
hdr_buf[rt_len + 3] |= 4;
|
||||
hdr_buf[rt_len + 3] |= data_rate[pattrib->data_rate] << 4;
|
||||
}
|
||||
@@ -4182,6 +4224,7 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
||||
ptr = skb_push(pskb, rt_len);
|
||||
if (ptr) {
|
||||
rtap_hdr->it_len = cpu_to_le16(rt_len);
|
||||
rtap_hdr->it_present = cpu_to_le32(rtap_hdr->it_present);
|
||||
memcpy(ptr, rtap_hdr, rt_len);
|
||||
} else
|
||||
ret = _FAIL;
|
||||
@@ -4193,8 +4236,6 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
|
||||
int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
_pkt *pskb = NULL;
|
||||
|
||||
@@ -4204,13 +4245,14 @@ int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe)
|
||||
pskb->data = rframe->u.hdr.rx_data;
|
||||
skb_set_tail_pointer(pskb, rframe->u.hdr.len);
|
||||
|
||||
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
/* fill radiotap header */
|
||||
if (fill_radiotap_hdr(padapter, rframe, (u8 *)pskb) == _FAIL) {
|
||||
ret = _FAIL;
|
||||
rtw_free_recvframe(rframe, pfree_recv_queue); /* free this recv_frame */
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* write skb information to recv frame */
|
||||
skb_reset_mac_header(pskb);
|
||||
rframe->u.hdr.len = pskb->len;
|
||||
@@ -4240,8 +4282,9 @@ exit:
|
||||
int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
#ifdef DBG_RX_COUNTER_DUMP
|
||||
struct rx_pkt_attrib *pattrib = &rframe->u.hdr.attrib;
|
||||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
#endif
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
|
||||
#ifdef DBG_RX_COUNTER_DUMP
|
||||
@@ -4388,7 +4431,10 @@ int recv_func(_adapter *padapter, union recv_frame *rframe)
|
||||
struct recv_priv *recvpriv = &padapter->recvpriv;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
|
||||
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
u8 type;
|
||||
u8 *ptr = rframe->u.hdr.rx_data;
|
||||
#endif
|
||||
if (check_fwstate(mlmepriv, WIFI_MONITOR_STATE)) {
|
||||
/* monitor mode */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
|
||||
@@ -4397,7 +4443,18 @@ int recv_func(_adapter *padapter, union recv_frame *rframe)
|
||||
ret = _SUCCESS;
|
||||
goto exit;
|
||||
} else
|
||||
|
||||
{}
|
||||
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
type = GetFrameType(ptr);
|
||||
if ((type == WIFI_DATA_TYPE)&& check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
struct wlan_network *cur_network = &(mlmepriv->cur_network);
|
||||
if ( _rtw_memcmp(get_addr2_ptr(ptr), cur_network->network.MacAddress, ETH_ALEN)==0) {
|
||||
recv_frame_monitor(padapter, rframe);
|
||||
ret = _SUCCESS;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* check if need to handle uc_swdec_pending_queue*/
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE) && psecuritypriv->busetkipkey) {
|
||||
union recv_frame *pending_frame;
|
||||
@@ -4584,10 +4641,11 @@ set_timer:
|
||||
|
||||
static void rx_process_rssi(_adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
u32 last_rssi, tmp_val;
|
||||
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
struct signal_stat *signal_stat = &padapter->recvpriv.signal_strength_data;
|
||||
#else /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
|
||||
u32 last_rssi, tmp_val;
|
||||
#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
|
||||
|
||||
/* RTW_INFO("process_rssi=> pattrib->rssil(%d) signal_strength(%d)\n ",pattrib->recv_signal_power,pattrib->signal_strength); */
|
||||
@@ -4634,10 +4692,11 @@ static void rx_process_rssi(_adapter *padapter, union recv_frame *prframe)
|
||||
|
||||
static void rx_process_link_qual(_adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
u32 last_evm = 0, tmpVal;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
struct signal_stat *signal_stat;
|
||||
#else /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
|
||||
u32 last_evm = 0, tmpVal;
|
||||
#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
|
||||
|
||||
if (prframe == NULL || padapter == NULL)
|
||||
@@ -4791,19 +4850,34 @@ void rx_query_phy_status(
|
||||
|
||||
{
|
||||
precvframe->u.hdr.psta = NULL;
|
||||
if ((!MLME_IS_MESH(padapter) && pkt_info.is_packet_match_bssid)
|
||||
|| (MLME_IS_MESH(padapter) && psta)
|
||||
|| padapter->registrypriv.mp_mode == 1
|
||||
) {
|
||||
if (psta) {
|
||||
precvframe->u.hdr.psta = psta;
|
||||
if (padapter->registrypriv.mp_mode != 1) {
|
||||
if ((!MLME_IS_MESH(padapter) && pkt_info.is_packet_match_bssid)
|
||||
|| (MLME_IS_MESH(padapter) && psta)) {
|
||||
if (psta) {
|
||||
precvframe->u.hdr.psta = psta;
|
||||
rx_process_phy_info(padapter, precvframe);
|
||||
}
|
||||
} else if (pkt_info.is_packet_to_self || pkt_info.is_packet_beacon) {
|
||||
if (psta)
|
||||
precvframe->u.hdr.psta = psta;
|
||||
rx_process_phy_info(padapter, precvframe);
|
||||
}
|
||||
} else if (pkt_info.is_packet_to_self || pkt_info.is_packet_beacon) {
|
||||
|
||||
if (psta)
|
||||
precvframe->u.hdr.psta = psta;
|
||||
rx_process_phy_info(padapter, precvframe);
|
||||
} else {
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
if (padapter->mppriv.brx_filter_beacon == _TRUE) {
|
||||
if (pkt_info.is_packet_beacon) {
|
||||
RTW_INFO("in MP Rx is_packet_beacon\n");
|
||||
if (psta)
|
||||
precvframe->u.hdr.psta = psta;
|
||||
rx_process_phy_info(padapter, precvframe);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (psta)
|
||||
precvframe->u.hdr.psta = psta;
|
||||
rx_process_phy_info(padapter, precvframe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4854,9 +4928,9 @@ s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status)
|
||||
u8 *pbuf = precvframe->u.hdr.rx_data;
|
||||
u8 *pda = get_ra(pbuf);
|
||||
u8 ra_is_bmc = IS_MCAST(pda);
|
||||
_adapter *primary_padapter = precvframe->u.hdr.adapter;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_adapter *iface = NULL;
|
||||
_adapter *primary_padapter = precvframe->u.hdr.adapter;
|
||||
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
if (rtw_mp_mode_check(primary_padapter))
|
||||
@@ -4866,6 +4940,10 @@ s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status)
|
||||
if (ra_is_bmc == _FALSE) { /*unicast packets*/
|
||||
iface = rtw_get_iface_by_macddr(primary_padapter , pda);
|
||||
if (NULL == iface) {
|
||||
#ifdef CONFIG_RTW_CFGVENDOR_RANDOM_MAC_OUI
|
||||
if (_rtw_memcmp(pda, adapter_pno_mac_addr(primary_padapter),
|
||||
ETH_ALEN) != _TRUE)
|
||||
#endif
|
||||
RTW_INFO("%s [WARN] Cannot find appropriate adapter - mac_addr : "MAC_FMT"\n", __func__, MAC_ARG(pda));
|
||||
/*rtw_warn_on(1);*/
|
||||
} else
|
||||
@@ -4874,13 +4952,14 @@ s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status)
|
||||
rtw_mi_buddy_clone_bcmc_packet(primary_padapter, precvframe, pphy_status);
|
||||
bypass_concurrent_hdl:
|
||||
#endif /* CONFIG_CONCURRENT_MODE */
|
||||
|
||||
/* skip unnecessary bmc data frame for primary adapter */
|
||||
if (ra_is_bmc == _TRUE && GetFrameType(pbuf) == WIFI_DATA_TYPE
|
||||
&& !adapter_allow_bmc_data_rx(precvframe->u.hdr.adapter)
|
||||
) {
|
||||
rtw_free_recvframe(precvframe, &precvframe->u.hdr.adapter->recvpriv.free_recv_queue);
|
||||
goto exit;
|
||||
if (primary_padapter->registrypriv.mp_mode != 1) {
|
||||
/* skip unnecessary bmc data frame for primary adapter */
|
||||
if (ra_is_bmc == _TRUE && GetFrameType(pbuf) == WIFI_DATA_TYPE
|
||||
&& !adapter_allow_bmc_data_rx(precvframe->u.hdr.adapter)
|
||||
) {
|
||||
rtw_free_recvframe(precvframe, &precvframe->u.hdr.adapter->recvpriv.free_recv_queue);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (pphy_status)
|
||||
@@ -4897,11 +4976,13 @@ thread_return rtw_recv_thread(thread_context context)
|
||||
_adapter *adapter = (_adapter *)context;
|
||||
struct recv_priv *recvpriv = &adapter->recvpriv;
|
||||
s32 err = _SUCCESS;
|
||||
#ifdef RTW_RECV_THREAD_HIGH_PRIORITY
|
||||
#ifdef PLATFORM_LINUX
|
||||
struct sched_param param = { .sched_priority = 1 };
|
||||
|
||||
sched_setscheduler(current, SCHED_FIFO, ¶m);
|
||||
#endif /* PLATFORM_LINUX */
|
||||
#endif /*RTW_RECV_THREAD_HIGH_PRIORITY*/
|
||||
thread_enter("RTW_RECV_THREAD");
|
||||
|
||||
RTW_INFO(FUNC_ADPT_FMT" enter\n", FUNC_ADPT_ARG(adapter));
|
||||
|
||||
557
core/rtw_rf.c
557
core/rtw_rf.c
@@ -204,7 +204,6 @@ struct center_chs_ent_t center_chs_5g_by_bw[] = {
|
||||
*/
|
||||
u8 rtw_get_scch_by_cch_offset(u8 cch, u8 bw, u8 offset)
|
||||
{
|
||||
int i;
|
||||
u8 t_cch = 0;
|
||||
|
||||
if (bw == CHANNEL_WIDTH_20) {
|
||||
@@ -470,7 +469,6 @@ bool rtw_chbw_to_freq_range(u8 ch, u8 bw, u8 offset, u32 *hi, u32 *lo)
|
||||
u8 c_ch;
|
||||
u32 freq;
|
||||
u32 hi_ret = 0, lo_ret = 0;
|
||||
int i;
|
||||
bool valid = _FALSE;
|
||||
|
||||
if (hi)
|
||||
@@ -567,471 +565,6 @@ const u8 _rf_type_to_rf_rx_cnt[] = {
|
||||
1, /*RF_TYPE_MAX*/
|
||||
};
|
||||
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
#define COUNTRY_CHPLAN_ASSIGN_EN_11AC(_val) , .en_11ac = (_val)
|
||||
#else
|
||||
#define COUNTRY_CHPLAN_ASSIGN_EN_11AC(_val)
|
||||
#endif
|
||||
|
||||
#if RTW_DEF_MODULE_REGULATORY_CERT
|
||||
#define COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_val) , .def_module_flags = (_val)
|
||||
#else
|
||||
#define COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_val)
|
||||
#endif
|
||||
|
||||
/* has def_module_flags specified, used by common map and HAL dfference map */
|
||||
#define COUNTRY_CHPLAN_ENT(_alpha2, _chplan, _en_11ac, _def_module_flags) \
|
||||
{.alpha2 = (_alpha2), .chplan = (_chplan) \
|
||||
COUNTRY_CHPLAN_ASSIGN_EN_11AC(_en_11ac) \
|
||||
COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_def_module_flags) \
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP
|
||||
|
||||
#include "../platform/custom_country_chplan.h"
|
||||
|
||||
#elif RTW_DEF_MODULE_REGULATORY_CERT
|
||||
|
||||
/* leave def_module_flags empty, def_module_flags check is done on country_chplan_map */
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8821AE_HMC_M2) /* 2013 certify */
|
||||
static const struct country_chplan RTL8821AE_HMC_M2_country_chplan_exc_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("CA", 0x34, 1, 0), /* Canada */
|
||||
COUNTRY_CHPLAN_ENT("CL", 0x30, 1, 0), /* Chile */
|
||||
COUNTRY_CHPLAN_ENT("CN", 0x51, 1, 0), /* China */
|
||||
COUNTRY_CHPLAN_ENT("MX", 0x34, 1, 0), /* Mexico */
|
||||
COUNTRY_CHPLAN_ENT("MY", 0x47, 1, 0), /* Malaysia */
|
||||
COUNTRY_CHPLAN_ENT("TW", 0x39, 1, 0), /* Taiwan */
|
||||
COUNTRY_CHPLAN_ENT("UA", 0x36, 0, 0), /* Ukraine */
|
||||
COUNTRY_CHPLAN_ENT("US", 0x34, 1, 0), /* United States of America (USA) */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8821AU) /* 2014 certify */
|
||||
static const struct country_chplan RTL8821AU_country_chplan_exc_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("CA", 0x34, 1, 0), /* Canada */
|
||||
COUNTRY_CHPLAN_ENT("RU", 0x59, 0, 0), /* Russia(fac/gost), Kaliningrad */
|
||||
COUNTRY_CHPLAN_ENT("TW", 0x39, 1, 0), /* Taiwan */
|
||||
COUNTRY_CHPLAN_ENT("UA", 0x36, 0, 0), /* Ukraine */
|
||||
COUNTRY_CHPLAN_ENT("US", 0x34, 1, 0), /* United States of America (USA) */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8812AENF_NGFF) /* 2014 certify */
|
||||
static const struct country_chplan RTL8812AENF_NGFF_country_chplan_exc_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("TW", 0x39, 1, 0), /* Taiwan */
|
||||
COUNTRY_CHPLAN_ENT("US", 0x34, 1, 0), /* United States of America (USA) */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8812AEBT_HMC) /* 2013 certify */
|
||||
static const struct country_chplan RTL8812AEBT_HMC_country_chplan_exc_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("CA", 0x34, 1, 0), /* Canada */
|
||||
COUNTRY_CHPLAN_ENT("RU", 0x59, 0, 0), /* Russia(fac/gost), Kaliningrad */
|
||||
COUNTRY_CHPLAN_ENT("TW", 0x39, 1, 0), /* Taiwan */
|
||||
COUNTRY_CHPLAN_ENT("UA", 0x36, 0, 0), /* Ukraine */
|
||||
COUNTRY_CHPLAN_ENT("US", 0x34, 1, 0), /* United States of America (USA) */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8188EE_HMC_M2) /* 2012 certify */
|
||||
static const struct country_chplan RTL8188EE_HMC_M2_country_chplan_exc_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("CA", 0x20, 1, 0), /* Canada */
|
||||
COUNTRY_CHPLAN_ENT("MX", 0x34, 1, 0), /* Mexico */
|
||||
COUNTRY_CHPLAN_ENT("TW", 0x39, 1, 0), /* Taiwan */
|
||||
COUNTRY_CHPLAN_ENT("US", 0x34, 1, 0), /* United States of America (USA) */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8723BE_HMC_M2) /* 2013 certify */
|
||||
static const struct country_chplan RTL8723BE_HMC_M2_country_chplan_exc_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("CA", 0x20, 1, 0), /* Canada */
|
||||
COUNTRY_CHPLAN_ENT("MX", 0x34, 1, 0), /* Mexico */
|
||||
COUNTRY_CHPLAN_ENT("TW", 0x39, 1, 0), /* Taiwan */
|
||||
COUNTRY_CHPLAN_ENT("US", 0x34, 1, 0), /* United States of America (USA) */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8723BS_NGFF1216) /* 2014 certify */
|
||||
static const struct country_chplan RTL8723BS_NGFF1216_country_chplan_exc_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("CA", 0x20, 1, 0), /* Canada */
|
||||
COUNTRY_CHPLAN_ENT("MX", 0x34, 1, 0), /* Mexico */
|
||||
COUNTRY_CHPLAN_ENT("TW", 0x39, 1, 0), /* Taiwan */
|
||||
COUNTRY_CHPLAN_ENT("US", 0x34, 1, 0), /* United States of America (USA) */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8192EEBT_HMC_M2) /* 2013 certify */
|
||||
static const struct country_chplan RTL8192EEBT_HMC_M2_country_chplan_exc_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("CA", 0x20, 1, 0), /* Canada */
|
||||
COUNTRY_CHPLAN_ENT("MX", 0x34, 1, 0), /* Mexico */
|
||||
COUNTRY_CHPLAN_ENT("TW", 0x39, 1, 0), /* Taiwan */
|
||||
COUNTRY_CHPLAN_ENT("US", 0x34, 1, 0), /* United States of America (USA) */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8723DE_NGFF1630) /* 2016 certify */
|
||||
static const struct country_chplan RTL8723DE_NGFF1630_country_chplan_exc_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("CA", 0x2A, 1, 0), /* Canada */
|
||||
COUNTRY_CHPLAN_ENT("MX", 0x34, 1, 0), /* Mexico */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8822BE) /* 2016 certify */
|
||||
static const struct country_chplan RTL8822BE_country_chplan_exc_map[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8821CE) /* 2016 certify */
|
||||
static const struct country_chplan RTL8821CE_country_chplan_exc_map[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* rtw_def_module_get_chplan_from_country -
|
||||
* @country_code: string of country code
|
||||
* @return:
|
||||
* Return NULL for case referring to common map
|
||||
*/
|
||||
static const struct country_chplan *rtw_def_module_get_chplan_from_country(const char *country_code)
|
||||
{
|
||||
const struct country_chplan *ent = NULL;
|
||||
const struct country_chplan *hal_map = NULL;
|
||||
u16 hal_map_sz = 0;
|
||||
int i;
|
||||
|
||||
/* TODO: runtime selection for multi driver */
|
||||
#if (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821AE_HMC_M2)
|
||||
hal_map = RTL8821AE_HMC_M2_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8821AE_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821AU)
|
||||
hal_map = RTL8821AU_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8821AU_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8812AENF_NGFF)
|
||||
hal_map = RTL8812AENF_NGFF_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8812AENF_NGFF_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8812AEBT_HMC)
|
||||
hal_map = RTL8812AEBT_HMC_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8812AEBT_HMC_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8188EE_HMC_M2)
|
||||
hal_map = RTL8188EE_HMC_M2_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8188EE_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723BE_HMC_M2)
|
||||
hal_map = RTL8723BE_HMC_M2_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8723BE_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723BS_NGFF1216)
|
||||
hal_map = RTL8723BS_NGFF1216_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8723BS_NGFF1216_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8192EEBT_HMC_M2)
|
||||
hal_map = RTL8192EEBT_HMC_M2_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8192EEBT_HMC_M2_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723DE_NGFF1630)
|
||||
hal_map = RTL8723DE_NGFF1630_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8723DE_NGFF1630_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8822BE)
|
||||
hal_map = RTL8822BE_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8822BE_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821CE)
|
||||
hal_map = RTL8821CE_country_chplan_exc_map;
|
||||
hal_map_sz = sizeof(RTL8821CE_country_chplan_exc_map) / sizeof(struct country_chplan);
|
||||
#endif
|
||||
|
||||
if (hal_map == NULL || hal_map_sz == 0)
|
||||
goto exit;
|
||||
|
||||
for (i = 0; i < hal_map_sz; i++) {
|
||||
if (strncmp(country_code, hal_map[i].alpha2, 2) == 0) {
|
||||
ent = &hal_map[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
return ent;
|
||||
}
|
||||
#endif /* CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP or RTW_DEF_MODULE_REGULATORY_CERT */
|
||||
|
||||
static const struct country_chplan country_chplan_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("AD", 0x26, 1, 0x000), /* Andorra */
|
||||
COUNTRY_CHPLAN_ENT("AE", 0x26, 1, 0x7FB), /* United Arab Emirates */
|
||||
COUNTRY_CHPLAN_ENT("AF", 0x42, 1, 0x000), /* Afghanistan */
|
||||
COUNTRY_CHPLAN_ENT("AG", 0x26, 1, 0x000), /* Antigua & Barbuda */
|
||||
COUNTRY_CHPLAN_ENT("AI", 0x26, 1, 0x000), /* Anguilla(UK) */
|
||||
COUNTRY_CHPLAN_ENT("AL", 0x26, 1, 0x7F1), /* Albania */
|
||||
COUNTRY_CHPLAN_ENT("AM", 0x26, 1, 0x6B0), /* Armenia */
|
||||
COUNTRY_CHPLAN_ENT("AN", 0x26, 1, 0x7F1), /* Netherlands Antilles */
|
||||
COUNTRY_CHPLAN_ENT("AO", 0x47, 1, 0x6E0), /* Angola */
|
||||
COUNTRY_CHPLAN_ENT("AQ", 0x26, 1, 0x000), /* Antarctica */
|
||||
COUNTRY_CHPLAN_ENT("AR", 0x61, 1, 0x7F3), /* Argentina */
|
||||
COUNTRY_CHPLAN_ENT("AS", 0x34, 1, 0x000), /* American Samoa */
|
||||
COUNTRY_CHPLAN_ENT("AT", 0x26, 1, 0x7FB), /* Austria */
|
||||
COUNTRY_CHPLAN_ENT("AU", 0x45, 1, 0x7FB), /* Australia */
|
||||
COUNTRY_CHPLAN_ENT("AW", 0x34, 1, 0x0B0), /* Aruba */
|
||||
COUNTRY_CHPLAN_ENT("AZ", 0x26, 1, 0x7F1), /* Azerbaijan */
|
||||
COUNTRY_CHPLAN_ENT("BA", 0x26, 1, 0x7F1), /* Bosnia & Herzegovina */
|
||||
COUNTRY_CHPLAN_ENT("BB", 0x34, 1, 0x650), /* Barbados */
|
||||
COUNTRY_CHPLAN_ENT("BD", 0x26, 1, 0x7F1), /* Bangladesh */
|
||||
COUNTRY_CHPLAN_ENT("BE", 0x26, 1, 0x7FB), /* Belgium */
|
||||
COUNTRY_CHPLAN_ENT("BF", 0x26, 1, 0x6B0), /* Burkina Faso */
|
||||
COUNTRY_CHPLAN_ENT("BG", 0x26, 1, 0x7F1), /* Bulgaria */
|
||||
COUNTRY_CHPLAN_ENT("BH", 0x47, 1, 0x7F1), /* Bahrain */
|
||||
COUNTRY_CHPLAN_ENT("BI", 0x26, 1, 0x6B0), /* Burundi */
|
||||
COUNTRY_CHPLAN_ENT("BJ", 0x26, 1, 0x6B0), /* Benin */
|
||||
COUNTRY_CHPLAN_ENT("BN", 0x47, 1, 0x610), /* Brunei */
|
||||
COUNTRY_CHPLAN_ENT("BO", 0x73, 1, 0x7F1), /* Bolivia */
|
||||
COUNTRY_CHPLAN_ENT("BR", 0x62, 1, 0x7F1), /* Brazil */
|
||||
COUNTRY_CHPLAN_ENT("BS", 0x34, 1, 0x620), /* Bahamas */
|
||||
COUNTRY_CHPLAN_ENT("BW", 0x26, 1, 0x6F1), /* Botswana */
|
||||
COUNTRY_CHPLAN_ENT("BY", 0x26, 1, 0x7F1), /* Belarus */
|
||||
COUNTRY_CHPLAN_ENT("BZ", 0x34, 1, 0x000), /* Belize */
|
||||
COUNTRY_CHPLAN_ENT("CA", 0x2B, 1, 0x7FB), /* Canada */
|
||||
COUNTRY_CHPLAN_ENT("CC", 0x26, 1, 0x000), /* Cocos (Keeling) Islands (Australia) */
|
||||
COUNTRY_CHPLAN_ENT("CD", 0x26, 1, 0x6B0), /* Congo, Republic of the */
|
||||
COUNTRY_CHPLAN_ENT("CF", 0x26, 1, 0x6B0), /* Central African Republic */
|
||||
COUNTRY_CHPLAN_ENT("CG", 0x26, 1, 0x6B0), /* Congo, Democratic Republic of the. Zaire */
|
||||
COUNTRY_CHPLAN_ENT("CH", 0x26, 1, 0x7FB), /* Switzerland */
|
||||
COUNTRY_CHPLAN_ENT("CI", 0x26, 1, 0x7F1), /* Cote d'Ivoire */
|
||||
COUNTRY_CHPLAN_ENT("CK", 0x26, 1, 0x000), /* Cook Islands */
|
||||
COUNTRY_CHPLAN_ENT("CL", 0x2D, 1, 0x7F1), /* Chile */
|
||||
COUNTRY_CHPLAN_ENT("CM", 0x26, 1, 0x6B0), /* Cameroon */
|
||||
COUNTRY_CHPLAN_ENT("CN", 0x48, 1, 0x7FB), /* China */
|
||||
COUNTRY_CHPLAN_ENT("CO", 0x34, 1, 0x7F1), /* Colombia */
|
||||
COUNTRY_CHPLAN_ENT("CR", 0x34, 1, 0x7F1), /* Costa Rica */
|
||||
COUNTRY_CHPLAN_ENT("CV", 0x26, 1, 0x6B0), /* Cape Verde */
|
||||
COUNTRY_CHPLAN_ENT("CX", 0x45, 1, 0x000), /* Christmas Island (Australia) */
|
||||
COUNTRY_CHPLAN_ENT("CY", 0x26, 1, 0x7FB), /* Cyprus */
|
||||
COUNTRY_CHPLAN_ENT("CZ", 0x26, 1, 0x7FB), /* Czech Republic */
|
||||
COUNTRY_CHPLAN_ENT("DE", 0x26, 1, 0x7FB), /* Germany */
|
||||
COUNTRY_CHPLAN_ENT("DJ", 0x26, 1, 0x680), /* Djibouti */
|
||||
COUNTRY_CHPLAN_ENT("DK", 0x26, 1, 0x7FB), /* Denmark */
|
||||
COUNTRY_CHPLAN_ENT("DM", 0x34, 1, 0x000), /* Dominica */
|
||||
COUNTRY_CHPLAN_ENT("DO", 0x34, 1, 0x7F1), /* Dominican Republic */
|
||||
COUNTRY_CHPLAN_ENT("DZ", 0x26, 1, 0x7F1), /* Algeria */
|
||||
COUNTRY_CHPLAN_ENT("EC", 0x34, 1, 0x7F1), /* Ecuador */
|
||||
COUNTRY_CHPLAN_ENT("EE", 0x26, 1, 0x7FB), /* Estonia */
|
||||
COUNTRY_CHPLAN_ENT("EG", 0x47, 1, 0x7F1), /* Egypt */
|
||||
COUNTRY_CHPLAN_ENT("EH", 0x47, 1, 0x680), /* Western Sahara */
|
||||
COUNTRY_CHPLAN_ENT("ER", 0x26, 1, 0x000), /* Eritrea */
|
||||
COUNTRY_CHPLAN_ENT("ES", 0x26, 1, 0x7FB), /* Spain, Canary Islands, Ceuta, Melilla */
|
||||
COUNTRY_CHPLAN_ENT("ET", 0x26, 1, 0x4B0), /* Ethiopia */
|
||||
COUNTRY_CHPLAN_ENT("FI", 0x26, 1, 0x7FB), /* Finland */
|
||||
COUNTRY_CHPLAN_ENT("FJ", 0x34, 1, 0x600), /* Fiji */
|
||||
COUNTRY_CHPLAN_ENT("FK", 0x26, 1, 0x000), /* Falkland Islands (Islas Malvinas) (UK) */
|
||||
COUNTRY_CHPLAN_ENT("FM", 0x34, 1, 0x000), /* Micronesia, Federated States of (USA) */
|
||||
COUNTRY_CHPLAN_ENT("FO", 0x26, 1, 0x000), /* Faroe Islands (Denmark) */
|
||||
COUNTRY_CHPLAN_ENT("FR", 0x26, 1, 0x7FB), /* France */
|
||||
COUNTRY_CHPLAN_ENT("GA", 0x26, 1, 0x6B0), /* Gabon */
|
||||
COUNTRY_CHPLAN_ENT("GB", 0x26, 1, 0x7FB), /* Great Britain (United Kingdom; England) */
|
||||
COUNTRY_CHPLAN_ENT("GD", 0x34, 1, 0x0B0), /* Grenada */
|
||||
COUNTRY_CHPLAN_ENT("GE", 0x26, 1, 0x600), /* Georgia */
|
||||
COUNTRY_CHPLAN_ENT("GF", 0x26, 1, 0x080), /* French Guiana */
|
||||
COUNTRY_CHPLAN_ENT("GG", 0x26, 1, 0x000), /* Guernsey (UK) */
|
||||
COUNTRY_CHPLAN_ENT("GH", 0x26, 1, 0x7F1), /* Ghana */
|
||||
COUNTRY_CHPLAN_ENT("GI", 0x26, 1, 0x600), /* Gibraltar (UK) */
|
||||
COUNTRY_CHPLAN_ENT("GL", 0x26, 1, 0x600), /* Greenland (Denmark) */
|
||||
COUNTRY_CHPLAN_ENT("GM", 0x26, 1, 0x6B0), /* Gambia */
|
||||
COUNTRY_CHPLAN_ENT("GN", 0x26, 1, 0x610), /* Guinea */
|
||||
COUNTRY_CHPLAN_ENT("GP", 0x26, 1, 0x600), /* Guadeloupe (France) */
|
||||
COUNTRY_CHPLAN_ENT("GQ", 0x26, 1, 0x6B0), /* Equatorial Guinea */
|
||||
COUNTRY_CHPLAN_ENT("GR", 0x26, 1, 0x7FB), /* Greece */
|
||||
COUNTRY_CHPLAN_ENT("GS", 0x26, 1, 0x000), /* South Georgia and the Sandwich Islands (UK) */
|
||||
COUNTRY_CHPLAN_ENT("GT", 0x34, 1, 0x7F1), /* Guatemala */
|
||||
COUNTRY_CHPLAN_ENT("GU", 0x34, 1, 0x600), /* Guam (USA) */
|
||||
COUNTRY_CHPLAN_ENT("GW", 0x26, 1, 0x6B0), /* Guinea-Bissau */
|
||||
COUNTRY_CHPLAN_ENT("GY", 0x44, 1, 0x000), /* Guyana */
|
||||
COUNTRY_CHPLAN_ENT("HK", 0x26, 1, 0x7FB), /* Hong Kong */
|
||||
COUNTRY_CHPLAN_ENT("HM", 0x45, 1, 0x000), /* Heard and McDonald Islands (Australia) */
|
||||
COUNTRY_CHPLAN_ENT("HN", 0x32, 1, 0x7F1), /* Honduras */
|
||||
COUNTRY_CHPLAN_ENT("HR", 0x26, 1, 0x7F9), /* Croatia */
|
||||
COUNTRY_CHPLAN_ENT("HT", 0x34, 1, 0x650), /* Haiti */
|
||||
COUNTRY_CHPLAN_ENT("HU", 0x26, 1, 0x7FB), /* Hungary */
|
||||
COUNTRY_CHPLAN_ENT("ID", 0x3D, 0, 0x7F3), /* Indonesia */
|
||||
COUNTRY_CHPLAN_ENT("IE", 0x26, 1, 0x7FB), /* Ireland */
|
||||
COUNTRY_CHPLAN_ENT("IL", 0x47, 1, 0x7F1), /* Israel */
|
||||
COUNTRY_CHPLAN_ENT("IM", 0x26, 1, 0x000), /* Isle of Man (UK) */
|
||||
COUNTRY_CHPLAN_ENT("IN", 0x48, 1, 0x7F1), /* India */
|
||||
COUNTRY_CHPLAN_ENT("IQ", 0x26, 1, 0x000), /* Iraq */
|
||||
COUNTRY_CHPLAN_ENT("IR", 0x26, 0, 0x000), /* Iran */
|
||||
COUNTRY_CHPLAN_ENT("IS", 0x26, 1, 0x7FB), /* Iceland */
|
||||
COUNTRY_CHPLAN_ENT("IT", 0x26, 1, 0x7FB), /* Italy */
|
||||
COUNTRY_CHPLAN_ENT("JE", 0x26, 1, 0x000), /* Jersey (UK) */
|
||||
COUNTRY_CHPLAN_ENT("JM", 0x51, 1, 0x7F1), /* Jamaica */
|
||||
COUNTRY_CHPLAN_ENT("JO", 0x49, 1, 0x7FB), /* Jordan */
|
||||
COUNTRY_CHPLAN_ENT("JP", 0x27, 1, 0x7FF), /* Japan- Telec */
|
||||
COUNTRY_CHPLAN_ENT("KE", 0x47, 1, 0x7F9), /* Kenya */
|
||||
COUNTRY_CHPLAN_ENT("KG", 0x26, 1, 0x7F1), /* Kyrgyzstan */
|
||||
COUNTRY_CHPLAN_ENT("KH", 0x26, 1, 0x7F1), /* Cambodia */
|
||||
COUNTRY_CHPLAN_ENT("KI", 0x26, 1, 0x000), /* Kiribati */
|
||||
COUNTRY_CHPLAN_ENT("KN", 0x34, 1, 0x000), /* Saint Kitts and Nevis */
|
||||
COUNTRY_CHPLAN_ENT("KR", 0x28, 1, 0x7FB), /* South Korea */
|
||||
COUNTRY_CHPLAN_ENT("KW", 0x47, 1, 0x7FB), /* Kuwait */
|
||||
COUNTRY_CHPLAN_ENT("KY", 0x34, 1, 0x000), /* Cayman Islands (UK) */
|
||||
COUNTRY_CHPLAN_ENT("KZ", 0x26, 1, 0x700), /* Kazakhstan */
|
||||
COUNTRY_CHPLAN_ENT("LA", 0x26, 1, 0x000), /* Laos */
|
||||
COUNTRY_CHPLAN_ENT("LB", 0x26, 1, 0x7F1), /* Lebanon */
|
||||
COUNTRY_CHPLAN_ENT("LC", 0x34, 1, 0x000), /* Saint Lucia */
|
||||
COUNTRY_CHPLAN_ENT("LI", 0x26, 1, 0x7FB), /* Liechtenstein */
|
||||
COUNTRY_CHPLAN_ENT("LK", 0x26, 1, 0x7F1), /* Sri Lanka */
|
||||
COUNTRY_CHPLAN_ENT("LR", 0x26, 1, 0x6B0), /* Liberia */
|
||||
COUNTRY_CHPLAN_ENT("LS", 0x26, 1, 0x7F1), /* Lesotho */
|
||||
COUNTRY_CHPLAN_ENT("LT", 0x26, 1, 0x7FB), /* Lithuania */
|
||||
COUNTRY_CHPLAN_ENT("LU", 0x26, 1, 0x7FB), /* Luxembourg */
|
||||
COUNTRY_CHPLAN_ENT("LV", 0x26, 1, 0x7FB), /* Latvia */
|
||||
COUNTRY_CHPLAN_ENT("LY", 0x26, 1, 0x000), /* Libya */
|
||||
COUNTRY_CHPLAN_ENT("MA", 0x47, 1, 0x7F1), /* Morocco */
|
||||
COUNTRY_CHPLAN_ENT("MC", 0x26, 1, 0x7FB), /* Monaco */
|
||||
COUNTRY_CHPLAN_ENT("MD", 0x26, 1, 0x7F1), /* Moldova */
|
||||
COUNTRY_CHPLAN_ENT("ME", 0x26, 1, 0x7F1), /* Montenegro */
|
||||
COUNTRY_CHPLAN_ENT("MF", 0x34, 1, 0x000), /* Saint Martin */
|
||||
COUNTRY_CHPLAN_ENT("MG", 0x26, 1, 0x620), /* Madagascar */
|
||||
COUNTRY_CHPLAN_ENT("MH", 0x34, 1, 0x000), /* Marshall Islands (USA) */
|
||||
COUNTRY_CHPLAN_ENT("MK", 0x26, 1, 0x7F1), /* Republic of Macedonia (FYROM) */
|
||||
COUNTRY_CHPLAN_ENT("ML", 0x26, 1, 0x6B0), /* Mali */
|
||||
COUNTRY_CHPLAN_ENT("MM", 0x26, 1, 0x000), /* Burma (Myanmar) */
|
||||
COUNTRY_CHPLAN_ENT("MN", 0x26, 1, 0x000), /* Mongolia */
|
||||
COUNTRY_CHPLAN_ENT("MO", 0x26, 1, 0x600), /* Macau */
|
||||
COUNTRY_CHPLAN_ENT("MP", 0x34, 1, 0x000), /* Northern Mariana Islands (USA) */
|
||||
COUNTRY_CHPLAN_ENT("MQ", 0x26, 1, 0x640), /* Martinique (France) */
|
||||
COUNTRY_CHPLAN_ENT("MR", 0x26, 1, 0x6A0), /* Mauritania */
|
||||
COUNTRY_CHPLAN_ENT("MS", 0x26, 1, 0x000), /* Montserrat (UK) */
|
||||
COUNTRY_CHPLAN_ENT("MT", 0x26, 1, 0x7FB), /* Malta */
|
||||
COUNTRY_CHPLAN_ENT("MU", 0x26, 1, 0x6B0), /* Mauritius */
|
||||
COUNTRY_CHPLAN_ENT("MV", 0x47, 1, 0x000), /* Maldives */
|
||||
COUNTRY_CHPLAN_ENT("MW", 0x26, 1, 0x6B0), /* Malawi */
|
||||
COUNTRY_CHPLAN_ENT("MX", 0x61, 1, 0x7F1), /* Mexico */
|
||||
COUNTRY_CHPLAN_ENT("MY", 0x63, 1, 0x7F1), /* Malaysia */
|
||||
COUNTRY_CHPLAN_ENT("MZ", 0x26, 1, 0x7F1), /* Mozambique */
|
||||
COUNTRY_CHPLAN_ENT("NA", 0x26, 1, 0x700), /* Namibia */
|
||||
COUNTRY_CHPLAN_ENT("NC", 0x26, 1, 0x000), /* New Caledonia */
|
||||
COUNTRY_CHPLAN_ENT("NE", 0x26, 1, 0x6B0), /* Niger */
|
||||
COUNTRY_CHPLAN_ENT("NF", 0x45, 1, 0x000), /* Norfolk Island (Australia) */
|
||||
COUNTRY_CHPLAN_ENT("NG", 0x75, 1, 0x7F9), /* Nigeria */
|
||||
COUNTRY_CHPLAN_ENT("NI", 0x34, 1, 0x7F1), /* Nicaragua */
|
||||
COUNTRY_CHPLAN_ENT("NL", 0x26, 1, 0x7FB), /* Netherlands */
|
||||
COUNTRY_CHPLAN_ENT("NO", 0x26, 1, 0x7FB), /* Norway */
|
||||
COUNTRY_CHPLAN_ENT("NP", 0x47, 1, 0x6F0), /* Nepal */
|
||||
COUNTRY_CHPLAN_ENT("NR", 0x26, 1, 0x000), /* Nauru */
|
||||
COUNTRY_CHPLAN_ENT("NU", 0x45, 1, 0x000), /* Niue */
|
||||
COUNTRY_CHPLAN_ENT("NZ", 0x45, 1, 0x7FB), /* New Zealand */
|
||||
COUNTRY_CHPLAN_ENT("OM", 0x26, 1, 0x7F9), /* Oman */
|
||||
COUNTRY_CHPLAN_ENT("PA", 0x34, 1, 0x7F1), /* Panama */
|
||||
COUNTRY_CHPLAN_ENT("PE", 0x34, 1, 0x7F1), /* Peru */
|
||||
COUNTRY_CHPLAN_ENT("PF", 0x26, 1, 0x000), /* French Polynesia (France) */
|
||||
COUNTRY_CHPLAN_ENT("PG", 0x26, 1, 0x7F1), /* Papua New Guinea */
|
||||
COUNTRY_CHPLAN_ENT("PH", 0x26, 1, 0x7F1), /* Philippines */
|
||||
COUNTRY_CHPLAN_ENT("PK", 0x51, 1, 0x7F1), /* Pakistan */
|
||||
COUNTRY_CHPLAN_ENT("PL", 0x26, 1, 0x7FB), /* Poland */
|
||||
COUNTRY_CHPLAN_ENT("PM", 0x26, 1, 0x000), /* Saint Pierre and Miquelon (France) */
|
||||
COUNTRY_CHPLAN_ENT("PR", 0x34, 1, 0x7F1), /* Puerto Rico */
|
||||
COUNTRY_CHPLAN_ENT("PT", 0x26, 1, 0x7FB), /* Portugal */
|
||||
COUNTRY_CHPLAN_ENT("PW", 0x34, 1, 0x000), /* Palau */
|
||||
COUNTRY_CHPLAN_ENT("PY", 0x34, 1, 0x7F1), /* Paraguay */
|
||||
COUNTRY_CHPLAN_ENT("QA", 0x51, 1, 0x7F9), /* Qatar */
|
||||
COUNTRY_CHPLAN_ENT("RE", 0x26, 1, 0x000), /* Reunion (France) */
|
||||
COUNTRY_CHPLAN_ENT("RO", 0x26, 1, 0x7F1), /* Romania */
|
||||
COUNTRY_CHPLAN_ENT("RS", 0x26, 1, 0x7F1), /* Serbia, Kosovo */
|
||||
COUNTRY_CHPLAN_ENT("RU", 0x59, 1, 0x7FB), /* Russia(fac/gost), Kaliningrad */
|
||||
COUNTRY_CHPLAN_ENT("RW", 0x26, 1, 0x0B0), /* Rwanda */
|
||||
COUNTRY_CHPLAN_ENT("SA", 0x26, 1, 0x7FB), /* Saudi Arabia */
|
||||
COUNTRY_CHPLAN_ENT("SB", 0x26, 1, 0x000), /* Solomon Islands */
|
||||
COUNTRY_CHPLAN_ENT("SC", 0x34, 1, 0x690), /* Seychelles */
|
||||
COUNTRY_CHPLAN_ENT("SE", 0x26, 1, 0x7FB), /* Sweden */
|
||||
COUNTRY_CHPLAN_ENT("SG", 0x26, 1, 0x7FB), /* Singapore */
|
||||
COUNTRY_CHPLAN_ENT("SH", 0x26, 1, 0x000), /* Saint Helena (UK) */
|
||||
COUNTRY_CHPLAN_ENT("SI", 0x26, 1, 0x7FB), /* Slovenia */
|
||||
COUNTRY_CHPLAN_ENT("SJ", 0x26, 1, 0x000), /* Svalbard (Norway) */
|
||||
COUNTRY_CHPLAN_ENT("SK", 0x26, 1, 0x7FB), /* Slovakia */
|
||||
COUNTRY_CHPLAN_ENT("SL", 0x26, 1, 0x6B0), /* Sierra Leone */
|
||||
COUNTRY_CHPLAN_ENT("SM", 0x26, 1, 0x000), /* San Marino */
|
||||
COUNTRY_CHPLAN_ENT("SN", 0x26, 1, 0x7F1), /* Senegal */
|
||||
COUNTRY_CHPLAN_ENT("SO", 0x26, 1, 0x000), /* Somalia */
|
||||
COUNTRY_CHPLAN_ENT("SR", 0x74, 1, 0x000), /* Suriname */
|
||||
COUNTRY_CHPLAN_ENT("ST", 0x34, 1, 0x680), /* Sao Tome and Principe */
|
||||
COUNTRY_CHPLAN_ENT("SV", 0x30, 1, 0x7F1), /* El Salvador */
|
||||
COUNTRY_CHPLAN_ENT("SX", 0x34, 1, 0x000), /* Sint Marteen */
|
||||
COUNTRY_CHPLAN_ENT("SZ", 0x26, 1, 0x020), /* Swaziland */
|
||||
COUNTRY_CHPLAN_ENT("TC", 0x26, 1, 0x000), /* Turks and Caicos Islands (UK) */
|
||||
COUNTRY_CHPLAN_ENT("TD", 0x26, 1, 0x6B0), /* Chad */
|
||||
COUNTRY_CHPLAN_ENT("TF", 0x26, 1, 0x680), /* French Southern and Antarctic Lands (FR Southern Territories) */
|
||||
COUNTRY_CHPLAN_ENT("TG", 0x26, 1, 0x6B0), /* Togo */
|
||||
COUNTRY_CHPLAN_ENT("TH", 0x26, 1, 0x7F1), /* Thailand */
|
||||
COUNTRY_CHPLAN_ENT("TJ", 0x26, 1, 0x640), /* Tajikistan */
|
||||
COUNTRY_CHPLAN_ENT("TK", 0x45, 1, 0x000), /* Tokelau */
|
||||
COUNTRY_CHPLAN_ENT("TM", 0x26, 1, 0x000), /* Turkmenistan */
|
||||
COUNTRY_CHPLAN_ENT("TN", 0x47, 1, 0x7F1), /* Tunisia */
|
||||
COUNTRY_CHPLAN_ENT("TO", 0x26, 1, 0x000), /* Tonga */
|
||||
COUNTRY_CHPLAN_ENT("TR", 0x26, 1, 0x7F1), /* Turkey, Northern Cyprus */
|
||||
COUNTRY_CHPLAN_ENT("TT", 0x42, 1, 0x3F1), /* Trinidad & Tobago */
|
||||
COUNTRY_CHPLAN_ENT("TW", 0x76, 1, 0x7FF), /* Taiwan */
|
||||
COUNTRY_CHPLAN_ENT("TZ", 0x26, 1, 0x6F0), /* Tanzania */
|
||||
COUNTRY_CHPLAN_ENT("UA", 0x36, 1, 0x7FB), /* Ukraine */
|
||||
COUNTRY_CHPLAN_ENT("UG", 0x26, 1, 0x6F1), /* Uganda */
|
||||
COUNTRY_CHPLAN_ENT("US", 0x76, 1, 0x7FF), /* United States of America (USA) */
|
||||
COUNTRY_CHPLAN_ENT("UY", 0x30, 1, 0x7F1), /* Uruguay */
|
||||
COUNTRY_CHPLAN_ENT("UZ", 0x47, 1, 0x6F0), /* Uzbekistan */
|
||||
COUNTRY_CHPLAN_ENT("VA", 0x26, 1, 0x000), /* Holy See (Vatican City) */
|
||||
COUNTRY_CHPLAN_ENT("VC", 0x34, 1, 0x010), /* Saint Vincent and the Grenadines */
|
||||
COUNTRY_CHPLAN_ENT("VE", 0x30, 1, 0x7F1), /* Venezuela */
|
||||
COUNTRY_CHPLAN_ENT("VI", 0x34, 1, 0x000), /* United States Virgin Islands (USA) */
|
||||
COUNTRY_CHPLAN_ENT("VN", 0x26, 1, 0x7F1), /* Vietnam */
|
||||
COUNTRY_CHPLAN_ENT("VU", 0x26, 1, 0x000), /* Vanuatu */
|
||||
COUNTRY_CHPLAN_ENT("WF", 0x26, 1, 0x000), /* Wallis and Futuna (France) */
|
||||
COUNTRY_CHPLAN_ENT("WS", 0x34, 1, 0x000), /* Samoa */
|
||||
COUNTRY_CHPLAN_ENT("YE", 0x26, 1, 0x040), /* Yemen */
|
||||
COUNTRY_CHPLAN_ENT("YT", 0x26, 1, 0x680), /* Mayotte (France) */
|
||||
COUNTRY_CHPLAN_ENT("ZA", 0x26, 1, 0x7F1), /* South Africa */
|
||||
COUNTRY_CHPLAN_ENT("ZM", 0x26, 1, 0x6B0), /* Zambia */
|
||||
COUNTRY_CHPLAN_ENT("ZW", 0x26, 1, 0x7F1), /* Zimbabwe */
|
||||
};
|
||||
|
||||
/*
|
||||
* rtw_get_chplan_from_country -
|
||||
* @country_code: string of country code
|
||||
*
|
||||
* Return pointer of struct country_chplan entry or NULL when unsupported country_code is given
|
||||
*/
|
||||
const struct country_chplan *rtw_get_chplan_from_country(const char *country_code)
|
||||
{
|
||||
#if RTW_DEF_MODULE_REGULATORY_CERT
|
||||
const struct country_chplan *exc_ent = NULL;
|
||||
#endif
|
||||
const struct country_chplan *ent = NULL;
|
||||
const struct country_chplan *map = NULL;
|
||||
u16 map_sz = 0;
|
||||
char code[2];
|
||||
int i;
|
||||
|
||||
code[0] = alpha_to_upper(country_code[0]);
|
||||
code[1] = alpha_to_upper(country_code[1]);
|
||||
|
||||
#ifdef CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP
|
||||
map = CUSTOMIZED_country_chplan_map;
|
||||
map_sz = sizeof(CUSTOMIZED_country_chplan_map) / sizeof(struct country_chplan);
|
||||
#else
|
||||
#if RTW_DEF_MODULE_REGULATORY_CERT
|
||||
exc_ent = rtw_def_module_get_chplan_from_country(code);
|
||||
#endif
|
||||
map = country_chplan_map;
|
||||
map_sz = sizeof(country_chplan_map) / sizeof(struct country_chplan);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < map_sz; i++) {
|
||||
if (strncmp(code, map[i].alpha2, 2) == 0) {
|
||||
ent = &map[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
#if RTW_DEF_MODULE_REGULATORY_CERT
|
||||
if (!ent || !(COUNTRY_CHPLAN_DEF_MODULE_FALGS(ent) & RTW_DEF_MODULE_REGULATORY_CERT))
|
||||
exc_ent = ent = NULL;
|
||||
if (exc_ent)
|
||||
ent = exc_ent;
|
||||
#endif
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
const char *const _regd_str[] = {
|
||||
"NONE",
|
||||
"FCC",
|
||||
@@ -1161,7 +694,6 @@ struct regd_exc_ent *_rtw_regd_exc_search(struct rf_ctl_t *rfctl, const char *co
|
||||
break;
|
||||
}
|
||||
|
||||
exit:
|
||||
if (match)
|
||||
return ent;
|
||||
else
|
||||
@@ -1341,13 +873,13 @@ void dump_txpwr_lmt(void *sel, _adapter *adapter)
|
||||
ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list);
|
||||
cur = get_next(cur);
|
||||
|
||||
sprintf(fmt, "%%%zus%%s ", strlen(ent->regd_name) < 4 ? 5 - strlen(ent->regd_name) : 1);
|
||||
sprintf(fmt, "%%%zus%%s ", strlen(ent->regd_name) >= 6 ? 1 : 6 - strlen(ent->regd_name));
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt
|
||||
, strcmp(ent->regd_name, rfctl->regd_name) == 0 ? "*" : ""
|
||||
, ent->regd_name);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
}
|
||||
sprintf(fmt, "%%%zus%%s ", strlen(regd_str(TXPWR_LMT_WW)) < 4 ? 5 - strlen(regd_str(TXPWR_LMT_WW)) : 1);
|
||||
sprintf(fmt, "%%%zus%%s ", strlen(regd_str(TXPWR_LMT_WW)) >= 6 ? 1 : 6 - strlen(regd_str(TXPWR_LMT_WW)));
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt
|
||||
, strcmp(rfctl->regd_name, regd_str(TXPWR_LMT_WW)) == 0 ? "*" : ""
|
||||
, regd_str(TXPWR_LMT_WW));
|
||||
@@ -1394,45 +926,41 @@ void dump_txpwr_lmt(void *sel, _adapter *adapter)
|
||||
ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list);
|
||||
cur = get_next(cur);
|
||||
lmt = phy_get_txpwr_lmt_abs(adapter, ent->regd_name, band, bw, tlrs, ntx_idx, ch, 0);
|
||||
if (lmt == MAX_POWER_INDEX) {
|
||||
sprintf(fmt, "%%%zus ", strlen(ent->regd_name) >= 5 ? strlen(ent->regd_name) + 1 : 5);
|
||||
if (lmt == hal_spec->txgi_max) {
|
||||
sprintf(fmt, "%%%zus ", strlen(ent->regd_name) >= 6 ? strlen(ent->regd_name) + 1 : 6);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, "NA");
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
} else {
|
||||
if (lmt == -1) { /* -0.5 */
|
||||
sprintf(fmt, "%%%zus ", strlen(ent->regd_name) >= 5 ? strlen(ent->regd_name) + 1 : 5);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, "-0.5");
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
} else if (lmt % 2) { /* n.5 */
|
||||
sprintf(fmt, "%%%zud.5 ", strlen(ent->regd_name) >= 5 ? strlen(ent->regd_name) - 1 : 3);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, lmt / 2);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
} else { /* n */
|
||||
sprintf(fmt, "%%%zud ", strlen(ent->regd_name) >= 5 ? strlen(ent->regd_name) + 1 : 5);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, lmt / 2);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
}
|
||||
} else if (lmt > -hal_spec->txgi_pdbm && lmt < 0) { /* -0.xx */
|
||||
sprintf(fmt, "%%%zus-0.%%d ", strlen(ent->regd_name) >= 6 ? strlen(ent->regd_name) - 4 : 1);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, "", (rtw_abs(lmt) % hal_spec->txgi_pdbm) * 100 / hal_spec->txgi_pdbm);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
} else if (lmt % hal_spec->txgi_pdbm) { /* d.xx */
|
||||
sprintf(fmt, "%%%zud.%%d ", strlen(ent->regd_name) >= 6 ? strlen(ent->regd_name) - 2 : 3);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, lmt / hal_spec->txgi_pdbm, (rtw_abs(lmt) % hal_spec->txgi_pdbm) * 100 / hal_spec->txgi_pdbm);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
} else { /* d */
|
||||
sprintf(fmt, "%%%zud ", strlen(ent->regd_name) >= 6 ? strlen(ent->regd_name) + 1 : 6);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, lmt / hal_spec->txgi_pdbm);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
}
|
||||
}
|
||||
lmt = phy_get_txpwr_lmt_abs(adapter, regd_str(TXPWR_LMT_WW), band, bw, tlrs, ntx_idx, ch, 0);
|
||||
if (lmt == MAX_POWER_INDEX) {
|
||||
sprintf(fmt, "%%%zus ", strlen(regd_str(TXPWR_LMT_WW)) >= 5 ? strlen(regd_str(TXPWR_LMT_WW)) + 1 : 5);
|
||||
if (lmt == hal_spec->txgi_max) {
|
||||
sprintf(fmt, "%%%zus ", strlen(regd_str(TXPWR_LMT_WW)) >= 6 ? strlen(regd_str(TXPWR_LMT_WW)) + 1 : 6);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, "NA");
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
} else {
|
||||
if (lmt == -1) { /* -0.5 */
|
||||
sprintf(fmt, "%%%zus ", strlen(regd_str(TXPWR_LMT_WW)) >= 5 ? strlen(regd_str(TXPWR_LMT_WW)) + 1 : 5);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, "-0.5");
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
} else if (lmt % 2) { /* n.5 */
|
||||
sprintf(fmt, "%%%zud.5 ", strlen(regd_str(TXPWR_LMT_WW)) >= 5 ? strlen(regd_str(TXPWR_LMT_WW)) - 1 : 3);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, lmt / 2);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
} else { /* n */
|
||||
sprintf(fmt, "%%%zud ", strlen(regd_str(TXPWR_LMT_WW)) >= 5 ? strlen(regd_str(TXPWR_LMT_WW)) + 1 : 5);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, lmt / 2);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
}
|
||||
} else if (lmt > -hal_spec->txgi_pdbm && lmt < 0) { /* -0.xx */
|
||||
sprintf(fmt, "%%%zus-0.%%d ", strlen(regd_str(TXPWR_LMT_WW)) >= 6 ? strlen(regd_str(TXPWR_LMT_WW)) - 4 : 1);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, "", (rtw_abs(lmt) % hal_spec->txgi_pdbm) * 100 / hal_spec->txgi_pdbm);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
} else if (lmt % hal_spec->txgi_pdbm) { /* d.xx */
|
||||
sprintf(fmt, "%%%zud.%%d ", strlen(regd_str(TXPWR_LMT_WW)) >= 6 ? strlen(regd_str(TXPWR_LMT_WW)) - 2 : 3);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, lmt / hal_spec->txgi_pdbm, (rtw_abs(lmt) % hal_spec->txgi_pdbm) * 100 / hal_spec->txgi_pdbm);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
} else { /* d */
|
||||
sprintf(fmt, "%%%zud ", strlen(regd_str(TXPWR_LMT_WW)) >= 6 ? strlen(regd_str(TXPWR_LMT_WW)) + 1 : 6);
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt, lmt / hal_spec->txgi_pdbm);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
}
|
||||
|
||||
/* dump limit offset of each path */
|
||||
@@ -1450,8 +978,8 @@ void dump_txpwr_lmt(void *sel, _adapter *adapter)
|
||||
ent = LIST_CONTAINOR(cur, struct txpwr_lmt_ent, list);
|
||||
cur = get_next(cur);
|
||||
lmt_offset = phy_get_txpwr_lmt(adapter, ent->regd_name, band, bw, path, rs, ntx_idx, ch, 0);
|
||||
if (lmt_offset == MAX_POWER_INDEX) {
|
||||
*(lmt_idx + i * RF_PATH_MAX + path) = MAX_POWER_INDEX;
|
||||
if (lmt_offset == hal_spec->txgi_max) {
|
||||
*(lmt_idx + i * RF_PATH_MAX + path) = hal_spec->txgi_max;
|
||||
_RTW_PRINT_SEL(sel, "%3s ", "NA");
|
||||
} else {
|
||||
*(lmt_idx + i * RF_PATH_MAX + path) = lmt_offset + base;
|
||||
@@ -1460,7 +988,7 @@ void dump_txpwr_lmt(void *sel, _adapter *adapter)
|
||||
i++;
|
||||
}
|
||||
lmt_offset = phy_get_txpwr_lmt(adapter, regd_str(TXPWR_LMT_WW), band, bw, path, rs, ntx_idx, ch, 0);
|
||||
if (lmt_offset == MAX_POWER_INDEX)
|
||||
if (lmt_offset == hal_spec->txgi_max)
|
||||
_RTW_PRINT_SEL(sel, "%3s ", "NA");
|
||||
else
|
||||
_RTW_PRINT_SEL(sel, "%3d ", lmt_offset);
|
||||
@@ -1502,6 +1030,7 @@ release_lock:
|
||||
void rtw_txpwr_lmt_add_with_nlen(struct rf_ctl_t *rfctl, const char *regd_name, u32 nlen
|
||||
, u8 band, u8 bw, u8 tlrs, u8 ntx_idx, u8 ch_idx, s8 lmt)
|
||||
{
|
||||
struct hal_spec_t *hal_spec = GET_HAL_SPEC(dvobj_get_primary_adapter(rfctl_to_dvobj(rfctl)));
|
||||
struct txpwr_lmt_ent *ent;
|
||||
_irqL irqL;
|
||||
_list *cur, *head;
|
||||
@@ -1540,13 +1069,13 @@ void rtw_txpwr_lmt_add_with_nlen(struct rf_ctl_t *rfctl, const char *regd_name,
|
||||
for (k = 0; k < TXPWR_LMT_RS_NUM_2G; ++k)
|
||||
for (m = 0; m < CENTER_CH_2G_NUM; ++m)
|
||||
for (l = 0; l < MAX_TX_COUNT; ++l)
|
||||
ent->lmt_2g[j][k][m][l] = MAX_POWER_INDEX;
|
||||
ent->lmt_2g[j][k][m][l] = hal_spec->txgi_max;
|
||||
#ifdef CONFIG_IEEE80211_BAND_5GHZ
|
||||
for (j = 0; j < MAX_5G_BANDWIDTH_NUM; ++j)
|
||||
for (k = 0; k < TXPWR_LMT_RS_NUM_5G; ++k)
|
||||
for (m = 0; m < CENTER_CH_5G_ALL_NUM; ++m)
|
||||
for (l = 0; l < MAX_TX_COUNT; ++l)
|
||||
ent->lmt_5g[j][k][m][l] = MAX_POWER_INDEX;
|
||||
ent->lmt_5g[j][k][m][l] = hal_spec->txgi_max;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1563,7 +1092,7 @@ chk_lmt_val:
|
||||
else
|
||||
goto release_lock;
|
||||
|
||||
if (pre_lmt != MAX_POWER_INDEX)
|
||||
if (pre_lmt != hal_spec->txgi_max)
|
||||
RTW_PRINT("duplicate txpwr_lmt for [%s][%s][%s][%s][%uT][%d]\n"
|
||||
, regd_name, band_str(band), ch_width_str(bw), txpwr_lmt_rs_str(tlrs), ntx_idx + 1
|
||||
, band == BAND_ON_2_4G ? ch_idx + 1 : center_ch_5g_all[ch_idx]);
|
||||
@@ -1684,7 +1213,6 @@ s8 rtw_rf_get_kfree_tx_gain_offset(_adapter *padapter, u8 path, u8 ch)
|
||||
s8 kfree_offset = 0;
|
||||
|
||||
#ifdef CONFIG_RF_POWER_TRIM
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(padapter);
|
||||
struct kfree_data_t *kfree_data = GET_KFREE_DATA(padapter);
|
||||
s8 bb_gain_sel = rtw_ch_to_bb_gain_sel(ch);
|
||||
|
||||
@@ -1710,7 +1238,9 @@ exit:
|
||||
|
||||
void rtw_rf_set_tx_gain_offset(_adapter *adapter, u8 path, s8 offset)
|
||||
{
|
||||
#if !defined(CONFIG_RTL8814A) && !defined(CONFIG_RTL8822B) && !defined(CONFIG_RTL8821C)
|
||||
u8 write_value;
|
||||
#endif
|
||||
u8 target_path = 0;
|
||||
u32 val32 = 0;
|
||||
|
||||
@@ -1749,6 +1279,12 @@ void rtw_rf_set_tx_gain_offset(_adapter *adapter, u8 path, s8 offset)
|
||||
rtw_hal_write_rfreg(adapter, target_path, 0x55, 0x0fc000, write_value);
|
||||
break;
|
||||
#endif /* CONFIG_RTL8188F */
|
||||
#ifdef CONFIG_RTL8188GTV
|
||||
case RTL8188GTV:
|
||||
write_value = RF_TX_GAIN_OFFSET_8188GTV(offset);
|
||||
rtw_hal_write_rfreg(adapter, target_path, 0x55, 0x0fc000, write_value);
|
||||
break;
|
||||
#endif /* CONFIG_RTL8188GTV */
|
||||
#ifdef CONFIG_RTL8192E
|
||||
case RTL8192E:
|
||||
write_value = RF_TX_GAIN_OFFSET_8192E(offset);
|
||||
@@ -1762,10 +1298,11 @@ void rtw_rf_set_tx_gain_offset(_adapter *adapter, u8 path, s8 offset)
|
||||
rtw_hal_write_rfreg(adapter, target_path, 0x55, 0x0f8000, write_value);
|
||||
break;
|
||||
#endif /* CONFIG_RTL8821A */
|
||||
#if defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C)
|
||||
#if defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8192F)
|
||||
case RTL8814A:
|
||||
case RTL8822B:
|
||||
case RTL8821C:
|
||||
case RTL8192F:
|
||||
RTW_INFO("\nkfree by PhyDM on the sw CH. path %d\n", path);
|
||||
break;
|
||||
#endif /* CONFIG_RTL8814A || CONFIG_RTL8822B || CONFIG_RTL8821C */
|
||||
|
||||
@@ -430,40 +430,17 @@ int issue_null_reply(struct rm_obj *prm)
|
||||
int ready_for_scan(struct rm_obj *prm)
|
||||
{
|
||||
_adapter *padapter = prm->psta->padapter;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
|
||||
if (rtw_is_scan_deny(padapter))
|
||||
return _FALSE;
|
||||
u8 ssc_chk;
|
||||
|
||||
if (!rtw_is_adapter_up(padapter))
|
||||
return _FALSE;
|
||||
|
||||
if (rtw_mi_busy_traffic_check(padapter, _FALSE))
|
||||
return _FALSE;
|
||||
ssc_chk = rtw_sitesurvey_condition_check(padapter, _FALSE);
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)
|
||||
&& check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" WIFI_AP_STATE && WIFI_UNDER_WPS\n",
|
||||
FUNC_ADPT_ARG(padapter));
|
||||
return _FALSE;
|
||||
}
|
||||
if (check_fwstate(pmlmepriv,
|
||||
(_FW_UNDER_SURVEY | _FW_UNDER_LINKING)) == _TRUE) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" _FW_UNDER_SURVEY|_FW_UNDER_LINKING\n",
|
||||
FUNC_ADPT_ARG(padapter));
|
||||
return _FALSE;
|
||||
}
|
||||
if (ssc_chk == SS_ALLOW)
|
||||
return _SUCCESS;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (rtw_mi_buddy_check_fwstate(padapter,
|
||||
(_FW_UNDER_SURVEY | _FW_UNDER_LINKING | WIFI_UNDER_WPS))) {
|
||||
RTW_INFO(FUNC_ADPT_FMT", but buddy_intf is under scanning or linking or wps_phase\n",
|
||||
FUNC_ADPT_ARG(padapter));
|
||||
return _FALSE;
|
||||
}
|
||||
#endif
|
||||
return _SUCCESS;
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
int rm_sitesurvey(struct rm_obj *prm)
|
||||
|
||||
@@ -656,8 +656,8 @@ static int rm_state_do_meas(struct rm_obj *prm, enum RM_EV_ID evid)
|
||||
case RM_EV_start_meas:
|
||||
if (prm->q.action_code == RM_ACT_RADIO_MEAS_REQ) {
|
||||
/* resotre measurement start time */
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_TSF, (u8 *)&val64);
|
||||
prm->meas_start_time = val64;
|
||||
prm->meas_start_time = rtw_hal_get_tsftr_by_port(padapter
|
||||
, rtw_hal_get_port(padapter));
|
||||
|
||||
switch (prm->q.m_type) {
|
||||
case bcn_req:
|
||||
@@ -741,8 +741,8 @@ static int rm_state_do_meas(struct rm_obj *prm, enum RM_EV_ID evid)
|
||||
case RM_EV_state_out:
|
||||
rm_cancel_clock(prm);
|
||||
/* resotre measurement end time */
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_TSF, (u8 *)&val64);
|
||||
_rtw_memcpy(&prm->meas_end_time, (char *)&val64, sizeof(u64));
|
||||
prm->meas_end_time = rtw_hal_get_tsftr_by_port(padapter
|
||||
, rtw_hal_get_port(padapter));
|
||||
|
||||
val8 = 0; /* Disable free run counter */
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_FREECNT, &val8);
|
||||
|
||||
@@ -555,7 +555,7 @@ void rtw_rson_scan_cmd_hdl(_adapter *padapter, int op)
|
||||
RTW_INFO("change to widi listen\n");
|
||||
}
|
||||
#endif /* CONFIG_INTEL_WIDI */
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
rtw_free_assoc_resources(padapter, _TRUE);
|
||||
rtw_indicate_disconnect(padapter, 0, _FALSE);
|
||||
} else
|
||||
pmlmepriv->to_join = _TRUE;
|
||||
|
||||
@@ -982,13 +982,6 @@ static void next_key(u8 *key, sint round);
|
||||
static void byte_sub(u8 *in, u8 *out);
|
||||
static void shift_row(u8 *in, u8 *out);
|
||||
static void mix_column(u8 *in, u8 *out);
|
||||
#ifndef PLATFORM_FREEBSD
|
||||
static void add_round_key(u8 *shiftrow_in,
|
||||
u8 *mcol_in,
|
||||
u8 *block_in,
|
||||
sint round,
|
||||
u8 *out);
|
||||
#endif /* PLATFORM_FREEBSD */
|
||||
static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext);
|
||||
|
||||
|
||||
@@ -1929,7 +1922,6 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
|
||||
|
||||
sint length;
|
||||
u32 prwskeylen;
|
||||
u8 *pframe, *prwskey; /* , *payload,*iv */
|
||||
struct sta_info *stainfo;
|
||||
struct rx_pkt_attrib *prxattrib = &((union recv_frame *)precvframe)->u.hdr.attrib;
|
||||
@@ -2139,6 +2131,7 @@ BIP_exit:
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
#ifndef PLATFORM_FREEBSD
|
||||
#if defined(CONFIG_TDLS)
|
||||
/* compress 512-bits */
|
||||
static int sha256_compress(struct sha256_state *md, unsigned char *buf)
|
||||
{
|
||||
@@ -2319,7 +2312,9 @@ static u8 os_strlen(const char *s)
|
||||
p++;
|
||||
return p - s;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TDLS) || defined(CONFIG_RTW_MESH_AEK)
|
||||
static int os_memcmp(const void *s1, const void *s2, u8 n)
|
||||
{
|
||||
const unsigned char *p1 = s1, *p2 = s2;
|
||||
@@ -2337,6 +2332,7 @@ static int os_memcmp(const void *s1, const void *s2, u8 n)
|
||||
|
||||
return *p1 - *p2;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* hmac_sha256_vector - HMAC-SHA256 over data vector (RFC 2104)
|
||||
@@ -2347,6 +2343,7 @@ static int os_memcmp(const void *s1, const void *s2, u8 n)
|
||||
* @len: Lengths of the data blocks
|
||||
* @mac: Buffer for the hash (32 bytes)
|
||||
*/
|
||||
#if defined(CONFIG_TDLS)
|
||||
static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
|
||||
u8 *addr[], size_t *len, u8 *mac)
|
||||
{
|
||||
@@ -2408,6 +2405,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
|
||||
_len[1] = 32;
|
||||
sha256_vector(2, _addr, _len, mac);
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
#endif /* PLATFORM_FREEBSD */
|
||||
/**
|
||||
* sha256_prf - SHA256-based Pseudo-Random Function (IEEE 802.11r, 8.5.1.5.2)
|
||||
@@ -2423,6 +2421,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
|
||||
* given key.
|
||||
*/
|
||||
#ifndef PLATFORM_FREEBSD /* Baron */
|
||||
#if defined(CONFIG_TDLS)
|
||||
static void sha256_prf(u8 *key, size_t key_len, char *label,
|
||||
u8 *data, size_t data_len, u8 *buf, size_t buf_len)
|
||||
{
|
||||
@@ -2459,6 +2458,7 @@ static void sha256_prf(u8 *key, size_t key_len, char *label,
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* PLATFORM_FREEBSD Baron */
|
||||
|
||||
/* AES tables*/
|
||||
|
||||
@@ -47,10 +47,9 @@ u8 sreset_get_wifi_status(_adapter *padapter)
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
u8 status = WIFI_STATUS_SUCCESS;
|
||||
u32 val32 = 0;
|
||||
_irqL irqL;
|
||||
|
||||
if (psrtpriv->silent_reset_inprogress == _TRUE)
|
||||
return status;
|
||||
val32 = rtw_read32(padapter, REG_TXDMA_STATUS);
|
||||
@@ -104,11 +103,9 @@ bool sreset_inprogress(_adapter *padapter)
|
||||
|
||||
void sreset_restore_security_station(_adapter *padapter)
|
||||
{
|
||||
u8 EntryId = 0;
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct security_priv *psecuritypriv = &(padapter->securitypriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
|
||||
|
||||
{
|
||||
@@ -147,25 +144,6 @@ void sreset_restore_network_station(_adapter *padapter)
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
u8 doiqk = _FALSE;
|
||||
|
||||
#if 0
|
||||
{
|
||||
/* ======================================================= */
|
||||
/* reset related register of Beacon control */
|
||||
|
||||
/* set MSR to nolink */
|
||||
Set_MSR(padapter, _HW_STATE_NOLINK_);
|
||||
/* reject all data frame */
|
||||
rtw_write16(padapter, REG_RXFLTMAP2, 0x00);
|
||||
/* reset TSF */
|
||||
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0) | BIT(1)));
|
||||
|
||||
/* disable update TSF */
|
||||
SetBcnCtrlReg(padapter, BIT(4), 0);
|
||||
|
||||
/* ======================================================= */
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure, RTW_CMDF_DIRECTLY);
|
||||
|
||||
{
|
||||
@@ -173,6 +151,7 @@ void sreset_restore_network_station(_adapter *padapter)
|
||||
#ifdef CONFIG_USB_HCI
|
||||
/* TH=1 => means that invalidate usb rx aggregation */
|
||||
/* TH=0 => means that validate usb rx aggregation, use init value. */
|
||||
#ifdef CONFIG_80211N_HT
|
||||
if (mlmepriv->htpriv.ht_option) {
|
||||
if (padapter->registrypriv.wifi_spec == 1)
|
||||
threshold = 1;
|
||||
@@ -183,6 +162,7 @@ void sreset_restore_network_station(_adapter *padapter)
|
||||
threshold = 1;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
}
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -200,8 +180,9 @@ void sreset_restore_network_station(_adapter *padapter)
|
||||
|
||||
{
|
||||
u8 join_type = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
|
||||
|
||||
rtw_hal_rcr_set_chk_bssid(padapter, MLME_STA_CONNECTING);
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
|
||||
}
|
||||
|
||||
Set_MSR(padapter, (pmlmeinfo->state & 0x3));
|
||||
@@ -217,8 +198,6 @@ void sreset_restore_network_station(_adapter *padapter)
|
||||
void sreset_restore_network_status(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
|
||||
@@ -498,7 +498,7 @@ static void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
|
||||
/* struct sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr) */
|
||||
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
|
||||
{
|
||||
_irqL irqL, irqL2;
|
||||
_irqL irqL2;
|
||||
s32 index;
|
||||
_list *phash_list;
|
||||
struct sta_info *psta;
|
||||
@@ -595,6 +595,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
|
||||
#endif
|
||||
/* init for the sequence number of received management frame */
|
||||
psta->RxMgmtFrameSeqNum = 0xffff;
|
||||
_rtw_memset(&psta->sta_stats, 0, sizeof(struct stainfo_stats));
|
||||
|
||||
rtw_alloc_macid(pstapriv->padapter, psta);
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@ void rtw_tdls_process_ht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8
|
||||
}
|
||||
|
||||
if (ptdls_sta->flags & WLAN_STA_HT) {
|
||||
if (padapter->registrypriv.ht_enable == _TRUE) {
|
||||
if (padapter->registrypriv.ht_enable == _TRUE && is_supported_ht(padapter->registrypriv.wireless_mode) ) {
|
||||
ptdls_sta->htpriv.ht_option = _TRUE;
|
||||
ptdls_sta->qos_option = _TRUE;
|
||||
} else {
|
||||
@@ -559,7 +559,7 @@ void rtw_tdls_process_vht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8
|
||||
|
||||
if (ptdls_sta->flags & WLAN_STA_VHT) {
|
||||
if (REGSTY_IS_11AC_ENABLE(&padapter->registrypriv)
|
||||
&& hal_chk_proto_cap(padapter, PROTO_CAP_11AC)
|
||||
&& is_supported_vht(padapter->registrypriv.wireless_mode)
|
||||
&& (!rfctl->country_ent || COUNTRY_CHPLAN_EN_11AC(rfctl->country_ent)))
|
||||
ptdls_sta->vhtpriv.vht_option = _TRUE;
|
||||
else
|
||||
@@ -2374,7 +2374,7 @@ int On_TDLS_Dis_Req(_adapter *padapter, union recv_frame *precv_frame)
|
||||
if (psta_ap == NULL)
|
||||
goto exit;
|
||||
dst = pIE->data + 12;
|
||||
if (MacAddr_isBcst(dst) == _FALSE && (_rtw_memcmp(adapter_mac_addr(padapter), dst, 6) == _FALSE))
|
||||
if (MacAddr_isBcst(dst) == _FALSE && (_rtw_memcmp(adapter_mac_addr(padapter), dst, ETH_ALEN) == _FALSE))
|
||||
goto exit;
|
||||
break;
|
||||
default:
|
||||
@@ -2853,7 +2853,7 @@ void rtw_build_tdls_setup_req_ies(_adapter *padapter, struct xmit_frame *pxmitfr
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
if ((padapter->mlmepriv.htpriv.ht_option == _TRUE) && (pmlmeext->cur_channel > 14)
|
||||
&& REGSTY_IS_11AC_ENABLE(pregistrypriv)
|
||||
&& hal_chk_proto_cap(padapter, PROTO_CAP_11AC)
|
||||
&& is_supported_vht(pregistrypriv->wireless_mode)
|
||||
&& (!rfctl->country_ent || COUNTRY_CHPLAN_EN_11AC(rfctl->country_ent))
|
||||
) {
|
||||
pframe = rtw_tdls_set_aid(padapter, pframe, pattrib);
|
||||
@@ -2948,7 +2948,7 @@ void rtw_build_tdls_setup_rsp_ies(_adapter *padapter, struct xmit_frame *pxmitfr
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
if ((padapter->mlmepriv.htpriv.ht_option == _TRUE) && (pmlmeext->cur_channel > 14)
|
||||
&& REGSTY_IS_11AC_ENABLE(pregistrypriv)
|
||||
&& hal_chk_proto_cap(padapter, PROTO_CAP_11AC)
|
||||
&& is_supported_vht(pregistrypriv->wireless_mode)
|
||||
&& (!rfctl->country_ent || COUNTRY_CHPLAN_EN_11AC(rfctl->country_ent))
|
||||
) {
|
||||
pframe = rtw_tdls_set_aid(padapter, pframe, pattrib);
|
||||
@@ -3025,7 +3025,7 @@ void rtw_build_tdls_setup_cfm_ies(_adapter *padapter, struct xmit_frame *pxmitfr
|
||||
if ((padapter->mlmepriv.htpriv.ht_option == _TRUE)
|
||||
&& (ptdls_sta->vhtpriv.vht_option == _TRUE) && (pmlmeext->cur_channel > 14)
|
||||
&& REGSTY_IS_11AC_ENABLE(pregistrypriv)
|
||||
&& hal_chk_proto_cap(padapter, PROTO_CAP_11AC)
|
||||
&& is_supported_vht(pregistrypriv->wireless_mode)
|
||||
&& (!rfctl->country_ent || COUNTRY_CHPLAN_EN_11AC(rfctl->country_ent))
|
||||
) {
|
||||
pframe = rtw_tdls_set_vht_operation(padapter, pframe, pattrib, pmlmeext->cur_channel);
|
||||
|
||||
122
core/rtw_vht.c
122
core/rtw_vht.c
@@ -61,10 +61,6 @@ void dump_vht_cap_ie_content(void *sel, const u8 *buf, u32 buf_len)
|
||||
|
||||
void dump_vht_cap_ie(void *sel, const u8 *ie, u32 ie_len)
|
||||
{
|
||||
const u8 *pos = ie;
|
||||
u16 id;
|
||||
u16 len;
|
||||
|
||||
const u8 *vht_cap_ie;
|
||||
sint vht_cap_ielen;
|
||||
|
||||
@@ -99,10 +95,6 @@ void dump_vht_op_ie_content(void *sel, const u8 *buf, u32 buf_len)
|
||||
|
||||
void dump_vht_op_ie(void *sel, const u8 *ie, u32 ie_len)
|
||||
{
|
||||
const u8 *pos = ie;
|
||||
u16 id;
|
||||
u16 len;
|
||||
|
||||
const u8 *vht_op_ie;
|
||||
sint vht_op_ielen;
|
||||
|
||||
@@ -490,6 +482,83 @@ void update_hw_vht_param(_adapter *padapter)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&pvhtpriv->ampdu_len));
|
||||
}
|
||||
|
||||
#ifdef ROKU_PRIVATE
|
||||
u8 VHT_get_ss_from_map(u8 *vht_mcs_map)
|
||||
{
|
||||
u8 i, j;
|
||||
u8 ss = 0;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (vht_mcs_map[i] != 0xff) {
|
||||
for (j = 0; j < 8; j += 2) {
|
||||
if (((vht_mcs_map[i] >> j) & 0x03) == 0x03)
|
||||
break;
|
||||
ss++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ss;
|
||||
}
|
||||
|
||||
void VHT_caps_handler_infra_ap(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv_infra_ap *pvhtpriv = &pmlmepriv->vhtpriv_infra_ap;
|
||||
u8 cur_stbc_cap_infra_ap = 0;
|
||||
u16 cur_beamform_cap_infra_ap = 0;
|
||||
u8 *pcap_mcs;
|
||||
u8 *pcap_mcs_tx;
|
||||
u8 Rx_ss = 0, Tx_ss = 0;
|
||||
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if (pIE == NULL)
|
||||
return;
|
||||
|
||||
pmlmeinfo->ht_vht_received |= BIT(1);
|
||||
|
||||
pvhtpriv->ldpc_cap_infra_ap = GET_VHT_CAPABILITY_ELE_RX_LDPC(pIE->data);
|
||||
|
||||
if (GET_VHT_CAPABILITY_ELE_RX_STBC(pIE->data))
|
||||
SET_FLAG(cur_stbc_cap_infra_ap, STBC_VHT_ENABLE_RX);
|
||||
if (GET_VHT_CAPABILITY_ELE_TX_STBC(pIE->data))
|
||||
SET_FLAG(cur_stbc_cap_infra_ap, STBC_VHT_ENABLE_TX);
|
||||
pvhtpriv->stbc_cap_infra_ap = cur_stbc_cap_infra_ap;
|
||||
|
||||
/*store ap info for channel bandwidth*/
|
||||
pvhtpriv->channel_width_infra_ap = GET_VHT_CAPABILITY_ELE_CHL_WIDTH(pIE->data);
|
||||
|
||||
/*check B11: SU Beamformer Capable and B12: SU Beamformee B19: MU Beamformer B20:MU Beamformee*/
|
||||
if (GET_VHT_CAPABILITY_ELE_SU_BFER(pIE->data))
|
||||
SET_FLAG(cur_beamform_cap_infra_ap, BEAMFORMING_VHT_BEAMFORMER_ENABLE);
|
||||
if (GET_VHT_CAPABILITY_ELE_SU_BFEE(pIE->data))
|
||||
SET_FLAG(cur_beamform_cap_infra_ap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE);
|
||||
if (GET_VHT_CAPABILITY_ELE_MU_BFER(pIE->data))
|
||||
SET_FLAG(cur_beamform_cap_infra_ap, BEAMFORMING_VHT_MU_MIMO_AP_ENABLE);
|
||||
if (GET_VHT_CAPABILITY_ELE_MU_BFEE(pIE->data))
|
||||
SET_FLAG(cur_beamform_cap_infra_ap, BEAMFORMING_VHT_MU_MIMO_STA_ENABLE);
|
||||
pvhtpriv->beamform_cap_infra_ap = cur_beamform_cap_infra_ap;
|
||||
|
||||
/*store information about vht_mcs_set*/
|
||||
pcap_mcs = GET_VHT_CAPABILITY_ELE_RX_MCS(pIE->data);
|
||||
pcap_mcs_tx = GET_VHT_CAPABILITY_ELE_TX_MCS(pIE->data);
|
||||
_rtw_memcpy(pvhtpriv->vht_mcs_map_infra_ap, pcap_mcs, 2);
|
||||
_rtw_memcpy(pvhtpriv->vht_mcs_map_tx_infra_ap, pcap_mcs_tx, 2);
|
||||
|
||||
Rx_ss = VHT_get_ss_from_map(pvhtpriv->vht_mcs_map_infra_ap);
|
||||
Tx_ss = VHT_get_ss_from_map(pvhtpriv->vht_mcs_map_tx_infra_ap);
|
||||
if (Rx_ss >= Tx_ss) {
|
||||
pvhtpriv->number_of_streams_infra_ap = Rx_ss;
|
||||
} else{
|
||||
pvhtpriv->number_of_streams_infra_ap = Tx_ss;
|
||||
}
|
||||
|
||||
}
|
||||
#endif /* ROKU_PRIVATE */
|
||||
|
||||
void VHT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
||||
{
|
||||
struct hal_spec_t *hal_spec = GET_HAL_SPEC(padapter);
|
||||
@@ -621,17 +690,21 @@ void rtw_process_vht_op_mode_notify(_adapter *padapter, u8 *pframe, PVOID sta)
|
||||
struct sta_info *psta = (struct sta_info *)sta;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct registry_priv *regsty = adapter_to_regsty(padapter);
|
||||
u8 target_bw;
|
||||
u8 target_rxss, current_rxss;
|
||||
u8 update_ra = _FALSE;
|
||||
u8 tx_nss = 0, rf_type = RF_1T1R;
|
||||
struct hal_spec_t *hal_spec = GET_HAL_SPEC(padapter);
|
||||
|
||||
if (pvhtpriv->vht_option == _FALSE)
|
||||
return;
|
||||
|
||||
target_bw = GET_VHT_OPERATING_MODE_FIELD_CHNL_WIDTH(pframe);
|
||||
target_rxss = (GET_VHT_OPERATING_MODE_FIELD_RX_NSS(pframe) + 1);
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
tx_nss = rtw_min(rf_type_to_rf_tx_cnt(rf_type), hal_spec->tx_nss_num);
|
||||
target_rxss = rtw_min(tx_nss, (GET_VHT_OPERATING_MODE_FIELD_RX_NSS(pframe) + 1));
|
||||
|
||||
if (target_bw != psta->cmn.bw_mode) {
|
||||
if (hal_is_bw_support(padapter, target_bw)
|
||||
@@ -720,7 +793,7 @@ u32 rtw_build_vht_op_mode_notify_ie(_adapter *padapter, u8 *pbuf, u8 bw)
|
||||
|
||||
u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
|
||||
{
|
||||
u8 bw, rf_type, rf_num, rx_stbc_nss = 0;
|
||||
u8 bw, rf_num, rx_stbc_nss = 0;
|
||||
u16 HighestRate;
|
||||
u8 *pcap, *pcap_mcs;
|
||||
u32 len = 0;
|
||||
@@ -738,19 +811,19 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_RX_PACKET_OFFSET, &rx_packet_offset);
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_MAX_RECVBUF_SZ, &max_recvbuf_sz);
|
||||
|
||||
RTW_DBG("%s, line%d, Available RX buf size = %d bytes\n.", __FUNCTION__, __LINE__, max_recvbuf_sz - rx_packet_offset);
|
||||
RTW_DBG("%s, line%d, Available RX buf size = %d bytes\n", __FUNCTION__, __LINE__, max_recvbuf_sz - rx_packet_offset);
|
||||
|
||||
if ((max_recvbuf_sz - rx_packet_offset) >= 11454) {
|
||||
SET_VHT_CAPABILITY_ELE_MAX_MPDU_LENGTH(pcap, 2);
|
||||
RTW_INFO("%s, line%d, Set MAX MPDU len = 11454 bytes\n.", __FUNCTION__, __LINE__);
|
||||
RTW_INFO("%s, line%d, Set MAX MPDU len = 11454 bytes\n", __FUNCTION__, __LINE__);
|
||||
} else if ((max_recvbuf_sz - rx_packet_offset) >= 7991) {
|
||||
SET_VHT_CAPABILITY_ELE_MAX_MPDU_LENGTH(pcap, 1);
|
||||
RTW_INFO("%s, line%d, Set MAX MPDU len = 7991 bytes\n.", __FUNCTION__, __LINE__);
|
||||
RTW_INFO("%s, line%d, Set MAX MPDU len = 7991 bytes\n", __FUNCTION__, __LINE__);
|
||||
} else if ((max_recvbuf_sz - rx_packet_offset) >= 3895) {
|
||||
SET_VHT_CAPABILITY_ELE_MAX_MPDU_LENGTH(pcap, 0);
|
||||
RTW_INFO("%s, line%d, Set MAX MPDU len = 3895 bytes\n.", __FUNCTION__, __LINE__);
|
||||
RTW_INFO("%s, line%d, Set MAX MPDU len = 3895 bytes\n", __FUNCTION__, __LINE__);
|
||||
} else
|
||||
RTW_ERR("%s, line%d, Error!! Available RX buf size < 3895 bytes\n.", __FUNCTION__, __LINE__);
|
||||
RTW_ERR("%s, line%d, Error!! Available RX buf size < 3895 bytes\n", __FUNCTION__, __LINE__);
|
||||
|
||||
/* B2 B3 Supported Channel Width Set */
|
||||
if (hal_chk_bw_cap(padapter, BW_CAP_160M) && REGSTY_IS_BW_5G_SUPPORT(pregistrypriv, CHANNEL_WIDTH_160)) {
|
||||
@@ -811,10 +884,11 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_BEAMFORMEE_CAP, (u8 *)&rf_num);
|
||||
|
||||
/* IOT action suggested by Yu Chen 2017/3/3 */
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_BROADCOM) &&
|
||||
!GET_VHT_CAPABILITY_ELE_MU_BFER(&pvhtpriv->beamform_cap))
|
||||
!pvhtpriv->ap_is_mu_bfer)
|
||||
rf_num = (rf_num >= 2 ? 2 : rf_num);
|
||||
|
||||
#endif
|
||||
/* B13 14 15 Compressed Steering Number of Beamformer Antennas Supported */
|
||||
SET_VHT_CAPABILITY_ELE_BFER_ANT_SUPP(pcap, rf_num);
|
||||
/* B20 SU Beamformee Capable */
|
||||
@@ -859,6 +933,8 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
|
||||
|
||||
u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(padapter);
|
||||
RT_CHANNEL_INFO *chset = rfctl->channel_set;
|
||||
u32 ielen;
|
||||
u8 max_bw;
|
||||
u8 oper_ch, oper_bw = CHANNEL_WIDTH_20, oper_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
@@ -920,7 +996,11 @@ u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_le
|
||||
oper_bw = rtw_min(oper_bw, max_bw);
|
||||
|
||||
/* try downgrage bw to fit in channel plan setting */
|
||||
while (!rtw_chset_is_chbw_valid(adapter_to_chset(padapter), oper_ch, oper_bw, oper_offset)) {
|
||||
while (!rtw_chset_is_chbw_valid(chset, oper_ch, oper_bw, oper_offset)
|
||||
|| (IS_DFS_SLAVE_WITH_RD(rfctl)
|
||||
&& !rtw_odm_dfs_domain_unknown(rfctl_to_dvobj(rfctl))
|
||||
&& rtw_chset_is_chbw_non_ocp(chset, oper_ch, oper_bw, oper_offset))
|
||||
) {
|
||||
oper_bw--;
|
||||
if (oper_bw == CHANNEL_WIDTH_20) {
|
||||
oper_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
@@ -930,7 +1010,9 @@ u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_le
|
||||
}
|
||||
}
|
||||
|
||||
rtw_warn_on(!rtw_chset_is_chbw_valid(adapter_to_chset(padapter), oper_ch, oper_bw, oper_offset));
|
||||
rtw_warn_on(!rtw_chset_is_chbw_valid(chset, oper_ch, oper_bw, oper_offset));
|
||||
if (IS_DFS_SLAVE_WITH_RD(rfctl) && !rtw_odm_dfs_domain_unknown(rfctl_to_dvobj(rfctl)))
|
||||
rtw_warn_on(rtw_chset_is_chbw_non_ocp(chset, oper_ch, oper_bw, oper_offset));
|
||||
|
||||
/* update VHT_OP_IE */
|
||||
if (oper_bw < CHANNEL_WIDTH_80) {
|
||||
|
||||
@@ -1065,7 +1065,7 @@ void wapi_test_set_key(struct _adapter *padapter, u8 *buf)
|
||||
void wapi_test_init(struct _adapter *padapter)
|
||||
{
|
||||
u8 keybuf[100];
|
||||
u8 mac_addr[6] = {0x00, 0xe0, 0x4c, 0x72, 0x04, 0x70};
|
||||
u8 mac_addr[ETH_ALEN] = {0x00, 0xe0, 0x4c, 0x72, 0x04, 0x70};
|
||||
u8 UskDataKey[16] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
|
||||
u8 UskMicKey[16] = {0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f};
|
||||
u8 UskId = 0;
|
||||
@@ -1091,7 +1091,7 @@ void wapi_test_init(struct _adapter *padapter)
|
||||
keybuf[2] = 1; /* AE */
|
||||
keybuf[3] = 0; /* not update */
|
||||
|
||||
memcpy(keybuf + 4, mac_addr, 6);
|
||||
memcpy(keybuf + 4, mac_addr, ETH_ALEN);
|
||||
memcpy(keybuf + 10, UskDataKey, 16);
|
||||
memcpy(keybuf + 26, UskMicKey, 16);
|
||||
keybuf[42] = UskId;
|
||||
@@ -1103,7 +1103,7 @@ void wapi_test_init(struct _adapter *padapter)
|
||||
keybuf[2] = 0; /* AE */
|
||||
keybuf[3] = 0; /* not update */
|
||||
|
||||
memcpy(keybuf + 4, mac_addr, 6);
|
||||
memcpy(keybuf + 4, mac_addr, ETH_ALEN);
|
||||
memcpy(keybuf + 10, UskDataKey, 16);
|
||||
memcpy(keybuf + 26, UskMicKey, 16);
|
||||
keybuf[42] = UskId;
|
||||
@@ -1116,7 +1116,7 @@ void wapi_test_init(struct _adapter *padapter)
|
||||
keybuf[1] = 1; /* Enable TX */
|
||||
keybuf[2] = 1; /* AE */
|
||||
keybuf[3] = 0; /* not update */
|
||||
memcpy(keybuf + 4, mac_addr, 6);
|
||||
memcpy(keybuf + 4, mac_addr, ETH_ALEN);
|
||||
memcpy(keybuf + 10, MskDataKey, 16);
|
||||
memcpy(keybuf + 26, MskMicKey, 16);
|
||||
keybuf[42] = MskId;
|
||||
@@ -1127,7 +1127,7 @@ void wapi_test_init(struct _adapter *padapter)
|
||||
keybuf[1] = 1; /* Enable TX */
|
||||
keybuf[2] = 0; /* AE */
|
||||
keybuf[3] = 0; /* not update */
|
||||
memcpy(keybuf + 4, mac_addr, 6);
|
||||
memcpy(keybuf + 4, mac_addr, ETH_ALEN);
|
||||
memcpy(keybuf + 10, MskDataKey, 16);
|
||||
memcpy(keybuf + 26, MskMicKey, 16);
|
||||
keybuf[42] = MskId;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
180
core/rtw_xmit.c
180
core/rtw_xmit.c
@@ -471,7 +471,6 @@ void rtw_get_adapter_tx_rate_bmp_by_bw(_adapter *adapter, u8 bw, u16 *r_bmp_cck_
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj);
|
||||
struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv;
|
||||
u8 fix_bw = 0xFF;
|
||||
u16 bmp_cck_ofdm = 0;
|
||||
u32 bmp_ht = 0;
|
||||
@@ -504,7 +503,6 @@ void rtw_get_adapter_tx_rate_bmp_by_bw(_adapter *adapter, u8 bw, u16 *r_bmp_cck_
|
||||
|
||||
/* TODO: mlmeext->tx_rate*/
|
||||
|
||||
exit:
|
||||
if (r_bmp_cck_ofdm)
|
||||
*r_bmp_cck_ofdm = bmp_cck_ofdm;
|
||||
if (r_bmp_ht)
|
||||
@@ -938,23 +936,26 @@ static void update_attrib_phy_info(_adapter *padapter, struct pkt_attrib *pattri
|
||||
pattrib->stbc = psta->cmn.stbc_en;
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
pattrib->ht_en = psta->htpriv.ht_option;
|
||||
pattrib->ch_offset = psta->htpriv.ch_offset;
|
||||
pattrib->ampdu_en = _FALSE;
|
||||
if(padapter->registrypriv.ht_enable &&
|
||||
is_supported_ht(padapter->registrypriv.wireless_mode)) {
|
||||
pattrib->ht_en = psta->htpriv.ht_option;
|
||||
pattrib->ch_offset = psta->htpriv.ch_offset;
|
||||
pattrib->ampdu_en = _FALSE;
|
||||
|
||||
if (padapter->driver_ampdu_spacing != 0xFF) /* driver control AMPDU Density for peer sta's rx */
|
||||
pattrib->ampdu_spacing = padapter->driver_ampdu_spacing;
|
||||
else
|
||||
pattrib->ampdu_spacing = psta->htpriv.rx_ampdu_min_spacing;
|
||||
if (padapter->driver_ampdu_spacing != 0xFF) /* driver control AMPDU Density for peer sta's rx */
|
||||
pattrib->ampdu_spacing = padapter->driver_ampdu_spacing;
|
||||
else
|
||||
pattrib->ampdu_spacing = psta->htpriv.rx_ampdu_min_spacing;
|
||||
|
||||
/* check if enable ampdu */
|
||||
if (pattrib->ht_en && psta->htpriv.ampdu_enable) {
|
||||
if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) {
|
||||
pattrib->ampdu_en = _TRUE;
|
||||
if (psta->htpriv.tx_amsdu_enable == _TRUE)
|
||||
pattrib->amsdu_ampdu_en = _TRUE;
|
||||
else
|
||||
pattrib->amsdu_ampdu_en = _FALSE;
|
||||
/* check if enable ampdu */
|
||||
if (pattrib->ht_en && psta->htpriv.ampdu_enable) {
|
||||
if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) {
|
||||
pattrib->ampdu_en = _TRUE;
|
||||
if (psta->htpriv.tx_amsdu_enable == _TRUE)
|
||||
pattrib->amsdu_ampdu_en = _TRUE;
|
||||
else
|
||||
pattrib->amsdu_ampdu_en = _FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
@@ -970,10 +971,13 @@ static void update_attrib_phy_info(_adapter *padapter, struct pkt_attrib *pattri
|
||||
|
||||
pattrib->raid = psta->cmn.ra_info.rate_id;
|
||||
#ifdef CONFIG_80211N_HT
|
||||
pattrib->bwmode = rtw_get_tx_bw_mode(padapter, psta);
|
||||
pattrib->ht_en = psta->htpriv.ht_option;
|
||||
pattrib->ch_offset = psta->htpriv.ch_offset;
|
||||
pattrib->sgi = query_ra_short_GI(psta, pattrib->bwmode);
|
||||
if(padapter->registrypriv.ht_enable &&
|
||||
is_supported_ht(padapter->registrypriv.wireless_mode)) {
|
||||
pattrib->bwmode = rtw_get_tx_bw_mode(padapter, psta);
|
||||
pattrib->ht_en = psta->htpriv.ht_option;
|
||||
pattrib->ch_offset = psta->htpriv.ch_offset;
|
||||
pattrib->sgi = query_ra_short_GI(psta, pattrib->bwmode);
|
||||
}
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
@@ -1185,6 +1189,15 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)
|
||||
UserPriority = 7;
|
||||
}
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ICMP_VOQ
|
||||
if(pattrib->icmp_pkt==1)/*use VO queue to send icmp packet*/
|
||||
UserPriority = 7;
|
||||
#endif
|
||||
#ifdef CONFIG_IP_R_MONITOR
|
||||
if (pattrib->ether_type == ETH_P_ARP)
|
||||
UserPriority = 7;
|
||||
#endif/*CONFIG_IP_R_MONITOR*/
|
||||
pattrib->priority = UserPriority;
|
||||
pattrib->hdrlen = WLAN_HDR_A3_QOS_LEN;
|
||||
pattrib->subtype = WIFI_QOS_DATA_TYPE;
|
||||
@@ -1273,19 +1286,49 @@ exit:
|
||||
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
/*get non-qos hw_ssn control register,mapping to REG_HW_SEQ0,1,2,3*/
|
||||
/*get non-qos hw_ssn control register,mapping to REG_HW_SEQ 0,1,2,3*/
|
||||
inline u8 rtw_get_hwseq_no(_adapter *padapter)
|
||||
{
|
||||
u8 hwseq_num = 0;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C)
|
||||
hwseq_num = padapter->iface_id;
|
||||
if (hwseq_num > 3)
|
||||
hwseq_num = 3;
|
||||
#else
|
||||
if (!is_primary_adapter(padapter))
|
||||
hwseq_num = 1;
|
||||
/* else */
|
||||
/* hwseq_num = 2; */
|
||||
#endif
|
||||
#endif /* CONFIG_CONCURRENT_MODE */
|
||||
return hwseq_num;
|
||||
}
|
||||
#ifdef CONFIG_LPS
|
||||
#define LPS_PT_NORMAL 0
|
||||
#define LPS_PT_SP 1/* only DHCP packets is as SPECIAL_PACKET*/
|
||||
#define LPS_PT_ICMP 2
|
||||
|
||||
/*If EAPOL , ARP , OR DHCP packet, driver must be in active mode.*/
|
||||
static u8 _rtw_lps_chk_packet_type(struct pkt_attrib *pattrib)
|
||||
{
|
||||
u8 pkt_type = LPS_PT_NORMAL; /*normal data frame*/
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if ((pattrib->ether_type == 0x88B4) || (pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
|
||||
pkt_type = LPS_PT_SP;
|
||||
#else /* !CONFIG_WAPI_SUPPORT */
|
||||
|
||||
#ifndef CONFIG_LPS_NOT_LEAVE_FOR_ICMP
|
||||
if (pattrib->icmp_pkt == 1)
|
||||
pkt_type = LPS_PT_ICMP;
|
||||
else
|
||||
#endif
|
||||
if (pattrib->dhcp_pkt == 1)
|
||||
pkt_type = LPS_PT_SP;
|
||||
#endif
|
||||
return pkt_type;
|
||||
}
|
||||
#endif
|
||||
static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattrib)
|
||||
{
|
||||
uint i;
|
||||
@@ -1295,12 +1338,13 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
|
||||
|
||||
sint bmcast;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
sint res = _SUCCESS;
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
u8 pkt_type = 0;
|
||||
#endif
|
||||
|
||||
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib);
|
||||
|
||||
@@ -1441,29 +1485,34 @@ get_sta_info:
|
||||
}
|
||||
|
||||
} else if (0x888e == pattrib->ether_type)
|
||||
RTW_PRINT("send eapol packet\n");
|
||||
parsing_eapol_packet(padapter, pktfile.cur_addr, psta, 1);
|
||||
#ifdef DBG_ARP_DUMP
|
||||
else if (pattrib->ether_type == ETH_P_ARP) {
|
||||
u8 arp[28] = {0};
|
||||
|
||||
_rtw_pktfile_read(&pktfile, arp, 28);
|
||||
dump_arp_pkt(RTW_DBGDUMP, etherhdr.h_dest, etherhdr.h_source, arp, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
|
||||
rtw_mi_set_scan_deny(padapter, 3000);
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
|
||||
pattrib->ether_type == ETH_P_ARP &&
|
||||
!IS_MCAST(pattrib->dst)) {
|
||||
rtw_mi_set_scan_deny(padapter, 1000);
|
||||
rtw_mi_scan_abort(padapter, _FALSE); /*rtw_scan_abort_no_wait*/
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
/* If EAPOL , ARP , OR DHCP packet, driver must be in active mode. */
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if ((pattrib->ether_type == 0x88B4) || (pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
|
||||
#else /* !CONFIG_WAPI_SUPPORT */
|
||||
#if 0
|
||||
if ((pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
|
||||
#else /* only ICMP/DHCP packets is as SPECIAL_PACKET, and leave LPS when tx IMCP/DHCP packets. */
|
||||
/* if ((pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1) ) */
|
||||
if (pattrib->icmp_pkt == 1)
|
||||
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1);
|
||||
else if (pattrib->dhcp_pkt == 1)
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
pkt_type = _rtw_lps_chk_packet_type(pattrib);
|
||||
|
||||
if (pkt_type == LPS_PT_SP) {/*packet is as SPECIAL_PACKET*/
|
||||
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_active);
|
||||
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SPECIAL_PACKET, 1);
|
||||
}
|
||||
} else if (pkt_type == LPS_PT_ICMP)
|
||||
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1);
|
||||
#endif /* CONFIG_LPS */
|
||||
|
||||
#ifdef CONFIG_BEAMFORMING
|
||||
@@ -1544,7 +1593,6 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
u8 *pframe, *payload, mic[8];
|
||||
struct mic_data micdata;
|
||||
/* struct sta_info *stainfo; */
|
||||
struct qos_priv *pqospriv = &(padapter->mlmepriv.qospriv);
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
@@ -1628,7 +1676,6 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
|
||||
}
|
||||
|
||||
/* if(pqospriv->qos_option==1) */
|
||||
if (pattrib->qos_en)
|
||||
priority[0] = (u8)pxmitframe->attrib.priority;
|
||||
|
||||
@@ -2516,7 +2563,7 @@ s32 rtw_xmitframe_coalesce_amsdu(_adapter *padapter, struct xmit_frame *pxmitfra
|
||||
|
||||
xmitframe_swencrypt(padapter, pxmitframe);
|
||||
|
||||
pattrib->vcs_mode = NONE_VCS;
|
||||
update_attrib_vcs_info(padapter, pxmitframe);
|
||||
|
||||
exit:
|
||||
return res;
|
||||
@@ -3160,11 +3207,15 @@ void rtw_count_tx_stats(PADAPTER padapter, struct xmit_frame *pxmitframe, int sz
|
||||
pstats->tx_pkts += pkt_num;
|
||||
|
||||
pstats->tx_bytes += sz;
|
||||
#if defined(CONFIG_CHECK_LEAVE_LPS) && defined(CONFIG_LPS_CHK_BY_TP)
|
||||
if (adapter_to_pwrctl(padapter)->lps_chk_by_tp)
|
||||
traffic_check_for_leave_lps_by_tp(padapter, _TRUE, psta);
|
||||
#endif /* CONFIG_LPS */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CHECK_LEAVE_LPS
|
||||
/* traffic_check_for_leave_lps(padapter, _TRUE); */
|
||||
#endif /* CONFIG_LPS */
|
||||
#endif /* CONFIG_CHECK_LEAVE_LPS */
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3201,9 +3252,6 @@ static struct xmit_buf *__rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv,
|
||||
} else
|
||||
RTW_INFO("%s fail, no xmitbuf available !!!\n", __func__);
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
return pxmitbuf;
|
||||
}
|
||||
|
||||
@@ -3734,10 +3782,6 @@ struct xmit_frame *rtw_get_xframe(struct xmit_priv *pxmitpriv, int *num_frame)
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
int i, inx[4];
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
/* int j, tmp, acirp_cnt[4]; */
|
||||
#endif
|
||||
|
||||
inx[0] = 0;
|
||||
inx[1] = 1;
|
||||
inx[2] = 2;
|
||||
@@ -3792,10 +3836,6 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi
|
||||
_adapter *padapter = pxmitpriv->adapter;
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
int i, inx[4];
|
||||
#ifdef CONFIG_USB_HCI
|
||||
/* int j, tmp, acirp_cnt[4]; */
|
||||
#endif
|
||||
|
||||
|
||||
inx[0] = 0;
|
||||
inx[1] = 1;
|
||||
@@ -3803,7 +3843,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi
|
||||
inx[3] = 3;
|
||||
|
||||
if (pregpriv->wifi_spec == 1) {
|
||||
int j, tmp, acirp_cnt[4];
|
||||
int j;
|
||||
#if 0
|
||||
if (flags < XMIT_QUEUE_ENTRY) {
|
||||
/* priority exchange according to the completed xmitbuf flags. */
|
||||
@@ -3966,7 +4006,6 @@ s32 rtw_xmit_classifier(_adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
struct sta_info *psta;
|
||||
struct tx_servq *ptxservq;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct hw_xmit *phwxmits = padapter->xmitpriv.hwxmits;
|
||||
sint res = _SUCCESS;
|
||||
|
||||
@@ -4114,7 +4153,6 @@ void rtw_init_hwxmits(struct hw_xmit *phwxmit, sint entry)
|
||||
int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
|
||||
{
|
||||
struct sk_buff *skb = *pskb;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
_irqL irqL;
|
||||
/* if(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE) */
|
||||
{
|
||||
@@ -4379,9 +4417,10 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
||||
u8 dummybuf[32];
|
||||
int len = skb->len, rtap_len;
|
||||
|
||||
if (skb)
|
||||
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
|
||||
|
||||
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
|
||||
|
||||
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
|
||||
goto fail;
|
||||
|
||||
@@ -4400,7 +4439,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
||||
}
|
||||
_rtw_pktfile_read(&pktfile, dummybuf, rtap_len-sizeof(struct ieee80211_radiotap_header));
|
||||
len = len - rtap_len;
|
||||
|
||||
#endif
|
||||
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
|
||||
if (pmgntframe == NULL) {
|
||||
rtw_udelay_os(500);
|
||||
@@ -4440,7 +4479,6 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
||||
dump_mgntframe(padapter, pmgntframe);
|
||||
|
||||
fail:
|
||||
rtw_endofpktfile(&pktfile);
|
||||
rtw_skb_free(skb);
|
||||
return 0;
|
||||
}
|
||||
@@ -4737,7 +4775,6 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
sint bmcst = IS_MCAST(pattrib->ra);
|
||||
bool update_tim = _FALSE;
|
||||
#ifdef CONFIG_TDLS
|
||||
@@ -5258,7 +5295,9 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta)
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
exit:
|
||||
#endif
|
||||
/* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
@@ -5491,7 +5530,6 @@ bool rtw_xmit_ac_blocked(_adapter *adapter)
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
_adapter *iface;
|
||||
struct mlme_ext_priv *mlmeext;
|
||||
struct mlme_ext_info *mlmeextinfo;
|
||||
bool blocked = _FALSE;
|
||||
int i;
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
@@ -5505,8 +5543,14 @@ bool rtw_xmit_ac_blocked(_adapter *adapter)
|
||||
#endif/* #ifdef DBG_CONFIG_ERROR_RESET */
|
||||
#endif/* #ifdef DBG_CONFIG_ERROR_DETECT */
|
||||
|
||||
if (rfctl->offch_state != OFFCHS_NONE)
|
||||
if (rfctl->offch_state != OFFCHS_NONE
|
||||
#ifdef CONFIG_DFS
|
||||
|| IS_RADAR_DETECTED(rfctl) || rfctl->csa_ch
|
||||
#endif
|
||||
) {
|
||||
blocked = _TRUE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
iface = dvobj->padapters[i];
|
||||
@@ -5702,8 +5746,6 @@ static u8 backup_idx[HW_QUEUE_ENTRY];
|
||||
|
||||
void rtw_tx_desc_backup(_adapter *padapter, struct xmit_frame *pxmitframe, u8 desc_size, u8 hwq)
|
||||
{
|
||||
u16 reg_rp;
|
||||
u16 reg_wp;
|
||||
u32 tmp32;
|
||||
u8 *pxmit_buf;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user