mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
rtl8188eu: Remove dead code inside #if 0 .... #endif
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
e3e242b712
commit
f0050d3365
52 changed files with 38 additions and 3703 deletions
147
core/rtw_ap.c
147
core/rtw_ap.c
|
@ -276,10 +276,6 @@ u8 chk_sta_is_alive(struct sta_info *psta)
|
|||
|
||||
/* if(sta_last_rx_pkts(psta) == sta_rx_pkts(psta)) */
|
||||
if ((psta->sta_stats.last_rx_data_pkts + psta->sta_stats.last_rx_ctrl_pkts) == (psta->sta_stats.rx_data_pkts + psta->sta_stats.rx_ctrl_pkts)) {
|
||||
#if 0
|
||||
if (psta->state & WIFI_SLEEP_STATE)
|
||||
ret = _TRUE;
|
||||
#endif
|
||||
} else
|
||||
ret = _TRUE;
|
||||
|
||||
|
@ -936,11 +932,6 @@ static void rtw_set_hw_wmm_param(_adapter *padapter)
|
|||
/*TODO:*/
|
||||
acm_mask = 0;
|
||||
padapter->mlmepriv.acm_mask = acm_mask;
|
||||
|
||||
#if 0
|
||||
/* BK */
|
||||
/* AIFS = AIFSN * slot time + SIFS - r2t phy delay */
|
||||
#endif
|
||||
AIFS = (7 * pmlmeinfo->slotTime) + aSifsTime;
|
||||
ECWMin = 4;
|
||||
ECWMax = 10;
|
||||
|
@ -1530,45 +1521,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
psecuritypriv->wpa2_group_cipher = group_cipher;
|
||||
psecuritypriv->wpa2_pairwise_cipher = pairwise_cipher;
|
||||
#if 0
|
||||
switch (group_cipher) {
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP40:
|
||||
psecuritypriv->wpa2_group_cipher = _WEP40_;
|
||||
break;
|
||||
case WPA_CIPHER_TKIP:
|
||||
psecuritypriv->wpa2_group_cipher = _TKIP_;
|
||||
break;
|
||||
case WPA_CIPHER_CCMP:
|
||||
psecuritypriv->wpa2_group_cipher = _AES_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP104:
|
||||
psecuritypriv->wpa2_group_cipher = _WEP104_;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (pairwise_cipher) {
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP40:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _WEP40_;
|
||||
break;
|
||||
case WPA_CIPHER_TKIP:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _TKIP_;
|
||||
break;
|
||||
case WPA_CIPHER_CCMP:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _AES_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP104:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _WEP104_;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* wpa */
|
||||
|
@ -1589,53 +1542,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
psecuritypriv->wpa_group_cipher = group_cipher;
|
||||
psecuritypriv->wpa_pairwise_cipher = pairwise_cipher;
|
||||
|
||||
#if 0
|
||||
switch (group_cipher) {
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa_group_cipher = _NO_PRIVACY_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP40:
|
||||
psecuritypriv->wpa_group_cipher = _WEP40_;
|
||||
break;
|
||||
case WPA_CIPHER_TKIP:
|
||||
psecuritypriv->wpa_group_cipher = _TKIP_;
|
||||
break;
|
||||
case WPA_CIPHER_CCMP:
|
||||
psecuritypriv->wpa_group_cipher = _AES_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP104:
|
||||
psecuritypriv->wpa_group_cipher = _WEP104_;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (pairwise_cipher) {
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP40:
|
||||
psecuritypriv->wpa_pairwise_cipher = _WEP40_;
|
||||
break;
|
||||
case WPA_CIPHER_TKIP:
|
||||
psecuritypriv->wpa_pairwise_cipher = _TKIP_;
|
||||
break;
|
||||
case WPA_CIPHER_CCMP:
|
||||
psecuritypriv->wpa_pairwise_cipher = _AES_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP104:
|
||||
psecuritypriv->wpa_pairwise_cipher = _WEP104_;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if ((p == NULL) || (ie_len == 0))
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
/* wmm */
|
||||
|
@ -2246,19 +2158,6 @@ static u8 rtw_ap_bmc_frames_hdl(_adapter *padapter)
|
|||
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
#if 0
|
||||
/* HIQ Check */
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty);
|
||||
|
||||
while (_FALSE == empty && rtw_get_passing_time_ms(start) < 3000) {
|
||||
rtw_msleep_os(100);
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty);
|
||||
}
|
||||
|
||||
|
||||
RTW_INFO("check if hiq empty=%d\n", empty);
|
||||
#endif
|
||||
|
||||
return H2C_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -2864,19 +2763,6 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
|
||||
|
||||
#if 0
|
||||
if (!(psta->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) &&
|
||||
!psta->no_short_preamble_set) {
|
||||
psta->no_short_preamble_set = 1;
|
||||
pmlmepriv->num_sta_no_short_preamble++;
|
||||
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
|
||||
(pmlmepriv->num_sta_no_short_preamble == 1))
|
||||
ieee802_11_set_beacons(hapd->iface);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (!(psta->flags & WLAN_STA_SHORT_PREAMBLE)) {
|
||||
if (!psta->no_short_preamble_set) {
|
||||
psta->no_short_preamble_set = 1;
|
||||
|
@ -2905,15 +2791,6 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (psta->flags & WLAN_STA_NONERP && !psta->nonerp_set) {
|
||||
psta->nonerp_set = 1;
|
||||
pmlmepriv->num_sta_non_erp++;
|
||||
if (pmlmepriv->num_sta_non_erp == 1)
|
||||
ieee802_11_set_beacons(hapd->iface);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (psta->flags & WLAN_STA_NONERP) {
|
||||
if (!psta->nonerp_set) {
|
||||
psta->nonerp_set = 1;
|
||||
|
@ -2939,19 +2816,6 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT) &&
|
||||
!psta->no_short_slot_time_set) {
|
||||
psta->no_short_slot_time_set = 1;
|
||||
pmlmepriv->num_sta_no_short_slot_time++;
|
||||
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
|
||||
(pmlmepriv->num_sta_no_short_slot_time == 1))
|
||||
ieee802_11_set_beacons(hapd->iface);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT)) {
|
||||
if (!psta->no_short_slot_time_set) {
|
||||
psta->no_short_slot_time_set = 1;
|
||||
|
@ -3924,17 +3788,6 @@ void tx_beacon_handler(struct dvobj_priv *pdvobj)
|
|||
/*update_beacon(padapter, _TIM_IE_, NULL, _FALSE);*/
|
||||
issue_beacon(padapter, 0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* handle any buffered BC/MC frames*/
|
||||
/* Don't dynamically change DIS_ATIM due to HW will auto send ACQ after HIQ empty.*/
|
||||
val8 = *((unsigned char *)priv->beaconbuf + priv->timoffset + 4);
|
||||
if (val8 & 0x01) {
|
||||
process_mcast_dzqueue(priv);
|
||||
priv->pkt_in_dtimQ = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void tx_beacon_timer_handler(struct dvobj_priv *pdvobj)
|
||||
|
|
|
@ -550,9 +550,6 @@ u8 rtw_btcoex_send_event_to_BT(_adapter *padapter, u8 status, u8 event_code, u8
|
|||
|
||||
/* total tx event length + EventCode length + sizeof(length) */
|
||||
tx_event_length = pEvent->Length + 2;
|
||||
#if 0
|
||||
rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length, dbg_msg);
|
||||
#endif
|
||||
status = rtw_btcoex_sendmsgbysocket(padapter, (u8 *)pEvent, tx_event_length, _FALSE);
|
||||
|
||||
return status;
|
||||
|
@ -628,9 +625,6 @@ u8 rtw_btcoex_parse_BT_info_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen)
|
|||
|
||||
/* total tx event length + EventCode length + sizeof(length) */
|
||||
tx_event_length = pEvent->Length + 2;
|
||||
#if 0
|
||||
rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length, "BT_info_event");
|
||||
#endif
|
||||
status = rtw_btcoex_sendmsgbysocket(padapter, (u8 *)pEvent, tx_event_length, _FALSE);
|
||||
|
||||
return status;
|
||||
|
@ -679,9 +673,6 @@ u8 rtw_btcoex_parse_BT_patch_ver_info_cmd(_adapter *padapter, u8 *pcmd, u16 cmdl
|
|||
|
||||
/* total tx event length + EventCode length + sizeof(length) */
|
||||
tx_event_length = pEvent->Length + 2;
|
||||
#if 0
|
||||
rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length, "BT_patch_event");
|
||||
#endif
|
||||
status = rtw_btcoex_sendmsgbysocket(padapter, (u8 *)pEvent, tx_event_length, _FALSE);
|
||||
return status;
|
||||
/* bthci_IndicateEvent(Adapter, PPacketIrpEvent, len+2); */
|
||||
|
@ -1258,10 +1249,6 @@ void rtw_btcoex_recvmsgbysocket(void *data)
|
|||
u32 len = 0;
|
||||
u16 recv_length = 0;
|
||||
u16 parse_res = 0;
|
||||
#if 0
|
||||
u8 para_len = 0, polling_enable = 0, poling_interval = 0, reason = 0, btinfo_len = 0;
|
||||
u8 btinfo[BT_INFO_LEN] = {0};
|
||||
#endif
|
||||
|
||||
struct bt_coex_info *pcoex_info = NULL;
|
||||
struct sock *sk = NULL;
|
||||
|
@ -1292,40 +1279,6 @@ void rtw_btcoex_recvmsgbysocket(void *data)
|
|||
_rtw_memcpy(recv_data, skb->data + 8, recv_length);
|
||||
|
||||
parse_res = rtw_btcoex_parse_recv_data(recv_data, recv_length);
|
||||
#if 0
|
||||
if (RX_ATTEND_ACK == parse_res) {
|
||||
/* attend ack */
|
||||
pcoex_info->BT_attend = _TRUE;
|
||||
RTW_INFO("RX_ATTEND_ACK!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
|
||||
} else if (RX_ATTEND_REQ == parse_res) {
|
||||
/* attend req from BT */
|
||||
pcoex_info->BT_attend = _TRUE;
|
||||
RTW_INFO("RX_BT_ATTEND_REQ!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
|
||||
rtw_btcoex_sendmsgbysocket(pbtcoexadapter, attend_ack, sizeof(attend_ack), _FALSE);
|
||||
} else if (RX_INVITE_REQ == parse_res) {
|
||||
/* invite req from BT */
|
||||
pcoex_info->BT_attend = _TRUE;
|
||||
RTW_INFO("RX_INVITE_REQ!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
|
||||
rtw_btcoex_sendmsgbysocket(pbtcoexadapter, invite_rsp, sizeof(invite_rsp), _FALSE);
|
||||
} else if (RX_INVITE_RSP == parse_res) {
|
||||
/* invite rsp */
|
||||
pcoex_info->BT_attend = _TRUE;
|
||||
RTW_INFO("RX_INVITE_RSP!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
|
||||
} else if (RX_LEAVE_ACK == parse_res) {
|
||||
/* mean BT know wifi will leave */
|
||||
pcoex_info->BT_attend = _FALSE;
|
||||
RTW_INFO("RX_LEAVE_ACK!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
|
||||
} else if (RX_BT_LEAVE == parse_res) {
|
||||
/* BT leave */
|
||||
rtw_btcoex_sendmsgbysocket(pbtcoexadapter, leave_ack, sizeof(leave_ack), _FALSE); /* no ack */
|
||||
pcoex_info->BT_attend = _FALSE;
|
||||
RTW_INFO("RX_BT_LEAVE!sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
|
||||
} else {
|
||||
/* todo: check if recv data are really hci cmds */
|
||||
if (_TRUE == pcoex_info->BT_attend)
|
||||
rtw_btcoex_parse_hci_cmd(pbtcoexadapter, recv_data, recv_length);
|
||||
}
|
||||
#endif
|
||||
switch (parse_res) {
|
||||
case RX_ATTEND_ACK:
|
||||
/* attend ack */
|
||||
|
@ -1618,11 +1571,7 @@ void rtw_btcoex_SendEventExtBtCoexControl(PADAPTER padapter, u8 bNeedDbgRsp, u8
|
|||
|
||||
/* total tx event length + EventCode length + sizeof(length) */
|
||||
tx_event_length = pEvent->Length + 2;
|
||||
#if 0
|
||||
rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length, "BT COEX CONTROL", _FALSE);
|
||||
#endif
|
||||
rtw_btcoex_sendmsgbysocket(padapter, (u8 *)pEvent, tx_event_length, _FALSE);
|
||||
|
||||
}
|
||||
|
||||
/* Porting from Windows team */
|
||||
|
@ -1660,11 +1609,7 @@ void rtw_btcoex_SendEventExtBtInfoControl(PADAPTER padapter, u8 dataLen, void *p
|
|||
|
||||
/* total tx event length + EventCode length + sizeof(length) */
|
||||
tx_event_length = pEvent->Length + 2;
|
||||
#if 0
|
||||
rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length, "BT INFO CONTROL");
|
||||
#endif
|
||||
rtw_btcoex_sendmsgbysocket(padapter, (u8 *)pEvent, tx_event_length, _FALSE);
|
||||
|
||||
}
|
||||
|
||||
void rtw_btcoex_SendScanNotify(PADAPTER padapter, u8 scanType)
|
||||
|
@ -1700,9 +1645,6 @@ void rtw_btcoex_SendScanNotify(PADAPTER padapter, u8 scanType)
|
|||
|
||||
/* total tx event length + EventCode length + sizeof(length) */
|
||||
tx_event_length = pEvent->Length + 2;
|
||||
#if 0
|
||||
rtw_btcoex_dump_tx_msg((u8 *)pEvent, tx_event_length, "WIFI SCAN OPERATION");
|
||||
#endif
|
||||
rtw_btcoex_sendmsgbysocket(padapter, (u8 *)pEvent, tx_event_length, _FALSE);
|
||||
}
|
||||
#endif /* CONFIG_BT_COEXIST_SOCKET_TRX */
|
||||
|
|
|
@ -2779,14 +2779,6 @@ void rtw_dump_drv_phy_cap(void *sel, _adapter *adapter)
|
|||
struct registry_priv *pregistry_priv = &adapter->registrypriv;
|
||||
|
||||
RTW_PRINT_SEL(sel, "\n ======== DRV's configuration ========\n");
|
||||
#if 0
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] TRx Capability : 0x%08x\n", phy_spec->trx_cap);
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] Tx Stream Num Index : %d\n", (phy_spec->trx_cap >> 24) & 0xFF); /*Tx Stream Num Index [31:24]*/
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] Rx Stream Num Index : %d\n", (phy_spec->trx_cap >> 16) & 0xFF); /*Rx Stream Num Index [23:16]*/
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] Tx Path Num Index : %d\n", (phy_spec->trx_cap >> 8) & 0xFF);/*Tx Path Num Index [15:8]*/
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] Rx Path Num Index : %d\n", (phy_spec->trx_cap & 0xFF));/*Rx Path Num Index [7:0]*/
|
||||
#endif
|
||||
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] STBC Capability : 0x%02x\n", pregistry_priv->stbc_cap);
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] VHT STBC Tx : %s\n", (TEST_FLAG(pregistry_priv->stbc_cap, BIT1)) ? "V" : "X"); /*BIT1: Enable VHT STBC Tx*/
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] VHT STBC Rx : %s\n", (TEST_FLAG(pregistry_priv->stbc_cap, BIT0)) ? "V" : "X"); /*BIT0: Enable VHT STBC Rx*/
|
||||
|
@ -2799,13 +2791,6 @@ void rtw_dump_drv_phy_cap(void *sel, _adapter *adapter)
|
|||
RTW_PRINT_SEL(sel, "[DRV CAP] HT LDPC Tx : %s\n", (TEST_FLAG(pregistry_priv->ldpc_cap, BIT5)) ? "V" : "X"); /*BIT5: Enable HT LDPC Tx*/
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] HT LDPC Rx : %s\n\n", (TEST_FLAG(pregistry_priv->ldpc_cap, BIT4)) ? "V" : "X"); /*BIT4: Enable HT LDPC Rx*/
|
||||
#ifdef CONFIG_BEAMFORMING
|
||||
#if 0
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] TxBF parameter : 0x%08x\n", phy_spec->txbf_param);
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] VHT Sounding Dim : %d\n", (phy_spec->txbf_param >> 24) & 0xFF); /*VHT Sounding Dim [31:24]*/
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] VHT Steering Ant : %d\n", (phy_spec->txbf_param >> 16) & 0xFF); /*VHT Steering Ant [23:16]*/
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] HT Sounding Dim : %d\n", (phy_spec->txbf_param >> 8) & 0xFF); /*HT Sounding Dim [15:8]*/
|
||||
RTW_PRINT_SEL(sel, "[DRV CAP] HT Steering Ant : %d\n", phy_spec->txbf_param & 0xFF); /*HT Steering Ant [7:0]*/
|
||||
#endif
|
||||
|
||||
/*
|
||||
* BIT0: Enable VHT SU Beamformer
|
||||
|
@ -4132,43 +4117,6 @@ int proc_get_efuse_map(struct seq_file *m, void *v)
|
|||
|
||||
ssize_t proc_set_efuse_map(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data)
|
||||
{
|
||||
#if 0
|
||||
char tmp[256] = {0};
|
||||
u32 addr, cnts;
|
||||
u8 efuse_data;
|
||||
|
||||
int jj, kk;
|
||||
|
||||
struct net_device *dev = data;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
|
||||
u8 ips_mode = IPS_NUM;
|
||||
|
||||
if (count < 3) {
|
||||
RTW_INFO("argument size is less than 3\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (count > sizeof(tmp)) {
|
||||
rtw_warn_on(1);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
if (buffer && !copy_from_user(tmp, buffer, count)) {
|
||||
|
||||
int num = sscanf(tmp, "%x %d %x", &addr, &cnts, &efuse_data);
|
||||
|
||||
if (num != 3) {
|
||||
RTW_INFO("invalid write_reg parameter!\n");
|
||||
return count;
|
||||
}
|
||||
}
|
||||
ips_mode = pwrctrlpriv->ips_mode;
|
||||
rtw_pm_set_ips(padapter, IPS_NONE);
|
||||
if (rtw_efuse_map_write(padapter, addr, cnts, &efuse_data) == _FAIL)
|
||||
RTW_INFO("WARN - rtw_efuse_map_write error!!\n");
|
||||
rtw_pm_set_ips(padapter, ips_mode);
|
||||
#endif
|
||||
return count;
|
||||
}
|
||||
|
||||
|
@ -4479,15 +4427,6 @@ ssize_t proc_set_mcc_policy_table(struct file *file, const char __user *buffer,
|
|||
RTW_INFO(FUNC_ADPT_FMT ": input parameters < 7\n", FUNC_ADPT_ARG(padapter));
|
||||
return -EINVAL;
|
||||
}
|
||||
#if 0
|
||||
RTW_INFO("mcc_policy_table_idx:%d\n", mcc_policy_table_idx);
|
||||
RTW_INFO("mcc_duration:%d\n", mcc_duration);
|
||||
RTW_INFO("mcc_tsf_sync_offset:%d\n", mcc_tsf_sync_offset);
|
||||
RTW_INFO("mcc_start_time_offset:%d\n", mcc_start_time_offset);
|
||||
RTW_INFO("mcc_interval:%d\n", mcc_interval);
|
||||
RTW_INFO("mcc_guard_offset0:%d\n", mcc_guard_offset0);
|
||||
RTW_INFO("mcc_guard_offset1:%d\n", mcc_guard_offset1);
|
||||
#endif
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
iface = dvobj->padapters[i];
|
||||
if (!iface)
|
||||
|
|
100
core/rtw_mlme.c
100
core/rtw_mlme.c
|
@ -825,39 +825,6 @@ void update_network(WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src,
|
|||
, dst->Ssid.Ssid, MAC_ARG(dst->MacAddress), dst->PhyInfo.SignalStrength, dst->PhyInfo.SignalQuality, dst->Rssi);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0 /* old codes, may be useful one day...
|
||||
* RTW_INFO("update_network: rssi=0x%lx dst->Rssi=%d ,dst->Rssi=0x%lx , src->Rssi=0x%lx",(dst->Rssi+src->Rssi)/2,dst->Rssi,dst->Rssi,src->Rssi); */
|
||||
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) && is_same_network(&(padapter->mlmepriv.cur_network.network), src)) {
|
||||
|
||||
/* RTW_INFO("b:ssid=%s update_network: src->rssi=0x%d padapter->recvpriv.ui_rssi=%d\n",src->Ssid.Ssid,src->Rssi,padapter->recvpriv.signal); */
|
||||
if (padapter->recvpriv.signal_qual_data.total_num++ >= PHY_LINKQUALITY_SLID_WIN_MAX) {
|
||||
padapter->recvpriv.signal_qual_data.total_num = PHY_LINKQUALITY_SLID_WIN_MAX;
|
||||
last_evm = padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index];
|
||||
padapter->recvpriv.signal_qual_data.total_val -= last_evm;
|
||||
}
|
||||
padapter->recvpriv.signal_qual_data.total_val += query_rx_pwr_percentage(src->Rssi);
|
||||
|
||||
padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index++] = query_rx_pwr_percentage(src->Rssi);
|
||||
if (padapter->recvpriv.signal_qual_data.index >= PHY_LINKQUALITY_SLID_WIN_MAX)
|
||||
padapter->recvpriv.signal_qual_data.index = 0;
|
||||
|
||||
/* RTW_INFO("Total SQ=%d pattrib->signal_qual= %d\n", padapter->recvpriv.signal_qual_data.total_val, src->Rssi); */
|
||||
|
||||
/* <1> Showed on UI for user,in percentage. */
|
||||
tmpVal = padapter->recvpriv.signal_qual_data.total_val / padapter->recvpriv.signal_qual_data.total_num;
|
||||
padapter->recvpriv.signal = (u8)tmpVal; /* Link quality */
|
||||
|
||||
src->Rssi = translate_percentage_to_dbm(padapter->recvpriv.signal) ;
|
||||
} else {
|
||||
/* RTW_INFO("ELSE:ssid=%s update_network: src->rssi=0x%d dst->rssi=%d\n",src->Ssid.Ssid,src->Rssi,dst->Rssi); */
|
||||
src->Rssi = (src->Rssi + dst->Rssi) / 2; /* dBM */
|
||||
}
|
||||
|
||||
/* RTW_INFO("a:update_network: src->rssi=0x%d padapter->recvpriv.ui_rssi=%d\n",src->Rssi,padapter->recvpriv.signal); */
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static void update_current_network(_adapter *adapter, WLAN_BSSID_EX *pnetwork)
|
||||
|
@ -871,13 +838,9 @@ static void update_current_network(_adapter *adapter, WLAN_BSSID_EX *pnetwork)
|
|||
&(pmlmepriv->cur_network.network));
|
||||
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) && (is_same_network(&(pmlmepriv->cur_network.network), pnetwork, 0))) {
|
||||
|
||||
/* if(pmlmepriv->cur_network.network.IELength<= pnetwork->IELength) */
|
||||
{
|
||||
update_network(&(pmlmepriv->cur_network.network), pnetwork, adapter, _TRUE);
|
||||
rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof(NDIS_802_11_FIXED_IEs),
|
||||
update_network(&(pmlmepriv->cur_network.network), pnetwork, adapter, _TRUE);
|
||||
rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof(NDIS_802_11_FIXED_IEs),
|
||||
pmlmepriv->cur_network.network.IELength);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1712,18 +1675,6 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl
|
|||
|
||||
psta->aid = pnetwork->join_res;
|
||||
|
||||
#if 0 /* alloc macid when call rtw_alloc_stainfo(), and release macid when call rtw_free_stainfo() */
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
|
||||
if (PRIMARY_ADAPTER == padapter->adapter_type)
|
||||
psta->mac_id = 0;
|
||||
else
|
||||
psta->mac_id = 2;
|
||||
#else
|
||||
psta->mac_id = 0;
|
||||
#endif
|
||||
#endif /* removed */
|
||||
|
||||
update_sta_info(padapter, psta);
|
||||
|
||||
/* update station supportRate */
|
||||
|
@ -2602,15 +2553,6 @@ void _rtw_join_timeout_handler(_adapter *adapter)
|
|||
_irqL irqL;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
#if 0
|
||||
if (rtw_is_drv_stopped(adapter)) {
|
||||
_rtw_up_sema(&pmlmepriv->assoc_terminate);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
RTW_INFO("%s, fw_state=%x\n", __func__, get_fwstate(pmlmepriv));
|
||||
|
||||
if (RTW_CANNOT_RUN(adapter))
|
||||
|
@ -3285,21 +3227,9 @@ candidate_exist:
|
|||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) {
|
||||
RTW_INFO("%s: _FW_LINKED while ask_for_joinbss!!!\n", __func__);
|
||||
|
||||
#if 0 /* for WPA/WPA2 authentication, wpa_supplicant will expect authentication from AP, it is needed to reconnect AP... */
|
||||
if (is_same_network(&pmlmepriv->cur_network.network, &candidate->network)) {
|
||||
RTW_INFO("%s: _FW_LINKED and is same network, it needn't join again\n", __func__);
|
||||
|
||||
rtw_indicate_connect(adapter);/* rtw_indicate_connect again */
|
||||
|
||||
ret = 2;
|
||||
goto exit;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
rtw_disassoc_cmd(adapter, 0, _TRUE);
|
||||
rtw_indicate_disconnect(adapter, 0, _FALSE);
|
||||
rtw_free_assoc_resources(adapter, 0);
|
||||
}
|
||||
rtw_disassoc_cmd(adapter, 0, _TRUE);
|
||||
rtw_indicate_disconnect(adapter, 0, _FALSE);
|
||||
rtw_free_assoc_resources(adapter, 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ANTENNA_DIVERSITY
|
||||
|
@ -3464,16 +3394,7 @@ int rtw_restruct_wmm_ie(_adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, u
|
|||
ielength = initial_out_len;
|
||||
|
||||
if (in_ie[i] == 0xDD && in_ie[i + 2] == 0x00 && in_ie[i + 3] == 0x50 && in_ie[i + 4] == 0xF2 && in_ie[i + 5] == 0x02 && i + 5 < in_len) { /* WMM element ID and OUI */
|
||||
|
||||
/* Append WMM IE to the last index of out_ie */
|
||||
#if 0
|
||||
for (j = i; j < i + (in_ie[i + 1] + 2); j++) {
|
||||
out_ie[ielength] = in_ie[j];
|
||||
ielength++;
|
||||
}
|
||||
out_ie[initial_out_len + 8] = 0x00; /* force the QoS Info Field to be zero */
|
||||
#endif
|
||||
|
||||
for (j = i; j < i + 9; j++) {
|
||||
out_ie[ielength] = in_ie[j];
|
||||
ielength++;
|
||||
|
@ -3693,17 +3614,6 @@ void rtw_update_registrypriv_dev_network(_adapter *adapter)
|
|||
/* struct xmit_priv *pxmitpriv = &adapter->xmitpriv; */
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
|
||||
|
||||
#if 0
|
||||
pxmitpriv->vcs_setting = pregistrypriv->vrtl_carrier_sense;
|
||||
pxmitpriv->vcs = pregistrypriv->vcs_type;
|
||||
pxmitpriv->vcs_type = pregistrypriv->vcs_type;
|
||||
/* pxmitpriv->rts_thresh = pregistrypriv->rts_thresh; */
|
||||
pxmitpriv->frag_len = pregistrypriv->frag_thresh;
|
||||
|
||||
adapter->qospriv.qos_option = pregistrypriv->wmm_enable;
|
||||
#endif
|
||||
|
||||
pdev_network->Privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0) ; /* adhoc no 802.1x */
|
||||
|
||||
pdev_network->Rssi = 0;
|
||||
|
|
|
@ -1093,10 +1093,6 @@ static void init_channel_list(_adapter *padapter, RT_CHANNEL_INFO *channel_set,
|
|||
struct p2p_oper_class_map op_class[] = {
|
||||
{ IEEE80211G, 81, 1, 13, 1, BW20 },
|
||||
{ IEEE80211G, 82, 14, 14, 1, BW20 },
|
||||
#if 0 /* Do not enable HT40 on 2 GHz */
|
||||
{ IEEE80211G, 83, 1, 9, 1, BW40PLUS },
|
||||
{ IEEE80211G, 84, 5, 13, 1, BW40MINUS },
|
||||
#endif
|
||||
{ IEEE80211A, 115, 36, 48, 4, BW20 },
|
||||
{ IEEE80211A, 116, 36, 44, 8, BW40PLUS },
|
||||
{ IEEE80211A, 117, 40, 48, 8, BW40MINUS },
|
||||
|
@ -1373,19 +1369,6 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
|
|||
struct dvobj_priv *psdpriv = padapter->dvobj;
|
||||
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
|
||||
|
||||
|
||||
#if 0
|
||||
{
|
||||
u8 *pbuf;
|
||||
pbuf = GetAddr1Ptr(pframe);
|
||||
RTW_INFO("A1-%x:%x:%x:%x:%x:%x\n", *pbuf, *(pbuf + 1), *(pbuf + 2), *(pbuf + 3), *(pbuf + 4), *(pbuf + 5));
|
||||
pbuf = get_addr2_ptr(pframe);
|
||||
RTW_INFO("A2-%x:%x:%x:%x:%x:%x\n", *pbuf, *(pbuf + 1), *(pbuf + 2), *(pbuf + 3), *(pbuf + 4), *(pbuf + 5));
|
||||
pbuf = GetAddr3Ptr(pframe);
|
||||
RTW_INFO("A3-%x:%x:%x:%x:%x:%x\n", *pbuf, *(pbuf + 1), *(pbuf + 2), *(pbuf + 3), *(pbuf + 4), *(pbuf + 5));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (GetFrameType(pframe) != WIFI_MGT_TYPE) {
|
||||
return;
|
||||
}
|
||||
|
@ -1830,18 +1813,7 @@ unsigned int OnProbeRsp(_adapter *padapter, union recv_frame *precv_frame)
|
|||
return _SUCCESS;
|
||||
}
|
||||
|
||||
#if 0 /* move to validate_recv_mgnt_frame */
|
||||
if (_rtw_memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) {
|
||||
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) {
|
||||
psta = rtw_get_stainfo(pstapriv, get_addr2_ptr(pframe));
|
||||
if (psta != NULL)
|
||||
psta->sta_stats.rx_mgnt_pkts++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
/* for 11n Logo 4.2.31/4.2.32 */
|
||||
|
@ -2051,12 +2023,7 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
if (pmlmeext->en_hw_update_tsf)
|
||||
rtw_enable_hw_update_tsf_cmd(padapter);
|
||||
|
||||
#if 0 /* move to validate_recv_mgnt_frame */
|
||||
psta->sta_stats.rx_mgnt_pkts++;
|
||||
#endif
|
||||
}
|
||||
|
||||
} else if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
|
||||
_irqL irqL;
|
||||
u8 rate_set[16];
|
||||
|
@ -2552,30 +2519,8 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame)
|
|||
pstat->state |= WIFI_FW_ASSOC_STATE;
|
||||
}
|
||||
|
||||
|
||||
#if 0/* todo:tkip_countermeasures */
|
||||
if (hapd->tkip_countermeasures) {
|
||||
resp = WLAN_REASON_MICHAEL_MIC_FAILURE;
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
pstat->capability = capab_info;
|
||||
|
||||
#if 0/* todo: */
|
||||
/* check listen_interval */
|
||||
if (listen_interval > hapd->conf->max_listen_interval) {
|
||||
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
|
||||
HOSTAPD_LEVEL_DEBUG,
|
||||
"Too large Listen Interval (%d)",
|
||||
listen_interval);
|
||||
resp = WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
pstat->listen_interval = listen_interval;
|
||||
#endif
|
||||
|
||||
/* now parse all ieee802_11 ie to point to elems */
|
||||
if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed ||
|
||||
!elems.ssid) {
|
||||
|
@ -8672,7 +8617,6 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc)
|
|||
|
||||
/* supported rate & extended supported rate */
|
||||
|
||||
#if 1 /* Check if the AP's supported rates are also supported by STA. */
|
||||
get_rate_set(padapter, sta_bssrate, &sta_bssrate_len);
|
||||
/* RTW_INFO("sta_bssrate_len=%d\n", sta_bssrate_len); */
|
||||
|
||||
|
@ -8720,22 +8664,6 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc)
|
|||
bssrate_len = index;
|
||||
RTW_INFO("bssrate_len = %d\n", bssrate_len);
|
||||
|
||||
#else /* Check if the AP's supported rates are also supported by STA. */
|
||||
#if 0
|
||||
get_rate_set(padapter, bssrate, &bssrate_len);
|
||||
#else
|
||||
for (bssrate_len = 0; bssrate_len < NumRates; bssrate_len++) {
|
||||
if (pmlmeinfo->network.SupportedRates[bssrate_len] == 0)
|
||||
break;
|
||||
|
||||
if (pmlmeinfo->network.SupportedRates[bssrate_len] == 0x2C) /* Avoid the proprietary data rate (22Mbps) of Handlink WSG-4000 AP */
|
||||
break;
|
||||
|
||||
bssrate[bssrate_len] = pmlmeinfo->network.SupportedRates[bssrate_len];
|
||||
}
|
||||
#endif
|
||||
#endif /* Check if the AP's supported rates are also supported by STA. */
|
||||
|
||||
if ((bssrate_len == 0) && (pmlmeinfo->network.SupportedRates[0] != 0)) {
|
||||
rtw_free_xmitbuf(pxmitpriv, pmgntframe->pxmitbuf);
|
||||
rtw_free_xmitframe(pxmitpriv, pmgntframe);
|
||||
|
@ -10330,16 +10258,8 @@ unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr)
|
|||
psta = rtw_get_stainfo(pstapriv, addr);
|
||||
if (psta == NULL)
|
||||
return _SUCCESS;
|
||||
|
||||
#if 0
|
||||
RTW_INFO("%s:%s\n", __func__, (initiator == 0) ? "RX_DIR" : "TX_DIR");
|
||||
if (initiator == 1) /* originator */
|
||||
RTW_INFO("tx agg_enable_bitmap(0x%08x)\n", psta->htpriv.agg_enable_bitmap);
|
||||
#endif
|
||||
|
||||
for (tid = 0; tid < TID_NUM; tid++)
|
||||
send_delba_sta_tid(padapter, initiator, psta, tid, 0);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -10528,14 +10448,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI
|
|||
}
|
||||
|
||||
/* todo: */
|
||||
#if 0
|
||||
if (judge_network_type(bssid->SupportedRates, (len + i)) == WIRELESS_11B)
|
||||
bssid->NetworkTypeInUse = Ndis802_11DS;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
bssid->NetworkTypeInUse = Ndis802_11OFDM24;
|
||||
}
|
||||
bssid->NetworkTypeInUse = Ndis802_11OFDM24;
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
if (subtype == WIFI_PROBEREQ) {
|
||||
|
@ -11007,11 +10920,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid)
|
|||
k++;
|
||||
} else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) {
|
||||
chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
|
||||
#if 0
|
||||
chplan_new[k].ScanType = chplan_sta[i].ScanType;
|
||||
#else
|
||||
chplan_new[k].ScanType = SCAN_PASSIVE;
|
||||
#endif
|
||||
i++;
|
||||
k++;
|
||||
} else if (chplan_sta[i].ChannelNum > chplan_ap.Channel[j]) {
|
||||
|
@ -11027,11 +10936,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid)
|
|||
&& (chplan_sta[i].ChannelNum != 0)
|
||||
&& (chplan_sta[i].ChannelNum <= 14)) {
|
||||
chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
|
||||
#if 0
|
||||
chplan_new[k].ScanType = chplan_sta[i].ScanType;
|
||||
#else
|
||||
chplan_new[k].ScanType = SCAN_PASSIVE;
|
||||
#endif
|
||||
i++;
|
||||
k++;
|
||||
}
|
||||
|
@ -11076,11 +10981,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid)
|
|||
k++;
|
||||
} else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) {
|
||||
chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
|
||||
#if 0
|
||||
chplan_new[k].ScanType = chplan_sta[i].ScanType;
|
||||
#else
|
||||
chplan_new[k].ScanType = SCAN_PASSIVE;
|
||||
#endif
|
||||
i++;
|
||||
k++;
|
||||
} else if (chplan_sta[i].ChannelNum > chplan_ap.Channel[j]) {
|
||||
|
@ -11094,11 +10995,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid)
|
|||
/* change AP not support channel to Passive scan */
|
||||
while ((i < MAX_CHANNEL_NUM) && (chplan_sta[i].ChannelNum != 0)) {
|
||||
chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
|
||||
#if 0
|
||||
chplan_new[k].ScanType = chplan_sta[i].ScanType;
|
||||
#else
|
||||
chplan_new[k].ScanType = SCAN_PASSIVE;
|
||||
#endif
|
||||
i++;
|
||||
k++;
|
||||
}
|
||||
|
@ -11131,21 +11028,6 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid)
|
|||
}
|
||||
_RTW_INFO("}\n");
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* recover the right channel index */
|
||||
channel = chplan_sta[pmlmeext->sitesurvey_res.channel_idx].ChannelNum;
|
||||
k = 0;
|
||||
while ((k < MAX_CHANNEL_NUM) && (chplan_new[k].ChannelNum != 0)) {
|
||||
if (chplan_new[k].ChannelNum == channel) {
|
||||
RTW_INFO("%s: change mlme_ext sitesurvey channel index from %d to %d\n",
|
||||
__func__, pmlmeext->sitesurvey_res.channel_idx, k);
|
||||
pmlmeext->sitesurvey_res.channel_idx = k;
|
||||
break;
|
||||
}
|
||||
k++;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* If channel is used by AP, set channel scan type to active */
|
||||
|
@ -14728,16 +14610,9 @@ u8 chk_bmc_sleepq_hdl(_adapter *padapter, unsigned char *pbuf)
|
|||
if (xmitframe_hiq_filter(pxmitframe) == _TRUE)
|
||||
pxmitframe->attrib.qsel = QSLT_HIGH;/* HIQ */
|
||||
|
||||
#if 0
|
||||
_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL);
|
||||
if (rtw_hal_xmit(padapter, pxmitframe) == _TRUE)
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
_enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL);
|
||||
#endif
|
||||
rtw_hal_xmitframe_enqueue(padapter, pxmitframe);
|
||||
}
|
||||
|
||||
/* _exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); */
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
if (rtw_get_intf_type(padapter) != RTW_PCIE) {
|
||||
|
@ -15343,11 +15218,6 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf)
|
|||
_cancel_timer_ex(&ptdls_sta->ch_sw_timer);
|
||||
_cancel_timer_ex(&ptdls_sta->stay_on_base_chnl_timer);
|
||||
_cancel_timer_ex(&ptdls_sta->ch_sw_monitor_timer);
|
||||
#if 0
|
||||
_rtw_memset(pHalData->tdls_ch_sw_iqk_info_base_chnl, 0x00, sizeof(pHalData->tdls_ch_sw_iqk_info_base_chnl));
|
||||
_rtw_memset(pHalData->tdls_ch_sw_iqk_info_off_chnl, 0x00, sizeof(pHalData->tdls_ch_sw_iqk_info_off_chnl));
|
||||
#endif
|
||||
|
||||
if (option == TDLS_CH_SW_END_TO_BASE_CHNL)
|
||||
rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_CH_SW_TO_BASE_CHNL);
|
||||
|
||||
|
|
|
@ -339,20 +339,6 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr,
|
|||
RTW_PUT_BE32(wpsie, WPSOUI);
|
||||
wpsielen += 4;
|
||||
|
||||
#if 0
|
||||
/* WPS version */
|
||||
/* Type: */
|
||||
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_ATTR_VER1);
|
||||
wpsielen += 2;
|
||||
|
||||
/* Length: */
|
||||
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(0x0001);
|
||||
wpsielen += 2;
|
||||
|
||||
/* Value: */
|
||||
wpsie[wpsielen++] = WPS_VERSION_1; /* Version 1.0 */
|
||||
#endif
|
||||
|
||||
/* Config Method */
|
||||
/* Type: */
|
||||
/* *(u16*) ( wpsie + wpsielen ) = cpu_to_be16( WPS_ATTR_CONF_METHOD ); */
|
||||
|
@ -5241,21 +5227,7 @@ void dbg_rtw_p2p_set_pre_state(struct wifidirect_info *wdinfo, enum P2P_STATE st
|
|||
);
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
void dbg_rtw_p2p_restore_state(struct wifidirect_info *wdinfo, const char *caller, int line)
|
||||
{
|
||||
if (wdinfo->pre_p2p_state != -1) {
|
||||
RTW_INFO("[CONFIG_DBG_P2P]%s:%d restore from %s to %s\n", caller, line
|
||||
, p2p_state_str[wdinfo->p2p_state], p2p_state_str[wdinfo->pre_p2p_state]
|
||||
);
|
||||
_rtw_p2p_restore_state(wdinfo);
|
||||
} else {
|
||||
RTW_INFO("[CONFIG_DBG_P2P]%s:%d restore no pre state, cur state %s\n", caller, line
|
||||
, p2p_state_str[wdinfo->p2p_state]
|
||||
);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void dbg_rtw_p2p_set_role(struct wifidirect_info *wdinfo, enum P2P_ROLE role, const char *caller, int line)
|
||||
{
|
||||
if (wdinfo->role != role) {
|
||||
|
|
|
@ -884,18 +884,9 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode
|
|||
rtw_usleep_os(100);
|
||||
} while (1);
|
||||
}
|
||||
#endif
|
||||
#if 0 /*def CONFIG_LPS_PG*/
|
||||
lps_pg_hdl_id = LPS_PG_REDLEMEM;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_LPS_PG_HANDLE, (u8 *)(&lps_pg_hdl_id));
|
||||
#endif
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode));
|
||||
|
||||
#if 0 /*def CONFIG_LPS_PG*/
|
||||
lps_pg_hdl_id = LPS_PG_RESEND_H2C;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_LPS_PG_HANDLE, (u8 *)(&lps_pg_hdl_id));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LPS_POFF
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_LPS_POFF_SET_MODE,
|
||||
(u8 *)(&ps_mode));
|
||||
|
@ -1371,12 +1362,6 @@ void cpwm_int_hdl(
|
|||
goto exit;
|
||||
|
||||
pwrpriv = adapter_to_pwrctl(padapter);
|
||||
#if 0
|
||||
if (pwrpriv->cpwm_tog == (preportpwrstate->state & PS_TOGGLE)) {
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
#ifdef CONFIG_LPS_RPWM_TIMER
|
||||
|
|
|
@ -130,32 +130,18 @@ static void sreset_restore_security_station(_adapter *padapter)
|
|||
val8 = 0xcf;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ((padapter->securitypriv.dot11PrivacyAlgrthm == _WEP40_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_)) {
|
||||
|
||||
for (EntryId = 0; EntryId < 4; EntryId++) {
|
||||
if (EntryId == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
rtw_set_key(padapter, &padapter->securitypriv, EntryId, 1, _FALSE);
|
||||
else
|
||||
rtw_set_key(padapter, &padapter->securitypriv, EntryId, 0, _FALSE);
|
||||
}
|
||||
|
||||
} else
|
||||
#endif
|
||||
if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) {
|
||||
psta = rtw_get_stainfo(pstapriv, get_bssid(mlmepriv));
|
||||
if (psta == NULL) {
|
||||
/* DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail\n")); */
|
||||
} else {
|
||||
/* pairwise key */
|
||||
rtw_setstakey_cmd(padapter, psta, UNICAST_KEY, _FALSE);
|
||||
/* group key */
|
||||
rtw_set_key(padapter, &padapter->securitypriv, padapter->securitypriv.dot118021XGrpKeyid, 0, _FALSE);
|
||||
}
|
||||
if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) {
|
||||
psta = rtw_get_stainfo(pstapriv, get_bssid(mlmepriv));
|
||||
if (psta == NULL) {
|
||||
/* DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail\n")); */
|
||||
} else {
|
||||
/* pairwise key */
|
||||
rtw_setstakey_cmd(padapter, psta, UNICAST_KEY, _FALSE);
|
||||
/* group key */
|
||||
rtw_set_key(padapter, &padapter->securitypriv, padapter->securitypriv.dot118021XGrpKeyid, 0, _FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sreset_restore_network_station(_adapter *padapter)
|
||||
|
@ -165,25 +151,6 @@ static 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, _FALSE);
|
||||
|
||||
{
|
||||
|
|
|
@ -230,20 +230,6 @@ int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsig
|
|||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
#if 0
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, da);
|
||||
if (psta) {
|
||||
if (power_mode)
|
||||
rtw_hal_macid_sleep(padapter, psta->mac_id);
|
||||
else
|
||||
rtw_hal_macid_wakeup(padapter, psta->mac_id);
|
||||
} else {
|
||||
RTW_INFO(FUNC_ADPT_FMT ": Can't find sta info for " MAC_FMT ", skip macid %s!!\n",
|
||||
FUNC_ADPT_ARG(padapter), MAC_ARG(da), power_mode ? "sleep" : "wakeup");
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
do {
|
||||
ret = _issue_nulldata_to_TDLS_peer_STA(padapter, da, power_mode, wait_ms > 0 ? _TRUE : _FALSE);
|
||||
|
||||
|
@ -2071,20 +2057,6 @@ int On_TDLS_Teardown(_adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
}
|
||||
|
||||
#if 0
|
||||
u8 TDLS_check_ch_state(uint state)
|
||||
{
|
||||
if (state & TDLS_CH_SWITCH_ON_STATE &&
|
||||
state & TDLS_PEER_AT_OFF_STATE) {
|
||||
if (state & TDLS_PEER_SLEEP_STATE)
|
||||
return 2; /* U-APSD + ch. switch */
|
||||
else
|
||||
return 1; /* ch. switch */
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int On_TDLS_Peer_Traffic_Indication(_adapter *padapter, union recv_frame *precv_frame)
|
||||
{
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
|
|
|
@ -1115,13 +1115,6 @@ static bool _rtw_sec_camid_is_used(struct cam_ctl_t *cam_ctl, u8 id)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
#if 0 /* for testing */
|
||||
if (rtw_sec_camid_is_drv_forbid(cam_ctl, id)) {
|
||||
ret = _TRUE;
|
||||
goto exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = rtw_sec_camid_is_set(&cam_ctl->used, id);
|
||||
|
||||
exit:
|
||||
|
@ -1257,11 +1250,7 @@ static s16 rtw_get_camid(_adapter *adapter, struct sta_info *sta, u8 *addr, s16
|
|||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
|
||||
int i;
|
||||
#if 0 /* for testing */
|
||||
static u8 start_id = 0;
|
||||
#else
|
||||
u8 start_id = 0;
|
||||
#endif
|
||||
s16 cam_id = -1;
|
||||
|
||||
if (addr == NULL) {
|
||||
|
@ -1599,23 +1588,6 @@ int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
_rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element));
|
||||
pmlmeinfo->WMM_enable = 1;
|
||||
return _TRUE;
|
||||
|
||||
#if 0
|
||||
if (pregpriv->wifi_spec == 1) {
|
||||
if (pmlmeinfo->WMM_enable == 1) {
|
||||
/* todo: compare the parameter set count & decide wheher to update or not */
|
||||
return _FAIL;
|
||||
} else {
|
||||
pmlmeinfo->WMM_enable = 1;
|
||||
_rtw_rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element));
|
||||
return _TRUE;
|
||||
}
|
||||
} else {
|
||||
pmlmeinfo->WMM_enable = 0;
|
||||
return _FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void WMMOnAssocRsp(_adapter *padapter)
|
||||
|
@ -2077,52 +2049,6 @@ void HTOnAssocRsp(_adapter *padapter)
|
|||
rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_MIN_SPACE, (u8 *)(&min_MPDU_spacing));
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&max_AMPDU_len));
|
||||
|
||||
#if 0 /* move to rtw_update_ht_cap() */
|
||||
if ((pregpriv->bw_mode > 0) &&
|
||||
(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & BIT(1)) &&
|
||||
(pmlmeinfo->HT_info.infos[0] & BIT(2))) {
|
||||
/* switch to the 40M Hz mode accoring to the AP */
|
||||
pmlmeext->cur_bwmode = CHANNEL_WIDTH_40;
|
||||
switch ((pmlmeinfo->HT_info.infos[0] & 0x3)) {
|
||||
case EXTCHNL_OFFSET_UPPER:
|
||||
pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
|
||||
break;
|
||||
|
||||
case EXTCHNL_OFFSET_LOWER:
|
||||
pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
|
||||
break;
|
||||
|
||||
default:
|
||||
pmlmeext->cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); */
|
||||
|
||||
#if 0 /* move to rtw_update_ht_cap() */
|
||||
/* */
|
||||
/* Config SM Power Save setting */
|
||||
/* */
|
||||
pmlmeinfo->SM_PS = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & 0x0C) >> 2;
|
||||
if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC) {
|
||||
#if 0
|
||||
u8 i;
|
||||
/* update the MCS rates */
|
||||
for (i = 0; i < 16; i++)
|
||||
pmlmeinfo->HT_caps.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
|
||||
#endif
|
||||
RTW_INFO("%s(): WLAN_HT_CAP_SM_PS_STATIC\n", __func__);
|
||||
}
|
||||
|
||||
/* */
|
||||
/* Config current HT Protection mode. */
|
||||
/* */
|
||||
pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void ERP_IE_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
||||
|
@ -2347,27 +2273,6 @@ void rtw_dump_bcn_keys(struct beacon_keys *recv_beacon)
|
|||
|
||||
int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
||||
{
|
||||
#if 0
|
||||
unsigned int len;
|
||||
unsigned char *p;
|
||||
unsigned short val16, subtype;
|
||||
struct wlan_network *cur_network = &(Adapter->mlmepriv.cur_network);
|
||||
/* u8 wpa_ie[255],rsn_ie[255]; */
|
||||
u16 wpa_len = 0, rsn_len = 0;
|
||||
u8 encryp_protocol = 0;
|
||||
WLAN_BSSID_EX *bssid;
|
||||
int group_cipher = 0, pairwise_cipher = 0, is_8021x = 0;
|
||||
unsigned char *pbuf;
|
||||
u32 wpa_ielen = 0;
|
||||
u8 *pbssid = GetAddr3Ptr(pframe);
|
||||
u32 hidden_ssid = 0;
|
||||
u8 cur_network_type, network_type = 0;
|
||||
struct HT_info_element *pht_info = NULL;
|
||||
struct rtw_ieee80211_ht_cap *pht_cap = NULL;
|
||||
u32 bcn_channel;
|
||||
unsigned short ht_cap_info;
|
||||
unsigned char ht_info_infos_0;
|
||||
#endif
|
||||
unsigned int len;
|
||||
u8 *pbssid = GetAddr3Ptr(pframe);
|
||||
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
|
||||
|
@ -2452,182 +2357,6 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
|||
}
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
#if 0
|
||||
bssid = (WLAN_BSSID_EX *)rtw_zmalloc(sizeof(WLAN_BSSID_EX));
|
||||
if (bssid == NULL) {
|
||||
RTW_INFO("%s rtw_zmalloc fail !!!\n", __func__);
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
if ((pmlmepriv->timeBcnInfoChkStart != 0) && (rtw_get_passing_time_ms(pmlmepriv->timeBcnInfoChkStart) > DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS)) {
|
||||
pmlmepriv->timeBcnInfoChkStart = 0;
|
||||
pmlmepriv->NumOfBcnInfoChkFail = 0;
|
||||
}
|
||||
|
||||
subtype = get_frame_sub_type(pframe) >> 4;
|
||||
|
||||
if (subtype == WIFI_BEACON)
|
||||
bssid->Reserved[0] = 1;
|
||||
|
||||
bssid->Length = sizeof(WLAN_BSSID_EX) - MAX_IE_SZ + len;
|
||||
|
||||
/* below is to copy the information element */
|
||||
bssid->IELength = len;
|
||||
_rtw_memcpy(bssid->IEs, (pframe + sizeof(struct rtw_ieee80211_hdr_3addr)), bssid->IELength);
|
||||
|
||||
/* check bw and channel offset */
|
||||
/* parsing HT_CAP_IE */
|
||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
||||
if (p && len > 0) {
|
||||
pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2);
|
||||
ht_cap_info = pht_cap->cap_info;
|
||||
} else
|
||||
ht_cap_info = 0;
|
||||
/* parsing HT_INFO_IE */
|
||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
||||
if (p && len > 0) {
|
||||
pht_info = (struct HT_info_element *)(p + 2);
|
||||
ht_info_infos_0 = pht_info->infos[0];
|
||||
} else
|
||||
ht_info_infos_0 = 0;
|
||||
if (ht_cap_info != cur_network->BcnInfo.ht_cap_info ||
|
||||
((ht_info_infos_0 & 0x03) != (cur_network->BcnInfo.ht_info_infos_0 & 0x03))) {
|
||||
RTW_INFO("%s bcn now: ht_cap_info:%x ht_info_infos_0:%x\n", __func__,
|
||||
ht_cap_info, ht_info_infos_0);
|
||||
RTW_INFO("%s bcn link: ht_cap_info:%x ht_info_infos_0:%x\n", __func__,
|
||||
cur_network->BcnInfo.ht_cap_info, cur_network->BcnInfo.ht_info_infos_0);
|
||||
RTW_INFO("%s bw mode change\n", __func__);
|
||||
{
|
||||
/* bcn_info_update */
|
||||
cur_network->BcnInfo.ht_cap_info = ht_cap_info;
|
||||
cur_network->BcnInfo.ht_info_infos_0 = ht_info_infos_0;
|
||||
/* to do : need to check that whether modify related register of BB or not */
|
||||
}
|
||||
/* goto _mismatch; */
|
||||
}
|
||||
|
||||
/* Checking for channel */
|
||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _DSSET_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
||||
if (p)
|
||||
bcn_channel = *(p + 2);
|
||||
else {/* In 5G, some ap do not have DSSET IE checking HT info for channel */
|
||||
rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
||||
if (pht_info)
|
||||
bcn_channel = pht_info->primary_channel;
|
||||
else { /* we don't find channel IE, so don't check it */
|
||||
/* RTW_INFO("Oops: %s we don't find channel IE, so don't check it\n", __func__); */
|
||||
bcn_channel = Adapter->mlmeextpriv.cur_channel;
|
||||
}
|
||||
}
|
||||
if (bcn_channel != Adapter->mlmeextpriv.cur_channel) {
|
||||
RTW_INFO("%s beacon channel:%d cur channel:%d disconnect\n", __func__,
|
||||
bcn_channel, Adapter->mlmeextpriv.cur_channel);
|
||||
goto _mismatch;
|
||||
}
|
||||
|
||||
/* checking SSID */
|
||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _SSID_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
||||
if (p == NULL) {
|
||||
RTW_INFO("%s marc: cannot find SSID for survey event\n", __func__);
|
||||
hidden_ssid = _TRUE;
|
||||
} else
|
||||
hidden_ssid = _FALSE;
|
||||
|
||||
if ((NULL != p) && (_FALSE == hidden_ssid && (*(p + 1)))) {
|
||||
_rtw_memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
|
||||
bssid->Ssid.SsidLength = *(p + 1);
|
||||
} else {
|
||||
bssid->Ssid.SsidLength = 0;
|
||||
bssid->Ssid.Ssid[0] = '\0';
|
||||
}
|
||||
|
||||
|
||||
if (_rtw_memcmp(bssid->Ssid.Ssid, cur_network->network.Ssid.Ssid, 32) == _FALSE ||
|
||||
bssid->Ssid.SsidLength != cur_network->network.Ssid.SsidLength) {
|
||||
if (bssid->Ssid.Ssid[0] != '\0' && bssid->Ssid.SsidLength != 0) { /* not hidden ssid */
|
||||
RTW_INFO("%s(), SSID is not match\n", __func__);
|
||||
goto _mismatch;
|
||||
}
|
||||
}
|
||||
|
||||
/* check encryption info */
|
||||
val16 = rtw_get_capability((WLAN_BSSID_EX *)bssid);
|
||||
|
||||
if (val16 & BIT(4))
|
||||
bssid->Privacy = 1;
|
||||
else
|
||||
bssid->Privacy = 0;
|
||||
|
||||
if (cur_network->network.Privacy != bssid->Privacy) {
|
||||
RTW_INFO("%s(), privacy is not match\n", __func__);
|
||||
goto _mismatch;
|
||||
}
|
||||
|
||||
rtw_get_sec_ie(bssid->IEs, bssid->IELength, NULL, &rsn_len, NULL, &wpa_len);
|
||||
|
||||
if (rsn_len > 0)
|
||||
encryp_protocol = ENCRYP_PROTOCOL_WPA2;
|
||||
else if (wpa_len > 0)
|
||||
encryp_protocol = ENCRYP_PROTOCOL_WPA;
|
||||
else {
|
||||
if (bssid->Privacy)
|
||||
encryp_protocol = ENCRYP_PROTOCOL_WEP;
|
||||
}
|
||||
|
||||
if (cur_network->BcnInfo.encryp_protocol != encryp_protocol) {
|
||||
RTW_INFO("%s(): enctyp is not match\n", __func__);
|
||||
goto _mismatch;
|
||||
}
|
||||
|
||||
if (encryp_protocol == ENCRYP_PROTOCOL_WPA || encryp_protocol == ENCRYP_PROTOCOL_WPA2) {
|
||||
pbuf = rtw_get_wpa_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength - 12);
|
||||
if (pbuf && (wpa_ielen > 0)) {
|
||||
rtw_parse_wpa_ie(pbuf, wpa_ielen + 2, &group_cipher, &pairwise_cipher, &is_8021x);
|
||||
} else {
|
||||
pbuf = rtw_get_wpa2_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength - 12);
|
||||
|
||||
if (pbuf && (wpa_ielen > 0)) {
|
||||
rtw_parse_wpa2_ie(pbuf, wpa_ielen + 2, &group_cipher, &pairwise_cipher, &is_8021x);
|
||||
}
|
||||
}
|
||||
|
||||
if (pairwise_cipher != cur_network->BcnInfo.pairwise_cipher || group_cipher != cur_network->BcnInfo.group_cipher) {
|
||||
RTW_INFO("%s pairwise_cipher(%x:%x) or group_cipher(%x:%x) is not match\n", __func__,
|
||||
pairwise_cipher, cur_network->BcnInfo.pairwise_cipher,
|
||||
group_cipher, cur_network->BcnInfo.group_cipher);
|
||||
goto _mismatch;
|
||||
}
|
||||
|
||||
if (is_8021x != cur_network->BcnInfo.is_8021x) {
|
||||
RTW_INFO("%s authentication is not match\n", __func__);
|
||||
goto _mismatch;
|
||||
}
|
||||
}
|
||||
|
||||
rtw_mfree((u8 *)bssid, sizeof(WLAN_BSSID_EX));
|
||||
return _SUCCESS;
|
||||
|
||||
_mismatch:
|
||||
rtw_mfree((u8 *)bssid, sizeof(WLAN_BSSID_EX));
|
||||
|
||||
if (pmlmepriv->NumOfBcnInfoChkFail == 0)
|
||||
pmlmepriv->timeBcnInfoChkStart = rtw_get_current_time();
|
||||
|
||||
pmlmepriv->NumOfBcnInfoChkFail++;
|
||||
RTW_INFO("%s by "ADPT_FMT" - NumOfChkFail = %d (SeqNum of this Beacon frame = %d).\n", __func__, ADPT_ARG(Adapter), pmlmepriv->NumOfBcnInfoChkFail, GetSequence(pframe));
|
||||
|
||||
if ((pmlmepriv->timeBcnInfoChkStart != 0) && (rtw_get_passing_time_ms(pmlmepriv->timeBcnInfoChkStart) <= DISCONNECT_BY_CHK_BCN_FAIL_OBSERV_PERIOD_IN_MS)
|
||||
&& (pmlmepriv->NumOfBcnInfoChkFail >= DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD)) {
|
||||
RTW_INFO("%s by "ADPT_FMT" - NumOfChkFail = %d >= threshold : %d (in %d ms), return FAIL.\n", __func__, ADPT_ARG(Adapter), pmlmepriv->NumOfBcnInfoChkFail,
|
||||
DISCONNECT_BY_CHK_BCN_FAIL_THRESHOLD, rtw_get_passing_time_ms(pmlmepriv->timeBcnInfoChkStart));
|
||||
pmlmepriv->timeBcnInfoChkStart = 0;
|
||||
pmlmepriv->NumOfBcnInfoChkFail = 0;
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
return _SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta_info *psta)
|
||||
|
@ -3156,14 +2885,6 @@ void update_wireless_mode(_adapter *padapter)
|
|||
}
|
||||
|
||||
pmlmeext->cur_wireless_mode = network_type & padapter->registrypriv.wireless_mode;
|
||||
/* RTW_INFO("network_type=%02x, padapter->registrypriv.wireless_mode=%02x\n", network_type, padapter->registrypriv.wireless_mode); */
|
||||
#if 0
|
||||
if ((pmlmeext->cur_wireless_mode == WIRELESS_11G) ||
|
||||
(pmlmeext->cur_wireless_mode == WIRELESS_11BG)) /* WIRELESS_MODE_G) */
|
||||
SIFS_Timer = 0x0a0a;/* CCK */
|
||||
else
|
||||
SIFS_Timer = 0x0e0e;/* pHalData->SifsTime; //OFDM */
|
||||
#endif
|
||||
|
||||
SIFS_Timer = 0x0a0a0808; /* 0x0808->for CCK, 0x0a0a->for OFDM
|
||||
* change this value if having IOT issues. */
|
||||
|
@ -3186,31 +2907,8 @@ void update_wireless_mode(_adapter *padapter)
|
|||
update_mgnt_tx_rate(padapter, IEEE80211_OFDM_RATE_6MB);
|
||||
}
|
||||
|
||||
void fire_write_MAC_cmd(_adapter *padapter, unsigned int addr, unsigned int value);
|
||||
void fire_write_MAC_cmd(_adapter *padapter, unsigned int addr, unsigned int value)
|
||||
{
|
||||
#if 0
|
||||
struct cmd_obj *ph2c;
|
||||
struct reg_rw_parm *pwriteMacPara;
|
||||
struct cmd_priv *pcmdpriv = &(padapter->cmdpriv);
|
||||
|
||||
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if (ph2c == NULL)
|
||||
return;
|
||||
|
||||
pwriteMacPara = (struct reg_rw_parm *)rtw_malloc(sizeof(struct reg_rw_parm));
|
||||
if (pwriteMacPara == NULL) {
|
||||
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
|
||||
return;
|
||||
}
|
||||
|
||||
pwriteMacPara->rw = 1;
|
||||
pwriteMacPara->addr = addr;
|
||||
pwriteMacPara->value = value;
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pwriteMacPara, GEN_CMD_CODE(_Write_MACREG));
|
||||
rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
#endif
|
||||
}
|
||||
|
||||
void update_sta_basic_rate(struct sta_info *psta, u8 wireless_mode)
|
||||
|
@ -3826,105 +3524,6 @@ inline void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl)
|
|||
_rtw_spinlock_free(&macid_ctl->lock);
|
||||
}
|
||||
|
||||
#if 0
|
||||
unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame)
|
||||
{
|
||||
unsigned short ATIMWindow;
|
||||
unsigned char *pframe;
|
||||
struct tx_desc *ptxdesc;
|
||||
struct rtw_ieee80211_hdr *pwlanhdr;
|
||||
unsigned short *fctrl;
|
||||
unsigned int rate_len, len = 0;
|
||||
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
|
||||
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
_rtw_memset(beacon_frame, 0, 256);
|
||||
|
||||
pframe = beacon_frame + TXDESC_SIZE;
|
||||
|
||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
|
||||
|
||||
fctrl = &(pwlanhdr->frame_ctl);
|
||||
*(fctrl) = 0;
|
||||
|
||||
_rtw_memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN);
|
||||
|
||||
set_frame_sub_type(pframe, WIFI_BEACON);
|
||||
|
||||
pframe += sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
len = sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
|
||||
/* timestamp will be inserted by hardware */
|
||||
pframe += 8;
|
||||
len += 8;
|
||||
|
||||
/* beacon interval: 2 bytes */
|
||||
_rtw_memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2);
|
||||
|
||||
pframe += 2;
|
||||
len += 2;
|
||||
|
||||
/* capability info: 2 bytes */
|
||||
_rtw_memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2);
|
||||
|
||||
pframe += 2;
|
||||
len += 2;
|
||||
|
||||
/* SSID */
|
||||
pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &len);
|
||||
|
||||
/* supported rates... */
|
||||
rate_len = rtw_get_rateset_len(cur_network->SupportedRates);
|
||||
pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &len);
|
||||
|
||||
/* DS parameter set */
|
||||
pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &len);
|
||||
|
||||
/* IBSS Parameter Set... */
|
||||
/* ATIMWindow = cur->Configuration.ATIMWindow; */
|
||||
ATIMWindow = 0;
|
||||
pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &len);
|
||||
|
||||
/* todo: ERP IE */
|
||||
|
||||
/* EXTERNDED SUPPORTED RATE */
|
||||
if (rate_len > 8)
|
||||
pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &len);
|
||||
|
||||
if ((len + TXDESC_SIZE) > 256) {
|
||||
/* RTW_INFO("marc: beacon frame too large\n"); */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* fill the tx descriptor */
|
||||
ptxdesc = (struct tx_desc *)beacon_frame;
|
||||
|
||||
/* offset 0 */
|
||||
ptxdesc->txdw0 |= cpu_to_le32(len & 0x0000ffff);
|
||||
ptxdesc->txdw0 |= cpu_to_le32(((TXDESC_SIZE + OFFSET_SZ) << OFFSET_SHT) & 0x00ff0000); /* default = 32 bytes for TX Desc */
|
||||
|
||||
/* offset 4 */
|
||||
ptxdesc->txdw1 |= cpu_to_le32((0x10 << QSEL_SHT) & 0x00001f00);
|
||||
|
||||
/* offset 8 */
|
||||
ptxdesc->txdw2 |= cpu_to_le32(BMC);
|
||||
ptxdesc->txdw2 |= cpu_to_le32(BK);
|
||||
|
||||
/* offset 16 */
|
||||
ptxdesc->txdw4 = 0x80000000;
|
||||
|
||||
/* offset 20 */
|
||||
ptxdesc->txdw5 = 0x00000000; /* 1M */
|
||||
|
||||
return len + TXDESC_SIZE;
|
||||
}
|
||||
#endif
|
||||
|
||||
_adapter *dvobj_get_port0_adapter(struct dvobj_priv *dvobj)
|
||||
{
|
||||
_adapter *port0_iface = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue