diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 1b7e939..2e09189 100644 --- a/core/rtw_ap.c +++ b/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) diff --git a/core/rtw_btcoex.c b/core/rtw_btcoex.c index dfc0ed7..5a08501 100644 --- a/core/rtw_btcoex.c +++ b/core/rtw_btcoex.c @@ -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 */ diff --git a/core/rtw_debug.c b/core/rtw_debug.c index 8938004..b52e5ed 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -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) diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 9ed987e..5850213 100644 --- a/core/rtw_mlme.c +++ b/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; diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 4e2e64b..250fc74 100755 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -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); diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index 3677733..4b33764 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -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) { diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index 53346ce..3f7b22c 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -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 diff --git a/core/rtw_sreset.c b/core/rtw_sreset.c index 660cc52..ee7fc6b 100644 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -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); { diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 38bfd5c..deff6ab 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -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; diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index f2b4157..859150c 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -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; diff --git a/hal/btc/halbtcoutsrc.h b/hal/btc/halbtcoutsrc.h index 14a56de..5a276ef 100644 --- a/hal/btc/halbtcoutsrc.h +++ b/hal/btc/halbtcoutsrc.h @@ -960,12 +960,6 @@ VOID EXhalbtcoutsrc_UpdateMinBtRssi( IN s1Byte btRssi ); -#if 0 -VOID -EXhalbtcoutsrc_SetBtExist( - IN BOOLEAN bBtExist - ); -#endif VOID EXhalbtcoutsrc_SetChipType( IN u1Byte chipType diff --git a/hal/hal_btcoex.c b/hal/hal_btcoex.c index 47b380c..595cd82 100644 --- a/hal/hal_btcoex.c +++ b/hal/hal_btcoex.c @@ -330,14 +330,6 @@ void halbtcoutsrc_NormalLps(PBTC_COEXIST pBtCoexist) pBtCoexist->bt_info.bt_lps_on = _FALSE; rtw_btcoex_LPS_Leave(padapter); pBtCoexist->bt_info.bt_ctrl_lps = _FALSE; - - /* recover the LPS state to the original */ -#if 0 - padapter->hal_func.UpdateLPSStatusHandler( - padapter, - pPSC->RegLeisurePsMode, - pPSC->RegPowerSaveMode); -#endif } } @@ -839,13 +831,9 @@ u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf) break; case BTC_GET_BL_WIFI_SCAN: -#if 0 - *pu8 = (rtw_mi_check_fwstate(padapter, WIFI_SITE_MONITOR)) ? _TRUE : _FALSE; -#else /* Use the value of the new variable GLBtcWiFiInScanState to judge whether WiFi is in scan state or not, since the originally used flag WIFI_SITE_MONITOR in fwstate may not be cleared in time */ *pu8 = GLBtcWiFiInScanState; -#endif break; case BTC_GET_BL_WIFI_LINK: @@ -1127,11 +1115,7 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) /* the following are some action which will be triggered */ case BTC_SET_ACT_GET_BT_RSSI: -#if 0 - BT_SendGetBtRssiEvent(padapter); -#else ret = _FALSE; -#endif break; case BTC_SET_ACT_AGGREGATE_CTRL: @@ -1229,17 +1213,7 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) #endif /* CONFIG_BT_COEXIST_SOCKET_TRX */ break; case BTC_SET_ACT_CTRL_8723B_ANT: -#if 0 - { - u1Byte dataLen = *pU1Tmp; - u1Byte tmpBuf[BTC_TMP_BUF_SHORT]; - if (dataLen) - PlatformMoveMemory(&tmpBuf[0], pU1Tmp + 1, dataLen); - BT_Set8723bAnt(Adapter, dataLen, &tmpBuf[0]); - } -#else ret = _FALSE; -#endif break; /* ===================== */ default: @@ -1288,156 +1262,6 @@ u8 halbtcoutsrc_Under32K(PBTC_COEXIST pBtCoexist) void halbtcoutsrc_DisplayCoexStatistics(PBTC_COEXIST pBtCoexist) { -#if 0 - PADAPTER padapter = (PADAPTER)pBtCoexist->Adapter; - PBT_MGNT pBtMgnt = &padapter->MgntInfo.BtInfo.BtMgnt; - PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); - u8 *cliBuf = pBtCoexist->cliBuf; - u1Byte i, j; - u1Byte tmpbuf[BTC_TMP_BUF_SHORT]; - - - if (gl_coex_offload.cnt_h2c_sent) { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Coex h2c notify]============"); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = H2c(%d)/Ack(%d)", "Coex h2c/c2h overall statistics", - gl_coex_offload.cnt_h2c_sent, gl_coex_offload.cnt_c2h_ack); - for (j = 0; j < COL_STATUS_MAX; j++) { - if (gl_coex_offload.status[j]) { - CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, ", %s:%d", coexH2cResultString[j], gl_coex_offload.status[j]); - CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, BTC_TMP_BUF_SHORT); - } - } - CL_PRINTF(cliBuf); - } - for (i = 0; i < COL_OP_WIFI_OPCODE_MAX; i++) { - if (gl_coex_offload.h2c_record[i].count) { - /*==========================================*/ - /* H2C result statistics*/ - /*==========================================*/ - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = total:%d", coexOpcodeString[i], gl_coex_offload.h2c_record[i].count); - for (j = 0; j < COL_STATUS_MAX; j++) { - if (gl_coex_offload.h2c_record[i].status[j]) { - CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, ", %s:%d", coexH2cResultString[j], gl_coex_offload.h2c_record[i].status[j]); - CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, BTC_TMP_BUF_SHORT); - } - } - CL_PRINTF(cliBuf); - /*==========================================*/ - /* H2C/C2H content*/ - /*==========================================*/ - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = ", "H2C / C2H content"); - for (j = 0; j < gl_coex_offload.h2c_record[i].h2c_len; j++) { - CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, "%02x ", gl_coex_offload.h2c_record[i].h2c_buf[j]); - CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, 3); - } - if (gl_coex_offload.h2c_record[i].c2h_ack_len) { - CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, "/ ", 2); - for (j = 0; j < gl_coex_offload.h2c_record[i].c2h_ack_len; j++) { - CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, "%02x ", gl_coex_offload.h2c_record[i].c2h_ack_buf[j]); - CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, 3); - } - } - CL_PRINTF(cliBuf); - /*==========================================*/ - } - } - - if (gl_coex_offload.cnt_c2h_ind) { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Coex c2h indication]============"); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = Ind(%d)", "C2H indication statistics", - gl_coex_offload.cnt_c2h_ind); - for (j = 0; j < COL_STATUS_MAX; j++) { - if (gl_coex_offload.c2h_ind_status[j]) { - CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, ", %s:%d", coexH2cResultString[j], gl_coex_offload.c2h_ind_status[j]); - CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, BTC_TMP_BUF_SHORT); - } - } - CL_PRINTF(cliBuf); - } - for (i = 0; i < COL_IND_MAX; i++) { - if (gl_coex_offload.c2h_ind_record[i].count) { - /*==========================================*/ - /* H2C result statistics*/ - /*==========================================*/ - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = total:%d", coexIndTypeString[i], gl_coex_offload.c2h_ind_record[i].count); - for (j = 0; j < COL_STATUS_MAX; j++) { - if (gl_coex_offload.c2h_ind_record[i].status[j]) { - CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, ", %s:%d", coexH2cResultString[j], gl_coex_offload.c2h_ind_record[i].status[j]); - CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, BTC_TMP_BUF_SHORT); - } - } - CL_PRINTF(cliBuf); - /*==========================================*/ - /* content*/ - /*==========================================*/ - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = ", "C2H indication content"); - for (j = 0; j < gl_coex_offload.c2h_ind_record[i].ind_len; j++) { - CL_SPRINTF(tmpbuf, BTC_TMP_BUF_SHORT, "%02x ", gl_coex_offload.c2h_ind_record[i].ind_buf[j]); - CL_STRNCAT(cliBuf, BT_TMP_BUF_SIZE, tmpbuf, 3); - } - CL_PRINTF(cliBuf); - /*==========================================*/ - } - } - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Statistics]============"); - CL_PRINTF(cliBuf); - -#if (H2C_USE_IO_THREAD != 1) - for (i = 0; i < H2C_STATUS_MAX; i++) { - if (pHalData->h2cStatistics[i]) { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s] = %d", "H2C statistics", \ - h2cStaString[i], pHalData->h2cStatistics[i]); - CL_PRINTF(cliBuf); - } - } -#else - for (i = 0; i < IO_STATUS_MAX; i++) { - if (Adapter->ioComStr.ioH2cStatistics[i]) { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = [%s] = %d", "H2C statistics", \ - ioStaString[i], Adapter->ioComStr.ioH2cStatistics[i]); - CL_PRINTF(cliBuf); - } - } -#endif -#if 0 - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x", "lastHMEBoxNum", \ - pHalData->LastHMEBoxNum); - CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x / 0x%x", "LastOkH2c/FirstFailH2c(fwNotRead)", \ - pHalData->lastSuccessH2cEid, pHalData->firstFailedH2cEid); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "c2hIsr/c2hIntr/clr1AF/noRdy/noBuf", \ - pHalData->InterruptLog.nIMR_C2HCMD, DBG_Var.c2hInterruptCnt, DBG_Var.c2hClrReadC2hCnt, - DBG_Var.c2hNotReadyCnt, DBG_Var.c2hBufAlloFailCnt); - CL_PRINTF(cliBuf); - - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "c2hPacket", \ - DBG_Var.c2hPacketCnt); - CL_PRINTF(cliBuf); -#endif - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d", "Periodical/ DbgCtrl", \ - pBtCoexist->statistics.cntPeriodical, pBtCoexist->statistics.cntDbgCtrl); - CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d", "PowerOn/InitHw/InitCoexDm/RfStatus", \ - pBtCoexist->statistics.cntPowerOn, pBtCoexist->statistics.cntInitHwConfig, pBtCoexist->statistics.cntInitCoexDm, - pBtCoexist->statistics.cntRfStatusNotify); - CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "Ips/Lps/Scan/Connect/Mstatus", \ - pBtCoexist->statistics.cntIpsNotify, pBtCoexist->statistics.cntLpsNotify, - pBtCoexist->statistics.cntScanNotify, pBtCoexist->statistics.cntConnectNotify, - pBtCoexist->statistics.cntMediaStatusNotify); - CL_PRINTF(cliBuf); - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %d", "Special pkt/Bt info/ bind", - pBtCoexist->statistics.cntSpecialPacketNotify, pBtCoexist->statistics.cntBtInfoNotify, - pBtCoexist->statistics.cntBind); - CL_PRINTF(cliBuf); -#endif PADAPTER padapter = pBtCoexist->Adapter; PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter); u8 *cliBuf = pBtCoexist->cli_buf; @@ -1454,30 +1278,6 @@ void halbtcoutsrc_DisplayCoexStatistics(PBTC_COEXIST pBtCoexist) void halbtcoutsrc_DisplayBtLinkInfo(PBTC_COEXIST pBtCoexist) { -#if 0 - PADAPTER padapter = (PADAPTER)pBtCoexist->Adapter; - PBT_MGNT pBtMgnt = &padapter->MgntInfo.BtInfo.BtMgnt; - u8 *cliBuf = pBtCoexist->cliBuf; - u8 i; - - - if (pBtCoexist->stack_info.profile_notified) { - for (i = 0; i < pBtMgnt->ExtConfig.NumberOfACL; i++) { - if (pBtMgnt->ExtConfig.HCIExtensionVer >= 1) { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/ %s/ %s", "Bt link type/spec/role", \ - BtProfileString[pBtMgnt->ExtConfig.aclLink[i].BTProfile], - BtSpecString[pBtMgnt->ExtConfig.aclLink[i].BTCoreSpec], - BtLinkRoleString[pBtMgnt->ExtConfig.aclLink[i].linkRole]); - CL_PRINTF(cliBuf); - } else { - CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/ %s", "Bt link type/spec", \ - BtProfileString[pBtMgnt->ExtConfig.aclLink[i].BTProfile], - BtSpecString[pBtMgnt->ExtConfig.aclLink[i].BTCoreSpec]); - CL_PRINTF(cliBuf); - } - } - } -#endif } void halbtcoutsrc_DisplayWifiStatus(PBTC_COEXIST pBtCoexist) @@ -1779,20 +1579,7 @@ u16 halbtcoutsrc_SetBtReg(void *pBtcContext, u8 RegType, u32 RegAddr, u32 Data) u8 halbtcoutsrc_SetBtAntDetection(void *pBtcContext, u8 txTime, u8 btChnl) { /* Always return _FALSE since we don't implement this yet */ -#if 0 - PBTC_COEXIST pBtCoexist = (PBTC_COEXIST)pBtcContext; - PADAPTER Adapter = pBtCoexist->Adapter; - u1Byte btCanTx = 0; - BOOLEAN bStatus = FALSE; - - bStatus = NDBG_SetBtAntDetection(Adapter, txTime, btChnl, &btCanTx); - if (bStatus && btCanTx) - return _TRUE; - else - return _FALSE; -#else return _FALSE; -#endif } BOOLEAN @@ -1802,29 +1589,7 @@ halbtcoutsrc_SetBtTRXMASK( ) { /* Always return _FALSE since we don't implement this yet */ -#if 0 - struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext; - PADAPTER Adapter = pBtCoexist->Adapter; - BOOLEAN bStatus = FALSE; - u1Byte btCanTx = 0; - - if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter) || IS_HARDWARE_TYPE_8723D(pBtCoexist->Adapter) - || IS_HARDWARE_TYPE_8821C(pBtCoexist->Adapter)) { - - if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) - bStatus = NDBG_SetBtTRXMASK(Adapter, 1, bt_trx_mask, &btCanTx); - else - bStatus = NDBG_SetBtTRXMASK(Adapter, 2, bt_trx_mask, &btCanTx); - } - - - if (bStatus) - return TRUE; - else - return FALSE; -#else return _FALSE; -#endif } u16 halbtcoutsrc_GetBtReg_with_status(void *pBtcContext, u8 RegType, u32 RegAddr, u32 *data) @@ -1903,18 +1668,6 @@ static COL_H2C_STATUS halbtcoutsrc_send_h2c(PADAPTER Adapter, PCOL_H2C pcol_h2c, INIT_COMPLETION(gl_coex_offload.c2h_event[pcol_h2c->req_num]); #endif - if (TRUE) { -#if 0 /*(USE_HAL_MAC_API == 1) */ - if (RT_STATUS_SUCCESS == HAL_MAC_Send_BT_COEX(&GET_HAL_MAC_INFO(Adapter), (pu1Byte)(pcol_h2c), (u4Byte)h2c_cmd_len, 1)) { - if (!wait_for_completion_timeout(&gl_coex_offload.c2h_event[pcol_h2c->req_num], 20)) { - h2c_status = COL_STATUS_H2C_TIMTOUT; - } - } else { - h2c_status = COL_STATUS_H2C_HALMAC_FAIL; - } -#endif - } - return h2c_status; } @@ -1998,21 +1751,7 @@ COL_H2C_STATUS halbtcoutsrc_CoexH2cProcess(void *pBtCoexist, u8 halbtcoutsrc_GetAntDetValFromBt(void *pBtcContext) { /* Always return 0 since we don't implement this yet */ -#if 0 - struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext; - PADAPTER Adapter = pBtCoexist->Adapter; - u1Byte AntDetVal = 0x0; - u1Byte opcodeVer = 1; - BOOLEAN status = false; - - status = NDBG_GetAntDetValFromBt(Adapter, opcodeVer, &AntDetVal); - - RT_TRACE(COMP_DBG, DBG_LOUD, ("$$$ halbtcoutsrc_GetAntDetValFromBt(): status = %d, feature = %x\n", status, AntDetVal)); - - return AntDetVal; -#else return 0; -#endif } u8 halbtcoutsrc_GetBleScanTypeFromBt(void *pBtcContext) @@ -2152,128 +1891,9 @@ u32 halbtcoutsrc_phydm_query_PHY_counter(void *pBtcContext, u8 info_type) struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext; /* switch to #if 0 in case the phydm version does not provide the function */ -#if 1 return phydm_cmn_info_query((struct PHY_DM_STRUCT *)pBtCoexist->odm_priv, (enum phydm_info_query_e)info_type); -#else - return 0; -#endif } -#if 0 -static void BT_CoexOffloadRecordErrC2hAck(PADAPTER Adapter) -{ - PADAPTER pDefaultAdapter = GetDefaultAdapter(Adapter); - - if (pDefaultAdapter != Adapter) - return; - - if (!hal_btcoex_IsBtExist(Adapter)) - return; - - gl_coex_offload.cnt_c2h_ack++; - - gl_coex_offload.status[COL_STATUS_INVALID_C2H_LEN]++; -} - -static void BT_CoexOffloadC2hAckCheck(PADAPTER Adapter, u8 *tmpBuf, u8 length) -{ - PADAPTER pDefaultAdapter = GetDefaultAdapter(Adapter); - PCOL_C2H_ACK p_c2h_ack = NULL; - u8 req_num = 0xff; - - if (pDefaultAdapter != Adapter) - return; - - if (!hal_btcoex_IsBtExist(Adapter)) - return; - - gl_coex_offload.cnt_c2h_ack++; - - if (length < COL_C2H_ACK_HDR_LEN) { /* c2h ack length must >= 3 (status, opcode_ver, req_num and ret_len) */ - gl_coex_offload.status[COL_STATUS_INVALID_C2H_LEN]++; - } else { - BT_PrintData(Adapter, "[COL], c2h ack:", length, tmpBuf); - - p_c2h_ack = (PCOL_C2H_ACK)tmpBuf; - req_num = p_c2h_ack->req_num; - - _rtw_memmove(&gl_coex_offload.c2h_ack_buf[req_num][0], tmpBuf, length); - gl_coex_offload.c2h_ack_len[req_num] = length; - - complete(&gl_coex_offload.c2h_event[req_num]); - } -} - -static void BT_CoexOffloadC2hIndCheck(PADAPTER Adapter, u8 *tmpBuf, u8 length) -{ - PADAPTER pDefaultAdapter = GetDefaultAdapter(Adapter); - PCOL_C2H_IND p_c2h_ind = NULL; - u8 ind_type = 0, ind_version = 0, ind_length = 0; - - if (pDefaultAdapter != Adapter) - return; - - if (!hal_btcoex_IsBtExist(Adapter)) - return; - - gl_coex_offload.cnt_c2h_ind++; - - if (length < COL_C2H_IND_HDR_LEN) { /* c2h indication length must >= 3 (type, version and length) */ - gl_coex_offload.c2h_ind_status[COL_STATUS_INVALID_C2H_LEN]++; - } else { - BT_PrintData(Adapter, "[COL], c2h indication:", length, tmpBuf); - - p_c2h_ind = (PCOL_C2H_IND)tmpBuf; - ind_type = p_c2h_ind->type; - ind_version = p_c2h_ind->version; - ind_length = p_c2h_ind->length; - - _rtw_memmove(&gl_coex_offload.c2h_ind_buf[0], tmpBuf, length); - gl_coex_offload.c2h_ind_len = length; - - /* log */ - gl_coex_offload.c2h_ind_record[ind_type].count++; - gl_coex_offload.c2h_ind_record[ind_type].status[COL_STATUS_C2H_OK]++; - _rtw_memmove(&gl_coex_offload.c2h_ind_record[ind_type].ind_buf[0], tmpBuf, length); - gl_coex_offload.c2h_ind_record[ind_type].ind_len = length; - - gl_coex_offload.c2h_ind_status[COL_STATUS_C2H_OK]++; - /*TODO: need to check c2h indication length*/ - /* TODO: Notification */ - } -} - -void BT_CoexOffloadC2hCheck(PADAPTER Adapter, u8 *Buffer, u8 Length) -{ -#if 0 /*(USE_HAL_MAC_API == 1)*/ - u8 c2hSubCmdId = 0, c2hAckLen = 0, h2cCmdId = 0, h2cSubCmdId = 0, c2hIndLen = 0; - - BT_PrintData(Adapter, "[COL], c2h packet:", Length - 2, Buffer + 2); - c2hSubCmdId = (u1Byte)C2H_HDR_GET_C2H_SUB_CMD_ID(Buffer); - - if (c2hSubCmdId == C2H_SUB_CMD_ID_H2C_ACK_HDR || - c2hSubCmdId == C2H_SUB_CMD_ID_BT_COEX_INFO) { - if (c2hSubCmdId == C2H_SUB_CMD_ID_H2C_ACK_HDR) { - /* coex c2h ack */ - h2cCmdId = (u1Byte)H2C_ACK_HDR_GET_H2C_CMD_ID(Buffer); - h2cSubCmdId = (u1Byte)H2C_ACK_HDR_GET_H2C_SUB_CMD_ID(Buffer); - if (h2cCmdId == 0xff && h2cSubCmdId == 0x60) { - c2hAckLen = (u1Byte)C2H_HDR_GET_LEN(Buffer); - if (c2hAckLen >= 8) - BT_CoexOffloadC2hAckCheck(Adapter, &Buffer[12], (u1Byte)(c2hAckLen - 8)); - else - BT_CoexOffloadRecordErrC2hAck(Adapter); - } - } else if (c2hSubCmdId == C2H_SUB_CMD_ID_BT_COEX_INFO) { - /* coex c2h indication */ - c2hIndLen = (u1Byte)C2H_HDR_GET_LEN(Buffer); - BT_CoexOffloadC2hIndCheck(Adapter, &Buffer[4], (u1Byte)c2hIndLen); - } - } -#endif -} -#endif - /* ************************************ * Extern functions called by other module * ************************************ */ @@ -2473,11 +2093,6 @@ void EXhalbtcoutsrc_init_hw_config(PBTC_COEXIST pBtCoexist, u8 bWifiOnly) pBtCoexist->statistics.cnt_init_hw_config++; if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_init_hw_config(pBtCoexist, bWifiOnly); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_init_hw_config(pBtCoexist, bWifiOnly); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -2534,11 +2149,6 @@ void EXhalbtcoutsrc_init_coex_dm(PBTC_COEXIST pBtCoexist) pBtCoexist->statistics.cnt_init_coex_dm++; if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_init_coex_dm(pBtCoexist); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_init_coex_dm(pBtCoexist); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -2604,11 +2214,6 @@ void EXhalbtcoutsrc_ips_notify(PBTC_COEXIST pBtCoexist, u8 type) * halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_ips_notify(pBtCoexist, ipsType); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_ips_notify(pBtCoexist, ipsType); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -2672,11 +2277,6 @@ void EXhalbtcoutsrc_lps_notify(PBTC_COEXIST pBtCoexist, u8 type) } if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_lps_notify(pBtCoexist, lpsType); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_lps_notify(pBtCoexist, lpsType); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -2739,11 +2339,6 @@ void EXhalbtcoutsrc_scan_notify(PBTC_COEXIST pBtCoexist, u8 type) * halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_scan_notify(pBtCoexist, scanType); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_scan_notify(pBtCoexist, scanType); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -2788,32 +2383,6 @@ void EXhalbtcoutsrc_scan_notify(PBTC_COEXIST pBtCoexist, u8 type) void EXhalbtcoutsrc_SetAntennaPathNotify(PBTC_COEXIST pBtCoexist, u8 type) { -#if 0 - u8 switchType; - - if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) - return; - - if (pBtCoexist->manual_control) - return; - - halbtcoutsrc_LeaveLowPower(pBtCoexist); - - switchType = type; - - if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) { - if (pBtCoexist->board_info.btdm_ant_num == 1) - ex_halbtc8723b1ant_set_antenna_notify(pBtCoexist, type); - } - if (IS_HARDWARE_TYPE_8723D(pBtCoexist->Adapter)) { - if (pBtCoexist->board_info.btdm_ant_num == 1) - ex_halbtc8723d1ant_set_antenna_notify(pBtCoexist, type); - else if (pBtCoexist->board_info.btdm_ant_num == 2) - ex_halbtc8723d2ant_set_antenna_notify(pBtCoexist, type); - } - - halbtcoutsrc_NormalLowPower(pBtCoexist); -#endif } void EXhalbtcoutsrc_connect_notify(PBTC_COEXIST pBtCoexist, u8 action) @@ -2835,11 +2404,6 @@ void EXhalbtcoutsrc_connect_notify(PBTC_COEXIST pBtCoexist, u8 action) * halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_connect_notify(pBtCoexist, assoType); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_connect_notify(pBtCoexist, assoType); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -2902,11 +2466,6 @@ void EXhalbtcoutsrc_media_status_notify(PBTC_COEXIST pBtCoexist, RT_MEDIA_STATUS * halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_media_status_notify(pBtCoexist, mStatus); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_media_status_notify(pBtCoexist, mStatus); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -2974,11 +2533,6 @@ void EXhalbtcoutsrc_specific_packet_notify(PBTC_COEXIST pBtCoexist, u8 pktType) * halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_specific_packet_notify(pBtCoexist, packetType); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_specific_packet_notify(pBtCoexist, packetType); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -3032,11 +2586,6 @@ void EXhalbtcoutsrc_bt_info_notify(PBTC_COEXIST pBtCoexist, u8 *tmpBuf, u8 lengt * halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_bt_info_notify(pBtCoexist, tmpBuf, length); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_bt_info_notify(pBtCoexist, tmpBuf, length); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -3116,28 +2665,6 @@ EXhalbtcoutsrc_RfStatusNotify( void EXhalbtcoutsrc_StackOperationNotify(PBTC_COEXIST pBtCoexist, u8 type) { -#if 0 - u8 stackOpType; - - if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) - return; - pBtCoexist->statistics.cntStackOperationNotify++; - if (pBtCoexist->manual_control) - return; - - if ((HCI_BT_OP_INQUIRY_START == type) || - (HCI_BT_OP_PAGING_START == type) || - (HCI_BT_OP_PAIRING_START == type)) - stackOpType = BTC_STACK_OP_INQ_PAGE_PAIR_START; - else if ((HCI_BT_OP_INQUIRY_FINISH == type) || - (HCI_BT_OP_PAGING_SUCCESS == type) || - (HCI_BT_OP_PAGING_UNSUCCESS == type) || - (HCI_BT_OP_PAIRING_FINISH == type)) - stackOpType = BTC_STACK_OP_INQ_PAGE_PAIR_FINISH; - else - stackOpType = BTC_STACK_OP_NONE; - -#endif } void EXhalbtcoutsrc_halt_notify(PBTC_COEXIST pBtCoexist) @@ -3146,11 +2673,6 @@ void EXhalbtcoutsrc_halt_notify(PBTC_COEXIST pBtCoexist) return; if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_halt_notify(pBtCoexist); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_halt_notify(pBtCoexist); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -3226,11 +2748,6 @@ void EXhalbtcoutsrc_pnp_notify(PBTC_COEXIST pBtCoexist, u8 pnpState) else if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8723d2ant_pnp_notify(pBtCoexist, pnpState); } else if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_pnp_notify(pBtCoexist, pnpState); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 1) ex_halbtc8821a1ant_pnp_notify(pBtCoexist, pnpState); else if (pBtCoexist->board_info.btdm_ant_num == 2) @@ -3296,11 +2813,6 @@ void EXhalbtcoutsrc_periodical(PBTC_COEXIST pBtCoexist) * halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_periodical(pBtCoexist); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_periodical(pBtCoexist); else if (pBtCoexist->board_info.btdm_ant_num == 1) { @@ -3371,34 +2883,6 @@ void EXhalbtcoutsrc_dbg_control(PBTC_COEXIST pBtCoexist, u8 opCode, u8 opLen, u8 /* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } -#if 0 -VOID -EXhalbtcoutsrc_AntennaDetection( - IN PBTC_COEXIST pBtCoexist, - IN u4Byte centFreq, - IN u4Byte offset, - IN u4Byte span, - IN u4Byte seconds -) -{ - if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) - return; - - /* Need to refine the following power save operations to enable this function in the future */ -#if 0 - IPSDisable(pBtCoexist->Adapter, FALSE, 0); - LeisurePSLeave(pBtCoexist->Adapter, LPS_DISABLE_BT_COEX); -#endif - - if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) { - if (pBtCoexist->board_info.btdm_ant_num == 1) - ex_halbtc8723b1ant_AntennaDetection(pBtCoexist, centFreq, offset, span, seconds); - } - - /* IPSReturn(pBtCoexist->Adapter, 0xff); */ -} -#endif - void EXhalbtcoutsrc_StackUpdateProfileInfo(void) { #ifdef CONFIG_BT_COEXIST_SOCKET_TRX @@ -3480,12 +2964,6 @@ void EXhalbtcoutsrc_SetBtPatchVersion(u16 btHciVersion, u16 btPatchVersion) pBtCoexist->bt_info.bt_hci_ver = btHciVersion; } -#if 0 -void EXhalbtcoutsrc_SetBtExist(u8 bBtExist) -{ - GLBtCoexist.boardInfo.bBtExist = bBtExist; -} -#endif void EXhalbtcoutsrc_SetChipType(u8 chipType) { switch (chipType) { @@ -3519,21 +2997,10 @@ void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) if (BT_COEX_ANT_TYPE_PG == type) { GLBtCoexist.board_info.pg_ant_num = antNum; GLBtCoexist.board_info.btdm_ant_num = antNum; -#if 0 - /* The antenna position: Main (default) or Aux for pgAntNum=2 && btdmAntNum =1 */ - /* The antenna position should be determined by auto-detect mechanism */ - /* The following is assumed to main, and those must be modified if y auto-detect mechanism is ready */ - if ((GLBtCoexist.board_info.pg_ant_num == 2) && (GLBtCoexist.board_info.btdm_ant_num == 1)) - GLBtCoexist.board_info.btdm_ant_pos = BTC_ANTENNA_AT_MAIN_PORT; - else - GLBtCoexist.board_info.btdm_ant_pos = BTC_ANTENNA_AT_MAIN_PORT; -#endif } else if (BT_COEX_ANT_TYPE_ANTDIV == type) { GLBtCoexist.board_info.btdm_ant_num = antNum; - /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ } else if (BT_COEX_ANT_TYPE_DETECTED == type) { GLBtCoexist.board_info.btdm_ant_num = antNum; - /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ } } @@ -3553,11 +3020,6 @@ void EXhalbtcoutsrc_DisplayBtCoexInfo(PBTC_COEXIST pBtCoexist) halbtcoutsrc_LeaveLowPower(pBtCoexist); if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) { -#if 0 - if (halbtcoutsrc_IsCsrBtCoex(pBtCoexist) == _TRUE) - ex_halbtc8821aCsr2ant_display_coex_info(pBtCoexist); - else -#endif if (pBtCoexist->board_info.btdm_ant_num == 2) ex_halbtc8821a2ant_display_coex_info(pBtCoexist); else if (pBtCoexist->board_info.btdm_ant_num == 1) @@ -3890,12 +3352,8 @@ void hal_btcoex_SuspendNotify(PADAPTER padapter, u8 state) break; case BTCOEX_SUSPEND_STATE_SUSPEND_KEEP_ANT: /* should switch to "#if 1" once all ICs' coex. revision are upgraded to support the KEEP_ANT case */ -#if 0 - EXhalbtcoutsrc_pnp_notify(&GLBtCoexist, BTC_WIFI_PNP_SLEEP_KEEP_ANT); -#else EXhalbtcoutsrc_pnp_notify(&GLBtCoexist, BTC_WIFI_PNP_SLEEP); EXhalbtcoutsrc_pnp_notify(&GLBtCoexist, BTC_WIFI_PNP_SLEEP_KEEP_ANT); -#endif break; case BTCOEX_SUSPEND_STATE_RESUME: EXhalbtcoutsrc_pnp_notify(&GLBtCoexist, BTC_WIFI_PNP_WAKE_UP); @@ -4085,96 +3543,8 @@ u32 hal_btcoex_GetDBG(PADAPTER padapter, u8 *pStrBuf, u32 bufSize) pstr += count; leftSize -= count; -#if 0 - count = rtw_sprintf(pstr, leftSize, "INTERFACE Debug Setting Definition:\n"); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[0]=%d for INTF_INIT\n", - GLBtcDbgType[BTC_MSG_INTERFACE] & INTF_INIT ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[2]=%d for INTF_NOTIFY\n\n", - GLBtcDbgType[BTC_MSG_INTERFACE] & INTF_NOTIFY ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - - count = rtw_sprintf(pstr, leftSize, "ALGORITHM Debug Setting Definition:\n"); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[0]=%d for BT_RSSI_STATE\n", - GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_BT_RSSI_STATE ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[1]=%d for WIFI_RSSI_STATE\n", - GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_WIFI_RSSI_STATE ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[2]=%d for BT_MONITOR\n", - GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_BT_MONITOR ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[3]=%d for TRACE\n", - GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[4]=%d for TRACE_FW\n", - GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[5]=%d for TRACE_FW_DETAIL\n", - GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW_DETAIL ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[6]=%d for TRACE_FW_EXEC\n", - GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW_EXEC ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[7]=%d for TRACE_SW\n", - GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[8]=%d for TRACE_SW_DETAIL\n", - GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW_DETAIL ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[9]=%d for TRACE_SW_EXEC\n", - GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW_EXEC ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; -#endif - exit: count = pstr - pStrBuf; - /* RTW_INFO(FUNC_ADPT_FMT ": usedsize=%d\n", FUNC_ADPT_ARG(padapter), count); */ - return count; } diff --git a/hal/hal_com.c b/hal/hal_com.c index 4add10e..d55c7e9 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -2002,17 +2002,7 @@ void rtw_sec_write_cam_ent(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key) u32 wdata; /* TODO: consider other key length accordingly */ -#if 0 - switch ((ctrl & 0x1c) >> 2) { - case _WEP40_: - case _TKIP_: - case _AES_: - case _WEP104_: - - } -#else j = 7; -#endif for (; j >= 0; j--) { switch (j) { @@ -2447,44 +2437,16 @@ void rtw_mbid_cam_restore(_adapter *adapter) void rtw_hal_set_macaddr_mbid(_adapter *adapter, u8 *mac_addr) { -#if 0 /*TODO - modify for more flexible*/ - u8 idx = 0; + /* + MBID entry_id = 0~7 ,for IFACE_ID0 ~ IFACE_IDx + */ + u8 entry_id = rtw_mbid_camid_alloc(adapter, mac_addr); - if ((check_fwstate(&adapter->mlmepriv, WIFI_STATION_STATE) == _TRUE) && - (DEV_STA_NUM(adapter_to_dvobj(adapter)) == 1)) { - for (idx = 0; idx < 6; idx++) - rtw_write8(GET_PRIMARY_ADAPTER(adapter), (REG_MACID + idx), val[idx]); - } else { - /*MBID entry_id = 0~7 ,0 for root AP, 1~7 for VAP*/ - u8 entry_id; - if ((check_fwstate(&adapter->mlmepriv, WIFI_AP_STATE) == _TRUE) && - (DEV_AP_NUM(adapter_to_dvobj(adapter)) == 1)) { - entry_id = 0; - if (rtw_mbid_cam_assign(adapter, val, entry_id)) { - RTW_INFO(FUNC_ADPT_FMT" Root AP assigned success\n", FUNC_ADPT_ARG(adapter)); - write_mbssid_cam(adapter, entry_id, val); - } - } else { - entry_id = rtw_mbid_camid_alloc(adapter, val); - if (entry_id != INVALID_CAM_ID) - write_mbssid_cam(adapter, entry_id, val); - } + if (entry_id != INVALID_CAM_ID) { + write_mbssid_cam(adapter, entry_id, mac_addr); + enable_mbssid_cam(adapter); } -#else - { - /* - MBID entry_id = 0~7 ,for IFACE_ID0 ~ IFACE_IDx - */ - u8 entry_id = rtw_mbid_camid_alloc(adapter, mac_addr); - - - if (entry_id != INVALID_CAM_ID) { - write_mbssid_cam(adapter, entry_id, mac_addr); - enable_mbssid_cam(adapter); - } - } -#endif } void rtw_hal_change_macaddr_mbid(_adapter *adapter, u8 *mac_addr) @@ -3952,14 +3914,6 @@ void rtw_hal_set_fw_wow_related_cmd(_adapter *padapter, u8 enable) rtw_hal_check_pno_enabled(padapter); #endif /* CONFIG_PNO_SUPPORT */ } else { -#if 0 - { - u32 PageSize = 0; - rtw_hal_get_def_var(padapter, HAL_DEF_TX_PAGE_SIZE, (u8 *)&PageSize); - dump_TX_FIFO(padapter, 4, PageSize); - } -#endif - rtw_hal_set_remote_wake_ctrl_cmd(padapter, enable); } RTW_PRINT("-%s()-\n", __func__); @@ -4396,21 +4350,6 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe pframe += (cur_network->IELength + len_diff); pktlen += (cur_network->IELength + len_diff); } -#if 0 - { - u8 *wps_ie; - uint wps_ielen; - u8 sr = 0; - wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct rtw_ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_, - pattrib->pktlen - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_, NULL, &wps_ielen); - if (wps_ie && wps_ielen > 0) - rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL); - if (sr != 0) - set_fwstate(pmlmepriv, WIFI_UNDER_WPS); - else - _clr_fwstate_(pmlmepriv, WIFI_UNDER_WPS); - } -#endif #ifdef CONFIG_P2P if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { u32 len; @@ -4501,18 +4440,6 @@ _issue_bcn: * #endif */ /* #if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ *pLength = pktlen; -#if 0 - /* printf dbg msg */ - dbgbufLen = pktlen; - RTW_INFO("======> DBG MSG FOR CONSTRAUCT P2P BEACON\n"); - - for (index = 0; index < dbgbufLen; index++) - printk("%x ", *(dbgbuf + index)); - - printk("\n"); - RTW_INFO("<====== DBG MSG FOR CONSTRAUCT P2P BEACON\n"); - -#endif } static int get_reg_classes_full_count(struct p2p_channels channel_list) @@ -4834,19 +4761,8 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p #endif *pLength = pktlen; - -#if 0 - /* printf dbg msg */ - dbgbufLen = pktlen; - RTW_INFO("======> DBG MSG FOR CONSTRAUCT P2P Probe Rsp\n"); - - for (index = 0; index < dbgbufLen; index++) - printk("%x ", *(dbgbuf + index)); - - printk("\n"); - RTW_INFO("<====== DBG MSG FOR CONSTRAUCT P2P Probe Rsp\n"); -#endif } + static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pLength) { unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; @@ -5250,19 +5166,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL pframe += wfdielen; pktlen += wfdielen; #endif - *pLength = pktlen; -#if 0 - /* printf dbg msg */ - dbgbufLen = pktlen; - RTW_INFO("======> DBG MSG FOR CONSTRAUCT Nego Rsp\n"); - - for (index = 0; index < dbgbufLen; index++) - printk("%x ", *(dbgbuf + index)); - - printk("\n"); - RTW_INFO("<====== DBG MSG FOR CONSTRAUCT Nego Rsp\n"); -#endif } static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 *pLength) @@ -5364,142 +5268,6 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 * p2pie[p2pielen++] = 200; /* 2 seconds needed to be the P2P Client */ /* due to defult value is FAIL INFO UNAVAILABLE, so the following IE is not needed */ -#if 0 - if (status_code == P2P_STATUS_SUCCESS) { - if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { - /* The P2P Invitation request frame asks this Wi-Fi device to be the P2P GO */ - /* In this case, the P2P Invitation response frame should carry the two more P2P attributes. */ - /* First one is operating channel attribute. */ - /* Second one is P2P Group BSSID attribute. */ - - /* Operating Channel */ - /* Type: */ - p2pie[p2pielen++] = P2P_ATTR_OPERATING_CH; - - /* Length: */ - *(u16 *)(p2pie + p2pielen) = cpu_to_le16(0x0005); - p2pielen += 2; - - /* Value: */ - /* Country String */ - p2pie[p2pielen++] = 'X'; - p2pie[p2pielen++] = 'X'; - - /* The third byte should be set to 0x04. */ - /* Described in the "Operating Channel Attribute" section. */ - p2pie[p2pielen++] = 0x04; - - /* Operating Class */ - p2pie[p2pielen++] = 0x51; /* Copy from SD7 */ - - /* Channel Number */ - p2pie[p2pielen++] = pwdinfo->operating_channel; /* operating channel number */ - - - /* P2P Group BSSID */ - /* Type: */ - p2pie[p2pielen++] = P2P_ATTR_GROUP_BSSID; - - /* Length: */ - *(u16 *)(p2pie + p2pielen) = cpu_to_le16(ETH_ALEN); - p2pielen += 2; - - /* Value: */ - /* P2P Device Address for GO */ - _rtw_memcpy(p2pie + p2pielen, adapter_mac_addr(padapter), ETH_ALEN); - p2pielen += ETH_ALEN; - - } - - /* Channel List */ - /* Type: */ - p2pie[p2pielen++] = P2P_ATTR_CH_LIST; - - /* Length: */ - /* Country String(3) */ - /* + ( Operating Class (1) + Number of Channels(1) ) * Operation Classes (?) */ - /* + number of channels in all classes */ - len_channellist_attr = 3 - + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes - + get_reg_classes_full_count(pmlmeext->channel_list); - -#ifdef CONFIG_CONCURRENT_MODE - if (rtw_mi_check_status(padapter, MI_LINKED)) - *(u16 *)(p2pie + p2pielen) = cpu_to_le16(5 + 1); - else - *(u16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr); - -#else - - *(u16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr); - -#endif - p2pielen += 2; - - /* Value: */ - /* Country String */ - p2pie[p2pielen++] = 'X'; - p2pie[p2pielen++] = 'X'; - - /* The third byte should be set to 0x04. */ - /* Described in the "Operating Channel Attribute" section. */ - p2pie[p2pielen++] = 0x04; - - /* Channel Entry List */ -#ifdef CONFIG_CONCURRENT_MODE - if (rtw_mi_check_status(padapter, MI_LINKED)) { - u8 union_ch = rtw_mi_get_union_chan(padapter); - - /* Operating Class */ - if (union_ch > 14) { - if (union_ch >= 149) - p2pie[p2pielen++] = 0x7c; - else - p2pie[p2pielen++] = 0x73; - - } else - p2pie[p2pielen++] = 0x51; - - - /* Number of Channels */ - /* Just support 1 channel and this channel is AP's channel */ - p2pie[p2pielen++] = 1; - - /* Channel List */ - p2pie[p2pielen++] = union_ch; - } else { - int i, j; - for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { - /* Operating Class */ - p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; - - /* Number of Channels */ - p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; - - /* Channel List */ - for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) - p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; - } - } -#else /* CONFIG_CONCURRENT_MODE */ - { - int i, j; - for (j = 0; j < pmlmeext->channel_list.reg_classes; j++) { - /* Operating Class */ - p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].reg_class; - - /* Number of Channels */ - p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channels; - - /* Channel List */ - for (i = 0; i < pmlmeext->channel_list.reg_class[j].channels; i++) - p2pie[p2pielen++] = pmlmeext->channel_list.reg_class[j].channel[i]; - } - } -#endif /* CONFIG_CONCURRENT_MODE */ - } -#endif - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pktlen); #ifdef CONFIG_WFD @@ -5509,21 +5277,8 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 * #endif *pLength = pktlen; - -#if 0 - /* printf dbg msg */ - dbgbufLen = pktlen; - RTW_INFO("======> DBG MSG FOR CONSTRAUCT Invite Rsp\n"); - - for (index = 0; index < dbgbufLen; index++) - printk("%x ", *(dbgbuf + index)); - - printk("\n"); - RTW_INFO("<====== DBG MSG FOR CONSTRAUCT Invite Rsp\n"); -#endif } - static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, u32 *pLength) { unsigned char category = RTW_WLAN_CATEGORY_PUBLIC; @@ -5583,20 +5338,6 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, 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 ); */ @@ -5622,18 +5363,6 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, #endif *pLength = pktlen; - - /* printf dbg msg */ -#if 0 - dbgbufLen = pktlen; - RTW_INFO("======> DBG MSG FOR CONSTRAUCT ProvisionDis Rsp\n"); - - for (index = 0; index < dbgbufLen; index++) - printk("%x ", *(dbgbuf + index)); - - printk("\n"); - RTW_INFO("<====== DBG MSG FOR CONSTRAUCT ProvisionDis Rsp\n"); -#endif } u8 rtw_hal_set_FwP2PRsvdPage_cmd(_adapter *adapter, PRSVDPAGE_LOC rsvdpageloc) @@ -6521,23 +6250,6 @@ void rtw_hal_set_wow_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 index, } CurtPktPageNum = (u8)PageNum(GTKLength, page_size); } -#if 0 - { - int i; - printk("\ntoFW KCK: "); - for (i = 0; i < 16; i++) - printk(" %02x ", kck[i]); - printk("\ntoFW KEK: "); - for (i = 0; i < 16; i++) - printk(" %02x ", kek[i]); - printk("\n"); - } - - RTW_INFO("%s(): HW_VAR_SET_TX_CMD: KEK KCK %p %d\n", - __func__, &pframe[index - tx_desc], - (tx_desc + RTW_KCK_LEN + RTW_KEK_LEN)); -#endif - *page_num += CurtPktPageNum; index += (CurtPktPageNum * page_size); @@ -6549,22 +6261,6 @@ void rtw_hal_set_wow_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 index, rtw_hal_fill_fake_txdesc(adapter, &pframe[index - tx_desc], GTKLength, _FALSE, _FALSE, _TRUE); -#if 0 - { - int gj; - printk("123GTK pkt=>\n"); - for (gj = 0; gj < GTKLength + tx_desc; gj++) { - printk(" %02x ", pframe[index - tx_desc + gj]); - if ((gj + 1) % 16 == 0) - printk("\n"); - } - printk(" <=end\n"); - } - - RTW_INFO("%s(): HW_VAR_SET_TX_CMD: GTK RSP %p %d\n", - __func__, &pframe[index - tx_desc], - (tx_desc + GTKLength)); -#endif CurtPktPageNum = (u8)PageNum(tx_desc + GTKLength, page_size); @@ -7719,11 +7415,6 @@ void rtw_hal_set_p2p_wow_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 index, rtw_hal_fill_fake_txdesc(adapter, &pframe[index - tx_desc], P2PBCNLength, _FALSE, _FALSE, _FALSE); -#if 0 - RTW_INFO("%s(): HW_VAR_SET_TX_CMD: PROBE RSP %p %d\n", - __func__, &pframe[index - tx_desc], (P2PBCNLength + tx_desc)); -#endif - CurtPktPageNum = (u8)PageNum(tx_desc + P2PBCNLength, page_size); *page_num += CurtPktPageNum; @@ -7737,9 +7428,6 @@ void rtw_hal_set_p2p_wow_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 index, rtw_hal_fill_fake_txdesc(adapter, &pframe[index - tx_desc], P2PProbeRspLength, _FALSE, _FALSE, _FALSE); - /* RTW_INFO("%s(): HW_VAR_SET_TX_CMD: PROBE RSP %p %d\n", */ - /* __func__, &pframe[index-tx_desc], (P2PProbeRspLength+tx_desc)); */ - CurtPktPageNum = (u8)PageNum(tx_desc + P2PProbeRspLength, page_size); *page_num += CurtPktPageNum; @@ -9560,21 +9248,8 @@ void rtw_dump_cur_efuse(PADAPTER padapter) RTW_INFO("EFUSE FILE\n"); else RTW_INFO("HW EFUSE\n"); - -#if 0 //def CONFIG_RTW_DEBUG - for (i = 0; i < mapsize; i++) { - if (i % 16 == 0) - RTW_PRINT_SEL(RTW_DBGDUMP, "0x%03x: ", i); - - _RTW_PRINT_SEL(RTW_DBGDUMP, "%02X%s" - , hal_data->efuse_eeprom_data[i] - , ((i + 1) % 16 == 0) ? "\n" : " "); - } - _RTW_PRINT_SEL(RTW_DBGDUMP, "\n"); -#endif } - #ifdef CONFIG_EFUSE_CONFIG_FILE u32 Hal_readPGDataFromConfigFile(PADAPTER padapter) { diff --git a/hal/hal_com_phycfg.c b/hal/hal_com_phycfg.c index a67ab06..19879b6 100644 --- a/hal/hal_com_phycfg.c +++ b/hal/hal_com_phycfg.c @@ -4821,25 +4821,6 @@ PHY_ConfigRFWithTxPwrTrackParaFile( } } else RTW_INFO("%s(): No File %s, Load from HWImg Array!\n", __func__, pFileName); -#if 0 - for (i = 0; i < DELTA_SWINGIDX_SIZE; ++i) { - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_2ga_p[%d] = %d\n", i, pRFCalibrateInfo->delta_swing_table_idx_2ga_p[i]); - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_2ga_n[%d] = %d\n", i, pRFCalibrateInfo->delta_swing_table_idx_2ga_n[i]); - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_2gb_p[%d] = %d\n", i, pRFCalibrateInfo->delta_swing_table_idx_2gb_p[i]); - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_2gb_n[%d] = %d\n", i, pRFCalibrateInfo->delta_swing_table_idx_2gb_n[i]); - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_2g_cck_a_p[%d] = %d\n", i, pRFCalibrateInfo->delta_swing_table_idx_2g_cck_a_p[i]); - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_2g_cck_a_n[%d] = %d\n", i, pRFCalibrateInfo->delta_swing_table_idx_2g_cck_a_n[i]); - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_2g_cck_b_p[%d] = %d\n", i, pRFCalibrateInfo->delta_swing_table_idx_2g_cck_b_p[i]); - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_2g_cck_b_n[%d] = %d\n", i, pRFCalibrateInfo->delta_swing_table_idx_2g_cck_b_n[i]); - - for (j = 0; j < 3; ++j) { - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_5ga_p[%d][%d] = %d\n", j, i, pRFCalibrateInfo->delta_swing_table_idx_5ga_p[j][i]); - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_5ga_n[%d][%d] = %d\n", j, i, pRFCalibrateInfo->delta_swing_table_idx_5ga_n[j][i]); - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_5gb_p[%d][%d] = %d\n", j, i, pRFCalibrateInfo->delta_swing_table_idx_5gb_p[j][i]); - RTW_INFO("pRFCalibrateInfo->delta_swing_table_idx_5gb_n[%d][%d] = %d\n", j, i, pRFCalibrateInfo->delta_swing_table_idx_5gb_n[j][i]); - } - } -#endif return rtStatus; } diff --git a/hal/hal_intf.c b/hal/hal_intf.c index e9fb558..b7cdc8f 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -580,10 +580,6 @@ void rtw_hal_set_chnl_bw(_adapter *padapter, u8 channel, CHANNEL_WIDTH Bandwidth /* MP mode channel don't use secondary channel */ if (rtw_mi_mp_mode_check(padapter) == _FALSE) { - #if 0 - if (cch_160 != 0) - cch_80 = rtw_get_scch_by_cch_offset(cch_160, CHANNEL_WIDTH_160, Offset80); - #endif if (cch_80 != 0) cch_40 = rtw_get_scch_by_cch_offset(cch_80, CHANNEL_WIDTH_80, Offset80); if (cch_40 != 0) diff --git a/hal/hal_mp.c b/hal/hal_mp.c index c83ce4b..9a9be42 100644 --- a/hal/hal_mp.c +++ b/hal/hal_mp.c @@ -506,11 +506,6 @@ static void mpt_SetRFPath_819X(PADAPTER pAdapter) default: break; } -#if 0 - /* r_rx_antenna_ofdm, bit0=A, bit1=B, bit2=C, bit3=D */ - /* r_cckrx_enable : CCK default, 0=A, 1=B, 2=C, 3=D */ - /* r_cckrx_enable_2 : CCK option, 0=A, 1=B, 2=C, 3=D */ -#endif switch (ulAntennaRx) { case ANTENNA_A: r_rx_antenna_ofdm = 0x1; /* A*/ @@ -607,23 +602,13 @@ u8 hal_mpt_ReadRFThermalMeter(PADAPTER pAdapter) } - void hal_mpt_GetThermalMeter(PADAPTER pAdapter, u8 *value) { -#if 0 - fw_cmd(pAdapter, IOCMD_GET_THERMAL_METER); - rtw_msleep_os(1000); - fw_cmd_data(pAdapter, value, 1); - *value &= 0xFF; -#else hal_mpt_TriggerRFThermalMeter(pAdapter); rtw_msleep_os(1000); *value = hal_mpt_ReadRFThermalMeter(pAdapter); -#endif - } - void hal_mpt_SetSingleCarrierTx(PADAPTER pAdapter, u8 bStart) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); diff --git a/hal/phydm/hal8188erateadaptive.c b/hal/phydm/hal8188erateadaptive.c index 2919ffd..5ab0288 100644 --- a/hal/phydm/hal8188erateadaptive.c +++ b/hal/phydm/hal8188erateadaptive.c @@ -52,20 +52,6 @@ static u8 RETRY_PENALTY_UP[RETRYSIZE + 1] = {49, 44, 16, 16, 0, 48}; /* 12% for static u8 PT_PENALTY[RETRYSIZE + 1] = {34, 31, 30, 24, 0, 32}; -#if 0 -static u8 RETRY_PENALTY_IDX[2][RATESIZE] = {{ - 4, 4, 4, 5, 4, 4, 5, 7, 7, 7, 8, 0x0a, /* SS>TH */ - 4, 4, 4, 4, 6, 0x0a, 0x0b, 0x0d, - 5, 5, 7, 7, 8, 0x0b, 0x0d, 0x0f - }, /* 0329 R01 */ - { - 4, 4, 4, 5, 7, 7, 9, 9, 0x0c, 0x0e, 0x10, 0x12, /* SS