diff --git a/core/efuse/rtw_efuse.c b/core/efuse/rtw_efuse.c index b7c02d47..2ed638c4 100644 --- a/core/efuse/rtw_efuse.c +++ b/core/efuse/rtw_efuse.c @@ -72,10 +72,6 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset) return (IS_MASKED(8812A, _MUSB, Offset)) ? TRUE : FALSE; #endif #if defined(CONFIG_RTL8821A) -#if 0 - if (IS_HARDWARE_TYPE_8811AU(pAdapter)) - return (IS_MASKED(8811A, _MUSB, Offset)) ? TRUE : FALSE; -#endif if (IS_HARDWARE_TYPE_8821(pAdapter)) return (IS_MASKED(8821A, _MUSB, Offset)) ? TRUE : FALSE; #endif @@ -3013,7 +3009,6 @@ u8 mac_hidden_wl_func_to_hal_wl_func(u8 func) return wl_func; } -#ifdef PLATFORM_LINUX #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE /* #include */ @@ -3054,13 +3049,6 @@ int retriveAdaptorInfoFile(char *path, u8 *efuse_data) else ret = _FAIL; -#if 0 - if (isAdaptorInfoFileValid()) - return 0; - else - return _FAIL; -#endif - } else { RTW_INFO("%s NULL pointer\n", __FUNCTION__); ret = _FAIL; @@ -3276,4 +3264,3 @@ u32 rtw_read_macaddr_from_file(const char *path, u8 *buf) } #endif /* CONFIG_EFUSE_CONFIG_FILE */ -#endif /* PLATFORM_LINUX */ diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index 5e0ada3c..92679165 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -2725,49 +2725,31 @@ static void rtw_mpath_tx_queue_flush(_adapter *adapter) } } -#ifdef PLATFORM_LINUX /* 3.10 ~ 4.13 checked */ #if defined(CONFIG_SLUB) #include #elif defined(CONFIG_SLAB) #include #endif typedef struct kmem_cache rtw_mcache; -#endif rtw_mcache *rtw_mcache_create(const char *name, size_t size) { -#ifdef PLATFORM_LINUX /* 3.10 ~ 4.13 checked */ return kmem_cache_create(name, size, 0, 0, NULL); -#else - #error "TBD\n"; -#endif } void rtw_mcache_destroy(rtw_mcache *s) { -#ifdef PLATFORM_LINUX /* 3.10 ~ 4.13 checked */ kmem_cache_destroy(s); -#else - #error "TBD\n"; -#endif } void *_rtw_mcache_alloc(rtw_mcache *cachep) { -#ifdef PLATFORM_LINUX /* 3.10 ~ 4.13 checked */ return kmem_cache_alloc(cachep, GFP_ATOMIC); -#else - #error "TBD\n"; -#endif } void _rtw_mcache_free(rtw_mcache *cachep, void *objp) { -#ifdef PLATFORM_LINUX /* 3.10 ~ 4.13 checked */ kmem_cache_free(cachep, objp); -#else - #error "TBD\n"; -#endif } #ifdef DBG_MEM_ALLOC @@ -3769,14 +3751,6 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe u8 b2u_num = 0; #endif - /* fwd info lifetime update */ - #if 0 - if (!is_mda_self) - mDA(A3) fwinfo.lifetime - mSA(A4) fwinfo.lifetime - Precursor-to-mDA(A2) fwinfo.lifetime - #endif - /* update/create pxoxy info for SA, mSA */ if ((mctrl->flags & MESH_FLAGS_AE) && sa != msa && _rtw_memcmp(sa, msa, ETH_ALEN) == _FALSE @@ -3853,10 +3827,6 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe } else { /* mDA is known in fwd info */ - #if 0 - if (TA is not in precursors) - goto exit; - #endif goto fwd_chk; } @@ -3948,14 +3918,6 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe , FUNC_ADPT_ARG(adapter), MAC_ARG(da)); #endif /* DA is unknown */ - #if 0 /* TODO: flags with AE bit */ - rtw_mesh_path_error_tx(adapter - , adapter->mesh_cfg.element_ttl - , mda, adapter->mesh_info.last_sn_update - , WLAN_REASON_MESH_PATH_NOPROXY - , msa - ); - #endif } /* diff --git a/core/mesh/rtw_mesh.h b/core/mesh/rtw_mesh.h index 166dad3c..e2f12f43 100644 --- a/core/mesh/rtw_mesh.h +++ b/core/mesh/rtw_mesh.h @@ -520,7 +520,7 @@ int rtw_mesh_rx_msdu_act_check(union recv_frame *rframe void dump_mesh_stats(void *sel, _adapter *adapter); -#if defined(PLATFORM_LINUX) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)) #define rtw_lockdep_assert_held(l) lockdep_assert_held(l) #define rtw_lockdep_is_held(l) lockdep_is_held(l) #else diff --git a/core/mesh/rtw_mesh_hwmp.c b/core/mesh/rtw_mesh_hwmp.c index a9ea348d..b0b5bb98 100644 --- a/core/mesh/rtw_mesh_hwmp.c +++ b/core/mesh/rtw_mesh_hwmp.c @@ -174,12 +174,8 @@ static inline BOOLEAN rtw_ether_addr_equal(const u8 *addr1, const u8 *addr2) return _rtw_memcmp(addr1, addr2, ETH_ALEN); } -#ifdef PLATFORM_LINUX #define rtw_print_ratelimit() printk_ratelimit() #define rtw_mod_timer(ptimer, expires) mod_timer(&(ptimer)->timer, expires) -#else - -#endif #define RTW_MESH_EWMA_PRECISION 20 #define RTW_MESH_EWMA_WEIGHT_RCP 8 @@ -1464,11 +1460,7 @@ void rtw_mesh_path_timer(void *ctx) #ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK struct rtw_mesh_cfg *mshcfg = &adapter->mesh_cfg; #endif - /* TBD: Proctect for suspend */ -#if 0 - if (suspending) - return; -#endif + enter_critical_bh(&path->state_lock); if (path->flags & RTW_MESH_PATH_RESOLVED || (!(path->flags & RTW_MESH_PATH_RESOLVING))) { diff --git a/core/mesh/rtw_mesh_pathtbl.c b/core/mesh/rtw_mesh_pathtbl.c index a1323b94..8f6b8594 100644 --- a/core/mesh/rtw_mesh_pathtbl.c +++ b/core/mesh/rtw_mesh_pathtbl.c @@ -18,7 +18,6 @@ #include #include -#ifdef PLATFORM_LINUX #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) static void rtw_mpath_free_rcu(struct rtw_mesh_path *mpath) { @@ -39,7 +38,6 @@ static void rtw_mpath_free_rcu(struct rtw_mesh_path *mpath) call_rcu(&mpath->rcu, rtw_mpath_free_rcu_callback); } #endif -#endif /* PLATFORM_LINUX */ static void rtw_mesh_path_free_rcu(struct rtw_mesh_table *tbl, struct rtw_mesh_path *mpath); @@ -201,20 +199,6 @@ static void rtw_mesh_path_move_to_queue(struct rtw_mesh_path *gate_mpath, gate_mpath->frame_queue_len++; _exit_critical_bh(&gate_mpath->frame_queue.lock, &flags); - #if 0 /* TODO: copy */ - skb = rtw_skb_copy(fskb); - if (rtw_warn_on(!skb)) - break; - - rtw_prepare_for_gate(skb, gate_mpath->dst, gate_mpath); - skb_queue_tail(&gate_mpath->frame_queue, skb); - - if (copy) - continue; - - __skb_unlink(fskb, &failq); - rtw_skb_free(fskb); - #endif } RTW_MPATH_DBG(FUNC_ADPT_FMT" mpath queue for gate %pM has %d frames\n" diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 49f525b8..12a2ca23 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -77,10 +77,6 @@ u8 rtw_set_tim_ie(u8 dtim_cnt, u8 dtim_period *p++ = (rtw_bmp_is_set(tim_bmp, tim_bmp_len, 0) ? BIT0 : 0) | n1; memcpy(p, tim_bmp + n1, bmp_len); -#if 0 - RTW_INFO("n1:%u, n2:%u, bmp_offset:%u, bmp_len:%u\n", n1, n2, n1 / 2, bmp_len); - RTW_INFO_DUMP("tim_ie: ", tim_ie + 2, 2 + 1 + bmp_len); -#endif return 2 + 2 + 1 + bmp_len; } @@ -92,12 +88,6 @@ static void update_BCNTIM(_adapter *padapter) WLAN_BSSID_EX *pnetwork_mlmeext = &(pmlmeinfo->network); unsigned char *pie = pnetwork_mlmeext->IEs; -#if 0 - - - /* update TIM IE */ - /* if(rtw_tim_map_anyone_be_set(padapter, pstapriv->tim_bitmap)) */ -#endif if (_TRUE) { u8 *p, *dst_ie, *premainder_ie = NULL, *pbackup_remainder_ie = NULL; uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen; @@ -286,10 +276,7 @@ static 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 + #ifdef CONFIG_RTW_MESH if (MLME_IS_MESH(psta->padapter) && (psta->sta_stats.last_rx_hwmp_pkts != @@ -1298,10 +1285,6 @@ static void rtw_set_hw_wmm_param(_adapter *padapter) 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; @@ -1419,12 +1402,7 @@ static void update_hw_ht_param(_adapter *padapter) /* */ 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", __FUNCTION__); } @@ -2082,45 +2060,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) psecuritypriv->auth_alg = WLAN_AUTH_SAE; } #endif /* CONFIG_IOCTL_CFG80211 */ -#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 */ @@ -2141,44 +2081,6 @@ 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; @@ -2243,11 +2145,6 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; struct ieee80211_ht_cap *pht_cap = (struct ieee80211_ht_cap *)(p + 2); - if (0) { - RTW_INFO(FUNC_ADPT_FMT" HT_CAP_IE from upper layer:\n", FUNC_ADPT_ARG(padapter)); - dump_ht_cap_ie_content(RTW_DBGDUMP, p + 2, ie_len); - } - pHT_caps_ie = p; ht_cap = _TRUE; @@ -2346,10 +2243,6 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) memcpy(&pmlmepriv->htpriv.ht_cap, p + 2, ie_len); - if (0) { - RTW_INFO(FUNC_ADPT_FMT" HT_CAP_IE driver masked:\n", FUNC_ADPT_ARG(padapter)); - dump_ht_cap_ie_content(RTW_DBGDUMP, p + 2, ie_len); - } } /* parsing HT_INFO_IE */ @@ -2932,19 +2825,6 @@ 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) { - msleep(100); - rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); - } - - - printk("check if hiq empty=%d\n", empty); -#endif - return H2C_SUCCESS; } @@ -3311,8 +3191,6 @@ void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *ta #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) || defined(CONFIG_PCI_BCN_POLLING) if (tx && updated) { /* send_beacon(padapter); */ /* send_beacon must execute on TSR level */ - if (0) - RTW_INFO(FUNC_ADPT_FMT" ie_id:%u - %s\n", FUNC_ADPT_ARG(padapter), ie_id, tag); set_tx_beacon_cmd(padapter); } #else @@ -3535,19 +3413,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; @@ -3570,15 +3435,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; @@ -3605,18 +3461,6 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta) } - -#if 0 - if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) && - !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_TIME)) { if (!psta->no_short_slot_time_set) { psta->no_short_slot_time_set = 1; @@ -3808,11 +3652,6 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta) if (beacon_updated == _TRUE) update_beacon(padapter, 0xFF, NULL, _TRUE); -#if 0 - /* update associated stations cap. */ - associated_clients_update(padapter, beacon_updated, STA_INFO_UPDATE_ALL); /* move it to avoid deadlock */ -#endif - RTW_INFO("%s, updated=%d\n", __func__, beacon_updated); return beacon_updated; @@ -5106,17 +4945,6 @@ void tx_beacon_handlder(struct dvobj_priv *pdvobj) send_beacon(padapter); } } - -#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_handlder(void *ctx) diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c index a2c491e5..d2b2d801 100644 --- a/core/rtw_br_ext.c +++ b/core/rtw_br_ext.c @@ -25,20 +25,7 @@ #include #endif -#if 1 /* rtw_wifi_driver */ - #include -#else /* rtw_wifi_driver */ - #include "./8192cd_cfg.h" - - #ifndef __KERNEL__ - #include "./sys-support.h" - #endif - - #include "./8192cd.h" - #include "./8192cd_headers.h" - #include "./8192cd_br_ext.h" - #include "./8192cd_debug.h" -#endif /* rtw_wifi_driver */ +#include #ifdef CL_IPV6_PASS #ifdef __KERNEL__ @@ -1461,35 +1448,6 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb) return 0; } -#if 0 -void mac_clone(_adapter *priv, unsigned char *addr) -{ - struct sockaddr sa; - - memcpy(sa.sa_data, addr, ETH_ALEN); - RTW_INFO("MAC Clone: Addr=%02x%02x%02x%02x%02x%02x\n", - addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); - rtl8192cd_set_hwaddr(priv->dev, &sa); -} - - -int mac_clone_handle_frame(_adapter *priv, struct sk_buff *skb) -{ - if (priv->ethBrExtInfo.macclone_enable && !priv->macclone_completed) { - if (!(skb->data[ETH_ALEN] & 1)) { /* check any other particular MAC add */ - if (memcmp(skb->data + ETH_ALEN, GET_MY_HWADDR(priv), ETH_ALEN) && - ((priv->dev->br_port) && - memcmp(skb->data + ETH_ALEN, priv->br_mac, ETH_ALEN))) { - mac_clone(priv, skb->data + ETH_ALEN); - priv->macclone_completed = 1; - } - } - } - - return 0; -} -#endif /* 0 */ - #define SERVER_PORT 67 #define CLIENT_PORT 68 #define DHCP_MAGIC 0x63825363 diff --git a/core/rtw_bt_mp.c b/core/rtw_bt_mp.c index 8c2d2207..dc232955 100644 --- a/core/rtw_bt_mp.c +++ b/core/rtw_bt_mp.c @@ -485,11 +485,6 @@ MPTBT_FwC2hBtMpCtrl( switch (pExtC2h->extendId) { case EXT_C2H_WIFI_FW_ACTIVE_RSP: RTW_INFO("[MPT], EXT_C2H_WIFI_FW_ACTIVE_RSP\n"); -#if 0 - RTW_INFO("[MPT], pExtC2h->buf hex:\n"); - for (i = 0; i < (length - 3); i++) - RTW_INFO(" 0x%x ", pExtC2h->buf[i]); -#endif if ((_FALSE == pMptCtx->bMPh2c_timeout) && (_FALSE == pMptCtx->MptH2cRspEvent)) { pMptCtx->MptH2cRspEvent = _TRUE; diff --git a/core/rtw_btcoex.c b/core/rtw_btcoex.c index a6388cce..f0e480a4 100644 --- a/core/rtw_btcoex.c +++ b/core/rtw_btcoex.c @@ -584,9 +584,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; @@ -626,14 +623,11 @@ u8 rtw_btcoex_parse_BT_info_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) memset(btinfo, 0, BT_INFO_LENGTH); -#if 1 if (BT_INFO_LENGTH != btInfoLen) { status = HCI_STATUS_INVALID_HCI_CMD_PARA_VALUE; RTW_INFO("Error BT Info Length: %d\n", btInfoLen); /* return _FAIL; */ - } else -#endif - { + } else { if (0x1 == btInfoReason || 0x2 == btInfoReason) { memcpy(btinfo, &pcmd[4], btInfoLen); btinfo[0] = btInfoReason; @@ -662,9 +656,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; @@ -713,9 +704,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); */ @@ -1285,140 +1273,6 @@ u16 rtw_btcoex_parse_recv_data(u8 *msg, u8 msg_size) return res; } -void rtw_btcoex_recvmsgbysocket(void *data) -{ - u8 recv_data[255]; - u8 tx_msg[255] = leave_ack; - 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; - struct sk_buff *skb = NULL; - - /*RTW_INFO("%s\n",__func__);*/ - - if (pbtcoexadapter == NULL) { - RTW_INFO("%s: btcoexadapter NULL!\n", __func__); - return; - } - - pcoex_info = &pbtcoexadapter->coex_info; - sk = pcoex_info->sk_store; - - if (sk == NULL) { - RTW_INFO("%s: critical error when receive socket data!\n", __func__); - return; - } - - len = skb_queue_len(&sk->sk_receive_queue); - while (len > 0) { - skb = skb_dequeue(&sk->sk_receive_queue); - - /*important: cut the udp header from skb->data! header length is 8 byte*/ - recv_length = skb->len - 8; - memset(recv_data, 0, sizeof(recv_data)); - 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 */ - 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); - rtw_btcoex_pta_off_on_notify(pbtcoexadapter, pcoex_info->BT_attend); - break; - - case RX_ATTEND_REQ: - 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); - rtw_btcoex_pta_off_on_notify(pbtcoexadapter, pcoex_info->BT_attend); - break; - - case RX_INVITE_REQ: - /* 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); - rtw_btcoex_pta_off_on_notify(pbtcoexadapter, pcoex_info->BT_attend); - break; - - case RX_INVITE_RSP: - /*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); - rtw_btcoex_pta_off_on_notify(pbtcoexadapter, pcoex_info->BT_attend); - break; - - case RX_LEAVE_ACK: - /* 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); - rtw_btcoex_pta_off_on_notify(pbtcoexadapter, pcoex_info->BT_attend); - break; - - case RX_BT_LEAVE: - /* 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); - rtw_btcoex_pta_off_on_notify(pbtcoexadapter, pcoex_info->BT_attend); - break; - - default: - if (_TRUE == pcoex_info->BT_attend) - rtw_btcoex_parse_hci_cmd(pbtcoexadapter, recv_data, recv_length); - else - RTW_INFO("ERROR!! BT is UP\n"); - break; - - } - - len--; - kfree_skb(skb); - } -} - #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)) void rtw_btcoex_recvmsg_init(struct sock *sk_in, s32 bytes) #else @@ -1615,16 +1469,6 @@ void rtw_btcoex_close_socket(_adapter *padapter) } } -void rtw_btcoex_dump_tx_msg(u8 *tx_msg, u8 len, u8 *msg_name) -{ - u8 i = 0; - RTW_INFO("======> Msg name: %s\n", msg_name); - for (i = 0; i < len; i++) - printk("%02x ", tx_msg[i]); - printk("\n"); - RTW_INFO("Msg name: %s <======\n", msg_name); -} - /* Porting from Windows team */ void rtw_btcoex_SendEventExtBtCoexControl(PADAPTER padapter, u8 bNeedDbgRsp, u8 dataLen, void *pData) { @@ -1658,9 +1502,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); } @@ -1700,9 +1542,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); } @@ -1740,9 +1580,7 @@ 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_cmd.c b/core/rtw_cmd.c index dd1fe3d6..fc29de95 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -413,9 +413,6 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) if (DBG_CMD_EXECUTE) RTW_INFO(ADPT_FMT" drop "CMD_FMT" hw_init_completed:%u, cmdthd_running:%u\n", ADPT_ARG(cmd_obj->padapter) , CMD_ARG(cmd_obj), rtw_get_hw_init_completed(cmd_obj->padapter), atomic_read(&pcmdpriv->cmdthd_running)); - if (0) - rtw_warn_on(1); - return _FAIL; } return _SUCCESS; @@ -646,8 +643,6 @@ thread_return rtw_cmd_thread(thread_context context) _enter_critical_mutex(&(pcmd->padapter->cmdpriv.sctx_mutex), NULL); if (pcmd->sctx) { - if (0) - RTW_PRINT(FUNC_ADPT_FMT" pcmd->sctx\n", FUNC_ADPT_ARG(pcmd->padapter)); if (pcmd->res == H2C_SUCCESS) rtw_sctx_done(&pcmd->sctx); else @@ -658,8 +653,6 @@ thread_return rtw_cmd_thread(thread_context context) cmd_process_time = rtw_get_passing_time_ms(cmd_start_time); if (cmd_process_time > 1000) { RTW_INFO(ADPT_FMT" "CMD_FMT" process_time=%d\n", ADPT_ARG(pcmd->padapter), CMD_ARG(pcmd), cmd_process_time); - if (0) - rtw_warn_on(1); } /* call callback function for post-processed */ @@ -694,9 +687,6 @@ thread_return rtw_cmd_thread(thread_context context) if (pcmd == NULL) break; - if (0) - RTW_INFO("%s: leaving... drop "CMD_FMT"\n", __func__, CMD_ARG(pcmd)); - if (pcmd->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra)) { extra_parm = (struct drvextra_cmd_parm *)pcmd->parmbuf; if (extra_parm->pbuf && extra_parm->size > 0) @@ -709,8 +699,6 @@ thread_return rtw_cmd_thread(thread_context context) _enter_critical_mutex(&(pcmd->padapter->cmdpriv.sctx_mutex), NULL); if (pcmd->sctx) { - if (0) - RTW_PRINT(FUNC_ADPT_FMT" pcmd->sctx\n", FUNC_ADPT_ARG(pcmd->padapter)); rtw_sctx_done_err(&pcmd->sctx, RTW_SCTX_DONE_CMD_DROP); } _exit_critical_mutex(&(pcmd->padapter->cmdpriv.sctx_mutex), NULL); @@ -1369,15 +1357,7 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork) res = _FAIL; goto exit; } -#if 0 - /* for IEs is pointer */ - t_len = sizeof(ULONG) + sizeof(NDIS_802_11_MAC_ADDRESS) + 2 + - sizeof(NDIS_802_11_SSID) + sizeof(ULONG) + - sizeof(NDIS_802_11_RSSI) + sizeof(NDIS_802_11_NETWORK_TYPE) + - sizeof(NDIS_802_11_CONFIGURATION) + - sizeof(NDIS_802_11_NETWORK_INFRASTRUCTURE) + - sizeof(NDIS_802_11_RATES_EX) + sizeof(WLAN_PHY_INFO) + sizeof(ULONG) + MAX_IE_SZ; -#endif + /* for IEs is fix buf size */ t_len = sizeof(WLAN_BSSID_EX); @@ -1507,15 +1487,6 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork) rtw_ft_validate_akm_type(padapter, pnetwork); #endif -#if 0 - psecuritypriv->supplicant_ie[0] = (u8)psecnetwork->IELength; - - if (psecnetwork->IELength < (256 - 1)) - memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0], psecnetwork->IELength); - else - memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0], (256 - 1)); -#endif - pcmd->cmdsz = sizeof(WLAN_BSSID_EX); #ifdef CONFIG_RTL8712 @@ -2614,19 +2585,17 @@ u8 _ssmps_chk_by_tp(_adapter *adapter, u8 from_timer) enter_smps = _FALSE; } - if (1) { - RTW_INFO(FUNC_ADPT_FMT" tx_tp:%d [%d], rx_tp:%d [%d] , SSMPS enter :%s\n", - FUNC_ADPT_ARG(adapter), - tx_tp_mbits, pmlmeext->ssmps_tx_tp_th, - rx_tp_mbits, pmlmeext->ssmps_rx_tp_th, - (enter_smps == _TRUE) ? "True" : "False"); - #ifdef DBG_STATIC_SMPS - RTW_INFO(FUNC_ADPT_FMT" test:%d test_en:%d\n", - FUNC_ADPT_ARG(adapter), - pmlmeext->ssmps_test, - pmlmeext->ssmps_test_en); - #endif - } + RTW_INFO(FUNC_ADPT_FMT" tx_tp:%d [%d], rx_tp:%d [%d] , SSMPS enter :%s\n", + FUNC_ADPT_ARG(adapter), + tx_tp_mbits, pmlmeext->ssmps_tx_tp_th, + rx_tp_mbits, pmlmeext->ssmps_rx_tp_th, + (enter_smps == _TRUE) ? "True" : "False"); + #ifdef DBG_STATIC_SMPS + RTW_INFO(FUNC_ADPT_FMT" test:%d test_en:%d\n", + FUNC_ADPT_ARG(adapter), + pmlmeext->ssmps_test, + pmlmeext->ssmps_test_en); + #endif if (enter_smps) { if (!from_timer && psta->cmn.sm_ps != SM_PS_STATIC) @@ -2802,13 +2771,11 @@ void rtw_ctrl_tx_ss_by_tp(_adapter *adapter, u8 from_timer) tx_1ss = _TRUE; } - if (1) { - RTW_INFO(FUNC_ADPT_FMT" tx_tp:%d [%d] tx_1ss(%d):%s\n", - FUNC_ADPT_ARG(adapter), - tx_tp_mbits, pmlmeext->txss_tp_th, - pmlmeext->txss_tp_chk_cnt, - (tx_1ss == _TRUE) ? "True" : "False"); - } + RTW_INFO(FUNC_ADPT_FMT" tx_tp:%d [%d] tx_1ss(%d):%s\n", + FUNC_ADPT_ARG(adapter), + tx_tp_mbits, pmlmeext->txss_tp_th, + pmlmeext->txss_tp_chk_cnt, + (tx_1ss == _TRUE) ? "True" : "False"); if (pmlmeext->txss_1ss != tx_1ss) { if (from_timer) @@ -2855,8 +2822,6 @@ static u8 _bcn_cnt_expected(struct sta_info *psta) if ((pmlmeinfo->bcn_interval !=0) && (dtim != 0)) bcn_cnt = 2000 / pmlmeinfo->bcn_interval / dtim * 4 / 5; /*2s*/ - if (0) - RTW_INFO("%s bcn_cnt:%d\n", bcn_cnt); if (bcn_cnt == 0) { RTW_ERR(FUNC_ADPT_FMT" bcn_cnt == 0\n", FUNC_ADPT_ARG(adapter)); @@ -2887,15 +2852,9 @@ u8 _lps_chk_by_tp(_adapter *adapter, u8 from_timer) psta->sta_stats.acc_tx_bytes = psta->sta_stats.tx_bytes; psta->sta_stats.acc_rx_bytes = psta->sta_stats.rx_bytes; -#if 1 tx_tp_mbits = psta->sta_stats.tx_tp_kbits >> 10; rx_tp_mbits = psta->sta_stats.rx_tp_kbits >> 10; bi_tp_mbits = tx_tp_mbits + rx_tp_mbits; -#else - tx_tp_mbits = psta->sta_stats.smooth_tx_tp_kbits >> 10; - rx_tp_mbits = psta->sta_stats.smooth_rx_tp_kbits >> 10; - bi_tp_mbits = tx_tp_mbits + rx_tp_mbits; -#endif if ((bi_tp_mbits >= pwrpriv->lps_bi_tp_th) || (tx_tp_mbits >= pwrpriv->lps_tx_tp_th) || @@ -2920,26 +2879,24 @@ u8 _lps_chk_by_tp(_adapter *adapter, u8 from_timer) enter_ps = _TRUE; } - if (1) { - RTW_INFO(FUNC_ADPT_FMT" tx_tp:%d [%d], rx_tp:%d [%d], bi_tp:%d [%d], enter_ps(%d):%s\n", - FUNC_ADPT_ARG(adapter), - tx_tp_mbits, pwrpriv->lps_tx_tp_th, - rx_tp_mbits, pwrpriv->lps_rx_tp_th, - bi_tp_mbits, pwrpriv->lps_bi_tp_th, - pwrpriv->lps_chk_cnt, - (enter_ps == _TRUE) ? "True" : "False"); - RTW_INFO(FUNC_ADPT_FMT" tx_pkt_cnt :%d [%d], rx_pkt_cnt :%d [%d]\n", - FUNC_ADPT_ARG(adapter), - pmlmepriv->LinkDetectInfo.NumTxOkInPeriod, - pwrpriv->lps_tx_pkts, - pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod, - pwrpriv->lps_rx_pkts); - if (!adapter->bsta_tp_dump) - RTW_INFO(FUNC_ADPT_FMT" bcn_cnt:%d (per-%d second)\n", - FUNC_ADPT_ARG(adapter), - rx_bcn_cnt, - 2); - } + RTW_INFO(FUNC_ADPT_FMT" tx_tp:%d [%d], rx_tp:%d [%d], bi_tp:%d [%d], enter_ps(%d):%s\n", + FUNC_ADPT_ARG(adapter), + tx_tp_mbits, pwrpriv->lps_tx_tp_th, + rx_tp_mbits, pwrpriv->lps_rx_tp_th, + bi_tp_mbits, pwrpriv->lps_bi_tp_th, + pwrpriv->lps_chk_cnt, + (enter_ps == _TRUE) ? "True" : "False"); + RTW_INFO(FUNC_ADPT_FMT" tx_pkt_cnt :%d [%d], rx_pkt_cnt :%d [%d]\n", + FUNC_ADPT_ARG(adapter), + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod, + pwrpriv->lps_tx_pkts, + pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod, + pwrpriv->lps_rx_pkts); + if (!adapter->bsta_tp_dump) + RTW_INFO(FUNC_ADPT_FMT" bcn_cnt:%d (per-%d second)\n", + FUNC_ADPT_ARG(adapter), + rx_bcn_cnt, + 2); if (enter_ps) { if (!from_timer) @@ -5247,10 +5204,6 @@ void session_tracker_chk_for_sta(_adapter *adapter, struct sta_info *sta) continue; #ifdef CONFIG_WFD - if (0) - RTW_INFO(FUNC_ADPT_FMT" local:%u, remote:%u, rtsp:%u, %u, %u\n", FUNC_ADPT_ARG(adapter) - , ntohs(st->local_port), ntohs(st->remote_port), adapter->wfd_info.rtsp_ctrlport, adapter->wfd_info.tdls_rtsp_ctrlport - , adapter->wfd_info.peer_rtsp_ctrlport); if (ntohs(st->local_port) == adapter->wfd_info.rtsp_ctrlport) op_wfd_mode |= MIRACAST_SINK; if (ntohs(st->local_port) == adapter->wfd_info.tdls_rtsp_ctrlport) @@ -5756,11 +5709,6 @@ void rtw_create_ibss_post_hdl(_adapter *padapter, int status) /* copy pdev_network information to pmlmepriv->cur_network */ memcpy(&mlme_cur_network->network, pdev_network, (get_WLAN_BSSID_EX_sz(pdev_network))); -#if 0 - /* reset DSConfig */ - mlme_cur_network->network.Configuration.DSConfig = (u32)rtw_ch2freq(pdev_network->Configuration.DSConfig); -#endif - _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); /* we will set _FW_LINKED when there is one more sat to join us (rtw_stassoc_event_callback) */ diff --git a/core/rtw_debug.c b/core/rtw_debug.c index 77e0b2fd..8629ad97 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -237,8 +237,6 @@ void sd_f0_reg_dump(void *sel, _adapter *adapter) if (i % 16 == 0) RTW_PRINT_SEL(sel, "0x%02x ", i); - _RTW_PRINT_SEL(sel, "%02x ", rtw_sd_f0_read8(adapter, i)); - if (i % 16 == 15) _RTW_PRINT_SEL(sel, "\n"); else if (i % 8 == 7) @@ -1485,7 +1483,6 @@ ssize_t proc_set_survey_info(struct file *file, const char __user *buffer, size_ if (count < 1) return -EFAULT; -#if 1 ssc_chk = rtw_sitesurvey_condition_check(padapter, _FALSE); if (ssc_chk != SS_ALLOW) goto exit; @@ -1497,49 +1494,7 @@ ssize_t proc_set_survey_info(struct file *file, const char __user *buffer, size_ RTW_INFO("scan abort!! adapter cannot use\n"); goto cancel_ps_deny; } -#else -#ifdef CONFIG_MP_INCLUDED - if (rtw_mp_mode_check(padapter)) { - RTW_INFO("MP mode block Scan request\n"); - goto exit; - } -#endif - if (rtw_is_scan_deny(padapter)) { - RTW_INFO(FUNC_ADPT_FMT ": scan deny\n", FUNC_ADPT_ARG(padapter)); - goto exit; - } - - rtw_ps_deny(padapter, PS_DENY_SCAN); - if (_FAIL == rtw_pwr_wakeup(padapter)) - goto cancel_ps_deny; - - if (!rtw_is_adapter_up(padapter)) { - RTW_INFO("scan abort!! adapter cannot use\n"); - goto cancel_ps_deny; - } - - if (rtw_mi_busy_traffic_check(padapter, _FALSE)) { - RTW_INFO("scan abort!! BusyTraffic == _TRUE\n"); - goto cancel_ps_deny; - } - - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) && check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { - RTW_INFO("scan abort!! AP mode process WPS\n"); - goto cancel_ps_deny; - } - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == _TRUE) { - RTW_INFO("scan abort!! fwstate=0x%x\n", pmlmepriv->fw_state); - goto cancel_ps_deny; - } -#ifdef CONFIG_CONCURRENT_MODE - if (rtw_mi_buddy_check_fwstate(padapter, - _FW_UNDER_SURVEY | _FW_UNDER_LINKING | WIFI_UNDER_WPS)) { - RTW_INFO("scan abort!! buddy_fwstate check failed\n"); - goto cancel_ps_deny; - } -#endif -#endif _status = rtw_set_802_11_bssid_list_scan(padapter, NULL); cancel_ps_deny: @@ -3374,13 +3329,7 @@ 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 + #ifdef CONFIG_80211N_HT 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*/ @@ -3395,13 +3344,6 @@ void rtw_dump_drv_phy_cap(void *sel, _adapter *adapter) 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*/ #endif /* CONFIG_80211N_HT */ #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 @@ -3830,10 +3772,8 @@ int proc_get_best_channel(struct seq_file *m, void *v) best_channel_5G = rfctl->channel_set[i].ChannelNum; } } -#if 1 /* debug */ RTW_PRINT_SEL(m, "The rx cnt of channel %3d = %d\n", rfctl->channel_set[i].ChannelNum, rfctl->channel_set[i].rx_count); -#endif } RTW_PRINT_SEL(m, "best_channel_5G = %d\n", best_channel_5G); @@ -4446,7 +4386,6 @@ int proc_get_tx_ring_ext(struct seq_file *m, void *v) RTW_PRINT_SEL(m, "\n"); } -#if 1 /* data dump */ if (pbuf->tx_desc_size) { RTW_PRINT_SEL(m, " data[%03d]:\n", j); @@ -4461,8 +4400,6 @@ int proc_get_tx_ring_ext(struct seq_file *m, void *v) } RTW_PRINT_SEL(m, "\n"); } -#endif - RTW_PRINT_SEL(m, " R/W pointer: %d/%d\n", pbuf->tx_bak_rp, pbuf->tx_bak_wp); pbuf = pbuf + 1; @@ -5631,48 +5568,6 @@ int proc_get_efuse_map(struct seq_file *m, void *v) return 0; } -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; -} - #ifdef CONFIG_IEEE80211W ssize_t proc_set_tx_sa_query(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data) { @@ -6912,7 +6807,7 @@ int proc_get_smps(struct seq_file *m, void *v) #endif /* CONFIG_PROC_DEBUG */ #define RTW_BUFDUMP_BSIZE 16 -#if 1 + inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring, bool _idx_show, const u8 *_hexdata, int _hexdatalen) { @@ -6944,89 +6839,4 @@ inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring, } #endif } -#else -inline void _RTW_STR_DUMP_SEL(void *sel, char *str_out) -{ - if (sel == RTW_DBGDUMP) - _dbgdump("%s\n", str_out); - #if defined(_seqdump) - else - _seqdump(sel, "%s\n", str_out); - #endif /*_seqdump*/ -} -inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring, - bool _idx_show, u8 *_hexdata, int _hexdatalen) -{ - int __i, len; - int __j, idx; - int block_num, remain_byte; - char str_out[128] = {'\0'}; - char str_val[32] = {'\0'}; - char *p = NULL; - u8 *ptr = (u8 *)_hexdata; - - if (_loglevel <= rtw_drv_log_level) { - /*dump title*/ - p = &str_out[0]; - if (_titlestring) { - if (sel == RTW_DBGDUMP) { - len = snprintf(str_val, sizeof(str_val), "%s", DRIVER_PREFIX); - strncpy(p, str_val, len); - p += len; - } - len = snprintf(str_val, sizeof(str_val), "%s", _titlestring); - strncpy(p, str_val, len); - p += len; - } - if (p != &str_out[0]) { - _RTW_STR_DUMP_SEL(sel, str_out); - memset(&str_out, '\0', sizeof(str_out)); - } - - /*dump buffer*/ - block_num = _hexdatalen / RTW_BUFDUMP_BSIZE; - remain_byte = _hexdatalen % RTW_BUFDUMP_BSIZE; - for (__i = 0; __i < block_num; __i++) { - p = &str_out[0]; - if (sel == RTW_DBGDUMP) { - len = snprintf(str_val, sizeof(str_val), "%s", DRIVER_PREFIX); - strncpy(p, str_val, len); - p += len; - } - if (_idx_show) { - len = snprintf(str_val, sizeof(str_val), "0x%03X: ", __i * RTW_BUFDUMP_BSIZE); - strncpy(p, str_val, len); - p += len; - } - for (__j =0; __j < RTW_BUFDUMP_BSIZE; __j++) { - idx = __i * RTW_BUFDUMP_BSIZE + __j; - len = snprintf(str_val, sizeof(str_val), "%02X%s", ptr[idx], (((__j + 1) % 4) == 0) ? " " : " "); - strncpy(p, str_val, len); - p += len; - } - _RTW_STR_DUMP_SEL(sel, str_out); - memset(&str_out, '\0', sizeof(str_out)); - } - - p = &str_out[0]; - if ((sel == RTW_DBGDUMP) && remain_byte) { - len = snprintf(str_val, sizeof(str_val), "%s", DRIVER_PREFIX); - strncpy(p, str_val, len); - p += len; - } - if (_idx_show && remain_byte) { - len = snprintf(str_val, sizeof(str_val), "0x%03X: ", block_num * RTW_BUFDUMP_BSIZE); - strncpy(p, str_val, len); - p += len; - } - for (__i = 0; __i < remain_byte; __i++) { - idx = block_num * RTW_BUFDUMP_BSIZE + __i; - len = snprintf(str_val, sizeof(str_val), "%02X%s", ptr[idx], (((__i + 1) % 4) == 0) ? " " : " "); - strncpy(p, str_val, len); - p += len; - } - _RTW_STR_DUMP_SEL(sel, str_out); - } -} -#endif diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 2134a34e..02f7f25d 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -2101,9 +2101,6 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id , u8 *buf_att u16 attr_data_len = RTW_GET_LE16(attr_ptr + 1); u16 attr_len = attr_data_len + 3; - if (0) - RTW_INFO("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); - if ((attr_ptr - p2p_ie + attr_len) > p2p_ielen) break; @@ -2444,9 +2441,6 @@ u8 *rtw_get_wfd_attr(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id, u8 *buf_attr u16 attr_data_len = RTW_GET_BE16(attr_ptr + 1); u16 attr_len = attr_data_len + 3; - if (0) - RTW_INFO("%s attr_ptr:%p, id:%u, length:%u\n", __func__, attr_ptr, attr_id, attr_data_len); - if ((attr_ptr - wfd_ie + attr_len) > wfd_ielen) break; diff --git a/core/rtw_io.c b/core/rtw_io.c index 3afbe5bd..c149a43f 100644 --- a/core/rtw_io.c +++ b/core/rtw_io.c @@ -157,23 +157,6 @@ int rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *pdata) } #ifdef CONFIG_SDIO_HCI -u8 _rtw_sd_f0_read8(_adapter *adapter, u32 addr) -{ - u8 r_val = 0x00; - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &(pio_priv->intf); - u8(*_sd_f0_read8)(struct intf_hdl *pintfhdl, u32 addr); - - _sd_f0_read8 = pintfhdl->io_ops._sd_f0_read8; - - if (_sd_f0_read8) - r_val = _sd_f0_read8(pintfhdl, addr); - else - RTW_WARN(FUNC_ADPT_FMT" _sd_f0_read8 callback is NULL\n", FUNC_ADPT_ARG(adapter)); - - return r_val; -} - #ifdef CONFIG_SDIO_INDIRECT_ACCESS u8 _rtw_sd_iread8(_adapter *adapter, u32 addr) { @@ -599,9 +582,6 @@ static bool match_io_sniff_en(_adapter *adapter || (sniff->type == RTW_IO_SNIFF_TYPE_DIS && (mask & val) != mask) ) { ret = 1; - if (0) - RTW_INFO(FUNC_ADPT_FMT" addr:0x%x len:%u val:0x%x i:%d sniff_len:%u shift:%u mask:0x%x\n" - , FUNC_ADPT_ARG(adapter), addr, len, val, i, sniff_len, shift, mask); } exit: @@ -718,22 +698,6 @@ bool match_rf_write_sniff_ranges(_adapter *adapter, u8 path, u32 addr, u32 mask) } #ifdef CONFIG_SDIO_HCI -u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const int line) -{ - u8 val = _rtw_sd_f0_read8(adapter, addr); - -#if 0 - const struct rtw_io_sniff_ent *ent = match_read_sniff(adapter, addr, 1, val); - - if (ent) { - RTW_INFO("DBG_IO %s:%d rtw_sd_f0_read8(0x%04x) return 0x%02x %s\n" - , caller, line, addr, val, rtw_io_sniff_ent_get_tag(ent)); - } -#endif - - return val; -} - #ifdef CONFIG_SDIO_INDIRECT_ACCESS u8 dbg_rtw_sd_iread8(_adapter *adapter, u32 addr, const char *caller, const int line) { diff --git a/core/rtw_ioctl_rtl.c b/core/rtw_ioctl_rtl.c index 6cc1c0d6..a1d24b09 100644 --- a/core/rtw_ioctl_rtl.c +++ b/core/rtw_ioctl_rtl.c @@ -145,26 +145,6 @@ struct oid_obj_priv oid_rtl_seg_03_00[] = { NDIS_STATUS oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - _irqL oldirql; - - - if (poid_par_priv->type_of_oid != SET_OID) { - status = NDIS_STATUS_NOT_ACCEPTED; - return status; - } - - _irqlevel_changed_(&oldirql, LOWER); - if (poid_par_priv->information_buf_len >= sizeof(struct setdig_parm)) { - /* DEBUG_ERR(("===> oid_rt_pro_set_fw_dig_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf ))); */ - if (!rtw_setfwdig_cmd(Adapter, *((unsigned char *)poid_par_priv->information_buf))) - status = NDIS_STATUS_NOT_ACCEPTED; - - } else - status = NDIS_STATUS_NOT_ACCEPTED; - _irqlevel_changed_(&oldirql, RAISE); -#endif return status; } /* ----------------------------------------------------------------------------- */ @@ -172,27 +152,6 @@ NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - _irqL oldirql; - - if (poid_par_priv->type_of_oid != SET_OID) { - status = NDIS_STATUS_NOT_ACCEPTED; - return status; - } - - - _irqlevel_changed_(&oldirql, LOWER); - - if (poid_par_priv->information_buf_len >= sizeof(struct setra_parm)) { - /* DEBUG_ERR(("===> oid_rt_pro_set_fw_ra_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf ))); */ - if (!rtw_setfwra_cmd(Adapter, *((unsigned char *)poid_par_priv->information_buf))) - status = NDIS_STATUS_NOT_ACCEPTED; - - } else - status = NDIS_STATUS_NOT_ACCEPTED; - _irqlevel_changed_(&oldirql, RAISE); -#endif return status; } /* ----------------------------------------------------------------------------- */ @@ -207,16 +166,6 @@ NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv *poid_par_priv) return status; } -#if 0 - if (pMgntInfo->mAssoc || pMgntInfo->mIbss) { - ulInfo = pAdapter->RxStats.SignalQuality; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - } else { - ulInfo = 0xffffffff; /* It stands for -1 in 4-byte integer. */ - } - break; -#endif - return status; } @@ -786,45 +735,6 @@ NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv *poid_par_priv) NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - _irqL oldirql; - - /* DEBUG_ERR(("<**********************oid_rt_pro_rf_read_registry_hdl\n")); */ - if (poid_par_priv->type_of_oid != SET_OID) { /* QUERY_OID */ - status = NDIS_STATUS_NOT_ACCEPTED; - return status; - } - - _irqlevel_changed_(&oldirql, LOWER); - if (poid_par_priv->information_buf_len == (sizeof(unsigned long) * 3)) { - if (Adapter->mppriv.act_in_progress == _TRUE) - status = NDIS_STATUS_NOT_ACCEPTED; - else { - /* init workparam */ - Adapter->mppriv.act_in_progress = _TRUE; - Adapter->mppriv.workparam.bcompleted = _FALSE; - Adapter->mppriv.workparam.act_type = MPT_READ_RF; - Adapter->mppriv.workparam.io_offset = *(unsigned long *)poid_par_priv->information_buf; - Adapter->mppriv.workparam.io_value = 0xcccccccc; - - /* RegOffsetValue - The offset of RF register to read. */ - /* RegDataWidth - The data width of RF register to read. */ - /* RegDataValue - The value to read. */ - /* RegOffsetValue = *((unsigned long*)InformationBuffer); */ - /* RegDataWidth = *((unsigned long*)InformationBuffer+1); */ - /* RegDataValue = *((unsigned long*)InformationBuffer+2); */ - if (!rtw_getrfreg_cmd(Adapter, - *(unsigned char *)poid_par_priv->information_buf, - (unsigned char *)&Adapter->mppriv.workparam.io_value)) - status = NDIS_STATUS_NOT_ACCEPTED; - } - - - } else - status = NDIS_STATUS_INVALID_LENGTH; - _irqlevel_changed_(&oldirql, RAISE); -#endif return status; } @@ -870,19 +780,6 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv *poid_par_priv) *(ULONG *)poid_par_priv->information_buf = ulInfo; *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; -#if 0 - /* Rearrange the order to let the UI still shows connection when scan is in progress */ - if (pMgntInfo->mAssoc) - ulInfo = 1; - else if (pMgntInfo->mIbss) - ulInfo = 2; - else if (pMgntInfo->bScanInProgress) - ulInfo = 0; - else - ulInfo = 3; - ulInfoLen = sizeof(ULONG); -#endif - return status; } diff --git a/core/rtw_ioctl_set.c b/core/rtw_ioctl_set.c index 892d711e..99c712fa 100644 --- a/core/rtw_ioctl_set.c +++ b/core/rtw_ioctl_set.c @@ -552,7 +552,6 @@ u8 rtw_set_802_11_disassociate(_adapter *padapter) return _TRUE; } -#if 1 u8 rtw_set_802_11_bssid_list_scan(_adapter *padapter, struct sitesurvey_parm *pparm) { _irqL irqL; @@ -566,49 +565,7 @@ u8 rtw_set_802_11_bssid_list_scan(_adapter *padapter, struct sitesurvey_parm *pp return res; } -#else -u8 rtw_set_802_11_bssid_list_scan(_adapter *padapter, struct sitesurvey_parm *pparm) -{ - _irqL irqL; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - u8 res = _TRUE; - - - - if (padapter == NULL) { - res = _FALSE; - goto exit; - } - if (!rtw_is_hw_init_completed(padapter)) { - res = _FALSE; - goto exit; - } - - if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == _TRUE) || - (pmlmepriv->LinkDetectInfo.bBusyTraffic == _TRUE)) { - /* Scan or linking is in progress, do nothing. */ - res = _TRUE; - - } else { - if (rtw_is_scan_deny(padapter)) { - RTW_INFO(FUNC_ADPT_FMT": scan deny\n", FUNC_ADPT_ARG(padapter)); - indicate_wx_scan_complete_event(padapter); - return _SUCCESS; - } - - _enter_critical_bh(&pmlmepriv->lock, &irqL); - - res = rtw_sitesurvey_cmd(padapter, pparm); - - _exit_critical_bh(&pmlmepriv->lock, &irqL); - } -exit: - - - return res; -} -#endif u8 rtw_set_802_11_authentication_mode(_adapter *padapter, NDIS_802_11_AUTHENTICATION_MODE authmode) { struct security_priv *psecuritypriv = &padapter->securitypriv; diff --git a/core/rtw_iol.c b/core/rtw_iol.c index 37f5d506..e8492107 100644 --- a/core/rtw_iol.c +++ b/core/rtw_iol.c @@ -23,7 +23,6 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter) struct pkt_attrib *pattrib; struct xmit_priv *pxmitpriv = &(adapter->xmitpriv); -#if 1 xmit_frame = rtw_alloc_xmitframe(pxmitpriv); if (xmit_frame == NULL) { RTW_INFO("%s rtw_alloc_xmitframe return null\n", __FUNCTION__); @@ -48,19 +47,6 @@ struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter) pattrib->qsel = QSLT_BEACON;/* Beacon */ pattrib->subtype = IEEE80211_STYPE_BEACON; pattrib->pktlen = pattrib->last_txcmdsz = 0; - -#else - xmit_frame = alloc_mgtxmitframe(pxmitpriv); - if (xmit_frame == NULL) - RTW_INFO("%s alloc_mgtxmitframe return null\n", __FUNCTION__); - else { - pattrib = &xmit_frame->attrib; - update_mgntframe_attrib(adapter, pattrib); - pattrib->qsel = QSLT_BEACON; - pattrib->pktlen = pattrib->last_txcmdsz = 0; - } -#endif - exit: return xmit_frame; } diff --git a/core/rtw_mi.c b/core/rtw_mi.c index da0d31ce..689298ff 100644 --- a/core/rtw_mi.c +++ b/core/rtw_mi.c @@ -374,21 +374,11 @@ inline void rtw_mi_update_iface_status(struct mlme_priv *pmlmepriv, sint state) ) return; - if (0) - RTW_INFO("%s => will change or clean state to 0x%08x\n", __func__, state); - rtw_mi_status(adapter, &tmp_mstate); memcpy(iface_state, &tmp_mstate, sizeof(struct mi_state)); if (rtw_mi_get_ch_setting_union(adapter, &u_ch, &u_bw, &u_offset)) rtw_mi_update_union_chan_inf(adapter , u_ch, u_offset , u_bw); - else { - if (0) { - dump_adapters_status(RTW_DBGDUMP , dvobj); - RTW_INFO("%s-[ERROR] cannot get union channel\n", __func__); - rtw_warn_on(1); - } - } #ifdef DBG_IFACE_STATUS DBG_IFACE_STATUS_DUMP(adapter); @@ -1557,15 +1547,12 @@ u8 rtw_mi_get_assoc_if_num(_adapter *adapter) { struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); u8 n_assoc_iface = 0; -#if 1 + u8 i; for (i = 0; i < dvobj->iface_nums; i++) { if (check_fwstate(&(dvobj->padapters[i]->mlmepriv), WIFI_ASOC_STATE)) n_assoc_iface++; } -#else - n_assoc_iface = DEV_STA_LD_NUM(dvobj) + DEV_AP_NUM(dvobj) + DEV_ADHOC_NUM(dvobj) + DEV_MESH_NUM(dvobj); -#endif return n_assoc_iface; } diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index d32a8e2e..e12d420c 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -867,38 +867,6 @@ void update_network(WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src, } #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) @@ -951,11 +919,6 @@ bool rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target) phead = get_list_head(queue); plist = get_next(phead); -#if 0 - RTW_INFO("%s => ssid:%s , rssi:%ld , ss:%d\n", - __func__, target->Ssid.Ssid, target->Rssi, target->PhyInfo.SignalStrength); -#endif - #ifdef CONFIG_P2P if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) feature = 1; /* p2p enable */ @@ -3030,15 +2993,6 @@ void rtw_join_timeout_handler(void *ctx) _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", __FUNCTION__, get_fwstate(pmlmepriv)); if (RTW_CANNOT_RUN(adapter)) @@ -3181,7 +3135,7 @@ void rtw_drv_scan_by_self(_adapter *padapter, u8 reason) struct sitesurvey_parm parm; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; int i; -#if 1 + u8 ssc_chk; ssc_chk = rtw_sitesurvey_condition_check(padapter, _FALSE); @@ -3203,40 +3157,6 @@ void rtw_drv_scan_by_self(_adapter *padapter, u8 reason) if (!rtw_is_adapter_up(padapter)) goto exit; -#else - if (rtw_is_scan_deny(padapter)) - goto exit; - - if (!rtw_is_adapter_up(padapter)) - goto exit; - - if (rtw_mi_busy_traffic_check(padapter, _FALSE)) { -#ifdef CONFIG_LAYER2_ROAMING - if (rtw_chk_roam_flags(padapter, RTW_ROAM_ACTIVE) && pmlmepriv->need_to_roam == _TRUE) { - RTW_INFO("need to roam, don't care BusyTraffic\n"); - } else -#endif - { - RTW_INFO(FUNC_ADPT_FMT" exit BusyTraffic\n", FUNC_ADPT_ARG(padapter)); - goto exit; - } - } - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) && check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { - RTW_INFO(FUNC_ADPT_FMT" WIFI_AP_STATE && WIFI_UNDER_WPS\n", FUNC_ADPT_ARG(padapter)); - goto exit; - } - if (check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY | _FW_UNDER_LINKING)) == _TRUE) { - RTW_INFO(FUNC_ADPT_FMT" _FW_UNDER_SURVEY|_FW_UNDER_LINKING\n", FUNC_ADPT_ARG(padapter)); - goto exit; - } - -#ifdef CONFIG_CONCURRENT_MODE - if (rtw_mi_buddy_check_fwstate(padapter, (_FW_UNDER_SURVEY | _FW_UNDER_LINKING | WIFI_UNDER_WPS))) { - RTW_INFO(FUNC_ADPT_FMT", but buddy_intf is under scanning or linking or wps_phase\n", FUNC_ADPT_ARG(padapter)); - goto exit; - } -#endif -#endif RTW_INFO(FUNC_ADPT_FMT" reason:0x%02x\n", FUNC_ADPT_ARG(padapter), reason); @@ -3530,8 +3450,6 @@ inline void rtw_clear_scan_deny(_adapter *adapter) { struct mlme_priv *mlmepriv = &adapter->mlmepriv; atomic_set(&mlmepriv->set_scan_deny, 0); - if (0) - RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); } void rtw_set_scan_deny_timer_hdl(void *ctx) @@ -3543,8 +3461,6 @@ void rtw_set_scan_deny_timer_hdl(void *ctx) void rtw_set_scan_deny(_adapter *adapter, u32 ms) { struct mlme_priv *mlmepriv = &adapter->mlmepriv; - if (0) - RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); atomic_set(&mlmepriv->set_scan_deny, 1); _set_timer(&mlmepriv->set_scan_deny_timer, ms); } @@ -3612,7 +3528,7 @@ static int rtw_check_roaming_candidate(struct mlme_priv *mlme else goto exit; } -#if 1 + if (rtw_get_passing_time_ms(competitor->last_scanned) >= mlme->roam_scanr_exp_ms) goto exit; @@ -3628,9 +3544,7 @@ static int rtw_check_roaming_candidate(struct mlme_priv *mlme if (*candidate != NULL && (*candidate)->network.Rssi >= competitor->network.Rssi) goto exit; -#else - goto exit; -#endif + update: *candidate = competitor; @@ -3670,14 +3584,6 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme) } mlme->pscanned = get_next(mlme->pscanned); - - if (0) - RTW_INFO("%s("MAC_FMT", ch%u) rssi:%d\n" - , pnetwork->network.Ssid.Ssid - , MAC_ARG(pnetwork->network.MacAddress) - , pnetwork->network.Configuration.DSConfig - , (int)pnetwork->network.Rssi); - rtw_check_roaming_candidate(mlme, &candidate, pnetwork); } @@ -3865,13 +3771,6 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); - if (0) - RTW_INFO("%s("MAC_FMT", ch%u) rssi:%d\n" - , pnetwork->network.Ssid.Ssid - , MAC_ARG(pnetwork->network.MacAddress) - , pnetwork->network.Configuration.DSConfig - , (int)pnetwork->network.Rssi); - rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork); } @@ -3895,22 +3794,9 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) /* check for situation of _FW_LINKED */ if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) { RTW_INFO("%s: _FW_LINKED while ask_for_joinbss!!!\n", __FUNCTION__); - -#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", __FUNCTION__); - - rtw_indicate_connect(adapter);/* rtw_indicate_connect again */ - - ret = 2; - goto exit; - } else -#endif - { - rtw_disassoc_cmd(adapter, 0, 0); - rtw_indicate_disconnect(adapter, 0, _FALSE); - rtw_free_assoc_resources_cmd(adapter, _TRUE, 0); - } + rtw_disassoc_cmd(adapter, 0, 0); + rtw_indicate_disconnect(adapter, 0, _FALSE); + rtw_free_assoc_resources_cmd(adapter, _TRUE, 0); } #ifdef CONFIG_ANTENNA_DIVERSITY @@ -4172,15 +4058,6 @@ int rtw_restruct_wmm_ie(_adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, u 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++; @@ -4413,17 +4290,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; @@ -4993,12 +4859,6 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel) /* */ 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", __FUNCTION__); } diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 895fd5a9..f08ec253 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -122,10 +122,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 }, @@ -860,8 +856,6 @@ u8 rtw_chset_is_chbw_valid(RT_CHANNEL_INFO *ch_set, u8 ch, u8 bw, u8 offset) goto exit; for (i = 0; i < op_ch_num; i++) { - if (0) - RTW_INFO("%u,%u,%u - cch:%u, bw:%u, op_ch:%u\n", ch, bw, offset, cch, bw, *(op_chs + i)); if (rtw_chset_search_ch(ch_set, *(op_chs + i)) == -1) break; } @@ -1258,19 +1252,6 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, get_addr2_ptr(pframe)); struct recv_priv *precvpriv = &padapter->recvpriv; - -#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) != IEEE80211_FTYPE_MGMT) { return; } @@ -1317,7 +1298,6 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) } ptable += index; -#if 1 if (psta != NULL) { if (GetRetry(pframe)) { if (precv_frame->u.hdr.attrib.seq_num == psta->RxMgmtFrameSeqNum) { @@ -1329,12 +1309,6 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) } psta->RxMgmtFrameSeqNum = precv_frame->u.hdr.attrib.seq_num; } -#else - - if (GetRetry(pframe)) { - /* return; */ - } -#endif #ifdef CONFIG_AP_MODE switch (get_frame_sub_type(pframe)) { @@ -1754,16 +1728,6 @@ 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; } @@ -1801,10 +1765,6 @@ static void rtw_check_legacy_ap(_adapter *padapter, u8 *pframe, u32 len) #endif /* for legacy ap */ if (elems.ht_capabilities == NULL && elems.ht_capabilities_len == 0) { - - if (0) - RTW_INFO("%s: "MAC_FMT" is legacy ap\n", __func__, MAC_ARG(GetAddr3Ptr(pframe))); - atomic_set(&pmlmepriv->olbc, _TRUE); atomic_set(&pmlmepriv->olbc_ht, _TRUE); } @@ -1974,9 +1934,6 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) if (pmlmeext->tsf_update_required && 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) { @@ -2486,13 +2443,6 @@ 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 - if (rtw_ap_linking_test_force_asoc_fail()) { status = rtw_ap_linking_test_force_asoc_fail(); RTW_INFO(FUNC_ADPT_FMT" force asoc fail with status:%u\n" @@ -2513,19 +2463,6 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) rtw_ap_parse_sta_capability(padapter, pstat, pframe + WLAN_HDR_A3_LEN); listen_interval = RTW_GET_LE16(pframe + WLAN_HDR_A3_LEN + 2); -#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 we should check all the fields... */ /* checking SSID */ @@ -3601,12 +3538,6 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame) if (!_rtw_memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(pframe), ETH_ALEN)) return _SUCCESS; -#if 0 - /* check A1 matches or not */ - if (!_rtw_memcmp(adapter_mac_addr(padapter), ieee80211_get_DA((struct ieee80211_hdr *)pframe), ETH_ALEN)) - return _SUCCESS; -#endif - if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) return _SUCCESS; @@ -7268,13 +7199,6 @@ unsigned int OnAction_sa_query(_adapter *padapter, union recv_frame *precv_frame default: break; } - if (0) { - int pp; - printk("pattrib->pktlen = %d =>", pattrib->pkt_len); - for (pp = 0; pp < pattrib->pkt_len; pp++) - printk(" %02x ", pframe[pp]); - printk("\n"); - } return _SUCCESS; } @@ -9072,7 +8996,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); */ @@ -9120,22 +9043,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); @@ -10734,12 +10641,6 @@ unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *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); @@ -10863,8 +10764,6 @@ unsigned int send_beacon(_adapter *padapter) if (passing_time > 100 || issue > 3) RTW_INFO("%s success, issue:%d, poll:%d, %u ms\n", __FUNCTION__, issue, poll, rtw_get_passing_time_ms(start)); - else if (0) - RTW_INFO("%s success, issue:%d, poll:%d, %u ms\n", __FUNCTION__, issue, poll, rtw_get_passing_time_ms(start)); #ifdef CONFIG_FW_CORRECT_BCN rtw_hal_fw_correct_bcn(padapter); @@ -11019,12 +10918,6 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI memcpy(bssid->SupportedRates + i, (p + 2), len); } - /* todo: */ -#if 0 - if (judge_network_type(bssid->SupportedRates, (len + i)) == WIRELESS_11B) - bssid->NetworkTypeInUse = Ndis802_11DS; - else -#endif { bssid->NetworkTypeInUse = Ndis802_11OFDM24; } @@ -11564,11 +11457,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]) { @@ -11584,11 +11473,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++; } @@ -11633,11 +11518,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]) { @@ -11651,11 +11532,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++; } @@ -11689,21 +11566,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", - __FUNCTION__, pmlmeext->sitesurvey_res.channel_idx, k); - pmlmeext->sitesurvey_res.channel_idx = k; - break; - } - k++; - } -#endif - done_update_chplan_from_ap: if (chplan_sta) rtw_mfree(chplan_sta, sizeof(RT_CHANNEL_INFO) * MAX_CHANNEL_NUM); @@ -14040,35 +13902,6 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) rtw_adjust_chbw(padapter, pmlmeext->cur_channel, &pmlmeext->cur_bwmode, &pmlmeext->cur_ch_offset); -#if 0 - if (padapter->registrypriv.wifi_spec) { - /* for WiFi test, follow WMM test plan spec */ - acparm = 0x002F431C; /* VO */ - rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VO, (u8 *)(&acparm)); - acparm = 0x005E541C; /* VI */ - rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VI, (u8 *)(&acparm)); - acparm = 0x0000A525; /* BE */ - rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); - acparm = 0x0000A549; /* BK */ - rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acparm)); - - /* for WiFi test, mixed mode with intel STA under bg mode throughput issue */ - if (padapter->mlmepriv.htpriv.ht_option == _FALSE) { - acparm = 0x00004320; - rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); - } - } else { - acparm = 0x002F3217; /* VO */ - rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VO, (u8 *)(&acparm)); - acparm = 0x005E4317; /* VI */ - rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_VI, (u8 *)(&acparm)); - acparm = 0x00105320; /* BE */ - rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BE, (u8 *)(&acparm)); - acparm = 0x0000A444; /* BK */ - rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acparm)); - } -#endif - /* check channel, bandwidth, offset and switch */ if (rtw_chk_start_clnt_join(padapter, &u_ch, &u_bw, &u_offset) == _FAIL) { report_join_res(padapter, (-4), WLAN_STATUS_UNSPECIFIED_FAILURE); @@ -14287,9 +14120,6 @@ u8 rtw_scan_sparse(_adapter *adapter, struct rtw_ieee80211_channel *ch, u8 ch_nu scan_division_num = (ch_num / max_allow_ch) + ((ch_num % max_allow_ch) ? 1 : 0); token = (token + 1) % scan_division_num; - if (0) - RTW_INFO("scan_division_num:%u, token:%u\n", scan_division_num, token); - for (i = 0; i < ch_num; i++) { if (ch[i].hw_value && (i % scan_division_num) == token ) { @@ -14390,9 +14220,6 @@ static int rtw_scan_ch_decision(_adapter *padapter, struct rtw_ieee80211_channel j = 0; for (i = 0; i < in_num; i++) { - if (0) - RTW_INFO(FUNC_ADPT_FMT" "CHAN_FMT"\n", FUNC_ADPT_ARG(padapter), CHAN_ARG(&in[i])); - if (!in[i].hw_value || (in[i].flags & IEEE80211_CHAN_DISABLED)) continue; if (rtw_mlme_band_check(padapter, in[i].hw_value) == _FALSE) @@ -14425,9 +14252,6 @@ static int rtw_scan_ch_decision(_adapter *padapter, struct rtw_ieee80211_channel if (rtw_mlme_ignore_chan(padapter, chan) == _TRUE) continue; - if (0) - RTW_INFO(FUNC_ADPT_FMT" ch:%u\n", FUNC_ADPT_ARG(padapter), chan); - if (j >= out_num) { RTW_PRINT(FUNC_ADPT_FMT" out_num:%u not enough\n", FUNC_ADPT_ARG(padapter), out_num); @@ -14734,18 +14558,11 @@ void survey_done_set_ch_bw(_adapter *padapter) #ifdef CONFIG_MCC_MODE if (!rtw_hal_mcc_change_scan_flag(padapter, &cur_channel, &cur_bwmode, &cur_ch_offset)) { - if (0) - RTW_INFO(FUNC_ADPT_FMT" back to AP channel - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), cur_channel, cur_bwmode, cur_ch_offset); goto exit; } #endif - if (rtw_mi_get_ch_setting_union(padapter, &cur_channel, &cur_bwmode, &cur_ch_offset) != 0) { - if (0) - RTW_INFO(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), cur_channel, cur_bwmode, cur_ch_offset); - } else { + if (rtw_mi_get_ch_setting_union(padapter, &cur_channel, &cur_bwmode, &cur_ch_offset) == 0) { #ifdef CONFIG_P2P struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); _adapter *iface; @@ -14765,9 +14582,6 @@ void survey_done_set_ch_bw(_adapter *padapter) cur_channel = iface->wdinfo.listen_channel; cur_bwmode = CHANNEL_WIDTH_20; cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - if (0) - RTW_INFO(FUNC_ADPT_FMT" back to "ADPT_FMT"'s listen ch - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), ADPT_ARG(iface), cur_channel, cur_bwmode, cur_ch_offset); break; } } @@ -14777,9 +14591,6 @@ void survey_done_set_ch_bw(_adapter *padapter) cur_channel = pmlmeext->cur_channel; cur_bwmode = pmlmeext->cur_bwmode; cur_ch_offset = pmlmeext->cur_ch_offset; - if (0) - RTW_INFO(FUNC_ADPT_FMT" back to ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), cur_channel, cur_bwmode, cur_ch_offset); } } #ifdef CONFIG_MCC_MODE @@ -15902,12 +15713,6 @@ 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); } @@ -16333,7 +16138,7 @@ void rtw_set_external_auth_status(_adapter *padapter, params.ssid.ssid_len = RTW_GET_BE64((u8 *)data + 42); params.key_mgmt_suite = RTW_GET_BE32((u8 *)data + 58); params.status = RTW_GET_BE16((u8 *)data + 62); - memcpy(¶ms.pmkid, (u8 *)data + 64, PMKID_LEN); + memcpy(¶ms.pmkid, (u8 *)data + 64, WLAN_PMKID_LEN); rtw_cfg80211_external_auth_status(wiphy, dev, ¶ms); #endif /* CONFIG_IOCTL_CFG80211 */ @@ -16592,10 +16397,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 - memset(pHalData->tdls_ch_sw_iqk_info_base_chnl, 0x00, sizeof(pHalData->tdls_ch_sw_iqk_info_base_chnl)); - 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->cmn.mac_addr, TDLS_CH_SW_TO_BASE_CHNL); diff --git a/core/rtw_mp.c b/core/rtw_mp.c index 951b76ed..1c88c436 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -121,51 +121,6 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv) } -#ifdef PLATFORM_LINUX -#if 0 -static int init_mp_priv_by_os(struct mp_priv *pmp_priv) -{ - int i, res; - struct mp_xmit_frame *pmp_xmitframe; - - if (pmp_priv == NULL) - return _FAIL; - - _rtw_init_queue(&pmp_priv->free_mp_xmitqueue); - - pmp_priv->pallocated_mp_xmitframe_buf = NULL; - pmp_priv->pallocated_mp_xmitframe_buf = rtw_zmalloc(NR_MP_XMITFRAME * sizeof(struct mp_xmit_frame) + 4); - if (pmp_priv->pallocated_mp_xmitframe_buf == NULL) { - res = _FAIL; - goto _exit_init_mp_priv; - } - - pmp_priv->pmp_xmtframe_buf = pmp_priv->pallocated_mp_xmitframe_buf + 4 - ((SIZE_PTR)(pmp_priv->pallocated_mp_xmitframe_buf) & 3); - - pmp_xmitframe = (struct mp_xmit_frame *)pmp_priv->pmp_xmtframe_buf; - - for (i = 0; i < NR_MP_XMITFRAME; i++) { - _rtw_init_listhead(&pmp_xmitframe->list); - rtw_list_insert_tail(&pmp_xmitframe->list, &pmp_priv->free_mp_xmitqueue.queue); - - pmp_xmitframe->pkt = NULL; - pmp_xmitframe->frame_tag = MP_FRAMETAG; - pmp_xmitframe->padapter = pmp_priv->papdater; - - pmp_xmitframe++; - } - - pmp_priv->free_mp_xmitframe_cnt = NR_MP_XMITFRAME; - - res = _SUCCESS; - -_exit_init_mp_priv: - - return res; -} -#endif -#endif - static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter) { HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); @@ -178,10 +133,6 @@ static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter) memset(pmptx->desc, 0, TXDESC_SIZE); pattrib->ether_type = 0x8712; -#if 0 - memcpy(pattrib->src, adapter_mac_addr(padapter), ETH_ALEN); - memcpy(pattrib->ta, pattrib->src, ETH_ALEN); -#endif memset(pattrib->dst, 0xFF, ETH_ALEN); /* pattrib->dhcp_pkt = 0; @@ -270,30 +221,6 @@ void free_mp_priv(struct mp_priv *pmp_priv) pmp_priv->pmp_xmtframe_buf = NULL; } -#if 0 -static VOID PHY_IQCalibrate_default( - IN PADAPTER pAdapter, - IN BOOLEAN bReCovery -) -{ - RTW_INFO("%s\n", __func__); -} - -static VOID PHY_LCCalibrate_default( - IN PADAPTER pAdapter -) -{ - RTW_INFO("%s\n", __func__); -} - -static VOID PHY_SetRFPathSwitch_default( - IN PADAPTER pAdapter, - IN BOOLEAN bMain -) -{ - RTW_INFO("%s\n", __func__); -} -#endif void mpt_InitHWConfig(PADAPTER Adapter) { @@ -639,15 +566,6 @@ MPT_DeInitAdapter( #if defined(CONFIG_RTL8723B) phy_set_bb_reg(pAdapter, 0xA01, BIT0, 1); /* /suggestion by jerry for MP Rx. */ #endif -#if 0 /* for Windows */ - PlatformFreeWorkItem(&(pMptCtx->MptWorkItem)); - - while (pMptCtx->bMptWorkItemInProgress) { - if (NdisWaitEvent(&(pMptCtx->MptWorkItemEvent), 50)) - break; - } - NdisFreeSpinLock(&(pMptCtx->MptWorkItemSpinLock)); -#endif } static u8 mpt_ProStartTest(PADAPTER padapter) @@ -847,24 +765,22 @@ u32 mp_join(PADAPTER padapter, u8 mode) _exit_critical_bh(&pmlmepriv->lock, &irqL); - if (1) { /* (res == _SUCCESS) */ - /* set MSR to WIFI_FW_ADHOC_STATE */ - if (mode == WIFI_FW_ADHOC_STATE) { - /* set msr to WIFI_FW_ADHOC_STATE */ - pmlmeinfo->state = WIFI_FW_ADHOC_STATE; - Set_MSR(padapter, (pmlmeinfo->state & 0x3)); - rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, padapter->registrypriv.dev_network.MacAddress); - rtw_hal_rcr_set_chk_bssid(padapter, MLME_ADHOC_STARTED); - pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS; - } else { - Set_MSR(padapter, WIFI_FW_STATION_STATE); + /* set MSR to WIFI_FW_ADHOC_STATE */ + if (mode == WIFI_FW_ADHOC_STATE) { + /* set msr to WIFI_FW_ADHOC_STATE */ + pmlmeinfo->state = WIFI_FW_ADHOC_STATE; + Set_MSR(padapter, (pmlmeinfo->state & 0x3)); + rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, padapter->registrypriv.dev_network.MacAddress); + rtw_hal_rcr_set_chk_bssid(padapter, MLME_ADHOC_STARTED); + pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS; + } else { + Set_MSR(padapter, WIFI_FW_STATION_STATE); - RTW_INFO("%s , pmppriv->network_macaddr =%x %x %x %x %x %x\n", __func__, - pmppriv->network_macaddr[0], pmppriv->network_macaddr[1], pmppriv->network_macaddr[2], pmppriv->network_macaddr[3], pmppriv->network_macaddr[4], - pmppriv->network_macaddr[5]); + RTW_INFO("%s , pmppriv->network_macaddr =%x %x %x %x %x %x\n", __func__, + pmppriv->network_macaddr[0], pmppriv->network_macaddr[1], pmppriv->network_macaddr[2], pmppriv->network_macaddr[3], pmppriv->network_macaddr[4], + pmppriv->network_macaddr[5]); - rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmppriv->network_macaddr); - } + rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmppriv->network_macaddr); } return res; @@ -1019,79 +935,6 @@ void mp_stop_test(PADAPTER padapter) #endif } } -/*---------------------------hal\rtl8192c\MPT_Phy.c---------------------------*/ -#if 0 -/* #ifdef CONFIG_USB_HCI */ -static VOID mpt_AdjustRFRegByRateByChan92CU(PADAPTER pAdapter, u8 RateIdx, u8 Channel, u8 BandWidthID) -{ - u8 eRFPath; - u32 rfReg0x26; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter); - - - if (RateIdx < MPT_RATE_6M) /* CCK rate,for 88cu */ - rfReg0x26 = 0xf400; - else if ((RateIdx >= MPT_RATE_6M) && (RateIdx <= MPT_RATE_54M)) {/* OFDM rate,for 88cu */ - if ((4 == Channel) || (8 == Channel) || (12 == Channel)) - rfReg0x26 = 0xf000; - else if ((5 == Channel) || (7 == Channel) || (13 == Channel) || (14 == Channel)) - rfReg0x26 = 0xf400; - else - rfReg0x26 = 0x4f200; - } else if ((RateIdx >= MPT_RATE_MCS0) && (RateIdx <= MPT_RATE_MCS15)) { - /* MCS 20M ,for 88cu */ /* MCS40M rate,for 88cu */ - - if (CHANNEL_WIDTH_20 == BandWidthID) { - if ((4 == Channel) || (8 == Channel)) - rfReg0x26 = 0xf000; - else if ((5 == Channel) || (7 == Channel) || (13 == Channel) || (14 == Channel)) - rfReg0x26 = 0xf400; - else - rfReg0x26 = 0x4f200; - } else { - if ((4 == Channel) || (8 == Channel)) - rfReg0x26 = 0xf000; - else if ((5 == Channel) || (7 == Channel)) - rfReg0x26 = 0xf400; - else - rfReg0x26 = 0x4f200; - } - } - - for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++) - write_rfreg(pAdapter, eRFPath, RF_SYN_G2, rfReg0x26); -} -#endif -/*----------------------------------------------------------------------------- - * Function: mpt_SwitchRfSetting - * - * Overview: Change RF Setting when we siwthc channel/rate/BW for MP. - * - * Input: IN PADAPTER pAdapter - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 01/08/2009 MHC Suggestion from SD3 Willis for 92S series. - * 01/09/2009 MHC Add CCK modification for 40MHZ. Suggestion from SD3. - * - *---------------------------------------------------------------------------*/ -#if 0 -static void mpt_SwitchRfSetting(PADAPTER pAdapter) -{ - hal_mpt_SwitchRfSetting(pAdapter); -} - -/*---------------------------hal\rtl8192c\MPT_Phy.c---------------------------*/ -/*---------------------------hal\rtl8192c\MPT_HelperFunc.c---------------------------*/ -static void MPT_CCKTxPowerAdjust(PADAPTER Adapter, BOOLEAN bInCH14) -{ - hal_mpt_CCKTxPowerAdjust(Adapter, bInCH14); -} -#endif /*---------------------------hal\rtl8192c\MPT_HelperFunc.c---------------------------*/ @@ -1170,18 +1013,6 @@ s32 SetThermalMeter(PADAPTER pAdapter, u8 target_ther) return hal_mpt_SetThermalMeter(pAdapter, target_ther); } -#if 0 -static void TriggerRFThermalMeter(PADAPTER pAdapter) -{ - hal_mpt_TriggerRFThermalMeter(pAdapter); -} - -static u8 ReadRFThermalMeter(PADAPTER pAdapter) -{ - return hal_mpt_ReadRFThermalMeter(pAdapter); -} -#endif - void GetThermalMeter(PADAPTER pAdapter, u8 *value) { hal_mpt_GetThermalMeter(pAdapter, value); @@ -1986,13 +1817,12 @@ void SetPacketTx(PADAPTER padapter) rtw_mfree(pmp_priv->TXradomBuffer, 4096); /* 3 6. start thread */ -#ifdef PLATFORM_LINUX pmp_priv->tx.PktTxThread = kthread_run(mp_xmit_packet_thread, pmp_priv, "RTW_MP_THREAD"); if (IS_ERR(pmp_priv->tx.PktTxThread)) { RTW_ERR("Create PktTx Thread Fail !!!!!\n"); pmp_priv->tx.PktTxThread = NULL; } -#endif + Rtw_MPSetMacTxEDCA(padapter); exit: return; @@ -2308,11 +2138,9 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data) int psd_analysis = 0; u8 *pdata = data; -#ifdef PLATFORM_LINUX if (!netif_running(pAdapter->pnetdev)) { return 0; } -#endif if (check_fwstate(&pAdapter->mlmepriv, WIFI_MP_STATE) == _FALSE) { return 0; @@ -2354,91 +2182,6 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data) return strlen(data) + 1; } - -#if 0 -void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv) -{ - int i, res; - _adapter *padapter = pxmitpriv->adapter; - struct xmit_frame *pxmitframe = (struct xmit_frame *) pxmitpriv->pxmit_frame_buf; - struct xmit_buf *pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmitbuf; - - u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; - u32 num_xmit_extbuf = NR_XMIT_EXTBUFF; - if (padapter->registrypriv.mp_mode == 0) { - max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; - num_xmit_extbuf = NR_XMIT_EXTBUFF; - } else { - max_xmit_extbuf_size = 6000; - num_xmit_extbuf = 8; - } - - pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; - for (i = 0; i < num_xmit_extbuf; i++) { - rtw_os_xmit_resource_free(padapter, pxmitbuf, (max_xmit_extbuf_size + XMITBUF_ALIGN_SZ), _FALSE); - - pxmitbuf++; - } - - vfree(pxmitpriv->pallocated_xmit_extbuf); - - if (padapter->registrypriv.mp_mode == 0) { - max_xmit_extbuf_size = 6000; - num_xmit_extbuf = 8; - } else { - max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; - num_xmit_extbuf = NR_XMIT_EXTBUFF; - } - - /* Init xmit extension buff */ - _rtw_init_queue(&pxmitpriv->free_xmit_extbuf_queue); - - pxmitpriv->pallocated_xmit_extbuf = vzalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4); - - if (pxmitpriv->pallocated_xmit_extbuf == NULL) { - res = _FAIL; - goto exit; - } - - pxmitpriv->pxmit_extbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitpriv->pallocated_xmit_extbuf), 4); - - pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; - - for (i = 0; i < num_xmit_extbuf; i++) { - _rtw_init_listhead(&pxmitbuf->list); - - pxmitbuf->priv_data = NULL; - pxmitbuf->padapter = padapter; - pxmitbuf->buf_tag = XMITBUF_MGNT; - - res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ, _TRUE); - if (res == _FAIL) { - res = _FAIL; - goto exit; - } - -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pxmitbuf->phead = pxmitbuf->pbuf; - pxmitbuf->pend = pxmitbuf->pbuf + max_xmit_extbuf_size; - pxmitbuf->len = 0; - pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; -#endif - - rtw_list_insert_tail(&pxmitbuf->list, &(pxmitpriv->free_xmit_extbuf_queue.queue)); -#ifdef DBG_XMIT_BUF_EXT - pxmitbuf->no = i; -#endif - pxmitbuf++; - - } - - pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf; - -exit: - ; -} -#endif - u8 mpt_to_mgnt_rate( IN ULONG MptRateIdx diff --git a/core/rtw_mp_ioctl.c b/core/rtw_mp_ioctl.c index 35b1b0e2..4dd11019 100644 --- a/core/rtw_mp_ioctl.c +++ b/core/rtw_mp_ioctl.c @@ -705,38 +705,7 @@ NDIS_STATUS oid_rt_pro_trigger_gpio_hdl(struct oid_par_priv *poid_par_priv) * ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro8711_join_bss_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - PNDIS_802_11_SSID pssid; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - *poid_par_priv->bytes_needed = (u32)sizeof(NDIS_802_11_SSID); - *poid_par_priv->bytes_rw = 0; - if (poid_par_priv->information_buf_len < *poid_par_priv->bytes_needed) - return NDIS_STATUS_INVALID_LENGTH; - - pssid = (PNDIS_802_11_SSID)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - - if (mp_start_joinbss(Adapter, pssid) == _FAIL) - status = NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, RAISE); - - *poid_par_priv->bytes_rw = sizeof(NDIS_802_11_SSID); - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv) @@ -837,979 +806,194 @@ NDIS_STATUS oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv) /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_burst_read_register_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - pBurst_RW_Reg pBstRwReg; - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - pBstRwReg = (pBurst_RW_Reg)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - rtw_read_mem(padapter, pBstRwReg->offset, (u32)pBstRwReg->len, pBstRwReg->Data); - _irqlevel_changed_(&oldirql, RAISE); - - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_burst_write_register_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - pBurst_RW_Reg pBstRwReg; - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - pBstRwReg = (pBurst_RW_Reg)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - rtw_write_mem(padapter, pBstRwReg->offset, (u32)pBstRwReg->len, pBstRwReg->Data); - _irqlevel_changed_(&oldirql, RAISE); - - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_write_txcmd_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - TX_CMD_Desc *TxCmd_Info; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - - TxCmd_Info = (TX_CMD_Desc *)poid_par_priv->information_buf; - - - _irqlevel_changed_(&oldirql, LOWER); - - rtw_write32(Adapter, TxCmd_Info->offset + 0, (unsigned int)TxCmd_Info->TxCMD.value[0]); - rtw_write32(Adapter, TxCmd_Info->offset + 4, (unsigned int)TxCmd_Info->TxCMD.value[1]); - - _irqlevel_changed_(&oldirql, RAISE); - - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_read16_eeprom_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - - pEEPROM_RWParam pEEPROM; - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - pEEPROM = (pEEPROM_RWParam)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - pEEPROM->value = eeprom_read16(padapter, (u16)(pEEPROM->offset >> 1)); - _irqlevel_changed_(&oldirql, RAISE); - - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_write16_eeprom_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - pEEPROM_RWParam pEEPROM; - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - pEEPROM = (pEEPROM_RWParam)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - eeprom_write16(padapter, (u16)(pEEPROM->offset >> 1), pEEPROM->value); - _irqlevel_changed_(&oldirql, RAISE); - - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro8711_wi_poll_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - struct mp_wiparam *pwi_param; - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(struct mp_wiparam)) - return NDIS_STATUS_INVALID_LENGTH; - - if (Adapter->mppriv.workparam.bcompleted == _FALSE) - return NDIS_STATUS_NOT_ACCEPTED; - - pwi_param = (struct mp_wiparam *)poid_par_priv->information_buf; - - memcpy(pwi_param, &Adapter->mppriv.workparam, sizeof(struct mp_wiparam)); - Adapter->mppriv.act_in_progress = _FALSE; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro8711_pkt_loss_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(uint) * 2) { - return NDIS_STATUS_INVALID_LENGTH; - } - - if (*(uint *)poid_par_priv->information_buf == 1) /* init==1 */ - Adapter->mppriv.rx_pktloss = 0; - - *((uint *)poid_par_priv->information_buf + 1) = Adapter->mppriv.rx_pktloss; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_rd_attrib_mem_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - struct io_queue *pio_queue = (struct io_queue *)Adapter->pio_queue; - struct intf_hdl *pintfhdl = &pio_queue->intf; - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - -#ifdef CONFIG_SDIO_HCI - void (*_attrib_read)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); -#endif - - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - -#ifdef CONFIG_SDIO_HCI - _irqlevel_changed_(&oldirql, LOWER); - { - u32 *plmem = (u32 *)poid_par_priv->information_buf + 2; - _attrib_read = pintfhdl->io_ops._attrib_read; - _attrib_read(pintfhdl, *((u32 *)poid_par_priv->information_buf), - *((u32 *)poid_par_priv->information_buf + 1), (u8 *)plmem); - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - } - _irqlevel_changed_(&oldirql, RAISE); -#endif - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_wr_attrib_mem_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - struct io_queue *pio_queue = (struct io_queue *)Adapter->pio_queue; - struct intf_hdl *pintfhdl = &pio_queue->intf; - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - -#ifdef CONFIG_SDIO_HCI - void (*_attrib_write)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); -#endif - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - -#ifdef CONFIG_SDIO_HCI - _irqlevel_changed_(&oldirql, LOWER); - { - u32 *plmem = (u32 *)poid_par_priv->information_buf + 2; - _attrib_write = pintfhdl->io_ops._attrib_write; - _attrib_write(pintfhdl, *(u32 *)poid_par_priv->information_buf, - *((u32 *)poid_par_priv->information_buf + 1), (u8 *)plmem); - } - _irqlevel_changed_(&oldirql, RAISE); -#endif - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_set_rf_intfs_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, LOWER); - - if (rtw_setrfintfs_cmd(Adapter, *(unsigned char *)poid_par_priv->information_buf) == _FAIL) - status = NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, RAISE); - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_poll_rx_status_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - memcpy(poid_par_priv->information_buf, (unsigned char *)&Adapter->mppriv.rxstat, sizeof(struct recv_stat)); - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_pro_cfg_debug_message_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - PCFG_DBG_MSG_STRUCT pdbg_msg; - - - -#if 0/*#ifdef CONFIG_DEBUG_RTL871X*/ - - pdbg_msg = (PCFG_DBG_MSG_STRUCT)(poid_par_priv->information_buf); - - if (poid_par_priv->type_of_oid == SET_OID) { - - GlobalDebugLevel = pdbg_msg->DebugLevel; - GlobalDebugComponents = (pdbg_msg->DebugComponent_H32 << 32) | pdbg_msg->DebugComponent_L32; - } else { - pdbg_msg->DebugLevel = GlobalDebugLevel; - pdbg_msg->DebugComponent_H32 = (u32)(GlobalDebugComponents >> 32); - pdbg_msg->DebugComponent_L32 = (u32)GlobalDebugComponents; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - } - -#endif - - - return status; -#else - return 0; -#endif -} -/* ------------------------------------------------------------------------------ */ -NDIS_STATUS oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv) -{ - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, LOWER); - - if (rtw_setdatarate_cmd(Adapter, poid_par_priv->information_buf) != _SUCCESS) - status = NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, RAISE); - - - return status; -} -/* ----------------------------------------------------------------------------- */ -NDIS_STATUS oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv) -{ - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - u8 thermal = 0; - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(u32)) - return NDIS_STATUS_INVALID_LENGTH; - - _irqlevel_changed_(&oldirql, LOWER); - GetThermalMeter(Adapter, &thermal); - _irqlevel_changed_(&oldirql, RAISE); - - *(u32 *)poid_par_priv->information_buf = (u32)thermal; - *poid_par_priv->bytes_rw = sizeof(u32); - - - return status; -} -/* ----------------------------------------------------------------------------- */ -NDIS_STATUS oid_rt_pro_read_tssi_hdl(struct oid_par_priv *poid_par_priv) -{ -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (Adapter->mppriv.act_in_progress == _TRUE) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(u8)) - return NDIS_STATUS_INVALID_LENGTH; - - /* init workparam */ - Adapter->mppriv.act_in_progress = _TRUE; - Adapter->mppriv.workparam.bcompleted = _FALSE; - Adapter->mppriv.workparam.act_type = MPT_READ_TSSI; - Adapter->mppriv.workparam.io_offset = 0; - Adapter->mppriv.workparam.io_value = 0xFFFFFFFF; - - _irqlevel_changed_(&oldirql, LOWER); - - if (!rtw_gettssi_cmd(Adapter, 0, (u8 *)&Adapter->mppriv.workparam.io_value)) - status = NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, RAISE); - - - return status; -#else - return 0; -#endif -} -/* ------------------------------------------------------------------------------ */ -NDIS_STATUS oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv *poid_par_priv) -{ - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - /* if (poid_par_priv->type_of_oid != SET_OID) - * return NDIS_STATUS_NOT_ACCEPTED; */ - - if (poid_par_priv->information_buf_len < sizeof(u8)) - return NDIS_STATUS_INVALID_LENGTH; - - _irqlevel_changed_(&oldirql, LOWER); - if (poid_par_priv->type_of_oid == SET_OID) { - u8 enable; - - enable = *(u8 *)poid_par_priv->information_buf; - - SetPowerTracking(Adapter, enable); - } else - GetPowerTracking(Adapter, (u8 *)poid_par_priv->information_buf); - _irqlevel_changed_(&oldirql, RAISE); - - - return status; -} -/* ----------------------------------------------------------------------------- */ -NDIS_STATUS oid_rt_pro_set_basic_rate_hdl(struct oid_par_priv *poid_par_priv) -{ -#if 0 - u32 ratevalue; - u8 datarates[NumRates]; - int i; - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; -#if 0 - ratevalue = *((u32 *)poid_par_priv->information_buf); - - for (i = 0; i < NumRates; i++) { - if (ratevalue == mpdatarate[i]) - datarates[i] = mpdatarate[i]; - else - datarates[i] = 0xff; - } - - _irqlevel_changed_(&oldirql, LOWER); - - if (rtw_setbasicrate_cmd(padapter, datarates) != _SUCCESS) - status = NDIS_STATUS_NOT_ACCEPTED; - - _irqlevel_changed_(&oldirql, RAISE); -#endif - - - return status; -#else - return 0; -#endif -} -/* ------------------------------------------------------------------------------ */ -NDIS_STATUS oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv *poid_par_priv) -{ -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < 8) - return NDIS_STATUS_INVALID_LENGTH; - - *poid_par_priv->bytes_rw = 8; - memcpy(poid_par_priv->information_buf, &(adapter_to_pwrctl(Adapter)->pwr_mode), 8); - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - - - return status; -#else - return 0; -#endif -} -/* ------------------------------------------------------------------------------ */ -NDIS_STATUS oid_rt_pro_set_pwrstate_hdl(struct oid_par_priv *poid_par_priv) -{ -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - uint pwr_mode, smart_ps; - - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - *poid_par_priv->bytes_rw = 0; - *poid_par_priv->bytes_needed = 8; - - if (poid_par_priv->information_buf_len < 8) - return NDIS_STATUS_INVALID_LENGTH; - - pwr_mode = *(uint *)(poid_par_priv->information_buf); - smart_ps = *(uint *)((int)poid_par_priv->information_buf + 4); - - *poid_par_priv->bytes_rw = 8; - - - return status; -#else - return 0; -#endif -} -/* ------------------------------------------------------------------------------ */ -NDIS_STATUS oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv *poid_par_priv) -{ -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - struct setratable_parm *prate_table; - u8 res; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - *poid_par_priv->bytes_needed = sizeof(struct setratable_parm); - if (poid_par_priv->information_buf_len < sizeof(struct setratable_parm)) - return NDIS_STATUS_INVALID_LENGTH; - - prate_table = (struct setratable_parm *)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - res = rtw_setrttbl_cmd(Adapter, prate_table); - _irqlevel_changed_(&oldirql, RAISE); - - if (res == _FAIL) - status = NDIS_STATUS_FAILURE; - - - return status; -#else - return 0; -#endif -} -/* ------------------------------------------------------------------------------ */ -NDIS_STATUS oid_rt_pro_h2c_get_rate_table_hdl(struct oid_par_priv *poid_par_priv) -{ -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; - -#if 0 - struct mp_wi_cntx *pmp_wi_cntx = &(Adapter->mppriv.wi_cntx); - u8 res = _SUCCESS; - DEBUG_INFO(("===> Set OID_RT_PRO_H2C_GET_RATE_TABLE.\n")); - - if (pmp_wi_cntx->bmp_wi_progress == _TRUE) { - DEBUG_ERR(("\n mp workitem is progressing, not allow to set another workitem right now!!!\n")); - Status = NDIS_STATUS_NOT_ACCEPTED; - break; - } else { - pmp_wi_cntx->bmp_wi_progress = _TRUE; - pmp_wi_cntx->param.bcompleted = _FALSE; - pmp_wi_cntx->param.act_type = MPT_GET_RATE_TABLE; - pmp_wi_cntx->param.io_offset = 0x0; - pmp_wi_cntx->param.bytes_cnt = sizeof(struct getratable_rsp); - pmp_wi_cntx->param.io_value = 0xffffffff; - - res = rtw_getrttbl_cmd(Adapter, (struct getratable_rsp *)pmp_wi_cntx->param.data); - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - if (res != _SUCCESS) - Status = NDIS_STATUS_NOT_ACCEPTED; - } - DEBUG_INFO(("\n <=== Set OID_RT_PRO_H2C_GET_RATE_TABLE.\n")); -#endif - - - return status; -#else - return 0; -#endif -} - -/* **************** oid_rtl_seg_87_12_00 section start **************** */ -NDIS_STATUS oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv *poid_par_priv) -{ -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - struct security_priv *psecuritypriv = &Adapter->securitypriv; - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - ENCRY_CTRL_STATE encry_mode; - - - *poid_par_priv->bytes_needed = sizeof(u8); - if (poid_par_priv->information_buf_len < *poid_par_priv->bytes_needed) - return NDIS_STATUS_INVALID_LENGTH; - - if (poid_par_priv->type_of_oid == SET_OID) { - encry_mode = *((u8 *)poid_par_priv->information_buf); - switch (encry_mode) { - case HW_CONTROL: -#if 0 - Adapter->registrypriv.software_decrypt = _FALSE; - Adapter->registrypriv.software_encrypt = _FALSE; -#else - psecuritypriv->sw_decrypt = _FALSE; - psecuritypriv->sw_encrypt = _FALSE; -#endif - break; - case SW_CONTROL: -#if 0 - Adapter->registrypriv.software_decrypt = _TRUE; - Adapter->registrypriv.software_encrypt = _TRUE; -#else - psecuritypriv->sw_decrypt = _TRUE; - psecuritypriv->sw_encrypt = _TRUE; -#endif - break; - case HW_ENCRY_SW_DECRY: -#if 0 - Adapter->registrypriv.software_decrypt = _TRUE; - Adapter->registrypriv.software_encrypt = _FALSE; -#else - psecuritypriv->sw_decrypt = _TRUE; - psecuritypriv->sw_encrypt = _FALSE; -#endif - break; - case SW_ENCRY_HW_DECRY: -#if 0 - Adapter->registrypriv.software_decrypt = _FALSE; - Adapter->registrypriv.software_encrypt = _TRUE; -#else - psecuritypriv->sw_decrypt = _FALSE; - psecuritypriv->sw_encrypt = _TRUE; -#endif - break; - } - - } else { -#if 0 - if (Adapter->registrypriv.software_encrypt == _FALSE) { - if (Adapter->registrypriv.software_decrypt == _FALSE) - encry_mode = HW_CONTROL; - else - encry_mode = HW_ENCRY_SW_DECRY; - } else { - if (Adapter->registrypriv.software_decrypt == _FALSE) - encry_mode = SW_ENCRY_HW_DECRY; - else - encry_mode = SW_CONTROL; - } -#else - - if ((psecuritypriv->sw_encrypt == _FALSE) && (psecuritypriv->sw_decrypt == _FALSE)) - encry_mode = HW_CONTROL; - else if ((psecuritypriv->sw_encrypt == _FALSE) && (psecuritypriv->sw_decrypt == _TRUE)) - encry_mode = HW_ENCRY_SW_DECRY; - else if ((psecuritypriv->sw_encrypt == _TRUE) && (psecuritypriv->sw_decrypt == _FALSE)) - encry_mode = SW_ENCRY_HW_DECRY; - else if ((psecuritypriv->sw_encrypt == _TRUE) && (psecuritypriv->sw_decrypt == _TRUE)) - encry_mode = SW_CONTROL; - -#endif - - *(u8 *)poid_par_priv->information_buf = encry_mode; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - - } - - return status; -#else return 0; -#endif } /* ------------------------------------------------------------------------------ */ -NDIS_STATUS oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv) +NDIS_STATUS oid_rt_pro_set_data_rate_ex_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); NDIS_STATUS status = NDIS_STATUS_SUCCESS; - struct sta_info *psta = NULL; - UCHAR *macaddr; if (poid_par_priv->type_of_oid != SET_OID) return NDIS_STATUS_NOT_ACCEPTED; - *poid_par_priv->bytes_needed = ETH_ALEN; - if (poid_par_priv->information_buf_len < *poid_par_priv->bytes_needed) - return NDIS_STATUS_INVALID_LENGTH; - - macaddr = (UCHAR *) poid_par_priv->information_buf ; - - _irqlevel_changed_(&oldirql, LOWER); - psta = rtw_get_stainfo(&Adapter->stapriv, macaddr); - - if (psta == NULL) { /* the sta have been in sta_info_queue => do nothing */ - psta = rtw_alloc_stainfo(&Adapter->stapriv, macaddr); - - if (psta == NULL) { - status = NDIS_STATUS_FAILURE; - } - } + if (rtw_setdatarate_cmd(Adapter, poid_par_priv->information_buf) != _SUCCESS) + status = NDIS_STATUS_NOT_ACCEPTED; _irqlevel_changed_(&oldirql, RAISE); + return status; -#else - return 0; -#endif } -/* ------------------------------------------------------------------------------ */ -NDIS_STATUS oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv) +/* ----------------------------------------------------------------------------- */ +NDIS_STATUS oid_rt_get_thermal_meter_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - NDIS_STATUS status = NDIS_STATUS_SUCCESS; + u8 thermal = 0; + PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - struct sta_info *psta = NULL; - UCHAR *macaddr; - if (poid_par_priv->type_of_oid != SET_OID) + if (poid_par_priv->type_of_oid != QUERY_OID) return NDIS_STATUS_NOT_ACCEPTED; - *poid_par_priv->bytes_needed = ETH_ALEN; - if (poid_par_priv->information_buf_len < *poid_par_priv->bytes_needed) + if (poid_par_priv->information_buf_len < sizeof(u32)) return NDIS_STATUS_INVALID_LENGTH; - macaddr = (UCHAR *) poid_par_priv->information_buf ; + _irqlevel_changed_(&oldirql, LOWER); + GetThermalMeter(Adapter, &thermal); + _irqlevel_changed_(&oldirql, RAISE); + + *(u32 *)poid_par_priv->information_buf = (u32)thermal; + *poid_par_priv->bytes_rw = sizeof(u32); - psta = rtw_get_stainfo(&Adapter->stapriv, macaddr); - if (psta != NULL) { - /* _enter_critical(&(Adapter->stapriv.sta_hash_lock), &irqL); */ - rtw_free_stainfo(Adapter, psta); - /* _exit_critical(&(Adapter->stapriv.sta_hash_lock), &irqL); */ - } return status; -#else - return 0; -#endif } -/* ------------------------------------------------------------------------------ */ -#if 0 -static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var) +/* ----------------------------------------------------------------------------- */ +NDIS_STATUS oid_rt_pro_read_tssi_hdl(struct oid_par_priv *poid_par_priv) { -#ifdef CONFIG_SDIO_HCI - - if (offset == 1) { - u16 tmp_blk_num; - tmp_blk_num = rtw_read16(padapter, SDIO_RX0_RDYBLK_NUM); - if (adapter_to_dvobj(padapter)->rxblknum != tmp_blk_num) { - /* sd_recv_rxfifo(padapter); */ - } - } - -#if 0 - if (offset <= 100) { /* For setting data rate and query data rate */ - if (offset == 100) { /* For query data rate */ - var = padapter->registrypriv.tx_rate; - - } else if (offset < 0x1d) { /* For setting data rate */ - padapter->registrypriv.tx_rate = offset; - var = padapter->registrypriv.tx_rate; - padapter->registrypriv.use_rate = _TRUE; - } else { /* not use the data rate */ - padapter->registrypriv.use_rate = _FALSE; - } - } else if (offset <= 110) { /* for setting debug level */ - if (offset == 110) { /* For query data rate */ - padapter->registrypriv.dbg_level = GlobalDebugLevel; - var = padapter->registrypriv.dbg_level; - } else if (offset < 110 && offset > 100) { - padapter->registrypriv.dbg_level = GlobalDebugLevel = offset - 100; - var = padapter->registrypriv.dbg_level; - - } - } else if (offset > 110 && offset < 116) { - if (115 == offset) { - } else { - switch (offset) { - case 111: - adapter_to_dvobj(padapter)->tx_block_mode = 1; - adapter_to_dvobj(padapter)->rx_block_mode = 1; - break; - case 112: - adapter_to_dvobj(padapter)->tx_block_mode = 1; - adapter_to_dvobj(padapter)->rx_block_mode = 0; - break; - case 113: - adapter_to_dvobj(padapter)->tx_block_mode = 0; - adapter_to_dvobj(padapter)->rx_block_mode = 1; - break; - case 114: - adapter_to_dvobj(padapter)->tx_block_mode = 0; - adapter_to_dvobj(padapter)->rx_block_mode = 0; - break; - default: - break; - - } - - } - - } else if (offset >= 127) { - u64 prnt_dbg_comp; - u8 chg_idx; - u64 tmp_dbg_comp; - chg_idx = offset - 0x80; - tmp_dbg_comp = BIT(chg_idx); - prnt_dbg_comp = padapter->registrypriv.dbg_component = GlobalDebugComponents; - if (offset == 127) { - /* prnt_dbg_comp=padapter->registrypriv.dbg_component= GlobalDebugComponents; */ - var = (u32)(padapter->registrypriv.dbg_component); - prnt_dbg_comp = GlobalDebugComponents; - prnt_dbg_comp = GlobalDebugComponents = padapter->registrypriv.dbg_component; - - } else { - prnt_dbg_comp = GlobalDebugComponents; - prnt_dbg_comp = GlobalDebugComponents = padapter->registrypriv.dbg_component; - - if (GlobalDebugComponents & tmp_dbg_comp) { - /* this bit is already set, now clear it */ - GlobalDebugComponents = GlobalDebugComponents & (~tmp_dbg_comp); - } else { - /* this bit is not set, now set it. */ - GlobalDebugComponents = GlobalDebugComponents | tmp_dbg_comp; - } - prnt_dbg_comp = GlobalDebugComponents; - - var = (u32)(GlobalDebugComponents); - /* GlobalDebugComponents=padapter->registrypriv.dbg_component; */ - - } - } -#endif -#endif - - return var; + return 0; } -#endif - -NDIS_STATUS oid_rt_pro_query_dr_variable_hdl(struct oid_par_priv *poid_par_priv) +/* ------------------------------------------------------------------------------ */ +NDIS_STATUS oid_rt_pro_set_power_tracking_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; + NDIS_STATUS status = NDIS_STATUS_SUCCESS; + PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - DR_VARIABLE_STRUCT *pdrv_var; - if (poid_par_priv->type_of_oid != QUERY_OID) - return NDIS_STATUS_NOT_ACCEPTED; + /* if (poid_par_priv->type_of_oid != SET_OID) + * return NDIS_STATUS_NOT_ACCEPTED; */ - *poid_par_priv->bytes_needed = sizeof(DR_VARIABLE_STRUCT); - if (poid_par_priv->information_buf_len < *poid_par_priv->bytes_needed) + if (poid_par_priv->information_buf_len < sizeof(u8)) return NDIS_STATUS_INVALID_LENGTH; + _irqlevel_changed_(&oldirql, LOWER); + if (poid_par_priv->type_of_oid == SET_OID) { + u8 enable; - pdrv_var = (struct _DR_VARIABLE_STRUCT_ *)poid_par_priv->information_buf; + enable = *(u8 *)poid_par_priv->information_buf; - _irqlevel_changed_(&oldirql, LOWER); - pdrv_var->variable = mp_query_drv_var(Adapter, pdrv_var->offset, pdrv_var->variable); + SetPowerTracking(Adapter, enable); + } else + GetPowerTracking(Adapter, (u8 *)poid_par_priv->information_buf); _irqlevel_changed_(&oldirql, RAISE); - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - return status; -#else +} +/* ----------------------------------------------------------------------------- */ +NDIS_STATUS oid_rt_pro_set_basic_rate_hdl(struct oid_par_priv *poid_par_priv) +{ return 0; -#endif } /* ------------------------------------------------------------------------------ */ -NDIS_STATUS oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv) +NDIS_STATUS oid_rt_pro_qry_pwrstate_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - - if (poid_par_priv->information_buf_len < sizeof(UCHAR)) { - status = NDIS_STATUS_INVALID_LENGTH; - *poid_par_priv->bytes_needed = sizeof(UCHAR); - return status; - } - - if (poid_par_priv->type_of_oid == SET_OID) { - Adapter->mppriv.rx_with_status = *(UCHAR *) poid_par_priv->information_buf; - - - } else { - *(UCHAR *) poid_par_priv->information_buf = Adapter->mppriv.rx_with_status; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - + return 0; +} +/* ------------------------------------------------------------------------------ */ +NDIS_STATUS oid_rt_pro_set_pwrstate_hdl(struct oid_par_priv *poid_par_priv) +{ + return 0; +} +/* ------------------------------------------------------------------------------ */ +NDIS_STATUS oid_rt_pro_h2c_set_rate_table_hdl(struct oid_par_priv *poid_par_priv) +{ + return 0; +} +/* ------------------------------------------------------------------------------ */ +NDIS_STATUS oid_rt_pro_h2c_get_rate_table_hdl(struct oid_par_priv *poid_par_priv) +{ + return 0; +} - /* *(u32 *)&Adapter->eeprompriv.mac_addr[0]=rtw_read32(Adapter, 0x10250050); */ - /* *(u16 *)&Adapter->eeprompriv.mac_addr[4]=rtw_read16(Adapter, 0x10250054); */ - } -#endif +/* **************** oid_rtl_seg_87_12_00 section start **************** */ +NDIS_STATUS oid_rt_pro_encryption_ctrl_hdl(struct oid_par_priv *poid_par_priv) +{ + return 0; +} +/* ------------------------------------------------------------------------------ */ +NDIS_STATUS oid_rt_pro_add_sta_info_hdl(struct oid_par_priv *poid_par_priv) +{ + return 0; +} +/* ------------------------------------------------------------------------------ */ +NDIS_STATUS oid_rt_pro_dele_sta_info_hdl(struct oid_par_priv *poid_par_priv) +{ + return 0; +} +NDIS_STATUS oid_rt_pro_query_dr_variable_hdl(struct oid_par_priv *poid_par_priv) +{ + return 0; +} +/* ------------------------------------------------------------------------------ */ +NDIS_STATUS oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv) +{ return NDIS_STATUS_SUCCESS; } /* ------------------------------------------------------------------------------ */ @@ -2041,30 +1225,6 @@ NDIS_STATUS oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv) NDIS_STATUS oid_rt_set_crystal_cap_hdl(struct oid_par_priv *poid_par_priv) { NDIS_STATUS status = NDIS_STATUS_SUCCESS; -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - u32 crystal_cap = 0; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(u32)) - return NDIS_STATUS_INVALID_LENGTH; - - crystal_cap = *((u32 *)poid_par_priv->information_buf); /* 4 */ - if (crystal_cap > 0xf) - return NDIS_STATUS_NOT_ACCEPTED; - - Adapter->mppriv.curr_crystalcap = crystal_cap; - - _irqlevel_changed_(&oldirql, LOWER); - SetCrystalCap(Adapter); - _irqlevel_changed_(&oldirql, RAISE); - - -#endif return status; } @@ -2086,128 +1246,17 @@ NDIS_STATUS oid_rt_set_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv) rx_pkt_type = *((u8 *)poid_par_priv->information_buf); /* 4 */ -#if 0 - _irqlevel_changed_(&oldirql, LOWER); -#if 0 - rcr_val8 = rtw_read8(Adapter, 0x10250048);/* RCR */ - rcr_val8 &= ~(RCR_AB | RCR_AM | RCR_APM | RCR_AAP); - - if (rx_pkt_type == RX_PKT_BROADCAST) - rcr_val8 |= (RCR_AB | RCR_ACRC32); - else if (rx_pkt_type == RX_PKT_DEST_ADDR) - rcr_val8 |= (RCR_AAP | RCR_AM | RCR_ACRC32); - else if (rx_pkt_type == RX_PKT_PHY_MATCH) - rcr_val8 |= (RCR_APM | RCR_ACRC32); - else - rcr_val8 &= ~(RCR_AAP | RCR_APM | RCR_AM | RCR_AB | RCR_ACRC32); - rtw_write8(padapter, 0x10250048, rcr_val8); -#else - rcr_val32 = rtw_read32(padapter, RCR);/* RCR = 0x10250048 */ - rcr_val32 &= ~(RCR_CBSSID | RCR_AB | RCR_AM | RCR_APM | RCR_AAP); -#if 0 - if (rx_pkt_type == RX_PKT_BROADCAST) - rcr_val32 |= (RCR_AB | RCR_AM | RCR_APM | RCR_AAP | RCR_ACRC32); - else if (rx_pkt_type == RX_PKT_DEST_ADDR) { - /* rcr_val32 |= (RCR_CBSSID|RCR_AAP|RCR_AM|RCR_ACRC32); */ - rcr_val32 |= (RCR_CBSSID | RCR_APM | RCR_ACRC32); - } else if (rx_pkt_type == RX_PKT_PHY_MATCH) { - rcr_val32 |= (RCR_APM | RCR_ACRC32); - /* rcr_val32 |= (RCR_AAP|RCR_ACRC32); */ - } else - rcr_val32 &= ~(RCR_AAP | RCR_APM | RCR_AM | RCR_AB | RCR_ACRC32); -#else - switch (rx_pkt_type) { - case RX_PKT_BROADCAST: - rcr_val32 |= (RCR_AB | RCR_AM | RCR_APM | RCR_AAP | RCR_ACRC32); - break; - case RX_PKT_DEST_ADDR: - rcr_val32 |= (RCR_AB | RCR_AM | RCR_APM | RCR_AAP | RCR_ACRC32); - break; - case RX_PKT_PHY_MATCH: - rcr_val32 |= (RCR_APM | RCR_ACRC32); - break; - default: - rcr_val32 &= ~(RCR_AAP | RCR_APM | RCR_AM | RCR_AB | RCR_ACRC32); - break; - } - - if (rx_pkt_type == RX_PKT_DEST_ADDR) - padapter->mppriv.check_mp_pkt = 1; - else - padapter->mppriv.check_mp_pkt = 0; -#endif - rtw_write32(padapter, RCR, rcr_val32); - -#endif - _irqlevel_changed_(&oldirql, RAISE); -#endif - return status; } NDIS_STATUS oid_rt_pro_set_tx_agc_offset_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - u32 txagc; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(u32)) - return NDIS_STATUS_INVALID_LENGTH; - - txagc = *(u32 *)poid_par_priv->information_buf; - - _irqlevel_changed_(&oldirql, LOWER); - SetTxAGCOffset(Adapter, txagc); - _irqlevel_changed_(&oldirql, RAISE); - - - return status; -#else return 0; -#endif } NDIS_STATUS oid_rt_pro_set_pkt_test_mode_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - - struct mlme_priv *pmlmepriv = &Adapter->mlmepriv; - struct mp_priv *pmppriv = &Adapter->mppriv; - u32 type; - - - if (poid_par_priv->type_of_oid != SET_OID) - return NDIS_STATUS_NOT_ACCEPTED; - - if (poid_par_priv->information_buf_len < sizeof(u32)) - return NDIS_STATUS_INVALID_LENGTH; - - type = *(u32 *)poid_par_priv->information_buf; - - if (_LOOPBOOK_MODE_ == type) { - pmppriv->mode = type; - set_fwstate(pmlmepriv, WIFI_MP_LPBK_STATE); /* append txdesc */ - } else if (_2MAC_MODE_ == type) { - pmppriv->mode = type; - _clr_fwstate_(pmlmepriv, WIFI_MP_LPBK_STATE); - } else - status = NDIS_STATUS_NOT_ACCEPTED; - - - return status; -#else return 0; -#endif } unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) @@ -2243,97 +1292,14 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) return NDIS_STATUS_SUCCESS; } -#if 0 -unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv) -{ - unsigned char *pframe, *pmp_pkt; - struct ethhdr *pethhdr; - struct pkt_attrib *pattrib; - struct ieee80211_hdr *pwlanhdr; - unsigned short *fctrl; - int llc_sz, payload_len; - struct mp_xmit_frame *pxframe = NULL; - struct mp_xmit_packet *pmp_xmitpkt = (struct mp_xmit_packet *)param; - u8 addr3[] = {0x02, 0xE0, 0x4C, 0x87, 0x66, 0x55}; - - /* RTW_INFO("+mp_ioctl_xmit_packet_hdl\n"); */ - - pxframe = alloc_mp_xmitframe(&padapter->mppriv); - if (pxframe == NULL) { - DEBUG_ERR(("Can't alloc pmpframe %d:%s\n", __LINE__, __FILE__)); - return -1; - } - - /* mp_xmit_pkt */ - payload_len = pmp_xmitpkt->len - 14; - pmp_pkt = (unsigned char *)pmp_xmitpkt->mem; - pethhdr = (struct ethhdr *)pmp_pkt; - - /* RTW_INFO("payload_len=%d, pkt_mem=0x%x\n", pmp_xmitpkt->len, (void*)pmp_xmitpkt->mem); */ - - /* RTW_INFO("pxframe=0x%x\n", (void*)pxframe); */ - /* RTW_INFO("pxframe->mem=0x%x\n", (void*)pxframe->mem); */ - - /* update attribute */ - pattrib = &pxframe->attrib; - memset((u8 *)(pattrib), 0, sizeof(struct pkt_attrib)); - pattrib->pktlen = pmp_xmitpkt->len; - pattrib->ether_type = ntohs(pethhdr->h_proto); - pattrib->hdrlen = 24; - pattrib->nr_frags = 1; - pattrib->priority = 0; -#ifndef CONFIG_MP_LINUX - if (is_multicast_ether_addr(pethhdr->h_dest)) - pattrib->mac_id = 4; - else - pattrib->mac_id = 5; -#else - pattrib->mac_id = 5; -#endif - - /* */ - memset(pxframe->mem, 0 , WLANHDR_OFFSET); - pframe = (u8 *)(pxframe->mem) + WLANHDR_OFFSET; - - pwlanhdr = (struct ieee80211_hdr *)pframe; - - fctrl =&pwlanhdr->frame_control; - *(fctrl) = 0; - set_frame_sub_type(pframe, (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)); - - memcpy(pwlanhdr->addr1, pethhdr->h_dest, ETH_ALEN); - memcpy(pwlanhdr->addr2, pethhdr->h_source, ETH_ALEN); - - memcpy(pwlanhdr->addr3, addr3, ETH_ALEN); - - pwlanhdr->seq_ctl = 0; - pframe += pattrib->hdrlen; - - llc_sz = rtw_put_snap(pframe, pattrib->ether_type); - pframe += llc_sz; - - memcpy(pframe, (void *)(pmp_pkt + 14), payload_len); - - pattrib->last_txcmdsz = pattrib->hdrlen + llc_sz + payload_len; - - DEBUG_INFO(("issuing mp_xmit_frame, tx_len=%d, ether_type=0x%x\n", pattrib->last_txcmdsz, pattrib->ether_type)); - xmit_mp_frame(padapter, pxframe); - - return _SUCCESS; -} -#endif -/* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv) { u8 bpwrup; NDIS_STATUS status = NDIS_STATUS_SUCCESS; -#ifdef PLATFORM_LINUX #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context); #endif -#endif - if (poid_par_priv->type_of_oid != SET_OID) { status = NDIS_STATUS_NOT_ACCEPTED; @@ -2345,10 +1311,8 @@ NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv) bpwrup = *(u8 *)poid_par_priv->information_buf; /* CALL the power_down function */ -#ifdef PLATFORM_LINUX #if defined(CONFIG_RTL8712) /* Linux MP insmod unknown symbol */ dev_power_down(padapter, bpwrup); -#endif #endif _irqlevel_changed_(&oldirql, RAISE); @@ -2361,32 +1325,5 @@ NDIS_STATUS oid_rt_set_power_down_hdl(struct oid_par_priv *poid_par_priv) /* ------------------------------------------------------------------------------ */ NDIS_STATUS oid_rt_get_power_mode_hdl(struct oid_par_priv *poid_par_priv) { -#if 0 - NDIS_STATUS status = NDIS_STATUS_SUCCESS; - PADAPTER Adapter = (PADAPTER)(poid_par_priv->adapter_context); - /* #ifdef PLATFORM_OS_XP */ - /* _irqL oldirql; - * #endif */ - - - if (poid_par_priv->type_of_oid != QUERY_OID) { - status = NDIS_STATUS_NOT_ACCEPTED; - return status; - } - if (poid_par_priv->information_buf_len < sizeof(u32)) { - status = NDIS_STATUS_INVALID_LENGTH; - return status; - } - - - /* _irqlevel_changed_(&oldirql, LOWER); */ - *(int *)poid_par_priv->information_buf = Adapter->registrypriv.low_power ? POWER_LOW : POWER_NORMAL; - *poid_par_priv->bytes_rw = poid_par_priv->information_buf_len; - /* _irqlevel_changed_(&oldirql, RAISE); */ - - - return status; -#else return 0; -#endif } diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index f6cbde8b..d3e0a6af 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -331,20 +331,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 ); */ @@ -3439,23 +3425,14 @@ static int cancel_ro_ch_handler(_adapter *padapter, u8 *buf) #endif if (rtw_mi_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { - if (0) - RTW_INFO(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), ch, bw, offset); } else if (adapter_wdev_data(padapter)->p2p_enabled && pwdinfo->listen_channel) { ch = pwdinfo->listen_channel; bw = CHANNEL_WIDTH_20; offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - if (0) - RTW_INFO(FUNC_ADPT_FMT" back to listen ch - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), ch, bw, offset); } else { ch = pcfg80211_wdinfo->restore_channel; bw = CHANNEL_WIDTH_20; offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - if (0) - RTW_INFO(FUNC_ADPT_FMT" back to restore ch - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), ch, bw, offset); } set_channel_bwmode(padapter, ch, offset, bw); @@ -3497,39 +3474,6 @@ static void ro_ch_timer_process(void *FunctionContext) p2p_cancel_roch_cmd(adapter, 0, NULL, 0); } -#if 0 -static void rtw_change_p2pie_op_ch(_adapter *padapter, const u8 *frame_body, u32 len, u8 ch) -{ - u8 *ies, *p2p_ie; - u32 ies_len, p2p_ielen; - -#ifdef CONFIG_MCC_MODE - if (MCC_EN(padapter)) - return; -#endif /* CONFIG_MCC_MODE */ - - ies = (u8 *)(frame_body + _PUBLIC_ACTION_IE_OFFSET_); - ies_len = len - _PUBLIC_ACTION_IE_OFFSET_; - - p2p_ie = rtw_get_p2p_ie(ies, ies_len, NULL, &p2p_ielen); - - while (p2p_ie) { - u32 attr_contentlen = 0; - u8 *pattr = NULL; - - /* Check P2P_ATTR_OPERATING_CH */ - attr_contentlen = 0; - pattr = NULL; - pattr = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, (uint *)&attr_contentlen); - if (pattr != NULL) - *(pattr + 4) = ch; - - /* Get the next P2P IE */ - p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, ies_len - (p2p_ie - ies + p2p_ielen), NULL, &p2p_ielen); - } -} -#endif - #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT) static void rtw_change_p2pie_ch_list(_adapter *padapter, const u8 *frame_body, u32 len, u8 ch) { @@ -5303,21 +5247,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 ce77bf63..8d5ab66d 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -1483,11 +1483,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); @@ -1616,16 +1611,11 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work) #endif if (rtw_read8(padapter, 0x100) != 0xEA) { -#if 1 struct reportpwrstate_parm report; report.state = PS_STATE_S2; RTW_INFO("\n%s: FW already leave 32K!\n\n", __func__); cpwm_int_hdl(padapter, &report); -#else - RTW_INFO("\n%s: FW already leave 32K!\n\n", __func__); - cpwm_event_callback(&pwrpriv->cpwm_event); -#endif return; } @@ -2335,11 +2325,7 @@ void rtw_resume_in_workqueue(struct pwrctrl_priv *pwrpriv) rtw_resume_lock_suspend(); -#if 1 queue_work(pwrpriv->rtw_workqueue, &pwrpriv->resume_work); -#else - _set_workitem(&pwrpriv->resume_work); -#endif } #endif /* CONFIG_RESUME_IN_WORKQUEUE */ diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 5bc6501e..85085375 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -632,18 +632,6 @@ union recv_frame *decryptor(_adapter *padapter, union recv_frame *precv_frame) && prxattrib->encrypt > 0 && (psecuritypriv->busetkipkey == 1 || prxattrib->encrypt != _TKIP_) ) { -#if 0 - if ((prxstat->icv == 1) && (prxattrib->encrypt != _AES_)) { - psecuritypriv->hw_decrypted = _FALSE; - - - rtw_free_recvframe(precv_frame, &padapter->recvpriv.free_recv_queue); - - return_packet = NULL; - - } else -#endif - { DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_hw); psecuritypriv->hw_decrypted = _TRUE; @@ -656,7 +644,6 @@ union recv_frame *decryptor(_adapter *padapter, union recv_frame *precv_frame) psecuritypriv->hw_decrypted); #endif - } } else { DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_unknown); #ifdef DBG_RX_DECRYPTOR @@ -1645,13 +1632,6 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) /* RTW_INFO("handling ps-poll, q_len=%d\n", psta->sleepq_len); */ /* RTW_INFO_DUMP("handling, tim=", pstapriv->tim_bitmap, pstapriv->aid_bmp_len); */ - -#if 0 - _exit_critical_bh(&psta->sleep_q.lock, &irqL); - if (rtw_hal_xmit(padapter, pxmitframe) == _TRUE) - rtw_os_xmit_complete(padapter, pxmitframe); - _enter_critical_bh(&psta->sleep_q.lock, &irqL); -#endif rtw_hal_xmitframe_enqueue(padapter, pxmitframe); if (psta->sleepq_len == 0) { @@ -2245,20 +2225,6 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) ptdlsinfo->collect_pkt_num[ptdlsinfo->cur_channel - 1]++; #endif /* CONFIG_TDLS */ -#ifdef RTK_DMP_PLATFORM - if (0) { - RTW_INFO("++\n"); - { - int i; - for (i = 0; i < 64; i = i + 8) - RTW_INFO("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:", *(ptr + i), - *(ptr + i + 1), *(ptr + i + 2) , *(ptr + i + 3) , *(ptr + i + 4), *(ptr + i + 5), *(ptr + i + 6), *(ptr + i + 7)); - - } - RTW_INFO("--\n"); - } -#endif /* RTK_DMP_PLATFORM */ - /* add version chk */ if (ver != 0) { retval = _FAIL; @@ -2283,7 +2249,6 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) sc = (pattrib->seq_num << 4) | pattrib->frag_num; #endif -#if 1 /* Dump rx packets */ { u8 bDumpRxPkt = 0; @@ -2295,7 +2260,6 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) else if ((bDumpRxPkt == 3) && (type == IEEE80211_FTYPE_DATA)) dump_rx_packet(ptr); } -#endif switch (type) { case IEEE80211_FTYPE_MGMT: /* mgnt */ DBG_COUNTER(adapter->rx_logs.core_rx_pre_mgmt); @@ -2386,7 +2350,6 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) /* remove the wlanhdr and add the eth_hdr */ -#if 1 sint wlanhdr_to_ethhdr(union recv_frame *precvframe) { sint rmv_len; @@ -2470,127 +2433,10 @@ sint wlanhdr_to_ethhdr(union recv_frame *precvframe) } -#else -static u8 SNAP_ETH_TYPE_APPLETALK_DDP[2] = {0x80, 0x9b}; -/* Datagram Delivery Protocol */ -static u8 SNAP_HDR_APPLETALK_DDP[3] = {0x08, 0x00, 0x07}; -static u8 oui_8021h[] = {0x00, 0x00, 0xf8}; -static u8 oui_rfc1042[] = {0x00, 0x00, 0x00}; - -sint wlanhdr_to_ethhdr(union recv_frame *precvframe) -{ - sint rmv_len; - u16 eth_type; - u8 bsnaphdr; - u8 *psnap_type; - struct ieee80211_snap_hdr *psnap; - - sint ret = _SUCCESS; - _adapter *adapter = precvframe->u.hdr.adapter; - struct mlme_priv *pmlmepriv = &adapter->mlmepriv; - - u8 *ptr = get_recvframe_data(precvframe) ; /* point to frame_ctrl field */ - struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib; - struct _vlan *pvlan = NULL; - - - psnap = (struct ieee80211_snap_hdr *)(ptr + pattrib->hdrlen + pattrib->iv_len); - psnap_type = ptr + pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE; - if (psnap->dsap == 0xaa && psnap->ssap == 0xaa && psnap->ctrl == 0x03) { - if (_rtw_memcmp(psnap->oui, oui_rfc1042, WLAN_IEEE_OUI_LEN)) - bsnaphdr = _TRUE; /* wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_RFC1042; */ - else if (_rtw_memcmp(psnap->oui, SNAP_HDR_APPLETALK_DDP, WLAN_IEEE_OUI_LEN) && - _rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_DDP, 2)) - bsnaphdr = _TRUE; /* wlan_pkt_format = WLAN_PKT_FORMAT_APPLETALK; */ - else if (_rtw_memcmp(psnap->oui, oui_8021h, WLAN_IEEE_OUI_LEN)) - bsnaphdr = _TRUE; /* wlan_pkt_format = WLAN_PKT_FORMAT_SNAP_TUNNEL; */ - else { - ret = _FAIL; - goto exit; - } - - } else - bsnaphdr = _FALSE; /* wlan_pkt_format = WLAN_PKT_FORMAT_OTHERS; */ - - rmv_len = pattrib->hdrlen + pattrib->iv_len + (bsnaphdr ? SNAP_SIZE : 0); - - if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == _TRUE) { - ptr += rmv_len ; - *ptr = 0x87; - *(ptr + 1) = 0x12; - - /* back to original pointer */ - ptr -= rmv_len; - } - - ptr += rmv_len ; - - memcpy(ð_type, ptr, 2); - eth_type = ntohs((unsigned short)eth_type); /* pattrib->ether_type */ - ptr += 2; - - if (pattrib->encrypt) - recvframe_pull_tail(precvframe, pattrib->icv_len); - - if (eth_type == 0x8100) { /* vlan */ - pvlan = (struct _vlan *) ptr; - - /* eth_type = get_vlan_encap_proto(pvlan); */ - /* eth_type = pvlan->h_vlan_encapsulated_proto; */ /* ? */ - rmv_len += 4; - ptr += 4; - } - - if (eth_type == 0x0800) { /* ip */ - /* struct iphdr* piphdr = (struct iphdr*) ptr; */ - /* __u8 tos = (unsigned char)(pattrib->priority & 0xff); */ - - /* piphdr->tos = tos; */ - - } else if (eth_type == 0x8712) { /* append rx status for mp test packets */ - /* ptr -= 16; */ - /* memcpy(ptr, get_rxmem(precvframe), 16); */ - } else { -#ifdef PLATFORM_OS_XP - NDIS_PACKET_8021Q_INFO VlanPriInfo; - UINT32 UserPriority = precvframe->u.hdr.attrib.priority; - UINT32 VlanID = (pvlan != NULL ? get_vlan_id(pvlan) : 0); - - VlanPriInfo.Value = /* Get current value. */ - NDIS_PER_PACKET_INFO_FROM_PACKET(precvframe->u.hdr.pkt, Ieee8021QInfo); - - VlanPriInfo.TagHeader.UserPriority = UserPriority; - VlanPriInfo.TagHeader.VlanId = VlanID ; - - VlanPriInfo.TagHeader.CanonicalFormatId = 0; /* Should be zero. */ - VlanPriInfo.TagHeader.Reserved = 0; /* Should be zero. */ - NDIS_PER_PACKET_INFO_FROM_PACKET(precvframe->u.hdr.pkt, Ieee8021QInfo) = VlanPriInfo.Value; -#endif - } - - if (eth_type == 0x8712) { /* append rx status for mp test packets */ - ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + 2) - 24); - memcpy(ptr, get_rxmem(precvframe), 24); - ptr += 24; - } else - ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + 2)); - memcpy(ptr, pattrib->dst, ETH_ALEN); - memcpy(ptr + ETH_ALEN, pattrib->src, ETH_ALEN); - - eth_type = htons((unsigned short)eth_type) ; - memcpy(ptr + 12, ð_type, 2); - -exit: - - - return ret; -} -#endif #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -#ifdef PLATFORM_LINUX static void recvframe_expand_pkt( PADAPTER padapter, union recv_frame *prframe) @@ -2643,9 +2489,6 @@ static void recvframe_expand_pkt( pfhdr->rx_tail = skb_tail_pointer(ppkt); pfhdr->rx_end = skb_end_pointer(ppkt); } -#else -#warning "recvframe_expand_pkt not implement, defrag may crash system" -#endif #endif /* perform defrag */ @@ -3383,12 +3226,6 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct phead = get_list_head(ppending_recvframe_queue); plist = get_next(phead); -#if 0 - /* Check if there is any other indication thread running. */ - if (pTS->RxIndicateState == RXTS_INDICATE_PROCESSING) - return; -#endif - /* Handling some condition for forced indicate case. */ if (bforced == _TRUE) { precvpriv->dbg_rx_ampdu_forced_indicate_count++; @@ -3418,15 +3255,6 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { -#if 0 - /* This protect buffer from overflow. */ - if (index >= REORDER_WIN_SIZE) { - RT_ASSERT(FALSE, ("IndicateRxReorderList(): Buffer overflow!!\n")); - bPktInBuf = TRUE; - break; - } -#endif - plist = get_next(plist); rtw_list_delete(&(prframe->u.hdr.list)); @@ -3438,18 +3266,6 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct #endif } -#if 0 - index++; - if (index == 1) { - /* Cancel previous pending timer. */ - /* PlatformCancelTimer(Adapter, &pTS->RxPktPendingTimer); */ - if (bforced != _TRUE) { - /* RTW_INFO("_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);\n"); */ - _cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer); - } - } -#endif - /* Set this as a lock to make sure that only one thread is indicating packet. */ /* pTS->RxIndicateState = RXTS_INDICATE_PROCESSING; */ @@ -3477,18 +3293,6 @@ static int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ct /* _rtw_spinunlock_ex(&ppending_recvframe_queue->lock); */ /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ -#if 0 - /* Release the indication lock and set to new indication step. */ - if (bPktInBuf) { - /* Set new pending timer. */ - /* pTS->RxIndicateState = RXTS_INDICATE_REORDER; */ - /* PlatformSetTimer(Adapter, &pTS->RxPktPendingTimer, pHTInfo->RxReorderPendingTime); */ - - _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); - } else { - /* pTS->RxIndicateState = RXTS_INDICATE_IDLE; */ - } -#endif /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ /* return _TRUE; */ @@ -3523,15 +3327,8 @@ static int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prfram RTW_INFO("DBG_RX_DROP_FRAME "FUNC_ADPT_FMT" check_indicate_seq fail\n" , FUNC_ADPT_ARG(padapter)); #endif -#if 0 - rtw_recv_indicatepkt(padapter, prframe); - - _exit_critical_bh(&ppending_recvframe_queue->lock, &irql); - goto _success_exit; -#else goto _err_exit; -#endif } @@ -3655,24 +3452,6 @@ int validate_mp_recv_frame(_adapter *adapter, union recv_frame *precv_frame) pmptx = &pmppriv->tx; -#if 0 - if (1) { - u8 bDumpRxPkt; - type = GetFrameType(ptr); - subtype = get_frame_sub_type(ptr); /* bit(7)~bit(2) */ - - rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt)); - if (bDumpRxPkt == 1) { /* dump all rx packets */ - int i; - RTW_INFO("############ type:0x%02x subtype:0x%02x #################\n", type, subtype); - - for (i = 0; i < 64; i = i + 8) - RTW_INFO("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr + i), - *(ptr + i + 1), *(ptr + i + 2) , *(ptr + i + 3) , *(ptr + i + 4), *(ptr + i + 5), *(ptr + i + 6), *(ptr + i + 7)); - RTW_INFO("#############################\n"); - } - } -#endif if (pmppriv->bloopback) { if (_rtw_memcmp(ptr + 24, pmptx->buf + 24, precv_frame->u.hdr.len - 24) == _FALSE) { RTW_INFO("Compare payload content Fail !!!\n"); @@ -3915,36 +3694,6 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, { #define CHAN2FREQ(a) ((a < 14) ? (2407+5*a) : (5000+5*a)) -#if 0 -#define RTW_RX_RADIOTAP_PRESENT (\ - (1 << IEEE80211_RADIOTAP_TSFT) | \ - (1 << IEEE80211_RADIOTAP_FLAGS) | \ - (1 << IEEE80211_RADIOTAP_RATE) | \ - (1 << IEEE80211_RADIOTAP_CHANNEL) | \ - (0 << IEEE80211_RADIOTAP_FHSS) | \ - (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ - (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \ - (0 << IEEE80211_RADIOTAP_LOCK_QUALITY) | \ - (0 << IEEE80211_RADIOTAP_TX_ATTENUATION) | \ - (0 << IEEE80211_RADIOTAP_DB_TX_ATTENUATION) | \ - (0 << IEEE80211_RADIOTAP_DBM_TX_POWER) | \ - (1 << IEEE80211_RADIOTAP_ANTENNA) | \ - (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \ - (0 << IEEE80211_RADIOTAP_DB_ANTNOISE) | \ - (0 << IEEE80211_RADIOTAP_RX_FLAGS) | \ - (0 << IEEE80211_RADIOTAP_TX_FLAGS) | \ - (0 << IEEE80211_RADIOTAP_RTS_RETRIES) | \ - (0 << IEEE80211_RADIOTAP_DATA_RETRIES) | \ - (0 << IEEE80211_RADIOTAP_MCS) | \ - (0 << IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE)| \ - (0 << IEEE80211_RADIOTAP_VENDOR_NAMESPACE) | \ - (0 << IEEE80211_RADIOTAP_EXT) | \ - 0) - - /* (0 << IEEE80211_RADIOTAP_AMPDU_STATUS) | \ */ - /* (0 << IEEE80211_RADIOTAP_VHT) | \ */ -#endif - #ifndef IEEE80211_RADIOTAP_RX_FLAGS #define IEEE80211_RADIOTAP_RX_FLAGS 14 #endif @@ -4002,11 +3751,6 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, /* flags */ rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_FLAGS); - if (0) - hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_CFP; - - if (0) - hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_SHORTPRE; if ((pattrib->encrypt == 1) || (pattrib->encrypt == 5)) hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_WEP; @@ -4017,10 +3761,6 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, /* always append FCS */ hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_FCS; - - if (0) - hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_DATAPAD; - if (pattrib->crc_err) hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_BADFCS; @@ -4076,18 +3816,6 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, hdr_buf[rt_len] = pattrib->phy_info.recv_signal_power; rt_len += 1; -#if 0 - /* dBm Antenna Noise */ - rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE); - hdr_buf[rt_len] = 0; - rt_len += 1; - - /* Signal Quality */ - rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_LOCK_QUALITY); - hdr_buf[rt_len] = pattrib->phy_info.signal_quality; - rt_len += 1; -#endif - /* Antenna */ rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_ANTENNA); hdr_buf[rt_len] = 0; /* pHalData->rf_type; */ @@ -4095,10 +3823,7 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, /* RX flags */ rtap_hdr->it_present |= (1 << IEEE80211_RADIOTAP_RX_FLAGS); -#if 0 - tmp_16bit = cpu_to_le16(0); - memcpy(ptr, &tmp_16bit, 1); -#endif + rt_len += 2; /* MCS information */ @@ -4330,21 +4055,6 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) RTW_INFO("%s =>"ADPT_FMT" Rx BC/MC from "MAC_FMT"\n", __func__, ADPT_ARG(padapter), MAC_ARG(pattrib->ta)); #endif -#if 0 - if (is_primary_adapter(padapter)) { - RTW_INFO("+++\n"); - { - int i; - u8 *ptr = get_recvframe_data(prframe); - for (i = 0; i < 140; i = i + 8) - RTW_INFO("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:", *(ptr + i), - *(ptr + i + 1), *(ptr + i + 2) , *(ptr + i + 3) , *(ptr + i + 4), *(ptr + i + 5), *(ptr + i + 6), *(ptr + i + 7)); - - } - RTW_INFO("---\n"); - } -#endif - #ifdef CONFIG_TDLS /* check TDLS frame */ psnap_type = get_recvframe_data(orig_prframe) + pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE; @@ -4777,22 +4487,6 @@ void rx_query_phy_status( if (_rtw_memcmp(adapter_mac_addr(padapter), ta, ETH_ALEN) == _TRUE) { static systime start_time = 0; -#if 0 /*For debug */ - if (IsFrameTypeCtrl(wlanhdr)) { - RTW_INFO("-->Control frame: Y\n"); - RTW_INFO("-->pkt_len: %d\n", pattrib->pkt_len); - RTW_INFO("-->Sub Type = 0x%X\n", get_frame_sub_type(wlanhdr)); - } - - /* Dump first 40 bytes of header */ - int i = 0; - - for (i = 0; i < 40; i++) - RTW_INFO("%d: %X\n", i, *((u8 *)wlanhdr + i)); - - RTW_INFO("\n"); -#endif - if ((start_time == 0) || (rtw_get_passing_time_ms(start_time) > 5000)) { RTW_PRINT("Warning!!! %s: Confilc mac addr!!\n", __func__); start_time = jiffies; @@ -4962,11 +4656,9 @@ thread_return rtw_recv_thread(thread_context context) struct recv_priv *recvpriv = &adapter->recvpriv; s32 err = _SUCCESS; #ifdef RTW_RECV_THREAD_HIGH_PRIORITY -#ifdef PLATFORM_LINUX struct sched_param param = { .sched_priority = 1 }; sched_setscheduler(current, SCHED_FIFO, ¶m); -#endif /* PLATFORM_LINUX */ #endif /*RTW_RECV_THREAD_HIGH_PRIORITY*/ thread_enter("RTW_RECV_THREAD"); diff --git a/core/rtw_rf.c b/core/rtw_rf.c index 00b840f6..e1f84b10 100644 --- a/core/rtw_rf.c +++ b/core/rtw_rf.c @@ -1105,12 +1105,6 @@ void rtw_txpwr_lmt_add_with_nlen(struct rf_ctl_t *rfctl, const char *regd_name, ent->lmt_5g[bw][tlrs - 1][ch_idx][ntx_idx] = lmt; #endif - if (0) - RTW_PRINT("%s, %4s, %6s, %7s, %uT, ch%3d = %d\n" - , regd_name, band_str(band), ch_width_str(bw), txpwr_lmt_rs_str(tlrs), ntx_idx + 1 - , band == BAND_ON_2_4G ? ch_idx + 1 : center_ch_5g_all[ch_idx] - , lmt); - release_lock: _exit_critical_mutex(&rfctl->txpwr_lmt_mutex, &irqL); diff --git a/core/rtw_rm.c b/core/rtw_rm.c index 31d9c3f1..21b39714 100644 --- a/core/rtw_rm.c +++ b/core/rtw_rm.c @@ -292,17 +292,6 @@ u8 rm_add_nb_req(_adapter *padapter, struct sta_info *psta) prm->q.action_code = RM_ACT_NB_REP_REQ; - #if 0 - if (pmac) { /* find sta_info according to bssid */ - pmac += 4; /* skip mac= */ - if (hwaddr_parse(pmac, bssid) == NULL) { - sprintf(pstr(s), "Err: \nincorrect mac format\n"); - return _FAIL; - } - psta = rm_get_sta(padapter, 0xff, bssid); - } - #endif - /* enquee rmobj */ rm_enqueue_rmobj(padapter, prm, _FALSE); @@ -767,19 +756,6 @@ int rm_recv_radio_mens_req(_adapter *padapter, u8 *pmeas_body = &pdiag_body[5]; u8 rmid, update = 0; - -#if 0 - /* search existing rm_obj */ - rmid = psta->cmn.aid << 16 - | pdiag_body[2] << 8 - | RM_SLAVE; - - prm = rm_get_rmobj(padapter, rmid); - if (prm) { - RTW_INFO("RM: Found an exist meas rmid=%u\n", rmid); - update = 1; - } else -#endif prm = rm_alloc_rmobj(padapter); if (prm == NULL) { @@ -2180,12 +2156,9 @@ static int rm_dbg_modify_meas(_adapter *padapter, char *s) if (psta) { prm->psta = psta; -#if 0 - prm->q.diag_token = psta->rm_diag_token++; -#else /* TODO dialog should base on sta_info */ prm->q.diag_token = pmlmeinfo->dialogToken++; -#endif + prm->rmid = psta->cmn.aid << 16 | prm->q.diag_token << 8 | RM_MASTER; diff --git a/core/rtw_rson.c b/core/rtw_rson.c index 713aca6e..abfd01ae 100644 --- a/core/rtw_rson.c +++ b/core/rtw_rson.c @@ -355,28 +355,6 @@ int rtw_rson_isupdate_roamcan(struct mlme_priv *mlme if (cand_score < comp_score) return _TRUE; -#if 0 /* Handle 11R protocol */ -#ifdef CONFIG_RTW_80211R - if (rtw_chk_ft_flags(adapter, RTW_FT_SUPPORTED)) { - ptmp = rtw_get_ie(&competitor->network.IEs[12], _MDIE_, &mdie_len, competitor->network.IELength-12); - if (ptmp) { - if (!_rtw_memcmp(&pftpriv->mdid, ptmp+2, 2)) - goto exit; - - /*The candidate don't support over-the-DS*/ - if (rtw_chk_ft_flags(adapter, RTW_FT_STA_OVER_DS_SUPPORTED)) { - if ((rtw_chk_ft_flags(adapter, RTW_FT_OVER_DS_SUPPORTED) && !(*(ptmp+4) & 0x01)) || - (!rtw_chk_ft_flags(adapter, RTW_FT_OVER_DS_SUPPORTED) && (*(ptmp+4) & 0x01))) { - RTW_INFO("FT: ignore the candidate(" MAC_FMT ") for over-the-DS\n", MAC_ARG(competitor->network.MacAddress)); - rtw_clr_ft_flags(adapter, RTW_FT_OVER_DS_SUPPORTED); - goto exit; - } - } - } else - goto exit; - } -#endif -#endif return _FALSE; } diff --git a/core/rtw_security.c b/core/rtw_security.c index e209f7b1..ecb0de0f 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -1997,28 +1997,6 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe) prwskey = &stainfo->dot118021x_UncstKey.skey[0]; length = ((union recv_frame *)precvframe)->u.hdr.len - prxattrib->hdrlen - prxattrib->iv_len; -#if 0 - /* add for CONFIG_IEEE80211W, debug */ - if (0) - printk("@@@@@@@@@@@@@@@@@@ length=%d, prxattrib->hdrlen=%d, prxattrib->pkt_len=%d\n" - , length, prxattrib->hdrlen, prxattrib->pkt_len); - if (0) { - int no; - /* test print PSK */ - printk("PSK key below:\n"); - for (no = 0; no < 16; no++) - printk(" %02x ", prwskey[no]); - printk("\n"); - } - if (0) { - int no; - /* test print PSK */ - printk("frame:\n"); - for (no = 0; no < prxattrib->pkt_len; no++) - printk(" %02x ", pframe[no]); - printk("\n"); - } -#endif res = aes_decipher(prwskey, prxattrib->hdrlen, pframe, length); @@ -2095,27 +2073,6 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen if (omac1_aes_128(key, BIP_AAD, ori_len, mic)) goto BIP_exit; -#if 0 - /* management packet content */ - { - int pp; - RTW_INFO("pkt: "); - for (pp = 0; pp < flen; pp++) - printk(" %02x ", whdr_pos[pp]); - RTW_INFO("\n"); - /* BIP AAD + management frame body + MME(MIC is zero) */ - RTW_INFO("AAD+PKT: "); - for (pp = 0; pp < ori_len; pp++) - RTW_INFO(" %02x ", BIP_AAD[pp]); - RTW_INFO("\n"); - /* show the MIC result */ - RTW_INFO("mic: "); - for (pp = 0; pp < 16; pp++) - RTW_INFO(" %02x ", mic[pp]); - RTW_INFO("\n"); - } -#endif - /* MIC field should be last 8 bytes of packet (packet without FCS) */ if (_rtw_memcmp(mic, whdr_pos + flen - 8, 8)) { *ipn = pkt_ipn; @@ -2974,11 +2931,8 @@ int aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, os_memcpy(counter, nonce, AES_BLOCK_SIZE); while (left > 0) { - #if 0 - aes_encrypt(ctx, counter, buf); - #else + aes_128_encrypt(ctx, counter, buf); - #endif len = (left < AES_BLOCK_SIZE) ? left : AES_BLOCK_SIZE; for (j = 0; j < len; j++) diff --git a/core/rtw_sreset.c b/core/rtw_sreset.c index 18231487..6a49f146 100644 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -226,7 +226,7 @@ void sreset_stop_adapter(_adapter *padapter) rtw_cancel_all_timer(padapter); /* TODO: OS and HCI independent */ -#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI) +#ifdef CONFIG_USB_HCI tasklet_kill(&pxmitpriv->xmit_tasklet); #endif @@ -254,7 +254,7 @@ void sreset_start_adapter(_adapter *padapter) sreset_restore_network_status(padapter); /* TODO: OS and HCI independent */ -#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI) +#ifdef CONFIG_USB_HCI tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); #endif diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 948a5433..c133a0c6 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -191,14 +191,6 @@ void rtw_enable_tdls_func(_adapter *padapter) if (rtw_is_tdls_enabled(padapter) == _TRUE) return; -#if 0 -#ifdef CONFIG_MCC_MODE - if (rtw_hal_check_mcc_status(padapter, MCC_STATUS_DOING_MCC) == _TRUE) { - RTW_INFO("[TDLS] MCC is running, can't enable TDLS !\n"); - return; - } -#endif -#endif rtw_set_tdls_enable(padapter, _TRUE); } @@ -359,20 +351,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->cmn.mac_id); - else - rtw_hal_macid_wakeup(padapter, psta->cmn.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); @@ -543,14 +521,7 @@ void rtw_tdls_process_vht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8 memcpy(ptdls_sta->vhtpriv.vht_cap, data, 12); -#if 0 - if (elems.vht_op_mode_notify && elems.vht_op_mode_notify_len == 1) - memcpy(&pstat->vhtpriv.vht_op_mode_notify, elems.vht_op_mode_notify, 1); - else /* for Frame without Operating Mode notify ie; default: 80M */ - pstat->vhtpriv.vht_op_mode_notify = CHANNEL_WIDTH_80; -#else ptdls_sta->vhtpriv.vht_op_mode_notify = CHANNEL_WIDTH_80; -#endif } else { ptdls_sta->flags &= ~WLAN_STA_VHT; return; @@ -2416,20 +2387,6 @@ int On_TDLS_Teardown(_adapter *padapter, union recv_frame *precv_frame, struct s } -#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 sta_info *ptdls_sta) { struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; diff --git a/core/rtw_wapi.c b/core/rtw_wapi.c index d852764e..3ec85a87 100644 --- a/core/rtw_wapi.c +++ b/core/rtw_wapi.c @@ -703,43 +703,6 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr) } else { WAPI_TRACE(WAPI_API, " %s: wapiSTAUsedList is not null\n", __FUNCTION__); -#if 0 - pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry((pWapiInfo->wapiSTAUsedList.next), RT_WAPI_STA_INFO, list); - - list_for_each_entry(pWapiStaInfo, &(pWapiInfo->wapiSTAUsedList), list) { - - RTW_INFO("MAC Addr %02x-%02x-%02x-%02x-%02x-%02x\n", MacAddr[0], MacAddr[1], MacAddr[2], MacAddr[3], MacAddr[4], MacAddr[5]); - - - RTW_INFO("peer Addr %02x-%02x-%02x-%02x-%02x-%02x\n", pWapiStaInfo->PeerMacAddr[0], pWapiStaInfo->PeerMacAddr[1], pWapiStaInfo->PeerMacAddr[2], pWapiStaInfo->PeerMacAddr[3], - pWapiStaInfo->PeerMacAddr[4], pWapiStaInfo->PeerMacAddr[5]); - - if (pWapiStaInfo == NULL) { - WAPI_TRACE(WAPI_API, " %s: pWapiStaInfo == NULL Case\n", __FUNCTION__); - return; - } - - if (pWapiStaInfo->PeerMacAddr == NULL) { - WAPI_TRACE(WAPI_API, " %s: pWapiStaInfo->PeerMacAddr == NULL Case\n", __FUNCTION__); - return; - } - - if (MacAddr == NULL) { - WAPI_TRACE(WAPI_API, " %s: MacAddr == NULL Case\n", __FUNCTION__); - return; - } - - if (_rtw_memcmp(pWapiStaInfo->PeerMacAddr, MacAddr, ETH_ALEN) == _TRUE) { - pWapiStaInfo->bAuthenticateInProgress = false; - pWapiStaInfo->bSetkeyOk = false; - memset(pWapiStaInfo->PeerMacAddr, 0, ETH_ALEN); - list_del_init(&pWapiStaInfo->list); - list_add_tail(&pWapiStaInfo->list, &pWapiInfo->wapiSTAIdleList); - break; - } - - } -#endif while (!list_empty(&(pWapiInfo->wapiSTAUsedList))) { pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAUsedList.next, RT_WAPI_STA_INFO, list); @@ -902,240 +865,6 @@ void rtw_wapi_set_key(_adapter *padapter, RT_WAPI_KEY *pWapiKey, RT_WAPI_STA_INF } -#if 0 -/* YJ,test,091013 */ -void wapi_test_set_key(struct _adapter *padapter, u8 *buf) -{ - /*Data: keyType(1) + bTxEnable(1) + bAuthenticator(1) + bUpdate(1) + PeerAddr(6) + DataKey(16) + MicKey(16) + KeyId(1)*/ - PRT_WAPI_T pWapiInfo = &padapter->wapiInfo; - PRT_WAPI_BKID pWapiBkid; - PRT_WAPI_STA_INFO pWapiSta; - u8 data[43]; - bool bTxEnable; - bool bUpdate; - bool bAuthenticator; - u8 PeerAddr[6]; - u8 WapiAEPNInitialValueSrc[16] = {0x37, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C} ; - u8 WapiASUEPNInitialValueSrc[16] = {0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C} ; - u8 WapiAEMultiCastPNInitialValueSrc[16] = {0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C, 0x36, 0x5C} ; - - WAPI_TRACE(WAPI_INIT, "===========>%s\n", __FUNCTION__); - - if (!padapter->WapiSupport) - return; - - copy_from_user(data, buf, 43); - bTxEnable = data[1]; - bAuthenticator = data[2]; - bUpdate = data[3]; - memcpy(PeerAddr, data + 4, 6); - - if (data[0] == 0x3) { - if (!list_empty(&(pWapiInfo->wapiBKIDIdleList))) { - pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDIdleList.next, RT_WAPI_BKID, list); - list_del_init(&pWapiBkid->list); - memcpy(pWapiBkid->bkid, data + 10, 16); - WAPI_DATA(WAPI_INIT, "SetKey - BKID", pWapiBkid->bkid, 16); - list_add_tail(&pWapiBkid->list, &pWapiInfo->wapiBKIDStoreList); - } - } else { - list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { - if (!memcmp(pWapiSta->PeerMacAddr, PeerAddr, 6)) { - pWapiSta->bAuthenticatorInUpdata = false; - switch (data[0]) { - case 1: /* usk */ - if (bAuthenticator) { /* authenticator */ - memcpy(pWapiSta->lastTxUnicastPN, WapiAEPNInitialValueSrc, 16); - if (!bUpdate) { /* first */ - WAPI_TRACE(WAPI_INIT, "AE fisrt set usk\n"); - pWapiSta->wapiUsk.bSet = true; - memcpy(pWapiSta->wapiUsk.dataKey, data + 10, 16); - memcpy(pWapiSta->wapiUsk.micKey, data + 26, 16); - pWapiSta->wapiUsk.keyId = *(data + 42); - pWapiSta->wapiUsk.bTxEnable = true; - WAPI_DATA(WAPI_INIT, "SetKey - AE USK Data Key", pWapiSta->wapiUsk.dataKey, 16); - WAPI_DATA(WAPI_INIT, "SetKey - AE USK Mic Key", pWapiSta->wapiUsk.micKey, 16); - } else { /* update */ - WAPI_TRACE(WAPI_INIT, "AE update usk\n"); - pWapiSta->wapiUskUpdate.bSet = true; - pWapiSta->bAuthenticatorInUpdata = true; - memcpy(pWapiSta->wapiUskUpdate.dataKey, data + 10, 16); - memcpy(pWapiSta->wapiUskUpdate.micKey, data + 26, 16); - memcpy(pWapiSta->lastRxUnicastPNBEQueue, WapiASUEPNInitialValueSrc, 16); - memcpy(pWapiSta->lastRxUnicastPNBKQueue, WapiASUEPNInitialValueSrc, 16); - memcpy(pWapiSta->lastRxUnicastPNVIQueue, WapiASUEPNInitialValueSrc, 16); - memcpy(pWapiSta->lastRxUnicastPNVOQueue, WapiASUEPNInitialValueSrc, 16); - memcpy(pWapiSta->lastRxUnicastPN, WapiASUEPNInitialValueSrc, 16); - pWapiSta->wapiUskUpdate.keyId = *(data + 42); - pWapiSta->wapiUskUpdate.bTxEnable = true; - } - } else { - if (!bUpdate) { - WAPI_TRACE(WAPI_INIT, "ASUE fisrt set usk\n"); - if (bTxEnable) { - pWapiSta->wapiUsk.bTxEnable = true; - memcpy(pWapiSta->lastTxUnicastPN, WapiASUEPNInitialValueSrc, 16); - } else { - pWapiSta->wapiUsk.bSet = true; - memcpy(pWapiSta->wapiUsk.dataKey, data + 10, 16); - memcpy(pWapiSta->wapiUsk.micKey, data + 26, 16); - pWapiSta->wapiUsk.keyId = *(data + 42); - pWapiSta->wapiUsk.bTxEnable = false; - } - } else { - WAPI_TRACE(WAPI_INIT, "ASUE update usk\n"); - if (bTxEnable) { - pWapiSta->wapiUskUpdate.bTxEnable = true; - if (pWapiSta->wapiUskUpdate.bSet) { - memcpy(pWapiSta->wapiUsk.dataKey, pWapiSta->wapiUskUpdate.dataKey, 16); - memcpy(pWapiSta->wapiUsk.micKey, pWapiSta->wapiUskUpdate.micKey, 16); - pWapiSta->wapiUsk.keyId = pWapiSta->wapiUskUpdate.keyId; - memcpy(pWapiSta->lastRxUnicastPNBEQueue, WapiASUEPNInitialValueSrc, 16); - memcpy(pWapiSta->lastRxUnicastPNBKQueue, WapiASUEPNInitialValueSrc, 16); - memcpy(pWapiSta->lastRxUnicastPNVIQueue, WapiASUEPNInitialValueSrc, 16); - memcpy(pWapiSta->lastRxUnicastPNVOQueue, WapiASUEPNInitialValueSrc, 16); - memcpy(pWapiSta->lastRxUnicastPN, WapiASUEPNInitialValueSrc, 16); - pWapiSta->wapiUskUpdate.bTxEnable = false; - pWapiSta->wapiUskUpdate.bSet = false; - } - memcpy(pWapiSta->lastTxUnicastPN, WapiASUEPNInitialValueSrc, 16); - } else { - pWapiSta->wapiUskUpdate.bSet = true; - memcpy(pWapiSta->wapiUskUpdate.dataKey, data + 10, 16); - memcpy(pWapiSta->wapiUskUpdate.micKey, data + 26, 16); - pWapiSta->wapiUskUpdate.keyId = *(data + 42); - pWapiSta->wapiUskUpdate.bTxEnable = false; - } - } - } - break; - case 2: /* msk */ - if (bAuthenticator) { /* authenticator */ - pWapiInfo->wapiTxMsk.bSet = true; - memcpy(pWapiInfo->wapiTxMsk.dataKey, data + 10, 16); - memcpy(pWapiInfo->wapiTxMsk.micKey, data + 26, 16); - pWapiInfo->wapiTxMsk.keyId = *(data + 42); - pWapiInfo->wapiTxMsk.bTxEnable = true; - memcpy(pWapiInfo->lastTxMulticastPN, WapiAEMultiCastPNInitialValueSrc, 16); - - if (!bUpdate) { /* first */ - WAPI_TRACE(WAPI_INIT, "AE fisrt set msk\n"); - if (!pWapiSta->bSetkeyOk) - pWapiSta->bSetkeyOk = true; - pWapiInfo->bFirstAuthentiateInProgress = false; - } else /* update */ - WAPI_TRACE(WAPI_INIT, "AE update msk\n"); - - WAPI_DATA(WAPI_INIT, "SetKey - AE MSK Data Key", pWapiInfo->wapiTxMsk.dataKey, 16); - WAPI_DATA(WAPI_INIT, "SetKey - AE MSK Mic Key", pWapiInfo->wapiTxMsk.micKey, 16); - } else { - if (!bUpdate) { - WAPI_TRACE(WAPI_INIT, "ASUE fisrt set msk\n"); - pWapiSta->wapiMsk.bSet = true; - memcpy(pWapiSta->wapiMsk.dataKey, data + 10, 16); - memcpy(pWapiSta->wapiMsk.micKey, data + 26, 16); - pWapiSta->wapiMsk.keyId = *(data + 42); - pWapiSta->wapiMsk.bTxEnable = false; - if (!pWapiSta->bSetkeyOk) - pWapiSta->bSetkeyOk = true; - pWapiInfo->bFirstAuthentiateInProgress = false; - WAPI_DATA(WAPI_INIT, "SetKey - ASUE MSK Data Key", pWapiSta->wapiMsk.dataKey, 16); - WAPI_DATA(WAPI_INIT, "SetKey - ASUE MSK Mic Key", pWapiSta->wapiMsk.micKey, 16); - } else { - WAPI_TRACE(WAPI_INIT, "ASUE update msk\n"); - pWapiSta->wapiMskUpdate.bSet = true; - memcpy(pWapiSta->wapiMskUpdate.dataKey, data + 10, 16); - memcpy(pWapiSta->wapiMskUpdate.micKey, data + 26, 16); - pWapiSta->wapiMskUpdate.keyId = *(data + 42); - pWapiSta->wapiMskUpdate.bTxEnable = false; - } - } - break; - default: - WAPI_TRACE(WAPI_ERR, "Unknown Flag\n"); - break; - } - } - } - } - WAPI_TRACE(WAPI_INIT, "<===========%s\n", __FUNCTION__); -} - - -void wapi_test_init(struct _adapter *padapter) -{ - u8 keybuf[100]; - u8 mac_addr[ETH_ALEN] = {0x00, 0xe0, 0x4c, 0x72, 0x04, 0x70}; - u8 UskDataKey[16] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}; - u8 UskMicKey[16] = {0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}; - u8 UskId = 0; - u8 MskDataKey[16] = {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}; - u8 MskMicKey[16] = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f}; - u8 MskId = 0; - - WAPI_TRACE(WAPI_INIT, "===========>%s\n", __FUNCTION__); - - /* Enable Wapi */ - WAPI_TRACE(WAPI_INIT, "%s: Enable wapi!!!!\n", __FUNCTION__); - padapter->wapiInfo.bWapiEnable = true; - padapter->pairwise_key_type = KEY_TYPE_SMS4; - ieee->group_key_type = KEY_TYPE_SMS4; - padapter->wapiInfo.extra_prefix_len = WAPI_EXT_LEN; - padapter->wapiInfo.extra_postfix_len = SMS4_MIC_LEN; - - /* set usk */ - WAPI_TRACE(WAPI_INIT, "%s: Set USK!!!!\n", __FUNCTION__); - memset(keybuf, 0, 100); - keybuf[0] = 1; /* set usk */ - keybuf[1] = 1; /* enable tx */ - keybuf[2] = 1; /* AE */ - keybuf[3] = 0; /* not update */ - - memcpy(keybuf + 4, mac_addr, ETH_ALEN); - memcpy(keybuf + 10, UskDataKey, 16); - memcpy(keybuf + 26, UskMicKey, 16); - keybuf[42] = UskId; - wapi_test_set_key(padapter, keybuf); - - memset(keybuf, 0, 100); - keybuf[0] = 1; /* set usk */ - keybuf[1] = 1; /* enable tx */ - keybuf[2] = 0; /* AE */ - keybuf[3] = 0; /* not update */ - - memcpy(keybuf + 4, mac_addr, ETH_ALEN); - memcpy(keybuf + 10, UskDataKey, 16); - memcpy(keybuf + 26, UskMicKey, 16); - keybuf[42] = UskId; - wapi_test_set_key(padapter, keybuf); - - /* set msk */ - WAPI_TRACE(WAPI_INIT, "%s: Set MSK!!!!\n", __FUNCTION__); - memset(keybuf, 0, 100); - keybuf[0] = 2; /* set msk */ - keybuf[1] = 1; /* Enable TX */ - keybuf[2] = 1; /* AE */ - keybuf[3] = 0; /* not update */ - memcpy(keybuf + 4, mac_addr, ETH_ALEN); - memcpy(keybuf + 10, MskDataKey, 16); - memcpy(keybuf + 26, MskMicKey, 16); - keybuf[42] = MskId; - wapi_test_set_key(padapter, keybuf); - - memset(keybuf, 0, 100); - keybuf[0] = 2; /* set msk */ - keybuf[1] = 1; /* Enable TX */ - keybuf[2] = 0; /* AE */ - keybuf[3] = 0; /* not update */ - memcpy(keybuf + 4, mac_addr, ETH_ALEN); - memcpy(keybuf + 10, MskDataKey, 16); - memcpy(keybuf + 26, MskMicKey, 16); - keybuf[42] = MskId; - wapi_test_set_key(padapter, keybuf); - WAPI_TRACE(WAPI_INIT, "<===========%s\n", __FUNCTION__); -} -#endif - void rtw_wapi_get_iv(_adapter *padapter, u8 *pRA, u8 *IV) { PWLAN_HEADER_WAPI_EXTENSION pWapiExt = NULL; diff --git a/core/rtw_wapi_sms4.c b/core/rtw_wapi_sms4.c index 1cb251c7..cc23ca6d 100644 --- a/core/rtw_wapi_sms4.c +++ b/core/rtw_wapi_sms4.c @@ -281,76 +281,6 @@ void WapiSMS4CalculateMic(u8 *Key, u8 *IV, u8 *Input1, u8 Input1Length, *OutputLength = 16; } -void SecCalculateMicSMS4( - u8 KeyIdx, - u8 *MicKey, - u8 *pHeader, - u8 *pData, - u16 DataLen, - u8 *MicBuffer -) -{ -#if 0 - struct ieee80211_hdr_3addr_qos *header; - u8 TempBuf[34], TempLen = 32, MicLen, QosOffset, *IV; - u16 *pTemp, fc; - - WAPI_TRACE(WAPI_TX | WAPI_RX, "=========>%s\n", __FUNCTION__); - - header = (struct ieee80211_hdr_3addr_qos *)pHeader; - memset(TempBuf, 0, 34); - memcpy(TempBuf, pHeader, 2); /* FrameCtrl */ - pTemp = (u16 *)TempBuf; - *pTemp &= 0xc78f; /* bit4,5,6,11,12,13 */ - - memcpy((TempBuf + 2), (pHeader + 4), 12); /* Addr1, Addr2 */ - memcpy((TempBuf + 14), (pHeader + 22), 2); /* SeqCtrl */ - pTemp = (u16 *)(TempBuf + 14); - *pTemp &= 0x000f; - - memcpy((TempBuf + 16), (pHeader + 16), 6); /* Addr3 */ - - fc = le16_to_cpu(header->frame_control); - - - - if (GetFrDs((u16 *)&fc) && GetToDs((u16 *)&fc)) { - memcpy((TempBuf + 22), (pHeader + 24), 6); - QosOffset = 30; - } else { - memset((TempBuf + 22), 0, 6); - QosOffset = 24; - } - - if ((fc & 0x0088) == 0x0088) { - memcpy((TempBuf + 28), (pHeader + QosOffset), 2); - TempLen += 2; - /* IV = pHeader + QosOffset + 2 + SNAP_SIZE + sizeof(u16) + 2; */ - IV = pHeader + QosOffset + 2 + 2; - } else { - IV = pHeader + QosOffset + 2; - /* IV = pHeader + QosOffset + SNAP_SIZE + sizeof(u16) + 2; */ - } - - TempBuf[TempLen - 1] = (u8)(DataLen & 0xff); - TempBuf[TempLen - 2] = (u8)((DataLen & 0xff00) >> 8); - TempBuf[TempLen - 4] = KeyIdx; - - WAPI_DATA(WAPI_TX, "CalculateMic - KEY", MicKey, 16); - WAPI_DATA(WAPI_TX, "CalculateMic - IV", IV, 16); - WAPI_DATA(WAPI_TX, "CalculateMic - TempBuf", TempBuf, TempLen); - WAPI_DATA(WAPI_TX, "CalculateMic - pData", pData, DataLen); - - WapiSMS4CalculateMic(MicKey, IV, TempBuf, TempLen, - pData, DataLen, MicBuffer, &MicLen); - - if (MicLen != 16) - WAPI_TRACE(WAPI_ERR, "%s: MIC Length Error!!\n", __FUNCTION__); - - WAPI_TRACE(WAPI_TX | WAPI_RX, "<=========%s\n", __FUNCTION__); -#endif -} - /* AddCount: 1 or 2. * If overflow, return 1, * else return 0. @@ -452,47 +382,6 @@ void WapiSetLastRxUnicastPNForQoSData( WAPI_TRACE(WAPI_RX, "<=========== %s\n", __FUNCTION__); } - -/**************************************************************************** - FALSE not RX-Reorder - TRUE do RX Reorder -add to support WAPI to N-mode -*****************************************************************************/ -u8 WapiCheckPnInSwDecrypt( - _adapter *padapter, - struct sk_buff *pskb -) -{ - u8 ret = false; - -#if 0 - struct ieee80211_hdr_3addr_qos *header; - u16 fc; - u8 *pDaddr, *pTaddr, *pRaddr; - - header = (struct ieee80211_hdr_3addr_qos *)pskb->data; - pTaddr = header->addr2; - pRaddr = header->addr1; - fc = le16_to_cpu(header->frame_control); - - if (GetToDs(&fc)) - pDaddr = header->addr3; - else - pDaddr = header->addr1; - - if ((_rtw_memcmp(pRaddr, padapter->pnetdev->dev_addr, ETH_ALEN) == 0) - && !(pDaddr) - && (GetFrameType(&fc) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA))) - /* && ieee->pHTInfo->bCurrentHTSupport && */ - /* ieee->pHTInfo->bCurRxReorderEnable) */ - ret = false; - else - ret = true; -#endif - WAPI_TRACE(WAPI_RX, "%s: return %d\n", __FUNCTION__, ret); - return ret; -} - int SecSMS4HeaderFillIV(_adapter *padapter, u8 *pxmitframe) { struct pkt_attrib *pattrib = &((struct xmit_frame *)pxmitframe)->attrib; @@ -507,81 +396,6 @@ int SecSMS4HeaderFillIV(_adapter *padapter, u8 *pxmitframe) WAPI_TRACE(WAPI_TX, "=========>%s\n", __FUNCTION__); return ret; -#if 0 - hdr_len = sMacHdrLng; - if (GetFrameType(pskb->data) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) - hdr_len += 2; - /* hdr_len += SNAP_SIZE + sizeof(u16); */ - - pos = skb_push(pskb, padapter->wapiInfo.extra_prefix_len); - memmove(pos, pos + padapter->wapiInfo.extra_prefix_len, hdr_len); - - pSecHeader = pskb->data + hdr_len; - pWapiExt = (PWLAN_HEADER_WAPI_EXTENSION)pSecHeader; - pRA = pskb->data + 4; - - WAPI_DATA(WAPI_TX, "FillIV - Before Fill IV", pskb->data, pskb->len); - - /* Address 1 is always receiver's address */ - if (is_multicast_ether_addr(pRA)) { - if (!pWapiInfo->wapiTxMsk.bTxEnable) { - WAPI_TRACE(WAPI_ERR, "%s: bTxEnable = 0!!\n", __FUNCTION__); - return -2; - } - if (pWapiInfo->wapiTxMsk.keyId <= 1) { - pWapiExt->KeyIdx = pWapiInfo->wapiTxMsk.keyId; - pWapiExt->Reserved = 0; - bPNOverflow = WapiIncreasePN(pWapiInfo->lastTxMulticastPN, 1); - memcpy(pWapiExt->PN, pWapiInfo->lastTxMulticastPN, 16); - if (bPNOverflow) { - /* Update MSK Notification. */ - WAPI_TRACE(WAPI_ERR, "===============>%s():multicast PN overflow\n", __FUNCTION__); - rtw_wapi_app_event_handler(padapter, NULL, 0, pRA, false, false, true, 0, false); - } - } else { - WAPI_TRACE(WAPI_ERR, "%s: Invalid Wapi Multicast KeyIdx!!\n", __FUNCTION__); - ret = -3; - } - } else { - list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { - if (!memcmp(pWapiSta->PeerMacAddr, pRA, 6)) { - bFindMatchPeer = true; - break; - } - } - if (bFindMatchPeer) { - if ((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable)) { - WAPI_TRACE(WAPI_ERR, "%s: bTxEnable = 0!!\n", __FUNCTION__); - return -4; - } - if (pWapiSta->wapiUsk.keyId <= 1) { - if (pWapiSta->wapiUskUpdate.bTxEnable) - pWapiExt->KeyIdx = pWapiSta->wapiUskUpdate.keyId; - else - pWapiExt->KeyIdx = pWapiSta->wapiUsk.keyId; - - pWapiExt->Reserved = 0; - bPNOverflow = WapiIncreasePN(pWapiSta->lastTxUnicastPN, 2); - memcpy(pWapiExt->PN, pWapiSta->lastTxUnicastPN, 16); - if (bPNOverflow) { - /* Update USK Notification. */ - WAPI_TRACE(WAPI_ERR, "===============>%s():unicast PN overflow\n", __FUNCTION__); - rtw_wapi_app_event_handler(padapter, NULL, 0, pWapiSta->PeerMacAddr, false, true, false, 0, false); - } - } else { - WAPI_TRACE(WAPI_ERR, "%s: Invalid Wapi Unicast KeyIdx!!\n", __FUNCTION__); - ret = -5; - } - } else { - WAPI_TRACE(WAPI_ERR, "%s: Can not find Peer Sta "MAC_FMT"!!\n", __FUNCTION__, MAC_ARG(pRA)); - ret = -6; - } - } - - WAPI_DATA(WAPI_TX, "FillIV - After Fill IV", pskb->data, pskb->len); - WAPI_TRACE(WAPI_TX, "<=========%s\n", __FUNCTION__); - return ret; -#endif } /* WAPI SW Enc: must have done Coalesce! */ @@ -649,7 +463,6 @@ void SecSWSMS4Encryption( } SecPtr = pframe; - SecCalculateMicSMS4(KeyIdx, pMicKey, SecPtr, (SecPtr + DataOffset), pattrib->pktlen, MicBuffer); WAPI_DATA(WAPI_TX, "Encryption - MIC", MicBuffer, padapter->wapiInfo.extra_postfix_len); @@ -689,7 +502,7 @@ u8 SecSWSMS4Decryption( precv_hdr = &((union recv_frame *)precv_frame)->u.hdr; pskb = (struct sk_buff *)(precv_hdr->rx_data); - precv_hdr->bWapiCheckPNInDecrypt = WapiCheckPnInSwDecrypt(padapter, pskb); + precv_hdr->bWapiCheckPNInDecrypt = false; WAPI_TRACE(WAPI_RX, "=========>%s: check PN %d\n", __FUNCTION__, precv_hdr->bWapiCheckPNInDecrypt); WAPI_DATA(WAPI_RX, "Decryption - Before decryption", pskb->data, pskb->len); @@ -812,8 +625,6 @@ u8 SecSWSMS4Decryption( DataLen -= padapter->wapiInfo.extra_postfix_len; - SecCalculateMicSMS4(KeyIdx, pMicKey, pskb->data, pSecData, DataLen, MicBuffer); - WAPI_DATA(WAPI_RX, "Decryption - MIC received", pRecvMic, SMS4_MIC_LEN); WAPI_DATA(WAPI_RX, "Decryption - MIC calculated", MicBuffer, SMS4_MIC_LEN); diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index a6cfa900..fc9a8f9c 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -1021,13 +1021,6 @@ 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: @@ -1132,15 +1125,6 @@ s16 _rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid, s8 gk) } } - if (0) { - if (addr) - RTW_INFO(FUNC_ADPT_FMT" addr:"MAC_FMT" kid:%d, gk:%d, return cam_id:%d\n" - , FUNC_ADPT_ARG(adapter), MAC_ARG(addr), kid, gk, cam_id); - else - RTW_INFO(FUNC_ADPT_FMT" addr:%p kid:%d, gk:%d, return cam_id:%d\n" - , FUNC_ADPT_ARG(adapter), addr, kid, gk, cam_id); - } - return cam_id; } @@ -1163,11 +1147,9 @@ s16 rtw_get_camid(_adapter *adapter, u8 *addr, s16 kid, u8 gk) 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) { @@ -1243,9 +1225,8 @@ s16 rtw_camid_alloc(_adapter *adapter, struct sta_info *sta, u8 kid, u8 gk, bool u8 *addr = adapter_mac_addr(adapter); cam_id = rtw_get_camid(adapter, addr, kid, gk); - if (1) - RTW_PRINT(FUNC_ADPT_FMT" group key with "MAC_FMT" assigned cam_id:%u\n" - , FUNC_ADPT_ARG(adapter), MAC_ARG(addr), cam_id); + RTW_PRINT(FUNC_ADPT_FMT" group key with "MAC_FMT" assigned cam_id:%u\n" + , FUNC_ADPT_ARG(adapter), MAC_ARG(addr), cam_id); #endif } else { /* @@ -1314,8 +1295,7 @@ inline void rtw_sec_cam_swap(_adapter *adapter, u8 cam_id_a, u8 cam_id_b) _irqL irqL; bool cam_a_used, cam_b_used; - if (1) - RTW_INFO(ADPT_FMT" - sec_cam %d,%d swap\n", ADPT_ARG(adapter), cam_id_a, cam_id_b); + RTW_INFO(ADPT_FMT" - sec_cam %d,%d swap\n", ADPT_ARG(adapter), cam_id_a, cam_id_b); if (cam_id_a == cam_id_b) return; @@ -1423,7 +1403,6 @@ void flush_all_cam_entry(_adapter *padapter) rtw_clearstakey_cmd(padapter, psta, _FALSE); } } else if (MLME_IS_AP(padapter) || MLME_IS_MESH(padapter)) { -#if 1 int cam_id = -1; u8 *addr = adapter_mac_addr(padapter); @@ -1432,21 +1411,6 @@ void flush_all_cam_entry(_adapter *padapter) clear_cam_entry(padapter, cam_id); rtw_camid_free(padapter, cam_id); } -#else - /* clear default key */ - int i, cam_id; - u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; - - for (i = 0; i < 4; i++) { - cam_id = rtw_camid_search(padapter, null_addr, i, -1); - if (cam_id >= 0) { - clear_cam_entry(padapter, cam_id); - rtw_camid_free(padapter, cam_id); - } - } - /* clear default key related key search setting */ - rtw_hal_set_hwreg(padapter, HW_VAR_SEC_DK_CFG, (u8 *)_FALSE); -#endif } #else /*NON CONFIG_CONCURRENT_MODE*/ @@ -1511,22 +1475,6 @@ int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) 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) @@ -2097,50 +2045,6 @@ void HTOnAssocRsp(_adapter *padapter) #ifdef CONFIG_80211N_HT rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&max_AMPDU_len)); #endif /* CONFIG_80211N_HT */ -#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", __FUNCTION__); - } - - /* */ - /* Config current HT Protection mode. */ - /* */ - pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; -#endif } @@ -3368,13 +3272,6 @@ void update_wireless_mode(_adapter *padapter) #ifndef RTW_HALMAC /* HALMAC IC do not set HW_VAR_RESP_SIFS here */ -#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. */ @@ -3398,33 +3295,6 @@ 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) { if (IsSupportedTxCCK(wireless_mode)) { @@ -3509,13 +3379,6 @@ int rtw_ies_get_supported_rate(u8 *ies, uint ies_len, u8 *rate_set, u8 *rate_num if (*rate_num == 0) return _FAIL; - if (0) { - int i; - - for (i = 0; i < *rate_num; i++) - RTW_INFO("rate:0x%02x\n", *(rate_set + i)); - } - return _SUCCESS; } @@ -3572,10 +3435,6 @@ void rtw_process_bar_frame(_adapter *padapter, union recv_frame *precv_frame) start_seq = ((cpu_to_le16(*(u16 *)(pframe + 18))) >> 4); preorder_ctrl->indicate_seq = start_seq; - /* for Debug use */ - if (0) - RTW_INFO(FUNC_ADPT_FMT" tid=%d, start_seq=%d\n", FUNC_ADPT_ARG(padapter), tid, start_seq); - exit: return; } @@ -4011,8 +3870,6 @@ inline void rtw_macid_ctl_set_h2c_msr(struct macid_ctl_t *macid_ctl, u8 id, u8 h } macid_ctl->h2c_msr[id] = h2c_msr; - if (0) - RTW_INFO("macid:%u, h2c_msr:"H2C_MSR_FMT"\n", id, H2C_MSR_ARG(&macid_ctl->h2c_msr[id])); } inline void rtw_macid_ctl_set_bw(struct macid_ctl_t *macid_ctl, u8 id, u8 bw) @@ -4023,8 +3880,6 @@ inline void rtw_macid_ctl_set_bw(struct macid_ctl_t *macid_ctl, u8 id, u8 bw) } macid_ctl->bw[id] = bw; - if (0) - RTW_INFO("macid:%u, bw:%s\n", id, ch_width_str(macid_ctl->bw[id])); } inline void rtw_macid_ctl_set_vht_en(struct macid_ctl_t *macid_ctl, u8 id, u8 en) @@ -4035,8 +3890,6 @@ inline void rtw_macid_ctl_set_vht_en(struct macid_ctl_t *macid_ctl, u8 id, u8 en } macid_ctl->vht_en[id] = en; - if (0) - RTW_INFO("macid:%u, vht_en:%u\n", id, macid_ctl->vht_en[id]); } inline void rtw_macid_ctl_set_rate_bmp0(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp) @@ -4047,8 +3900,6 @@ inline void rtw_macid_ctl_set_rate_bmp0(struct macid_ctl_t *macid_ctl, u8 id, u3 } macid_ctl->rate_bmp0[id] = bmp; - if (0) - RTW_INFO("macid:%u, rate_bmp0:0x%08X\n", id, macid_ctl->rate_bmp0[id]); } inline void rtw_macid_ctl_set_rate_bmp1(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp) @@ -4059,8 +3910,6 @@ inline void rtw_macid_ctl_set_rate_bmp1(struct macid_ctl_t *macid_ctl, u8 id, u3 } macid_ctl->rate_bmp1[id] = bmp; - if (0) - RTW_INFO("macid:%u, rate_bmp1:0x%08X\n", id, macid_ctl->rate_bmp1[id]); } inline void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3) @@ -4172,105 +4021,6 @@ bool rtw_tim_map_anyone_be_set_exclude_aid0(_adapter *padapter, const u8 *map) } #endif /* CONFIG_AP_MODE */ -#if 0 -unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) -{ - unsigned short ATIMWindow; - unsigned char *pframe; - struct tx_desc *ptxdesc; - struct 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}; - - memset(beacon_frame, 0, 256); - - pframe = beacon_frame + TXDESC_SIZE; - - pwlanhdr = (struct ieee80211_hdr *)pframe; - - fctrl =&pwlanhdr->frame_control; - *(fctrl) = 0; - - memcpy(pwlanhdr->addr1, bc_addr, ETH_ALEN); - memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); - memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN); - - set_frame_sub_type(pframe, IEEE80211_STYPE_BEACON); - - pframe += sizeof(struct ieee80211_hdr_3addr); - len = sizeof(struct ieee80211_hdr_3addr); - - /* timestamp will be inserted by hardware */ - pframe += 8; - len += 8; - - /* beacon interval: 2 bytes */ - memcpy(pframe, (unsigned char *)(rtw_get_beacon_interval_from_ie(cur_network->IEs)), 2); - - pframe += 2; - len += 2; - - /* capability info: 2 bytes */ - memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2); - - pframe += 2; - len += 2; - - /* SSID */ - pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 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, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &len); - - /* DS parameter set */ - pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &len); - - /* IBSS Parameter Set... */ - /* ATIMWindow = cur->Configuration.ATIMWindow; */ - ATIMWindow = 0; - pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &len); - - /* todo: ERP IE */ - - /* EXTERNDED SUPPORTED RATE */ - if (rate_len > 8) - pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (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/core/rtw_xmit.c b/core/rtw_xmit.c index b0004427..d377a6a1 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -768,18 +768,6 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf } } else { while (_TRUE) { -#if 0 /* Todo */ - /* check IOT action */ - if (pHTInfo->IOTAction & HT_IOT_ACT_FORCED_CTS2SELF) { - pattrib->vcs_mode = CTS_TO_SELF; - pattrib->rts_rate = MGN_24M; - break; - } else if (pHTInfo->IOTAction & (HT_IOT_ACT_FORCED_RTS | HT_IOT_ACT_PURE_N_MODE)) { - pattrib->vcs_mode = RTS_CTS; - pattrib->rts_rate = MGN_24M; - break; - } -#endif /* IOT action */ if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en == _TRUE) && @@ -1169,26 +1157,13 @@ u8 rtw_check_tdls_established(_adapter *padapter, struct pkt_attrib *pattrib) pattrib->direct_link = _FALSE; if (padapter->tdlsinfo.link_established == _TRUE) { pattrib->ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst); -#if 1 + if ((pattrib->ptdls_sta != NULL) && (pattrib->ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) && (pattrib->ether_type != 0x0806)) { pattrib->direct_link = _TRUE; /* RTW_INFO("send ptk to "MAC_FMT" using direct link\n", MAC_ARG(pattrib->dst)); */ } -#else - if (pattrib->ptdls_sta != NULL && - pattrib->ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) { - pattrib->direct_link = _TRUE; -#if 0 - RTW_INFO("send ptk to "MAC_FMT" using direct link\n", MAC_ARG(pattrib->dst)); -#endif - } - - /* ARP frame may be helped by AP*/ - if (pattrib->ether_type != 0x0806) - pattrib->direct_link = _FALSE; -#endif } return pattrib->direct_link; @@ -1408,8 +1383,6 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr if (pattrib->pktlen > 282) { /* MINIMUM_DHCP_PACKET_SIZE */ pattrib->dhcp_pkt = 1; DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_dhcp); - if (0) - RTW_INFO("send DHCP packet\n"); } } @@ -1877,13 +1850,6 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) SetSeqNum(hdr, pattrib->seqnum); #ifdef CONFIG_80211N_HT -#if 0 /* move into update_attrib_phy_info(). */ - /* check if enable ampdu */ - if (pattrib->ht_en && psta->htpriv.ampdu_enable) { - if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) - pattrib->ampdu_en = _TRUE; - } -#endif /* re-check if enable ampdu by BA_starting_seqctrl */ if (pattrib->ampdu_en == _TRUE) { u16 tx_seq; @@ -2638,38 +2604,6 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm /* adding icv, if necessary... */ if (pattrib->iv_len) { -#if 0 - /* if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) */ - /* psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv)); */ - /* else */ - /* psta = rtw_get_stainfo(pstapriv, pattrib->ra); */ - - if (psta != NULL) { - switch (pattrib->encrypt) { - case _WEP40_: - case _WEP104_: - WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - break; - case _TKIP_: - if (bmcst) - TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - else - TKIP_IV(pattrib->iv, psta->dot11txpn, 0); - break; - case _AES_: - if (bmcst) - AES_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - else - AES_IV(pattrib->iv, psta->dot11txpn, 0); - break; -#ifdef CONFIG_WAPI_SUPPORT - case _SMS4_: - rtw_wapi_get_iv(padapter, pattrib->ra, pattrib->iv); - break; -#endif - } - } -#endif memcpy(pframe, pattrib->iv, pattrib->iv_len); @@ -3807,13 +3741,6 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi if (pregpriv->wifi_spec == 1) { int j; -#if 0 - if (flags < XMIT_QUEUE_ENTRY) { - /* priority exchange according to the completed xmitbuf flags. */ - inx[flags] = 0; - inx[0] = flags; - } -#endif #if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_PCI_HCI) for (j = 0; j < 4; j++) @@ -3866,7 +3793,6 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi return pxmitframe; } -#if 1 struct tx_servq *rtw_get_sta_pending(_adapter *padapter, struct sta_info *psta, sint up, u8 *ac) { struct tx_servq *ptxservq = NULL; @@ -3903,60 +3829,6 @@ struct tx_servq *rtw_get_sta_pending(_adapter *padapter, struct sta_info *psta, return ptxservq; } -#else -__inline static struct tx_servq *rtw_get_sta_pending -(_adapter *padapter, _queue **ppstapending, struct sta_info *psta, sint up) -{ - struct tx_servq *ptxservq; - struct hw_xmit *phwxmits = padapter->xmitpriv.hwxmits; - - -#ifdef CONFIG_RTL8711 - - if (is_multicast_ether_addr(psta->cmn.mac_addr)) { - ptxservq = &(psta->sta_xmitpriv.be_q); /* we will use be_q to queue bc/mc frames in BCMC_stainfo */ - *ppstapending = &padapter->xmitpriv.bm_pending; - } else -#endif - { - switch (up) { - case 1: - case 2: - ptxservq = &(psta->sta_xmitpriv.bk_q); - *ppstapending = &padapter->xmitpriv.bk_pending; - (phwxmits + 3)->accnt++; - break; - - case 4: - case 5: - ptxservq = &(psta->sta_xmitpriv.vi_q); - *ppstapending = &padapter->xmitpriv.vi_pending; - (phwxmits + 1)->accnt++; - break; - - case 6: - case 7: - ptxservq = &(psta->sta_xmitpriv.vo_q); - *ppstapending = &padapter->xmitpriv.vo_pending; - (phwxmits + 0)->accnt++; - break; - - case 0: - case 3: - default: - ptxservq = &(psta->sta_xmitpriv.be_q); - *ppstapending = &padapter->xmitpriv.be_pending; - (phwxmits + 2)->accnt++; - break; - - } - - } - - - return ptxservq; -} -#endif /* * Will enqueue pxmitframe to the proper queue, @@ -4148,7 +4020,7 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) { /* if (priv->dev->br_port && * !memcmp(skb->data+MACADDRLEN, priv->br_mac, MACADDRLEN)) { */ -#if 1 + if (*((unsigned short *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_8021Q)) { is_vlan_tag = 1; vlan_hdr = *((unsigned short *)(skb->data + MACADDRLEN * 2 + 2)); @@ -4184,7 +4056,7 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) } } _exit_critical_bh(&padapter->br_ext_lock, &irqL); -#endif /* 1 */ + if (do_nat25) { int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method); if (nat25_db_handle(padapter, skb, NAT25_CHECK) == 0) { @@ -4259,20 +4131,6 @@ int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb) *((unsigned short *)(skb->data + MACADDRLEN * 2 + 2)) = vlan_hdr; } } -#if 0 - else { - if (*((unsigned short *)(skb->data + MACADDRLEN * 2)) == __constant_htons(ETH_P_8021Q)) - is_vlan_tag = 1; - - if (is_vlan_tag) { - if (ICMPV6_MCAST_MAC(skb->data) && ICMPV6_PROTO1A_VALN(skb->data)) - memcpy(skb->data + MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN); - } else { - if (ICMPV6_MCAST_MAC(skb->data) && ICMPV6_PROTO1A(skb->data)) - memcpy(skb->data + MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN); - } - } -#endif /* 0 */ /* check if SA is equal to our MAC */ if (memcmp(skb->data + MACADDRLEN, GET_MY_HWADDR(padapter), MACADDRLEN)) { @@ -4714,9 +4572,6 @@ inline bool xmitframe_hiq_filter(struct xmit_frame *xmitframe) #endif || attrib->dhcp_pkt ) { - if (0) - RTW_INFO(FUNC_ADPT_FMT" ether_type:0x%04x%s\n", FUNC_ADPT_ARG(xmitframe->padapter) - , attrib->ether_type, attrib->dhcp_pkt ? " DHCP" : ""); allow = _TRUE; } } else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_ALL) @@ -5754,9 +5609,7 @@ void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms) { sctx->timeout_ms = timeout_ms; sctx->submit_time = jiffies; -#ifdef PLATFORM_LINUX /* TODO: add condition wating interface for other os */ init_completion(&sctx->done); -#endif sctx->status = RTW_SCTX_SUBMITTED; } @@ -5766,7 +5619,6 @@ int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg) unsigned long expire; int status = 0; -#ifdef PLATFORM_LINUX expire = sctx->timeout_ms ? msecs_to_jiffies(sctx->timeout_ms) : MAX_SCHEDULE_TIMEOUT; if (!wait_for_completion_timeout(&sctx->done, expire)) { /* timeout, do something?? */ @@ -5774,7 +5626,6 @@ int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg) RTW_INFO("%s timeout: %s\n", __func__, msg); } else status = sctx->status; -#endif if (status == RTW_SCTX_DONE_SUCCESS) ret = _SUCCESS; @@ -5803,9 +5654,7 @@ void rtw_sctx_done_err(struct submit_ctx **sctx, int status) if (rtw_sctx_chk_waring_status(status)) RTW_INFO("%s status:%d\n", __func__, status); (*sctx)->status = status; -#ifdef PLATFORM_LINUX complete(&((*sctx)->done)); -#endif *sctx = NULL; } } diff --git a/hal/btc/halbtc8192e1ant.c b/hal/btc/halbtc8192e1ant.c index 1c60239f..25efd4f7 100644 --- a/hal/btc/halbtc8192e1ant.c +++ b/hal/btc/halbtc8192e1ant.c @@ -1882,14 +1882,8 @@ void halbtc8192e1ant_action_wifi_connected_bt_acl_busy(IN struct btc_coexist } else { halbtc8192e1ant_tdma_duration_adjust_for_acl(btcoexist, wifi_status); -#if 0 - if (coex_sta->cck_lock) - halbtc8192e1ant_coex_table_with_type(btcoexist, - NORMAL_EXEC, 3); - else -#endif - halbtc8192e1ant_coex_table_with_type(btcoexist, - NORMAL_EXEC, 4); + halbtc8192e1ant_coex_table_with_type(btcoexist, + NORMAL_EXEC, 4); coex_dm->auto_tdma_adjust = true; } } else if (((bt_link_info->a2dp_exist) && (bt_link_info->pan_exist)) || @@ -2479,67 +2473,6 @@ void halbtc8192e1ant_wifi_off_hw_cfg(IN struct btc_coexist* btcoexist) * ************************************************************ * extern function start with ex_halbtc8192e1ant_ * ************************************************************ */ -void ex_halbtc8192e1ant_power_on_setting(IN struct btc_coexist *btcoexist) -{ -#if 0 - struct btc_board_info *board_info = &btcoexist->board_info; - u8 u8tmp = 0x0; - u16 u16tmp = 0x0; - - btcoexist->stop_coex_dm = true; - - btcoexist->btc_write_1byte(btcoexist, 0x67, 0x20); - - /* enable BB, REG_SYS_FUNC_EN such that we can write 0x948 correctly. */ - u16tmp = btcoexist->btc_read_2byte(btcoexist, 0x2); - btcoexist->btc_write_2byte(btcoexist, 0x2, u16tmp | BIT(0) | BIT(1)); - - /* set GRAN_BT = 1 */ - btcoexist->btc_write_1byte(btcoexist, 0x765, 0x18); - /* set WLAN_ACT = 0 */ - btcoexist->btc_write_1byte(btcoexist, 0x76e, 0x4); - - /* */ - /* S0 or S1 setting and Local register setting(By the setting fw can get ant number, S0/S1, ... info) */ - /* Local setting bit define */ - /* BIT0: "0" for no antenna inverse; "1" for antenna inverse */ - /* BIT1: "0" for internal switch; "1" for external switch */ - /* BIT2: "0" for one antenna; "1" for two antenna */ - /* NOTE: here default all internal switch and 1-antenna ==> BIT1=0 and BIT2=0 */ - if (btcoexist->chip_interface == BTC_INTF_USB) { - /* fixed at S0 for USB interface */ - btcoexist->btc_write_4byte(btcoexist, 0x948, 0x0); - - u8tmp |= 0x1; /* antenna inverse */ - btcoexist->btc_write_local_reg_1byte(btcoexist, 0xfe08, u8tmp); - - board_info->btdm_ant_pos = BTC_ANTENNA_AT_AUX_PORT; - } else { - /* for PCIE and SDIO interface, we check efuse 0xc3[6] */ - if (board_info->single_ant_path == 0) { - /* set to S1 */ - btcoexist->btc_write_4byte(btcoexist, 0x948, 0x280); - board_info->btdm_ant_pos = BTC_ANTENNA_AT_MAIN_PORT; - } else if (board_info->single_ant_path == 1) { - /* set to S0 */ - btcoexist->btc_write_4byte(btcoexist, 0x948, 0x0); - u8tmp |= 0x1; /* antenna inverse */ - board_info->btdm_ant_pos = BTC_ANTENNA_AT_AUX_PORT; - } - - if (btcoexist->chip_interface == BTC_INTF_PCI) - btcoexist->btc_write_local_reg_1byte(btcoexist, 0x384, - u8tmp); - else if (btcoexist->chip_interface == BTC_INTF_SDIO) - btcoexist->btc_write_local_reg_1byte(btcoexist, 0x60, - u8tmp); - } -#endif -} - -void ex_halbtc8192e1ant_pre_load_firmware(IN struct btc_coexist *btcoexist) -{ -} void ex_halbtc8192e1ant_init_hw_config(IN struct btc_coexist *btcoexist, IN boolean wifi_only) diff --git a/hal/btc/halbtc8192e1ant.h b/hal/btc/halbtc8192e1ant.h index 10c34c1d..f9c5d904 100644 --- a/hal/btc/halbtc8192e1ant.h +++ b/hal/btc/halbtc8192e1ant.h @@ -185,8 +185,6 @@ struct coex_sta_8192e_1ant { /* ******************************************* * The following is interface which will notify coex module. * ******************************************* */ -void ex_halbtc8192e1ant_power_on_setting(IN struct btc_coexist *btcoexist); -void ex_halbtc8192e1ant_pre_load_firmware(IN struct btc_coexist *btcoexist); void ex_halbtc8192e1ant_init_hw_config(IN struct btc_coexist *btcoexist, IN boolean wifi_only); void ex_halbtc8192e1ant_init_coex_dm(IN struct btc_coexist *btcoexist); @@ -216,8 +214,6 @@ void ex_halbtc8192e1ant_dbg_control(IN struct btc_coexist *btcoexist, IN u8 op_code, IN u8 op_len, IN u8 *pdata); #else /* #if (RTL8192E_SUPPORT == 1) */ -#define ex_halbtc8192e1ant_power_on_setting(btcoexist) -#define ex_halbtc8192e1ant_pre_load_firmware(btcoexist) #define ex_halbtc8192e1ant_init_hw_config(btcoexist, wifi_only) #define ex_halbtc8192e1ant_init_coex_dm(btcoexist) #define ex_halbtc8192e1ant_ips_notify(btcoexist, type) diff --git a/hal/btc/halbtc8192e2ant.c b/hal/btc/halbtc8192e2ant.c index 1465f2fc..82154f75 100644 --- a/hal/btc/halbtc8192e2ant.c +++ b/hal/btc/halbtc8192e2ant.c @@ -389,7 +389,6 @@ void halbtc8192e2ant_monitor_bt_ctr(IN struct btc_coexist *btcoexist) void halbtc8192e2ant_monitor_wifi_ctr(IN struct btc_coexist *btcoexist) { -#if 1 coex_sta->crc_ok_cck = btcoexist->btc_phydm_query_PHY_counter( @@ -424,7 +423,6 @@ void halbtc8192e2ant_monitor_wifi_ctr(IN struct btc_coexist *btcoexist) btcoexist->btc_phydm_query_PHY_counter( btcoexist, PHYDM_INFO_CRC32_ERROR_VHT); -#endif } @@ -779,12 +777,6 @@ void halbtc8192e2ant_dec_bt_pwr(IN struct btc_coexist *btcoexist, { coex_dm->cur_bt_dec_pwr_lvl = dec_bt_pwr_lvl; - if (!force_exec) { -#if 0 /* work around, avoid h2c command fail. */ - if (coex_dm->pre_bt_dec_pwr_lvl == coex_dm->cur_bt_dec_pwr_lvl) - return; -#endif - } halbtc8192e2ant_set_fw_dec_bt_pwr(btcoexist, coex_dm->cur_bt_dec_pwr_lvl); @@ -3704,12 +3696,6 @@ void ex_halbtc8192e2ant_display_coex_info(IN struct btc_coexist *btcoexist) (coex_sta->wifi_is_high_pri_task ? "Yes" : "No")); CL_PRINTF(cli_buf); -#if 0 - CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s/", "test patch version", - "20161003_v3"); - CL_PRINTF(cli_buf); -#endif - /* wifi status */ CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============"); diff --git a/hal/btc/halbtcoutsrc.h b/hal/btc/halbtcoutsrc.h index 77ab0eb2..9d07a9ac 100644 --- a/hal/btc/halbtcoutsrc.h +++ b/hal/btc/halbtcoutsrc.h @@ -1117,65 +1117,6 @@ EXhalbtcoutsrc_PowerOnSetting( IN PBTC_COEXIST pBtCoexist ); VOID -EXhalbtcoutsrc_PreLoadFirmware( - IN PBTC_COEXIST pBtCoexist - ); -VOID -EXhalbtcoutsrc_InitHwConfig( - IN PBTC_COEXIST pBtCoexist, - IN BOOLEAN bWifiOnly - ); -VOID -EXhalbtcoutsrc_InitCoexDm( - IN PBTC_COEXIST pBtCoexist - ); -VOID -EXhalbtcoutsrc_IpsNotify( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte type - ); -VOID -EXhalbtcoutsrc_LpsNotify( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte type - ); -VOID -EXhalbtcoutsrc_ScanNotify( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte type - ); -VOID -EXhalbtcoutsrc_SetAntennaPathNotify( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte type - ); -VOID -EXhalbtcoutsrc_ConnectNotify( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte action - ); -VOID -EXhalbtcoutsrc_MediaStatusNotify( - IN PBTC_COEXIST pBtCoexist, - IN RT_MEDIA_STATUS mediaStatus - ); -VOID -EXhalbtcoutsrc_SpecificPacketNotify( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte pktType - ); -VOID -EXhalbtcoutsrc_BtInfoNotify( - IN PBTC_COEXIST pBtCoexist, - IN pu1Byte tmpBuf, - IN u1Byte length - ); -VOID -EXhalbtcoutsrc_RfStatusNotify( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte type - ); -VOID EXhalbtcoutsrc_WlFwDbgInfoNotify( IN PBTC_COEXIST pBtCoexist, IN pu1Byte tmpBuf, @@ -1188,43 +1129,6 @@ EXhalbtcoutsrc_rx_rate_change_notify( IN u1Byte btc_rate_id ); VOID -EXhalbtcoutsrc_StackOperationNotify( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte type - ); -VOID -EXhalbtcoutsrc_HaltNotify( - IN PBTC_COEXIST pBtCoexist - ); -VOID -EXhalbtcoutsrc_PnpNotify( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte pnpState - ); -VOID -EXhalbtcoutsrc_CoexDmSwitch( - IN PBTC_COEXIST pBtCoexist - ); -VOID -EXhalbtcoutsrc_Periodical( - IN PBTC_COEXIST pBtCoexist - ); -VOID -EXhalbtcoutsrc_DbgControl( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte opCode, - IN u1Byte opLen, - IN pu1Byte pData - ); -VOID -EXhalbtcoutsrc_AntennaDetection( - IN PBTC_COEXIST pBtCoexist, - IN u4Byte centFreq, - IN u4Byte offset, - IN u4Byte span, - IN u4Byte seconds - ); -VOID EXhalbtcoutsrc_StackUpdateProfileInfo( VOID ); @@ -1237,20 +1141,7 @@ EXhalbtcoutsrc_SetBtPatchVersion( IN u2Byte btHciVersion, IN u2Byte btPatchVersion ); -VOID -EXhalbtcoutsrc_UpdateMinBtRssi( - IN s1Byte btRssi - ); -#if 0 -VOID -EXhalbtcoutsrc_SetBtExist( - IN BOOLEAN bBtExist - ); -#endif -VOID -EXhalbtcoutsrc_SetChipType( - IN u1Byte chipType - ); + VOID EXhalbtcoutsrc_SetAntNum( IN u1Byte type, @@ -1264,10 +1155,6 @@ VOID EXhalbtcoutsrc_DisplayBtCoexInfo( IN PBTC_COEXIST pBtCoexist ); -VOID -EXhalbtcoutsrc_DisplayAntDetection( - IN PBTC_COEXIST pBtCoexist - ); #define MASKBYTE0 0xff #define MASKBYTE1 0xff00 diff --git a/hal/btc/mp_precomp.h b/hal/btc/mp_precomp.h index e745ea9d..1feaaa8b 100644 --- a/hal/btc/mp_precomp.h +++ b/hal/btc/mp_precomp.h @@ -20,10 +20,9 @@ #define BT_TMP_BUF_SIZE 100 -#ifdef PLATFORM_LINUX #define rsprintf snprintf #define rstrncat(dst, src, src_size) strncat(dst, src, src_size) -#endif + #define DCMD_Printf DBG_BT_INFO #ifdef bEnable diff --git a/hal/hal_btcoex.c b/hal/hal_btcoex.c index fbed20ae..6bd49356 100644 --- a/hal/hal_btcoex.c +++ b/hal/hal_btcoex.c @@ -336,14 +336,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 } } @@ -1053,13 +1045,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: @@ -1396,11 +1384,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: @@ -1508,17 +1492,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; case BTC_SET_BL_BT_LNA_CONSTRAIN_LEVEL: halbtcoutsrc_LnaConstrainLvl(pBtCoexist, pu8); @@ -1570,156 +1544,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; @@ -1734,34 +1558,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) { PADAPTER padapter = pBtCoexist->Adapter; @@ -1939,7 +1735,7 @@ void halbtcoutsrc_DisplayDbgMsg(void *pBtcContext, u8 dispType) halbtcoutsrc_DisplayCoexStatistics(pBtCoexist); break; case BTC_DBG_DISP_BT_LINK_INFO: - halbtcoutsrc_DisplayBtLinkInfo(pBtCoexist); + /* halbtcoutsrc_DisplayBtLinkInfo(pBtCoexist); */ break; case BTC_DBG_DISP_WIFI_STATUS: halbtcoutsrc_DisplayWifiStatus(pBtCoexist); @@ -2148,57 +1944,6 @@ u16 halbtcoutsrc_SetBtReg(void *pBtcContext, u8 RegType, u32 RegAddr, u32 Data) return ret; } -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 -halbtcoutsrc_SetBtTRXMASK( - IN PVOID pBtcContext, - IN u1Byte bt_trx_mask - ) -{ - /* 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) { PBTC_COEXIST pBtCoexist; @@ -2275,18 +2020,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; } @@ -2367,24 +2100,6 @@ COL_H2C_STATUS halbtcoutsrc_CoexH2cProcess(void *pBtCoexist, return ret_status; } -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); - - return AntDetVal; -#else - return 0; -#endif -} - u8 halbtcoutsrc_GetBleScanTypeFromBt(void *pBtcContext) { PBTC_COEXIST pBtCoexist; @@ -2561,139 +2276,16 @@ void halbtcoutsrc_phydm_modify_RA_PCR_threshold(void *pBtcContext, u8 RA_offset_ { struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext; -/* switch to #if 0 in case the phydm version does not provide the function */ -#if 1 phydm_modify_RA_PCR_threshold(pBtCoexist->odm_priv, RA_offset_direction, RA_threshold_offset); -#endif } 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 dm_struct *)pBtCoexist->odm_priv, (enum phydm_info_query)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; - - 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; - - 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]++; - 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 * ************************************ */ @@ -2797,12 +2389,12 @@ u8 EXhalbtcoutsrc_InitlizeVariables(void *padapter) pBtCoexist->btc_set = halbtcoutsrc_Set; pBtCoexist->btc_get_bt_reg = halbtcoutsrc_GetBtReg; pBtCoexist->btc_set_bt_reg = halbtcoutsrc_SetBtReg; - pBtCoexist->btc_set_bt_ant_detection = halbtcoutsrc_SetBtAntDetection; - pBtCoexist->btc_set_bt_trx_mask = halbtcoutsrc_SetBtTRXMASK; + pBtCoexist->btc_set_bt_ant_detection = _FALSE; + pBtCoexist->btc_set_bt_trx_mask = _FALSE; pBtCoexist->btc_coex_h2c_process = halbtcoutsrc_CoexH2cProcess; pBtCoexist->btc_get_bt_coex_supported_feature = halbtcoutsrc_GetBtCoexSupportedFeature; pBtCoexist->btc_get_bt_coex_supported_version= halbtcoutsrc_GetBtCoexSupportedVersion; - pBtCoexist->btc_get_ant_det_val_from_bt = halbtcoutsrc_GetAntDetValFromBt; + pBtCoexist->btc_get_ant_det_val_from_bt = 0; pBtCoexist->btc_get_ble_scan_type_from_bt = halbtcoutsrc_GetBleScanTypeFromBt; pBtCoexist->btc_get_ble_scan_para_from_bt = halbtcoutsrc_GetBleScanParaFromBt; pBtCoexist->btc_get_bt_afh_map_from_bt = halbtcoutsrc_GetBtAFHMapFromBt; @@ -3374,36 +2966,6 @@ void EXhalbtcoutsrc_scan_notify(PBTC_COEXIST pBtCoexist, u8 type) /* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } -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 assoType) { if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) @@ -3855,82 +3417,6 @@ void EXhalbtcoutsrc_rx_rate_change_notify(PBTC_COEXIST pBtCoexist, u8 is_data_fr #endif } -VOID -EXhalbtcoutsrc_RfStatusNotify( - IN PBTC_COEXIST pBtCoexist, - IN u1Byte type -) -{ - if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) - return; - pBtCoexist->statistics.cnt_rf_status_notify++; - - if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) { -#ifdef CONFIG_RTL8723B - if (pBtCoexist->board_info.btdm_ant_num == 1) - ex_halbtc8723b1ant_rf_status_notify(pBtCoexist, type); -#endif - } - -#ifdef CONFIG_RTL8703B - else if (IS_HARDWARE_TYPE_8703B(pBtCoexist->Adapter)) { - if (pBtCoexist->board_info.btdm_ant_num == 1) - ex_halbtc8703b1ant_rf_status_notify(pBtCoexist, type); - } -#endif - -#ifdef CONFIG_RTL8723D - else if (IS_HARDWARE_TYPE_8723D(pBtCoexist->Adapter)) { - if (pBtCoexist->board_info.btdm_ant_num == 1) - ex_halbtc8723d1ant_rf_status_notify(pBtCoexist, type); - } -#endif - -#ifdef CONFIG_RTL8822B - else if (IS_HARDWARE_TYPE_8822B(pBtCoexist->Adapter)) { - if (pBtCoexist->board_info.btdm_ant_num == 1) - ex_halbtc8822b1ant_rf_status_notify(pBtCoexist, type); - else if (pBtCoexist->board_info.btdm_ant_num == 2) - ex_halbtc8822b2ant_rf_status_notify(pBtCoexist, type); - } -#endif - -#ifdef CONFIG_RTL8821C - else if (IS_HARDWARE_TYPE_8821C(pBtCoexist->Adapter)) { - if (pBtCoexist->board_info.btdm_ant_num == 2) - ex_halbtc8821c2ant_rf_status_notify(pBtCoexist, type); - else if (pBtCoexist->board_info.btdm_ant_num == 1) - ex_halbtc8821c1ant_rf_status_notify(pBtCoexist, type); - } -#endif -} - -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) { if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) @@ -4098,43 +3584,6 @@ void EXhalbtcoutsrc_pnp_notify(PBTC_COEXIST pBtCoexist, u8 pnpState) #endif } -void EXhalbtcoutsrc_CoexDmSwitch(PBTC_COEXIST pBtCoexist) -{ - if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) - return; - pBtCoexist->statistics.cnt_coex_dm_switch++; - - halbtcoutsrc_LeaveLowPower(pBtCoexist); - - if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) { -#ifdef CONFIG_RTL8723B - if (pBtCoexist->board_info.btdm_ant_num == 1) { - pBtCoexist->stop_coex_dm = TRUE; - ex_halbtc8723b1ant_coex_dm_reset(pBtCoexist); - EXhalbtcoutsrc_SetAntNum(BT_COEX_ANT_TYPE_DETECTED, 2); - ex_halbtc8723b2ant_init_hw_config(pBtCoexist, FALSE); - ex_halbtc8723b2ant_init_coex_dm(pBtCoexist); - pBtCoexist->stop_coex_dm = FALSE; - } -#endif - } - -#ifdef CONFIG_RTL8723D - else if (IS_HARDWARE_TYPE_8723D(pBtCoexist->Adapter)) { - if (pBtCoexist->board_info.btdm_ant_num == 1) { - pBtCoexist->stop_coex_dm = TRUE; - ex_halbtc8723d1ant_coex_dm_reset(pBtCoexist); - EXhalbtcoutsrc_SetAntNum(BT_COEX_ANT_TYPE_DETECTED, 2); - ex_halbtc8723d2ant_init_hw_config(pBtCoexist, FALSE); - ex_halbtc8723d2ant_init_coex_dm(pBtCoexist); - pBtCoexist->stop_coex_dm = FALSE; - } - } -#endif - - halbtcoutsrc_NormalLowPower(pBtCoexist); -} - void EXhalbtcoutsrc_periodical(PBTC_COEXIST pBtCoexist) { if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) @@ -4254,34 +3703,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 @@ -4335,16 +3756,6 @@ void EXhalbtcoutsrc_StackUpdateProfileInfo(void) #endif /* CONFIG_BT_COEXIST_SOCKET_TRX */ } -void EXhalbtcoutsrc_UpdateMinBtRssi(s8 btRssi) -{ - PBTC_COEXIST pBtCoexist = &GLBtCoexist; - - if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) - return; - - pBtCoexist->stack_info.min_bt_rssi = btRssi; -} - void EXhalbtcoutsrc_SetHciVersion(u16 hciVersion) { PBTC_COEXIST pBtCoexist = &GLBtCoexist; @@ -4366,54 +3777,11 @@ 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) { - default: - case BT_2WIRE: - case BT_ISSC_3WIRE: - case BT_ACCEL: - case BT_RTL8756: - GLBtCoexist.board_info.bt_chip_type = BTC_CHIP_UNDEF; - break; - case BT_CSR_BC4: - GLBtCoexist.board_info.bt_chip_type = BTC_CHIP_CSR_BC4; - break; - case BT_CSR_BC8: - GLBtCoexist.board_info.bt_chip_type = BTC_CHIP_CSR_BC8; - break; - case BT_RTL8723A: - GLBtCoexist.board_info.bt_chip_type = BTC_CHIP_RTL8723A; - break; - case BT_RTL8821: - GLBtCoexist.board_info.bt_chip_type = BTC_CHIP_RTL8821; - break; - case BT_RTL8723B: - GLBtCoexist.board_info.bt_chip_type = BTC_CHIP_RTL8723B; - break; - } -} - 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; */ @@ -4516,23 +3884,6 @@ void EXhalbtcoutsrc_DisplayBtCoexInfo(PBTC_COEXIST pBtCoexist) halbtcoutsrc_NormalLowPower(pBtCoexist); } -void EXhalbtcoutsrc_DisplayAntDetection(PBTC_COEXIST pBtCoexist) -{ - if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist)) - return; - - halbtcoutsrc_LeaveLowPower(pBtCoexist); - - if (IS_HARDWARE_TYPE_8723B(pBtCoexist->Adapter)) { -#ifdef CONFIG_RTL8723B - if (pBtCoexist->board_info.btdm_ant_num == 1) - ex_halbtc8723b1ant_display_ant_detection(pBtCoexist); -#endif - } - - halbtcoutsrc_NormalLowPower(pBtCoexist); -} - void ex_halbtcoutsrc_pta_off_on_notify(PBTC_COEXIST pBtCoexist, u8 bBTON) { #ifdef CONFIG_RTL8812A @@ -5081,13 +4432,8 @@ void hal_btcoex_SuspendNotify(PADAPTER padapter, u8 state) EXhalbtcoutsrc_pnp_notify(&GLBtCoexist, BTC_WIFI_PNP_SLEEP); 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: #ifdef CONFIG_FW_MULTI_PORT_SUPPORT @@ -5281,92 +4627,6 @@ 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); */ diff --git a/hal/hal_com.c b/hal/hal_com.c index 0e6320e5..05440716 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -213,8 +213,6 @@ u8 rtw_hal_get_port(_adapter *adapter) rtw_warn_on(1); } } - if (0) - RTW_INFO(ADPT_FMT" - HP:%d,CP:%d\n", ADPT_ARG(adapter), get_hw_port(adapter), get_clt_port(adapter)); #endif /*DBG_HW_PORT*/ #endif/*CONFIG_CLIENT_PORT_CFG*/ @@ -1140,26 +1138,9 @@ void rtw_hal_dump_macaddr(void *sel, _adapter *adapter) #ifdef RTW_HALMAC void rtw_hal_hw_port_enable(_adapter *adapter) { -#if 1 u8 port_enable = _TRUE; rtw_hal_set_hwreg(adapter, HW_VAR_PORT_CFG, &port_enable); -#else - struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); - struct rtw_halmac_bcn_ctrl bcn_ctrl; - - memset(&bcn_ctrl, 0, sizeof(struct rtw_halmac_bcn_ctrl)); - bcn_ctrl.enable_bcn = 1; - bcn_ctrl.rx_bssid_fit = 1; - bcn_ctrl.rxbcn_rpt = 1; - - /*rtw_halmac_get_bcn_ctrl(struct dvobj_priv *d, enum _hw_port hwport, - struct rtw_halmac_bcn_ctrl *bcn_ctrl)*/ - if (rtw_halmac_set_bcn_ctrl(dvobj, get_hw_port(adapter), &bcn_ctrl) == -1) { - RTW_ERR(ADPT_FMT" - hw port(%d) enable fail!!\n", ADPT_ARG(adapter), get_hw_port(adapter)); - rtw_warn_on(1); - } -#endif } void rtw_hal_hw_port_disable(_adapter *adapter) { @@ -1201,8 +1182,7 @@ void rtw_mi_set_mac_addr(_adapter *adapter) rtw_hal_set_hwreg(iface, HW_VAR_MAC_ADDR, adapter_mac_addr(iface)); } #endif - if (1) - rtw_hal_dump_macaddr(RTW_DBGDUMP, adapter); + rtw_hal_dump_macaddr(RTW_DBGDUMP, adapter); } void rtw_init_hal_com_default_value(PADAPTER Adapter) @@ -1250,11 +1230,6 @@ s32 c2h_evt_read_88xx(_adapter *adapter, u8 *buf) SET_C2H_SEQ_88XX(buf, rtw_read8(adapter, REG_C2HEVT_CMD_SEQ_88XX)); SET_C2H_PLEN_88XX(buf, rtw_read8(adapter, REG_C2HEVT_CMD_LEN_88XX)); - if (0) { - RTW_INFO("%s id=0x%02x, seq=%u, plen=%u, trigger=0x%02x\n", __func__ - , C2H_ID_88XX(buf), C2H_SEQ_88XX(buf), C2H_PLEN_88XX(buf), trigger); - } - /* Read the content */ for (i = 0; i < C2H_PLEN_88XX(buf); i++) *(C2H_PAYLOAD_88XX(buf) + i) = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 2 + i); @@ -1365,8 +1340,6 @@ void c2h_iqk_offload(_adapter *adapter, u8 *data, u8 len) struct submit_ctx *iqk_sctx = &hal_data->iqk_sctx; RTW_INFO("IQK offload finish in %dms\n", rtw_get_passing_time_ms(iqk_sctx->submit_time)); - if (0) - RTW_INFO_DUMP("C2H_IQK_FINISH: ", data, len); rtw_sctx_done(&iqk_sctx); } @@ -2016,21 +1989,7 @@ void rtw_hal_update_sta_mimo_type(_adapter *adapter, struct sta_info *psta) void rtw_hal_update_sta_smps_cap(_adapter *adapter, struct sta_info *psta) { /*Spatial Multiplexing Power Save*/ -#if 0 - if (check_fwstate(&adapter->mlmepriv, WIFI_AP_STATE) == _TRUE) { - #ifdef CONFIG_80211N_HT - if (psta->htpriv.ht_option) { - if (psta->htpriv.smps_cap == 0) - psta->cmn.sm_ps = SM_PS_STATIC; - else if (psta->htpriv.smps_cap == 1) - psta->cmn.sm_ps = SM_PS_DYNAMIC; - else - psta->cmn.sm_ps = SM_PS_DISABLE; - } - #endif /* CONFIG_80211N_HT */ - } else -#endif - psta->cmn.sm_ps = SM_PS_DISABLE; + psta->cmn.sm_ps = SM_PS_DISABLE; RTW_INFO("STA - MAC_ID:%d, SM_PS %d\n", psta->cmn.mac_id, psta->cmn.sm_ps); @@ -2375,17 +2334,7 @@ void rtw_sec_write_cam_ent(_adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key) u32 wdata, wdata1 = 0; /* 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) { @@ -2875,43 +2824,19 @@ void rtw_hal_set_bcn_rsvdpage_loc_cmd(_adapter *adapter) u8 bcn_rsvdpage[H2C_BCN_RSVDPAGE_LEN] = {0}; rtw_hal_get_def_var(adapter, HAL_DEF_TX_PAGE_SIZE, (u8 *)&page_size); - #if 1 for (vap_id = 0; vap_id < CONFIG_LIMITED_AP_NUM; vap_id++) { if (dvobj->vap_map & BIT(vap_id)) bcn_rsvdpage[vap_id] = vap_id * (MAX_BEACON_LEN / page_size); } - #else -#define SET_H2CCMD_BCN_RSVDPAGE_LOC_ROOT(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) -#define SET_H2CCMD_BCN_RSVDPAGE_LOC_VAP1(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 1, 8, __Value) -#define SET_H2CCMD_BCN_RSVDPAGE_LOC_VAP2(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 2, 8, __Value) -#define SET_H2CCMD_BCN_RSVDPAGE_LOC_VAP3(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 3, 8, __Value) -#define SET_H2CCMD_BCN_RSVDPAGE_LOC_VAP4(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 4, 8, __Value) - - if (dvobj->vap_map & BIT(0)) - SET_H2CCMD_BCN_RSVDPAGE_LOC_ROOT(bcn_rsvdpage, 0); - if (dvobj->vap_map & BIT(1)) - SET_H2CCMD_BCN_RSVDPAGE_LOC_VAP1(bcn_rsvdpage, - 1 * (MAX_BEACON_LEN / page_size)); - if (dvobj->vap_map & BIT(2)) - SET_H2CCMD_BCN_RSVDPAGE_LOC_VAP2(bcn_rsvdpage, - 2 * (MAX_BEACON_LEN / page_size)); - if (dvobj->vap_map & BIT(3)) - SET_H2CCMD_BCN_RSVDPAGE_LOC_VAP3(bcn_rsvdpage, - 3 * (MAX_BEACON_LEN / page_size)); - if (dvobj->vap_map & BIT(4)) - SET_H2CCMD_BCN_RSVDPAGE_LOC_VAP4(bcn_rsvdpage, - 4 * (MAX_BEACON_LEN / page_size)); - #endif - if (1) { - RTW_INFO("[BCN_LOC] vap_map : 0x%02x\n", dvobj->vap_map); - RTW_INFO("[BCN_LOC] page_size :%d, @bcn_page_num :%d\n" - , page_size, (MAX_BEACON_LEN / page_size)); - RTW_INFO("[BCN_LOC] root ap : 0x%02x\n", *bcn_rsvdpage); - RTW_INFO("[BCN_LOC] vap_1 : 0x%02x\n", *(bcn_rsvdpage + 1)); - RTW_INFO("[BCN_LOC] vap_2 : 0x%02x\n", *(bcn_rsvdpage + 2)); - RTW_INFO("[BCN_LOC] vap_3 : 0x%02x\n", *(bcn_rsvdpage + 3)); - RTW_INFO("[BCN_LOC] vap_4 : 0x%02x\n", *(bcn_rsvdpage + 4)); - } + + RTW_INFO("[BCN_LOC] vap_map : 0x%02x\n", dvobj->vap_map); + RTW_INFO("[BCN_LOC] page_size :%d, @bcn_page_num :%d\n" + , page_size, (MAX_BEACON_LEN / page_size)); + RTW_INFO("[BCN_LOC] root ap : 0x%02x\n", *bcn_rsvdpage); + RTW_INFO("[BCN_LOC] vap_1 : 0x%02x\n", *(bcn_rsvdpage + 1)); + RTW_INFO("[BCN_LOC] vap_2 : 0x%02x\n", *(bcn_rsvdpage + 2)); + RTW_INFO("[BCN_LOC] vap_3 : 0x%02x\n", *(bcn_rsvdpage + 3)); + RTW_INFO("[BCN_LOC] vap_4 : 0x%02x\n", *(bcn_rsvdpage + 4)); ret = rtw_hal_fill_h2c_cmd(adapter, H2C_BCN_RSVDPAGE, H2C_BCN_RSVDPAGE_LEN, bcn_rsvdpage); } @@ -2935,13 +2860,6 @@ void rtw_ap_multi_bcn_cfg(_adapter *adapter) rtw_halmac_set_bcn_interval(adapter_to_dvobj(adapter), HW_PORT0, dft_bcn_space); rtw_write8(adapter, REG_MBSSID_BCN_SPACE3 + 2, sub_bcn_space); - #if 0 /*setting in hw_var_set_opmode_mbid - ResumeTxBeacon*/ - /*BCN hold time 0x540[19:8] = 0x80*/ - rtw_write8(adapter, REG_TBTT_PROHIBIT + 1, TBTT_PROHIBIT_HOLD_TIME & 0xFF); - rtw_write8(adapter, REG_TBTT_PROHIBIT + 2, - (rtw_read8(adapter, REG_TBTT_PROHIBIT + 2) & 0xF0) | (TBTT_PROHIBIT_HOLD_TIME >> 8)); - #endif - /*ATIM window -0x55A = 0x32, reg 0x570 = 0x32, reg 0x5A0 = 0x32 */ rtw_write8(adapter, REG_ATIMWND, 0x32); rtw_write8(adapter, REG_ATIMWND1_V1, 0x32); @@ -3079,46 +2997,17 @@ void rtw_ap_multi_bcn_cfg(_adapter *adapter) #ifdef CONFIG_MI_WITH_MBSSID_CAM void rtw_hal_set_macaddr_mbid(_adapter *adapter, u8 *mac_addr) { - -#if 0 /*TODO - modify for more flexible*/ - u8 idx = 0; - - 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); - } - } -#else - { - /* - MBID entry_id = 0~7 ,for IFACE_ID0 ~ IFACE_IDx - */ - u8 entry_id = rtw_mbid_camid_alloc(adapter, mac_addr); + /* + 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); - RTW_INFO("%s "ADPT_FMT"- mbid(%d) mac_addr ="MAC_FMT"\n", __func__, - ADPT_ARG(adapter), entry_id, MAC_ARG(mac_addr)); - } + if (entry_id != INVALID_CAM_ID) { + write_mbssid_cam(adapter, entry_id, mac_addr); + RTW_INFO("%s "ADPT_FMT"- mbid(%d) mac_addr ="MAC_FMT"\n", __func__, + ADPT_ARG(adapter), entry_id, MAC_ARG(mac_addr)); } -#endif } void rtw_hal_change_macaddr_mbid(_adapter *adapter, u8 *mac_addr) @@ -3998,123 +3887,6 @@ s32 rtw_set_ps_rsvd_page(_adapter *adapter) return ret; } - -#if 0 -_adapter * _rtw_search_dp_iface(_adapter *adapter) -{ - struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); - _adapter *iface; - _adapter *target_iface = NULL; - int i; - u8 sta_num = 0, tdls_num = 0, ap_num = 0, mesh_num = 0, adhoc_num = 0; - u8 p2p_go_num = 0, p2p_gc_num = 0; - _adapter *sta_ifs[8]; - _adapter *ap_ifs[8]; - _adapter *mesh_ifs[8]; - _adapter *gc_ifs[8]; - _adapter *go_ifs[8]; - - for (i = 0; i < dvobj->iface_nums; i++) { - iface = dvobj->padapters[i]; - - if (check_fwstate(&iface->mlmepriv, WIFI_STATION_STATE) == _TRUE) { - if (check_fwstate(&iface->mlmepriv, _FW_LINKED) == _TRUE) { - sta_ifs[sta_num++] = iface; - - #ifdef CONFIG_TDLS - if (iface->tdlsinfo.link_established == _TRUE) - tdls_num++; - #endif - #ifdef CONFIG_P2P - if (MLME_IS_GC(iface)) - gc_ifs[p2p_gc_num++] = iface; - #endif - } -#ifdef CONFIG_AP_MODE - } else if (check_fwstate(&iface->mlmepriv, WIFI_AP_STATE) == _TRUE ) { - if (check_fwstate(&iface->mlmepriv, _FW_LINKED) == _TRUE) { - ap_ifs[ap_num++] = iface; - #ifdef CONFIG_P2P - if (MLME_IS_GO(iface)) - go_ifs[p2p_go_num++] = iface; - #endif - } -#endif - } else if (check_fwstate(&iface->mlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE) == _TRUE - && check_fwstate(&iface->mlmepriv, _FW_LINKED) == _TRUE - ) { - adhoc_num++; - -#ifdef CONFIG_RTW_MESH - } else if (check_fwstate(&iface->mlmepriv, WIFI_MESH_STATE) == _TRUE - && check_fwstate(&iface->mlmepriv, _FW_LINKED) == _TRUE - ) { - mesh_ifs[mesh_num++] = iface; -#endif - } - } - - if (p2p_gc_num) { - target_iface = gc_ifs[0]; - } - else if (sta_num) { - if(sta_num == 1) { - target_iface = sta_ifs[0]; - } else if (sta_num >= 2) { - /*TODO get target_iface by timestamp*/ - target_iface = sta_ifs[0]; - } - } else if (ap_num) { - target_iface = ap_ifs[0]; - } - - RTW_INFO("[IFS_ASSOC_STATUS] - STA :%d", sta_num); - RTW_INFO("[IFS_ASSOC_STATUS] - TDLS :%d", tdls_num); - RTW_INFO("[IFS_ASSOC_STATUS] - AP:%d", ap_num); - RTW_INFO("[IFS_ASSOC_STATUS] - MESH :%d", mesh_num); - RTW_INFO("[IFS_ASSOC_STATUS] - ADHOC :%d", adhoc_num); - RTW_INFO("[IFS_ASSOC_STATUS] - P2P-GC :%d", p2p_gc_num); - RTW_INFO("[IFS_ASSOC_STATUS] - P2P-GO :%d", p2p_go_num); - - if (target_iface) - RTW_INFO("%s => target_iface ("ADPT_FMT")\n", - __func__, ADPT_ARG(target_iface)); - else - RTW_INFO("%s => target_iface NULL\n", __func__); - - return target_iface; -} - -void rtw_search_default_port(_adapter *adapter) -{ - struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); - _adapter *adp_iface = NULL; -#ifdef CONFIG_WOWLAN - struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj); - - if (pwrpriv->wowlan_mode == _TRUE) { - adp_iface = adapter; - goto exit; - } -#endif - adp_iface = _rtw_search_dp_iface(adapter); - -exit : - if ((adp_iface != NULL) && (MLME_IS_STA(adp_iface))) - rtw_set_default_port_id(adp_iface); - else - rtw_hal_set_default_port_id_cmd(adapter, 0); - - if (1) { - _adapter *tmp_adp; - - tmp_adp = (adp_iface) ? adp_iface : adapter; - - RTW_INFO("%s ("ADPT_FMT")=> hw_port :%d, default_port(%d)\n", - __func__, ADPT_ARG(adapter), get_hw_port(tmp_adp), get_dft_portid(tmp_adp)); - } -} -#endif #endif /*CONFIG_FW_MULTI_PORT_SUPPORT*/ #ifdef CONFIG_P2P_PS @@ -5632,14 +5404,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__); @@ -6107,21 +5871,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 ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_, - pattrib->pktlen - sizeof(struct 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; @@ -6212,18 +5961,6 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe * #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 void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength) @@ -6534,18 +6271,6 @@ 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) { @@ -6938,17 +6663,6 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL #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) @@ -7050,130 +6764,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) { - struct p2p_channels *ch_list = &(adapter_to_rfctl(padapter)->channel_list); - - 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 */ - 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)ch_list->reg_classes - + get_reg_classes_full_count(ch_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 -#endif /* CONFIG_CONCURRENT_MODE */ - { - int i, j; - for (j = 0; j < ch_list->reg_classes; j++) { - /* Operating Class */ - p2pie[p2pielen++] = ch_list->reg_class[j].reg_class; - - /* Number of Channels */ - p2pie[p2pielen++] = ch_list->reg_class[j].channels; - - /* Channel List */ - for (i = 0; i < ch_list->reg_class[j].channels; i++) - p2pie[p2pielen++] = ch_list->reg_class[j].channel[i]; - } - } - } -#endif - pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pktlen); #ifdef CONFIG_WFD @@ -7183,18 +6773,6 @@ 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 } @@ -7257,20 +6835,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 ); */ @@ -7296,18 +6860,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) @@ -7417,52 +6969,6 @@ void rtw_hal_construct_beacon(_adapter *padapter, pframe += 2; pktlen += 2; -#if 0 - /* capability info: 2 bytes */ - memcpy(pframe, (unsigned char *)(rtw_get_capability_from_ie(cur_network->IEs)), 2); - - pframe += 2; - pktlen += 2; - - if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) { - /* RTW_INFO("ie len=%d\n", cur_network->IELength); */ - pktlen += cur_network->IELength - sizeof(NDIS_802_11_FIXED_IEs); - memcpy(pframe, cur_network->IEs + sizeof(NDIS_802_11_FIXED_IEs), pktlen); - - goto _ConstructBeacon; - } - - /* below for ad-hoc mode */ - - /* SSID */ - pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); - - /* supported rates... */ - rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pktlen); - - /* DS parameter set */ - pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); - - if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) { - u32 ATIMWindow; - /* IBSS Parameter Set... */ - /* ATIMWindow = cur->Configuration.ATIMWindow; */ - ATIMWindow = 0; - pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &pktlen); - } - - - /* todo: ERP IE */ - - - /* EXTERNDED SUPPORTED RATE */ - if (rate_len > 8) - pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); - - /* todo:HT for adhoc */ -#endif - _ConstructBeacon: if ((pktlen + TXDESC_SIZE) > MAX_BEACON_LEN) { @@ -8532,22 +8038,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", - __FUNCTION__, &pframe[index - tx_desc], - (tx_desc + RTW_KCK_LEN + RTW_KEK_LEN)); -#endif *page_num += CurtPktPageNum; @@ -8563,22 +8053,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", - __FUNCTION__, &pframe[index - tx_desc], - (tx_desc + GTKLength)); -#endif CurtPktPageNum = (u8)PageNum(tx_desc + GTKLength, page_size); @@ -9709,13 +9183,6 @@ static void rtw_hal_wow_disable(_adapter *adapter) RTW_INFO("%s: psta is null\n", __func__); } - if (0) { - RTW_INFO("0x630:0x%02x\n", rtw_read8(adapter, 0x630)); - RTW_INFO("0x631:0x%02x\n", rtw_read8(adapter, 0x631)); - RTW_INFO("0x634:0x%02x\n", rtw_read8(adapter, 0x634)); - RTW_INFO("0x1c7:0x%02x\n", rtw_read8(adapter, 0x1c7)); - } - pwrctl->wowlan_wake_reason = rtw_read8(adapter, REG_WOWLAN_WAKE_REASON); RTW_PRINT("wakeup_reason: 0x%02x\n", @@ -9818,11 +9285,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", - __FUNCTION__, &pframe[index - tx_desc], (P2PBCNLength + tx_desc)); -#endif - CurtPktPageNum = (u8)PageNum(tx_desc + P2PBCNLength, page_size); *page_num += CurtPktPageNum; @@ -10086,16 +9548,8 @@ u8 rtw_hal_set_lps_pg_info(_adapter *adapter) void rtw_hal_lps_pg_rssi_lv_decide(_adapter *adapter, struct sta_info *sta) { -#if 0 - if (sta->cmn.ra_info.rssi_level >= 4) - sta->lps_pg_rssi_lv = 3; /*RSSI High - 1SS_VHT_MCS7*/ - else if (sta->cmn.ra_info.rssi_level >= 2) - sta->lps_pg_rssi_lv = 2; /*RSSI Middle - 1SS_VHT_MCS3*/ - else - sta->lps_pg_rssi_lv = 1; /*RSSI Lower - Lowest_rate*/ -#else sta->lps_pg_rssi_lv = 0; -#endif + RTW_INFO("%s mac-id:%d, rssi:%d, rssi_level:%d, lps_pg_rssi_lv:%d\n", __func__, sta->cmn.mac_id, sta->cmn.rssi_stat.rssi, sta->cmn.ra_info.rssi_level, sta->lps_pg_rssi_lv); } @@ -10148,16 +9602,6 @@ static u8 _rtw_mi_assoc_if_num(_adapter *adapter) { u8 mi_iface_num = 0; - if (0) { - RTW_INFO("[IFS_ASSOC_STATUS] - STA :%d", DEV_STA_LD_NUM(adapter_to_dvobj(adapter))); - RTW_INFO("[IFS_ASSOC_STATUS] - AP:%d", DEV_AP_NUM(adapter_to_dvobj(adapter))); - RTW_INFO("[IFS_ASSOC_STATUS] - AP starting :%d", DEV_AP_STARTING_NUM(adapter_to_dvobj(adapter))); - RTW_INFO("[IFS_ASSOC_STATUS] - MESH :%d", DEV_MESH_NUM(adapter_to_dvobj(adapter))); - RTW_INFO("[IFS_ASSOC_STATUS] - ADHOC :%d", DEV_ADHOC_NUM(adapter_to_dvobj(adapter))); - /*RTW_INFO("[IFS_ASSOC_STATUS] - P2P-GC :%d", DEV_P2P_GC_NUM(adapter_to_dvobj(adapter)));*/ - /*RTW_INFO("[IFS_ASSOC_STATUS] - P2P-GO :%d", DEV_P2P_GO_NUM(adapter_to_dvobj(adapter)));*/ - } - mi_iface_num = (DEV_STA_LD_NUM(adapter_to_dvobj(adapter)) + DEV_AP_NUM(adapter_to_dvobj(adapter)) + DEV_AP_STARTING_NUM(adapter_to_dvobj(adapter))); @@ -11220,13 +10664,11 @@ void hw_var_set_correct_tsf(PADAPTER adapter, u8 mlme_state) } /*#ifdef DBG_P0_TSF_SYNC*/ - #if 1 if (dvobj->p0_tsf.sync_port == MAX_HW_PORT) RTW_INFO("[TSF_SYNC] p0 sync port = N/A\n"); else RTW_INFO("[TSF_SYNC] p0 sync port = %d\n", dvobj->p0_tsf.sync_port); RTW_INFO("[TSF_SYNC] timer offset = %d\n", dvobj->p0_tsf.offset); - #endif #endif /*CONFIG_CONCURRENT_MODE*/ } @@ -11791,9 +11233,6 @@ u8 SetHwReg(_adapter *adapter, u8 variable, u8 *val) break; #endif default: - if (0) - RTW_PRINT(FUNC_ADPT_FMT" variable(%d) not defined!\n", - FUNC_ADPT_ARG(adapter), variable); ret = _FAIL; break; } @@ -11869,9 +11308,6 @@ void GetHwReg(_adapter *adapter, u8 variable, u8 *val) break; default: - if (0) - RTW_PRINT(FUNC_ADPT_FMT" variable(%d) not defined!\n", - FUNC_ADPT_ARG(adapter), variable); break; } @@ -11932,13 +11368,7 @@ u8 rtw_hal_query_txbfer_rf_num(_adapter *adapter) if ((pregistrypriv->beamformer_rf_num) && (IS_HARDWARE_TYPE_8814AE(adapter) || IS_HARDWARE_TYPE_8814AU(adapter) || IS_HARDWARE_TYPE_8822BU(adapter) || IS_HARDWARE_TYPE_8821C(adapter))) return pregistrypriv->beamformer_rf_num; - else if (IS_HARDWARE_TYPE_8814AE(adapter) -#if 0 -#if defined(CONFIG_USB_HCI) - || (IS_HARDWARE_TYPE_8814AU(adapter) && (pUsbModeMech->CurUsbMode == 2 || pUsbModeMech->HubUsbMode == 2)) /* for USB3.0 */ -#endif -#endif - ) { + else if (IS_HARDWARE_TYPE_8814AE(adapter)) { /*BF cap provided by Yu Chen, Sean, 2015, 01 */ if (hal_data->rf_type == RF_3T3R) return 2; @@ -11979,12 +11409,6 @@ void rtw_hal_beamforming_config_csirate(PADAPTER adapter) /* Acting as BFee */ if (IS_BEAMFORMEE(adapter)) { - #if 0 - /* Do not enable now because it will affect MU performance and CTS/BA rate. 2016.07.19. by tynli. [PCIE-1660] */ - if (IS_HARDWARE_TYPE_8821C(Adapter)) - FixRateEnable = 1; /* Support after 8821C */ - #endif - p_dm_odm = adapter_to_phydm(adapter); bf_info = GET_BEAMFORM_INFO(adapter); @@ -14139,15 +13563,6 @@ static void _hw_client_port_alloc(_adapter *adapter) struct clt_port_t *cltp = &dvobj->clt_port; _irqL irql; int i; - - #if 0 - if (cltp->num > MAX_CLIENT_PORT_NUM) { - RTW_ERR(ADPT_FMT" cann't alloc client (%d)\n", ADPT_ARG(adapter), cltp->num); - rtw_warn_on(1); - return; - } - #endif - if (adapter->client_id != MAX_CLIENT_PORT_NUM) { RTW_INFO(ADPT_FMT" client_id %d has allocated port:%d\n", ADPT_ARG(adapter), adapter->client_id, adapter->client_port); @@ -14175,13 +13590,6 @@ static void _hw_client_port_free(_adapter *adapter) struct clt_port_t *cltp = &dvobj->clt_port; _irqL irql; - #if 0 - if (adapter->client_id >= MAX_CLIENT_PORT_NUM) { - RTW_ERR(ADPT_FMT" client_id %d is invalid\n", ADPT_ARG(adapter), adapter->client_id); - /*rtw_warn_on(1);*/ - } - #endif - RTW_INFO("%s ("ADPT_FMT") id:%d, port:%d clt_num:%d\n", __func__, ADPT_ARG(adapter), adapter->client_id, adapter->client_port, cltp->num); diff --git a/hal/hal_com_phycfg.c b/hal/hal_com_phycfg.c index d0a9f4e4..2e2309e7 100644 --- a/hal/hal_com_phycfg.c +++ b/hal/hal_com_phycfg.c @@ -2212,9 +2212,6 @@ PHY_GetTxPowerIndexBase( *bIn24G = phy_GetChnlIndex(Channel, &chnlIdx); - if (0) - RTW_INFO("[%s] Channel Index: %d\n", (*bIn24G ? "2.4G" : "5G"), chnlIdx); - if (*bIn24G) { if (IS_CCK_RATE(Rate)) { /* CCK-nTX */ @@ -3146,15 +3143,6 @@ PHY_GetTxPowerLimit(_adapter *adapter } exit: - - if (0) { - if (final_bw != bw && (IS_HT_RATE(rate) || IS_VHT_RATE(rate))) - RTW_INFO("%s min_lmt: %s ch%u -> %s ch%u\n" - , MGN_RATE_STR(rate) - , ch_width_str(bw), cch - , ch_width_str(final_bw), final_cch); - } - return min_lmt; } @@ -3284,12 +3272,6 @@ static void phy_txpwr_lmt_cross_ref_ht_vht(_adapter *adapter) else if (tlrs == TXPWR_LMT_RS_VHT && ref_tlrs == TXPWR_LMT_RS_HT) vht_ref_ht_5g_20_40++; - if (0) - RTW_INFO("reg:%s, bw:%u, ch:%u, %s-%uT ref %s-%uT\n" - , ent->regd_name, bw, channel - , txpwr_lmt_rs_str(tlrs), ntx_idx + 1 - , txpwr_lmt_rs_str(ref_tlrs), ntx_idx + 1); - ent->lmt_5g[bw][tlrs - 1][channel][ntx_idx] = ent->lmt_5g[bw][ref_tlrs - 1][channel][ntx_idx]; } @@ -3300,11 +3282,6 @@ static void phy_txpwr_lmt_cross_ref_ht_vht(_adapter *adapter) } } - if (0) { - RTW_INFO("ht_ref_vht_5g_20_40:%d, ht_has_ref_5g_20_40:%d\n", ht_ref_vht_5g_20_40, ht_has_ref_5g_20_40); - RTW_INFO("vht_ref_ht_5g_20_40:%d, vht_has_ref_5g_20_40:%d\n", vht_ref_ht_5g_20_40, vht_has_ref_5g_20_40); - } - /* 5G 20M&40M HT all come from VHT*/ if (ht_ref_vht_5g_20_40 && ht_has_ref_5g_20_40 == ht_ref_vht_5g_20_40) rfctl->txpwr_lmt_5g_20_40_ref |= TXPWR_LMT_REF_HT_FROM_VHT; @@ -3578,10 +3555,6 @@ phy_set_tx_power_limit( s8 powerLimit = 0, prevPowerLimit, channelIndex; s8 ww_lmt_val = phy_txpwr_ww_lmt_value(Adapter); - if (0) - RTW_INFO("Index of power limit table [regulation %s][band %s][bw %s][rate section %s][ntx %s][chnl %s][val %s]\n" - , Regulation, Band, Bandwidth, RateSection, ntx, Channel, PowerLimit); - if (GetU1ByteIntegerFromStringInDecimal((char *)Channel, &channel) == _FALSE || GetS1ByteIntegerFromStringInDecimal((char *)PowerLimit, &powerLimit) == _FALSE ) { @@ -4880,25 +4853,6 @@ PHY_ConfigRFWithTxPwrTrackParaFile( } } else RTW_INFO("%s(): No File %s, Load from HWImg Array!\n", __FUNCTION__, 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_dm.c b/hal/hal_dm.c index f7e5a0df..b4f2d7d9 100644 --- a/hal/hal_dm.c +++ b/hal/hal_dm.c @@ -458,36 +458,6 @@ struct turbo_edca_setting{ #define TURBO_EDCA_ENT(UL, DL) {UL, DL} -#if 0 -#define TURBO_EDCA_MODE_NUM 18 -static struct turbo_edca_setting rtw_turbo_edca[TURBO_EDCA_MODE_NUM] = { - TURBO_EDCA_ENT(0xa42b, 0xa42b), /* mode 0 */ - TURBO_EDCA_ENT(0x431c, 0x431c), /* mode 1 */ - TURBO_EDCA_ENT(0x4319, 0x4319), /* mode 2 */ - - TURBO_EDCA_ENT(0x5ea42b, 0x5ea42b), /* mode 3 */ - TURBO_EDCA_ENT(0x5e431c, 0x5e431c), /* mode 4 */ - TURBO_EDCA_ENT(0x5e4319, 0x5e4319), /* mode 5 */ - - TURBO_EDCA_ENT(0x6ea42b, 0x6ea42b), /* mode 6 */ - TURBO_EDCA_ENT(0x6e431c, 0x6e431c), /* mode 7 */ - TURBO_EDCA_ENT(0x6e4319, 0x6e4319), /* mode 8 */ - - TURBO_EDCA_ENT(0x5ea42b, 0xa42b), /* mode 9 */ - TURBO_EDCA_ENT(0x5e431c, 0x431c), /* mode 10 */ - TURBO_EDCA_ENT(0x5e4319, 0x4319), /* mode 11 */ - - TURBO_EDCA_ENT(0x6ea42b, 0xa42b), /* mode 12 */ - TURBO_EDCA_ENT(0x6e431c, 0x431c), /* mode 13 */ - TURBO_EDCA_ENT(0x6e4319, 0x4319), /* mode 14 */ - - TURBO_EDCA_ENT(0x431c, 0x5e431c), /* mode 15 */ - - TURBO_EDCA_ENT(0xa42b, 0x5ea42b), /* mode 16 */ - - TURBO_EDCA_ENT(0x138642b, 0x431c), /* mode 17 */ -}; -#else #define TURBO_EDCA_MODE_NUM 8 static struct turbo_edca_setting rtw_turbo_edca[TURBO_EDCA_MODE_NUM] = { /* { UL, DL } */ @@ -507,7 +477,6 @@ static struct turbo_edca_setting rtw_turbo_edca[TURBO_EDCA_MODE_NUM] = { TURBO_EDCA_ENT(0x5e431c, 0xa42b), /* mode 7 */ }; -#endif void rtw_hal_turbo_edca(_adapter *adapter) { @@ -518,11 +487,6 @@ void rtw_hal_turbo_edca(_adapter *adapter) struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - /* Parameter suggested by Scott */ -#if 0 - u32 EDCA_BE_UL = edca_setting_UL[p_mgnt_info->iot_peer]; - u32 EDCA_BE_DL = edca_setting_DL[p_mgnt_info->iot_peer]; -#endif u32 EDCA_BE_UL = 0x5ea42b; u32 EDCA_BE_DL = 0x00a42b; u8 ic_type = rtw_get_chip_type(adapter); @@ -592,10 +556,7 @@ void rtw_hal_turbo_edca(_adapter *adapter) traffic_index = UP_LINK; } } -#if 0 - if ((p_dm_odm->dm_edca_table.prv_traffic_idx != traffic_index) - || (!p_dm_odm->dm_edca_table.is_current_turbo_edca)) -#endif + { if (interface_type == RTW_PCIE) { EDCA_BE_UL = 0x6ea42b; @@ -1176,25 +1137,6 @@ void dump_sta_traffic(void *sel, _adapter *adapter, struct sta_info *psta) , HDATA_RATE((psta->curr_rx_rate & 0x7F)), HDATA_RATE((psta->curr_rx_rate_bmc & 0x7F)), psta->cmn.rssi_stat.rssi ); - if (0) { - RTW_PRINT_SEL(sel, "tx_bytes:%llu(%llu - %llu)\n" - , psta->sta_stats.tx_bytes - psta->sta_stats.last_tx_bytes - , psta->sta_stats.tx_bytes, psta->sta_stats.last_tx_bytes - ); - RTW_PRINT_SEL(sel, "rx_uc_bytes:%llu(%llu - %llu)\n" - , sta_rx_uc_bytes(psta) - sta_last_rx_uc_bytes(psta) - , sta_rx_uc_bytes(psta), sta_last_rx_uc_bytes(psta) - ); - RTW_PRINT_SEL(sel, "rx_mc_bytes:%llu(%llu - %llu)\n" - , psta->sta_stats.rx_mc_bytes - psta->sta_stats.last_rx_mc_bytes - , psta->sta_stats.rx_mc_bytes, psta->sta_stats.last_rx_mc_bytes - ); - RTW_PRINT_SEL(sel, "rx_bc_bytes:%llu(%llu - %llu)\n" - , psta->sta_stats.rx_bc_bytes - psta->sta_stats.last_rx_bc_bytes - , psta->sta_stats.rx_bc_bytes, psta->sta_stats.last_rx_bc_bytes - ); - } - _RTW_PRINT_SEL(sel, "RTW: [TP] "); tx_tp_mbips = psta->sta_stats.tx_tp_kbits >> 10; rx_tp_mbips = psta->sta_stats.rx_tp_kbits >> 10; @@ -1235,11 +1177,6 @@ void dump_sta_traffic(void *sel, _adapter *adapter, struct sta_info *psta) else _RTW_PRINT_SEL(sel, "Total : %d(Kbps)\n", psta->sta_stats.smooth_tx_tp_kbits + psta->sta_stats.rx_tp_kbits); - #if 0 - RTW_PRINT_SEL(sel, "Moving-AVG TP {Tx,Rx,Total} = { %d , %d , %d } Mbps\n\n", - (psta->cmn.tx_moving_average_tp << 3), (psta->cmn.rx_moving_average_tp << 3), - (psta->cmn.tx_moving_average_tp + psta->cmn.rx_moving_average_tp) << 3); - #endif } void dump_sta_info(void *sel, struct sta_info *psta) @@ -1366,8 +1303,6 @@ static u8 _rtw_phydm_rfk_condition_check(_adapter *adapter, u8 is_scaning, u8 if #ifdef CONFIG_SKIP_RFK_IN_DM rfk_allowed = _FALSE; - if (0) - RTW_ERR("[RFK-CHK] RF-K not allowed due to CONFIG_SKIP_RFK_IN_DM\n"); return rfk_allowed; #endif @@ -1376,8 +1311,6 @@ static u8 _rtw_phydm_rfk_condition_check(_adapter *adapter, u8 is_scaning, u8 if if (MCC_EN(adapter) && rtw_hal_check_mcc_status(adapter, MCC_STATUS_DOING_MCC)) { rfk_allowed = _FALSE; - if (0) - RTW_INFO("[RFK-CHK] RF-K not allowed due to doing MCC\n"); return rfk_allowed; } #endif @@ -1406,14 +1339,9 @@ static u8 _rtw_phydm_iqk_segment_chk(_adapter *adapter, u8 ifs_linked) { u8 iqk_sgt = _FALSE; -#if 0 - struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); - if (ifs_linked && (dvobj->traffic_stat.cur_tx_tp > 2 || dvobj->traffic_stat.cur_rx_tp > 2)) - rst = _TRUE; -#else if (ifs_linked) iqk_sgt = _TRUE; -#endif + return iqk_sgt; } #endif diff --git a/hal/hal_dm_acs.c b/hal/hal_dm_acs.c index 2328eecb..b6a5e952 100644 --- a/hal/hal_dm_acs.c +++ b/hal/hal_dm_acs.c @@ -412,8 +412,6 @@ void rtw_acs_current_info_dump(void *sel, _adapter *adapter) } _RTW_PRINT_SEL(sel, "Current BW %s\n", ch_width_str(bw)); - if (0) - _RTW_PRINT_SEL(sel, "Current IGI 0x%02x\n", rtw_phydm_get_cur_igi(adapter)); _RTW_PRINT_SEL(sel, "CLM:%d, NHM:%d\n\n", hal_data->acs.cur_ch_clm_ratio, hal_data->acs.cur_ch_nhm_ratio); } diff --git a/hal/hal_halmac.c b/hal/hal_halmac.c index b8c10f8b..0ec49028 100644 --- a/hal/hal_halmac.c +++ b/hal/hal_halmac.c @@ -760,12 +760,6 @@ struct halmac_platform_api rtw_halmac_platform_api = { .REG_WRITE_32 = _halmac_reg_write_32, #endif /* CONFIG_USB_HCI || CONFIG_PCI_HCI */ - /* Write data */ -#if 0 - /* impletement in HAL-IC level */ - .SEND_RSVD_PAGE = sdio_write_data_rsvd_page, - .SEND_H2C_PKT = sdio_write_data_h2c, -#endif /* Memory allocate */ .RTL_FREE = _halmac_mfree, .RTL_MALLOC = _halmac_malloc, @@ -827,7 +821,6 @@ u32 rtw_halmac_read32(struct intf_hdl *pintfhdl, u32 addr) static void _read_register(struct dvobj_priv *d, u32 addr, u32 cnt, u8 *buf) { -#if 1 struct _ADAPTER *a; u32 i, n; u16 val16; @@ -872,15 +865,7 @@ static void _read_register(struct dvobj_priv *d, u32 addr, u32 cnt, u8 *buf) break; } } -#else - struct _ADAPTER *a; - u32 i; - - a = dvobj_get_primary_adapter(d); - for (i = 0; i < cnt; i++) - buf[i] = rtw_read8(a, addr + i); -#endif } #ifdef CONFIG_SDIO_HCI @@ -1819,30 +1804,6 @@ int rtw_halmac_get_mac_address(struct dvobj_priv *d, enum _hw_port hwport, u8 *a */ int rtw_halmac_get_network_type(struct dvobj_priv *d, enum _hw_port hwport, u8 *type) { -#if 0 - struct halmac_adapter *halmac; - struct halmac_api *api; - enum halmac_portid port; - enum halmac_network_type_select network; - enum halmac_ret_status status; - int err = -1; - - - halmac = dvobj_to_halmac(d); - api = HALMAC_GET_API(halmac); - port = _hw_port_drv2halmac(hwport); - network = HALMAC_NETWORK_UNDEFINE; - - status = api->halmac_get_net_type(halmac, port, &network); - if (status != HALMAC_RET_SUCCESS) - goto out; - - *type = _network_type_halmac2drv(network); - - err = 0; -out: - return err; -#else struct _ADAPTER *a; enum halmac_portid port; enum halmac_network_type_select network; @@ -1889,7 +1850,6 @@ int rtw_halmac_get_network_type(struct dvobj_priv *d, enum _hw_port hwport, u8 * err = 0; out: return err; -#endif } /** @@ -2259,12 +2219,6 @@ int rtw_halmac_set_aid(struct dvobj_priv *d, enum _hw_port hwport, u16 aid) api = HALMAC_GET_API(halmac); port = _hw_port_drv2halmac(hwport); -#if 0 - status = api->halmac_cfg_aid(halmac, port, aid); - if (status != HALMAC_RET_SUCCESS) - goto out; -#else -{ struct _ADAPTER *a; u32 addr; u16 val; @@ -2310,8 +2264,6 @@ int rtw_halmac_set_aid(struct dvobj_priv *d, enum _hw_port hwport, u16 aid) default: goto out; } -} -#endif err = 0; out: @@ -3344,12 +3296,6 @@ static int init_mac_flow(struct dvobj_priv *d) goto out; #endif -#if 0 /* It is not necessary to call this in normal driver */ - status = api->halmac_cfg_la_mode(halmac, HALMAC_LA_MODE_DISABLE); - if (status != HALMAC_RET_SUCCESS) - goto out; -#endif - err = _cfg_drv_rsvd_pg_num(d); if (err) goto out; diff --git a/hal/hal_hci/hal_usb.c b/hal/hal_hci/hal_usb.c index de0fc65f..3a030555 100644 --- a/hal/hal_hci/hal_usb.c +++ b/hal/hal_hci/hal_usb.c @@ -22,22 +22,17 @@ int usb_init_recv_priv(_adapter *padapter, u16 ini_in_buf_sz) struct recv_priv *precvpriv = &padapter->recvpriv; int i, res = _SUCCESS; struct recv_buf *precvbuf; - -#ifdef PLATFORM_LINUX tasklet_init(&precvpriv->recv_tasklet, (void(*)(unsigned long))usb_recv_tasklet, (unsigned long)padapter); -#endif /* PLATFORM_LINUX */ #ifdef CONFIG_USB_INTERRUPT_IN_PIPE -#ifdef PLATFORM_LINUX precvpriv->int_in_urb = usb_alloc_urb(0, GFP_KERNEL); if (precvpriv->int_in_urb == NULL) { res = _FAIL; RTW_INFO("alloc_urb for interrupt in endpoint fail !!!!\n"); goto exit; } -#endif /* PLATFORM_LINUX */ precvpriv->int_in_buf = rtw_zmalloc(ini_in_buf_sz); if (precvpriv->int_in_buf == NULL) { res = _FAIL; @@ -149,16 +144,12 @@ void usb_free_recv_priv(_adapter *padapter, u16 ini_in_buf_sz) rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF * sizeof(struct recv_buf) + 4); #ifdef CONFIG_USB_INTERRUPT_IN_PIPE -#ifdef PLATFORM_LINUX if (precvpriv->int_in_urb) usb_free_urb(precvpriv->int_in_urb); -#endif if (precvpriv->int_in_buf) rtw_mfree(precvpriv->int_in_buf, ini_in_buf_sz); #endif /* CONFIG_USB_INTERRUPT_IN_PIPE */ -#ifdef PLATFORM_LINUX - if (skb_queue_len(&precvpriv->rx_skb_queue)) RTW_WARN("rx_skb_queue not empty\n"); @@ -182,8 +173,6 @@ void usb_free_recv_priv(_adapter *padapter, u16 ini_in_buf_sz) #endif /* defined(CONFIG_PREALLOC_RX_SKB_BUFFER) && defined(CONFIG_PREALLOC_RECV_SKB) */ #endif /* !defined(CONFIG_USE_USB_BUFFER_ALLOC_RX) */ -#endif /* PLATFORM_LINUX */ - } #ifdef CONFIG_FW_C2H_REG @@ -196,9 +185,6 @@ void usb_c2h_hisr_hdl(_adapter *adapter, u8 *buf) if (rtw_hal_c2h_reg_hdr_parse(adapter, buf, &id, &seq, &plen, &payload) != _SUCCESS) return; - if (0) - RTW_PRINT("%s C2H == %d\n", __func__, id); - if (rtw_hal_c2h_id_handle_directly(adapter, id, seq, plen, payload)) { /* Handle directly */ rtw_hal_c2h_handler(adapter, id, seq, plen, payload); diff --git a/hal/hal_intf.c b/hal/hal_intf.c index e11347ff..8b8eb902 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -482,7 +482,7 @@ s32 rtw_hal_fw_mem_dl(_adapter *padapter, enum fw_mem mem) if (rst == _FALSE) pdbgpriv->dbg_fw_mem_dl_error_cnt++; - if (1) + RTW_INFO("%s dbg_fw_mem_dl_error_cnt:%d\n", __func__, pdbgpriv->dbg_fw_mem_dl_error_cnt); return rst; } @@ -797,10 +797,6 @@ void rtw_hal_set_chnl_bw(_adapter *padapter, u8 channel, enum channel_width Band if (rtw_mp_mode_check(padapter) == _FALSE) #endif { - #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) @@ -811,11 +807,6 @@ void rtw_hal_set_chnl_bw(_adapter *padapter, u8 channel, enum channel_width Band pHalData->cch_40 = cch_40; pHalData->cch_20 = cch_20; - if (0) - RTW_INFO("%s cch:%u, %s, offset40:%u, offset80:%u (%u, %u, %u)\n", __func__ - , channel, ch_width_str(Bandwidth), Offset40, Offset80 - , pHalData->cch_80, pHalData->cch_40, pHalData->cch_20); - padapter->hal_func.set_chnl_bw_handler(padapter, channel, Bandwidth, Offset40, Offset80); pHalData->current_band_type = channel > 14 ? BAND_ON_5G:BAND_ON_2_4G; } @@ -1409,7 +1400,7 @@ bool rtw_hal_rfkill_poll(_adapter *adapter, u8 *valid) u8 rtw_hal_ops_check(_adapter *padapter) { u8 ret = _SUCCESS; -#if 1 + /*** initialize section ***/ if (NULL == padapter->hal_func.read_chip_version) { rtw_hal_error_msg("read_chip_version"); @@ -1706,7 +1697,6 @@ u8 rtw_hal_ops_check(_adapter *padapter) rtw_hal_error_msg("hal_radio_onoff_check"); ret = _FAIL; } -#endif #endif return ret; } diff --git a/hal/hal_mcc.c b/hal/hal_mcc.c index aee46de2..57a60244 100644 --- a/hal/hal_mcc.c +++ b/hal/hal_mcc.c @@ -123,14 +123,6 @@ static void rtw_hal_mcc_build_p2p_noa_attr(PADAPTER padapter, u8 *ie, u32 *ie_le /* NoA Start Time (4 bytes) unit: microseconds */ RTW_PUT_LE32(p2p_noa_attr_ie + p2p_noa_attr_len, pmccadapriv->noa_start_time); - if (0) - RTW_INFO("indxe:%d, start_time=0x%02x:0x%02x:0x%02x:0x%02x\n" - , noa_index - , p2p_noa_attr_ie[p2p_noa_attr_len] - , p2p_noa_attr_ie[p2p_noa_attr_len + 1] - , p2p_noa_attr_ie[p2p_noa_attr_len + 2] - , p2p_noa_attr_ie[p2p_noa_attr_len + 3]); - p2p_noa_attr_len = p2p_noa_attr_len + 4; rtw_set_ie(ie, WLAN_EID_VENDOR_SPECIFIC, p2p_noa_attr_len, (u8 *)p2p_noa_attr_ie, ie_len); } @@ -158,9 +150,6 @@ static void rtw_hal_mcc_update_go_p2p_ie(PADAPTER padapter) pos = pmccadapriv->p2p_go_noa_ie + pmccadapriv->p2p_go_noa_ie_len - 15; /* 0~255 */ (*pos) = ((*pos) + 1) % 256; - if (0) - RTW_INFO("indxe:%d\n", (*pos)); - /* update duration */ noa_duration = mcc_switch_channel_policy_table[mccobjpriv->policy_index][MCC_DURATION_IDX] * TU; @@ -170,19 +159,8 @@ static void rtw_hal_mcc_update_go_p2p_ie(PADAPTER padapter) /* update start time */ pos = pmccadapriv->p2p_go_noa_ie + pmccadapriv->p2p_go_noa_ie_len - 4; RTW_PUT_LE32(pos, pmccadapriv->noa_start_time); - if (0) - RTW_INFO("start_time=0x%02x:0x%02x:0x%02x:0x%02x\n" - , ((u8*)(pos))[0] - , ((u8*)(pos))[1] - , ((u8*)(pos))[2] - , ((u8*)(pos))[3]); - } - if (0) { - RTW_INFO("p2p_go_noa_ie_len:%d\n", pmccadapriv->p2p_go_noa_ie_len); - RTW_INFO_DUMP("\n", pmccadapriv->p2p_go_noa_ie, pmccadapriv->p2p_go_noa_ie_len); - } update_beacon(padapter, WLAN_EID_VENDOR_SPECIFIC, P2P_OUI, _TRUE); } @@ -227,8 +205,6 @@ void rtw_hal_mcc_restore_iqk_val(PADAPTER padapter) } } - if (0) - dump_iqk_val_table(padapter); } u8 rtw_hal_check_mcc_status(PADAPTER padapter, u8 mcc_status) @@ -903,16 +879,7 @@ static u8 rtw_hal_mcc_update_timing_parameters(PADAPTER padapter, u8 force_updat pmccadapriv = &iface->mcc_adapterpriv; if (pmccadapriv->role == MCC_ROLE_MAX) continue; -#if 0 - if (pmccadapriv->order == 0) { - pmccadapriv->mcc_duration = mcc_duration; - } else if (pmccadapriv->order == 1) { - pmccadapriv->mcc_duration = mcc_interval - mcc_duration; - } else { - RTW_INFO("[MCC] not support >= 3 interface\n"); - rtw_warn_on(1); - } -#endif + RTW_INFO("********************\n"); RTW_INFO(FUNC_ADPT_FMT": order:%d, role:%d\n", FUNC_ADPT_ARG(iface), pmccadapriv->order, pmccadapriv->role); @@ -2404,14 +2371,6 @@ static void rtw_hal_mcc_sw_ch_fw_notify_hdl(PADAPTER padapter) rtw_hal_mcc_check_case_not_limit_traffic(cur_iface, next_iface); - if (0) { - RTW_INFO("order:%d, mcc_tx_stop:%d, mcc_tp:%d\n", - cur_mccadapriv->order, cur_mccadapriv->mcc_tx_stop, cur_mccadapriv->mcc_tp); - dump_os_queue(0, cur_iface); - RTW_INFO("order:%d, mcc_tx_stop:%d, mcc_tp:%d\n", - next_mccadapriv->order, next_mccadapriv->mcc_tx_stop, next_mccadapriv->mcc_tp); - dump_os_queue(0, next_iface); - } } static void rtw_hal_mcc_update_noa_start_time_hdl(PADAPTER padapter, u8 buflen, u8 *tmpBuf) @@ -2439,18 +2398,6 @@ static void rtw_hal_mcc_update_noa_start_time_hdl(PADAPTER padapter, u8 buflen, /* convert GO TBTT from FW to noa_start_time(TU convert to mircosecond) */ pmccadapriv->noa_start_time = RTW_GET_LE32(tmpBuf + 2) + noa_start_time_offset * TU; - if (0) { - RTW_INFO("TBTT:0x%02x\n", RTW_GET_LE32(tmpBuf + 2)); - RTW_INFO("noa_tsf_sync_offset:%d, noa_start_time_offset:%d\n", noa_tsf_sync_offset, noa_start_time_offset); - RTW_INFO(FUNC_ADPT_FMT"buf=0x%02x:0x%02x:0x%02x:0x%02x, noa_start_time=0x%02x\n" - , FUNC_ADPT_ARG(iface) - , tmpBuf[2] - , tmpBuf[3] - , tmpBuf[4] - , tmpBuf[5] - ,pmccadapriv->noa_start_time); - } - rtw_hal_mcc_update_go_p2p_ie(iface); break; @@ -2474,9 +2421,6 @@ static void rtw_hal_mcc_rpt_tsf_hdl(PADAPTER padapter, u8 buflen, u8 *tmpBuf) mccadapriv->tsf = RTW_GET_LE64(tmpBuf + 2); - if (0) - RTW_INFO(FUNC_ADPT_FMT" TSF(order:%d):0x%02llx\n", FUNC_ADPT_ARG(iface), mccadapriv->order, mccadapriv->tsf); - if (mccadapriv->order == (MAX_MCC_NUM - 1)) rtw_sctx_done(&mcc_tsf_req_sctx); else @@ -2514,9 +2458,6 @@ void rtw_hal_mcc_c2h_handler(PADAPTER padapter, u8 buflen, u8 *tmpBuf) rtw_set_oper_bw(cur_adapter, cur_bw); rtw_set_oper_choffset(cur_adapter, cur_ch_offset); - if (0) - RTW_INFO("%d,order:%d,TSF:0x%llx\n", tmpBuf[0], tmpBuf[1], RTW_GET_LE64(tmpBuf + 2)); - switch (pmccobjpriv->mcc_c2h_status) { case MCC_RPT_SUCCESS: _enter_critical_bh(&pmccobjpriv->mcc_lock, &irqL); @@ -2831,9 +2772,6 @@ inline void rtw_hal_mcc_calc_tx_bytes_from_kernel(PADAPTER padapter, u32 len) if (MCC_EN(padapter)) { if (rtw_hal_check_mcc_status(padapter, MCC_STATUS_DOING_MCC)) { pmccadapriv->mcc_tx_bytes_from_kernel += len; - if (0) - RTW_INFO("%s(order:%d): mcc tx bytes from kernel:%lld\n" - , __func__, pmccadapriv->order, pmccadapriv->mcc_tx_bytes_from_kernel); } } } @@ -2851,10 +2789,6 @@ inline void rtw_hal_mcc_calc_tx_bytes_to_port(PADAPTER padapter, u32 len) if (rtw_hal_check_mcc_status(padapter, MCC_STATUS_DOING_MCC)) { pmccadapriv->mcc_tx_bytes_to_port += len; - if (0) - RTW_INFO("%s(order:%d): mcc tx bytes to port:%d, mcc target tx bytes to port:%d\n" - , __func__, pmccadapriv->order, pmccadapriv->mcc_tx_bytes_to_port - , pmccadapriv->mcc_target_tx_bytes_to_port); } } } diff --git a/hal/hal_mp.c b/hal/hal_mp.c index 412b7ce6..7b58a3c1 100644 --- a/hal/hal_mp.c +++ b/hal/hal_mp.c @@ -1391,11 +1391,7 @@ 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*/ @@ -1629,17 +1625,10 @@ u8 hal_mpt_ReadRFThermalMeter(PADAPTER pAdapter) void hal_mpt_GetThermalMeter(PADAPTER pAdapter, u8 *value) { -#if 0 - fw_cmd(pAdapter, IOCMD_GET_THERMAL_METER); - msleep(1000); - fw_cmd_data(pAdapter, value, 1); - *value &= 0xFF; -#else + hal_mpt_TriggerRFThermalMeter(pAdapter); msleep(1000); *value = hal_mpt_ReadRFThermalMeter(pAdapter); -#endif - } @@ -2158,17 +2147,6 @@ void mpt_ProSetPMacTx(PADAPTER Adapter) RT_PMAC_TX_INFO PMacTxInfo = pMptCtx->PMacTxInfo; u32 u4bTmp; -#if 0 - PRINT_DATA("LSIG ", PMacTxInfo.LSIG, 3); - PRINT_DATA("HT_SIG", PMacTxInfo.HT_SIG, 6); - PRINT_DATA("VHT_SIG_A", PMacTxInfo.VHT_SIG_A, 6); - PRINT_DATA("VHT_SIG_B", PMacTxInfo.VHT_SIG_B, 4); - dbg_print("VHT_SIG_B_CRC %x\n", PMacTxInfo.VHT_SIG_B_CRC); - PRINT_DATA("VHT_Delimiter", PMacTxInfo.VHT_Delimiter, 4); - - PRINT_DATA("Src Address", Adapter->mac_addr, ETH_ALEN); - PRINT_DATA("Dest Address", PMacTxInfo.MacAddress, ETH_ALEN); -#endif if (pmppriv->pktInterval != 0) PMacTxInfo.PacketPeriod = pmppriv->pktInterval; diff --git a/hal/led/hal_usb_led.c b/hal/led/hal_usb_led.c index 19505b13..9c5acd4b 100644 --- a/hal/led/hal_usb_led.c +++ b/hal/led/hal_usb_led.c @@ -3113,19 +3113,10 @@ SwLedControlMode9( /* LED1 settings */ if (LedAction == LED_CTL_NO_LINK) { /* if(pMgntInfo->AuthStatus == AUTH_STATUS_FAILED) */ - if (0) { - pLed1->CurrLedState = LED_BLINK_AUTH_ERROR; - if (pLed1->bLedOn) - pLed1->BlinkingLedState = RTW_LED_OFF; - else - pLed1->BlinkingLedState = RTW_LED_ON; + pLed1->CurrLedState = RTW_LED_OFF; + pLed1->BlinkingLedState = RTW_LED_OFF; + if (pLed1->bLedOn) _set_timer(&(pLed1->BlinkTimer), 0); - } else { - pLed1->CurrLedState = RTW_LED_OFF; - pLed1->BlinkingLedState = RTW_LED_OFF; - if (pLed1->bLedOn) - _set_timer(&(pLed1->BlinkTimer), 0); - } } else { pLed1->CurrLedState = RTW_LED_OFF; pLed1->BlinkingLedState = RTW_LED_OFF; diff --git a/hal/phydm/halrf/halphyrf_ap.c b/hal/phydm/halrf/halphyrf_ap.c index 4df219ed..0b74732a 100644 --- a/hal/phydm/halrf/halphyrf_ap.c +++ b/hal/phydm/halrf/halphyrf_ap.c @@ -327,7 +327,6 @@ odm_txpowertracking_callback_thermal_meter_jaguar_series3( void *dm_void ) { -#if 1 struct dm_struct *dm = (struct dm_struct *)dm_void; u8 thermal_value = 0, delta, delta_LCK, delta_IQK, channel, is_increase; u8 thermal_value_avg_count = 0, p = 0, i = 0; @@ -578,7 +577,6 @@ odm_txpowertracking_callback_thermal_meter_jaguar_series3( } } } -#endif if (GET_CHIP_VER(priv) != VERSION_8198F) { if ((delta_IQK >= c.threshold_iqk) && (!iqk_info->rfk_forbidden)) { @@ -880,30 +878,6 @@ odm_txpowertracking_callback_thermal_meter_jaguar_series( } } } -#if 0 - /* Query OFDM path A default setting Bit[31:21] */ - ele_D = phy_query_bb_reg(priv, 0xc1c, 0xffe00000); - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "0xc1c:0x%x ([31:21] = 0x%x)\n", phy_query_bb_reg(priv, 0xc1c, MASKDWORD), ele_D); - for (i = 0; i < OFDM_TABLE_SIZE_8812; i++) {/* 4 */ - if (ele_D == ofdm_swing_table_8812[i]) { - OFDM_index[0] = (unsigned char)i; - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "OFDM_index[0]=%d\n", OFDM_index[0]); - break; - } - } - /* Query OFDM path B default setting */ - if (rf == 2) { - ele_D = phy_query_bb_reg(priv, 0xe1c, 0xffe00000); - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "0xe1c:0x%x ([32:21] = 0x%x)\n", phy_query_bb_reg(priv, 0xe1c, MASKDWORD), ele_D); - for (i = 0; i < OFDM_TABLE_SIZE_8812; i++) { - if (ele_D == ofdm_swing_table_8812[i]) { - OFDM_index[1] = (unsigned char)i; - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "OFDM_index[1]=%d\n", OFDM_index[1]); - break; - } - } - } -#endif /* Initialize */ if (!priv->pshare->thermal_value) { priv->pshare->thermal_value = priv->pmib->dot11RFEntry.ther; @@ -952,40 +926,10 @@ odm_txpowertracking_callback_thermal_meter_jaguar_series( OFDM_index[rf_path] = priv->pshare->OFDM_index0[rf_path] + get_tx_tracking_index(priv, channel, rf_path, delta, is_decrease, 0); OFDM_index[rf_path] = ((OFDM_index[rf_path] > (OFDM_TABLE_SIZE_8812 - 1)) ? (OFDM_TABLE_SIZE_8812 - 1) : OFDM_index[rf_path]); RF_DBG(dm, DBG_RF_TX_PWR_TRACK, ">>> decrese power ---> new OFDM_INDEX:%d (%d + %d)\n", OFDM_index[rf_path], priv->pshare->OFDM_index0[rf_path], get_tx_tracking_index(priv, channel, rf_path, delta, is_decrease, 0)); -#if 0/* RTL8881A_SUPPORT */ - if (dm->support_ic_type == ODM_RTL8881A) { - if (priv->pshare->rf_ft_var.pwrtrk_tx_agc_enable) { - if (priv->pshare->add_tx_agc) { /* tx_agc has been added */ - add_tx_power88xx_ac(priv, 0); - priv->pshare->add_tx_agc = 0; - priv->pshare->add_tx_agc_index = 0; - } - } - } -#endif } else { OFDM_index[rf_path] = priv->pshare->OFDM_index0[rf_path] - get_tx_tracking_index(priv, channel, rf_path, delta, is_decrease, 0); -#if 0/* RTL8881A_SUPPORT */ - if (dm->support_ic_type == ODM_RTL8881A) { - if (priv->pshare->rf_ft_var.pwrtrk_tx_agc_enable) { - if (OFDM_index[i] < OFDM_min_index) { - priv->pshare->add_tx_agc_index = (OFDM_min_index - OFDM_index[i]) / 2; /* Calculate Remnant tx_agc value, 2 index for 1 tx_agc */ - add_tx_power88xx_ac(priv, priv->pshare->add_tx_agc_index); - priv->pshare->add_tx_agc = 1; /* add_tx_agc Flag = 1 */ - OFDM_index[i] = OFDM_min_index; - } else { - if (priv->pshare->add_tx_agc) { /* tx_agc been added */ - priv->pshare->add_tx_agc = 0; - priv->pshare->add_tx_agc_index = 0; - add_tx_power88xx_ac(priv, 0); /* minus the added TPI */ - } - } - } - } -#else OFDM_index[rf_path] = ((OFDM_index[rf_path] < OFDM_min_index) ? OFDM_min_index : OFDM_index[rf_path]); -#endif RF_DBG(dm, DBG_RF_TX_PWR_TRACK, ">>> increse power ---> new OFDM_INDEX:%d (%d - %d)\n", OFDM_index[rf_path], priv->pshare->OFDM_index0[rf_path], get_tx_tracking_index(priv, channel, rf_path, delta, is_decrease, 0)); } } @@ -1291,7 +1235,7 @@ odm_reset_iqk_result( { return; } -#if 1/* !(DM_ODM_SUPPORT_TYPE & ODM_AP) */ + u8 odm_get_right_chnl_place_for_iqk(u8 chnl) { u8 channel_all[ODM_TARGET_CHNL_NUM_2G_5G] = { @@ -1309,7 +1253,7 @@ u8 odm_get_right_chnl_place_for_iqk(u8 chnl) return 0; } -#endif + void odm_iq_calibrate( diff --git a/hal/phydm/halrf/halphyrf_ce.c b/hal/phydm/halrf/halphyrf_ce.c index c8753e50..af4c141c 100644 --- a/hal/phydm/halrf/halphyrf_ce.c +++ b/hal/phydm/halrf/halphyrf_ce.c @@ -403,12 +403,6 @@ void odm_txpowertracking_callback_thermal_meter(void *adapter) u32 thermal_value_avg = 0, regc80, regcd0, regcd4, regab4; /* OFDM BB Swing should be less than +3.0dB, required by Arthur */ -#if 0 - u8 OFDM_min_index = 0; -#endif -#if 0 - /* get_right_chnl_place_for_iqk(hal_data->current_channel) */ -#endif u8 power_tracking_type = rf->pwt_type; s8 thermal_value_temp = 0; @@ -582,44 +576,7 @@ void odm_txpowertracking_callback_thermal_meter(void *adapter) p, cali_info->power_index_offset[p], cali_info->delta_power_index[p], cali_info->delta_power_index_last[p]); -#if 0 - - cali_info->OFDM_index[p] = cali_info->bb_swing_idx_ofdm_base[p] + cali_info->power_index_offset[p]; - cali_info->CCK_index = cali_info->bb_swing_idx_cck_base + cali_info->power_index_offset[p]; - - cali_info->bb_swing_idx_cck = cali_info->CCK_index; - cali_info->bb_swing_idx_ofdm[p] = cali_info->OFDM_index[p]; - - /*************Print BB Swing base and index Offset*************/ - - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "The 'CCK' final index(%d) = BaseIndex(%d) + power_index_offset(%d)\n", - cali_info->bb_swing_idx_cck, - cali_info->bb_swing_idx_cck_base, - cali_info->power_index_offset[p]); - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "The 'OFDM' final index(%d) = BaseIndex[%d](%d) + power_index_offset(%d)\n", - cali_info->bb_swing_idx_ofdm[p], p, - cali_info->bb_swing_idx_ofdm_base[p], - cali_info->power_index_offset[p]); - - /*4 7.1 Handle boundary conditions of index.*/ - - if (cali_info->OFDM_index[p] > c.swing_table_size_ofdm - 1) - cali_info->OFDM_index[p] = c.swing_table_size_ofdm - 1; - else if (cali_info->OFDM_index[p] <= OFDM_min_index) - cali_info->OFDM_index[p] = OFDM_min_index; -#endif } -#if 0 - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "\n\n========================================================================================================\n"); - - if (cali_info->CCK_index > c.swing_table_size_cck - 1) - cali_info->CCK_index = c.swing_table_size_cck - 1; - else if (cali_info->CCK_index <= 0) - cali_info->CCK_index = 0; -#endif } else { RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "Thermal is unchanged thermal=%d last_thermal=%d\n", @@ -629,20 +586,6 @@ void odm_txpowertracking_callback_thermal_meter(void *adapter) cali_info->power_index_offset[p] = 0; } -#if 0 - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "TxPowerTracking: [CCK] Swing Current index: %d, Swing base index: %d\n", - cali_info->CCK_index, - cali_info->bb_swing_idx_cck_base); /*Print Swing base & current*/ - - for (p = RF_PATH_A; p < c.rf_path_count; p++) { - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "TxPowerTracking: [OFDM] Swing Current index: %d, Swing base index[%d]: %d\n", - cali_info->OFDM_index[p], p, - cali_info->bb_swing_idx_ofdm_base[p]); - } -#endif - if ((dm->support_ic_type & ODM_RTL8814A)) { RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "power_tracking_type=%d\n", power_tracking_type); @@ -676,34 +619,6 @@ void odm_txpowertracking_callback_thermal_meter(void *adapter) cali_info->power_index_offset[RF_PATH_B] != 0 || cali_info->power_index_offset[RF_PATH_C] != 0 || cali_info->power_index_offset[RF_PATH_D] != 0)) { -#if 0 - /* 4 7.2 Configure the Swing Table to adjust Tx Power. */ - /*Always true after Tx Power is adjusted by power tracking.*/ - - cali_info->is_tx_power_changed = true; - /* 2012/04/23 MH According to Luke's suggestion, we can not write BB digital - * to increase TX power. Otherwise, EVM will be bad. - * - * 2012/04/25 MH Add for tx power tracking to set tx power in tx agc for 88E. - */ - if (thermal_value > cali_info->thermal_value) { - for (p = RF_PATH_A; p < c.rf_path_count; p++) { - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "Temperature Increasing(%d): delta_pi: %d, delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", - p, cali_info->power_index_offset[p], - delta, thermal_value, rf->eeprom_thermal, - cali_info->thermal_value); - } - } else if (thermal_value < cali_info->thermal_value) { /*Low temperature*/ - for (p = RF_PATH_A; p < c.rf_path_count; p++) { - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "Temperature Decreasing(%d): delta_pi: %d, delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", - p, cali_info->power_index_offset[p], - delta, thermal_value, rf->eeprom_thermal, - cali_info->thermal_value); - } - } -#endif #if !(DM_ODM_SUPPORT_TYPE & ODM_AP) if (thermal_value > rf->eeprom_thermal) { @@ -723,12 +638,6 @@ void odm_txpowertracking_callback_thermal_meter(void *adapter) odm_pwrtrk_method(dm); } -#if 0 - /*Record last time Power Tracking result as base.*/ - cali_info->bb_swing_idx_cck_base = cali_info->bb_swing_idx_cck; - for (p = RF_PATH_A; p < c.rf_path_count; p++) - cali_info->bb_swing_idx_ofdm_base[p] = cali_info->bb_swing_idx_ofdm[p]; -#endif RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "cali_info->thermal_value = %d thermal_value= %d\n", cali_info->thermal_value, thermal_value); @@ -784,43 +693,6 @@ void odm_txpowertracking_callback_thermal_meter(void *adapter) } } -#if 0 - if (cali_info->dpk_thermal[RF_PATH_A] != 0) { - if (diff_DPK[RF_PATH_A] >= c.threshold_dpk) { - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x1); - odm_set_bb_reg(dm, R_0xcc4, BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10), (diff_DPK[RF_PATH_A] / c.threshold_dpk)); - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x0); - } else if ((diff_DPK[RF_PATH_A] <= -1 * c.threshold_dpk)) { - s32 value = 0x20 + (diff_DPK[RF_PATH_A] / c.threshold_dpk); - - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x1); - odm_set_bb_reg(dm, R_0xcc4, BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10), value); - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x0); - } else { - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x1); - odm_set_bb_reg(dm, R_0xcc4, BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10), 0); - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x0); - } - } - if (cali_info->dpk_thermal[RF_PATH_B] != 0) { - if (diff_DPK[RF_PATH_B] >= c.threshold_dpk) { - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x1); - odm_set_bb_reg(dm, R_0xec4, BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10), (diff_DPK[RF_PATH_B] / c.threshold_dpk)); - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x0); - } else if ((diff_DPK[RF_PATH_B] <= -1 * c.threshold_dpk)) { - s32 value = 0x20 + (diff_DPK[RF_PATH_B] / c.threshold_dpk); - - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x1); - odm_set_bb_reg(dm, R_0xec4, BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10), value); - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x0); - } else { - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x1); - odm_set_bb_reg(dm, R_0xec4, BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10), 0); - odm_set_bb_reg(dm, R_0x82c, BIT(31), 0x0); - } - } -#endif - #endif RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "<===%s\n", __func__); @@ -912,9 +784,5 @@ void phydm_rf_watchdog(void *dm_void) struct dm_struct *dm = (struct dm_struct *)dm_void; #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) odm_txpowertracking_check(dm); -#if 0 -/*if (dm->support_ic_type & ODM_IC_11AC_SERIES)*/ -/*odm_iq_calibrate(dm);*/ -#endif #endif } diff --git a/hal/phydm/halrf/halphyrf_iot.c b/hal/phydm/halrf/halphyrf_iot.c index 8145fc9b..9b50a82a 100644 --- a/hal/phydm/halrf/halphyrf_iot.c +++ b/hal/phydm/halrf/halphyrf_iot.c @@ -188,11 +188,6 @@ odm_txpowertracking_callback_thermal_meter( RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "no pg, hal_data->eeprom_thermal_meter = 0x%x\n", rf->eeprom_thermal); return; } -#if 0 - /*4 3. Initialize ThermalValues of rf_calibrate_info*/ - //if (cali_info->is_reloadtxpowerindex) - // RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "reload ofdm index for band switch\n"); -#endif /*4 4. Calculate average thermal meter*/ cali_info->thermal_value_avg[cali_info->thermal_value_avg_index] = thermal_value; @@ -325,48 +320,6 @@ odm_txpowertracking_callback_thermal_meter( xtal_offset_eanble = (cali_info->xtal_offset_last != cali_info->xtal_offset); } } -#if 0 - for (p = RF_PATH_A; p < c.rf_path_count; p++) { - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "\n\n=========================== [path-%d] Calculating power_index_offset===========================\n", p); - - if (cali_info->delta_power_index[p] == cali_info->delta_power_index_last[p]) /*If Thermal value changes but lookup table value still the same*/ - cali_info->power_index_offset[p] = 0; - else - cali_info->power_index_offset[p] = cali_info->delta_power_index[p] - cali_info->delta_power_index_last[p]; /*Power index diff between 2 times Power Tracking*/ - - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "[path-%d] power_index_offset(%d) = delta_power_index(%d) - delta_power_index_last(%d)\n", p, cali_info->power_index_offset[p], cali_info->delta_power_index[p], cali_info->delta_power_index_last[p]); - - cali_info->OFDM_index[p] = cali_info->bb_swing_idx_ofdm_base[p] + cali_info->power_index_offset[p]; - cali_info->CCK_index = cali_info->bb_swing_idx_cck_base + cali_info->power_index_offset[p]; - - cali_info->bb_swing_idx_cck = cali_info->CCK_index; - cali_info->bb_swing_idx_ofdm[p] = cali_info->OFDM_index[p]; - - /*************Print BB Swing base and index Offset*************/ - - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "The 'CCK' final index(%d) = BaseIndex(%d) + power_index_offset(%d)\n", cali_info->bb_swing_idx_cck, cali_info->bb_swing_idx_cck_base, cali_info->power_index_offset[p]); - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "The 'OFDM' final index(%d) = BaseIndex[%d](%d) + power_index_offset(%d)\n", cali_info->bb_swing_idx_ofdm[p], p, cali_info->bb_swing_idx_ofdm_base[p], cali_info->power_index_offset[p]); - - /*4 7.1 Handle boundary conditions of index.*/ - - if (cali_info->OFDM_index[p] > c.swing_table_size_ofdm - 1) - cali_info->OFDM_index[p] = c.swing_table_size_ofdm - 1; - else if (cali_info->OFDM_index[p] <= OFDM_min_index) - cali_info->OFDM_index[p] = OFDM_min_index; - } - - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "\n\n========================================================================================================\n"); - - if (cali_info->CCK_index > c.swing_table_size_cck - 1) - cali_info->CCK_index = c.swing_table_size_cck - 1; - else if (cali_info->CCK_index <= 0) - cali_info->CCK_index = 0; -#endif } else { RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "The thermal meter is unchanged or TxPowerTracking OFF(%d): thermal_value: %d, cali_info->thermal_value: %d\n", @@ -375,17 +328,7 @@ odm_txpowertracking_callback_thermal_meter( for (p = RF_PATH_A; p < c.rf_path_count; p++) cali_info->power_index_offset[p] = 0; } -#if 0 - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "TxPowerTracking: [CCK] Swing Current index: %d, Swing base index: %d\n", - cali_info->CCK_index, cali_info->bb_swing_idx_cck_base); /*Print Swing base & current*/ - for (p = RF_PATH_A; p < c.rf_path_count; p++) { - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, - "TxPowerTracking: [OFDM] Swing Current index: %d, Swing base index[%d]: %d\n", - cali_info->OFDM_index[p], p, cali_info->bb_swing_idx_ofdm_base[p]); - } -#endif if (thermal_value > rf->eeprom_thermal) { RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "Temperature(%d) higher than PG value(%d)\n", thermal_value, rf->eeprom_thermal); diff --git a/hal/phydm/halrf/halrf.c b/hal/phydm/halrf/halrf.c index 1ca6ef76..472b746d 100644 --- a/hal/phydm/halrf/halrf.c +++ b/hal/phydm/halrf/halrf.c @@ -287,9 +287,7 @@ void halrf_iqk_xym_dump(void *dm_void) tmp1 = odm_read_4byte(dm, 0x1b1c); odm_write_4byte(dm, 0x1b00, 0xf800000a); tmp2 = odm_read_4byte(dm, 0x1b1c); -#if 0 - /*halrf_iqk_xym_read(dm, xym_type);*/ -#endif + odm_write_4byte(dm, 0x1b00, 0xf8000008); odm_write_4byte(dm, 0x1b1c, tmp1); odm_write_4byte(dm, 0x1b00, 0xf800000a); @@ -434,13 +432,6 @@ void halrf_iqk_dbg(void *dm_void) else RF_DBG(dm, DBG_RF_IQK, "%-20s: %s\n", "bandwidth", "BW_UNKNOWN"); -#if 0 -/* - * RF_DBG(dm, DBG_RF_IQK, "%-20s: %llu %s\n", - * "progressing_time", - * dm->rf_calibrate_info.iqk_total_progressing_time, "(ms)"); - */ -#endif RF_DBG(dm, DBG_RF_IQK, "%-20s: %s\n", "rfk_forbidden", (iqk_info->rfk_forbidden) ? "True" : "False"); #if (RTL8814A_SUPPORT == 1 || RTL8822B_SUPPORT == 1 || \ @@ -477,11 +468,6 @@ void halrf_iqk_dbg(void *dm_void) void halrf_lck_dbg(struct dm_struct *dm) { RF_DBG(dm, DBG_RF_IQK, "%-20s\n", "====== LCK Info ======"); -#if 0 - /*RF_DBG(dm, DBG_RF_IQK, "%-20s\n", - * (dm->fw_offload_ability & PHYDM_RF_IQK_OFFLOAD) ? "LCK" : "RTK")); - */ -#endif RF_DBG(dm, DBG_RF_IQK, "%-20s: %llu %s\n", "progressing_time", dm->rf_calibrate_info.lck_progressing_time, "(ms)"); } @@ -553,10 +539,6 @@ void halrf_iqk_dbg_cfir_backup_update(struct dm_struct *dm) (iqk->iqk_cfir_imag[2][path][idx][i] << 9); odm_write_4byte(dm, 0x1bd8, data); -#if 0 - /*odm_write_4byte(dm, 0x1bd8, iqk->iqk_cfir_real[2][path][idx][i]);*/ - /*odm_write_4byte(dm, 0x1bd8, iqk->iqk_cfir_imag[2][path][idx][i]);*/ -#endif } } odm_set_bb_reg(dm, R_0x1bd8, MASKDWORD, 0x0); @@ -591,10 +573,6 @@ void halrf_iqk_dbg_cfir_reload(struct dm_struct *dm) odm_set_bb_reg(dm, R_0x1b0c, bmask13_12, 0x1); odm_set_bb_reg(dm, R_0x1bd4, bmask20_16, 0x10); for (i = 0; i < 8; i++) { -#if 0 - /*odm_write_4byte(dm, 0x1bd8, iqk->iqk_cfir_real[0][path][idx][i]);*/ - /*odm_write_4byte(dm, 0x1bd8, iqk->iqk_cfir_imag[0][path][idx][i]);*/ -#endif data = ((0xc0000000 >> idx) + 0x3) + (i * 4) + (iqk->iqk_cfir_real[0][path][idx][i] << 9); @@ -677,20 +655,6 @@ void halrf_iqk_debug(void *dm_void, u32 *const dm_value, u32 *_used, { struct dm_struct *dm = (struct dm_struct *)dm_void; -#if 0 - /*dm_value[0]=0x0: backup from SRAM & show*/ - /*dm_value[0]=0x1: write backup CFIR to SRAM*/ - /*dm_value[0]=0x2: reload default CFIR to SRAM*/ - /*dm_value[0]=0x3: show backup*/ - /*dm_value[0]=0x10: write backup CFIR real part*/ - /*--> dm_value[1]:path, dm_value[2]:tx/rx, dm_value[3]:index, dm_value[4]:data*/ - /*dm_value[0]=0x11: write backup CFIR imag*/ - /*--> dm_value[1]:path, dm_value[2]:tx/rx, dm_value[3]:index, dm_value[4]:data*/ - /*dm_value[0]=0x20 :xym_read enable*/ - /*--> dm_value[1]:0:disable, 1:enable*/ - /*if dm_value[0]=0x20 = enable, */ - /*0x1:show rx_sym; 0x2: tx_xym; 0x3:gs1_xym; 0x4:gs2_sym; 0x5:rxk1_xym*/ -#endif if (dm_value[0] == 0x0) halrf_iqk_dbg_cfir_backup(dm); else if (dm_value[0] == 0x1) @@ -713,25 +677,6 @@ void halrf_iqk_debug(void *dm_void, u32 *const dm_value, u32 *_used, halrf_do_imr_test(dm, (u8)dm_value[1]); } -void halrf_iqk_hwtx_check(void *dm_void, boolean is_check) -{ -#if 0 - struct dm_struct *dm = (struct dm_struct *)dm_void; - struct dm_iqk_info *iqk_info = &dm->IQK_info; - u32 tmp_b04; - - if (is_check) { - iqk_info->is_hwtx = (boolean)odm_get_bb_reg(dm, R_0xb00, BIT(8)); - } else { - if (iqk_info->is_hwtx) { - tmp_b04 = odm_read_4byte(dm, 0xb04); - odm_set_bb_reg(dm, R_0xb04, BIT(3) | BIT(2), 0x0); - odm_write_4byte(dm, 0xb04, tmp_b04); - } - } -#endif -} - void halrf_segment_iqk_trigger(void *dm_void, boolean clear, boolean segment_iqk) { @@ -1236,48 +1181,9 @@ void halrf_supportability_init(void *dm_void) void halrf_watchdog(void *dm_void) { struct dm_struct *dm = (struct dm_struct *)dm_void; -#if 0 - /*RF_DBG(dm, DBG_RF_TMP, "%s\n", __func__);*/ -#endif - phydm_rf_watchdog(dm); } -#if 0 -void -halrf_iqk_init( - void *dm_void -) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - struct _hal_rf_ *rf = &dm->rf_table; - - switch (dm->support_ic_type) { -#if (RTL8814B_SUPPORT == 1) - case ODM_RTL8814B: - break; -#endif -#if (RTL8822B_SUPPORT == 1) - case ODM_RTL8822B: - _iq_calibrate_8822b_init(dm); - break; -#endif -#if (RTL8822C_SUPPORT == 1) - case ODM_RTL8822C: - _iq_calibrate_8822c_init(dm); - break; -#endif -#if (RTL8821C_SUPPORT == 1) - case ODM_RTL8821C: - break; -#endif - - default: - break; - } -} -#endif - void halrf_dack_trigger(void *dm_void) { struct dm_struct *dm = (struct dm_struct *)dm_void; @@ -1597,16 +1503,11 @@ void halrf_aac_check(struct dm_struct *dm) switch (dm->support_ic_type) { #if (RTL8821C_SUPPORT == 1) case ODM_RTL8821C: -#if 0 - aac_check_8821c(dm); -#endif break; #endif #if (RTL8822B_SUPPORT == 1) case ODM_RTL8822B: -#if 1 aac_check_8822b(dm); -#endif break; #endif default: @@ -1626,11 +1527,11 @@ void halrf_init(void *dm_void) halrf_supportability_init_mp(dm); else halrf_supportability_init(dm); -#if 1 + /*Init all RF funciton*/ halrf_aac_check(dm); halrf_dack_trigger(dm); -#endif + halrf_tssi_init(dm); } @@ -1935,14 +1836,7 @@ halrf_config_rfk_with_header_file(void *dm_void, u32 config_type) { struct dm_struct *dm = (struct dm_struct *)dm_void; enum hal_status result = HAL_STATUS_SUCCESS; -#if 0 -#if (RTL8822B_SUPPORT == 1) - if (dm->support_ic_type == ODM_RTL8822B) { - if (config_type == CONFIG_BB_RF_CAL_INIT) - odm_read_and_config_mp_8822b_cal_init(dm); - } -#endif -#endif + #if (RTL8198F_SUPPORT == 1) if (dm->support_ic_type == ODM_RTL8198F) { if (config_type == CONFIG_BB_RF_CAL_INIT) @@ -2262,13 +2156,7 @@ void halrf_mode(void *dm_void, u32 *i_value, u32 *q_value) break; } } while (c < 100); -#if 1 -#if 0 - for (i = 0; i < SN; i++) - RF_DBG(dm, DBG_RF_DACK, "[DACK]iv[%d] = 0x%x\n", i, iv[i]); - for (i = 0; i < SN; i++) - RF_DBG(dm, DBG_RF_DACK, "[DACK]qv[%d] = 0x%x\n", i, qv[i]); -#endif + /*i*/ m = 0; p = 0; @@ -2308,6 +2196,6 @@ void halrf_mode(void *dm_void, u32 *i_value, u32 *q_value) t = 0x400 - t; } *q_value = t; -#endif + } diff --git a/hal/phydm/halrf/halrf.h b/hal/phydm/halrf/halrf.h index bbd351a1..048ef802 100644 --- a/hal/phydm/halrf/halrf.h +++ b/hal/phydm/halrf/halrf.h @@ -461,7 +461,6 @@ struct _hal_rf_ { void halrf_iqk_info_dump(void *dm_void, u32 *_used, char *output, u32 *_out_len); -void halrf_iqk_hwtx_check(void *dm_void, boolean is_check); #endif u8 halrf_match_iqk_version(void *dm_void); diff --git a/hal/phydm/halrf/halrf_debug.c b/hal/phydm/halrf/halrf_debug.c index b64c7368..137d98e5 100644 --- a/hal/phydm/halrf/halrf_debug.c +++ b/hal/phydm/halrf/halrf_debug.c @@ -243,19 +243,5 @@ void halrf_init_debug_setting(void *dm_void) struct dm_struct *dm = (struct dm_struct *)dm_void; struct _hal_rf_ *rf = &dm->rf_table; - rf->rf_dbg_comp = -#if DBG -#if 0 - /*DBG_RF_TX_PWR_TRACK |*/ - /*DBG_RF_IQK | */ - /*DBG_RF_LCK | */ - /*DBG_RF_DPK | */ - /*DBG_RF_DACK | */ - /*DBG_RF_TXGAPK | */ - /*DBG_RF_MP | */ - /*DBG_RF_TMP | */ - /*DBG_RF_INIT | */ -#endif -#endif - 0; + rf->rf_dbg_comp = 0; } diff --git a/hal/phydm/halrf/halrf_kfree.c b/hal/phydm/halrf/halrf_kfree.c index cee13be2..cc93f569 100644 --- a/hal/phydm/halrf/halrf_kfree.c +++ b/hal/phydm/halrf/halrf_kfree.c @@ -359,10 +359,6 @@ void phydm_set_pa_bias_to_rf_8822b(void *dm_void, u8 e_rf_path, s8 tx_pa_bias) "[kfree] 8822b 2g rf(0x51)=0x%X rf(0x52)=0x%X path=%d\n", rf_reg_51, rf_reg_52, e_rf_path); -#if 0 - /*rf3f => rf52[19:17] = rf3f[2:0] rf52[16:15] = rf3f[4:3] rf52[3:0] = rf3f[8:5]*/ - /*rf3f => rf51[6:3] = rf3f[12:9] rf52[13] = rf3f[13]*/ -#endif rf_reg_3f = ((rf_reg_52 & 0xe0000) >> 17) | (((rf_reg_52 & 0x18000) >> 15) << 3) | ((rf_reg_52 & 0xf) << 5) | @@ -746,25 +742,6 @@ void phydm_set_kfree_to_rf_8192f(void *dm_void, u8 e_rf_path, u8 channel_idx, BIT(15) | BIT(14))), e_rf_path, channel_idx); } -#if 0 -/* -void phydm_clear_kfree_to_rf_8192f(void *dm_void, u8 e_rf_path, u8 data) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - struct dm_rf_calibration_struct *cali_info = &dm->rf_calibrate_info; - - odm_set_rf_reg(dm, e_rf_path, RF_0x55, BIT(19), (data & BIT(0))); - odm_set_rf_reg(dm, e_rf_path, RF_0x55, (BIT(18) | BIT(17) | BIT(16) | BIT(15) | BIT(14)), ((data & 0x1f) >> 1)); - - RF_DBG(dm, DBG_RF_MP, - "[kfree] 8192F clear power trim 0x55[19:14]=0x%X path=%d\n", - odm_get_rf_reg(dm, e_rf_path, RF_0x55, (BIT(19) | BIT(18) | BIT(17) | BIT(16) | BIT(15) | BIT(14))), - e_rf_path - ); -} -*/ -#endif - void phydm_get_thermal_trim_offset_8198f(void *dm_void) { struct dm_struct *dm = (struct dm_struct *)dm_void; @@ -891,42 +868,9 @@ void phydm_clear_kfree_to_rf_8198f(void *dm_void, u8 e_rf_path, u8 data) RF_DBG(dm, DBG_RF_MP, "[kfree] %s:Clear kfree to rf 0x55\n", __func__); -#if 0 - /*power_trim based on 55[19:14]*/ - odm_set_rf_reg(dm, e_rf_path, RF_0x55, BIT(5), 1); - /*enable 55[14] for 0.5db step*/ - odm_set_rf_reg(dm, e_rf_path, RF_0xf5, BIT(18), 1); - /*enter power_trim debug mode*/ - odm_set_rf_reg(dm, e_rf_path, RF_0xdf, BIT(7), 0); - /*write enable*/ - odm_set_rf_reg(dm, e_rf_path, RF_0xef, BIT(7), 1); - - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 0); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 1); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 2); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 3); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 4); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x70000, 5); - odm_set_rf_reg(dm, e_rf_path, RF_0x33, 0x3F, data); - - /*leave power_trim debug mode*/ - odm_set_rf_reg(dm, e_rf_path, RF_0xdf, BIT(7), 0); - /*enable 55[14] for 0.5db step*/ - odm_set_rf_reg(dm, e_rf_path, RF_0xf5, BIT(18), 0); - /*write disable*/ - odm_set_rf_reg(dm, e_rf_path, RF_0xef, BIT(7), 0); -#else odm_set_rf_reg(dm, e_rf_path, RF_0xdf, BIT(7), 1); /*odm_set_rf_reg(dm, e_rf_path, RF_0xf5, BIT(18), 0);*/ - -#endif - } @@ -997,16 +941,6 @@ void phydm_get_power_trim_offset(void *dm_void) { struct dm_struct *dm = (struct dm_struct *)dm_void; -#if 0 //(DM_ODM_SUPPORT_TYPE & ODM_WIN) // 2017 MH DM Should use the same code.s - void *adapter = dm->adapter; - HAL_DATA_TYPE *hal_data = GET_HAL_DATA(((PADAPTER)adapter)); - PEFUSE_HAL pEfuseHal = &hal_data->EfuseHal; - u1Byte eFuseContent[DCMD_EFUSE_MAX_SECTION_NUM * EFUSE_MAX_WORD_UNIT * 2]; - - if (HAL_MAC_Dump_EFUSE(&GET_HAL_MAC_INFO(adapter), EFUSE_WIFI, eFuseContent, pEfuseHal->PhysicalLen_WiFi, HAL_MAC_EFUSE_PHYSICAL, HAL_MAC_EFUSE_PARSE_DRV) != RT_STATUS_SUCCESS) - RF_DBG(dm, DBG_RF_MP, "[kfree] dump efuse fail !!!\n"); -#endif - if (dm->support_ic_type & ODM_RTL8821C) phydm_get_power_trim_offset_8821c(dm_void); else if (dm->support_ic_type & ODM_RTL8822B) @@ -1143,18 +1077,6 @@ void phydm_do_kfree(void *dm_void, u8 channel_to_sw) phydm_clear_kfree_to_rf(dm, rfpath, bb_gain); } } -#if 0 - /*else if(dm->support_ic_type & ODM_RTL8192F){ - if (channel_to_sw >= 1 && channel_to_sw <= 3) - channel_idx = 0; - if (channel_to_sw >= 4 && channel_to_sw <= 9) - channel_idx = 1; - if (channel_to_sw >= 9 && channel_to_sw <= 14) - channel_idx = 2; - for (rfpath = RF_PATH_A; rfpath < max_path; rfpath++) - phydm_clear_kfree_to_rf_8192f(dm, rfpath, pwrtrim->bb_gain[channel_idx][rfpath]); - }*/ -#endif } } @@ -1182,9 +1104,6 @@ void phydm_config_kfree(void *dm_void, u8 channel_to_sw) __func__); return; } -#if 0 - /*if kfree_table[0] == 0xff, means no Kfree*/ -#endif phydm_do_kfree(dm, channel_to_sw); } RF_DBG(dm, DBG_RF_MP, "<===[kfree] phy_ConfigKFree()\n"); diff --git a/hal/phydm/halrf/halrf_powertracking_ap.c b/hal/phydm/halrf/halrf_powertracking_ap.c index cafd92f8..ccb5c8d0 100644 --- a/hal/phydm/halrf/halrf_powertracking_ap.c +++ b/hal/phydm/halrf/halrf_powertracking_ap.c @@ -384,176 +384,6 @@ u32 cck_swing_table_ch1_ch14_8192f[CCK_TABLE_SIZE_8192F] = { }; -#if 0 -u32 ofdm_swing_table_92e[OFDM_TABLE_SIZE_92E] = { - /* Index0 6 dB */ 0x7fc001ff, - /* Index1 5.7dB */ 0x7b4001ed, - /* Index2 5.4dB */ 0x774001dd, - /* Index3 5.1dB */ 0x734001cd, - /* Index4 4.8dB */ 0x6f4001bd, - /* Index5 4.5dB */ 0x6b8001ae, - /* Index6 4.2dB */ 0x67c0019f, - /* Index7 3.9dB */ 0x64400191, - /* Index8 3.6dB */ 0x60c00183, - /* Index9 3.3dB */ 0x5d800176, - /* Index10 3 dB */ 0x5a80016a, - /* Index11 2.7dB */ 0x5740015d, - /* Index12 2.4dB */ 0x54400151, - /* Index13 2.1dB */ 0x51800146, - /* Index14 1.8dB */ 0x4ec0013b, - /* Index15 1.5dB */ 0x4c000130, - /* Index16 1.2dB */ 0x49800126, - /* Index17 0.9dB */ 0x4700011c, - /* Index18 0.6dB */ 0x44800112, - /* Index19 0.3dB */ 0x42000108, - /* Index20 0 dB */ 0x40000100, /* 20 This is OFDM base index */ - /* Index21 -0.3dB */ 0x3dc000f7, - /* Index22 -0.6dB */ 0x3bc000ef, - /* Index23 -0.9dB */ 0x39c000e7, - /* Index24 -1.2dB */ 0x37c000df, - /* Index25 -1.5dB */ 0x35c000d7, - /* Index26 -1.8dB */ 0x340000d0, - /* Index27 -2.1dB */ 0x324000c9, - /* Index28 -2.4dB */ 0x308000c2, - /* Index29 -2.7dB */ 0x2f0000bc, - /* Index30 -3 dB */ 0x2d4000b5, - /* Index31 -3.3dB */ 0x2bc000af, - /* Index32 -3.6dB */ 0x2a4000a9, - /* Index33 -3.9dB */ 0x28c000a3, - /* Index34 -4.2dB */ 0x2780009e, - /* Index35 -4.5dB */ 0x26000098, - /* Index36 -4.8dB */ 0x24c00093, - /* Index37 -5.1dB */ 0x2380008e, - /* Index38 -5.4dB */ 0x22400089, - /* Index39 -5.7dB */ 0x21400085, - /* Index40 -6 dB */ 0x20000080, - /* Index41 -6.3dB */ 0x1f00007c, - /* Index42 -6.6dB */ 0x1e000078, - /* Index43 -6.9dB */ 0x1d000074, - /* Index44 -7.2dB */ 0x1c000070, - /* Index45 -7.5dB */ 0x1b00006c, - /* Index46 -7.8dB */ 0x1a000068, - /* Index47 -8.1dB */ 0x19400065, - /* Index48 -8.4dB */ 0x18400061, - /* Index49 -8.7dB */ 0x1780005e, - /* Index50 -9 dB */ 0x16c0005b, - /* Index51 -9.3dB */ 0x16000058, - /* Index52 -9.6dB */ 0x15400055, - /* Index53 -9.9dB */ 0x14800052 -}; -u8 cck_swing_table_ch1_ch13_92e[CCK_TABLE_SIZE_92E][8] = { - /* Index0 0 dB */ {0x36, 0x34, 0x2E, 0x26, 0x1C, 0x12, 0x08, 0x04}, - /* Index1 -0.3dB */ {0x34, 0x32, 0x2C, 0x25, 0x1B, 0x11, 0x08, 0x04}, - /* Index2 -0.6dB */ {0x32, 0x30, 0x2B, 0x23, 0x1A, 0x11, 0x07, 0x04}, - /* Index3 -0.9dB */ {0x31, 0x2F, 0x29, 0x22, 0x19, 0x10, 0x07, 0x04}, - /* Index4 -1.2dB */ {0x2F, 0x2D, 0x28, 0x21, 0x18, 0x10, 0x07, 0x03}, - /* Index5 -1.5dB */ {0x2D, 0x2C, 0x27, 0x20, 0x18, 0x0F, 0x07, 0x03}, - /* Index6 -1.8dB */ {0x2C, 0x2A, 0x25, 0x1F, 0x17, 0x0F, 0x06, 0x03}, - /* Index7 -2.1dB */ {0x2A, 0x29, 0x24, 0x1E, 0x16, 0x0E, 0x06, 0x03}, - /* Index8 -2.4dB */ {0x29, 0x27, 0x23, 0x1D, 0x15, 0x0E, 0x06, 0x03}, - /* Index9 -2.7dB */ {0x27, 0x26, 0x22, 0x1C, 0x14, 0x0D, 0x06, 0x03}, - /* Index10 -3 dB */ {0x26, 0x25, 0x20, 0x1B, 0x14, 0x0D, 0x06, 0x03}, - /* Index11 -3.3dB */ {0x25, 0x23, 0x1F, 0x1A, 0x13, 0x0C, 0x05, 0x03}, - /* Index12 -3.6dB */ {0x24, 0x22, 0x1E, 0x19, 0x12, 0x0C, 0x05, 0x03}, - /* Index13 -3.9dB */ {0x22, 0x21, 0x1D, 0x18, 0x12, 0x0B, 0x05, 0x03}, - /* Index14 -4.2dB */ {0x21, 0x20, 0x1C, 0x17, 0x11, 0x0B, 0x05, 0x02}, - /* Index15 -4.5dB */ {0x20, 0x1F, 0x1B, 0x17, 0x11, 0x0B, 0x05, 0x02}, - /* Index16 -4.8dB */ {0x1F, 0x1E, 0x1A, 0x16, 0x10, 0x0A, 0x05, 0x02}, - /* Index17 -5.1dB */ {0x1E, 0x1D, 0x1A, 0x15, 0x10, 0x0A, 0x04, 0x02}, - /* Index18 -5.4dB */ {0x1D, 0x1C, 0x19, 0x14, 0x0F, 0x0A, 0x04, 0x02}, - /* Index19 -5.7dB */ {0x1C, 0x1B, 0x18, 0x14, 0x0E, 0x09, 0x04, 0x02}, - /* Index20 -6.0dB */ {0x1B, 0x1A, 0x17, 0x13, 0x0E, 0x09, 0x04, 0x02}, /* 20 This is CCK base index */ - /* Index21 -6.3dB */ {0x1A, 0x19, 0x16, 0x12, 0x0E, 0x09, 0x04, 0x02}, - /* Index22 -6.6dB */ {0x19, 0x18, 0x15, 0x12, 0x0D, 0x08, 0x04, 0x02}, - /* Index23 -6.9dB */ {0x18, 0x17, 0x15, 0x11, 0x0D, 0x08, 0x04, 0x02}, - /* Index24 -7.2dB */ {0x18, 0x17, 0x14, 0x11, 0x0C, 0x08, 0x03, 0x02}, - /* Index25 -7.5dB */ {0x17, 0x16, 0x13, 0x10, 0x0C, 0x08, 0x03, 0x02}, - /* Index26 -7.8dB */ {0x16, 0x15, 0x13, 0x0F, 0x0B, 0x07, 0x03, 0x02}, - /* Index27 -8.1dB */ {0x15, 0x14, 0x12, 0x0F, 0x0B, 0x07, 0x03, 0x02}, - /* Index28 -8.4dB */ {0x14, 0x14, 0x11, 0x0E, 0x0B, 0x07, 0x03, 0x02}, - /* Index29 -8.7dB */ {0x14, 0x13, 0x11, 0x0E, 0x0A, 0x07, 0x03, 0x01}, - /* Index30 -9.0dB */ {0x13, 0x12, 0x10, 0x0D, 0x0A, 0x06, 0x03, 0x01}, /* 30 This is hp CCK base index */ - /* Index31 -9.3dB */ {0x12, 0x12, 0x0F, 0x0D, 0x0A, 0x06, 0x03, 0x01}, - /* Index32 -9.6dB */ {0x12, 0x11, 0x0F, 0x0D, 0x09, 0x06, 0x03, 0x01}, - /* Index33 -9.9dB */ {0x11, 0x11, 0x0F, 0x0C, 0x09, 0x06, 0x03, 0x01}, - /* Index34 -10.2dB */ {0x11, 0x11, 0x0E, 0x0C, 0x09, 0x06, 0x02, 0x01}, - /* Index35 -10.5dB */ {0x10, 0x0F, 0x0E, 0x0B, 0x08, 0x05, 0x02, 0x01}, - /* Index36 -10.8dB */ {0x10, 0x0F, 0x0D, 0x0B, 0x08, 0x05, 0x02, 0x01}, - /* Index37 -11.1dB */ {0x0F, 0x0E, 0x0D, 0x0A, 0x08, 0x05, 0x02, 0x01}, - /* Index38 -11.4dB */ {0x0E, 0x0E, 0x0C, 0x0A, 0x07, 0x05, 0x02, 0x01}, - /* Index39 -11.7dB */ {0x0E, 0x0D, 0x0C, 0x0A, 0x07, 0x05, 0x02, 0x01}, - /* Index40 -12 dB */ {0x0E, 0x0D, 0x0C, 0x0A, 0x07, 0x05, 0x02, 0x01}, - /* Index41 -12.3dB */ {0x0D, 0x0D, 0x0B, 0x09, 0x07, 0x04, 0x02, 0x01}, - /* Index42 -12.6dB */ {0x0D, 0x0C, 0x0B, 0x09, 0x07, 0x04, 0x02, 0x01}, - /* Index43 -12.9dB */ {0x0C, 0x0C, 0x0A, 0x09, 0x06, 0x04, 0x02, 0x01}, - /* Index44 -13.2dB */ {0x0C, 0x0B, 0x0A, 0x08, 0x06, 0x04, 0x02, 0x01}, - /* Index45 -13.5dB */ {0x0B, 0x0B, 0x0A, 0x08, 0x06, 0x04, 0x02, 0x01}, - /* Index46 -13.8dB */ {0x0B, 0x0B, 0x09, 0x08, 0x06, 0x04, 0x02, 0x01}, - /* Index47 -14.1dB */ {0x0B, 0x0A, 0x09, 0x07, 0x06, 0x04, 0x02, 0x01}, - /* Index48 -14.4dB */ {0x0A, 0x0A, 0x09, 0x07, 0x05, 0x03, 0x02, 0x01}, - /* Index49 -14.7dB */ {0x0A, 0x0A, 0x08, 0x07, 0x05, 0x03, 0x01, 0x01}, - /* Index50 -15 dB */ {0x0A, 0x09, 0x08, 0x07, 0x05, 0x03, 0x01, 0x01}, - /* Index51 -15.3dB */ {0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, - /* Index52 -15.6dB */ {0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, - /* Index53 -15.9dB */ {0x09, 0x08, 0x07, 0x06, 0x04, 0x03, 0x01, 0x01} -}; -u8 cck_swing_table_ch14_92e[CCK_TABLE_SIZE_92E][8] = { - /* Index0 0 dB */ {0x36, 0x34, 0x2E, 0x26, 0x00, 0x00, 0x00, 0x00}, - /* Index1 -0.3dB */ {0x34, 0x32, 0x2C, 0x25, 0x00, 0x00, 0x00, 0x00}, - /* Index2 -0.6dB */ {0x32, 0x30, 0x2B, 0x23, 0x00, 0x00, 0x00, 0x00}, - /* Index3 -0.9dB */ {0x31, 0x2F, 0x29, 0x22, 0x00, 0x00, 0x00, 0x00}, - /* Index4 -1.2dB */ {0x2F, 0x2D, 0x28, 0x21, 0x00, 0x00, 0x00, 0x00}, - /* Index5 -1.5dB */ {0x2D, 0x2C, 0x27, 0x20, 0x00, 0x00, 0x00, 0x00}, - /* Index6 -1.8dB */ {0x2C, 0x2A, 0x25, 0x1F, 0x00, 0x00, 0x00, 0x00}, - /* Index7 -2.1dB */ {0x2A, 0x29, 0x24, 0x1E, 0x00, 0x00, 0x00, 0x00}, - /* Index8 -2.4dB */ {0x29, 0x27, 0x23, 0x1D, 0x00, 0x00, 0x00, 0x00}, - /* Index9 -2.7dB */ {0x27, 0x26, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x00}, - /* Index10 -3 dB */ {0x26, 0x25, 0x20, 0x1B, 0x00, 0x00, 0x00, 0x00}, - /* Index11 -3.3dB */ {0x25, 0x23, 0x1F, 0x1A, 0x00, 0x00, 0x00, 0x00}, - /* Index12 -3.6dB */ {0x24, 0x22, 0x1E, 0x19, 0x00, 0x00, 0x00, 0x00}, - /* Index13 -3.9dB */ {0x22, 0x21, 0x1D, 0x18, 0x00, 0x00, 0x00, 0x00}, - /* Index14 -4.2dB */ {0x21, 0x20, 0x1C, 0x17, 0x00, 0x00, 0x00, 0x00}, - /* Index15 -4.5dB */ {0x20, 0x1F, 0x1B, 0x17, 0x00, 0x00, 0x00, 0x00}, - /* Index16 -4.8dB */ {0x1F, 0x1E, 0x1A, 0x16, 0x00, 0x00, 0x00, 0x00}, - /* Index17 -5.1dB */ {0x1E, 0x1D, 0x1A, 0x15, 0x00, 0x00, 0x00, 0x00}, - /* Index18 -5.4dB */ {0x1D, 0x1C, 0x19, 0x14, 0x00, 0x00, 0x00, 0x00}, - /* Index19 -5.7dB */ {0x1C, 0x1B, 0x18, 0x14, 0x00, 0x00, 0x00, 0x00}, - /* Index20 -6 dB */ {0x1B, 0x1A, 0x17, 0x13, 0x00, 0x00, 0x00, 0x00}, - /* Index21 -6.3dB */ {0x1A, 0x19, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00}, - /* Index22 -6.6dB */ {0x19, 0x18, 0x15, 0x12, 0x00, 0x00, 0x00, 0x00}, - /* Index23 -6.9dB */ {0x18, 0x17, 0x15, 0x11, 0x00, 0x00, 0x00, 0x00}, - /* Index24 -7.2dB */ {0x18, 0x17, 0x14, 0x11, 0x00, 0x00, 0x00, 0x00}, - /* Index25 -7.5dB */ {0x17, 0x16, 0x13, 0x10, 0x00, 0x00, 0x00, 0x00}, - /* Index26 -7.8dB */ {0x16, 0x15, 0x13, 0x0F, 0x00, 0x00, 0x00, 0x00}, - /* Index27 -8.1dB */ {0x15, 0x14, 0x12, 0x0F, 0x00, 0x00, 0x00, 0x00}, - /* Index28 -8.4dB */ {0x14, 0x14, 0x11, 0x0E, 0x00, 0x00, 0x00, 0x00}, - /* Index29 -8.7dB */ {0x14, 0x13, 0x11, 0x0E, 0x00, 0x00, 0x00, 0x00}, - /* Index30 -9 dB */ {0x13, 0x12, 0x10, 0x0D, 0x00, 0x00, 0x00, 0x00}, - /* Index31 -9.3dB */ {0x12, 0x12, 0x0F, 0x0D, 0x00, 0x00, 0x00, 0x00}, - /* Index32 -9.6dB */ {0x12, 0x11, 0x0F, 0x0D, 0x00, 0x00, 0x00, 0x00}, - /* Index33 -9.9dB */ {0x11, 0x11, 0x0F, 0x0C, 0x00, 0x00, 0x00, 0x00}, - /* Index34 -10.2dB */ {0x11, 0x11, 0x0E, 0x0C, 0x00, 0x00, 0x00, 0x00}, - /* Index35 -10.5dB */ {0x10, 0x0F, 0x0E, 0x0B, 0x00, 0x00, 0x00, 0x00}, - /* Index36 -10.8dB */ {0x10, 0x0F, 0x0D, 0x0B, 0x00, 0x00, 0x00, 0x00}, - /* Index37 -11.1dB */ {0x0F, 0x0E, 0x0D, 0x0A, 0x00, 0x00, 0x00, 0x00}, - /* Index38 -11.4dB */ {0x0E, 0x0E, 0x0C, 0x0A, 0x00, 0x00, 0x00, 0x00}, - /* Index39 -11.7dB */ {0x0E, 0x0D, 0x0C, 0x0A, 0x00, 0x00, 0x00, 0x00}, - /* Index40 -12 dB */ {0x0E, 0x0D, 0x0C, 0x0A, 0x00, 0x00, 0x00, 0x00}, - /* Index41 -12.3dB */ {0x0D, 0x0D, 0x0B, 0x09, 0x00, 0x00, 0x00, 0x00}, - /* Index42 -12.6dB */ {0x0D, 0x0C, 0x0B, 0x09, 0x00, 0x00, 0x00, 0x00}, - /* Index43 -12.9dB */ {0x0C, 0x0C, 0x0A, 0x09, 0x00, 0x00, 0x00, 0x00}, - /* Index44 -13.2dB */ {0x0C, 0x0B, 0x0A, 0x08, 0x00, 0x00, 0x00, 0x00}, - /* Index45 -13.5dB */ {0x0B, 0x0B, 0x0A, 0x08, 0x00, 0x00, 0x00, 0x00}, - /* Index46 -13.8dB */ {0x0B, 0x0B, 0x09, 0x08, 0x00, 0x00, 0x00, 0x00}, - /* Index47 -14.1dB */ {0x0B, 0x0A, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00}, - /* Index48 -14.4dB */ {0x0A, 0x0A, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00}, - /* Index49 -14.7dB */ {0x0A, 0x0A, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00}, - /* Index50 -15 dB */ {0x0A, 0x09, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00}, - /* Index51 -15.3dB */ {0x09, 0x09, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00}, - /* Index52 -15.6dB */ {0x09, 0x09, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00}, - /* Index53 -15.9dB */ {0x09, 0x08, 0x07, 0x06, 0x00, 0x00, 0x00, 0x00} -}; -#endif #endif diff --git a/hal/phydm/halrf/halrf_powertracking_ap.h b/hal/phydm/halrf/halrf_powertracking_ap.h index 1f960cf4..218cdaf0 100644 --- a/hal/phydm/halrf/halrf_powertracking_ap.h +++ b/hal/phydm/halrf/halrf_powertracking_ap.h @@ -279,49 +279,7 @@ struct dm_rf_calibration_struct { u8 is_ap_kdone; u8 is_apk_thermal_meter_ignore; u8 is_dp_done; -#if 0 /*move below members to halrf_dpk.h*/ - u8 is_dp_path_aok; - u8 is_dp_path_bok; - u8 is_dp_path_cok; - u8 is_dp_path_dok; - u8 dp_path_a_result[3]; - u8 dp_path_b_result[3]; - u8 dp_path_c_result[3]; - u8 dp_path_d_result[3]; - boolean is_dpk_enable; - u32 txrate[11]; - u8 pwsf_2g_a[3]; - u8 pwsf_2g_b[3]; - u8 pwsf_2g_c[3]; - u8 pwsf_2g_d[3]; - u32 lut_2g_even_a[3][64]; - u32 lut_2g_odd_a[3][64]; - u32 lut_2g_even_b[3][64]; - u32 lut_2g_odd_b[3][64]; - u32 lut_2g_even_c[3][64]; - u32 lut_2g_odd_c[3][64]; - u32 lut_2g_even_d[3][64]; - u32 lut_2g_odd_d[3][64]; - u1Byte is_5g_pdk_a_ok; - u1Byte is_5g_pdk_b_ok; - u1Byte is_5g_pdk_c_ok; - u1Byte is_5g_pdk_d_ok; - u1Byte pwsf_5g_a[9]; - u1Byte pwsf_5g_b[9]; - u1Byte pwsf_5g_c[9]; - u1Byte pwsf_5g_d[9]; - u4Byte lut_5g_even_a[9][16]; - u4Byte lut_5g_odd_a[9][16]; - u4Byte lut_5g_even_b[9][16]; - u4Byte lut_5g_odd_b[9][16]; - u4Byte lut_5g_even_c[9][16]; - u4Byte lut_5g_odd_c[9][16]; - u4Byte lut_5g_even_d[9][16]; - u4Byte lut_5g_odd_d[9][16]; - u8 thermal_value_dpk; - u8 thermal_value_dpk_avg[AVG_THERMAL_NUM_DPK]; - u8 thermal_value_dpk_avg_index; -#endif + s8 modify_tx_agc_value_ofdm; s8 modify_tx_agc_value_cck; diff --git a/hal/phydm/halrf/halrf_powertracking_ce.c b/hal/phydm/halrf/halrf_powertracking_ce.c index 926bda96..d783af97 100644 --- a/hal/phydm/halrf/halrf_powertracking_ce.c +++ b/hal/phydm/halrf/halrf_powertracking_ce.c @@ -692,9 +692,7 @@ void odm_txpowertracking_thermal_meter_init(void *dm_void) RF_DBG(dm, DBG_RF_IQK, "dm txpowertrack_control = %d\n", cali_info->txpowertrack_control); -#if 0 - /* dm->rf_calibrate_info.txpowertrack_control = true; */ -#endif + cali_info->thermal_value = rf->eeprom_thermal; cali_info->thermal_value_iqk = rf->eeprom_thermal; cali_info->thermal_value_lck = rf->eeprom_thermal; diff --git a/hal/phydm/halrf/halrf_powertracking_win.c b/hal/phydm/halrf/halrf_powertracking_win.c index 5766e951..dcdccce1 100644 --- a/hal/phydm/halrf/halrf_powertracking_win.c +++ b/hal/phydm/halrf/halrf_powertracking_win.c @@ -705,17 +705,7 @@ odm_txpowertracking_thermal_meter_init( } -void -odm_txpowertracking_check( - void *dm_void -) -{ - -#if 0 - /* 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate */ - /* at the same time. In the stage2/3, we need to prive universal interface and merge all */ - /* HW dynamic mechanism. */ -#endif +void odm_txpowertracking_check(void *dm_void) { struct dm_struct *dm = (struct dm_struct *)dm_void; switch (dm->support_platform) { diff --git a/hal/phydm/halrf/halrf_psd.c b/hal/phydm/halrf/halrf_psd.c index 8c2f8742..c5392e23 100644 --- a/hal/phydm/halrf/halrf_psd.c +++ b/hal/phydm/halrf/halrf_psd.c @@ -138,11 +138,6 @@ void halrf_psd( else psd_reg = R_0x808; -#if 0 - dbg_print("[PSD]point=%d, start_point=%d, stop_point=%d, average=%d, average_tmp=%d, buf_size=%d\n", - point, start_point, stop_point, average, average_tmp, psd->buf_size); -#endif - for (i = 0; i < psd->buf_size; i++) psd->psd_data[i] = 0; @@ -158,17 +153,6 @@ void halrf_psd( odm_set_bb_reg(dm, psd_reg, 0x3000, 0x1); } -#if 0 - if (avg_temp == 0) - avg = 1; - else if (avg_temp == 1) - avg = 8; - else if (avg_temp == 2) - avg = 16; - else if (avg_temp == 3) - avg = 32; -#endif - i = start_point; while (i < stop_point) { data_tatal = 0; @@ -181,18 +165,7 @@ void halrf_psd( for (k = 0; k < average_tmp; k++) { data_temp[k] = halrf_get_psd_data(dm, point_temp); data_tatal = data_tatal + (data_temp[k] * data_temp[k]); - -#if 0 - if ((k % 20) == 0) - dbg_print("\n "); - - dbg_print("0x%x ", data_temp[k]); -#endif } -#if 0 - /*dbg_print("\n");*/ -#endif - data_tatal = ((data_tatal * 100) / average_tmp); psd->psd_data[j] = (u32)_sqrt(data_tatal); @@ -200,16 +173,6 @@ void halrf_psd( j++; } -#if 0 - for (i = 0; i < psd->buf_size; i++) { - if ((i % 20) == 0) - dbg_print("\n "); - - dbg_print("0x%x ", psd->psd_data[i]); - } - dbg_print("\n\n"); -#endif - if (dm->support_ic_type & ODM_RTL8710B) odm_set_bb_reg(dm, psd_reg, 0x30000, avg_org); else @@ -293,10 +256,6 @@ void halrf_iqk_psd( else average_tmp = 1; } -#if 0 - DbgPrint("[PSD]point=%d, start_point=%d, stop_point=%d, average=0x%x, average_tmp=%d, buf_size=%d, mode=%d\n", - point, start_point, stop_point, average, average_tmp, psd->buf_size, mode); -#endif for (i = 0; i < psd->buf_size; i++) psd->psd_data[i] = 0; @@ -323,12 +282,7 @@ void halrf_iqk_psd( /*data_tatal = data_tatal + (data_temp[k] * data_temp[k]);*/ data_tatal = data_tatal + data_temp[k]; -#if 0 - if ((k % 20) == 0) - DbgPrint("\n "); - DbgPrint("0x%x ", data_temp[k]); -#endif } /*data_tatal = ((data_tatal * 100) / average_tmp);*/ @@ -340,17 +294,6 @@ void halrf_iqk_psd( j++; } -#if 0 - DbgPrint("\n [iqk psd]psd result:\n"); - - for (i = 0; i < psd->buf_size; i++) { - if ((i % 20) == 0) - DbgPrint("\n "); - - DbgPrint("0x%x ", psd->psd_data[i]); - } - DbgPrint("\n\n"); -#endif } diff --git a/hal/phydm/halrf/halrf_txgapcal.c b/hal/phydm/halrf/halrf_txgapcal.c index 0cc44974..c69a6064 100644 --- a/hal/phydm/halrf/halrf_txgapcal.c +++ b/hal/phydm/halrf/halrf_txgapcal.c @@ -204,15 +204,6 @@ void odm_tx_gain_gap_calibration_8197f( psd_gap = psd_value_next / (psd_value_current / 1000); -#if 0 - if (psd_gap > 1413) - delta_gain_gap[rf_path][rf0_idx] = 1; - else if (psd_gap > 1122) - delta_gain_gap[rf_path][rf0_idx] = 0; - else - delta_gain_gap[rf_path][rf0_idx] = -1; -#endif - if (psd_gap > 1445) delta_gain_gap[rf_path][rf0_idx] = 1; else if (psd_gap > 1096) @@ -256,10 +247,6 @@ void odm_tx_gain_gap_calibration_8197f( ODM_delay_us(100); } -#if 0 - /*odm_set_bb_reg(dm, R_0x88c, (BIT(23) | BIT(22) | BIT(21) | BIT(20)), 0x0);*/ /*enable 3-wire*/ -#endif - for (rf_path = RF_PATH_A; rf_path <= RF_PATH_B; rf_path++) { odm_set_rf_reg(dm, rf_path, RF_0xef, bRFRegOffsetMask, 0x00100); diff --git a/hal/phydm/halrf/rtl8192e/halrf_8192e_ap.c b/hal/phydm/halrf/rtl8192e/halrf_8192e_ap.c index 45c3e402..23d2de22 100644 --- a/hal/phydm/halrf/rtl8192e/halrf_8192e_ap.c +++ b/hal/phydm/halrf/rtl8192e/halrf_8192e_ap.c @@ -63,261 +63,6 @@ void halrf_rf_lna_setting_8192e( } } - -#if 0 -void set_iqk_matrix_8192e( - struct dm_struct *dm, - u8 OFDM_index, - u8 rf_path, - s32 iqk_result_x, - s32 iqk_result_y -) -{ - s32 ele_A = 0, ele_D, ele_C = 0, value32; - - ele_D = (ofdm_swing_table_new[OFDM_index] & 0xFFC00000) >> 22; - - /*new element A = element D x X*/ - if ((iqk_result_x != 0) && (*(dm->band_type) == ODM_BAND_2_4G)) { - if ((iqk_result_x & 0x00000200) != 0) /* consider minus */ - iqk_result_x = iqk_result_x | 0xFFFFFC00; - ele_A = ((iqk_result_x * ele_D) >> 8) & 0x000003FF; - - /* new element C = element D x Y */ - if ((iqk_result_y & 0x00000200) != 0) - iqk_result_y = iqk_result_y | 0xFFFFFC00; - ele_C = ((iqk_result_y * ele_D) >> 8) & 0x000003FF; - - /*if (rf_path == RF_PATH_A)// Remove this to Fix path B PowerTracking */ - switch (rf_path) { - case RF_PATH_A: - /* wirte new elements A, C, D to regC80 and regC94, element B is always 0 */ - value32 = (ele_D << 22) | ((ele_C & 0x3F) << 16) | ele_A; - odm_set_bb_reg(dm, REG_OFDM_0_XA_TX_IQ_IMBALANCE, MASKDWORD, value32); - - value32 = (ele_C & 0x000003C0) >> 6; - odm_set_bb_reg(dm, REG_OFDM_0_XC_TX_AFE, MASKH4BITS, value32); - - value32 = ((iqk_result_x * ele_D) >> 7) & 0x01; - odm_set_bb_reg(dm, REG_OFDM_0_ECCA_THRESHOLD, BIT(24), value32); - break; - case RF_PATH_B: - /* wirte new elements A, C, D to regC88 and regC9C, element B is always 0 */ - value32 = (ele_D << 22) | ((ele_C & 0x3F) << 16) | ele_A; - odm_set_bb_reg(dm, REG_OFDM_0_XB_TX_IQ_IMBALANCE, MASKDWORD, value32); - - value32 = (ele_C & 0x000003C0) >> 6; - odm_set_bb_reg(dm, REG_OFDM_0_XD_TX_AFE, MASKH4BITS, value32); - - value32 = ((iqk_result_x * ele_D) >> 7) & 0x01; - odm_set_bb_reg(dm, REG_OFDM_0_ECCA_THRESHOLD, BIT(28), value32); - - break; - default: - break; - } - } else { - switch (rf_path) { - case RF_PATH_A: - odm_set_bb_reg(dm, REG_OFDM_0_XA_TX_IQ_IMBALANCE, MASKDWORD, ofdm_swing_table_new[OFDM_index]); - odm_set_bb_reg(dm, REG_OFDM_0_XC_TX_AFE, MASKH4BITS, 0x00); - odm_set_bb_reg(dm, REG_OFDM_0_ECCA_THRESHOLD, BIT(24), 0x00); - break; - - case RF_PATH_B: - odm_set_bb_reg(dm, REG_OFDM_0_XB_TX_IQ_IMBALANCE, MASKDWORD, ofdm_swing_table_new[OFDM_index]); - odm_set_bb_reg(dm, REG_OFDM_0_XD_TX_AFE, MASKH4BITS, 0x00); - odm_set_bb_reg(dm, REG_OFDM_0_ECCA_THRESHOLD, BIT(28), 0x00); - break; - - default: - break; - } - } - - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "TxPwrTracking path %c: X = 0x%x, Y = 0x%x ele_A = 0x%x ele_C = 0x%x ele_D = 0x%x 0xeb4 = 0x%x 0xebc = 0x%x\n", - (rf_path == RF_PATH_A ? 'A' : 'B'), (u32)iqk_result_x, (u32)iqk_result_y, (u32)ele_A, (u32)ele_C, (u32)ele_D, (u32)iqk_result_x, (u32)iqk_result_y); -} - -void do_iqk_8192e( - void *dm_void, - u8 delta_thermal_index, - u8 thermal_value, - u8 threshold -) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; -#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) - void *adapter = dm->adapter; - HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); -#endif - - odm_reset_iqk_result(dm); - -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) -#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) -#if USE_WORKITEM - platform_acquire_mutex(&hal_data->mx_chnl_bw_control); -#else - platform_acquire_spin_lock(adapter, RT_CHANNEL_AND_BANDWIDTH_SPINLOCK); -#endif -#elif ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) - platform_acquire_mutex(&hal_data->mx_chnl_bw_control); -#endif -#endif - - - dm->rf_calibrate_info.thermal_value_iqk = thermal_value; -#if (DM_ODM_SUPPORT_TYPE & ODM_AP) - phy_iq_calibrate_8192e(dm, false); -#else - phy_iq_calibrate_8192e(adapter, false); -#endif - -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) -#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) -#if USE_WORKITEM - platform_release_mutex(&hal_data->mx_chnl_bw_control); -#else - platform_release_spin_lock(adapter, RT_CHANNEL_AND_BANDWIDTH_SPINLOCK); -#endif -#elif ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) - platform_release_mutex(&hal_data->mx_chnl_bw_control); -#endif -#endif -} - -/*----------------------------------------------------------------------------- - * Function: odm_TxPwrTrackSetPwr88E() - * - * Overview: 88E change all channel tx power accordign to flag. - * OFDM & CCK are all different. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 04/23/2012 MHC Create version 0. - * - *---------------------------------------------------------------------------*/ -void -odm_tx_pwr_track_set_pwr92_e( - struct dm_struct *dm, - enum pwrtrack_method method, - u8 rf_path, - u8 channel_mapped_index -) -{ - if (method == TXAGC) { - u8 rf = 0; - u32 pwr = 0, tx_agc = 0; - void *adapter = dm->adapter; - - RF_DBG(dm, DBG_RF_TX_PWR_TRACK, "odm_TxPwrTrackSetPwr92E CH=%d\n", *(dm->channel)); -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) - -#if (MP_DRIVER != 1) - phy_set_tx_power_level8192e(dm->adapter, *dm->channel); -#else - pwr = phy_query_bb_reg(adapter, REG_TX_AGC_A_RATE18_06, 0xFF); - pwr += dm->rf_calibrate_info.power_index_offset[RF_PATH_A]; - phy_set_bb_reg(adapter, REG_TX_AGC_A_CCK_1_MCS32, MASKBYTE1, pwr); - tx_agc = (pwr << 16) | (pwr << 8) | (pwr); - phy_set_bb_reg(adapter, REG_TX_AGC_B_CCK_11_A_CCK_2_11, 0xffffff00, tx_agc); - RT_DISP(FPHY, PHY_TXPWR, ("odm_tx_pwr_track_set_pwr88_e: CCK Tx-rf(A) Power = 0x%x\n", tx_agc)); - - pwr = phy_query_bb_reg(adapter, REG_TX_AGC_A_RATE18_06, 0xFF); - pwr += (dm->bb_swing_idx_ofdm[RF_PATH_A] - dm->bb_swing_idx_ofdm_base[RF_PATH_A]); - tx_agc |= ((pwr << 24) | (pwr << 16) | (pwr << 8) | pwr); - phy_set_bb_reg(adapter, REG_TX_AGC_A_RATE18_06, MASKDWORD, tx_agc); - phy_set_bb_reg(adapter, REG_TX_AGC_A_RATE54_24, MASKDWORD, tx_agc); - phy_set_bb_reg(adapter, REG_TX_AGC_A_MCS03_MCS00, MASKDWORD, tx_agc); - phy_set_bb_reg(adapter, REG_TX_AGC_A_MCS07_MCS04, MASKDWORD, tx_agc); - phy_set_bb_reg(adapter, REG_TX_AGC_A_MCS11_MCS08, MASKDWORD, tx_agc); - phy_set_bb_reg(adapter, REG_TX_AGC_A_MCS15_MCS12, MASKDWORD, tx_agc); - RT_DISP(FPHY, PHY_TXPWR, ("odm_tx_pwr_track_set_pwr88_e: OFDM Tx-rf(A) Power = 0x%x\n", tx_agc)); -#endif - -#endif -#if (DM_ODM_SUPPORT_TYPE & ODM_AP) - phy_rf6052_set_cck_tx_power(dm->priv, *(dm->channel)); - phy_rf6052_set_ofdm_tx_power(dm->priv, *(dm->channel)); -#endif - - } else if (method == BBSWING) { - /* Adjust BB swing by CCK filter coefficient */ - if (*dm->channel != 14) { - odm_write_1byte(dm, 0xa22, cck_swing_table_ch1_ch13_92e[dm->bb_swing_idx_cck][0]); - odm_write_1byte(dm, 0xa23, cck_swing_table_ch1_ch13_92e[dm->bb_swing_idx_cck][1]); - odm_write_1byte(dm, 0xa24, cck_swing_table_ch1_ch13_92e[dm->bb_swing_idx_cck][2]); - odm_write_1byte(dm, 0xa25, cck_swing_table_ch1_ch13_92e[dm->bb_swing_idx_cck][3]); - odm_write_1byte(dm, 0xa26, cck_swing_table_ch1_ch13_92e[dm->bb_swing_idx_cck][4]); - odm_write_1byte(dm, 0xa27, cck_swing_table_ch1_ch13_92e[dm->bb_swing_idx_cck][5]); - odm_write_1byte(dm, 0xa28, cck_swing_table_ch1_ch13_92e[dm->bb_swing_idx_cck][6]); - odm_write_1byte(dm, 0xa29, cck_swing_table_ch1_ch13_92e[dm->bb_swing_idx_cck][7]); - } else { - odm_write_1byte(dm, 0xa22, cck_swing_table_ch14_92e[dm->bb_swing_idx_cck][0]); - odm_write_1byte(dm, 0xa23, cck_swing_table_ch14_92e[dm->bb_swing_idx_cck][1]); - odm_write_1byte(dm, 0xa24, cck_swing_table_ch14_92e[dm->bb_swing_idx_cck][2]); - odm_write_1byte(dm, 0xa25, cck_swing_table_ch14_92e[dm->bb_swing_idx_cck][3]); - odm_write_1byte(dm, 0xa26, cck_swing_table_ch14_92e[dm->bb_swing_idx_cck][4]); - odm_write_1byte(dm, 0xa27, cck_swing_table_ch14_92e[dm->bb_swing_idx_cck][5]); - odm_write_1byte(dm, 0xa28, cck_swing_table_ch14_92e[dm->bb_swing_idx_cck][6]); - odm_write_1byte(dm, 0xa29, cck_swing_table_ch14_92e[dm->bb_swing_idx_cck][7]); - } - - /* Adjust BB swing by OFDM IQ matrix */ - if (rf_path == RF_PATH_A) { - set_iqk_matrix_8192e(dm, dm->bb_swing_idx_ofdm[RF_PATH_A], RF_PATH_A, - dm->rf_calibrate_info.iqk_matrix_reg_setting[channel_mapped_index].value[0][0], - dm->rf_calibrate_info.iqk_matrix_reg_setting[channel_mapped_index].value[0][1]); - } else if (rf_path == RF_PATH_B) { - set_iqk_matrix_8192e(dm, dm->bb_swing_idx_ofdm[RF_PATH_B], RF_PATH_B, - dm->rf_calibrate_info.iqk_matrix_reg_setting[channel_mapped_index].value[0][4], - dm->rf_calibrate_info.iqk_matrix_reg_setting[channel_mapped_index].value[0][5]); - } - } else - return; -} /* odm_TxPwrTrackSetPwr88E */ - -void -get_delta_swing_table_8192e( - struct dm_struct *dm, - u8 **temperature_up_a, - u8 **temperature_down_a, - u8 **temperature_up_b, - u8 **temperature_down_b -) -{ - *temperature_up_a = (u8 *)delta_swing_table_idx_2ga_p_8188e; - *temperature_down_a = (u8 *)delta_swing_table_idx_2ga_n_8188e; - *temperature_up_b = (u8 *)delta_swing_table_idx_2ga_p_8188e; - *temperature_down_b = (u8 *)delta_swing_table_idx_2ga_n_8188e; -} - - -void configure_txpower_track_8192e( - struct txpwrtrack_cfg *config -) -{ - config->swing_table_size_cck = CCK_TABLE_SIZE_92E; - config->swing_table_size_ofdm = OFDM_TABLE_SIZE_92E; - config->threshold_iqk = 8; - config->average_thermal_num = AVG_THERMAL_NUM_92E; - config->rf_path_count = 1; - config->thermal_reg_addr = RF_T_METER_92E; - - config->odm_tx_pwr_track_set_pwr = odm_tx_pwr_track_set_pwr92_e; - config->do_iqk = do_iqk_8192e; - config->phy_lc_calibrate = phy_lc_calibrate_8192e; - config->get_delta_swing_table = get_delta_swing_table_8192e; -} -#endif - /* 1 7. IQK */ #define MAX_TOLERANCE 5 #define IQK_DELAY_TIME 1 /* ms */ @@ -600,13 +345,6 @@ phy_path_b_iqk_8192e( odm_set_bb_reg(dm, REG_FPGA0_IQK, 0xffffff00, 0x808000); -#if 0 - odm_set_bb_reg(dm, R_0xe28, 0xffffff00, 0x000000); - RF_DBG(dm, DBG_RF_IQK, "path A 0xdf = 0x%x\n", odm_get_rf_reg(dm, RF_PATH_A, RF_0xdf, RFREGOFFSETMASK)); - RF_DBG(dm, DBG_RF_IQK, "path B 0xdf = 0x%x\n", odm_get_rf_reg(dm, RF_PATH_B, RF_0xdf, RFREGOFFSETMASK)); - odm_set_bb_reg(dm, R_0xe28, 0xffffff00, 0x808000); -#endif - odm_set_bb_reg(dm, REG_TX_IQK_TONE_A, MASKDWORD, 0x38008c1c); odm_set_bb_reg(dm, REG_RX_IQK_TONE_A, MASKDWORD, 0x38008c1c); odm_set_bb_reg(dm, REG_TX_IQK_TONE_B, MASKDWORD, 0x18008c1c); @@ -1000,13 +738,7 @@ _phy_reload_mac_registers_92e( u32 i; RF_DBG(dm, DBG_RF_IQK, "Reload MAC parameters !\n"); -#if 1 odm_set_bb_reg(dm, R_0x520, MASKBYTE2, 0x0); -#else - for (i = 0 ; i < (IQK_MAC_REG_NUM - 1); i++) - odm_write_1byte(dm, mac_reg[i], (u8)mac_backup[i]); - odm_write_4byte(dm, mac_reg[i], mac_backup[i]); -#endif } @@ -1052,13 +784,7 @@ _phy_mac_setting_calibration_92e( } odm_write_1byte(dm, mac_reg[i], (u8)(mac_backup[i]&(~BIT(5)))); */ -#if 1 odm_set_bb_reg(dm, R_0x520, MASKBYTE2, 0xff); -#else - odm_set_bb_reg(dm, R_0x522, MASKBYTE0, 0x7f); - odm_set_bb_reg(dm, R_0x550, MASKBYTE0, 0x15); - odm_set_bb_reg(dm, R_0x551, MASKBYTE0, 0x00); -#endif while ((((odm_get_rf_reg(dm, 0x0, RF_0x0, bMaskDWord) & 0xf0000) >> 16) == 0x2) && (((odm_get_rf_reg(dm, 0x1, RF_0x0, bMaskDWord) & 0xf0000) >> 16) == 0x2)) ODM_delay_ms(1); @@ -1322,18 +1048,9 @@ _phy_iq_calibrate_8192e( result[t][0] = 0x100; result[t][1] = 0x0; } -#if 0 - else if (i == (retry_count - 1) && path_aok == 0x01) { /*Tx IQK OK*/ - RT_DISP(FINIT, INIT_IQK, ("path A IQK Only Tx Success!!\n")); - - result[t][0] = (odm_get_bb_reg(dm, REG_TX_POWER_BEFORE_IQK_A, MASKDWORD) & 0x3FF0000) >> 16; - result[t][1] = (odm_get_bb_reg(dm, REG_TX_POWER_AFTER_IQK_A, MASKDWORD) & 0x3FF0000) >> 16; - } -#endif } /* path A RXIQK */ -#if 1 for (i = 0 ; i < retry_count ; i++) { path_aok = phy_path_a_rx_iqk_92e(dm, is2T); if (path_aok == 0x03) { @@ -1353,8 +1070,6 @@ _phy_iq_calibrate_8192e( if (0x00 == path_aok) RF_DBG(dm, DBG_RF_IQK, "path A IQK failed!!\n"); -#endif - if (is2T) { _phy_path_a_stand_by_92e(dm); /* Turn ADDA on */ @@ -1366,7 +1081,6 @@ _phy_iq_calibrate_8192e( odm_set_bb_reg(dm, REG_RX_IQK, MASKDWORD, 0x01004800); /* path B Tx IQK */ -#if 1 for (i = 0 ; i < retry_count ; i++) { path_bok = phy_path_b_iqk_8192e(dm); /* if(path_bok == 0x03){ */ @@ -1380,19 +1094,9 @@ _phy_iq_calibrate_8192e( result[t][4] = 0x100; result[t][5] = 0x0; } -#if 0 - else if (i == (retry_count - 1) && path_aok == 0x01) { /*Tx IQK OK*/ - RT_DISP(FINIT, INIT_IQK, ("path B IQK Only Tx Success!!\n")); - - result[t][0] = (odm_get_bb_reg(dm, REG_TX_POWER_BEFORE_IQK_B, MASKDWORD) & 0x3FF0000) >> 16; - result[t][1] = (odm_get_bb_reg(dm, REG_TX_POWER_AFTER_IQK_B, MASKDWORD) & 0x3FF0000) >> 16; - } -#endif } -#endif - /* path B RX IQK */ -#if 1 + for (i = 0 ; i < retry_count ; i++) { path_bok = phy_path_b_rx_iqk_92e(dm, is2T); if (path_bok == 0x03) { @@ -1413,7 +1117,6 @@ _phy_iq_calibrate_8192e( RF_DBG(dm, DBG_RF_IQK, "path B IQK failed!!\n"); /**/ } -#endif } /* Back to BB mode, load original value */ diff --git a/hal/phydm/halrf/rtl8192e/halrf_8192e_ce.c b/hal/phydm/halrf/rtl8192e/halrf_8192e_ce.c index 1a5922f5..2bd67d92 100644 --- a/hal/phydm/halrf/rtl8192e/halrf_8192e_ce.c +++ b/hal/phydm/halrf/rtl8192e/halrf_8192e_ce.c @@ -964,14 +964,6 @@ u8 /* bit0 = 1 => Tx OK, bit1 = 1 => Rx OK */ odm_set_rf_reg(dm, RF_PATH_B, RF_TXPA_G2, RFREGOFFSETMASK, 0x07f77); /* PA off, default: 0x7f7f */ odm_set_bb_reg(dm, REG_FPGA0_IQK, 0xffffff00, 0x808000); -#if 0 - odm_set_bb_reg(dm, R_0xe28, 0xffffff00, 0x000000); - RF_DBG(dm, DBG_RF_IQK, "path A 0xdf = 0x%x\n", - odm_get_rf_reg(dm, RF_PATH_A, RF_0xdf, RFREGOFFSETMASK)); - RF_DBG(dm, DBG_RF_IQK, "path B 0xdf = 0x%x\n", - odm_get_rf_reg(dm, RF_PATH_B, RF_0xdf, RFREGOFFSETMASK)); - odm_set_bb_reg(dm, R_0xe28, 0xffffff00, 0x808000); -#endif odm_set_bb_reg(dm, REG_TX_IQK_TONE_A, MASKDWORD, 0x38008c1c); odm_set_bb_reg(dm, REG_RX_IQK_TONE_A, MASKDWORD, 0x38008c1c); @@ -1333,13 +1325,10 @@ void _phy_reload_mac_registers_92e(struct dm_struct *dm, u32 *mac_reg, u32 i; RF_DBG(dm, DBG_RF_IQK, "Reload MAC parameters !\n"); -#if 0 - odm_set_bb_reg(dm, R_0x520, MASKBYTE2, 0x0); -#else + for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++) odm_write_1byte(dm, mac_reg[i], (u8)mac_backup[i]); odm_write_4byte(dm, mac_reg[i], mac_backup[i]); -#endif } void _phy_path_adda_on_92e(struct dm_struct *dm, u32 *adda_reg, @@ -1549,19 +1538,6 @@ void _phy_iq_calibrate_8192e(struct dm_struct *dm, s32 result[][8], u8 t, _phy_path_adda_on_92e(dm, ADDA_REG, true, is2T); -#if 0 - if (t == 0) - dm->rf_calibrate_info.is_rf_pi_enable = (u8)odm_get_bb_reg(dm, REG_FPGA0_XA_HSSI_PARAMETER1, BIT(8)); - - if (!dm->rf_calibrate_info.is_rf_pi_enable) { - /* Switch BB to PI mode to do IQ Calibration. */ -#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) - _phy_pi_mode_switch_92e(adapter, true); -#else - _phy_pi_mode_switch_92e(dm, true); -#endif - } -#endif /* MAC settings */ _phy_mac_setting_calibration_92e(dm, IQK_MAC_REG, dm->rf_calibrate_info.IQK_MAC_backup); @@ -1603,7 +1579,6 @@ void _phy_iq_calibrate_8192e(struct dm_struct *dm, s32 result[][8], u8 t, } /* path A TXIQK */ -#if 1 for (i = 0; i < retry_count; i++) { path_aok = phy_path_a_iqk_8192e(dm, is2T); /* if(path_aok == 0x03){ */ @@ -1615,19 +1590,8 @@ void _phy_iq_calibrate_8192e(struct dm_struct *dm, s32 result[][8], u8 t, } RF_DBG(dm, DBG_RF_IQK, "path A Tx IQK Fail!!\n"); -#if 0 - else if (i == (retry_count - 1) && path_aok == 0x01) { /*Tx IQK OK*/ - RT_DISP(FINIT, INIT_IQK, ("path A IQK Only Tx Success!!\n")); - - result[t][0] = (odm_get_bb_reg(dm, REG_TX_POWER_BEFORE_IQK_A, MASKDWORD) & 0x3FF0000) >> 16; - result[t][1] = (odm_get_bb_reg(dm, REG_TX_POWER_AFTER_IQK_A, MASKDWORD) & 0x3FF0000) >> 16; - } -#endif } -#endif - /* path A RXIQK */ -#if 1 for (i = 0; i < retry_count; i++) { path_aok = phy_path_a_rx_iqk_92e(dm, is2T); if (path_aok == 0x03) { @@ -1645,8 +1609,6 @@ void _phy_iq_calibrate_8192e(struct dm_struct *dm, s32 result[][8], u8 t, if (0x00 == path_aok) RF_DBG(dm, DBG_RF_IQK, "path A IQK failed!!\n"); -#endif - if (is2T) { _phy_path_a_stand_by_92e(dm); /* Turn ADDA on */ @@ -1658,7 +1620,6 @@ void _phy_iq_calibrate_8192e(struct dm_struct *dm, s32 result[][8], u8 t, odm_set_bb_reg(dm, REG_RX_IQK, MASKDWORD, 0x01004800); /* path B Tx IQK */ -#if 1 for (i = 0; i < retry_count; i++) { path_bok = phy_path_b_iqk_8192e(dm); /* if(path_bok == 0x03){ */ @@ -1669,19 +1630,9 @@ void _phy_iq_calibrate_8192e(struct dm_struct *dm, s32 result[][8], u8 t, result[t][5] = (odm_get_bb_reg(dm, REG_TX_POWER_AFTER_IQK_B, MASKDWORD) & 0x3FF0000) >> 16; break; } -#if 0 - else if (i == (retry_count - 1) && path_aok == 0x01) { /*Tx IQK OK*/ - RT_DISP(FINIT, INIT_IQK, ("path B IQK Only Tx Success!!\n")); - - result[t][0] = (odm_get_bb_reg(dm, REG_TX_POWER_BEFORE_IQK_B, MASKDWORD) & 0x3FF0000) >> 16; - result[t][1] = (odm_get_bb_reg(dm, REG_TX_POWER_AFTER_IQK_B, MASKDWORD) & 0x3FF0000) >> 16; - } -#endif } -#endif /* path B RX IQK */ -#if 1 for (i = 0; i < retry_count; i++) { path_bok = phy_path_b_rx_iqk_92e(dm, is2T); if (path_bok == 0x03) { @@ -1696,7 +1647,6 @@ void _phy_iq_calibrate_8192e(struct dm_struct *dm, s32 result[][8], u8 t, } if (0x00 == path_bok) RF_DBG(dm, DBG_RF_IQK, "path B IQK failed!!\n"); -#endif } /* Back to BB mode, load original value */ diff --git a/hal/phydm/halrf/rtl8192e/halrf_8192e_win.c b/hal/phydm/halrf/rtl8192e/halrf_8192e_win.c index a3c2241a..981bfd6b 100644 --- a/hal/phydm/halrf/rtl8192e/halrf_8192e_win.c +++ b/hal/phydm/halrf/rtl8192e/halrf_8192e_win.c @@ -966,13 +966,6 @@ phy_path_b_iqk_8192e( odm_set_bb_reg(dm, REG_FPGA0_IQK, 0xffffff00, 0x808000); -#if 0 - odm_set_bb_reg(dm, R_0xe28, 0xffffff00, 0x000000); - RF_DBG(dm, DBG_RF_IQK, "path A 0xdf = 0x%x\n", odm_get_rf_reg(dm, RF_PATH_A, RF_0xdf, RFREGOFFSETMASK)); - RF_DBG(dm, DBG_RF_IQK, "path B 0xdf = 0x%x\n", odm_get_rf_reg(dm, RF_PATH_B, RF_0xdf, RFREGOFFSETMASK)); - odm_set_bb_reg(dm, R_0xe28, 0xffffff00, 0x808000); -#endif - odm_set_bb_reg(dm, REG_TX_IQK_TONE_A, MASKDWORD, 0x38008c1c); odm_set_bb_reg(dm, REG_RX_IQK_TONE_A, MASKDWORD, 0x38008c1c); odm_set_bb_reg(dm, REG_TX_IQK_TONE_B, MASKDWORD, 0x18008c1c); @@ -1366,13 +1359,10 @@ _phy_reload_mac_registers_92e( u32 i; RF_DBG(dm, DBG_RF_IQK, "Reload MAC parameters !\n"); -#if 0 - odm_set_bb_reg(dm, R_0x520, MASKBYTE2, 0x0); -#else + for (i = 0 ; i < (IQK_MAC_REG_NUM - 1); i++) odm_write_1byte(dm, mac_reg[i], (u8)mac_backup[i]); odm_write_4byte(dm, mac_reg[i], mac_backup[i]); -#endif } @@ -1641,19 +1631,6 @@ _phy_iq_calibrate_8192e( _phy_path_adda_on_92e(dm, ADDA_REG, true, is2T); -#if 0 - if (t == 0) - cali_info->is_rf_pi_enable = (u8)odm_get_bb_reg(dm, REG_FPGA0_XA_HSSI_PARAMETER1, BIT(8)); - - if (!cali_info->is_rf_pi_enable) { - /* Switch BB to PI mode to do IQ Calibration. */ -#if !(DM_ODM_SUPPORT_TYPE & ODM_AP) - _phy_pi_mode_switch_92e(adapter, true); -#else - _phy_pi_mode_switch_92e(dm, true); -#endif - } -#endif /* MAC settings */ _phy_mac_setting_calibration_92e(dm, IQK_MAC_REG, cali_info->IQK_MAC_backup); @@ -1695,7 +1672,6 @@ _phy_iq_calibrate_8192e( } /* path A TXIQK */ -#if 1 for (i = 0 ; i < retry_count ; i++) { path_aok = phy_path_a_iqk_8192e(dm, is2T); /* if(path_aok == 0x03){ */ @@ -1706,19 +1682,9 @@ _phy_iq_calibrate_8192e( break; } else RF_DBG(dm, DBG_RF_IQK, "path A Tx IQK Fail!!\n"); -#if 0 - else if (i == (retry_count - 1) && path_aok == 0x01) { /*Tx IQK OK*/ - RT_DISP(FINIT, INIT_IQK, ("path A IQK Only Tx Success!!\n")); - - result[t][0] = (odm_get_bb_reg(dm, REG_TX_POWER_BEFORE_IQK_A, MASKDWORD) & 0x3FF0000) >> 16; - result[t][1] = (odm_get_bb_reg(dm, REG_TX_POWER_AFTER_IQK_A, MASKDWORD) & 0x3FF0000) >> 16; - } -#endif } -#endif /* path A RXIQK */ -#if 1 for (i = 0 ; i < retry_count ; i++) { path_aok = phy_path_a_rx_iqk_92e(dm, is2T); if (path_aok == 0x03) { @@ -1735,8 +1701,6 @@ _phy_iq_calibrate_8192e( if (0x00 == path_aok) RF_DBG(dm, DBG_RF_IQK, "path A IQK failed!!\n"); -#endif - if (is2T) { _phy_path_a_stand_by_92e(dm); /* Turn ADDA on */ @@ -1748,7 +1712,6 @@ _phy_iq_calibrate_8192e( odm_set_bb_reg(dm, REG_RX_IQK, MASKDWORD, 0x01004800); /* path B Tx IQK */ -#if 1 for (i = 0 ; i < retry_count ; i++) { path_bok = phy_path_b_iqk_8192e(dm); /* if(path_bok == 0x03){ */ @@ -1758,19 +1721,9 @@ _phy_iq_calibrate_8192e( result[t][5] = (odm_get_bb_reg(dm, REG_TX_POWER_AFTER_IQK_B, MASKDWORD) & 0x3FF0000) >> 16; break; } -#if 0 - else if (i == (retry_count - 1) && path_aok == 0x01) { /*Tx IQK OK*/ - RT_DISP(FINIT, INIT_IQK, ("path B IQK Only Tx Success!!\n")); - - result[t][0] = (odm_get_bb_reg(dm, REG_TX_POWER_BEFORE_IQK_B, MASKDWORD) & 0x3FF0000) >> 16; - result[t][1] = (odm_get_bb_reg(dm, REG_TX_POWER_AFTER_IQK_B, MASKDWORD) & 0x3FF0000) >> 16; - } -#endif } -#endif /* path B RX IQK */ -#if 1 for (i = 0 ; i < retry_count ; i++) { path_bok = phy_path_b_rx_iqk_92e(dm, is2T); @@ -1788,7 +1741,6 @@ _phy_iq_calibrate_8192e( RF_DBG(dm, DBG_RF_IQK, "path B IQK failed!!\n"); /**/ } -#endif } /* Back to BB mode, load original value */ diff --git a/hal/phydm/halrf/rtl8192e/halrf_8192e_win.h b/hal/phydm/halrf/rtl8192e/halrf_8192e_win.h index d20ccf62..9ee3fde5 100644 --- a/hal/phydm/halrf/rtl8192e/halrf_8192e_win.h +++ b/hal/phydm/halrf/rtl8192e/halrf_8192e_win.h @@ -73,22 +73,6 @@ phy_lc_calibrate_8192e( void *dm_void ); -/* - * AP calibrate - * */ -#if 0 -void -phy_ap_calibrate_8192e( -#if (DM_ODM_SUPPORT_TYPE & ODM_AP) - struct dm_struct *dm, -#else - void *adapter, -#endif - s8 delta); -void -phy_digital_predistortion_8192e(void *adapter); -#endif - void _phy_save_adda_registers_92e( struct dm_struct *dm, diff --git a/hal/phydm/phydm.c b/hal/phydm/phydm.c index 72324ba6..ef374fcb 100644 --- a/hal/phydm/phydm.c +++ b/hal/phydm/phydm.c @@ -97,16 +97,6 @@ void phydm_traffic_load_decision(void *dm_void) dm->consecutive_idlel_time += PHYDM_WATCH_DOG_PERIOD; else dm->consecutive_idlel_time = 0; - - #if 0 - PHYDM_DBG(dm, DBG_COMMON_FLOW, - "cur_tx_ok_cnt = %d, cur_rx_ok_cnt = %d, last_tx_ok_cnt = %d, last_rx_ok_cnt = %d\n", - dm->cur_tx_ok_cnt, dm->cur_rx_ok_cnt, dm->last_tx_ok_cnt, - dm->last_rx_ok_cnt); - - PHYDM_DBG(dm, DBG_COMMON_FLOW, "tx_tp = %d, rx_tp = %d\n", dm->tx_tp, - dm->rx_tp); - #endif } void phydm_cck_new_agc_chk(struct dm_struct *dm) @@ -255,13 +245,7 @@ void phydm_common_info_self_init(struct dm_struct *dm) dm->num_rf_path = 1; else if (dm->support_ic_type & ODM_IC_2SS) dm->num_rf_path = 2; - #if 0 - /* @RTK do not has IC which is equipped with 3 RF paths, - * so ODM_IC_3SS is an enpty macro and result in coverity check errors - */ - else if (dm->support_ic_type & ODM_IC_3SS) - dm->num_rf_path = 3; - #endif + else if (dm->support_ic_type & ODM_IC_4SS) dm->num_rf_path = 4; else @@ -1246,16 +1230,6 @@ u64 phydm_supportability_init_ap( break; } -#if 0 - /*@[Config Antenna Diveristy]*/ - if (*dm->enable_antdiv) - support_ability |= ODM_BB_ANT_DIV; - - /*@[Config Adaptivity]*/ - if (*dm->enable_adaptivity) - support_ability |= ODM_BB_ADAPTIVITY; -#endif - return support_ability; } #endif @@ -2918,13 +2892,6 @@ void odm_dtc(struct dm_struct *dm) u8 dtc_steps = 0; u8 sign; u8 resp_txagc = 0; - -#if 0 - /* @As DIG is disabled, DTC is also disable */ - if (!(dm->support_ability & ODM_XXXXXX)) - return; -#endif - if (dm->rssi_min > DTC_BASE) { /* need to decade the CTS TX power */ sign = 1; @@ -2935,19 +2902,7 @@ void odm_dtc(struct dm_struct *dm) dtc_steps++; } } -#if 0 - else if (dm->rssi_min > DTC_DWN_BASE) { - /* needs to increase the CTS TX power */ - sign = 0; - dtc_steps = 1; - for (i = 0; i < ARRAY_SIZE(dtc_table_up); i++) { - if (dtc_table_up[i] <= dm->rssi_min || dtc_steps >= 10) - break; - else - dtc_steps++; - } - } -#endif + else { sign = 0; dtc_steps = 0; diff --git a/hal/phydm/phydm.h b/hal/phydm/phydm.h index d1dabb48..0ca63eec 100644 --- a/hal/phydm/phydm.h +++ b/hal/phydm/phydm.h @@ -690,9 +690,6 @@ struct _phydm_mcc_dm_ { #if (DM_ODM_SUPPORT_TYPE & ODM_WIN) - #if (RT_PLATFORM != PLATFORM_LINUX) - typedef - #endif struct dm_struct { #else/*for AP, CE Team*/ @@ -1167,18 +1164,7 @@ struct dm_struct { struct phydm_mp dm_mp_table; #endif /*@==========================================================*/ - -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) - -#if (RT_PLATFORM != PLATFORM_LINUX) -} dm_struct; /*@DM_Dynamic_Mechanism_Structure*/ -#else }; -#endif - -#else /*@for AP,CE Team*/ -}; -#endif enum phydm_adv_ota { PHYDM_PATHB_1RCCA = BIT(0), diff --git a/hal/phydm/phydm_adaptivity.c b/hal/phydm/phydm_adaptivity.c index 08690362..144324c2 100644 --- a/hal/phydm/phydm_adaptivity.c +++ b/hal/phydm/phydm_adaptivity.c @@ -196,14 +196,8 @@ void phydm_mac_edcca_state(void *dm_void, enum phydm_mac_edcca_type state) if (state == PHYDM_IGNORE_EDCCA) { odm_set_mac_reg(dm, R_0x520, BIT(15), 1); /*@ignore EDCCA*/ -#if 0 - /*odm_set_mac_reg(dm, REG_RD_CTRL, BIT(11), 0);*/ -#endif } else { /*@don't set MAC ignore EDCCA signal*/ odm_set_mac_reg(dm, R_0x520, BIT(15), 0); /*@don't ignore EDCCA*/ -#if 0 - /*odm_set_mac_reg(dm, REG_RD_CTRL, BIT(11), 1);*/ -#endif } PHYDM_DBG(dm, DBG_ADPTVTY, "EDCCA enable state = %d\n", state); } @@ -625,9 +619,6 @@ void phydm_adaptivity_init(void *dm_void) if (dm->support_ic_type & ODM_IC_11N_SERIES && !(dm->support_ic_type & ODM_IC_PWDB_EDCCA)) { /*@interfernce need > 2^x us, and then EDCCA will be 1*/ -#if 0 - /*odm_set_bb_reg(dm, 0x948, 0x1c00, 0x7);*/ -#endif if (dm->support_ic_type & (ODM_RTL8197F | ODM_RTL8192F)) { /*set to page B1*/ odm_set_bb_reg(dm, R_0xe28, BIT(30), 0x1); @@ -641,9 +632,6 @@ void phydm_adaptivity_init(void *dm_void) } else if (dm->support_ic_type & ODM_IC_11AC_SERIES && !(dm->support_ic_type & ODM_IC_PWDB_EDCCA)) { /*@interfernce need > 2^x us, and then EDCCA will be 1*/ -#if 0 - /*odm_set_bb_reg(dm, 0x900, 0x70000000, 0x7);*/ -#endif /*@0:rx_dfir, 1: dcnf_out, 2 :rx_iq, 3: rx_nbi_nf_out*/ odm_set_bb_reg(dm, R_0x944, BIT(29) | BIT(28), 0x1); } diff --git a/hal/phydm/phydm_adc_sampling.c b/hal/phydm/phydm_adc_sampling.c index ea9d0c02..91cb5388 100644 --- a/hal/phydm/phydm_adc_sampling.c +++ b/hal/phydm/phydm_adc_sampling.c @@ -162,13 +162,6 @@ void phydm_la_get_tx_pkt_buf(void *dm_void) pr_debug("is_round_up = ((%d)), finish_addr=((0x%x * 8Byte)), Start_Addr = ((0x%x * 8Byte)), smp_number = ((%d))\n", is_round_up, finish_addr, addr_8byte, smp_number); } - #if 0 - dbg_print("is_round_up = %d, finish_addr=0x%x, value32=0x%x\n", - is_round_up, finish_addr, value32); - dbg_print( - "end_addr = %x, buf->start_pos = 0x%x, buf->buffer_size = 0x%x\n", - end_addr, buf->start_pos, buf->buffer_size); - #endif #if (RTL8197F_SUPPORT || RTL8198F_SUPPORT || RTL8814B_SUPPORT) if (dm->support_ic_type & @@ -350,10 +343,6 @@ void phydm_adc_smp_start(void *dm_void) odm_set_bb_reg(dm, R_0x1eb4, BIT(23), 0x1); else odm_write_1byte(dm, R_0x8b4, 0x80); -#if 0 - /* odm_set_bb_reg(dm, R_0x8b4, BIT(7), 1); */ -#endif - phydm_la_mode_set_mac_iq_dump(dm, smp->en_fake_trig); #if (DM_ODM_SUPPORT_TYPE & ODM_AP) @@ -544,10 +533,6 @@ void adc_smp_query(void *dm_void, void *output, u32 out_len, u32 *pused) struct rt_adcsmp_string *buf = &smp->adc_smp_buf; u32 used = *pused; u32 i = 0; -#if 0 - /* struct timespec t; */ - /* rtw_get_current_timespec(&t); */ -#endif pr_debug("%s adc_smp_state %d", __func__, smp->adc_smp_state); @@ -1023,23 +1008,6 @@ void phydm_la_set_buff_mode(void *dm_void, enum la_buff_mode mode) u8 normal_LA_on = priv->pmib->miscEntry.normal_LA_on; #endif smp->la_buff_mode = mode; -#if 0 - if (dm->support_ic_type & ODM_RTL8814A) - buf->start_pos = 0x30000; - else if (dm->support_ic_type & - (ODM_RTL8822B | ODM_RTL8822C | ODM_RTL8812F)) - buf->start_pos = 0x20000; - else if (dm->support_ic_type & ODM_RTL8814B) - buf->start_pos = 0x30000; - else if (dm->support_ic_type & (ODM_RTL8197F | ODM_RTL8198F)) - buf->start_pos = 0x00000; - else if (dm->support_ic_type & ODM_RTL8192F) - buf->start_pos = 0x2000; - else if (dm->support_ic_type & ODM_RTL8821C) - buf->start_pos = 0x8000; - else if (dm->support_ic_type & ODM_RTL8195B) - buf->start_pos = 0x4000; -#endif switch (dm->support_ic_type) { case ODM_RTL8814A: buff_size_base = 0x10000; diff --git a/hal/phydm/phydm_antdect.c b/hal/phydm/phydm_antdect.c index 5a44a054..4248e634 100644 --- a/hal/phydm/phydm_antdect.c +++ b/hal/phydm/phydm_antdect.c @@ -190,9 +190,6 @@ odm_single_dual_antenna_detection( /* @change to Antenna B */ if (dm->support_ic_type & ODM_RTL8723B) { -#if 0 - /* odm_set_bb_reg(dm, REG_DPDT_CONTROL, 0x3, 0x2); */ -#endif odm_set_bb_reg(dm, REG_S0_S1_PATH_SWITCH, 0xfff, 0x280); odm_set_bb_reg(dm, REG_AGC_TABLE_SELECT, BIT(31), 0x1); } @@ -470,16 +467,10 @@ odm_sw_ant_div_check_before_link( PHYDM_PRINT_ADDR(dm, DBG_ANT_DIV, "SSID:", p_tmp_bss_desc->bdSsIdBuf); PHYDM_PRINT_ADDR(dm, DBG_ANT_DIV, "BSSID:", p_tmp_bss_desc->bdSsIdBuf); -#if 0 - /* PHYDM_DBG(dm,DBG_ANT_DIV, "tmp_power_diff: (( %d)),max_power_diff: (( %d)),min_power_diff: (( %d))\n", tmp_power_diff,max_power_diff,min_power_diff); */ -#endif if (tmp_power_diff > max_power_diff) max_power_diff = tmp_power_diff; if (tmp_power_diff < min_power_diff) min_power_diff = tmp_power_diff; -#if 0 - /* PHYDM_DBG(dm,DBG_ANT_DIV, "max_power_diff: (( %d)),min_power_diff: (( %d))\n",max_power_diff,min_power_diff); */ -#endif PlatformMoveMemory(p_test_bss_desc, p_tmp_bss_desc, sizeof(RT_WLAN_BSS)); } else if (p_test_bss_desc->RecvSignalPower > p_tmp_bss_desc->RecvSignalPower) { /* Pow(Ant1) < Pow(Ant2) */ @@ -618,17 +609,11 @@ odm_sw_ant_div_check_before_link( if (dm->dm_swat_table.ANTB_ON == true) { dm->dm_swat_table.ANTA_ON = true; dm->dm_swat_table.ANTB_ON = false; -#if 0 - /* @bt_set_bt_coex_ant_num(adapter, BT_COEX_ANT_TYPE_DETECTED, 1); */ -#endif } PHYDM_DBG(dm, DBG_ANT_DIV, "%s: Single antenna\n", __func__); dm->dm_swat_table.single_ant_counter++; } } -#if 0 - /* PHYDM_DBG(dm,DBG_ANT_DIV, "is_result=(( %d ))\n",dm->dm_swat_table.rssi_ant_dect_result); */ -#endif PHYDM_DBG(dm, DBG_ANT_DIV, "dual_ant_counter = (( %d )), single_ant_counter = (( %d )) , retry_counter = (( %d )) , aux_fail_detec_counter = (( %d ))\n\n\n", dm->dm_swat_table.dual_ant_counter, @@ -830,11 +815,6 @@ void odm_single_dual_antenna_detection_psd( PHYDM_DBG(dm, DBG_ANT_DIV, "odm_sw_ant_div_check_before_link(): Dual antenna\n"); -#if 0 - /* set bt coexDM from 1ant coexDM to 2ant coexDM */ - /* @bt_set_bt_coex_ant_num(adapter, BT_COEX_ANT_TYPE_DETECTED, 2); */ -#endif - /* @Init antenna diversity */ dm->support_ability |= ODM_BB_ANT_DIV; odm_ant_div_init(dm); diff --git a/hal/phydm/phydm_antdiv.c b/hal/phydm/phydm_antdiv.c index 702406e6..af8f8750 100644 --- a/hal/phydm/phydm_antdiv.c +++ b/hal/phydm/phydm_antdiv.c @@ -256,10 +256,6 @@ void phydm_fast_training_enable(void *dm_void, u8 swch) } else if (dm->support_ic_type == ODM_RTL8192E) { odm_set_bb_reg(dm, R_0xb34, BIT(28), enable); /*@enable fast training (path-A)*/ -#if 0 - odm_set_bb_reg(dm, R_0xb34, BIT(29), enable); - /*enable fast training (path-B)*/ -#endif } else if (dm->support_ic_type & (ODM_RTL8821 | ODM_RTL8822B)) { odm_set_bb_reg(dm, R_0x900, BIT(19), enable); /*@enable fast training */ @@ -291,14 +287,6 @@ void phydm_update_rx_idle_ac(void *dm_void, u8 ant, u32 default_ant, value16 |= ((u16)optional_ant << 6); value16 |= ((u16)default_tx_ant << 9); odm_write_2byte(dm, ODM_REG_TRMUX_11AC + 2, value16); -#if 0 - odm_set_bb_reg(dm, ODM_REG_TRMUX_11AC, 0x380000, default_ant); - /* @Default RX */ - odm_set_bb_reg(dm, ODM_REG_TRMUX_11AC, 0x1c00000, optional_ant); - /* Optional RX */ - odm_set_bb_reg(dm, ODM_REG_TRMUX_11AC, 0xe000000, default_ant); - /* @Default TX */ -#endif } void phydm_update_rx_idle_n(void *dm_void, u8 ant, u32 default_ant, @@ -490,12 +478,6 @@ void odm_update_tx_ant(void *dm_void, u8 ant, u32 mac_id) PHYDM_DBG(dm, DBG_ANT_DIV, "[Set TX-DESC value]: mac_id:(( %d )), tx_ant = (( %s ))\n", mac_id, (ant == MAIN_ANT) ? "MAIN_ANT" : "AUX_ANT"); -#if 0 - PHYDM_DBG(dm, DBG_ANT_DIV, - "antsel_tr_mux=(( 3'b%d%d%d ))\n", - fat_tab->antsel_c[mac_id], fat_tab->antsel_b[mac_id], - fat_tab->antsel_a[mac_id]); -#endif } #ifdef PHYDM_BEAMFORMING_SUPPORT @@ -775,14 +757,12 @@ void odm_bd_ccoex_bfee_rx_div_arbitration( } } -#if 1 if (dm->bdc_holdstate == 0xff) { dm_bdc_table->BDC_state = BDC_DIV_HOLD_STATE; odm_bd_ccoex_type_with_bfer_client(dm, DIVON_CSIOFF); PHYDM_DBG(dm, DBG_ANT_DIV, "Force in [ DIV STATE]\n"); return; } -#endif /* @Does Client number changed ? ------------------------------- */ if (dm_bdc_table->num_client != dm_bdc_table->pre_num_client) { @@ -802,15 +782,6 @@ void odm_bd_ccoex_bfee_rx_div_arbitration( PHYDM_DBG(dm, DBG_ANT_DIV, "*****[2-1. BFer_TRAIN_STATE ]*****\n"); -#if 0 - /* @if(dm_bdc_table->num_bf_tar==0) */ - /* @{ */ - /* PHYDM_DBG(dm,DBG_ANT_DIV, "BF_tars exist? : (( No )), [ bdc_bfer_train_state ] >> [BDC_DIV_TRAIN_STATE]\n"); */ - /* odm_div_train_state_setting( dm); */ - /* @} */ - /* else */ /* num_bf_tar != 0 */ - /* @{ */ -#endif dm_bdc_table->bdc_try_counter = 2; dm_bdc_table->bdc_try_flag = 1; dm_bdc_table->BDC_state = BDC_DECISION_STATE; @@ -823,15 +794,6 @@ void odm_bd_ccoex_bfee_rx_div_arbitration( else if (dm_bdc_table->BDC_state == BDC_DECISION_STATE) { PHYDM_DBG(dm, DBG_ANT_DIV, "*****[2-2. DECISION_STATE]*****\n"); -#if 0 - /* @if(dm_bdc_table->num_bf_tar==0) */ - /* @{ */ - /* ODM_AntDiv_Printk(("BF_tars exist? : (( No )), [ DECISION_STATE ] >> [BDC_DIV_TRAIN_STATE]\n")); */ - /* odm_div_train_state_setting( dm); */ - /* @} */ - /* else */ /* num_bf_tar != 0 */ - /* @{ */ -#endif if (dm_bdc_table->BF_pass == false || dm_bdc_table->DIV_pass == false) stop_bf_flag = true; else @@ -870,16 +832,6 @@ void odm_bd_ccoex_bfee_rx_div_arbitration( } else { dm_bdc_table->bdc_hold_counter--; -#if 0 - /* @if(dm_bdc_table->num_bf_tar==0) */ - /* @{ */ - /* PHYDM_DBG(dm,DBG_ANT_DIV, "BF_tars exist? : (( No )), [ BDC_BF_HOLD_STATE ] >> [BDC_DIV_TRAIN_STATE]\n"); */ - /* odm_div_train_state_setting( dm); */ - /* @} */ - /* else */ /* num_bf_tar != 0 */ - /* @{ */ - /* PHYDM_DBG(dm,DBG_ANT_DIV, "BF_tars exist? : (( Yes ))\n"); */ -#endif dm_bdc_table->BDC_state = BDC_BF_HOLD_STATE; odm_bd_ccoex_type_with_bfer_client(dm, DIVOFF_CSION); PHYDM_DBG(dm, DBG_ANT_DIV, "[ BDC_BF_HOLD_STATE ] >> [BDC_BF_HOLD_STATE]\n"); @@ -1022,14 +974,6 @@ void odm_smart_hw_ant_div_init_88e( PHYDM_DBG(dm, DBG_ANT_DIV, "***8188E AntDiv_Init => ant_div_type=[CG_TRX_SMART_ANTDIV]\n"); -#if 0 - if (*dm->mp_mode == true) { - PHYDM_DBG(dm, ODM_COMP_INIT, "dm->ant_div_type: %d\n", - dm->ant_div_type); - return; - } -#endif - fat_tab->train_idx = 0; fat_tab->fat_state = FAT_PREPARE_STATE; @@ -1102,15 +1046,6 @@ void odm_smart_hw_ant_div_init_88e( /* @Enter Traing state */ odm_set_bb_reg(dm, R_0x864, BIT(2) | BIT(1) | BIT(0), (dm->fat_comb_a - 1)); /* reg864[2:0]=3'd6 */ /* ant combination=reg864[2:0]+1 */ -#if 0 - /* SW Control */ - /* phy_set_bb_reg(adapter, 0x864, BIT10, 1); */ - /* phy_set_bb_reg(adapter, 0x870, BIT9, 1); */ - /* phy_set_bb_reg(adapter, 0x870, BIT8, 1); */ - /* phy_set_bb_reg(adapter, 0x864, BIT11, 1); */ - /* phy_set_bb_reg(adapter, 0x860, BIT9, 0); */ - /* phy_set_bb_reg(adapter, 0x860, BIT8, 0); */ -#endif } #endif @@ -1122,17 +1057,6 @@ void odm_rx_hw_ant_div_init_92e(void *dm_void) struct dm_struct *dm = (struct dm_struct *)dm_void; struct phydm_fat_struct *fat_tab = &dm->dm_fat_table; -#if 0 - if (*dm->mp_mode == true) { - odm_ant_div_on_off(dm, ANTDIV_OFF); - odm_set_bb_reg(dm, R_0xc50, BIT(8), 0); - /* r_rxdiv_enable_anta regc50[8]=1'b0 0: control by c50[9] */ - odm_set_bb_reg(dm, R_0xc50, BIT(9), 1); - /* @1:CG, 0:CS */ - return; - } -#endif - PHYDM_DBG(dm, DBG_ANT_DIV, "[%s]=====>\n", __func__); /* Pin Settings */ @@ -1168,15 +1092,6 @@ void odm_trx_hw_ant_div_init_92e(void *dm_void) { struct dm_struct *dm = (struct dm_struct *)dm_void; -#if 0 - if (*dm->mp_mode == true) { - odm_ant_div_on_off(dm, ANTDIV_OFF); - odm_set_bb_reg(dm, R_0xc50, BIT(8), 0); /* r_rxdiv_enable_anta regc50[8]=1'b0 0: control by c50[9] */ - odm_set_bb_reg(dm, R_0xc50, BIT(9), 1); /* @1:CG, 0:CS */ - return; - } -#endif - PHYDM_DBG(dm, DBG_ANT_DIV, "[%s]=====>\n", __func__); /* @3 --RFE pin setting--------- */ @@ -1203,16 +1118,6 @@ void odm_trx_hw_ant_div_init_92e(void *dm_void) odm_set_bb_reg(dm, R_0xc50, BIT(8), 0); /* path-A */ /* disable CS/CG switch */ -#if 0 - /* @Let it follows PHY_REG for bit9 setting */ - if (dm->priv->pshare->rf_ft_var.use_ext_pa || - dm->priv->pshare->rf_ft_var.use_ext_lna) - odm_set_bb_reg(dm, R_0xc50, BIT(9), 1);/* path-A output at CS */ - else - odm_set_bb_reg(dm, R_0xc50, BIT(9), 0); - /* path-A output at CG ->normal power */ -#endif - odm_set_bb_reg(dm, R_0x870, BIT(9) | BIT(8), 0); /* path-A*/ /* antsel antselb by HW */ odm_set_bb_reg(dm, R_0xb38, BIT(10), 0);/* path-A*/ /* antsel2 by HW */ @@ -1418,15 +1323,6 @@ void phydm_rx_hw_ant_div_init_97f(void *dm_void) struct dm_struct *dm = (struct dm_struct *)dm_void; struct phydm_fat_struct *fat_tab = &dm->dm_fat_table; -#if 0 - if (*dm->mp_mode == true) { - odm_ant_div_on_off(dm, ANTDIV_OFF); - odm_set_bb_reg(dm, R_0xc50, BIT(8), 0); - /* r_rxdiv_enable_anta regc50[8]=1'b0 0: control by c50[9] */ - odm_set_bb_reg(dm, R_0xc50, BIT(9), 1); /* @1:CG, 0:CS */ - return; - } -#endif PHYDM_DBG(dm, DBG_ANT_DIV, "[%s]=====>\n", __func__); /* Pin Settings */ @@ -1475,21 +1371,14 @@ void odm_trx_hw_ant_div_init_8723d(void *dm_void) odm_set_bb_reg(dm, R_0xe64, 0xFFFF0000, 0x000c); odm_set_bb_reg(dm, R_0x870, BIT(9) | BIT(8), 0); -#if 0 - /*PTA setting: WL_BB_SEL_BTG_TRXG_anta, (1: HW CTRL 0: SW CTRL)*/ - /*odm_set_bb_reg(dm, R_0x948, BIT6, 0);*/ - /*odm_set_bb_reg(dm, R_0x948, BIT8, 0);*/ -#endif + /*@GNT_WL tx*/ odm_set_bb_reg(dm, R_0x950, BIT(29), 0); /*@Mapping Table*/ odm_set_bb_reg(dm, R_0x914, MASKBYTE0, 0); odm_set_bb_reg(dm, R_0x914, MASKBYTE1, 3); -#if 0 - /* odm_set_bb_reg(dm, R_0x864, BIT5|BIT4|BIT3, 0); */ - /* odm_set_bb_reg(dm, R_0x864, BIT8|BIT7|BIT6, 1); */ -#endif + /* Set WLBB_SEL_RF_ON 1 if RXFIR_PWDB > 0xCcc[3:0] */ odm_set_bb_reg(dm, R_0xccc, BIT(12), 0); @@ -1544,9 +1433,7 @@ void odm_s0s1_sw_ant_div_init_8723d(void *dm_void) odm_set_bb_reg(dm, R_0x914, MASKBYTE1, 1); /* Output Pin Settings */ -#if 0 - /* odm_set_bb_reg(dm, R_0x948, BIT6, 0x1); */ -#endif + odm_set_bb_reg(dm, R_0x870, BIT(8), 1); odm_set_bb_reg(dm, R_0x870, BIT(9), 1); @@ -1574,9 +1461,6 @@ void odm_update_rx_idle_ant_8723d(void *dm_void, u8 ant, u32 default_ant, /*score board to BT ,a002:WL to do ant-div*/ odm_set_mac_reg(dm, R_0xa8, MASKHWORD, 0xa002); ODM_delay_us(50); -#endif -#if 0 - /* odm_set_bb_reg(dm, R_0x948, BIT(6), 0x1); */ #endif if (dm->ant_div_type == S0S1_SW_ANTDIV) { odm_set_bb_reg(dm, R_0x860, BIT(8), default_ant); @@ -1615,22 +1499,6 @@ void phydm_set_tx_ant_pwr_8723d(void *dm_void, u8 ant) #endif #if (RTL8721D_SUPPORT) -#if 0 -void odm_update_rx_idle_ant_8721d(void *dm_void, u8 ant, u32 default_ant, - u32 optional_ant) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - struct phydm_fat_struct *fat_tab = &dm->dm_fat_table; - - odm_set_bb_reg(dm, R_0x864, BIT(5) | BIT(4) | BIT(3), default_ant); - /*@Default RX*/ - odm_set_bb_reg(dm, R_0x864, BIT(8) | BIT(7) | BIT(6), optional_ant); - /*@Optional RX*/ - odm_set_bb_reg(dm, R_0x860, BIT(14) | BIT(13) | BIT(12), default_ant); - /*@Default TX*/ - fat_tab->rx_idle_ant = ant; -} -#endif void odm_trx_hw_ant_div_init_8721d(void *dm_void) { @@ -1767,10 +1635,6 @@ void odm_s0s1_sw_ant_div_init_8723b(void *dm_void) odm_set_bb_reg(dm, R_0x914, MASKBYTE0, 0); odm_set_bb_reg(dm, R_0x914, MASKBYTE1, 1); -#if 0 - /* Output Pin Settings */ - /* odm_set_bb_reg(dm, R_0x948, BIT6, 0x1); */ -#endif odm_set_bb_reg(dm, R_0x870, BIT(9) | BIT(8), 0); fat_tab->is_become_linked = false; @@ -1800,72 +1664,6 @@ void odm_update_rx_idle_ant_8723b( return; } -#if 0 - /* Send H2C command to FW */ - /* @Enable wifi calibration */ - h2c_parameter = true; - odm_fill_h2c_cmd(dm, ODM_H2C_WIFI_CALIBRATION, 1, &h2c_parameter); - - /* @Check if H2C command sucess or not (0x1e6) */ - u1_temp = odm_read_1byte(dm, 0x1e6); - while ((u1_temp != 0x1) && (count < 100)) { - ODM_delay_us(10); - u1_temp = odm_read_1byte(dm, 0x1e6); - count++; - } - PHYDM_DBG(dm, DBG_ANT_DIV, - "[ Update Rx-Idle-ant ] 8723B: H2C command status = %d, count = %d\n", - u1_temp, count); - - if (u1_temp == 0x1) { - /* @Check if BT is doing IQK (0x1e7) */ - count = 0; - u1_temp = odm_read_1byte(dm, 0x1e7); - while ((!(u1_temp & BIT(0))) && (count < 100)) { - ODM_delay_us(50); - u1_temp = odm_read_1byte(dm, 0x1e7); - count++; - } - PHYDM_DBG(dm, DBG_ANT_DIV, - "[ Update Rx-Idle-ant ] 8723B: BT IQK status = %d, count = %d\n", - u1_temp, count); - - if (u1_temp & BIT(0)) { - odm_set_bb_reg(dm, R_0x948, BIT(6), 0x1); - odm_set_bb_reg(dm, R_0x948, BIT(9), default_ant); - odm_set_bb_reg(dm, R_0x864, 0x38, default_ant); - /* @Default RX */ - odm_set_bb_reg(dm, R_0x864, 0x1c0, optional_ant); - /* @Optional RX */ - odm_set_bb_reg(dm, R_0x860, 0x7000, default_ant); - /* @Default TX */ - fat_tab->rx_idle_ant = ant; - - /* Set TX AGC by S0/S1 */ - /* Need to consider Linux driver */ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - adapter->hal_func.set_tx_power_level_handler(adapter, *dm->channel); -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - rtw_hal_set_tx_power_level(adapter, *dm->channel); -#endif - - /* Set IQC by S0/S1 */ - odm_set_iqc_by_rfpath(dm, default_ant); - PHYDM_DBG(dm, DBG_ANT_DIV, - "[ Update Rx-Idle-ant ] 8723B: Success to set RX antenna\n"); - } else - PHYDM_DBG(dm, DBG_ANT_DIV, - "[ Update Rx-Idle-ant ] 8723B: Fail to set RX antenna due to BT IQK\n"); - } else - PHYDM_DBG(dm, DBG_ANT_DIV, - "[ Update Rx-Idle-ant ] 8723B: Fail to set RX antenna due to H2C command fail\n"); - - /* Send H2C command to FW */ - /* @Disable wifi calibration */ - h2c_parameter = false; - odm_fill_h2c_cmd(dm, ODM_H2C_WIFI_CALIBRATION, 1, &h2c_parameter); -#else - odm_set_bb_reg(dm, R_0x948, BIT(6), 0x1); odm_set_bb_reg(dm, R_0x948, BIT(9), default_ant); odm_set_bb_reg(dm, R_0x864, BIT(5) | BIT(4) | BIT(3), default_ant); @@ -1889,7 +1687,6 @@ void odm_update_rx_idle_ant_8723b( PHYDM_DBG(dm, DBG_ANT_DIV, "[ Update Rx-Idle-ant ] 8723B: Success to set RX antenna\n"); -#endif } boolean @@ -1897,17 +1694,8 @@ phydm_is_bt_enable_8723b(void *dm_void) { struct dm_struct *dm = (struct dm_struct *)dm_void; u32 bt_state; -#if 0 - /*u32 reg75;*/ - - /*reg75 = odm_get_bb_reg(dm, R_0x74, BIT8);*/ - /*odm_set_bb_reg(dm, R_0x74, BIT8, 0x0);*/ -#endif odm_set_bb_reg(dm, R_0xa0, BIT(24) | BIT(25) | BIT(26), 0x5); bt_state = odm_get_bb_reg(dm, R_0xa0, 0xf); -#if 0 - /*odm_set_bb_reg(dm, R_0x74, BIT8, reg75);*/ -#endif if (bt_state == 4 || bt_state == 7 || bt_state == 9 || bt_state == 13) return true; @@ -2245,16 +2033,6 @@ void odm_s0s1_sw_ant_div_init_8188f(void *dm_void) PHYDM_DBG(dm, DBG_ANT_DIV, "[%s]=====>\n", __func__); -#if 0 - /*@GPIO setting*/ - /*odm_set_mac_reg(dm, R_0x64, BIT(18), 0); */ - /*odm_set_mac_reg(dm, R_0x44, BIT(28)|BIT(27), 0);*/ - /*odm_set_mac_reg(dm, R_0x44, BIT(20) | BIT(19), 0x3);*/ - /*enable_output for P_GPIO[4:3]*/ - /*odm_set_mac_reg(dm, R_0x44, BIT(12)|BIT(11), 0);*/ /*output value*/ - /*odm_set_mac_reg(dm, R_0x40, BIT(1)|BIT(0), 0);*/ /*GPIO function*/ -#endif - if (dm->support_ic_type == ODM_RTL8188F) { if (dm->support_interface == ODM_ITRF_USB) odm_set_mac_reg(dm, R_0x44, BIT(20) | BIT(19), 0x3); @@ -2416,9 +2194,7 @@ void odm_evm_enhance_ant_div(void *dm_void) if ((dm->support_ic_type & ODM_EVM_ANTDIV_IC)) { if (dm->is_one_entry_only) { -#if 0 - /* PHYDM_DBG(dm,DBG_ANT_DIV, "[One Client only]\n"); */ -#endif + i = dm->one_entry_macid; sta = dm->phydm_sta_info[i]; @@ -2466,13 +2242,7 @@ void odm_evm_enhance_ant_div(void *dm_void) fat_tab->aux_evm_2ss_sum[i][1] = 0; fat_tab->main_evm_2ss_cnt[i] = 0; fat_tab->aux_evm_2ss_cnt[i] = 0; -#if 0 - /*Reset TP Method */ - fat_tab->main_tp = 0; - fat_tab->aux_tp = 0; - fat_tab->main_tp_cnt = 0; - fat_tab->aux_tp_cnt = 0; -#endif + /*Reset CRC Method */ fat_tab->main_crc32_ok_cnt = 0; fat_tab->main_crc32_fail_cnt = 0; @@ -2482,9 +2252,7 @@ void odm_evm_enhance_ant_div(void *dm_void) #ifdef SKIP_EVM_ANTDIV_TRAINING_PATCH if ((*dm->band_width == CHANNEL_WIDTH_20) && sta->mimo_type == RF_2T2R) { /*@1. Skip training: RSSI*/ -#if 0 - /*PHYDM_DBG(pDM_Odm,DBG_ANT_DIV, "TargetAnt_enhance=((%d)), RxIdleAnt=((%d))\n", pDM_FatTable->TargetAnt_enhance, pDM_FatTable->RxIdleAnt);*/ -#endif + curr_rssi = (u8)((fat_tab->rx_idle_ant == MAIN_ANT) ? main_rssi : aux_rssi); rssi_diff = (curr_rssi > fat_tab->pre_antdiv_rssi) ? (curr_rssi - fat_tab->pre_antdiv_rssi) : (fat_tab->pre_antdiv_rssi - curr_rssi); @@ -2540,63 +2308,50 @@ void odm_evm_enhance_ant_div(void *dm_void) PHYDM_DBG(dm, DBG_ANT_DIV, "[Decisoin state ]\n"); /* @3 [CRC32 statistic] */ -#if 0 - if ((fat_tab->main_crc32_ok_cnt > (fat_tab->aux_crc32_ok_cnt << 1)) || (diff_rssi >= 40 && rssi_larger_ant == MAIN_ANT)) { + if (fat_tab->main_crc32_fail_cnt <= 5) + fat_tab->main_crc32_fail_cnt = 5; + + if (fat_tab->aux_crc32_fail_cnt <= 5) + fat_tab->aux_crc32_fail_cnt = 5; + + if (fat_tab->main_crc32_ok_cnt > fat_tab->main_crc32_fail_cnt) + main_above1 = true; + + if (fat_tab->aux_crc32_ok_cnt > fat_tab->aux_crc32_fail_cnt) + aux_above1 = true; + + if (main_above1 == true && aux_above1 == false) { + force_antenna = true; fat_tab->target_ant_crc32 = MAIN_ANT; + } else if (main_above1 == false && aux_above1 == true) { force_antenna = true; - PHYDM_DBG(dm, DBG_ANT_DIV, "CRC32 Force Main\n"); - } else if ((fat_tab->aux_crc32_ok_cnt > ((fat_tab->main_crc32_ok_cnt) << 1)) || ((diff_rssi >= 40) && (rssi_larger_ant == AUX_ANT))) { fat_tab->target_ant_crc32 = AUX_ANT; - force_antenna = true; - PHYDM_DBG(dm, DBG_ANT_DIV, "CRC32 Force Aux\n"); - } else -#endif - { - if (fat_tab->main_crc32_fail_cnt <= 5) - fat_tab->main_crc32_fail_cnt = 5; - - if (fat_tab->aux_crc32_fail_cnt <= 5) - fat_tab->aux_crc32_fail_cnt = 5; - - if (fat_tab->main_crc32_ok_cnt > fat_tab->main_crc32_fail_cnt) - main_above1 = true; - - if (fat_tab->aux_crc32_ok_cnt > fat_tab->aux_crc32_fail_cnt) - aux_above1 = true; - - if (main_above1 == true && aux_above1 == false) { - force_antenna = true; - fat_tab->target_ant_crc32 = MAIN_ANT; - } else if (main_above1 == false && aux_above1 == true) { - force_antenna = true; - fat_tab->target_ant_crc32 = AUX_ANT; - } else if (main_above1 == true && aux_above1 == true) { - main_crc_utility = ((fat_tab->main_crc32_ok_cnt) << 7) / fat_tab->main_crc32_fail_cnt; - aux_crc_utility = ((fat_tab->aux_crc32_ok_cnt) << 7) / fat_tab->aux_crc32_fail_cnt; - fat_tab->target_ant_crc32 = (main_crc_utility == aux_crc_utility) ? (fat_tab->pre_target_ant_enhance) : ((main_crc_utility >= aux_crc_utility) ? MAIN_ANT : AUX_ANT); - - if (main_crc_utility != 0 && aux_crc_utility != 0) { - if (main_crc_utility >= aux_crc_utility) - utility_ratio = (main_crc_utility << 1) / aux_crc_utility; - else - utility_ratio = (aux_crc_utility << 1) / main_crc_utility; - } - } else if (main_above1 == false && aux_above1 == false) { - if (fat_tab->main_crc32_ok_cnt == 0) - fat_tab->main_crc32_ok_cnt = 1; - if (fat_tab->aux_crc32_ok_cnt == 0) - fat_tab->aux_crc32_ok_cnt = 1; - - main_crc_utility = ((fat_tab->main_crc32_fail_cnt) << 7) / fat_tab->main_crc32_ok_cnt; - aux_crc_utility = ((fat_tab->aux_crc32_fail_cnt) << 7) / fat_tab->aux_crc32_ok_cnt; - fat_tab->target_ant_crc32 = (main_crc_utility == aux_crc_utility) ? (fat_tab->pre_target_ant_enhance) : ((main_crc_utility <= aux_crc_utility) ? MAIN_ANT : AUX_ANT); - - if (main_crc_utility != 0 && aux_crc_utility != 0) { - if (main_crc_utility >= aux_crc_utility) - utility_ratio = (main_crc_utility << 1) / (aux_crc_utility); - else - utility_ratio = (aux_crc_utility << 1) / (main_crc_utility); - } + } else if (main_above1 == true && aux_above1 == true) { + main_crc_utility = ((fat_tab->main_crc32_ok_cnt) << 7) / fat_tab->main_crc32_fail_cnt; + aux_crc_utility = ((fat_tab->aux_crc32_ok_cnt) << 7) / fat_tab->aux_crc32_fail_cnt; + fat_tab->target_ant_crc32 = (main_crc_utility == aux_crc_utility) ? (fat_tab->pre_target_ant_enhance) : ((main_crc_utility >= aux_crc_utility) ? MAIN_ANT : AUX_ANT); + + if (main_crc_utility != 0 && aux_crc_utility != 0) { + if (main_crc_utility >= aux_crc_utility) + utility_ratio = (main_crc_utility << 1) / aux_crc_utility; + else + utility_ratio = (aux_crc_utility << 1) / main_crc_utility; + } + } else if (main_above1 == false && aux_above1 == false) { + if (fat_tab->main_crc32_ok_cnt == 0) + fat_tab->main_crc32_ok_cnt = 1; + if (fat_tab->aux_crc32_ok_cnt == 0) + fat_tab->aux_crc32_ok_cnt = 1; + + main_crc_utility = ((fat_tab->main_crc32_fail_cnt) << 7) / fat_tab->main_crc32_ok_cnt; + aux_crc_utility = ((fat_tab->aux_crc32_fail_cnt) << 7) / fat_tab->aux_crc32_ok_cnt; + fat_tab->target_ant_crc32 = (main_crc_utility == aux_crc_utility) ? (fat_tab->pre_target_ant_enhance) : ((main_crc_utility <= aux_crc_utility) ? MAIN_ANT : AUX_ANT); + + if (main_crc_utility != 0 && aux_crc_utility != 0) { + if (main_crc_utility >= aux_crc_utility) + utility_ratio = (main_crc_utility << 1) / (aux_crc_utility); + else + utility_ratio = (aux_crc_utility << 1) / (main_crc_utility); } } odm_set_mac_reg(dm, R_0x608, BIT(8), 0); /* NOT Accept CRC32 Error packets. */ @@ -2674,12 +2429,6 @@ void odm_evm_enhance_ant_div(void *dm_void) else fat_tab->target_ant_enhance = fat_tab->target_ant_evm; } - #if 0 - else if ((diff_EVM <= 50 && (utility_ratio > 4 && force_antenna == false)) || (force_antenna == true)) { - PHYDM_DBG(dm, DBG_ANT_DIV, "Decision type 2, CRC_utility = ((%d)), EVM_diff = ((%d))\n", utility_ratio, diff_EVM); - fat_tab->target_ant_enhance = fat_tab->target_ant_crc32; - } - #endif else if (diff_EVM >= 20) { PHYDM_DBG(dm, DBG_ANT_DIV, "Decision type 3, CRC_utility = ((%d)), EVM_diff = ((%d))\n", utility_ratio, diff_EVM); fat_tab->target_ant_enhance = fat_tab->target_ant_evm; @@ -2859,30 +2608,6 @@ void odm_hw_ant_div(void *dm_void) odm_ant_div_on_off(dm, ANTDIV_ON, ANT_PATH_B); else if (fat_tab->div_path_type == ANT_PATH_AB) odm_ant_div_on_off(dm, ANTDIV_ON, ANT_PATH_AB); -#if 0 - /*odm_tx_by_tx_desc_or_reg(dm, TX_BY_DESC);*/ -#endif - -#if 0 - /* @if(dm->support_ic_type == ODM_RTL8821 ) */ - /* odm_set_bb_reg(dm, R_0x800, BIT(25), 0); */ - /* CCK AntDiv function disable */ -#endif - -#if 0 - /* @#if(DM_ODM_SUPPORT_TYPE == ODM_AP) */ - /* @else if(dm->support_ic_type == ODM_RTL8881A) */ - /* odm_set_bb_reg(dm, R_0x800, BIT(25), 0); */ - /* CCK AntDiv function disable */ - /* @#endif */ -#endif - -#if 0 - /* @else if(dm->support_ic_type == ODM_RTL8723B ||*/ - /* @dm->support_ic_type == ODM_RTL8812) */ - /* odm_set_bb_reg(dm, R_0xa00, BIT(15), 0); */ - /* CCK AntDiv function disable */ -#endif fat_tab->is_become_linked = dm->is_linked; @@ -2975,10 +2700,6 @@ void odm_hw_ant_div(void *dm_void) "*** Client[ %d ] : Aux_Cnt = (( %d )) , CCK_Aux_Cnt = (( %d )) , aux_rssi = (( %d ))\n", i, fat_tab->aux_cnt[i], fat_tab->aux_cnt_cck[i], aux_rssi); -#if 0 - /* PHYDM_DBG(dm,DBG_ANT_DIV, "*** MAC ID:[ %d ] , target_ant =*/ - /*( %s )\n", i ,(target_ant==MAIN_ANT)?"MAIN_ANT":"AUX_ANT"); */ -#endif local_max_rssi = (main_rssi > aux_rssi) ? main_rssi : aux_rssi; /* @2 Select max_rssi for DIG */ @@ -3716,9 +3437,6 @@ void odm_sw_antdiv_callback(struct phydm_timer_list *timer) odm_schedule_work_item(&swat_tab->phydm_sw_antenna_switch_workitem); #else { -#if 0 - /* @dbg_print("SW_antdiv_Callback"); */ -#endif odm_s0s1_sw_ant_div(&hal_data->DM_OutSrc, SWAW_STEP_DETERMINE); } #endif @@ -3732,9 +3450,6 @@ void odm_sw_antdiv_workitem_callback(void *context) void *adapter = (void *)context; HAL_DATA_TYPE *hal_data = GET_HAL_DATA(((PADAPTER)adapter)); -#if 0 - /* @dbg_print("SW_antdiv_Workitem_Callback"); */ -#endif odm_s0s1_sw_ant_div(&hal_data->DM_OutSrc, SWAW_STEP_DETERMINE); } @@ -3747,9 +3462,6 @@ void odm_sw_antdiv_workitem_callback(void *context) HAL_DATA_TYPE *hal_data = GET_HAL_DATA(((PADAPTER)adapter)); -#if 0 - /*@dbg_print("SW_antdiv_Workitem_Callback");*/ -#endif odm_s0s1_sw_ant_div(&hal_data->odmpriv, SWAW_STEP_DETERMINE); } @@ -3760,12 +3472,8 @@ void odm_sw_antdiv_callback(void *function_context) if (*dm->is_net_closed == true) return; -#if 0 /* @Can't do I/O in timer callback*/ - odm_s0s1_sw_ant_div(dm, SWAW_STEP_DETERMINE); -#else rtw_run_in_thread_cmd(padapter, odm_sw_antdiv_workitem_callback, padapter); -#endif } #endif @@ -4008,38 +3716,6 @@ void odm_fast_ant_training( fat_tab->ant_ave_rssi[i]); } -#if 0 -#if (RTL8192E_SUPPORT == 1) - /* @3 [path-B]--------------------------- */ - for (i = 0; i < (dm->fat_comb_b); i++) { - if (fat_tab->antRSSIcnt_pathB[i] == 0) - fat_tab->antAveRSSI_pathB[i] = 0; - else { /* @(ant_rssi_cnt[i] != 0) */ - fat_tab->antAveRSSI_pathB[i] = fat_tab->antSumRSSI_pathB[i] / fat_tab->antRSSIcnt_pathB[i]; - is_pkt_filter_macth_path_b = true; - } - if (fat_tab->antAveRSSI_pathB[i] > max_rssi_path_b) { - max_rssi_path_b = fat_tab->antAveRSSI_pathB[i]; - pckcnt_path_b = fat_tab->antRSSIcnt_pathB[i]; - target_ant_path_b = (u8)i; - } - if (fat_tab->antAveRSSI_pathB[i] == max_rssi_path_b) { - if (fat_tab->antRSSIcnt_pathB > pckcnt_path_b) { - max_rssi_path_b = fat_tab->antAveRSSI_pathB[i]; - target_ant_path_b = (u8)i; - } - } - if (dm->fat_print_rssi == 1) { - PHYDM_DBG(dm, DBG_ANT_DIV, - "***{path-B}: Sum RSSI[%d] = (( %d )), cnt RSSI [%d] = (( %d )), Avg RSSI[%d] = (( %d ))\n", - i, fat_tab->antSumRSSI_pathB[i], i, - fat_tab->antRSSIcnt_pathB[i], i, - fat_tab->antAveRSSI_pathB[i]); - } - } -#endif -#endif - /* @1 DECISION STATE */ /* @2 Select TRX Antenna */ @@ -4048,9 +3724,6 @@ void odm_fast_ant_training( /* @3 [path-A]--------------------------- */ if (is_pkt_filter_macth_path_a == false) { -#if 0 - /* PHYDM_DBG(dm,DBG_ANT_DIV, "{path-A}: None Packet is matched\n"); */ -#endif PHYDM_DBG(dm, DBG_ANT_DIV, "{path-A}: None Packet is matched\n"); odm_ant_div_on_off(dm, ANTDIV_OFF, ANT_PATH_A); @@ -4071,27 +3744,6 @@ void odm_fast_ant_training( if (target_ant_path_a == 0) odm_ant_div_on_off(dm, ANTDIV_OFF, ANT_PATH_A); } -#if 0 -#if (RTL8192E_SUPPORT == 1) - /* @3 [path-B]--------------------------- */ - if (is_pkt_filter_macth_path_b == false) { - if (dm->fat_print_rssi == 1) - PHYDM_DBG(dm, DBG_ANT_DIV, - "***[%d]{path-B}: None Packet is matched\n\n\n", - __LINE__); - } else { - if (dm->fat_print_rssi == 1) { - PHYDM_DBG(dm, DBG_ANT_DIV, - " ***target_ant_path_b = (( %d )) *** max_rssi = (( %d ))***\n\n\n", - target_ant_path_b, max_rssi_path_b); - } - odm_set_bb_reg(dm, R_0xb38, BIT(21) | BIT20 | BIT19, target_ant_path_b); /* @Default RX is Omni, Optional RX is the best decision by FAT */ - odm_set_bb_reg(dm, R_0x80c, BIT(21), 1); /* Reg80c[21]=1'b1 //from TX Info */ - - fat_tab->antsel_pathB[fat_tab->train_idx] = target_ant_path_b; - } -#endif -#endif /* @2 Reset counter */ for (i = 0; i < (dm->fat_comb_a); i++) { @@ -4620,24 +4272,12 @@ void odm_ant_div(void *dm_void) dm->debug_components &= ~DBG_ANT_DIV; if (fat_tab->ant_div_2g_5g == ODM_ANTDIV_2G) { -#if 0 - /* PHYDM_DBG(dm, DBG_ANT_DIV,"[ 2G AntDiv Running ]\n"); */ -#endif if (!(dm->support_ic_type & ODM_ANTDIV_2G_SUPPORT_IC)) return; } else if (fat_tab->ant_div_2g_5g == ODM_ANTDIV_5G) { -#if 0 - /* PHYDM_DBG(dm, DBG_ANT_DIV,"[ 5G AntDiv Running ]\n"); */ -#endif if (!(dm->support_ic_type & ODM_ANTDIV_5G_SUPPORT_IC)) return; } -#if 0 -/* @else if(fat_tab->ant_div_2g_5g == (ODM_ANTDIV_2G|ODM_ANTDIV_5G)) */ -/* @{ */ -/* PHYDM_DBG(dm, DBG_ANT_DIV,"[ 2G & 5G AntDiv Running ]\n"); */ -/* @} */ -#endif #endif /* @---------- */ @@ -4660,11 +4300,6 @@ void odm_ant_div(void *dm_void) #endif } -#if 0 - /* PHYDM_DBG(dm, DBG_ANT_DIV,"ant_type= (%d), pre_ant_type= (%d)\n",*/ - /*dm->ant_type,dm->pre_ant_type); */ -#endif - if (dm->ant_type != ODM_AUTO_ANT) { PHYDM_DBG(dm, DBG_ANT_DIV, "Fix Antenna at (( %s ))\n", (dm->ant_type == ODM_FIX_MAIN_ANT) ? "MAIN" : "AUX"); @@ -4812,9 +4447,6 @@ void odm_ant_div(void *dm_void) sat_tab->fix_beam_pattern_codeword); /*return;*/ } else { -#if 0 -/*PHYDM_DBG(dm,DBG_ANT_DIV,"[SmartAnt] ant_div_type=HL_SW_SMART_ANT_TYPE1\n");*/ -#endif odm_fast_ant_training_hl_smart_antenna_type1(dm); } @@ -4827,9 +4459,7 @@ void odm_ant_div(void *dm_void) dm->ant_div_type = CG_TRX_HW_ANTDIV; PHYDM_DBG(dm, DBG_ANT_DIV, " [S0S1_SW_ANTDIV] -> [CG_TRX_HW_ANTDIV]\n"); -#if 0 - /*odm_set_bb_reg(dm, R_0x8d4, BIT24, 1); */ -#endif + if (fat_tab->is_become_linked == true) odm_ant_div_on_off(dm, ANTDIV_ON, @@ -4842,9 +4472,7 @@ void odm_ant_div(void *dm_void) dm->ant_div_type = S0S1_SW_ANTDIV; PHYDM_DBG(dm, DBG_ANT_DIV, " [CG_TRX_HW_ANTDIV] -> [S0S1_SW_ANTDIV]\n"); -#if 0 - /*odm_set_bb_reg(dm, R_0x8d4, BIT24, 0);*/ -#endif + odm_ant_div_on_off(dm, ANTDIV_OFF, ANT_PATH_A); } @@ -5195,11 +4823,7 @@ void odm_process_rssi_for_ant_div(void *dm_void, void *phy_info_void, sat_tab->pkt_rssi_cnt[fat_tab->antsel_rx_keep_0][sat_tab->fast_training_beam_num]++; sat_tab->pkt_counter++; -#if 1 train_pkt_number = sat_tab->beam_train_cnt[fat_tab->rx_idle_ant - 1][sat_tab->fast_training_beam_num]; -#else - train_pkt_number = sat_tab->per_beam_training_pkt_num; -#endif /*Swich Antenna erery N pkts*/ if (sat_tab->pkt_counter == train_pkt_number) { @@ -5310,14 +4934,7 @@ void odm_process_rssi_for_ant_div(void *dm_void, void *phy_info_void, odm_process_rssi_normal(dm, phy_info, pktinfo, rx_power_ant0); } -#if 0 -/* PHYDM_DBG(dm,DBG_ANT_DIV,"is_cck_rate=%d, pwdb_all=%d\n", - * pktinfo->is_cck_rate, phy_info->rx_pwdb_all); - * PHYDM_DBG(dm,DBG_ANT_DIV,"antsel_tr_mux=3'b%d%d%d\n", - * fat_tab->antsel_rx_keep_2, fat_tab->antsel_rx_keep_1, - * fat_tab->antsel_rx_keep_0); - */ -#endif + } #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE | ODM_IOT)) @@ -5394,30 +5011,22 @@ void odm_set_tx_ant_by_tx_info( return; if (dm->support_ic_type == ODM_RTL8881A) { -#if 0 - /*panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8881E******\n",__FUNCTION__,__LINE__); */ -#endif + pdesc->Dword6 &= set_desc(~(BIT(18) | BIT(17) | BIT(16))); pdesc->Dword6 |= set_desc(fat_tab->antsel_a[aid] << 16); } else if (dm->support_ic_type == ODM_RTL8192E) { -#if 0 - /*panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8192E******\n",__FUNCTION__,__LINE__); */ -#endif + pdesc->Dword6 &= set_desc(~(BIT(18) | BIT(17) | BIT(16))); pdesc->Dword6 |= set_desc(fat_tab->antsel_a[aid] << 16); } else if (dm->support_ic_type == ODM_RTL8197F) { -#if 0 - /*panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8192E******\n",__FUNCTION__,__LINE__); */ -#endif + pdesc->Dword6 &= set_desc(~(BIT(17) | BIT(16))); pdesc->Dword6 |= set_desc(fat_tab->antsel_a[aid] << 16); } else if (dm->support_ic_type == ODM_RTL8822B) { pdesc->Dword6 &= set_desc(~(BIT(17) | BIT(16))); pdesc->Dword6 |= set_desc(fat_tab->antsel_a[aid] << 16); } else if (dm->support_ic_type == ODM_RTL8188E) { -#if 0 - /*panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8188E******\n",__FUNCTION__,__LINE__);*/ -#endif + pdesc->Dword2 &= set_desc(~BIT(24)); pdesc->Dword2 &= set_desc(~BIT(25)); pdesc->Dword7 &= set_desc(~BIT(29)); @@ -5428,9 +5037,6 @@ void odm_set_tx_ant_by_tx_info( } else if (dm->support_ic_type == ODM_RTL8812) { /*@[path-A]*/ -#if 0 - /*panic_printk("[%s] [%d] ******ODM_SetTxAntByTxInfo_8881E******\n",__FUNCTION__,__LINE__);*/ -#endif pdesc->Dword6 &= set_desc(~BIT(16)); pdesc->Dword6 &= set_desc(~BIT(17)); @@ -5442,7 +5048,6 @@ void odm_set_tx_ant_by_tx_info( } } -#if 1 /*@def CONFIG_WLAN_HAL*/ void odm_set_tx_ant_by_tx_info_hal( struct rtl8192cd_priv *priv, void *pdesc_data, @@ -5460,16 +5065,11 @@ void odm_set_tx_ant_by_tx_info_hal( if (dm->support_ic_type & (ODM_RTL8881A | ODM_RTL8192E | ODM_RTL8814A | ODM_RTL8197F | ODM_RTL8822B)) { -#if 0 - /*panic_printk("[%s] [%d] **odm_set_tx_ant_by_tx_info_hal**\n", - * __FUNCTION__,__LINE__); - */ -#endif + pdescdata->ant_sel = 1; pdescdata->ant_sel_a = fat_tab->antsel_a[aid]; } } -#endif /*@#ifdef CONFIG_WLAN_HAL*/ #endif diff --git a/hal/phydm/phydm_antdiv.h b/hal/phydm/phydm_antdiv.h index 0449ce82..99354add 100644 --- a/hal/phydm/phydm_antdiv.h +++ b/hal/phydm/phydm_antdiv.h @@ -497,10 +497,8 @@ struct tx_desc; void odm_set_tx_ant_by_tx_info(struct rtl8192cd_priv *priv, struct tx_desc *pdesc, unsigned short aid); -#if 1 /*@def def CONFIG_WLAN_HAL*/ void odm_set_tx_ant_by_tx_info_hal(struct rtl8192cd_priv *priv, void *pdesc_data, u16 aid); -#endif /*@#ifdef CONFIG_WLAN_HAL*/ #endif void odm_ant_div_config(void *dm_void); diff --git a/hal/phydm/phydm_api.c b/hal/phydm/phydm_api.c index f84279c3..f8290834 100644 --- a/hal/phydm/phydm_api.c +++ b/hal/phydm/phydm_api.c @@ -279,9 +279,6 @@ void phydm_trx_antenna_setting_init(void *dm_void, u8 num_rf_path) u8 path_bitmap = 1; path_bitmap = (u8)phydm_gen_bitmask(num_rf_path); -#if 0 - /*PHYDM_DBG(dm, ODM_COMP_INIT, "path_bitmap=0x%x\n", path_bitmap);*/ -#endif dm->tx_ant_status = path_bitmap; dm->rx_ant_status = path_bitmap; diff --git a/hal/phydm/phydm_beamforming.c b/hal/phydm/phydm_beamforming.c index bc4855c1..1e21f402 100644 --- a/hal/phydm/phydm_beamforming.c +++ b/hal/phydm/phydm_beamforming.c @@ -460,41 +460,6 @@ beamforming_add_bfer_entry( return NULL; } -#if 0 -boolean -beamforming_remove_entry( - void *adapter, - u8 *RA, - u8 *idx -) -{ - HAL_DATA_TYPE *hal_data = GET_HAL_DATA(((PADAPTER)adapter)); - struct dm_struct *dm = &hal_data->DM_OutSrc; - - struct _RT_BEAMFORMER_ENTRY *bfer_entry = phydm_beamforming_get_bfer_entry_by_addr(dm, RA, idx); - struct _RT_BEAMFORMEE_ENTRY *entry = phydm_beamforming_get_bfee_entry_by_addr(dm, RA, idx); - boolean ret = false; - - RT_DISP(FBEAM, FBEAM_FUN, ("[Beamforming]@%s Start!\n", __func__)); - RT_DISP(FBEAM, FBEAM_FUN, ("[Beamforming]@%s, bfer_entry=0x%x\n", __func__, bfer_entry)); - RT_DISP(FBEAM, FBEAM_FUN, ("[Beamforming]@%s, entry=0x%x\n", __func__, entry)); - - if (entry != NULL) { - entry->is_used = false; - entry->beamform_entry_cap = BEAMFORMING_CAP_NONE; - /*@entry->beamform_entry_state = BEAMFORMING_ENTRY_STATE_UNINITIALIZE;*/ - entry->is_beamforming_in_progress = false; - ret = true; - } - if (bfer_entry != NULL) { - bfer_entry->is_used = false; - bfer_entry->beamform_entry_cap = BEAMFORMING_CAP_NONE; - ret = true; - } - return ret; -} -#endif - /* Used for beamforming_start_v1 */ void phydm_beamforming_ndpa_rate( void *dm_void, @@ -1807,35 +1772,6 @@ void beamforming_leave( PHYDM_DBG(dm, DBG_TXBF, "[%s] End!!\n", __func__); } -#if 0 -/* Nobody calls this function */ -void -phydm_beamforming_set_txbf_en( - void *dm_void, - u8 mac_id, - boolean is_txbf -) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - u8 idx = 0; - struct _RT_BEAMFORMEE_ENTRY *entry; - - PHYDM_DBG(dm, DBG_TXBF, "%s Start!\n", __func__); - - entry = phydm_beamforming_get_entry_by_mac_id(dm, mac_id, &idx); - - if (entry == NULL) - return; - else - entry->is_txbf = is_txbf; - - PHYDM_DBG(dm, DBG_TXBF, "%s mac_id %d TxBF %d\n", __func__, - entry->mac_id, entry->is_txbf); - - phydm_beamforming_notify(dm); -} -#endif - enum beamforming_cap phydm_beamforming_get_beam_cap( void *dm_void, diff --git a/hal/phydm/phydm_cck_pd.c b/hal/phydm/phydm_cck_pd.c index 8f5229ab..7d2a484e 100644 --- a/hal/phydm/phydm_cck_pd.c +++ b/hal/phydm/phydm_cck_pd.c @@ -412,12 +412,6 @@ void phydm_set_cckpd_lv_type3(void *dm_void, enum cckpd_lv lv) pd_th += 1; cs_ratio += 1; } - #if 0 - else if (lv == CCK_PD_LV_0) { - pd_th += 0; - cs_ratio += 0; - } - #endif phydm_write_cck_pd_type3(dm, pd_th, cs_ratio, cck_mode); } @@ -799,29 +793,6 @@ void phydm_cck_pd_init_type4(void *dm_void) PHYDM_DBG(dm, DBG_CCKPD, "[%s]======>\n", __func__); - #if 0 - /*@ - *cckpd_t[0][0][0][0] = 1ac8[7:0] r_PD_lim_RFBW20_1R - *cckpd_t[0][1][0][0] = 1ac8[15:8] r_PD_lim_RFBW20_2R - *cckpd_t[0][2][0][0] = 1ac8[23:16] r_PD_lim_RFBW20_3R - *cckpd_t[0][3][0][0] = 1ac8[31:24] r_PD_lim_RFBW20_4R - *cckpd_t[1][0][0][0] = 1acc[7:0] r_PD_lim_RFBW40_1R - *cckpd_t[1][1][0][0] = 1acc[15:8] r_PD_lim_RFBW40_2R - *cckpd_t[1][2][0][0] = 1acc[23:16] r_PD_lim_RFBW40_3R - *cckpd_t[1][3][0][0] = 1acc[31:24] r_PD_lim_RFBW40_4R - * - * - *cckpd_t[0][0][1][0] = 1ad0[4:0] r_CS_ratio_RFBW20_1R[4:0] - *cckpd_t[0][1][1][0] = 1ad0[9:5] r_CS_ratio_RFBW20_2R[4:0] - *cckpd_t[0][2][1][0] = 1ad0[14:10] r_CS_ratio_RFBW20_3R[4:0] - *cckpd_t[0][3][1][0] = 1ad0[19:15] r_CS_ratio_RFBW20_4R[4:0] - *cckpd_t[1][0][1][0] = 1ad0[24:20] r_CS_ratio_RFBW40_1R[4:0] - *cckpd_t[1][1][1][0] = 1ad0[29:25] r_CS_ratio_RFBW40_2R[4:0] - *cckpd_t[1][2][1][0] = 1ad0[31:30] r_CS_ratio_RFBW40_3R[1:0] - * 1ad4[2:0] r_CS_ratio_RFBW40_3R[4:2] - *cckpd_t[1][3][1][0] = 1ad4[7:3] r_CS_ratio_RFBW40_4R[4:0] - */ - #endif /*[Check Nrx]*/ cck_n_rx = (u8)odm_get_bb_reg(dm, R_0x1a2c, 0x60000) + 1; diff --git a/hal/phydm/phydm_ccx.c b/hal/phydm/phydm_ccx.c index 1f11046e..5bc7b041 100644 --- a/hal/phydm/phydm_ccx.c +++ b/hal/phydm/phydm_ccx.c @@ -812,14 +812,6 @@ void phydm_nhm_set(void *dm_void, enum nhm_option_txon_all include_tx, ccx->nhm_include_txon = include_tx; ccx->nhm_include_cca = include_cca; ccx->nhm_divider_opt = divi_opt; - #if 0 - PHYDM_DBG(dm, DBG_ENV_MNTR, - "val_tmp=%d, incld{tx, cca}={%d, %d}, divi_opt=%d, period=%d\n", - val_tmp, include_tx, include_cca, divi_opt, period); - - PHYDM_DBG(dm, DBG_ENV_MNTR, "0x994=0x%x\n", - odm_get_bb_reg(dm, 0x994, 0xf00)); - #endif } /*Set NHM period*/ @@ -1138,15 +1130,6 @@ void phydm_clm_h2c(void *dm_void, u16 obs_time, u8 fw_clm_en) break; } } -#if 0 - obs_time = (2 ^ 16 - 1)~(2 ^ 15) => obs_time_idx = 15 (65535 ~32768) - obs_time = (2 ^ 15 - 1)~(2 ^ 14) => obs_time_idx = 14 - ... - ... - ... - obs_time = (2 ^ 1 - 1)~(2 ^ 0) => obs_time_idx = 0 - -#endif h2c_val[0] = obs_time_idx | (((fw_clm_en) ? 1 : 0) << 7); h2c_val[1] = CLM_MAX_REPORT_TIME; diff --git a/hal/phydm/phydm_cfotracking.c b/hal/phydm/phydm_cfotracking.c index 95d89e37..7ca917de 100644 --- a/hal/phydm/phydm_cfotracking.c +++ b/hal/phydm/phydm_cfotracking.c @@ -520,10 +520,6 @@ void phydm_parsing_cfo(void *dm_void, void *pktinfo_void, s8 *pcfotail, if (valid_info) { if (num_ss > dm->num_rf_path) /*@For fool proof*/ num_ss = dm->num_rf_path; - #if 0 - PHYDM_DBG(dm, DBG_CFO_TRK, "num_ss=%d, num_rf_path=%d\n", - num_ss, dm->num_rf_path); - #endif /* @ Update CFO report for path-A & path-B */ /* Only paht-A and path-B have CFO tail and short CFO */ @@ -532,13 +528,6 @@ void phydm_parsing_cfo(void *dm_void, void *pktinfo_void, s8 *pcfotail, continue; cfo_track->CFO_tail[i] += pcfotail[i]; cfo_track->CFO_cnt[i]++; - #if 0 - PHYDM_DBG(dm, DBG_CFO_TRK, - "[ID %d][path %d][rate 0x%x] CFO_tail = ((%d)), CFO_tail_sum = ((%d)), CFO_cnt = ((%d))\n", - pktinfo->station_id, i, pktinfo->data_rate, - pcfotail[i], cfo_track->CFO_tail[i], - cfo_track->CFO_cnt[i]); - #endif } /* @ Update packet counter */ diff --git a/hal/phydm/phydm_debug.c b/hal/phydm/phydm_debug.c index 5d63ea45..a0006e09 100644 --- a/hal/phydm/phydm_debug.c +++ b/hal/phydm/phydm_debug.c @@ -180,14 +180,8 @@ void phydm_bb_hw_dbg_info_n(void *dm_void, u32 *_used, char *output, u8 rf_gain_a = 0, rf_gain_b = 0, rf_gain_c = 0, rf_gain_d = 0; u8 rx_snr_a = 0, rx_snr_b = 0, rx_snr_c = 0, rx_snr_d = 0; s8 rxevm_0 = 0, rxevm_1 = 0; - #if 1 struct phydm_cfo_rpt cfo; u8 i = 0; - #else - s32 short_cfo_a = 0, short_cfo_b = 0, long_cfo_a = 0, long_cfo_b = 0; - s32 scfo_a = 0, scfo_b = 0, avg_cfo_a = 0, avg_cfo_b = 0; - s32 cfo_end_a = 0, cfo_end_b = 0, acq_cfo_a = 0, acq_cfo_b = 0; - #endif PDM_SNPF(out_len, used, output + used, out_len - used, "\r\n %-35s\n", "BB Report Info"); @@ -244,7 +238,6 @@ void phydm_bb_hw_dbg_info_n(void *dm_void, u32 *_used, char *output, PDM_SNPF(out_len, used, output + used, out_len - used, "\r\n %-35s = %d / %d", "RXEVM (1ss/2ss)", rxevm_0, rxevm_1); -#if 1 phydm_get_cfo_info(dm, &cfo); for (i = 0; i < dm->num_rf_path; i++) { PDM_SNPF(out_len, used, output + used, out_len - used, @@ -253,118 +246,6 @@ void phydm_bb_hw_dbg_info_n(void *dm_void, u32 *_used, char *output, cfo.cfo_rpt_s[i], cfo.cfo_rpt_l[i], cfo.cfo_rpt_sec[i], cfo.cfo_rpt_acq[i], cfo.cfo_rpt_end[i]); } -#else - /*@CFO Report Info*/ - odm_set_bb_reg(dm, R_0xd00, BIT(26), 1); - - /*Short CFO*/ - value32 = odm_get_bb_reg(dm, R_0xdac, MASKDWORD); - value32_1 = odm_get_bb_reg(dm, R_0xdb0, MASKDWORD); - - short_cfo_b = (s32)(value32 & 0xfff); /*S(12,11)*/ - short_cfo_a = (s32)((value32 & 0x0fff0000) >> 16); - - long_cfo_b = (s32)(value32_1 & 0x1fff); /*S(13,12)*/ - long_cfo_a = (s32)((value32_1 & 0x1fff0000) >> 16); - - /*SFO 2's to dec*/ - if (short_cfo_a > 2047) - short_cfo_a = short_cfo_a - 4096; - if (short_cfo_b > 2047) - short_cfo_b = short_cfo_b - 4096; - - short_cfo_a = (short_cfo_a * 312500) / 2048; - short_cfo_b = (short_cfo_b * 312500) / 2048; - - /*@LFO 2's to dec*/ - - if (long_cfo_a > 4095) - long_cfo_a = long_cfo_a - 8192; - - if (long_cfo_b > 4095) - long_cfo_b = long_cfo_b - 8192; - - long_cfo_a = long_cfo_a * 312500 / 4096; - long_cfo_b = long_cfo_b * 312500 / 4096; - - PDM_SNPF(out_len, used, output + used, out_len - used, "\r\n %-35s", - "CFO Report Info"); - PDM_SNPF(out_len, used, output + used, out_len - used, - "\r\n %-35s = %d / %d", "Short CFO(Hz) ", short_cfo_a, - short_cfo_b); - PDM_SNPF(out_len, used, output + used, out_len - used, - "\r\n %-35s = %d / %d", "Long CFO(Hz) ", long_cfo_a, - long_cfo_b); - - /*SCFO*/ - value32 = odm_get_bb_reg(dm, R_0xdb8, MASKDWORD); - value32_1 = odm_get_bb_reg(dm, R_0xdb4, MASKDWORD); - - scfo_b = (s32)(value32 & 0x7ff); /*S(11,10)*/ - scfo_a = (s32)((value32 & 0x07ff0000) >> 16); - - if (scfo_a > 1023) - scfo_a = scfo_a - 2048; - - if (scfo_b > 1023) - scfo_b = scfo_b - 2048; - - scfo_a = scfo_a * 312500 / 1024; - scfo_b = scfo_b * 312500 / 1024; - - avg_cfo_b = (s32)(value32_1 & 0x1fff); /*S(13,12)*/ - avg_cfo_a = (s32)((value32_1 & 0x1fff0000) >> 16); - - if (avg_cfo_a > 4095) - avg_cfo_a = avg_cfo_a - 8192; - - if (avg_cfo_b > 4095) - avg_cfo_b = avg_cfo_b - 8192; - - avg_cfo_a = avg_cfo_a * 312500 / 4096; - avg_cfo_b = avg_cfo_b * 312500 / 4096; - - PDM_SNPF(out_len, used, output + used, out_len - used, - "\r\n %-35s = %d / %d", "value SCFO(Hz) ", scfo_a, - scfo_b); - PDM_SNPF(out_len, used, output + used, out_len - used, - "\r\n %-35s = %d / %d", "Avg CFO(Hz) ", avg_cfo_a, - avg_cfo_b); - - value32 = odm_get_bb_reg(dm, R_0xdbc, MASKDWORD); - value32_1 = odm_get_bb_reg(dm, R_0xde0, MASKDWORD); - - cfo_end_b = (s32)(value32 & 0x1fff); /*S(13,12)*/ - cfo_end_a = (s32)((value32 & 0x1fff0000) >> 16); - - if (cfo_end_a > 4095) - cfo_end_a = cfo_end_a - 8192; - - if (cfo_end_b > 4095) - cfo_end_b = cfo_end_b - 8192; - - cfo_end_a = cfo_end_a * 312500 / 4096; - cfo_end_b = cfo_end_b * 312500 / 4096; - - acq_cfo_b = (s32)(value32_1 & 0x1fff); /*S(13,12)*/ - acq_cfo_a = (s32)((value32_1 & 0x1fff0000) >> 16); - - if (acq_cfo_a > 4095) - acq_cfo_a = acq_cfo_a - 8192; - - if (acq_cfo_b > 4095) - acq_cfo_b = acq_cfo_b - 8192; - - acq_cfo_a = acq_cfo_a * 312500 / 4096; - acq_cfo_b = acq_cfo_b * 312500 / 4096; - - PDM_SNPF(out_len, used, output + used, out_len - used, - "\r\n %-35s = %d / %d", "End CFO(Hz) ", cfo_end_a, - cfo_end_b); - PDM_SNPF(out_len, used, output + used, out_len - used, - "\r\n %-35s = %d / %d", "ACQ CFO(Hz) ", acq_cfo_a, - acq_cfo_b); -#endif } #endif @@ -667,25 +548,11 @@ void phydm_bb_hw_dbg_info_ac(void *dm_void, u32 *_used, char *output, /*@ [VHT SIG B] ====================================================*/ value32 = odm_get_bb_reg(dm, R_0xf34, MASKDWORD); - #if 0 - v_length = (u16)(value32 & 0x1fffff); - vbrsv = (u8)((value32 & 0x600000) >> 21); - vb_tail = (u16)((value32 & 0x1f800000) >> 23); - vbcrc = (u8)((value32 & 0x80000000) >> 31); - #endif - PDM_SNPF(out_len, used, output + used, out_len - used, "\r\n %-35s", "VHT-SIG-B"); PDM_SNPF(out_len, used, output + used, out_len - used, "\r\n %-35s = %x", "Codeword", value32); - - #if 0 - PDM_SNPF(out_len, used, output + used, out_len - used, - "\r\n %-35s = %x / %x / %x / %x", - "length/Rsv/tail/CRC", - v_length, vbrsv, vb_tail, vbcrc); - #endif } *_used = used; @@ -4381,26 +4248,6 @@ void phydm_fw_trace_handler(void *dm_void, u8 *cmd_buf, u8 cmd_len) freg_num = (buf_0 & 0xf); c2h_seq = (buf_0 & 0xf0) >> 4; - #if 0 - PHYDM_DBG(dm, DBG_FW_TRACE, - "[FW debug message] freg_num = (( %d )), c2h_seq=(( %d ))\n", - freg_num, c2h_seq); - - strncpy(debug_trace_11byte, &cmd_buf[1], (cmd_len - 1)); - debug_trace_11byte[cmd_len - 1] = '\0'; - PHYDM_DBG(dm, DBG_FW_TRACE, "[FW debug message] %s\n", - debug_trace_11byte); - PHYDM_DBG(dm, DBG_FW_TRACE, "[FW debug message] cmd_len = (( %d ))\n", - cmd_len); - PHYDM_DBG(dm, DBG_FW_TRACE, "[FW debug message] c2h_cmd_start=((%d))\n", - dm->c2h_cmd_start); - - PHYDM_DBG(dm, DBG_FW_TRACE, "pre_seq = (( %d )), current_seq=((%d))\n", - dm->pre_c2h_seq, c2h_seq); - PHYDM_DBG(dm, DBG_FW_TRACE, "fw_buff_is_enpty = (( %d ))\n", - dm->fw_buff_is_enpty); - #endif - if (c2h_seq != dm->pre_c2h_seq && dm->fw_buff_is_enpty == false) { dm->fw_debug_trace[dm->c2h_cmd_start] = '\0'; PHYDM_DBG(dm, DBG_FW_TRACE, "[FW Dbg Queue Overflow] %s\n", @@ -4430,9 +4277,7 @@ void phydm_fw_trace_handler(void *dm_void, u8 *cmd_buf, u8 cmd_len) PHYDM_DBG(dm, DBG_FW_TRACE, "[FW DBG Msg] %s\n", dm->fw_debug_trace); -#if 0 - /*@dbg_print("[FW DBG Msg] %s\n", dm->fw_debug_trace);*/ -#endif + dm->c2h_cmd_start = 0; dm->fw_buff_is_enpty = true; } @@ -4675,11 +4520,6 @@ void phydm_fw_trace_handler_8051(void *dm_void, u8 *buffer, u8 cmd_len) { #ifdef CONFIG_PHYDM_DEBUG_FUNCTION struct dm_struct *dm = (struct dm_struct *)dm_void; -#if 0 - if (cmd_len >= 3) - cmd_buf[cmd_len - 1] = '\0'; - PHYDM_DBG(dm, DBG_FW_TRACE, "[FW DBG Msg] %s\n", &cmd_buf[3]); -#else int i = 0; u8 extend_c2h_sub_id = 0, extend_c2h_dbg_len = 0; @@ -4725,7 +4565,5 @@ void phydm_fw_trace_handler_8051(void *dm_void, u8 *buffer, u8 cmd_len) goto go_backfor_aggre_dbg_pkt; } } - -#endif #endif /*@#ifdef CONFIG_PHYDM_DEBUG_FUNCTION*/ } diff --git a/hal/phydm/phydm_dig.c b/hal/phydm/phydm_dig.c index 2e5321a9..9d9ea0d8 100644 --- a/hal/phydm/phydm_dig.c +++ b/hal/phydm/phydm_dig.c @@ -935,10 +935,6 @@ u8 phydm_new_igi_by_fa(struct dm_struct *dm, u8 igi, u32 fa_cnt, u8 *step_size) boolean dig_go_up_check = true; struct phydm_dig_struct *dig_t = &dm->dm_dig_table; -#if 0 - /*@dig_go_up_check = phydm_dig_go_up_check(dm);*/ -#endif - if (fa_cnt > dig_t->fa_th[2] && dig_go_up_check) igi = igi + step_size[0]; else if ((fa_cnt > dig_t->fa_th[1]) && dig_go_up_check) @@ -1681,9 +1677,7 @@ void phydm_tdma_dig_timer_check(void *dm_void) #else /*@if interrupt mask info is got.*/ /*Reg0xb0 is no longer needed*/ -#if 0 - /*regb0 = odm_get_bb_reg(dm, R_0xb0, bMaskDWord);*/ -#endif + PHYDM_DBG(dm, DBG_DIG, "Check fail, Mask[0]=0x%x, restart timer\n", *dm->interrupt_mask); @@ -1999,15 +1993,6 @@ u8 get_new_igi_bound(struct dm_struct *dm, u8 igi, u32 fa_cnt, u8 *rx_gain_max, igi = *rx_gain_min; } - #if 0 - #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) - #if (RTL8812A_SUPPORT) - if (dm->support_ic_type == ODM_RTL8812) - odm_config_bb_with_header_file(dm, - CONFIG_BB_AGC_TAB_DIFF); - #endif - #endif - #endif PHYDM_DBG(dm, DBG_DIG, "First connect: foce IGI=0x%x\n", igi); } else if (dm->is_linked) { PHYDM_DBG(dm, DBG_DIG, "Adjust IGI @ linked\n"); @@ -2348,14 +2333,6 @@ void phydm_tdma_low_dig(void *dm_void) else dig_t->dm_dig_min = DIG_MIN_DFS; - } else { - #if 0 - if (dm->support_ic_type & - (ODM_RTL8814A | ODM_RTL8812 | ODM_RTL8821 | ODM_RTL8822B)) - dig_t->dm_dig_min = 0x1c; - else if (dm->support_ic_type & ODM_RTL8197F) - dig_t->dm_dig_min = 0x1e; /*@For HW setting*/ - #endif } PHYDM_DBG(dm, DBG_DIG, "Abs{Max, Min}={0x%x, 0x%x}, Max_of_min=0x%x\n", @@ -2446,9 +2423,6 @@ void phydm_tdma_low_dig(void *dm_void) dig_t->low_ig_value = tdma_l_igi; dig_t->tdma_rx_gain_min[TDMA_DIG_LOW_STATE] = tdma_l_dym_min; dig_t->tdma_rx_gain_max[TDMA_DIG_LOW_STATE] = tdma_l_dym_max; -#if 0 - /*odm_write_dig(dm, tdma_l_igi);*/ -#endif } else { odm_write_dig(dm, new_igi); } @@ -2522,15 +2496,7 @@ void phydm_tdma_high_dig(void *dm_void) dig_t->dig_max_of_min = DIG_MAX_OF_MIN_PERFORMANCE_MODE; } - #if 0 - if (dm->support_ic_type & - (ODM_RTL8814A | ODM_RTL8812 | ODM_RTL8821 | ODM_RTL8822B)) - dig_t->dm_dig_min = 0x1c; - else if (dm->support_ic_type & ODM_RTL8197F) - dig_t->dm_dig_min = 0x1e; /*@For HW setting*/ - else - #endif - dig_t->dm_dig_min = DIG_MIN_PERFORMANCE; + dig_t->dm_dig_min = DIG_MIN_PERFORMANCE; } PHYDM_DBG(dm, DBG_DIG, "Abs{Max, Min}={0x%x, 0x%x}, Max_of_min=0x%x\n", dig_t->dm_dig_max, dig_t->dm_dig_min, dig_t->dig_max_of_min); @@ -2623,10 +2589,7 @@ void phydm_tdma_high_dig(void *dm_void) dig_t->cur_ig_value_tdma = tdma_h_igi; dig_t->tdma_rx_gain_min[TDMA_DIG_HIGH_STATE] = tdma_h_dym_min; dig_t->tdma_rx_gain_max[TDMA_DIG_HIGH_STATE] = tdma_h_dym_max; -#if 0 - /*odm_write_dig(dm, tdma_h_igi);*/ -#endif - } else { + } else { odm_write_dig(dm, new_igi); } diff --git a/hal/phydm/phydm_hwconfig.c b/hal/phydm/phydm_hwconfig.c index 35228178..db931dee 100644 --- a/hal/phydm/phydm_hwconfig.c +++ b/hal/phydm/phydm_hwconfig.c @@ -370,12 +370,6 @@ odm_config_rf_with_header_file(struct dm_struct *dm, if (e_rf_path == RF_PATH_A) READ_AND_CONFIG(8195b, _radioa); } - #if 0 - else if (config_type == CONFIG_RF_TXPWR_LMT) { - READ_AND_CONFIG(8821c, _txpwr_lmt); - /*@*/ - } - #endif } #endif #if (RTL8198F_SUPPORT == 1) @@ -728,12 +722,6 @@ odm_config_rf_with_tx_pwr_track_header_file(struct dm_struct *dm) #if RTL8721D_SUPPORT if (dm->support_ic_type == ODM_RTL8721D) { - #if 0 - if (dm->package_type == 1) - READ_AND_CONFIG_MP(8721d, _txpowertrack_qfn48m_smic); - else if (dm->package_type == 5) - READ_AND_CONFIG_MP(8721d, _txpowertrack_qfn48m_umc); - #endif READ_AND_CONFIG_MP(8721d, _txpowertrack); READ_AND_CONFIG_MP(8721d, _txxtaltrack); } diff --git a/hal/phydm/phydm_interface.c b/hal/phydm/phydm_interface.c index e9d305c3..9190633d 100644 --- a/hal/phydm/phydm_interface.c +++ b/hal/phydm/phydm_interface.c @@ -684,9 +684,6 @@ void odm_initialize_timer(struct dm_struct *dm, struct phydm_timer_list *timer, init_timer(timer); timer->function = call_back_func; timer->data = (unsigned long)dm; -#if 0 - /*@mod_timer(timer, jiffies+RTL_MILISECONDS_TO_JIFFIES(10)); */ -#endif #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211) timer_setup(timer, call_back_func, 0); #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) @@ -1298,82 +1295,6 @@ void phydm_enable_rx_related_interrupt_handler(struct dm_struct *dm) #endif } -#if 0 -boolean -phydm_get_txbf_en( - struct dm_struct *dm, - u16 mac_id, - u8 i -) -{ - boolean txbf_en = false; - -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) -#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && !defined(DM_ODM_CE_MAC80211) - -#ifdef CONFIG_BEAMFORMING - enum beamforming_cap beamform_cap; - void *adapter = dm->adapter; - #ifdef PHYDM_BEAMFORMING_SUPPORT - beamform_cap = - phydm_beamforming_get_entry_beam_cap_by_mac_id(dm, mac_id); - #else/*@for drv beamforming*/ - beamform_cap = - beamforming_get_entry_beam_cap_by_mac_id(&adapter->mlmepriv, mac_id); - #endif - if (beamform_cap & (BEAMFORMER_CAP_HT_EXPLICIT | BEAMFORMER_CAP_VHT_SU)) - txbf_en = true; - else - txbf_en = false; -#endif /*@#ifdef CONFIG_BEAMFORMING*/ - -#elif (DM_ODM_SUPPORT_TYPE & ODM_AP) - -#ifdef PHYDM_BEAMFORMING_SUPPORT - u8 idx = 0xff; - boolean act_bfer = false; - BEAMFORMING_CAP beamform_cap = BEAMFORMING_CAP_NONE; - PRT_BEAMFORMING_ENTRY entry = NULL; - struct rtl8192cd_priv *priv = dm->priv; - #if (defined(CONFIG_PHYDM_ANTENNA_DIVERSITY)) - struct _BF_DIV_COEX_ *dm_bdc_table = &dm->dm_bdc_table; - - dm_bdc_table->num_txbfee_client = 0; - dm_bdc_table->num_txbfer_client = 0; - #endif -#endif - -#ifdef PHYDM_BEAMFORMING_SUPPORT - beamform_cap = Beamforming_GetEntryBeamCapByMacId(priv, mac_id); - entry = Beamforming_GetEntryByMacId(priv, mac_id, &idx); - if (beamform_cap & (BEAMFORMER_CAP_HT_EXPLICIT | BEAMFORMER_CAP_VHT_SU)) { - if (entry->Sounding_En) - txbf_en = true; - else - txbf_en = false; - act_bfer = true; - } - #if (defined(CONFIG_PHYDM_ANTENNA_DIVERSITY)) /*@BDC*/ - if (act_bfer == true) { - dm_bdc_table->w_bfee_client[i] = true; /* @AP act as BFer */ - dm_bdc_table->num_txbfee_client++; - } else - dm_bdc_table->w_bfee_client[i] = false; /* @AP act as BFer */ - - if (beamform_cap & (BEAMFORMEE_CAP_HT_EXPLICIT | BEAMFORMEE_CAP_VHT_SU)) { - dm_bdc_table->w_bfer_client[i] = true; /* @AP act as BFee */ - dm_bdc_table->num_txbfer_client++; - } else - dm_bdc_table->w_bfer_client[i] = false; /* @AP act as BFer */ - - #endif -#endif - -#endif - return txbf_en; -} -#endif - void phydm_iqk_wait(struct dm_struct *dm, u32 timeout) { #if (DM_ODM_SUPPORT_TYPE == ODM_CE) diff --git a/hal/phydm/phydm_interface.h b/hal/phydm/phydm_interface.h index 38edfb49..7200e5e7 100644 --- a/hal/phydm/phydm_interface.h +++ b/hal/phydm/phydm_interface.h @@ -92,21 +92,6 @@ enum phydm_halmac_param { #define _bit_all(_name) BIT_##_name #define _bit_ic(_name, _ic) BIT_##_name##_ic -/* @_cat: implemented by Token-Pasting Operator. */ -#if 0 -#define _cat(_name, _ic_type, _func) \ - ( \ - _func##_all(_name)) -#endif - -#if 0 - -#define ODM_REG_DIG_11N 0xC50 -#define ODM_REG_DIG_11AC 0xDDD - -ODM_REG(DIG,_pdm_odm) -#endif - #if defined(DM_ODM_CE_MAC80211) #define ODM_BIT(name, dm) \ ((dm->support_ic_type & ODM_IC_11N_SERIES) ? \ @@ -323,15 +308,6 @@ void phydm_add_interrupt_mask_handler(struct dm_struct *dm, u8 interrupt_type); void phydm_enable_rx_related_interrupt_handler(struct dm_struct *dm); -#if 0 -boolean -phydm_get_txbf_en( - struct dm_struct *dm, - u16 mac_id, - u8 i -); -#endif - void phydm_iqk_wait(struct dm_struct *dm, u32 timeout); u8 phydm_get_hwrate_to_mrate(struct dm_struct *dm, u8 rate); diff --git a/hal/phydm/phydm_lna_sat.c b/hal/phydm/phydm_lna_sat.c index 5320468b..28e6b46a 100644 --- a/hal/phydm/phydm_lna_sat.c +++ b/hal/phydm/phydm_lna_sat.c @@ -282,19 +282,7 @@ void phydm_lna_sat_chk( config_phydm_write_rf_reg_8198f(dm, RF_PATH_D, 0x86, 0x10, 1); } else if (dm->support_ic_type & ODM_RTL8814B) { /*@set rf detection range (threshold)*/ -#if 0 - config_phydm_write_rf_reg_8814b(dm, RF_PATH_A, 0x87, 0x3, 0x3); - config_phydm_write_rf_reg_8814b(dm, RF_PATH_B, 0x87, 0x3, 0x3); - config_phydm_write_rf_reg_8814b(dm, RF_PATH_C, 0x87, 0x3, 0x3); - config_phydm_write_rf_reg_8814b(dm, RF_PATH_D, 0x87, 0x3, 0x3); -#endif /*@open rf power detection ckt*/ -#if 0 - config_phydm_write_rf_reg_8814b(dm, RF_PATH_A, 0x87, 0x10, 1); - config_phydm_write_rf_reg_8814b(dm, RF_PATH_B, 0x87, 0x10, 1); - config_phydm_write_rf_reg_8814b(dm, RF_PATH_C, 0x87, 0x10, 1); - config_phydm_write_rf_reg_8814b(dm, RF_PATH_D, 0x87, 0x10, 1); -#endif } else #endif { @@ -326,20 +314,6 @@ void phydm_lna_sat_chk( 0xe0000); } else if (dm->support_ic_type & ODM_RTL8814B) { /*@read peak detector info from 8814B rf reg*/ -#if 0 - sat_status_a = config_phydm_read_rf_reg_8814b(dm, RF_PATH_A, - RF_0xae, - 0xc0000); - sat_status_b = config_phydm_read_rf_reg_8814b(dm, RF_PATH_B, - RF_0xae, - 0xc0000); - sat_status_c = config_phydm_read_rf_reg_8814b(dm, RF_PATH_C, - RF_0xae, - 0xc0000); - sat_status_d = config_phydm_read_rf_reg_8814b(dm, RF_PATH_D, - RF_0xae, - 0xc0000); -#endif } else #endif { @@ -625,10 +599,6 @@ void phydm_snr_collect( struct phydm_lna_sat_t *pinfo = &dm->dm_lna_sat_info; if (pinfo->is_sm_done) { -#if 0 - /*PHYDM_DBG(dm, DBG_LNA_SAT_CHK, "%s ==>\n", __func__);*/ -#endif - /* @adapt only path-A for calculation */ pinfo->snr_statistic[pinfo->cnt_snr_statistic] = rx_snr; @@ -743,37 +713,10 @@ boolean phydm_is_snr_improve( return true; } } -#if 0 - /*special case, mean degrade less than VAR improvement*/ - /*@make sure pre_var is larger enough*/ - if (cur_state == ORI_TABLE_MONITOR && - cur_mean < pre_mean && - cur_var < pre_var) { - diff_mean = pre_mean - cur_mean; - diff_var = pre_var - cur_var; - return (diff_var > (2 * diff_mean * diff_mean)) ? true : false; - } - -#endif if (cur_lower_mean >= (pre_lower_mean + pinfo->delta_snr_mean)) is_snr_improve = true; else is_snr_improve = false; -#if 0 -/* @condition refine, mean is bigger enough or VAR is smaller enough*/ -/* @1. from mean's view, mean improve delta_snr_mean(2), VAR not degrade lot*/ - if (cur_mean > (pre_mean + pinfo->delta_snr_mean)) { - is_mean_improve = TRUE; - is_var_improve = (cur_var <= pre_var + dm->delta_snr_var) - ? TRUE : FALSE; - - } else if (cur_var + dm->delta_snr_var <= pre_var) { - is_var_improve = TRUE; - is_mean_improve = ((cur_mean + 1) >= pre_mean) ? TRUE : FALSE; - } else { - return false; - } -#endif return is_snr_improve; } @@ -790,19 +733,6 @@ boolean phydm_is_snr_degrade( is_degrade = TRUE; else is_degrade = FALSE; -#if 0 - is_mean_dgrade = (pinfo->cur_snr_mean + pinfo->delta_snr_mean <= pinfo->pre_snr_mean) ? TRUE : FALSE; - is_var_degrade = (pinfo->cur_snr_var > (pinfo->pre_snr_var + pinfo->delta_snr_mean)) ? TRUE : FALSE; - - PHYDM_DBG(dm, DBG_LNA_SAT_CHK, "%s: cur_mean=%d, pre_mean=%d, cur_var=%d, pre_var=%d\n", - __func__, - pinfo->cur_snr_mean, - pinfo->pre_snr_mean, - pinfo->cur_snr_var, - pinfo->pre_snr_var); - - return (is_mean_dgrade & is_var_degrade); -#endif return is_degrade; } @@ -851,15 +781,6 @@ void phydm_sat_table_training( struct dm_struct *dm = (struct dm_struct *)dm_void; struct phydm_lna_sat_t *pinfo = &dm->dm_lna_sat_info; - #if 0 - if pre_state = ORI_TABLE_MONITOR || SAT_TABLE_TRY_FAIL, - /*@"pre" adapt ori-table, "cur" adapt sat-table*/ - /*@adapt ori table*/ - if (pinfo->pre_state == ORI_TABLE_MONITOR) { - pinfo->nxt_state = SAT_TABLE_TRAINING; - config_phydm_switch_agc_tab_8822b(dm, *dm->channel, LNA_SAT_AGC_TABLE); - } else { - #endif if (phydm_is_snr_improve(dm)) { pinfo->nxt_state = SAT_TABLE_MONITOR; } else { @@ -988,20 +909,6 @@ void phydm_ori_table_try_fail( //config_phydm_switch_agc_tab_8822b(dm, *dm->channel, LNA_SAT_AGC_TABLE); } -#if 0 - if (phydm_is_large_var(dm)) { - if (phydm_is_snr_degrade(dm)) { - pinfo->nxt_state = SAT_TABLE_TRAINING; - config_phydm_switch_agc_tab_8822b(dm, *dm->channel, LNA_SAT_AGC_TABLE); - } else { - pinfo->nxt_state = SAT_TABLE_TRY_FAIL; - } - } else { - pinfo->nxt_state = ORI_TABLE_MONITOR; - } - - phydm_update_pre_status(dm); -#endif pinfo->pre_state = ORI_TABLE_TRY_FAIL; } diff --git a/hal/phydm/phydm_mp.c b/hal/phydm/phydm_mp.c index 7d964f5d..4f6516d7 100644 --- a/hal/phydm/phydm_mp.c +++ b/hal/phydm/phydm_mp.c @@ -97,16 +97,6 @@ void phydm_mp_set_single_tone_jgr3(void *dm_void, boolean is_single_tone, } if (is_single_tone) { mp->rf_reg0 = odm_get_rf_reg(dm, RF_PATH_A, RF_0x00, 0xfffff); -#if 0 - mp->rfe_sel_a_0 = odm_get_bb_reg(dm, R_0x1840, MASKDWORD); - mp->rfe_sel_b_0 = odm_get_bb_reg(dm, R_0x4140, MASKDWORD); - mp->rfe_sel_c_0 = odm_get_bb_reg(dm, R_0x5240, MASKDWORD); - mp->rfe_sel_d_0 = odm_get_bb_reg(dm, R_0x5340, MASKDWORD); - mp->rfe_sel_a_1 = odm_get_bb_reg(dm, R_0x1844, MASKDWORD); - mp->rfe_sel_b_1 = odm_get_bb_reg(dm, R_0x4144, MASKDWORD); - mp->rfe_sel_c_1 = odm_get_bb_reg(dm, R_0x5244, MASKDWORD); - mp->rfe_sel_d_1 = odm_get_bb_reg(dm, R_0x5344, MASKDWORD); -#endif /* Disable CCK and OFDM */ odm_set_bb_reg(dm, R_0x1c3c, 0x3, 0x0); for (start; start <= end; start++) { @@ -142,16 +132,6 @@ void phydm_mp_set_single_tone_jgr3(void *dm_void, boolean is_single_tone, 0x0); } } -#if 0 - odm_set_bb_reg(dm, R_0x1840, MASKDWORD, mp->rfe_sel_a_0); - odm_set_bb_reg(dm, R_0x4140, MASKDWORD, mp->rfe_sel_b_0); - odm_set_bb_reg(dm, R_0x5240, MASKDWORD, mp->rfe_sel_c_0); - odm_set_bb_reg(dm, R_0x5340, MASKDWORD, mp->rfe_sel_d_0); - odm_set_bb_reg(dm, R_0x1844, MASKDWORD, mp->rfe_sel_a_1); - odm_set_bb_reg(dm, R_0x4144, MASKDWORD, mp->rfe_sel_b_1); - odm_set_bb_reg(dm, R_0x5244, MASKDWORD, mp->rfe_sel_c_1); - odm_set_bb_reg(dm, R_0x5344, MASKDWORD, mp->rfe_sel_d_1); -#endif } } diff --git a/hal/phydm/phydm_noisemonitor.c b/hal/phydm/phydm_noisemonitor.c index aeeb2556..704a4f8e 100644 --- a/hal/phydm/phydm_noisemonitor.c +++ b/hal/phydm/phydm_noisemonitor.c @@ -407,30 +407,6 @@ void phydm_noisy_detection(void *dm_void) total_cca_cnt = dm->false_alm_cnt.cnt_cca_all; total_fa_cnt = dm->false_alm_cnt.cnt_all; -#if 0 - if (total_fa_cnt * 16 >= total_cca_cnt * 14) /* @87.5 */ - ; - else if (total_fa_cnt * 16 >= total_cca_cnt * 12) /* @75 */ - ; - else if (total_fa_cnt * 16 >= total_cca_cnt * 10) /* @56.25 */ - ; - else if (total_fa_cnt * 16 >= total_cca_cnt * 8) /* @50 */ - ; - else if (total_fa_cnt * 16 >= total_cca_cnt * 7) /* @43.75 */ - ; - else if (total_fa_cnt * 16 >= total_cca_cnt * 6) /* @37.5 */ - ; - else if (total_fa_cnt * 16 >= total_cca_cnt * 5) /* @31.25% */ - ; - else if (total_fa_cnt * 16 >= total_cca_cnt * 4) /* @25% */ - ; - else if (total_fa_cnt * 16 >= total_cca_cnt * 3) /* @18.75% */ - ; - else if (total_fa_cnt * 16 >= total_cca_cnt * 2) /* @12.5% */ - ; - else if (total_fa_cnt * 16 >= total_cca_cnt * 1) /* @6.25% */ - ; -#endif for (i = 0; i <= 16; i++) { if (total_fa_cnt * 16 >= total_cca_cnt * (16 - i)) { score = 16 - i; diff --git a/hal/phydm/phydm_pathdiv.c b/hal/phydm/phydm_pathdiv.c index b3c46d29..e789403e 100644 --- a/hal/phydm/phydm_pathdiv.c +++ b/hal/phydm/phydm_pathdiv.c @@ -411,15 +411,6 @@ void phydm_dynamic_tx_path( p_div->dtp_check_patha_counter = 0; p_div->phydm_dtp_state = PHYDM_DTP_INIT; } -#if 0 - /* @2 Search space update */ - else { - /* @1. find the worst candidate */ - - - /* @2. repalce the worst candidate */ - } -#endif } } diff --git a/hal/phydm/phydm_phystatus.c b/hal/phydm/phydm_phystatus.c index 856354c9..3c1d65af 100644 --- a/hal/phydm/phydm_phystatus.c +++ b/hal/phydm/phydm_phystatus.c @@ -375,72 +375,6 @@ u8 phydm_pwr_2_percent(s8 ant_power) #if (DM_ODM_SUPPORT_TYPE & ODM_WIN) -#if 0 /*(DM_ODM_SUPPORT_TYPE == ODM_CE)*/ -s32 phydm_signal_scale_mapping_92c_series(struct dm_struct *dm, s32 curr_sig) -{ - s32 ret_sig = 0; - -#if (DEV_BUS_TYPE == RT_PCI_INTERFACE) - if (dm->support_interface == ODM_ITRF_PCIE) { - /* step 1. Scale mapping. */ - if (curr_sig >= 61 && curr_sig <= 100) - ret_sig = 90 + ((curr_sig - 60) / 4); - else if (curr_sig >= 41 && curr_sig <= 60) - ret_sig = 78 + ((curr_sig - 40) / 2); - else if (curr_sig >= 31 && curr_sig <= 40) - ret_sig = 66 + (curr_sig - 30); - else if (curr_sig >= 21 && curr_sig <= 30) - ret_sig = 54 + (curr_sig - 20); - else if (curr_sig >= 5 && curr_sig <= 20) - ret_sig = 42 + (((curr_sig - 5) * 2) / 3); - else if (curr_sig == 4) - ret_sig = 36; - else if (curr_sig == 3) - ret_sig = 27; - else if (curr_sig == 2) - ret_sig = 18; - else if (curr_sig == 1) - ret_sig = 9; - else - ret_sig = curr_sig; - } -#endif - -#if ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) - if (dm->support_interface == ODM_ITRF_USB || - dm->support_interface == ODM_ITRF_SDIO) { - if (curr_sig >= 51 && curr_sig <= 100) - ret_sig = 100; - else if (curr_sig >= 41 && curr_sig <= 50) - ret_sig = 80 + ((curr_sig - 40) * 2); - else if (curr_sig >= 31 && curr_sig <= 40) - ret_sig = 66 + (curr_sig - 30); - else if (curr_sig >= 21 && curr_sig <= 30) - ret_sig = 54 + (curr_sig - 20); - else if (curr_sig >= 10 && curr_sig <= 20) - ret_sig = 42 + (((curr_sig - 10) * 2) / 3); - else if (curr_sig >= 5 && curr_sig <= 9) - ret_sig = 22 + (((curr_sig - 5) * 3) / 2); - else if (curr_sig >= 1 && curr_sig <= 4) - ret_sig = 6 + (((curr_sig - 1) * 3) / 2); - else - ret_sig = curr_sig; - } - -#endif - return ret_sig; -} - -s32 phydm_signal_scale_mapping(struct dm_struct *dm, s32 curr_sig) -{ -#ifdef CONFIG_SIGNAL_SCALE_MAPPING - return phydm_signal_scale_mapping_92c_series(dm, curr_sig); -#else - return curr_sig; -#endif -} -#endif - void phydm_process_signal_strength(struct dm_struct *dm, struct phydm_phyinfo_struct *phy_info, struct phydm_perpkt_info_struct *pktinfo) @@ -476,56 +410,28 @@ void phydm_process_signal_strength(struct dm_struct *dm, /* Update signal strength to UI, * and phy_info->rx_pwdb_all is the maximum RSSI of all path */ - #if 1 /*(DM_ODM_SUPPORT_TYPE == ODM_WIN)*/ ss = SignalScaleProc(dm->adapter, pwdb, false, false); - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - ss = (u8)phydm_signal_scale_mapping(dm, pwdb); - #elif (DM_ODM_SUPPORT_TYPE == ODM_IOT) - ss = (u8)phydm_signal_scale_mapping(dm, pwdb); - #endif - #endif } else if (dm->support_ic_type & PHYSTS_2ND_TYPE_IC) { #if (ODM_PHY_STATUS_NEW_TYPE_SUPPORT) /* Update signal strength to UI, * and phy_info->rx_pwdb_all is the maximum RSSI of all path */ - #if 1 /*(DM_ODM_SUPPORT_TYPE == ODM_WIN)*/ ss = SignalScaleProc(dm->adapter, pwdb, false, false); - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - ss = (u8)phydm_signal_scale_mapping(dm, pwdb); - #endif - #endif } else if (dm->support_ic_type & ODM_IC_11AC_SERIES) { #if ODM_IC_11AC_SERIES_SUPPORT if (pktinfo->is_cck_rate) - #if 1/*(DM_ODM_SUPPORT_TYPE == ODM_WIN)*/ ss = SignalScaleProc(dm->adapter, pwdb, 0, 1); - #else - ss = (u8)phydm_signal_scale_mapping(dm, pwdb); - #endif else - #if 1 /*(DM_ODM_SUPPORT_TYPE == ODM_WIN)*/ ss = SignalScaleProc(dm->adapter, avg_rssi, 0, 1); - #else - ss = (u8)phydm_signal_scale_mapping(dm, avg_rssi); - #endif #endif } else if (dm->support_ic_type & ODM_IC_11N_SERIES) { #if ODM_IC_11N_SERIES_SUPPORT if (pktinfo->is_cck_rate) - #if 1/*(DM_ODM_SUPPORT_TYPE == ODM_WIN)*/ ss = SignalScaleProc(dm->adapter, pwdb, 1, 1); - #else - ss = (u8)phydm_signal_scale_mapping(dm, pwdb); - #endif else - #if 1 /*(DM_ODM_SUPPORT_TYPE == ODM_WIN)*/ ss = SignalScaleProc(dm->adapter, avg_rssi, 1, 0); - #else - ss = (u8)phydm_signal_scale_mapping(dm, avg_rssi); - #endif #endif } phy_info->signal_strength = ss; @@ -972,9 +878,6 @@ void phydm_phy_sts_n_parsing(struct dm_struct *dm, #endif sq = phydm_get_signal_quality(phy_info, dm, phy_sts); -#if 0 - /* @dbg_print("cck sq = %d\n", sq); */ -#endif phy_info->signal_quality = sq; phy_info->rx_mimo_signal_quality[RF_PATH_A] = sq; phy_info->rx_mimo_signal_quality[RF_PATH_B] = -1; @@ -1139,9 +1042,6 @@ void phydm_get_sq(struct dm_struct *dm, struct phydm_phyinfo_struct *phy_info, } } -#if 0 - /* @dbg_print("cck sq = %d\n", sq); */ -#endif phy_info->signal_quality = sq; } @@ -1569,11 +1469,6 @@ void phydm_process_rssi_for_dm(struct dm_struct *dm, rssi_all, rssi_t->ofdm_pkt_cnt, rssi_t->cck_pkt_cnt); } -#if 0 - /* @dbg_print("ofdm_pkt=%d, weighting=%d\n", ofdm_pkt_cnt, weighting);*/ - /* @dbg_print("rssi_ofdm_tmp=%d, rssi_all=%d, rssi_cck_tmp=%d\n", */ - /* rssi_ofdm_tmp, rssi_all, rssi_cck_tmp); */ -#endif } #endif @@ -1843,15 +1738,6 @@ void phydm_common_phy_info_3rd(s8 rx_power, u8 channel, boolean is_beamformed, phy_info->signal_quality = signal_quality; /* signal quality */ phy_info->band_width = bandwidth; /* @bandwidth */ -#if 0 - /* @if (pktinfo->is_packet_match_bssid) */ - { - dbg_print("rx_pwdb_all = %d, rx_power = %d, recv_signal_power = %d\n", phy_info->rx_pwdb_all, phy_info->rx_power, phy_info->recv_signal_power); - dbg_print("signal_quality = %d\n", phy_info->signal_quality); - dbg_print("is_beamformed = %d, is_mu_packet = %d, rx_count = %d\n", phy_info->is_beamformed, phy_info->is_mu_packet, phy_info->rx_count + 1); - dbg_print("channel = %d, rxsc = %d, band_width = %d\n", channel, rxsc, bandwidth); - } -#endif } void phydm_get_physts_jarguar3_0(struct dm_struct *dm, u8 *phy_status_inf, @@ -2486,10 +2372,6 @@ void phydm_print_phy_sts_jgr2(struct dm_struct *dm, u8 *phy_status_inf, } dbg->show_phy_sts_cnt++; - #if 0 - dbg_print("cnt=%d, max=%d\n", - dbg->show_phy_sts_cnt, dbg->show_phy_sts_max_cnt); - #endif if (dbg->show_phy_sts_max_cnt != SHOW_PHY_STATUS_UNLIMITED) { if (dbg->show_phy_sts_cnt > dbg->show_phy_sts_max_cnt) @@ -2608,21 +2490,6 @@ void phydm_set_per_path_phy_info(u8 rx_path, s8 pwr, s8 rx_evm, s8 cfo_tail, phy_info->rx_snr[rx_path] = rx_snr >> 1; phy_info->ant_idx[rx_path] = ant_idx; -#if 0 - if (!pktinfo->is_packet_match_bssid) - return; - - dbg_print("path (%d)--------\n", rx_path); - dbg_print("rx_pwr = %d, Signal strength = %d\n", - phy_info->rx_pwr[rx_path], - phy_info->rx_mimo_signal_strength[rx_path]); - dbg_print("evm_dbm = %d, Signal quality = %d\n", - phy_info->rx_mimo_evm_dbm[rx_path], - phy_info->rx_mimo_signal_quality[rx_path]); - dbg_print("CFO = %d, SNR = %d\n", - phy_info->cfo_tail[rx_path], phy_info->rx_snr[rx_path]); - -#endif } void phydm_set_common_phy_info(s8 rx_power, u8 channel, boolean is_beamformed, @@ -2642,21 +2509,6 @@ void phydm_set_common_phy_info(s8 rx_power, u8 channel, boolean is_beamformed, phy_info->signal_quality = signal_quality; /* signal quality */ phy_info->band_width = bandwidth; /* @bandwidth */ -#if 0 - if (!pktinfo->is_packet_match_bssid) - return; - - dbg_print("rx_pwdb_all = %d, rx_power = %d, recv_signal_power = %d\n", - phy_info->rx_pwdb_all, phy_info->rx_power, - phy_info->recv_signal_power); - dbg_print("signal_quality = %d\n", phy_info->signal_quality); - dbg_print("is_beamformed = %d, is_mu_packet = %d, rx_count = %d\n", - phy_info->is_beamformed, phy_info->is_mu_packet, - phy_info->rx_count + 1); - dbg_print("channel = %d, rxsc = %d, band_width = %d\n", channel, - rxsc, bandwidth); - -#endif } void phydm_get_phy_sts_type0(struct dm_struct *dm, u8 *phy_status_inf, @@ -3025,17 +2877,6 @@ void phydm_process_rssi_for_dm_2nd_type(struct dm_struct *dm, rssi_t->rssi = (s8)GET_MA_VAL(rssi_t->rssi_acc, RSSI_MA); } - #if 0 - PHYDM_DBG(dm, DBG_TMP, "RSSI[%d]{A,B,C,D}={%d, %d, %d, %d} AVG=%d\n", - pktinfo->station_id, - phy_info->rx_mimo_signal_strength[0], - phy_info->rx_mimo_signal_strength[1], - phy_info->rx_mimo_signal_strength[2], - phy_info->rx_mimo_signal_strength[3], rssi_db); - PHYDM_DBG(dm, DBG_TMP, "rssi_acc = %d, rssi=%d\n", - rssi_t->rssi_acc, rssi_t->rssi); - #endif - if (pktinfo->is_cck_rate) rssi_t->rssi_cck = (s8)rssi_db; else diff --git a/hal/phydm/phydm_phystatus.h b/hal/phydm/phydm_phystatus.h index 333fa89b..73c0ec47 100644 --- a/hal/phydm/phydm_phystatus.h +++ b/hal/phydm/phydm_phystatus.h @@ -732,18 +732,7 @@ __PACK struct phy_sts_rpt_jgr3_type1 { u8 paid_msb : 1; #endif u16 rsvd_4; -#if 0 - /*@ - u8 rsvd_4; -#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE) - u8 rsvd_5: 6; - u8 rf_mode: 2; -#else - u8 rf_mode: 2; - u8 rsvd_5: 6; -#endif -*/ -#endif + /* @DW4 : Offset 16 */ s8 rxevm[4]; /* s(8,1) */ diff --git a/hal/phydm/phydm_pmac_tx_setting.c b/hal/phydm/phydm_pmac_tx_setting.c index 882283c7..cf3bde1f 100644 --- a/hal/phydm/phydm_pmac_tx_setting.c +++ b/hal/phydm/phydm_pmac_tx_setting.c @@ -310,18 +310,7 @@ void phydm_set_sig_jgr3(void *dm_void, struct phydm_pmac_info *tx_info) tmp = BYTE_2_DWORD(0, tx_info->lsig[2], tx_info->lsig[1], tx_info->lsig[0]); odm_set_bb_reg(dm, R_0x908, 0xffffff, tmp); -#if 0 - /* @0x924[7:0] = Data init octet */ - tmp = tx_info->packet_pattern; - odm_set_bb_reg(dm, R_0x924, 0xff, tmp); - if (tx_info->packet_pattern == RANDOM_BY_PN32) - tmp = 0x3; - else - tmp = 0x0; - - odm_set_bb_reg(dm, R_0x914, 0x60000000, tmp); -#endif if (pmac_tx->is_ht_rate) { /* @HT SIG */ tmp = BYTE_2_DWORD(0, tx_info->ht_sig[2], tx_info->ht_sig[1], diff --git a/hal/phydm/phydm_pow_train.c b/hal/phydm/phydm_pow_train.c index 56bc2411..464369d8 100644 --- a/hal/phydm/phydm_pow_train.c +++ b/hal/phydm/phydm_pow_train.c @@ -78,23 +78,7 @@ void phydm_update_power_training_state(void *dm_void) crc_ok_cnt = dm->phy_dbg_info.num_qry_phy_status_ofdm + dm->phy_dbg_info.num_qry_phy_status_cck; cca_cnt = fa_cnt->cnt_cca_all; -#if 0 - if (crc_ok_cnt > cca_cnt) { /*invalid situation*/ - pt_score_tmp = KEEP_PRE_PT_SCORE; - return; - } else if ((crc_ok_cnt + (crc_ok_cnt >> 1)) <= cca_cnt) { - /* @???crc_ok <= (2/3)*cca */ - pt_score_tmp = DISABLE_PT_SCORE; - dm->is_disable_power_training = true; - } else if ((crc_ok_cnt + (crc_ok_cnt >> 2)) <= cca_cnt) { - /* @???crc_ok <= (4/5)*cca */ - pt_score_tmp = KEEP_PRE_PT_SCORE; - } else { - /* @???crc_ok > (4/5)*cca */ - pt_score_tmp = ENABLE_PT_SCORE; - dm->is_disable_power_training = false; - } -#endif + if (ccx->nhm_ratio > 10) { pt_score_tmp = DISABLE_PT_SCORE; dm->is_disable_power_training = true; diff --git a/hal/phydm/phydm_precomp.h b/hal/phydm/phydm_precomp.h index 23cf50e6..e65fdc9b 100644 --- a/hal/phydm/phydm_precomp.h +++ b/hal/phydm/phydm_precomp.h @@ -438,14 +438,6 @@ rtw_phydm_cfg_phy_para( #include "rtl8721d/phydm_rtl8721d.h" #include "rtl8721d/hal8721dreg.h" #include - #if 0 - #if (DM_ODM_SUPPORT_TYPE == ODM_AP) - #include "halrf/rtl8721d/halrf_dpk_8721d.h" - #endif - #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8721d_hal.h" - #endif - #endif #endif #if (RTL8195B_SUPPORT == 1) #include "halrf/rtl8195b/halrf_8195b.h" diff --git a/hal/phydm/phydm_psd.c b/hal/phydm/phydm_psd.c index 458677b5..7bf407d3 100644 --- a/hal/phydm/phydm_psd.c +++ b/hal/phydm/phydm_psd.c @@ -334,10 +334,6 @@ void phydm_psd_para_setting(void *dm_void, u8 sw_avg_time, u8 hw_avg_time, odm_set_bb_reg(dm, 0x808, BIT(23) | BIT(22), fft_smp_point_idx); odm_set_bb_reg(dm, 0x804, BIT(5) | BIT(4), ant_sel); odm_set_bb_reg(dm, 0x80C, BIT(23), psd_input); - -#if 0 - } else { /*ODM_IC_11N_SERIES*/ -#endif } /*@bw = (*dm->band_width); //ODM_BW20M */ /*@channel = *(dm->channel);*/ @@ -377,9 +373,6 @@ void phydm_psd_init(void *dm_void) dm_psd_table->psd_pwr_common_offset = 0; phydm_psd_para_setting(dm, 1, 2, 3, 128, 0, 0, 7, 0); -#if 0 - /*phydm_psd(dm, 0x3c, 0, 127);*/ /* target at -50dBm */ -#endif } void phydm_psd_debug(void *dm_void, char input[][16], u32 *_used, diff --git a/hal/phydm/phydm_rainfo.c b/hal/phydm/phydm_rainfo.c index 077585df..529c75f7 100644 --- a/hal/phydm/phydm_rainfo.c +++ b/hal/phydm/phydm_rainfo.c @@ -348,9 +348,6 @@ void phydm_ra_dynamic_retry_count(void *dm_void) if (!(dm->support_ability & ODM_BB_DYNAMIC_ARFR)) return; -#if 0 - /*PHYDM_DBG(dm, DBG_RA, "dm->pre_b_noisy = %d\n", dm->pre_b_noisy );*/ -#endif if (dm->pre_b_noisy != dm->noisy_decision) { if (dm->noisy_decision) { PHYDM_DBG(dm, DBG_DYN_ARFR, "Noisy Env. RA fallback\n"); @@ -474,22 +471,6 @@ void phydm_c2h_ra_report_handler(void *dm_void, u8 *cmd_buf, u8 cmd_len) #endif -#if 0 - /*trigger dynamic rate ID*/ - if (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8192E)) - phydm_update_rate_id(dm, rate, macid); -#endif -} - -void odm_ra_post_action_on_assoc(void *dm_void) -{ -#if 0 - struct dm_struct *dm = (struct dm_struct *)dm_void; - - dm->h2c_rarpt_connect = 1; - phydm_rssi_monitor_check(dm); - dm->h2c_rarpt_connect = 0; -#endif } void phydm_modify_RA_PCR_threshold(void *dm_void, u8 ra_ofst_direc, @@ -546,9 +527,6 @@ void phydm_update_hal_ra_mask( u32 ratr_bitmap = *ratr_bitmap_lsb_in; u32 ratr_bitmap_msb = *ratr_bitmap_msb_in; -#if 0 - /*PHYDM_DBG(dm, DBG_RA_MASK, "phydm_rf_type = (( %x )), rf_type = (( %x ))\n", phydm_rf_type, rf_type);*/ -#endif PHYDM_DBG(dm, DBG_RA_MASK, "Platfoem original RA Mask = (( 0x %x | %x ))\n", ratr_bitmap_msb, ratr_bitmap); @@ -648,10 +626,6 @@ void phydm_update_hal_ra_mask( "wireless_mode= (( 0x%x )), rf_type = (( 0x%x )), BW = (( 0x%x )), MimoPs_en = (( %d )), tx_rate_level= (( 0x%x ))\n", wireless_mode, rf_type, bw, mimo_ps_enable, tx_rate_level); -#if 0 - /*PHYDM_DBG(dm, DBG_RA_MASK, "111 Phydm modified RA Mask = (( 0x %x | %x ))\n", ratr_bitmap_msb, ratr_bitmap);*/ -#endif - *ratr_bitmap_lsb_in = ratr_bitmap; *ratr_bitmap_msb_in = ratr_bitmap_msb; PHYDM_DBG(dm, DBG_RA_MASK, @@ -683,14 +657,6 @@ void phydm_rate_adaptive_mask_init(void *dm_void) ra_t->up_ramask_cnt_tmp = 0; } -void phydm_refresh_rate_adaptive_mask(void *dm_void) -{ -/*@Will be removed*/ - struct dm_struct *dm = (struct dm_struct *)dm_void; - - phydm_ra_mask_watchdog(dm); -} - void phydm_show_sta_info(void *dm_void, char input[][16], u32 *_used, char *output, u32 *_out_len) { @@ -1707,132 +1673,9 @@ void phydm_ra_info_init(void *dm_void) odm_set_bb_reg(dm, R_0x4cc, MASKBYTE3, (ret_value - 1)); } #endif - - #if 0 /*@CONFIG_RA_DYNAMIC_RTY_LIMIT*/ - phydm_ra_dynamic_retry_limit_init(dm); - #endif - - #if 0 /*@CONFIG_RA_DYNAMIC_RATE_ID*/ - phydm_ra_dynamic_rate_id_init(dm); - #endif - phydm_rate_adaptive_mask_init(dm); } -u8 odm_find_rts_rate(void *dm_void, u8 tx_rate, boolean is_erp_protect) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - u8 rts_ini_rate = ODM_RATE6M; - - if (is_erp_protect) { /* use CCK rate as RTS*/ - rts_ini_rate = ODM_RATE1M; - } else { - switch (tx_rate) { - case ODM_RATEVHTSS4MCS9: - case ODM_RATEVHTSS4MCS8: - case ODM_RATEVHTSS4MCS7: - case ODM_RATEVHTSS4MCS6: - case ODM_RATEVHTSS4MCS5: - case ODM_RATEVHTSS4MCS4: - case ODM_RATEVHTSS4MCS3: - case ODM_RATEVHTSS3MCS9: - case ODM_RATEVHTSS3MCS8: - case ODM_RATEVHTSS3MCS7: - case ODM_RATEVHTSS3MCS6: - case ODM_RATEVHTSS3MCS5: - case ODM_RATEVHTSS3MCS4: - case ODM_RATEVHTSS3MCS3: - case ODM_RATEVHTSS2MCS9: - case ODM_RATEVHTSS2MCS8: - case ODM_RATEVHTSS2MCS7: - case ODM_RATEVHTSS2MCS6: - case ODM_RATEVHTSS2MCS5: - case ODM_RATEVHTSS2MCS4: - case ODM_RATEVHTSS2MCS3: - case ODM_RATEVHTSS1MCS9: - case ODM_RATEVHTSS1MCS8: - case ODM_RATEVHTSS1MCS7: - case ODM_RATEVHTSS1MCS6: - case ODM_RATEVHTSS1MCS5: - case ODM_RATEVHTSS1MCS4: - case ODM_RATEVHTSS1MCS3: - case ODM_RATEMCS31: - case ODM_RATEMCS30: - case ODM_RATEMCS29: - case ODM_RATEMCS28: - case ODM_RATEMCS27: - case ODM_RATEMCS23: - case ODM_RATEMCS22: - case ODM_RATEMCS21: - case ODM_RATEMCS20: - case ODM_RATEMCS19: - case ODM_RATEMCS15: - case ODM_RATEMCS14: - case ODM_RATEMCS13: - case ODM_RATEMCS12: - case ODM_RATEMCS11: - case ODM_RATEMCS7: - case ODM_RATEMCS6: - case ODM_RATEMCS5: - case ODM_RATEMCS4: - case ODM_RATEMCS3: - case ODM_RATE54M: - case ODM_RATE48M: - case ODM_RATE36M: - case ODM_RATE24M: - rts_ini_rate = ODM_RATE24M; - break; - case ODM_RATEVHTSS4MCS2: - case ODM_RATEVHTSS4MCS1: - case ODM_RATEVHTSS3MCS2: - case ODM_RATEVHTSS3MCS1: - case ODM_RATEVHTSS2MCS2: - case ODM_RATEVHTSS2MCS1: - case ODM_RATEVHTSS1MCS2: - case ODM_RATEVHTSS1MCS1: - case ODM_RATEMCS26: - case ODM_RATEMCS25: - case ODM_RATEMCS18: - case ODM_RATEMCS17: - case ODM_RATEMCS10: - case ODM_RATEMCS9: - case ODM_RATEMCS2: - case ODM_RATEMCS1: - case ODM_RATE18M: - case ODM_RATE12M: - rts_ini_rate = ODM_RATE12M; - break; - case ODM_RATEVHTSS4MCS0: - case ODM_RATEVHTSS3MCS0: - case ODM_RATEVHTSS2MCS0: - case ODM_RATEVHTSS1MCS0: - case ODM_RATEMCS24: - case ODM_RATEMCS16: - case ODM_RATEMCS8: - case ODM_RATEMCS0: - case ODM_RATE9M: - case ODM_RATE6M: - rts_ini_rate = ODM_RATE6M; - break; - case ODM_RATE11M: - case ODM_RATE5_5M: - case ODM_RATE2M: - case ODM_RATE1M: - rts_ini_rate = ODM_RATE1M; - break; - default: - rts_ini_rate = ODM_RATE6M; - break; - } - } - - if (*dm->band_type == ODM_BAND_5G) { - if (rts_ini_rate < ODM_RATE6M) - rts_ini_rate = ODM_RATE6M; - } - return rts_ini_rate; -} - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) void odm_refresh_basic_rate_mask( @@ -1870,216 +1713,4 @@ void odm_refresh_basic_rate_mask( stage = cur_stage; } -#endif - -#if 0 /*@CONFIG_RA_DYNAMIC_RTY_LIMIT*/ - -void phydm_retry_limit_table_bound( - void *dm_void, - u8 *retry_limit, - u8 offset) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - struct ra_table *ra_tab = &dm->dm_ra_table; - - if (*retry_limit > offset) { - *retry_limit -= offset; - - if (*retry_limit < ra_tab->retrylimit_low) - *retry_limit = ra_tab->retrylimit_low; - else if (*retry_limit > ra_tab->retrylimit_high) - *retry_limit = ra_tab->retrylimit_high; - } else - *retry_limit = ra_tab->retrylimit_low; -} - -void phydm_reset_retry_limit_table( - void *dm_void) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - struct ra_table *ra_t = &dm->dm_ra_table; - u8 i; - - u8 per_rate_retrylimit_table_20M[ODM_RATEMCS15 + 1] = { - 1, 1, 2, 4, /*@CCK*/ - 2, 2, 4, 6, 8, 12, 16, 18, /*OFDM*/ - 2, 4, 6, 8, 12, 18, 20, 22, /*@20M HT-1SS*/ - 2, 4, 6, 8, 12, 18, 20, 22 /*@20M HT-2SS*/ - }; - u8 per_rate_retrylimit_table_40M[ODM_RATEMCS15 + 1] = { - 1, 1, 2, 4, /*@CCK*/ - 2, 2, 4, 6, 8, 12, 16, 18, /*OFDM*/ - 4, 8, 12, 16, 24, 32, 32, 32, /*@40M HT-1SS*/ - 4, 8, 12, 16, 24, 32, 32, 32 /*@40M HT-2SS*/ - }; - - memcpy(&ra_t->per_rate_retrylimit_20M[0], - &per_rate_retrylimit_table_20M[0], ODM_NUM_RATE_IDX); - memcpy(&ra_t->per_rate_retrylimit_40M[0], - &per_rate_retrylimit_table_40M[0], ODM_NUM_RATE_IDX); - - for (i = 0; i < ODM_NUM_RATE_IDX; i++) { - phydm_retry_limit_table_bound(dm, - &ra_t->per_rate_retrylimit_20M[i], - 0); - phydm_retry_limit_table_bound(dm, - &ra_t->per_rate_retrylimit_40M[i], - 0); - } -} - -void phydm_ra_dynamic_retry_limit_init( - void *dm_void) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - struct ra_table *ra_tab = &dm->dm_ra_table; - - ra_tab->retry_descend_num = RA_RETRY_DESCEND_NUM; - ra_tab->retrylimit_low = RA_RETRY_LIMIT_LOW; - ra_tab->retrylimit_high = RA_RETRY_LIMIT_HIGH; - - phydm_reset_retry_limit_table(dm); -} - -void phydm_ra_dynamic_retry_limit( - void *dm_void) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - struct ra_table *ra_tab = &dm->dm_ra_table; - u8 i, retry_offset; - u32 ma_rx_tp; - - if (dm->pre_number_active_client == dm->number_active_client) { - PHYDM_DBG(dm, DBG_RA, - "pre_number_active_client == number_active_client\n"); - return; - - } else { - if (dm->number_active_client == 1) { - phydm_reset_retry_limit_table(dm); - PHYDM_DBG(dm, DBG_RA, - "one client only->reset to default value\n"); - } else { - retry_offset = dm->number_active_client * ra_tab->retry_descend_num; - - for (i = 0; i < ODM_NUM_RATE_IDX; i++) { - phydm_retry_limit_table_bound(dm, - &ra_tab->per_rate_retrylimit_20M[i], - retry_offset); - phydm_retry_limit_table_bound(dm, - &ra_tab->per_rate_retrylimit_40M[i], - retry_offset); - } - } - } -} -#endif - -#if 0 /*@CONFIG_RA_DYNAMIC_RATE_ID*/ -void phydm_ra_dynamic_rate_id_on_assoc( - void *dm_void, - u8 wireless_mode, - u8 init_rate_id) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - - PHYDM_DBG(dm, DBG_RA, - "[ON ASSOC] rf_mode = ((0x%x)), wireless_mode = ((0x%x)), init_rate_id = ((0x%x))\n", - dm->rf_type, wireless_mode, init_rate_id); - - if (dm->rf_type == RF_2T2R || dm->rf_type == RF_2T3R || dm->rf_type == RF_2T4R) { - if ((dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8192E)) && - (wireless_mode & (ODM_WM_N24G | ODM_WM_N5G))) { - PHYDM_DBG(dm, DBG_RA, - "[ON ASSOC] set N-2SS ARFR5 table\n"); - odm_set_mac_reg(dm, R_0x4a4, MASKDWORD, 0xfc1ffff); /*N-2SS, ARFR5, rate_id = 0xe*/ - odm_set_mac_reg(dm, R_0x4a8, MASKDWORD, 0x0); /*N-2SS, ARFR5, rate_id = 0xe*/ - } else if ((dm->support_ic_type & (ODM_RTL8812)) && - (wireless_mode & (ODM_WM_AC_5G | ODM_WM_AC_24G | ODM_WM_AC_ONLY))) { - PHYDM_DBG(dm, DBG_RA, - "[ON ASSOC] set AC-2SS ARFR0 table\n"); - odm_set_mac_reg(dm, R_0x444, MASKDWORD, 0x0fff); /*@AC-2SS, ARFR0, rate_id = 0x9*/ - odm_set_mac_reg(dm, R_0x448, MASKDWORD, 0xff01f000); /*@AC-2SS, ARFR0, rate_id = 0x9*/ - } - } -} - -void phydm_ra_dynamic_rate_id_init( - void *dm_void) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - - if (dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8192E)) { - odm_set_mac_reg(dm, R_0x4a4, MASKDWORD, 0xfc1ffff); /*N-2SS, ARFR5, rate_id = 0xe*/ - odm_set_mac_reg(dm, R_0x4a8, MASKDWORD, 0x0); /*N-2SS, ARFR5, rate_id = 0xe*/ - - odm_set_mac_reg(dm, R_0x444, MASKDWORD, 0x0fff); /*@AC-2SS, ARFR0, rate_id = 0x9*/ - odm_set_mac_reg(dm, R_0x448, MASKDWORD, 0xff01f000); /*@AC-2SS, ARFR0, rate_id = 0x9*/ - } -} - -void phydm_update_rate_id( - void *dm_void, - u8 rate, - u8 platform_macid) -{ -#if 0 - - struct dm_struct *dm = (struct dm_struct *)dm_void; - struct ra_table *ra_tab = &dm->dm_ra_table; - u8 current_tx_ss; - u8 rate_idx = rate & 0x7f; /*remove bit7 SGI*/ - enum wireless_set wireless_set; - u8 phydm_macid; - struct cmn_sta_info *sta; - -#if 0 - if (rate_idx >= ODM_RATEVHTSS2MCS0) { - PHYDM_DBG(dm, DBG_RA, "rate[%d]: (( VHT2SS-MCS%d ))\n", - platform_macid, (rate_idx - ODM_RATEVHTSS2MCS0)); - /*@dummy for SD4 check patch*/ - } else if (rate_idx >= ODM_RATEVHTSS1MCS0) { - PHYDM_DBG(dm, DBG_RA, "rate[%d]: (( VHT1SS-MCS%d ))\n", - platform_macid, (rate_idx - ODM_RATEVHTSS1MCS0)); - /*@dummy for SD4 check patch*/ - } else if (rate_idx >= ODM_RATEMCS0) { - PHYDM_DBG(dm, DBG_RA, "rate[%d]: (( HT-MCS%d ))\n", - platform_macid, (rate_idx - ODM_RATEMCS0)); - /*@dummy for SD4 check patch*/ - } else { - PHYDM_DBG(dm, DBG_RA, "rate[%d]: (( HT-MCS%d ))\n", - platform_macid, rate_idx); - /*@dummy for SD4 check patch*/ - } -#endif - - phydm_macid = dm->phydm_macid_table[platform_macid]; - sta = dm->phydm_sta_info[phydm_macid]; - - if (is_sta_active(sta)) { - wireless_set = sta->support_wireless_set; - - if (dm->rf_type == RF_2T2R || dm->rf_type == RF_2T3R || dm->rf_type == RF_2T4R) { - if (wireless_set & WIRELESS_HT) { /*N mode*/ - if (rate_idx >= ODM_RATEMCS8 && rate_idx <= ODM_RATEMCS15) { /*@2SS mode*/ - - sta->ra_info.rate_id = ARFR_5_RATE_ID; - PHYDM_DBG(dm, DBG_RA, "ARFR_5\n"); - } - } else if (wireless_set & WIRELESS_VHT) {/*@AC mode*/ - if (rate_idx >= ODM_RATEVHTSS2MCS0 && rate_idx <= ODM_RATEVHTSS2MCS9) {/*@2SS mode*/ - - sta->ra_info.rate_id = ARFR_0_RATE_ID; - PHYDM_DBG(dm, DBG_RA, "ARFR_0\n"); - } - } else - sta->ra_info.rate_id = ARFR_0_RATE_ID; - - PHYDM_DBG(dm, DBG_RA, "UPdate_RateID[%d]: (( 0x%x ))\n", - platform_macid, sta->ra_info.rate_id); - } - } -#endif -} - -#endif +#endif \ No newline at end of file diff --git a/hal/phydm/phydm_rainfo.h b/hal/phydm/phydm_rainfo.h index a840880a..e9c1fb9e 100644 --- a/hal/phydm/phydm_rainfo.h +++ b/hal/phydm/phydm_rainfo.h @@ -141,7 +141,7 @@ struct _odm_ra_info_ { u8 ra_waiting_counter; u8 ra_pending_counter; u8 ra_drop_after_down; -#if 1 /* POWER_TRAINING_ACTIVE == 1 */ /* For compile pass only~! */ + u8 pt_active; /* on or off */ u8 pt_try_state; /* @0 trying state, 1 for decision state */ u8 pt_stage; /* @0~6 */ @@ -151,7 +151,6 @@ struct _odm_ra_info_ { u8 pt_mode_ss; /* @decide whitch rate should do PT */ u8 ra_stage; /* @StageRA, decide how many times RA will be done between PT */ u8 pt_smooth_factor; -#endif #if (DM_ODM_SUPPORT_TYPE == ODM_AP) && ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) u8 rate_down_counter; u8 rate_up_counter; @@ -176,13 +175,6 @@ struct ra_table { u8 ra_ofst_direc; /*RA_offset_direction*/ u8 up_ramask_cnt; /*@force update_ra_mask counter*/ u8 up_ramask_cnt_tmp; /*@Just for debug, should be removed latter*/ -#if 0 /*@CONFIG_RA_DYNAMIC_RTY_LIMIT*/ - u8 per_rate_retrylimit_20M[ODM_NUM_RATE_IDX]; - u8 per_rate_retrylimit_40M[ODM_NUM_RATE_IDX]; - u8 retry_descend_num; - u8 retrylimit_low; - u8 retrylimit_high; -#endif u8 ldpc_thres; /* @if RSSI > ldpc_th => switch from LPDC to BCC */ void (*record_ra_info)(void *dm_void, u8 macid, struct cmn_sta_info *sta, u64 ra_mask); @@ -250,14 +242,8 @@ void phydm_update_hal_ra_mask( u8 phydm_get_plcp(void *dm_void, u16 macid); #endif -void phydm_refresh_rate_adaptive_mask(void *dm_void); - u8 phydm_rssi_lv_dec(void *dm_void, u32 rssi, u8 ratr_state); -void odm_ra_post_action_on_assoc(void *dm); - -u8 odm_find_rts_rate(void *dm_void, u8 tx_rate, boolean is_erp_protect); - void phydm_show_sta_info(void *dm_void, char input[][16], u32 *_used, char *output, u32 *_out_len); diff --git a/hal/phydm/phydm_smt_ant.c b/hal/phydm/phydm_smt_ant.c index 8e805b3c..05fdfe5d 100644 --- a/hal/phydm/phydm_smt_ant.c +++ b/hal/phydm/phydm_smt_ant.c @@ -43,11 +43,6 @@ void phydm_smt_ant_init_98f(void *dm_void) struct dm_struct *dm = (struct dm_struct *)dm_void; u32 val = 0; - #if 0 - odm_set_bb_reg(dm, R_0x1da4, 0x3c, 4); /*6.25*4 = 25ms*/ - odm_set_bb_reg(dm, R_0x1da4, BIT(6), 1); - odm_set_bb_reg(dm, R_0x1da4, BIT(7), 1); - #endif } #endif #endif @@ -72,10 +67,6 @@ void phydm_cumitek_smt_ant_mapping_table_8822b( path_b_4to7_idx = ((table_path_b[7] & 0xf) << 28) | ((table_path_b[6] & 0xf) << 20) | ((table_path_b[5] & 0xf) << 12) | ((table_path_b[4] & 0xf) << 4); -#if 0 - /*PHYDM_DBG(dm, DBG_SMT_ANT, "mapping table{A, B} = {0x%x, 0x%x}\n", path_a_0to3_idx, path_b_0to3_idx);*/ -#endif - /*pathA*/ odm_set_bb_reg(dm, R_0xca4, MASKDWORD, path_a_0to3_idx); /*@ant map 1*/ odm_set_bb_reg(dm, R_0xca8, MASKDWORD, path_a_4to7_idx); /*@ant map 2*/ @@ -127,35 +118,6 @@ void phydm_cumitek_smt_ant_init_8822b( smtant_table->tx_desc_mode = 0; odm_set_mac_reg(dm, R_0x604, BIT(25), (u32)smtant_table->tx_desc_mode); - /*@========= BB RFE setting =================================*/ -#if 0 - /*path A*/ - odm_set_bb_reg(dm, R_0x1990, BIT(3), 0); /*RFE_CTRL_3*/ /*A_0*/ - odm_set_bb_reg(dm, R_0xcbc, BIT(3), 0); /*@inv*/ - odm_set_bb_reg(dm, R_0xcb0, 0xf000, 8); - - odm_set_bb_reg(dm, R_0x1990, BIT(0), 0); /*RFE_CTRL_0*/ /*A_1*/ - odm_set_bb_reg(dm, R_0xcbc, BIT(0), 0); /*@inv*/ - odm_set_bb_reg(dm, R_0xcb0, 0xf, 0x9); - - odm_set_bb_reg(dm, R_0x1990, BIT(8), 0); /*RFE_CTRL_8*/ /*A_2*/ - odm_set_bb_reg(dm, R_0xcbc, BIT(8), 0); /*@inv*/ - odm_set_bb_reg(dm, R_0xcb4, 0xf, 0xa); - - - /*path B*/ - odm_set_bb_reg(dm, R_0x1990, BIT(4), 1); /*RFE_CTRL_4*/ /*B_0*/ - odm_set_bb_reg(dm, R_0xdbc, BIT(4), 0); /*@inv*/ - odm_set_bb_reg(dm, R_0xdb0, 0xf0000, 0xb); - - odm_set_bb_reg(dm, R_0x1990, BIT(11), 1); /*RFE_CTRL_11*/ /*B_1*/ - odm_set_bb_reg(dm, R_0xdbc, BIT(11), 0); /*@inv*/ - odm_set_bb_reg(dm, R_0xdb4, 0xf000, 0xc); - - odm_set_bb_reg(dm, R_0x1990, BIT(9), 1); /*RFE_CTRL_9*/ /*B_2*/ - odm_set_bb_reg(dm, R_0xdbc, BIT(9), 0); /*@inv*/ - odm_set_bb_reg(dm, R_0xdb4, 0xf0, 0xd); -#endif /*@========= BB SmtAnt setting =================================*/ odm_set_mac_reg(dm, R_0x6d8, BIT(22) | BIT(21), 2); /*resp tx by register*/ odm_set_mac_reg(dm, R_0x668, BIT(3), 1); @@ -398,7 +360,6 @@ void phydm_hl_smart_ant_type2_init_8822b( {0xe, 0}, {0xf, 0}}; u8 rfu_codeword_table_init_5g[SUPPORT_BEAM_SET_PATTERN_NUM][MAX_PATH_NUM_8822B] = { -#if 1 {9, 1}, /*@0*/ {9, 9}, {1, 9}, @@ -415,24 +376,6 @@ void phydm_hl_smart_ant_type2_init_8822b( {6, 6}, {2, 6}, {1, 1} -#else - {1, 1}, /*@0*/ - {9, 1}, - {9, 9}, - {1, 9}, - {1, 2}, - {9, 2}, - {9, 6}, - {1, 6}, - {2, 1}, /*@8*/ - {6, 1}, - {6, 9}, - {2, 9}, - {2, 2}, - {6, 2}, - {6, 6}, - {2, 6} -#endif }; PHYDM_DBG(dm, DBG_ANT_DIV, @@ -454,9 +397,7 @@ void phydm_hl_smart_ant_type2_init_8822b( odm_set_mac_reg(dm, R_0x64, (BIT(18) | BIT(17) | BIT(16)), 0); odm_set_mac_reg(dm, R_0x44, BIT(25) | BIT(24), 0); /*@config P_GPIO[3:2] to data port*/ odm_set_mac_reg(dm, R_0x44, BIT(17) | BIT(16), 0x3); /*@enable_output for P_GPIO[3:2]*/ -#if 0 - /*odm_set_mac_reg(dm, R_0x44, BIT(9)|BIT(8), 0);*/ /*P_GPIO[3:2] output value*/ -#endif + odm_set_mac_reg(dm, R_0x40, BIT(1) | BIT(0), 0); /*@GPIO function*/ /*@Hong_lin smart antenna HW setting*/ @@ -547,16 +488,12 @@ void phydm_update_beam_pattern_type2( reg44_ori = odm_get_mac_reg(dm, R_0x44, MASKDWORD); reg44_tmp_p = reg44_ori; -#if 0 - /*PHYDM_DBG(dm, DBG_ANT_DIV, "reg44_ori =0x%x\n", reg44_ori);*/ -#endif /*@devide_num = (sat_tab->rfu_protocol_type == 2) ? 8 : 4;*/ for (i = 0; i <= (codeword_length - 1); i++) { beam_ctrl_signal = (boolean)((codeword & BIT(i)) >> i); - #if 1 if (dm->debug_components & DBG_ANT_DIV) { if (i == (codeword_length - 1)) pr_debug("%d ]\n", beam_ctrl_signal); @@ -567,7 +504,6 @@ void phydm_update_beam_pattern_type2( else pr_debug("%d ", beam_ctrl_signal); } - #endif if (dm->support_ic_type == ODM_RTL8821) { #if (RTL8821A_SUPPORT == 1) @@ -575,9 +511,6 @@ void phydm_update_beam_pattern_type2( reg44_tmp_p |= ((1 << 11) | (beam_ctrl_signal << 10)); reg44_tmp_n = reg44_ori & (~(BIT(11) | BIT(10))); -#if 0 - /*PHYDM_DBG(dm, DBG_ANT_DIV, "reg44_tmp_p =(( 0x%x )), reg44_tmp_n = (( 0x%x ))\n", reg44_tmp_p, reg44_tmp_n);*/ -#endif odm_set_mac_reg(dm, R_0x44, MASKDWORD, reg44_tmp_p); odm_set_mac_reg(dm, R_0x44, MASKDWORD, reg44_tmp_n); #endif @@ -592,18 +525,11 @@ void phydm_update_beam_pattern_type2( odm_set_mac_reg(dm, R_0x44, MASKDWORD, reg44_tmp_p); ODM_delay_us(sat_tab->rfu_protocol_delay_time); -#if 0 - /*PHYDM_DBG(dm, DBG_ANT_DIV, "reg44 =(( 0x%x )), reg44[9:8] = ((%x)), beam_ctrl_signal =((%x))\n", reg44_tmp_p, ((reg44_tmp_p & 0x300)>>8), beam_ctrl_signal);*/ -#endif - } else { reg44_tmp_p = reg44_ori & (~(BIT(9) | BIT(8))); /*@clean bit 9 & 8*/ reg44_tmp_p |= ((1 << 9) | (beam_ctrl_signal << 8)); reg44_tmp_n = reg44_ori & (~(BIT(9) | BIT(8))); -#if 0 - /*PHYDM_DBG(dm, DBG_ANT_DIV, "reg44_tmp_p =(( 0x%x )), reg44_tmp_n = (( 0x%x ))\n", reg44_tmp_p, reg44_tmp_n); */ -#endif odm_set_mac_reg(dm, R_0x44, MASKDWORD, reg44_tmp_p); ODM_delay_us(10); odm_set_mac_reg(dm, R_0x44, MASKDWORD, reg44_tmp_n); @@ -634,9 +560,6 @@ void phydm_update_rx_idle_beam_type2( #if DEV_BUS_TYPE == RT_USB_INTERFACE || DEV_BUS_TYPE == RT_SDIO_INTERFACE if (dm->support_interface == ODM_ITRF_USB || dm->support_interface == ODM_ITRF_SDIO) odm_schedule_work_item(&sat_tab->hl_smart_antenna_workitem); -#if 0 - /*odm_stall_execution(1);*/ -#endif #endif sat_tab->pre_codeword = sat_tab->update_beam_codeword; @@ -744,9 +667,6 @@ void phydm_hl_smt_ant_dbg_type2( #if DEV_BUS_TYPE == RT_USB_INTERFACE || DEV_BUS_TYPE == RT_SDIO_INTERFACE if (dm->support_interface == ODM_ITRF_USB || dm->support_interface == ODM_ITRF_SDIO) odm_schedule_work_item(&sat_tab->hl_smart_antenna_workitem); -#if 0 - /*odm_stall_execution(1);*/ -#endif #endif } else if (sat_tab->fix_beam_pattern_en == 0) PDM_SNPF(out_len, used, output + used, out_len - used, @@ -774,25 +694,6 @@ void phydm_hl_smt_ant_dbg_type2( PDM_SNPF(out_len, used, output + used, out_len - used, "[ SmartAnt ] AUTO per_beam_training_pkt_num\n"); } - } else if (dm_value[0] == 4) { - #if 0 - if (dm_value[1] == 1) { - sat_tab->ant_num = 1; - sat_tab->first_train_ant = MAIN_ANT; - - } else if (dm_value[1] == 2) { - sat_tab->ant_num = 1; - sat_tab->first_train_ant = AUX_ANT; - - } else if (dm_value[1] == 3) { - sat_tab->ant_num = 2; - sat_tab->first_train_ant = MAIN_ANT; - } - - PDM_SNPF((output + used, out_len - used, - "[ SmartAnt ] Set ant Num = (( %d )), first_train_ant = (( %d ))\n", - sat_tab->ant_num, (sat_tab->first_train_ant - 1))); - #endif } else if (dm_value[0] == 5) { /*set beam set table*/ PHYDM_SSCANF(input[4], DCMD_HEX, &dm_value[3]); @@ -838,27 +739,6 @@ void phydm_hl_smt_ant_dbg_type2( } } - } else if (dm_value[0] == 6) { -#if 0 - if (dm_value[1] == 0) { - if (dm_value[2] < SUPPORT_BEAM_SET_PATTERN_NUM) { - sat_tab->rfu_codeword_table_5g[dm_value[2] ][0] = (u8)dm_value[3]; - sat_tab->rfu_codeword_table_5g[dm_value[2] ][1] = (u8)dm_value[4]; - PDM_SNPF((output + used, out_len - used, - "[SmtAnt] Set5G Table[%d] = [A:0x%x, B:0x%x]\n", - dm_value[2], dm_value[3], - dm_value[4])); - } - } else { - for (i = 0; i < sat_tab->total_beam_set_num_5g; i++) { - PDM_SNPF((output + used, out_len - used, - "[SmtAnt] Read 5G Table[%d] = [A:0x%x, B:0x%x]\n", - i, - sat_tab->rfu_codeword_table_5g[i][0], - sat_tab->rfu_codeword_table_5g[i][1])); - } - } -#endif } else if (dm_value[0] == 7) { if (dm_value[1] == 1) { sat_tab->total_beam_set_num_2g = (u8)(dm_value[2]); @@ -915,9 +795,6 @@ void phydm_set_rfu_beam_pattern_type2( #if DEV_BUS_TYPE == RT_USB_INTERFACE || DEV_BUS_TYPE == RT_SDIO_INTERFACE if (dm->support_interface == ODM_ITRF_USB || dm->support_interface == ODM_ITRF_SDIO) odm_schedule_work_item(&sat_tab->hl_smart_antenna_workitem); -#if 0 - /*odm_stall_execution(1);*/ -#endif #endif } @@ -974,10 +851,6 @@ void phydm_fast_ant_training_hl_smart_antenna_type2( } } -#if 0 - /*PHYDM_DBG(dm, DBG_ANT_DIV, "HL Smart ant Training: state (( %d ))\n", fat_tab->fat_state);*/ -#endif - /* @[DECISION STATE] */ /*@=======================================================================================*/ if (fat_tab->fat_state == FAT_DECISION_STATE) { @@ -1243,9 +1116,6 @@ void phydm_beam_switch_workitem_callback( phydm_update_beam_pattern_type2(dm, sat_tab->update_beam_codeword, sat_tab->rfu_codeword_total_bit_num); #if DEV_BUS_TYPE != RT_PCI_INTERFACE -#if 0 - /*odm_stall_execution(sat_tab->latch_time);*/ -#endif sat_tab->pkt_skip_statistic_en = 0; #endif PHYDM_DBG(dm, DBG_ANT_DIV, @@ -1395,24 +1265,10 @@ void phydm_hl_smart_ant_type1_init_8821a( PHYDM_DBG(dm, DBG_ANT_DIV, "***8821A SmartAnt_Init => ant_div_type=[Hong-Lin Smart ant Type1]\n"); -#if 0 - /* @---------------------------------------- */ - /* @GPIO 2-3 for Beam control */ - /* reg0x66[2]=0 */ - /* reg0x44[27:26] = 0 */ - /* reg0x44[23:16] enable_output for P_GPIO[7:0] */ - /* reg0x44[15:8] output_value for P_GPIO[7:0] */ - /* reg0x40[1:0] = 0 GPIO function */ - /* @------------------------------------------ */ -#endif - /*@GPIO setting*/ odm_set_mac_reg(dm, R_0x64, BIT(18), 0); odm_set_mac_reg(dm, R_0x44, BIT(27) | BIT(26), 0); odm_set_mac_reg(dm, R_0x44, BIT(19) | BIT(18), 0x3); /*@enable_output for P_GPIO[3:2]*/ -#if 0 - /*odm_set_mac_reg(dm, R_0x44, BIT(11)|BIT(10), 0);*/ /*output value*/ -#endif odm_set_mac_reg(dm, R_0x40, BIT(1) | BIT(0), 0); /*@GPIO function*/ /*@Hong_lin smart antenna HW setting*/ @@ -1485,9 +1341,6 @@ u32 phydm_construct_hl_beam_codeword( if (ant_num < 8) { for (i = 0; i < (sat_tab->ant_num_total); i++) { -#if 0 - /*PHYDM_DBG(dm,DBG_ANT_DIV, "beam_pattern_num[%x] = %x\n",i,beam_pattern_num[i] );*/ -#endif if ((i < (sat_tab->first_train_ant - 1)) || break_counter >= sat_tab->ant_num) { data_tmp = 0; } else { @@ -1544,9 +1397,6 @@ void phydm_update_beam_pattern( reg44_ori = odm_get_mac_reg(dm, R_0x44, MASKDWORD); reg44_tmp_p = reg44_ori; -#if 0 - /*PHYDM_DBG(dm, DBG_ANT_DIV, "reg44_ori =0x%x\n", reg44_ori);*/ -#endif devide_num = (sat_tab->rfu_protocol_type == 2) ? 6 : 4; @@ -1570,9 +1420,6 @@ void phydm_update_beam_pattern( reg44_tmp_p |= ((1 << 11) | (beam_ctrl_signal << 10)); reg44_tmp_n = reg44_ori & (~(BIT(11) | BIT(10))); -#if 0 - /*PHYDM_DBG(dm, DBG_ANT_DIV, "reg44_tmp_p =(( 0x%x )), reg44_tmp_n = (( 0x%x ))\n", reg44_tmp_p, reg44_tmp_n);*/ -#endif odm_set_mac_reg(dm, R_0x44, MASKDWORD, reg44_tmp_p); odm_set_mac_reg(dm, R_0x44, MASKDWORD, reg44_tmp_n); #endif @@ -1587,18 +1434,12 @@ void phydm_update_beam_pattern( odm_set_mac_reg(dm, R_0x44, MASKDWORD, reg44_tmp_p); ODM_delay_us(10); -#if 0 - /*PHYDM_DBG(dm, DBG_ANT_DIV, "reg44 =(( 0x%x )), reg44[9:8] = ((%x)), beam_ctrl_signal =((%x))\n", reg44_tmp_p, ((reg44_tmp_p & 0x300)>>8), beam_ctrl_signal);*/ -#endif } else { reg44_tmp_p = reg44_ori & (~(BIT(9) | BIT(8))); /*@clean bit 9 & 8*/ reg44_tmp_p |= ((1 << 9) | (beam_ctrl_signal << 8)); reg44_tmp_n = reg44_ori & (~(BIT(9) | BIT(8))); -#if 0 - /*PHYDM_DBG(dm, DBG_ANT_DIV, "reg44_tmp_p =(( 0x%x )), reg44_tmp_n = (( 0x%x ))\n", reg44_tmp_p, reg44_tmp_n); */ -#endif odm_set_mac_reg(dm, R_0x44, MASKDWORD, reg44_tmp_p); ODM_delay_us(10); odm_set_mac_reg(dm, R_0x44, MASKDWORD, reg44_tmp_n); @@ -1636,9 +1477,6 @@ void phydm_update_rx_idle_beam( #if DEV_BUS_TYPE == RT_USB_INTERFACE || DEV_BUS_TYPE == RT_SDIO_INTERFACE if (dm->support_interface == ODM_ITRF_USB || dm->support_interface == ODM_ITRF_SDIO) odm_schedule_work_item(&sat_tab->hl_smart_antenna_workitem); -#if 0 - /*odm_stall_execution(1);*/ -#endif #endif sat_tab->pre_codeword = sat_tab->update_beam_codeword; @@ -1723,9 +1561,7 @@ void phydm_hl_smart_ant_debug( #if DEV_BUS_TYPE == RT_USB_INTERFACE || DEV_BUS_TYPE == RT_SDIO_INTERFACE if (dm->support_interface == ODM_ITRF_USB || dm->support_interface == ODM_ITRF_SDIO) odm_schedule_work_item(&sat_tab->hl_smart_antenna_workitem); -#if 0 - /*odm_stall_execution(1);*/ -#endif + #endif } else if (sat_tab->fix_beam_pattern_en == 0) PDM_SNPF(out_len, used, output + used, out_len - used, @@ -1892,11 +1728,6 @@ void odm_fast_ant_training_hl_smart_antenna_type1( "change to (( %d )) FAT_state\n", fat_tab->fat_state); -#if 0 - /*sat_tab->fast_training_beam_num = 0;*/ - /*phydm_set_all_ant_same_beam_num(dm);*/ -#endif - fat_tab->is_become_linked = dm->is_linked; } } @@ -1908,10 +1739,6 @@ void odm_fast_ant_training_hl_smart_antenna_type1( odm_tx_by_tx_desc_or_reg(dm, TX_BY_DESC); } -#if 0 - /*PHYDM_DBG(dm, DBG_ANT_DIV, "HL Smart ant Training: state (( %d ))\n", fat_tab->fat_state);*/ -#endif - /* @[DECISION STATE] */ /*@=======================================================================================*/ if (fat_tab->fat_state == FAT_DECISION_STATE) { @@ -1954,21 +1781,6 @@ void odm_fast_ant_training_hl_smart_antenna_type1( i, target_ant_beam[i], target_ant_beam_max_rssi[i]); -#if 0 - /*sorting*/ - /*@ - PHYDM_DBG(dm, DBG_ANT_DIV, "[Pre]rssi_sorting_seq = [%d, %d, %d, %d]\n", rssi_sorting_seq[0], rssi_sorting_seq[1], rssi_sorting_seq[2], rssi_sorting_seq[3]); - */ - - /*phydm_seq_sorting(dm, &rssi_sorting_seq[0], &rank_idx_seq[0], &rank_idx_out[0], SUPPORT_BEAM_PATTERN_NUM);*/ - - /*@ - PHYDM_DBG(dm, DBG_ANT_DIV, "[Post]rssi_sorting_seq = [%d, %d, %d, %d]\n", rssi_sorting_seq[0], rssi_sorting_seq[1], rssi_sorting_seq[2], rssi_sorting_seq[3]); - PHYDM_DBG(dm, DBG_ANT_DIV, "[Post]rank_idx_seq = [%d, %d, %d, %d]\n", rank_idx_seq[0], rank_idx_seq[1], rank_idx_seq[2], rank_idx_seq[3]); - PHYDM_DBG(dm, DBG_ANT_DIV, "[Post]rank_idx_out = [%d, %d, %d, %d]\n", rank_idx_out[0], rank_idx_out[1], rank_idx_out[2], rank_idx_out[3]); - */ -#endif - if (target_ant_beam_max_rssi[i] > max_beam_ant_rssi) { target_ant = i; max_beam_ant_rssi = target_ant_beam_max_rssi[i]; @@ -2175,9 +1987,7 @@ void phydm_beam_switch_workitem_callback( phydm_update_beam_pattern(dm, sat_tab->update_beam_codeword, sat_tab->rfu_codeword_total_bit_num); #if DEV_BUS_TYPE != RT_PCI_INTERFACE -#if 0 - /*odm_stall_execution(sat_tab->latch_time);*/ -#endif + sat_tab->pkt_skip_statistic_en = 0; #endif PHYDM_DBG(dm, DBG_ANT_DIV, diff --git a/hal/phydm/phydm_soml.c b/hal/phydm/phydm_soml.c index 35507e3f..6c907955 100644 --- a/hal/phydm/phydm_soml.c +++ b/hal/phydm/phydm_soml.c @@ -59,9 +59,7 @@ void phydm_dynamicsoftmletting(void *dm_void) "PHYDM_DynamicSoftMLSetting(): 0xF8C(== 0x%08X) < 0x16, enable SoML\n", ret_val); phydm_somlrxhp_setting(dm, true); -#if 0 - /*odm_set_bb_reg(dm, R_0x19a8, MASKDWORD, 0xc10a0000);*/ -#endif + dm->bsomlenabled = true; } } @@ -110,9 +108,7 @@ void phydm_adaptive_soml_callback(struct phydm_timer_list *timer) odm_schedule_work_item(&soml_tab->phydm_adaptive_soml_workitem); #else { -#if 0 - /*@dbg_print("%s\n",__func__);*/ -#endif + phydm_adsl(dm); } #endif @@ -128,9 +124,6 @@ void phydm_adaptive_soml_workitem_callback(void *context) HAL_DATA_TYPE *hal_data = GET_HAL_DATA(((PADAPTER)adapter)); struct dm_struct *dm = &hal_data->DM_OutSrc; -#if 0 - /*@dbg_print("%s\n",__func__);*/ -#endif phydm_adsl(dm); #endif } @@ -157,9 +150,7 @@ void phydm_adaptive_soml_workitem_callback(void *context) { struct dm_struct *dm = (void *)context; -#if 0 - /*@dbg_print("%s\n",__func__);*/ -#endif + phydm_adsl(dm); } @@ -964,13 +955,7 @@ void phydm_adaptive_soml_init(void *dm_void) { struct dm_struct *dm = (struct dm_struct *)dm_void; struct adaptive_soml *soml_tab = &dm->dm_soml_table; -#if 0 - if (!(dm->support_ability & ODM_BB_ADAPTIVE_SOML)) { - PHYDM_DBG(dm, DBG_ADPTV_SOML, - "[Return] Not Support Adaptive SOML\n"); - return; - } -#endif + PHYDM_DBG(dm, DBG_ADPTV_SOML, "%s\n", __func__); soml_tab->soml_state_cnt = 0; @@ -1088,9 +1073,7 @@ void phydm_init_soft_ml_setting(void *dm_void) #if (RTL8822B_SUPPORT == 1) if (!*dm->mp_mode) { if (dm->support_ic_type & ODM_RTL8822B) { -#if 0 - /*odm_set_bb_reg(dm, R_0x19a8, MASKDWORD, 0xd10a0000);*/ -#endif + phydm_somlrxhp_setting(dm, true); dm->bsomlenabled = true; } diff --git a/hal/phydm/phydm_soml.h b/hal/phydm/phydm_soml.h index 2d5fbc31..dfefab94 100644 --- a/hal/phydm/phydm_soml.h +++ b/hal/phydm/phydm_soml.h @@ -44,17 +44,6 @@ #define HT_ORDER_TYPE 3 #define VHT_ORDER_TYPE 4 -#if 0 -#define CFO_QPSK_TH 20 -#define CFO_QAM16_TH 20 -#define CFO_QAM64_TH 20 -#define CFO_QAM256_TH 20 - -#define BPSK_QPSK_DIST 20 -#define QAM16_DIST 30 -#define QAM64_DIST 30 -#define QAM256_DIST 20 -#endif #define HT_TYPE 1 #define VHT_TYPE 2 diff --git a/hal/phydm/phydm_types.h b/hal/phydm/phydm_types.h index a13f506b..7f43528e 100644 --- a/hal/phydm/phydm_types.h +++ b/hal/phydm/phydm_types.h @@ -67,14 +67,6 @@ enum hal_status { HAL_STATUS_SUCCESS, HAL_STATUS_FAILURE, -#if 0 - RT_STATUS_PENDING, - RT_STATUS_RESOURCE, - RT_STATUS_INVALID_CONTEXT, - RT_STATUS_INVALID_PARAMETER, - RT_STATUS_NOT_SUPPORT, - RT_STATUS_OS_API_FAILED, -#endif }; #if (DM_ODM_SUPPORT_TYPE != ODM_WIN) diff --git a/hal/phydm/rtl8192e/hal8192ereg.h b/hal/phydm/rtl8192e/hal8192ereg.h index 66c9c327..3bd41893 100644 --- a/hal/phydm/rtl8192e/hal8192ereg.h +++ b/hal/phydm/rtl8192e/hal8192ereg.h @@ -528,359 +528,6 @@ Current IOREG MAP #define StopBK BIT(0) */ -/* ----------------------------------------------------- - * - * 0xFE00h ~ 0xFE55h USB Configuration - * - * ----------------------------------------------------- */ -#if 0 -#define REG_USB_INFO 0xFE17 -#define REG_USB_SPECIAL_OPTION 0xFE55 -#define REG_USB_DMA_AGG_TO 0xFE5B -#define REG_USB_AGG_TO 0xFE5C -#define REG_USB_AGG_TH 0xFE5D - -#define REG_USB_HRPWM 0xFE58 -#define REG_USB_HCPWM 0xFE57 - - /* 2 USB Information (0xFE17) */ -#define USB_IS_HIGH_SPEED 0 -#define USB_IS_FULL_SPEED 1 -#define USB_SPEED_MASK BIT(5) - -#define USB_NORMAL_SIE_EP_MASK 0xF -#define USB_NORMAL_SIE_EP_SHIFT 4 - - /* 2 Special Option */ -#define USB_AGG_EN BIT(3) - -#endif -/* **************************************************************************** - * 8192C Regsiter Bit and Content definition - * **************************************************************************** - * ----------------------------------------------------- - * - * 0x0000h ~ 0x00FFh System Configuration - * - * ----------------------------------------------------- */ -#if 0 - /* 2 SYS_ISO_CTRL */ -#define ISO_MD2PP BIT(0) -#define ISO_UA2USB BIT(1) -#define ISO_UD2CORE BIT(2) -#define ISO_PA2PCIE BIT(3) -#define ISO_PD2CORE BIT(4) -#define ISO_IP2MAC BIT(5) -#define ISO_DIOP BIT(6) -#define ISO_DIOE BIT(7) -#define ISO_EB2CORE BIT(8) -#define ISO_DIOR BIT(9) -#define PWC_EV12V BIT(15) - - - /* 2 SYS_FUNC_EN */ -#define FEN_BBRSTB BIT(0) -#define FEN_BB_GLB_RSTn BIT(1) -#define FEN_USBA BIT(2) -#define FEN_UPLL BIT(3) -#define FEN_USBD BIT(4) -#define FEN_DIO_PCIE BIT(5) -#define FEN_PCIEA BIT(6) -#define FEN_PPLL BIT(7) -#define FEN_PCIED BIT(8) -#define FEN_DIOE BIT(9) -#define FEN_CPUEN BIT(10) -#define FEN_DCORE BIT(11) -#define FEN_ELDR BIT(12) -#define FEN_DIO_RF BIT(13) -#define FEN_HWPDN BIT(14) -#define FEN_MREGEN BIT(15) - - /* 2 APS_FSMCO */ -#define PFM_LDALL BIT(0) -#define PFM_ALDN BIT(1) -#define PFM_LDKP BIT(2) -#define PFM_WOWL BIT(3) -#define EnPDN BIT(4) -#define PDN_PL BIT(5) -#define APFM_ONMAC BIT(8) -#define APFM_OFF BIT(9) -#define APFM_RSM BIT(10) -#define AFSM_HSUS BIT(11) -#define AFSM_PCIE BIT(12) -#define APDM_MAC BIT(13) -#define APDM_HOST BIT(14) -#define APDM_HPDN BIT(15) -#define RDY_MACON BIT(16) -#define SUS_HOST BIT(17) -#define ROP_ALD BIT(20) -#define ROP_PWR BIT(21) -#define ROP_SPS BIT(22) -#define SOP_MRST BIT(25) -#define SOP_FUSE BIT(26) -#define SOP_ABG BIT(27) -#define SOP_AMB BIT(28) -#define SOP_RCK BIT(29) -#define SOP_A8M BIT(30) -#define XOP_BTCK BIT(31) - - /* 2 SYS_CLKR */ -#define ANAD16V_EN BIT(0) -#define ANA8M BIT(1) -#define MACSLP BIT(4) -#define LOADER_CLK_EN BIT(5) - - - /* 2 9346CR */ - -#define BOOT_FROM_EEPROM BIT(4) -#define EEPROM_EN BIT(5) - - - /* 2 RF_CTRL */ -#define RF_EN BIT(0) -#define RF_RSTB BIT(1) -#define RF_SDMRSTB BIT(2) - - /* 2 LDOV12D_CTRL */ -#define LDV12_EN BIT(0) -#define LDV12_SDBY BIT(1) -#define LPLDO_HSM BIT(2) -#define LPLDO_LSM_DIS BIT(3) -#define _LDV12_VADJ(x) (((x) & 0xF) << 4) - - - /* 2 EFUSE_TEST (For RTL8723 partially) */ -#define EF_TRPT BIT(7) -#define EF_CELL_SEL (BIT(8) | BIT(9)) /* 00: Wifi Efuse, 01: BT Efuse0, 10: BT Efuse1, 11: BT Efuse2 */ -#define LDOE25_EN BIT(31) -#define EFUSE_SEL(x) (((x) & 0x3) << 8) -#define EFUSE_SEL_MASK 0x300 -#define EFUSE_WIFI_SEL_0 0x0 -#define EFUSE_BT_SEL_0 0x1 -#define EFUSE_BT_SEL_1 0x2 -#define EFUSE_BT_SEL_2 0x3 - - - /* 2 8051FWDL */ - /* 2 MCUFWDL */ -#define MCUFWDL_EN BIT(0) -#define MCUFWDL_RDY BIT(1) -#define FWDL_ChkSum_rpt BIT(2) -#define MACINI_RDY BIT(3) -#define BBINI_RDY BIT(4) -#define RFINI_RDY BIT(5) -#define WINTINI_RDY BIT(6) -#define RAM_DL_SEL BIT(7) -#define ROM_DLEN BIT(19) -#define CPRST BIT(23) - - - - /* 2 REG_SYS_CFG */ -#define XCLK_VLD BIT(0) -#define ACLK_VLD BIT(1) -#define UCLK_VLD BIT(2) -#define PCLK_VLD BIT(3) -#define PCIRSTB BIT(4) -#define V15_VLD BIT(5) -#define TRP_B15V_EN BIT(7) -#define SIC_IDLE BIT(8) -#define BD_MAC2 BIT(9) -#define BD_MAC1 BIT(10) -#define IC_MACPHY_MODE BIT(11) -#define CHIP_VER (BIT(12) | BIT(13) | BIT(14) | BIT(15)) -#define BT_FUNC BIT(16) -#define VENDOR_ID BIT(19) -#define PAD_HWPD_IDN BIT(22) -#define TRP_VAUX_EN BIT(23) /* RTL ID */ -#define TRP_BT_EN BIT(24) -#define BD_PKG_SEL BIT(25) -#define BD_HCI_SEL BIT(26) -#define TYPE_ID BIT(27) - -#define CHIP_VER_RTL_MASK 0xF000 /* Bit 12 ~ 15 */ -#define CHIP_VER_RTL_SHIFT 12 - -#endif -/* ----------------------------------------------------- - * - * 0x0100h ~ 0x01FFh MACTOP General Configuration - * - * ----------------------------------------------------- */ -#if 0 - - /* 2 Function Enable Registers */ - /* 2 CR 0x0100-0x0103 */ - -#define HCI_TXDMA_EN BIT(0) -#define HCI_RXDMA_EN BIT(1) -#define TXDMA_EN BIT(2) -#define RXDMA_EN BIT(3) -#define PROTOCOL_EN BIT(4) -#define SCHEDULE_EN BIT(5) -#define MACTXEN BIT(6) -#define MACRXEN BIT(7) -#define ENSWBCN BIT(8) -#define ENSEC BIT(9) -#define CALTMR_EN BIT(10) /* 32k CAL TMR enable */ - - /* Network type */ -#define _NETTYPE(x) (((x) & 0x3) << 16) -#define MASK_NETTYPE 0x30000 -#define NT_NO_LINK 0x0 -#define NT_LINK_AD_HOC 0x1 -#define NT_LINK_AP 0x2 -#define NT_AS_AP 0x3 - - - /* 2 PBP - Page Size Register 0x0104 */ -#define GET_RX_PAGE_SIZE(value) ((value) & 0xF) -#define GET_TX_PAGE_SIZE(value) (((value) & 0xF0) >> 4) -#define _PSRX_MASK 0xF -#define _PSTX_MASK 0xF0 -#define _PSRX(x) (x) -#define _PSTX(x) ((x) << 4) - -#define PBP_64 0x0 -#define PBP_128 0x1 -#define PBP_256 0x2 -#define PBP_512 0x3 -#define PBP_1024 0x4 - - - /* 2 TX/RXDMA 0x010C */ -#define RXDMA_ARBBW_EN BIT(0) -#define RXSHFT_EN BIT(1) -#define RXDMA_AGG_EN BIT(2) -#define QS_VO_QUEUE BIT(8) -#define QS_VI_QUEUE BIT(9) -#define QS_BE_QUEUE BIT(10) -#define QS_BK_QUEUE BIT(11) -#define QS_MANAGER_QUEUE BIT(12) -#define QS_HIGH_QUEUE BIT(13) - -#define HQSEL_VOQ BIT(0) -#define HQSEL_VIQ BIT(1) -#define HQSEL_BEQ BIT(2) -#define HQSEL_BKQ BIT(3) -#define HQSEL_MGTQ BIT(4) -#define HQSEL_HIQ BIT(5) - - /* For normal driver, 0x10C */ -#define _TXDMA_HIQ_MAP(x) (((x) & 0x3) << 14) -#define _TXDMA_MGQ_MAP(x) (((x) & 0x3) << 12) -#define _TXDMA_BKQ_MAP(x) (((x) & 0x3) << 10) -#define _TXDMA_BEQ_MAP(x) (((x) & 0x3) << 8) -#define _TXDMA_VIQ_MAP(x) (((x) & 0x3) << 6) -#define _TXDMA_VOQ_MAP(x) (((x) & 0x3) << 4) - -#define QUEUE_LOW 1 -#define QUEUE_NORMAL 2 -#define QUEUE_HIGH 3 - - - /* 2 REG_C2HEVT_CLEAR 0x01AF */ -#define C2H_EVT_HOST_CLOSE 0x00 /* Set by driver and notify FW that the driver has read the C2H command message */ -#define C2H_EVT_FW_CLOSE 0xFF /* Set by FW indicating that FW had set the C2H command message and it's not yet read by driver. */ - - - - /* 2 LLT_INIT 0x01E0 */ -#define _LLT_NO_ACTIVE 0x0 -#define _LLT_WRITE_ACCESS 0x1 -#define _LLT_READ_ACCESS 0x2 - -#define _LLT_INIT_DATA(x) ((x) & 0xFF) -#define _LLT_INIT_ADDR(x) (((x) & 0xFF) << 8) -#define _LLT_OP(x) (((x) & 0x3) << 30) -#define _LLT_OP_VALUE(x) (((x) >> 30) & 0x3) - -#endif -/* ----------------------------------------------------- - * - * 0x0200h ~ 0x027Fh TXDMA Configuration - * - * ----------------------------------------------------- */ -#if 0 - /* 2 TDECTL 0x0208 */ -#define BLK_DESC_NUM_SHIFT 4 -#define BLK_DESC_NUM_MASK 0xF - - - /* 2 TXDMA_OFFSET_CHK 0x020C */ -#define DROP_DATA_EN BIT(9) -#endif -/* ----------------------------------------------------- - * - * 0x0280h ~ 0x028Bh RX DMA Configuration - * - * ----------------------------------------------------- */ -#if 0 - /* 2 REG_RXDMA_CONTROL, 0x0286h */ - - /* Write only. When this bit is set, RXDMA will decrease RX PKT counter by one. Before */ - /* this bit is polled, FW shall update RXFF_RD_PTR first. This register is write pulse and auto clear. */ -#define RXPKT_RELEASE_POLL BIT(0) - /* Read only. When RXMA finishes on-going DMA operation, RXMDA will report idle state in */ - /* this bit. FW can start releasing packets after RXDMA entering idle mode. */ -#define RXDMA_IDLE BIT(1) - /* When this bit is set, RXDMA will enter this mode after on-going RXDMA packet to host */ - /* completed, and stop DMA packet to host. RXDMA will then report Default: 0; */ -#define RW_RELEASE_EN BIT(2) -#endif -/* ----------------------------------------------------- - * - * 0x0400h ~ 0x047Fh Protocol Configuration - * - * ----------------------------------------------------- */ -#if 0 - /* 2 FWHW_TXQ_CTRL 0x0420 */ -#define EN_AMPDU_RTY_NEW BIT(7) - - - /* 2 REG_LIFECTRL_CTRL 0x0426 */ -#define HAL92C_EN_PKT_LIFE_TIME_BK BIT(3) -#define HAL92C_EN_PKT_LIFE_TIME_BE BIT(2) -#define HAL92C_EN_PKT_LIFE_TIME_VI BIT(1) -#define HAL92C_EN_PKT_LIFE_TIME_VO BIT(0) - -#define HAL92C_MSDU_LIFE_TIME_UNIT 128 /* in us, said by Tim. */ - - - /* 2 SPEC SIFS 0x0428 */ -#define _SPEC_SIFS_CCK(x) ((x) & 0xFF) -#define _SPEC_SIFS_OFDM(x) (((x) & 0xFF) << 8) - - /* 2 RL 0x042A */ -#define RETRY_LIMIT_SHORT_SHIFT 8 -#define RETRY_LIMIT_LONG_SHIFT 0 - -#define _LRL(x) ((x) & 0x3F) -#define _SRL(x) (((x) & 0x3F) << 8) -#endif - -/* ----------------------------------------------------- - * - * 0x0500h ~ 0x05FFh EDCA Configuration - * - * ----------------------------------------------------- */ -#if 0 - /* 2 EDCA setting 0x050C */ -#define AC_PARAM_TXOP_LIMIT_OFFSET 16 -#define AC_PARAM_ECW_MAX_OFFSET 12 -#define AC_PARAM_ECW_MIN_OFFSET 8 -#define AC_PARAM_AIFS_OFFSET 0 - - - /* 2 BCN_CTRL 0x0550 */ -#define EN_TXBCN_RPT BIT(2) -#define EN_BCN_FUNCTION BIT(3) - - /* 2 TxPause 0x0522 */ -#define STOP_BCNQ BIT(6) -#endif - /* 2 ACMHWCTRL 0x05C0 */ #define acm_hw_hw_en_8192e BIT(0) #define acm_hw_voq_en_8192e BIT(1) @@ -890,227 +537,4 @@ Current IOREG MAP #define acm_hw_viq_status_8192e BIT(6) #define acm_hw_beq_status_8192e BIT(7) -/* ----------------------------------------------------- - * - * 0x0600h ~ 0x07FFh WMAC Configuration - * - * ----------------------------------------------------- */ -#if 0 - - /* 2 TCR 0x0604 */ -#define DIS_GCLK BIT(1) -#define PAD_SEL BIT(2) -#define PWR_ST BIT(6) -#define PWRBIT_OW_EN BIT(7) -#define ACRC BIT(8) -#define CFENDFORM BIT(9) -#define ICV BIT(10) -#endif - -/* ---------------------------------------------------------------------------- - * 8195 (RCR) Receive Configuration Register (Offset 0x608, 32 bits) - * ---------------------------------------------------------------------------- */ -#if 0 -#define RCR_APPFCS BIT(31) /* WMAC append FCS after pauload */ -#define RCR_APP_MIC BIT(30) /* MACRX will retain the MIC at the bottom of the packet. */ -#define RCR_APP_ICV BIT(29) /* MACRX will retain the ICV at the bottom of the packet. */ -#define RCR_APP_PHYST_RXFF BIT(28) /* HY status is appended before RX packet in RXFF */ -#define RCR_APP_BA_SSN BIT(27) /* SSN of previous TXBA is appended as after original RXDESC as the 4-th DW of RXDESC. */ -#define RCR_RSVD_BIT(26) BIT26 /* Reserved */ -#endif -#define RCR_TCPOFLD_EN BIT(25) /* Enable TCP checksum offload */ -#if 0 -#define RCR_ENMBID BIT(24) /* Enable Multiple BssId. Only response ACK to the packets whose DID(A1) matching to the addresses in the MBSSID CAM Entries. */ -#define RCR_LSIGEN BIT(23) /* Enable LSIG TXOP Protection function. Search KEYCAM for each rx packet to check if LSIGEN bit is set. */ -#define RCR_MFBEN BIT(22) /* Enable immediate MCS Feedback function. When Rx packet with MRQ = 1'b1, then search KEYCAM to find sender's MCS Feedback function and send response. */ -#endif -#if 0 -#define RCR_RSVD_BIT(19) BIT19 /* Reserved */ -#define RCR_TIM_PARSER_EN BIT(18) /* RX Beacon TIM Parser. */ -#define RCR_BM_DATA_EN BIT(17) /* Broadcast data packet interrupt enable. */ -#define RCR_UC_DATA_EN BIT(16) /* Unicast data packet interrupt enable. */ -#endif -#if 0 -#define RCR_HTC_LOC_CTRL BIT(14) /* MFC<--HTC = 1 MFC-->HTC = 0 */ -#define RCR_AMF BIT(13) /* Accept management type frame */ -#define RCR_ACF BIT(12) /* Accept control type frame. Control frames BA, BAR, and PS-Poll (when in AP mode) are not controlled by this bit. They are controlled by ADF. */ -#define RCR_ADF BIT(11) /* Accept data type frame. This bit also regulates BA, BAR, and PS-Poll (AP mode only). */ -#endif -#if 0 -#define RCR_AICV BIT(9) /* Accept ICV error packet */ -#define RCR_ACRC32 BIT(8) /* Accept CRC32 error packet */ -#define RCR_CBSSID_BCN BIT(7) /* Accept BSSID match packet (Rx beacon, probe rsp) */ -#define RCR_CBSSID_DATA BIT(6) /* Accept BSSID match packet (data) */ -#define RCR_CBSSID RCR_CBSSID_DATA /* Accept BSSID match packet */ -#define RCR_APWRMGT BIT(5) /* Accept power management packet */ -#define RCR_ADD3 BIT(4) /* Accept address 3 match packet */ -#define RCR_AB BIT(3) /* Accept broadcast packet */ -#define RCR_AM BIT(2) /* Accept multicast packet */ -#define RCR_APM BIT(1) /* Accept physical match packet */ -#define RCR_AAP BIT(0) /* Accept all unicast packet */ - -#define AAP BIT(0) -#define APM BIT(1) -#define AM BIT(2) -#define AB BIT(3) -#define ADD3 BIT(4) -#define APWRMGT BIT(5) -#define CBSSID BIT(6) -#define CBSSID_DATA BIT(6) -#define CBSSID_BCN BIT(7) -#define ACRC32 BIT(8) -#define AICV BIT(9) -#define ADF BIT(11) -#define ACF BIT(12) -#define AMF BIT(13) -#define HTC_LOC_CTRL BIT(14) -#define UC_DATA_EN BIT(16) -#define BM_DATA_EN BIT(17) -#define MFBEN BIT(22) -#define LSIGEN BIT(23) -#define EnMBID BIT(24) -#define APP_BASSN BIT(27) -#define APP_PHYSTS BIT(28) -#define APP_ICV BIT(29) -#define APP_MIC BIT(30) -#endif - -/* ---------------------------------------------------------------------------- - * 8195 CAM Config setting (offset 0x680, 1 byte) - * ---------------------------------------------------------------------------- */ -#if 0 -#define SCR_TxUseDK BIT(0) /* Force Tx Use Default Key */ -#define SCR_RxUseDK BIT(1) /* Force Rx Use Default Key */ -#define SCR_TxEncEnable BIT(2) /* Enable Tx Encryption */ -#define SCR_RxDecEnable BIT(3) /* Enable Rx Decryption */ -#define SCR_SKByA2 BIT(4) /* Search kEY BY A2 */ -#define SCR_NoSKMC BIT(5) /* No Key Search Multicast */ -#define SCR_TXBCUSEDK BIT(6) /* Force Tx Broadcast packets Use Default Key */ -#define SCR_RXBCUSEDK BIT(7) /* Force Rx Broadcast packets Use Default Key */ - -#define CAM_NONE 0x0 -#define CAM_WEP40 0x01 -#define CAM_TKIP 0x02 -#define CAM_AES 0x04 -#define CAM_WEP104 0x05 -#define CAM_SMS4 0x6 - -#define TOTAL_CAM_ENTRY 32 -#define HALF_CAM_ENTRY 16 - -#define CAM_CONFIG_USEDK true -#define CAM_CONFIG_NO_USEDK false - -#define SCR_UseDK 0x01 -#define SCR_TxSecEnable 0x02 -#define SCR_RxSecEnable 0x04 -#endif - -/* ----------------------------------------------------- - * - * 0xFE00h ~ 0xFE55h RTL8723 SDIO Configuration - * - * ----------------------------------------------------- */ -#if 0 - /* SDIO host local register space mapping. */ -#define SDIO_LOCAL_MSK 0x0FFF -#define WLAN_IOREG_MSK 0x7FFF -#define WLAN_FIFO_MSK 0x1FFF /* Aggregation length[12:0] */ - -#define SDIO_WITHOUT_REF_DEVICE_ID 0 /* Without reference to the SDIO Device ID */ -#define SDIO_LOCAL_DEVICE_ID 0 /* 0b[16], 000b[15:13] */ -#define WLAN_TX_HIQ_DEVICE_ID 4 /* 0b[16], 100b[15:13] */ -#define WLAN_TX_MIQ_DEVICE_ID 5 /* 0b[16], 101b[15:13] */ -#define WLAN_TX_LOQ_DEVICE_ID 6 /* 0b[16], 110b[15:13] */ -#define WLAN_RX0FF_DEVICE_ID 7 /* 0b[16], 111b[15:13] */ -#define WLAN_IOREG_DEVICE_ID 8 /* 1b[16] */ - - /* SDIO Tx Free Page index */ -#define HI_QUEUE_IDX 0 -#define MID_QUEUE_IDX 1 -#define LOW_QUEUE_IDX 2 -#define PUBLIC_QUEUE_IDX 3 - -#define SDIO_REG_TX_CTRL 0x0000 /* SDIO Tx Control */ -#define SDIO_REG_HIMR 0x0014 /* SDIO Host Interrupt Mask */ -#define SDIO_REG_HISR 0x0018 /* SDIO Host Interrupt Service Routine */ -#define SDIO_REG_HCPWM 0x0019 /* HCI Current Power mode */ -#define SDIO_REG_RX0_REQ_LEN 0x001C /* RXDMA Request length */ -#define SDIO_REG_FREE_TXPG 0x0020 /* Free Tx buffer Page */ -#define SDIO_REG_HCPWM1 0x0024 /* HCI Current Power mode 1 */ -#define SDIO_REG_HCPWM2 0x0026 /* HCI Current Power mode 2 */ -#define SDIO_REG_HTSFR_INFO 0x0030 /* HTSF Informaion */ -#define SDIO_REG_HRPWM1 0x0080 /* HCI Request Power mode 1 */ -#define SDIO_REG_HRPWM2 0x0082 /* HCI Request Power mode 2 */ -#define SDIO_REG_HPS_CLKR 0x0084 /* HCI Power Save Clock */ -#define SDIO_REG_HSUS_CTRL 0x0086 /* SDIO HCI Suspend Control */ -#define SDIO_REG_HIMR_ON 0x0090 /* SDIO Host Extension Interrupt Mask Always */ -#define SDIO_REG_HISR_ON 0x0091 /* SDIO Host Extension Interrupt status Always */ - -#define SDIO_HIMR_DISABLED 0 - - /* RTL8723/RTL8188E SDIO Host Interrupt Mask Register */ -#define SDIO_HIMR_RX_REQUEST_MSK BIT(0) -#define SDIO_HIMR_AVAL_MSK BIT(1) -#define SDIO_HIMR_TXERR_MSK BIT(2) -#define SDIO_HIMR_RXERR_MSK BIT(3) -#define SDIO_HIMR_TXFOVW_MSK BIT(4) -#define SDIO_HIMR_RXFOVW_MSK BIT(5) -#define SDIO_HIMR_TXBCNOK_MSK BIT(6) -#define SDIO_HIMR_TXBCNERR_MSK BIT(7) -#define SDIO_HIMR_BCNERLY_INT_MSK BIT(16) -#define SDIO_HIMR_C2HCMD_MSK BIT(17) -#define SDIO_HIMR_CPWM1_MSK BIT(18) -#define SDIO_HIMR_CPWM2_MSK BIT(19) -#define SDIO_HIMR_HSISR_IND_MSK BIT(20) -#define SDIO_HIMR_GTINT3_IND_MSK BIT(21) -#define SDIO_HIMR_GTINT4_IND_MSK BIT(22) -#define SDIO_HIMR_PSTIMEOUT_MSK BIT(23) -#define SDIO_HIMR_OCPINT_MSK BIT(24) -#define SDIO_HIMR_ATIMEND_MSK BIT(25) -#define SDIO_HIMR_ATIMEND_E_MSK BIT(26) -#define SDIO_HIMR_CTWEND_MSK BIT(27) - - /* RTL8188E SDIO Specific */ -#define SDIO_HIMR_MCU_ERR_MSK BIT(28) -#define SDIO_HIMR_TSF_BIT32_TOGGLE_MSK BIT(29) - - /* SDIO Host Interrupt Service Routine */ -#define SDIO_HISR_RX_REQUEST BIT(0) -#define SDIO_HISR_AVAL BIT(1) -#define SDIO_HISR_TXERR BIT(2) -#define SDIO_HISR_RXERR BIT(3) -#define SDIO_HISR_TXFOVW BIT(4) -#define SDIO_HISR_RXFOVW BIT(5) -#define SDIO_HISR_TXBCNOK BIT(6) -#define SDIO_HISR_TXBCNERR BIT(7) -#define SDIO_HISR_BCNERLY_INT BIT(16) -#define SDIO_HISR_C2HCMD BIT(17) -#define SDIO_HISR_CPWM1 BIT(18) -#define SDIO_HISR_CPWM2 BIT(19) -#define SDIO_HISR_HSISR_IND BIT(20) -#define SDIO_HISR_GTINT3_IND BIT(21) -#define SDIO_HISR_GTINT4_IND BIT(22) -#define SDIO_HISR_PSTIMEOUT BIT(23) -#define SDIO_HISR_OCPINT BIT(24) -#define SDIO_HISR_ATIMEND BIT(25) -#define SDIO_HISR_ATIMEND_E BIT(26) -#define SDIO_HISR_CTWEND BIT(27) - - /* RTL8188E SDIO Specific */ -#define SDIO_HISR_MCU_ERR BIT(28) -#define SDIO_HISR_TSF_BIT32_TOGGLE BIT29 - - - /* SDIO HCI Suspend Control Register */ -#define HCI_RESUME_PWR_RDY BIT(1) -#define HCI_SUS_CTRL BIT(0) - -#if DEV_BUS_TYPE == RT_SDIO_INTERFACE -#define MAX_TX_AGG_PACKET_NUMBER 0x8 -#else -#define MAX_TX_AGG_PACKET_NUMBER 0xFF -#endif - -#endif #endif /* #ifndef __INC_HAL8192EREG_H */ diff --git a/hal/phydm/txbf/halcomtxbf.c b/hal/phydm/txbf/halcomtxbf.c index ae45a5b1..0a2b0e8f 100644 --- a/hal/phydm/txbf/halcomtxbf.c +++ b/hal/phydm/txbf/halcomtxbf.c @@ -250,7 +250,7 @@ void hal_com_txbf_fw_ndpa_work_item_callback( else if (dm->support_ic_type & ODM_RTL8814A) hal_txbf_8814a_fw_txbf(dm, idx); else if (dm->support_ic_type & ODM_RTL8822B) - hal_txbf_8822b_fw_txbf(dm, idx); + /*hal_txbf_8822b_fw_txbf(dm, idx);*/ } void hal_com_txbf_clk_work_item_callback( diff --git a/hal/phydm/txbf/halcomtxbf.h b/hal/phydm/txbf/halcomtxbf.h index 5ad30339..e2118247 100644 --- a/hal/phydm/txbf/halcomtxbf.h +++ b/hal/phydm/txbf/halcomtxbf.h @@ -25,22 +25,6 @@ #ifndef __HAL_COM_TXBF_H__ #define __HAL_COM_TXBF_H__ -#if 0 -typedef bool -(*TXBF_GET)( - void* adapter, - u8 get_type, - void* p_out_buf - ); - -typedef bool -(*TXBF_SET)( - void* adapter, - u8 set_type, - void* p_in_buf - ); -#endif - enum txbf_set_type { TXBF_SET_SOUNDING_ENTER, TXBF_SET_SOUNDING_LEAVE, diff --git a/hal/phydm/txbf/haltxbf8814a.c b/hal/phydm/txbf/haltxbf8814a.c index 7ad6ca90..142e8b8d 100644 --- a/hal/phydm/txbf/haltxbf8814a.c +++ b/hal/phydm/txbf/haltxbf8814a.c @@ -73,36 +73,6 @@ void hal_txbf_8814a_set_ndpa_rate(void *dm_void, u8 BW, u8 rate) odm_write_1byte(dm, REG_NDPA_OPT_CTRL_8814A, BW); odm_write_1byte(dm, REG_NDPA_RATE_8814A, (u8)rate); } -#if 0 -#define PHYDM_MEMORY_MAP_BUF_READ 0x8000 -#define PHYDM_CTRL_INFO_PAGE 0x660 - -void -phydm_data_rate_8814a( - struct dm_struct *dm, - u8 mac_id, - u32 *data, - u8 data_len -) -{ - u8 i = 0; - u16 x_read_data_addr = 0; - - odm_write_2byte(dm, REG_PKTBUF_DBG_CTRL_8814A, PHYDM_CTRL_INFO_PAGE); - x_read_data_addr = PHYDM_MEMORY_MAP_BUF_READ + mac_id * 32; /*@Ctrl Info: 32Bytes for each macid(n)*/ - - if (x_read_data_addr < PHYDM_MEMORY_MAP_BUF_READ || x_read_data_addr > 0x8FFF) { - PHYDM_DBG(dm, DBG_TXBF, - "x_read_data_addr(0x%x) is not correct!\n", - x_read_data_addr); - return; - } - - /* Read data */ - for (i = 0; i < data_len; i++) - *(data + i) = odm_read_2byte(dm, x_read_data_addr + i); -} -#endif void hal_txbf_8814a_get_tx_rate(void *dm_void) { @@ -353,132 +323,6 @@ void hal_txbf_8814a_rf_mode(void *dm_void, odm_set_bb_reg(dm, REG_BB_TX_PATH_SEL_2_8814A, MASKDWORD, 0x93e9360); } } -#if 0 -void -hal_txbf_8814a_download_ndpa( - void *dm_void, - u8 idx -) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - u8 u1b_tmp = 0, tmp_reg422 = 0; - u8 bcn_valid_reg = 0, count = 0, dl_bcn_count = 0; - u16 head_page = 0x7FE; - boolean is_send_beacon = false; - u16 tx_page_bndy = LAST_ENTRY_OF_TX_PKT_BUFFER_8814A; /*@default reseved 1 page for the IC type which is undefined.*/ - struct _RT_BEAMFORMING_INFO *beam_info = &dm->beamforming_info; - struct _RT_BEAMFORMEE_ENTRY *p_beam_entry = beam_info->beamformee_entry + idx; - void *adapter = dm->adapter; - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - *dm->is_fw_dw_rsvd_page_in_progress = true; -#endif - PHYDM_DBG(dm, DBG_TXBF, "[%s] Start!\n", __func__); - - phydm_get_hal_def_var_handler_interface(dm, HAL_DEF_TX_PAGE_BOUNDARY, (u16 *)&tx_page_bndy); - - /*Set REG_CR bit 8. DMA beacon by SW.*/ - u1b_tmp = odm_read_1byte(dm, REG_CR_8814A + 1); - odm_write_1byte(dm, REG_CR_8814A + 1, (u1b_tmp | BIT(0))); - - - /*Set FWHW_TXQ_CTRL 0x422[6]=0 to tell Hw the packet is not a real beacon frame.*/ - tmp_reg422 = odm_read_1byte(dm, REG_FWHW_TXQ_CTRL_8814A + 2); - odm_write_1byte(dm, REG_FWHW_TXQ_CTRL_8814A + 2, tmp_reg422 & (~BIT(6))); - - if (tmp_reg422 & BIT(6)) { - PHYDM_DBG(dm, DBG_TXBF, - "%s: There is an adapter is sending beacon.\n", - __func__); - is_send_beacon = true; - } - - /*@0x204[11:0] Beacon Head for TXDMA*/ - odm_write_2byte(dm, REG_FIFOPAGE_CTRL_2_8814A, head_page); - - do { - /*@Clear beacon valid check bit.*/ - bcn_valid_reg = odm_read_1byte(dm, REG_FIFOPAGE_CTRL_2_8814A + 1); - odm_write_1byte(dm, REG_FIFOPAGE_CTRL_2_8814A + 1, (bcn_valid_reg | BIT(7))); - - /*@download NDPA rsvd page.*/ - if (p_beam_entry->beamform_entry_cap & BEAMFORMER_CAP_VHT_SU) - beamforming_send_vht_ndpa_packet(dm, p_beam_entry->mac_addr, p_beam_entry->AID, p_beam_entry->sound_bw, BEACON_QUEUE); - else - beamforming_send_ht_ndpa_packet(dm, p_beam_entry->mac_addr, p_beam_entry->sound_bw, BEACON_QUEUE); - - /*@check rsvd page download OK.*/ - bcn_valid_reg = odm_read_1byte(dm, REG_FIFOPAGE_CTRL_2_8814A + 1); - count = 0; - while (!(bcn_valid_reg & BIT(7)) && count < 20) { - count++; - ODM_delay_ms(10); - bcn_valid_reg = odm_read_1byte(dm, REG_FIFOPAGE_CTRL_2_8814A + 2); - } - dl_bcn_count++; - } while (!(bcn_valid_reg & BIT(7)) && dl_bcn_count < 5); - - if (!(bcn_valid_reg & BIT(7))) - PHYDM_DBG(dm, DBG_TXBF, "%s Download RSVD page failed!\n", - __func__); - - /*@0x204[11:0] Beacon Head for TXDMA*/ - odm_write_2byte(dm, REG_FIFOPAGE_CTRL_2_8814A, tx_page_bndy); - - /*To make sure that if there exists an adapter which would like to send beacon.*/ - /*@If exists, the origianl value of 0x422[6] will be 1, we should check this to*/ - /*prevent from setting 0x422[6] to 0 after download reserved page, or it will cause */ - /*the beacon cannot be sent by HW.*/ - /*@2010.06.23. Added by tynli.*/ - if (is_send_beacon) - odm_write_1byte(dm, REG_FWHW_TXQ_CTRL_8814A + 2, tmp_reg422); - - /*@Do not enable HW DMA BCN or it will cause Pcie interface hang by timing issue. 2011.11.24. by tynli.*/ - /*@Clear CR[8] or beacon packet will not be send to TxBuf anymore.*/ - u1b_tmp = odm_read_1byte(dm, REG_CR_8814A + 1); - odm_write_1byte(dm, REG_CR_8814A + 1, (u1b_tmp & (~BIT(0)))); - - p_beam_entry->beamform_entry_state = BEAMFORMING_ENTRY_STATE_PROGRESSED; - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - *dm->is_fw_dw_rsvd_page_in_progress = false; -#endif -} - -void -hal_txbf_8814a_fw_txbf_cmd( - void *dm_void -) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - u8 idx, period = 0; - u8 PageNum0 = 0xFF, PageNum1 = 0xFF; - u8 u1_tx_bf_parm[3] = {0}; - struct _RT_BEAMFORMING_INFO *beam_info = &dm->beamforming_info; - - for (idx = 0; idx < BEAMFORMEE_ENTRY_NUM; idx++) { - if (beam_info->beamformee_entry[idx].is_used && beam_info->beamformee_entry[idx].beamform_entry_state == BEAMFORMING_ENTRY_STATE_PROGRESSED) { - if (beam_info->beamformee_entry[idx].is_sound) { - PageNum0 = 0xFE; - PageNum1 = 0x07; - period = (u8)(beam_info->beamformee_entry[idx].sound_period); - } else if (PageNum0 == 0xFF) { - PageNum0 = 0xFF; /*stop sounding*/ - PageNum1 = 0x0F; - } - } - } - - u1_tx_bf_parm[0] = PageNum0; - u1_tx_bf_parm[1] = PageNum1; - u1_tx_bf_parm[2] = period; - odm_fill_h2c_cmd(dm, PHYDM_H2C_TXBF, 3, u1_tx_bf_parm); - - PHYDM_DBG(dm, DBG_TXBF, - "[%s] PageNum0 = %d, PageNum1 = %d period = %d\n", __func__, - PageNum0, PageNum1, period); -} -#endif void hal_txbf_8814a_enter(void *dm_void, u8 bfer_bfee_idx) { struct dm_struct *dm = (struct dm_struct *)dm_void; @@ -656,18 +500,6 @@ void hal_txbf_8814a_status(void *dm_void, u8 idx) void hal_txbf_8814a_fw_txbf(void *dm_void, u8 idx) { -#if 0 - struct dm_struct *dm = (struct dm_struct *)dm_void; - struct _RT_BEAMFORMING_INFO *beam_info = &dm->beamforming_info; - struct _RT_BEAMFORMEE_ENTRY *p_beam_entry = beam_info->beamformee_entry + idx; - - PHYDM_DBG(dm, DBG_TXBF, "[%s] Start!\n", __func__); - - if (p_beam_entry->beamform_entry_state == BEAMFORMING_ENTRY_STATE_PROGRESSING) - hal_txbf_8814a_download_ndpa(dm, idx); - - hal_txbf_8814a_fw_txbf_cmd(dm); -#endif } #endif /* @(RTL8814A_SUPPORT == 1)*/ diff --git a/hal/phydm/txbf/haltxbf8822b.c b/hal/phydm/txbf/haltxbf8822b.c index 0c7d9851..d1fa77f6 100644 --- a/hal/phydm/txbf/haltxbf8822b.c +++ b/hal/phydm/txbf/haltxbf8822b.c @@ -85,240 +85,6 @@ u8 hal_txbf_8822b_get_nrx( } /***************SU & MU BFee Entry********************/ -void hal_txbf_8822b_rf_mode( - void *dm_void, - struct _RT_BEAMFORMING_INFO *beamforming_info, - u8 idx) -{ -#if 0 - struct dm_struct *dm = (struct dm_struct *)dm_void; - u8 i, nr_index = 0; - boolean is_self_beamformer = false; - boolean is_self_beamformee = false; - struct _RT_BEAMFORMEE_ENTRY beamformee_entry; - - if (idx < BEAMFORMEE_ENTRY_NUM) - beamformee_entry = beamforming_info->beamformee_entry[idx]; - else - return; - - if (dm->rf_type == RF_1T1R) - return; - - for (i = RF_PATH_A; i < RF_PATH_B; i++) { - odm_set_rf_reg(dm, (enum rf_path)i, rf_welut_jaguar, 0x80000, 0x1); - /*RF mode table write enable*/ - } - - if (beamforming_info->beamformee_su_cnt > 0 || beamforming_info->beamformee_mu_cnt > 0) { - for (i = RF_PATH_A; i < RF_PATH_B; i++) { - odm_set_rf_reg(dm, (enum rf_path)i, rf_mode_table_addr, 0xfffff, 0x18000); - /*Select RX mode*/ - odm_set_rf_reg(dm, (enum rf_path)i, rf_mode_table_data0, 0xfffff, 0xBE77F); - /*Set Table data*/ - odm_set_rf_reg(dm, (enum rf_path)i, rf_mode_table_data1, 0xfffff, 0x226BF); - /*@Enable TXIQGEN in RX mode*/ - } - odm_set_rf_reg(dm, RF_PATH_A, rf_mode_table_data1, 0xfffff, 0xE26BF); - /*@Enable TXIQGEN in RX mode*/ - } - - for (i = RF_PATH_A; i < RF_PATH_B; i++) { - odm_set_rf_reg(dm, (enum rf_path)i, rf_welut_jaguar, 0x80000, 0x0); - /*RF mode table write disable*/ - } - - if (beamforming_info->beamformee_su_cnt > 0) { - /*@for 8814 19ac(idx 1), 19b4(idx 0), different Tx ant setting*/ - odm_set_bb_reg(dm, REG_BB_TXBF_ANT_SET_BF1_8822B, BIT(28) | BIT29, 0x2); /*@enable BB TxBF ant mapping register*/ - - if (idx == 0) { - /*Nsts = 2 AB*/ - odm_set_bb_reg(dm, REG_BB_TXBF_ANT_SET_BF0_8822B, 0xffff, 0x0433); - odm_set_bb_reg(dm, REG_BB_TX_PATH_SEL_1_8822B, 0xfff00000, 0x043); - /*odm_set_bb_reg(dm, REG_BB_TX_PATH_SEL_2, MASKLWORD, 0x430);*/ - - } else {/*@IDX =1*/ - odm_set_bb_reg(dm, REG_BB_TXBF_ANT_SET_BF1_8822B, 0xffff, 0x0433); - odm_set_bb_reg(dm, REG_BB_TX_PATH_SEL_1_8822B, 0xfff00000, 0x043); - /*odm_set_bb_reg(dm, REG_BB_TX_PATH_SEL_2, MASKLWORD, 0x430;*/ - } - } else { - odm_set_bb_reg(dm, REG_BB_TX_PATH_SEL_1_8822B, 0xfff00000, 0x1); /*@1SS by path-A*/ - odm_set_bb_reg(dm, REG_BB_TX_PATH_SEL_2_8822B, MASKLWORD, 0x430); /*@2SS by path-A,B*/ - } - - if (beamforming_info->beamformee_mu_cnt > 0) { - /*@MU STAs share the common setting*/ - odm_set_bb_reg(dm, REG_BB_TXBF_ANT_SET_BF1_8822B, BIT(31), 1); - odm_set_bb_reg(dm, REG_BB_TXBF_ANT_SET_BF1_8822B, 0xffff, 0x0433); - odm_set_bb_reg(dm, REG_BB_TX_PATH_SEL_1_8822B, 0xfff00000, 0x043); - } -#endif -} -#if 0 -void -hal_txbf_8822b_download_ndpa( - void *adapter, - u8 idx -) -{ - u8 u1b_tmp = 0, tmp_reg422 = 0; - u8 bcn_valid_reg = 0, count = 0, dl_bcn_count = 0; - u16 head_page = 0x7FE; - boolean is_send_beacon = false; - HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); - u16 tx_page_bndy = LAST_ENTRY_OF_TX_PKT_BUFFER_8814A; /*@default reseved 1 page for the IC type which is undefined.*/ - struct _RT_BEAMFORMING_INFO *beam_info = GET_BEAMFORM_INFO(adapter); - struct _RT_BEAMFORMEE_ENTRY *p_beam_entry = beam_info->beamformee_entry + idx; - - hal_data->is_fw_dw_rsvd_page_in_progress = true; - phydm_get_hal_def_var_handler_interface(dm, HAL_DEF_TX_PAGE_BOUNDARY, (u16 *)&tx_page_bndy); - - /*Set REG_CR bit 8. DMA beacon by SW.*/ - u1b_tmp = platform_efio_read_1byte(adapter, REG_CR_8814A + 1); - platform_efio_write_1byte(adapter, REG_CR_8814A + 1, (u1b_tmp | BIT(0))); - - - /*Set FWHW_TXQ_CTRL 0x422[6]=0 to tell Hw the packet is not a real beacon frame.*/ - tmp_reg422 = platform_efio_read_1byte(adapter, REG_FWHW_TXQ_CTRL_8814A + 2); - platform_efio_write_1byte(adapter, REG_FWHW_TXQ_CTRL_8814A + 2, tmp_reg422 & (~BIT(6))); - - if (tmp_reg422 & BIT(6)) { - is_send_beacon = true; - } - - /*@0x204[11:0] Beacon Head for TXDMA*/ - platform_efio_write_2byte(adapter, REG_FIFOPAGE_CTRL_2_8814A, head_page); - - do { - /*@Clear beacon valid check bit.*/ - bcn_valid_reg = platform_efio_read_1byte(adapter, REG_FIFOPAGE_CTRL_2_8814A + 1); - platform_efio_write_1byte(adapter, REG_FIFOPAGE_CTRL_2_8814A + 1, (bcn_valid_reg | BIT(7))); - - /*@download NDPA rsvd page.*/ - if (p_beam_entry->beamform_entry_cap & BEAMFORMER_CAP_VHT_SU) - beamforming_send_vht_ndpa_packet(dm, p_beam_entry->mac_addr, p_beam_entry->AID, p_beam_entry->sound_bw, BEACON_QUEUE); - else - beamforming_send_ht_ndpa_packet(dm, p_beam_entry->mac_addr, p_beam_entry->sound_bw, BEACON_QUEUE); - - /*@check rsvd page download OK.*/ - bcn_valid_reg = platform_efio_read_1byte(adapter, REG_FIFOPAGE_CTRL_2_8814A + 1); - count = 0; - while (!(bcn_valid_reg & BIT(7)) && count < 20) { - count++; - delay_us(10); - bcn_valid_reg = platform_efio_read_1byte(adapter, REG_FIFOPAGE_CTRL_2_8814A + 2); - } - dl_bcn_count++; - } while (!(bcn_valid_reg & BIT(7)) && dl_bcn_count < 5); - - if (!(bcn_valid_reg & BIT(0))) - RT_DISP(FBEAM, FBEAM_ERROR, ("%s Download RSVD page failed!\n", __func__)); - - /*@0x204[11:0] Beacon Head for TXDMA*/ - platform_efio_write_2byte(adapter, REG_FIFOPAGE_CTRL_2_8814A, tx_page_bndy); - - /*To make sure that if there exists an adapter which would like to send beacon.*/ - /*@If exists, the origianl value of 0x422[6] will be 1, we should check this to*/ - /*prevent from setting 0x422[6] to 0 after download reserved page, or it will cause */ - /*the beacon cannot be sent by HW.*/ - /*@2010.06.23. Added by tynli.*/ - if (is_send_beacon) - platform_efio_write_1byte(adapter, REG_FWHW_TXQ_CTRL_8814A + 2, tmp_reg422); - - /*@Do not enable HW DMA BCN or it will cause Pcie interface hang by timing issue. 2011.11.24. by tynli.*/ - /*@Clear CR[8] or beacon packet will not be send to TxBuf anymore.*/ - u1b_tmp = platform_efio_read_1byte(adapter, REG_CR_8814A + 1); - platform_efio_write_1byte(adapter, REG_CR_8814A + 1, (u1b_tmp & (~BIT(0)))); - - p_beam_entry->beamform_entry_state = BEAMFORMING_ENTRY_STATE_PROGRESSED; - - hal_data->is_fw_dw_rsvd_page_in_progress = false; -} - -void -hal_txbf_8822b_fw_txbf_cmd( - void *adapter -) -{ - u8 idx, period = 0; - u8 PageNum0 = 0xFF, PageNum1 = 0xFF; - u8 u1_tx_bf_parm[3] = {0}; - - PMGNT_INFO mgnt_info = &(adapter->MgntInfo); - struct _RT_BEAMFORMING_INFO *beam_info = GET_BEAMFORM_INFO(adapter); - - for (idx = 0; idx < BEAMFORMEE_ENTRY_NUM; idx++) { - if (beam_info->beamformee_entry[idx].is_used && beam_info->beamformee_entry[idx].beamform_entry_state == BEAMFORMING_ENTRY_STATE_PROGRESSED) { - if (beam_info->beamformee_entry[idx].is_sound) { - PageNum0 = 0xFE; - PageNum1 = 0x07; - period = (u8)(beam_info->beamformee_entry[idx].sound_period); - } else if (PageNum0 == 0xFF) { - PageNum0 = 0xFF; /*stop sounding*/ - PageNum1 = 0x0F; - } - } - } - - u1_tx_bf_parm[0] = PageNum0; - u1_tx_bf_parm[1] = PageNum1; - u1_tx_bf_parm[2] = period; - fill_h2c_cmd(adapter, PHYDM_H2C_TXBF, 3, u1_tx_bf_parm); - - RT_DISP(FBEAM, FBEAM_FUN, ("@%s End, PageNum0 = 0x%x, PageNum1 = 0x%x period = %d", __func__, PageNum0, PageNum1, period)); -} -#endif - -#if 0 -void -hal_txbf_8822b_init( - void *dm_void -) -{ - struct dm_struct *dm = (struct dm_struct *)dm_void; - u8 u1b_tmp; - struct _RT_BEAMFORMING_INFO *beamforming_info = &dm->beamforming_info; - void *adapter = dm->adapter; - - odm_set_bb_reg(dm, R_0x14c0, BIT(16), 1); /*@Enable P1 aggr new packet according to P0 transfer time*/ - odm_set_bb_reg(dm, R_0x14c0, BIT(15) | BIT14 | BIT13 | BIT12, 10); /*@MU Retry Limit*/ - odm_set_bb_reg(dm, R_0x14c0, BIT(7), 0); /*@Disable Tx MU-MIMO until sounding done*/ - odm_set_bb_reg(dm, R_0x14c0, 0x3F, 0); /* @Clear validity of MU STAs */ - odm_write_1byte(dm, 0x167c, 0x70); /*@MU-MIMO Option as default value*/ - odm_write_2byte(dm, 0x1680, 0); /*@MU-MIMO Control as default value*/ - - /* Set MU NDPA rate & BW source */ - /* @0x42C[30] = 1 (0: from Tx desc, 1: from 0x45F) */ - u1b_tmp = odm_read_1byte(dm, 0x42C); - odm_write_1byte(dm, REG_TXBF_CTRL_8822B, (u1b_tmp | BIT(6))); - /* @0x45F[7:0] = 0x10 (rate=OFDM_6M, BW20) */ - odm_write_1byte(dm, REG_NDPA_OPT_CTRL_8822B, 0x10); - - /*Temp Settings*/ - odm_set_bb_reg(dm, R_0x6dc, 0x3F000000, 4); /*STA2's CSI rate is fixed at 6M*/ - odm_set_bb_reg(dm, R_0x1c94, MASKDWORD, 0xAFFFAFFF); /*@Grouping bitmap parameters*/ - - /* @Init HW variable */ - beamforming_info->reg_mu_tx_ctrl = odm_read_4byte(dm, 0x14c0); - - if (dm->rf_type == RF_2T2R) { /*@2T2R*/ - PHYDM_DBG(dm, DBG_TXBF, "%s: rf_type is 2T2R\n", __func__); - config_phydm_trx_mode_8822b(dm, (enum bb_path)3, (enum bb_path)3, true);/*Tx2path*/ - } - -#if (OMNIPEEK_SNIFFER_ENABLED == 1) - /* @Config HW to receive packet on the user position from registry for sniffer mode. */ - /* odm_set_bb_reg(dm, R_0xb00, BIT(9), 1);*/ /* For A-cut only. RegB00[9] = 1 (enable PMAC Rx) */ - odm_set_bb_reg(dm, R_0xb54, BIT(30), 1); /* RegB54[30] = 1 (force user position) */ - odm_set_bb_reg(dm, R_0xb54, (BIT(29) | BIT28), adapter->MgntInfo.sniff_user_position); /* RegB54[29:28] = user position (0~3) */ - PHYDM_DBG(dm, DBG_TXBF, - "Set adapter->MgntInfo.sniff_user_position=%#X\n", - adapter->MgntInfo.sniff_user_position); -#endif -} -#endif void hal_txbf_8822b_enter( void *dm_void, @@ -393,7 +159,6 @@ void hal_txbf_8822b_enter( if (beamforming_info->beamformee_su_cnt > 0 && bfee_idx < BEAMFORMEE_ENTRY_NUM) { p_beamformee_entry = &beamforming_info->beamformee_entry[bfee_idx]; p_beamformee_entry->is_mu_sta = false; - hal_txbf_8822b_rf_mode(dm, beamforming_info, bfee_idx); if (phydm_acting_determine(dm, phydm_acting_as_ibss)) sta_id = p_beamformee_entry->mac_id; @@ -596,7 +361,6 @@ void hal_txbf_8822b_enter( odm_write_1byte(dm, REG_RXFLTMAP0_8822B + 1, u1b_tmp); /* @End of MAC registers setting */ - hal_txbf_8822b_rf_mode(dm, beamforming_info, bfee_idx); #if (SUPPORT_MU_BF == 1) /*Special for plugfest*/ mdelay(50); /* wait for 4-way handshake ending*/ @@ -604,26 +368,22 @@ void hal_txbf_8822b_enter( #endif phydm_beamforming_notify(dm); -#if 1 - { - u32 ctrl_info_offset, index; - /*Set Ctrl Info*/ - odm_write_2byte(dm, 0x140, 0x660); - ctrl_info_offset = 0x8000 + 32 * p_beamformee_entry->mac_id; - /*Reset Ctrl Info*/ - for (index = 0; index < 8; index++) - odm_write_4byte(dm, ctrl_info_offset + index * 4, 0); - - odm_write_4byte(dm, ctrl_info_offset, (p_beamformee_entry->mu_reg_index + 1) << 16); - odm_write_1byte(dm, 0x81, 0x80); /*RPTBUF ready*/ - - PHYDM_DBG(dm, DBG_TXBF, - "@%s, mac_id = %d, ctrl_info_offset = 0x%x, mu_reg_index = %x\n", - __func__, p_beamformee_entry->mac_id, - ctrl_info_offset, - p_beamformee_entry->mu_reg_index); - } -#endif + u32 ctrl_info_offset, index; + /*Set Ctrl Info*/ + odm_write_2byte(dm, 0x140, 0x660); + ctrl_info_offset = 0x8000 + 32 * p_beamformee_entry->mac_id; + /*Reset Ctrl Info*/ + for (index = 0; index < 8; index++) + odm_write_4byte(dm, ctrl_info_offset + index * 4, 0); + + odm_write_4byte(dm, ctrl_info_offset, (p_beamformee_entry->mu_reg_index + 1) << 16); + odm_write_1byte(dm, 0x81, 0x80); /*RPTBUF ready*/ + + PHYDM_DBG(dm, DBG_TXBF, + "@%s, mac_id = %d, ctrl_info_offset = 0x%x, mu_reg_index = %x\n", + __func__, p_beamformee_entry->mac_id, + ctrl_info_offset, + p_beamformee_entry->mu_reg_index); } } @@ -673,7 +433,6 @@ void hal_txbf_8822b_leave( } if (p_beamformee_entry->beamform_entry_cap == BEAMFORMING_CAP_NONE) { - hal_txbf_8822b_rf_mode(dm, beamforming_info, idx); if (p_beamformee_entry->is_mu_sta == 0) { /*SU BFee*/ if (p_beamformee_entry->su_reg_index == 0) { odm_write_2byte(dm, REG_TXBF_CTRL_8822B, 0x0); @@ -762,99 +521,97 @@ void hal_txbf_8822b_status( } else { PHYDM_DBG(dm, DBG_TXBF, "@%s, MU Sounding Done\n", __func__); /*@MU sounding done */ - if (1) { /* @(beamform_entry->beamform_entry_state == BEAMFORMING_ENTRY_STATE_PROGRESSED) { */ - PHYDM_DBG(dm, DBG_TXBF, - "@%s, BEAMFORMING_ENTRY_STATE_PROGRESSED\n", - __func__); + PHYDM_DBG(dm, DBG_TXBF, + "@%s, BEAMFORMING_ENTRY_STATE_PROGRESSED\n", + __func__); + + value32 = odm_get_bb_reg(dm, R_0x1684, MASKDWORD); + is_sounding_success[0] = (value32 & BIT(10)) ? 1 : 0; + is_sounding_success[1] = (value32 & BIT(26)) ? 1 : 0; + value32 = odm_get_bb_reg(dm, R_0x1688, MASKDWORD); + is_sounding_success[2] = (value32 & BIT(10)) ? 1 : 0; + is_sounding_success[3] = (value32 & BIT(26)) ? 1 : 0; + value32 = odm_get_bb_reg(dm, R_0x168c, MASKDWORD); + is_sounding_success[4] = (value32 & BIT(10)) ? 1 : 0; + is_sounding_success[5] = (value32 & BIT(26)) ? 1 : 0; - value32 = odm_get_bb_reg(dm, R_0x1684, MASKDWORD); - is_sounding_success[0] = (value32 & BIT(10)) ? 1 : 0; - is_sounding_success[1] = (value32 & BIT(26)) ? 1 : 0; - value32 = odm_get_bb_reg(dm, R_0x1688, MASKDWORD); - is_sounding_success[2] = (value32 & BIT(10)) ? 1 : 0; - is_sounding_success[3] = (value32 & BIT(26)) ? 1 : 0; - value32 = odm_get_bb_reg(dm, R_0x168c, MASKDWORD); - is_sounding_success[4] = (value32 & BIT(10)) ? 1 : 0; - is_sounding_success[5] = (value32 & BIT(26)) ? 1 : 0; - - PHYDM_DBG(dm, DBG_TXBF, - "@%s, is_sounding_success STA1:%d, STA2:%d, STA3:%d, STA4:%d, STA5:%d, STA6:%d\n", - __func__, is_sounding_success[0], - is_sounding_success[1], - is_sounding_success[2], - is_sounding_success[3], - is_sounding_success[4], - is_sounding_success[5]); - - value32 = odm_get_bb_reg(dm, R_0xf4c, 0xFFFF0000); - /* odm_set_bb_reg(dm, R_0x19e0, MASKHWORD, 0xFFFF);Let MAC ignore bitmap */ - - is_bitmap_ready = (boolean)((value32 & BIT(15)) >> 15); - bitmap = (u16)(value32 & 0x3FFF); - - for (idx = 0; idx < 15; idx++) { - if (idx < 5) { /*@bit0~4*/ - id0 = 0; - id1 = (u8)(idx + 1); - } else if (idx < 9) { /*@bit5~8*/ - id0 = 1; - id1 = (u8)(idx - 3); - } else if (idx < 12) { /*@bit9~11*/ - id0 = 2; - id1 = (u8)(idx - 6); - } else if (idx < 14) { /*@bit12~13*/ - id0 = 3; - id1 = (u8)(idx - 8); - } else { /*@bit14*/ - id0 = 4; - id1 = (u8)(idx - 9); - } - if (bitmap & BIT(idx)) { - /*Pair 1*/ - gid = (idx << 1) + 1; - gid_valid[id0] |= (BIT(gid)); - gid_valid[id1] |= (BIT(gid)); - /*Pair 2*/ - gid += 1; - gid_valid[id0] |= (BIT(gid)); - gid_valid[id1] |= (BIT(gid)); - } else { - /*Pair 1*/ - gid = (idx << 1) + 1; - gid_valid[id0] &= ~(BIT(gid)); - gid_valid[id1] &= ~(BIT(gid)); - /*Pair 2*/ - gid += 1; - gid_valid[id0] &= ~(BIT(gid)); - gid_valid[id1] &= ~(BIT(gid)); - } + PHYDM_DBG(dm, DBG_TXBF, + "@%s, is_sounding_success STA1:%d, STA2:%d, STA3:%d, STA4:%d, STA5:%d, STA6:%d\n", + __func__, is_sounding_success[0], + is_sounding_success[1], + is_sounding_success[2], + is_sounding_success[3], + is_sounding_success[4], + is_sounding_success[5]); + + value32 = odm_get_bb_reg(dm, R_0xf4c, 0xFFFF0000); + /* odm_set_bb_reg(dm, R_0x19e0, MASKHWORD, 0xFFFF);Let MAC ignore bitmap */ + + is_bitmap_ready = (boolean)((value32 & BIT(15)) >> 15); + bitmap = (u16)(value32 & 0x3FFF); + + for (idx = 0; idx < 15; idx++) { + if (idx < 5) { /*@bit0~4*/ + id0 = 0; + id1 = (u8)(idx + 1); + } else if (idx < 9) { /*@bit5~8*/ + id0 = 1; + id1 = (u8)(idx - 3); + } else if (idx < 12) { /*@bit9~11*/ + id0 = 2; + id1 = (u8)(idx - 6); + } else if (idx < 14) { /*@bit12~13*/ + id0 = 3; + id1 = (u8)(idx - 8); + } else { /*@bit14*/ + id0 = 4; + id1 = (u8)(idx - 9); } - - for (i = 0; i < BEAMFORMEE_ENTRY_NUM; i++) { - beamform_entry = &beamforming_info->beamformee_entry[i]; - if (beamform_entry->is_mu_sta && beamform_entry->mu_reg_index < 6) { - value32 = gid_valid[beamform_entry->mu_reg_index]; - for (idx = 0; idx < 4; idx++) { - beamform_entry->gid_valid[idx] = (u8)(value32 & 0xFF); - value32 = (value32 >> 8); - } - } + if (bitmap & BIT(idx)) { + /*Pair 1*/ + gid = (idx << 1) + 1; + gid_valid[id0] |= (BIT(gid)); + gid_valid[id1] |= (BIT(gid)); + /*Pair 2*/ + gid += 1; + gid_valid[id0] |= (BIT(gid)); + gid_valid[id1] |= (BIT(gid)); + } else { + /*Pair 1*/ + gid = (idx << 1) + 1; + gid_valid[id0] &= ~(BIT(gid)); + gid_valid[id1] &= ~(BIT(gid)); + /*Pair 2*/ + gid += 1; + gid_valid[id0] &= ~(BIT(gid)); + gid_valid[id1] &= ~(BIT(gid)); } + } - for (idx = 0; idx < 6; idx++) { - beamforming_info->reg_mu_tx_ctrl &= ~(BIT(8) | BIT(9) | BIT(10)); - beamforming_info->reg_mu_tx_ctrl |= ((idx << 8) & (BIT(8) | BIT(9) | BIT(10))); - odm_write_4byte(dm, 0x14c0, beamforming_info->reg_mu_tx_ctrl); - odm_set_mac_reg(dm, R_0x14c4, MASKDWORD, gid_valid[idx]); /*set MU STA gid valid table*/ + for (i = 0; i < BEAMFORMEE_ENTRY_NUM; i++) { + beamform_entry = &beamforming_info->beamformee_entry[i]; + if (beamform_entry->is_mu_sta && beamform_entry->mu_reg_index < 6) { + value32 = gid_valid[beamform_entry->mu_reg_index]; + for (idx = 0; idx < 4; idx++) { + beamform_entry->gid_valid[idx] = (u8)(value32 & 0xFF); + value32 = (value32 >> 8); + } } + } - /*@Enable TxMU PPDU*/ - if (beamforming_info->dbg_disable_mu_tx == false) - beamforming_info->reg_mu_tx_ctrl |= BIT(7); - else - beamforming_info->reg_mu_tx_ctrl &= ~BIT(7); + for (idx = 0; idx < 6; idx++) { + beamforming_info->reg_mu_tx_ctrl &= ~(BIT(8) | BIT(9) | BIT(10)); + beamforming_info->reg_mu_tx_ctrl |= ((idx << 8) & (BIT(8) | BIT(9) | BIT(10))); odm_write_4byte(dm, 0x14c0, beamforming_info->reg_mu_tx_ctrl); + odm_set_mac_reg(dm, R_0x14c4, MASKDWORD, gid_valid[idx]); /*set MU STA gid valid table*/ } + + /*@Enable TxMU PPDU*/ + if (beamforming_info->dbg_disable_mu_tx == false) + beamforming_info->reg_mu_tx_ctrl |= BIT(7); + else + beamforming_info->reg_mu_tx_ctrl &= ~BIT(7); + odm_write_4byte(dm, 0x14c0, beamforming_info->reg_mu_tx_ctrl); } } @@ -925,85 +682,6 @@ void hal_txbf_8822b_config_gtab( odm_write_4byte(dm, 0x14c0, beamforming_info->reg_mu_tx_ctrl); } -#if 0 -/*This function translate the bitmap to GTAB*/ -void -haltxbf8822b_gtab_translation( - struct dm_struct *dm -) -{ - u8 idx, gid; - u8 id1, id0; - u32 gid_valid[6] = {0}; - u32 user_position_lsb[6] = {0}; - u32 user_position_msb[6] = {0}; - - for (idx = 0; idx < 15; idx++) { - if (idx < 5) {/*@bit0~4*/ - id0 = 0; - id1 = (u8)(idx + 1); - } else if (idx < 9) { /*@bit5~8*/ - id0 = 1; - id1 = (u8)(idx - 3); - } else if (idx < 12) { /*@bit9~11*/ - id0 = 2; - id1 = (u8)(idx - 6); - } else if (idx < 14) { /*@bit12~13*/ - id0 = 3; - id1 = (u8)(idx - 8); - } else { /*@bit14*/ - id0 = 4; - id1 = (u8)(idx - 9); - } - - /*Pair 1*/ - gid = (idx << 1) + 1; - gid_valid[id0] |= (1 << gid); - gid_valid[id1] |= (1 << gid); - if (gid < 16) { - /*user_position_lsb[id0] |= (0 << (gid << 1));*/ - user_position_lsb[id1] |= (1 << (gid << 1)); - } else { - /*user_position_msb[id0] |= (0 << ((gid - 16) << 1));*/ - user_position_msb[id1] |= (1 << ((gid - 16) << 1)); - } - - /*Pair 2*/ - gid += 1; - gid_valid[id0] |= (1 << gid); - gid_valid[id1] |= (1 << gid); - if (gid < 16) { - user_position_lsb[id0] |= (1 << (gid << 1)); - /*user_position_lsb[id1] |= (0 << (gid << 1));*/ - } else { - user_position_msb[id0] |= (1 << ((gid - 16) << 1)); - /*user_position_msb[id1] |= (0 << ((gid - 16) << 1));*/ - } - } - - - for (idx = 0; idx < 6; idx++) { - /*@dbg_print("gid_valid[%d] = 0x%x\n", idx, gid_valid[idx]); - dbg_print("user_position[%d] = 0x%x %x\n", idx, user_position_msb[idx], user_position_lsb[idx]);*/ - } -} -#endif - -void hal_txbf_8822b_fw_txbf( - void *dm_void, - u8 idx) -{ -#if 0 - struct _RT_BEAMFORMING_INFO *beam_info = GET_BEAMFORM_INFO(adapter); - struct _RT_BEAMFORMEE_ENTRY *p_beam_entry = beam_info->beamformee_entry + idx; - - if (p_beam_entry->beamform_entry_state == BEAMFORMING_ENTRY_STATE_PROGRESSING) - hal_txbf_8822b_download_ndpa(adapter, idx); - - hal_txbf_8822b_fw_txbf_cmd(adapter); -#endif -} - #endif #if (defined(CONFIG_BB_TXBF_API)) diff --git a/hal/phydm/txbf/haltxbf8822b.h b/hal/phydm/txbf/haltxbf8822b.h index 552fba2a..c41949af 100644 --- a/hal/phydm/txbf/haltxbf8822b.h +++ b/hal/phydm/txbf/haltxbf8822b.h @@ -43,14 +43,10 @@ void hal_txbf_8822b_status( void hal_txbf_8822b_config_gtab( void *dm_void); -void hal_txbf_8822b_fw_txbf( - void *dm_void, - u8 idx); #else #define hal_txbf_8822b_enter(dm_void, idx) #define hal_txbf_8822b_leave(dm_void, idx) #define hal_txbf_8822b_status(dm_void, idx) -#define hal_txbf_8822b_fw_txbf(dm_void, idx) #define hal_txbf_8822b_config_gtab(dm_void) #endif @@ -71,7 +67,6 @@ void phydm_8822b_sutxbfer_workaroud(void *dm_void, boolean enable_su_bfer, #define hal_txbf_8822b_enter(dm_void, idx) #define hal_txbf_8822b_leave(dm_void, idx) #define hal_txbf_8822b_status(dm_void, idx) -#define hal_txbf_8822b_fw_txbf(dm_void, idx) #define hal_txbf_8822b_config_gtab(dm_void) #endif diff --git a/hal/rtl8192e/rtl8192e_cmd.c b/hal/rtl8192e/rtl8192e_cmd.c index 6a92938c..f8cc7085 100644 --- a/hal/rtl8192e/rtl8192e_cmd.c +++ b/hal/rtl8192e/rtl8192e_cmd.c @@ -436,8 +436,6 @@ void rtl8192e_set_p2p_ps_offload_cmd(_adapter *padapter, u8 p2p_ps_state) u8 i; - -#if 1 switch (p2p_ps_state) { case P2P_PS_DISABLE: RTW_INFO("P2P_PS_DISABLE\n"); @@ -507,285 +505,11 @@ void rtl8192e_set_p2p_ps_offload_cmd(_adapter *padapter, u8 p2p_ps_state) RTW_INFO("P2P_PS_OFFLOAD : %x\n", p2p_ps_offload[0]); FillH2CCmd_8192E(padapter, H2C_8192E_P2P_PS_OFFLOAD, 1, p2p_ps_offload); -#endif - } #endif /* CONFIG_P2P */ - -#if 0 -u1Byte -hw_rate_to_m_rate( - IN u1Byte rate -) -{ - u1Byte ret_rate = MGN_1M; - - switch (rate) { - - case DESC_RATE1M: - ret_rate = MGN_1M; - break; - case DESC_RATE2M: - ret_rate = MGN_2M; - break; - case DESC_RATE5_5M: - ret_rate = MGN_5_5M; - break; - case DESC_RATE11M: - ret_rate = MGN_11M; - break; - case DESC_RATE6M: - ret_rate = MGN_6M; - break; - case DESC_RATE9M: - ret_rate = MGN_9M; - break; - case DESC_RATE12M: - ret_rate = MGN_12M; - break; - case DESC_RATE18M: - ret_rate = MGN_18M; - break; - case DESC_RATE24M: - ret_rate = MGN_24M; - break; - case DESC_RATE36M: - ret_rate = MGN_36M; - break; - case DESC_RATE48M: - ret_rate = MGN_48M; - break; - case DESC_RATE54M: - ret_rate = MGN_54M; - break; - case DESC_RATEMCS0: - ret_rate = MGN_MCS0; - break; - case DESC_RATEMCS1: - ret_rate = MGN_MCS1; - break; - case DESC_RATEMCS2: - ret_rate = MGN_MCS2; - break; - case DESC_RATEMCS3: - ret_rate = MGN_MCS3; - break; - case DESC_RATEMCS4: - ret_rate = MGN_MCS4; - break; - case DESC_RATEMCS5: - ret_rate = MGN_MCS5; - break; - case DESC_RATEMCS6: - ret_rate = MGN_MCS6; - break; - case DESC_RATEMCS7: - ret_rate = MGN_MCS7; - break; - case DESC_RATEMCS8: - ret_rate = MGN_MCS8; - break; - case DESC_RATEMCS9: - ret_rate = MGN_MCS9; - break; - case DESC_RATEMCS10: - ret_rate = MGN_MCS10; - break; - case DESC_RATEMCS11: - ret_rate = MGN_MCS11; - break; - case DESC_RATEMCS12: - ret_rate = MGN_MCS12; - break; - case DESC_RATEMCS13: - ret_rate = MGN_MCS13; - break; - case DESC_RATEMCS14: - ret_rate = MGN_MCS14; - break; - case DESC_RATEMCS15: - ret_rate = MGN_MCS15; - break; - case DESC_RATEMCS16: - ret_rate = MGN_MCS16; - break; - case DESC_RATEMCS17: - ret_rate = MGN_MCS17; - break; - case DESC_RATEMCS18: - ret_rate = MGN_MCS18; - break; - case DESC_RATEMCS19: - ret_rate = MGN_MCS19; - break; - case DESC_RATEMCS20: - ret_rate = MGN_MCS20; - break; - case DESC_RATEMCS21: - ret_rate = MGN_MCS21; - break; - case DESC_RATEMCS22: - ret_rate = MGN_MCS22; - break; - case DESC_RATEMCS23: - ret_rate = MGN_MCS23; - break; - case DESC_RATEMCS24: - ret_rate = MGN_MCS24; - break; - case DESC_RATEMCS25: - ret_rate = MGN_MCS25; - break; - case DESC_RATEMCS26: - ret_rate = MGN_MCS26; - break; - case DESC_RATEMCS27: - ret_rate = MGN_MCS27; - break; - case DESC_RATEMCS28: - ret_rate = MGN_MCS28; - break; - case DESC_RATEMCS29: - ret_rate = MGN_MCS29; - break; - case DESC_RATEMCS30: - ret_rate = MGN_MCS30; - break; - case DESC_RATEMCS31: - ret_rate = MGN_MCS31; - break; - case DESC_RATEVHTSS1MCS0: - ret_rate = MGN_VHT1SS_MCS0; - break; - case DESC_RATEVHTSS1MCS1: - ret_rate = MGN_VHT1SS_MCS1; - break; - case DESC_RATEVHTSS1MCS2: - ret_rate = MGN_VHT1SS_MCS2; - break; - case DESC_RATEVHTSS1MCS3: - ret_rate = MGN_VHT1SS_MCS3; - break; - case DESC_RATEVHTSS1MCS4: - ret_rate = MGN_VHT1SS_MCS4; - break; - case DESC_RATEVHTSS1MCS5: - ret_rate = MGN_VHT1SS_MCS5; - break; - case DESC_RATEVHTSS1MCS6: - ret_rate = MGN_VHT1SS_MCS6; - break; - case DESC_RATEVHTSS1MCS7: - ret_rate = MGN_VHT1SS_MCS7; - break; - case DESC_RATEVHTSS1MCS8: - ret_rate = MGN_VHT1SS_MCS8; - break; - case DESC_RATEVHTSS1MCS9: - ret_rate = MGN_VHT1SS_MCS9; - break; - case DESC_RATEVHTSS2MCS0: - ret_rate = MGN_VHT2SS_MCS0; - break; - case DESC_RATEVHTSS2MCS1: - ret_rate = MGN_VHT2SS_MCS1; - break; - case DESC_RATEVHTSS2MCS2: - ret_rate = MGN_VHT2SS_MCS2; - break; - case DESC_RATEVHTSS2MCS3: - ret_rate = MGN_VHT2SS_MCS3; - break; - case DESC_RATEVHTSS2MCS4: - ret_rate = MGN_VHT2SS_MCS4; - break; - case DESC_RATEVHTSS2MCS5: - ret_rate = MGN_VHT2SS_MCS5; - break; - case DESC_RATEVHTSS2MCS6: - ret_rate = MGN_VHT2SS_MCS6; - break; - case DESC_RATEVHTSS2MCS7: - ret_rate = MGN_VHT2SS_MCS7; - break; - case DESC_RATEVHTSS2MCS8: - ret_rate = MGN_VHT2SS_MCS8; - break; - case DESC_RATEVHTSS2MCS9: - ret_rate = MGN_VHT2SS_MCS9; - break; - case DESC_RATEVHTSS3MCS0: - ret_rate = MGN_VHT3SS_MCS0; - break; - case DESC_RATEVHTSS3MCS1: - ret_rate = MGN_VHT3SS_MCS1; - break; - case DESC_RATEVHTSS3MCS2: - ret_rate = MGN_VHT3SS_MCS2; - break; - case DESC_RATEVHTSS3MCS3: - ret_rate = MGN_VHT3SS_MCS3; - break; - case DESC_RATEVHTSS3MCS4: - ret_rate = MGN_VHT3SS_MCS4; - break; - case DESC_RATEVHTSS3MCS5: - ret_rate = MGN_VHT3SS_MCS5; - break; - case DESC_RATEVHTSS3MCS6: - ret_rate = MGN_VHT3SS_MCS6; - break; - case DESC_RATEVHTSS3MCS7: - ret_rate = MGN_VHT3SS_MCS7; - break; - case DESC_RATEVHTSS3MCS8: - ret_rate = MGN_VHT3SS_MCS8; - break; - case DESC_RATEVHTSS3MCS9: - ret_rate = MGN_VHT3SS_MCS9; - break; - case DESC_RATEVHTSS4MCS0: - ret_rate = MGN_VHT4SS_MCS0; - break; - case DESC_RATEVHTSS4MCS1: - ret_rate = MGN_VHT4SS_MCS1; - break; - case DESC_RATEVHTSS4MCS2: - ret_rate = MGN_VHT4SS_MCS2; - break; - case DESC_RATEVHTSS4MCS3: - ret_rate = MGN_VHT4SS_MCS3; - break; - case DESC_RATEVHTSS4MCS4: - ret_rate = MGN_VHT4SS_MCS4; - break; - case DESC_RATEVHTSS4MCS5: - ret_rate = MGN_VHT4SS_MCS5; - break; - case DESC_RATEVHTSS4MCS6: - ret_rate = MGN_VHT4SS_MCS6; - break; - case DESC_RATEVHTSS4MCS7: - ret_rate = MGN_VHT4SS_MCS7; - break; - case DESC_RATEVHTSS4MCS8: - ret_rate = MGN_VHT4SS_MCS8; - break; - case DESC_RATEVHTSS4MCS9: - ret_rate = MGN_VHT4SS_MCS9; - break; - - default: - break; - } - return ret_rate; -} - -#endif - void dump_txrpt_ccx_92e(IN u8 *CmdBuf) { u8 MacID, Unicast, LifeTimeOver, RetryOver, DataRetryCount, QueueTimeUs, FinalDataRateIndex; diff --git a/hal/rtl8192e/rtl8192e_dm.c b/hal/rtl8192e/rtl8192e_dm.c index 52a4a431..7cdd36f7 100644 --- a/hal/rtl8192e/rtl8192e_dm.c +++ b/hal/rtl8192e/rtl8192e_dm.c @@ -133,25 +133,6 @@ dm_InterruptMigration( pHalData->bInterruptMigration = IntMtToSet; } } - -#if 0 - if (bCurrentACIntDisable != ACIntToSet) { - RTW_INFO("%s(): Update AC interrrupt(%d)\n", __FUNCTION__, ACIntToSet); - if (ACIntToSet) { /* Disable four ACs interrupts. */ - /* */ - /* Disable VO, VI, BE and BK four AC interrupts to gain more efficient CPU utilization. */ - /* When extremely highly Rx OK occurs, we will disable Tx interrupts. */ - /* 2010.03.05. */ - /* */ - UpdateInterruptMask8192CE(Adapter, 0, RT_AC_INT_MASKS); - pHalData->bDisableTxInt = ACIntToSet; - } else { /* Enable four ACs interrupts. */ - UpdateInterruptMask8192CE(Adapter, RT_AC_INT_MASKS, 0); - pHalData->bDisableTxInt = ACIntToSet; - } - } -#endif - } #endif diff --git a/hal/rtl8192e/rtl8192e_hal_init.c b/hal/rtl8192e/rtl8192e_hal_init.c index 63aed1b8..86ae9be8 100644 --- a/hal/rtl8192e/rtl8192e_hal_init.c +++ b/hal/rtl8192e/rtl8192e_hal_init.c @@ -72,7 +72,7 @@ s32 InitLLTTable8192E(PADAPTER padapter, u8 txpktbuf_bndy) u32 value32; systime start = 0; u32 passing_time = 0; -#if 1 + value32 = rtw_read32(padapter, REG_AUTO_LLT); rtw_write32(padapter, REG_AUTO_LLT, value32 | BIT_AUTO_INIT_LLT); @@ -88,33 +88,6 @@ s32 InitLLTTable8192E(PADAPTER padapter, u8 txpktbuf_bndy) RTW_INFO("Auto %s success\n", __FUNCTION__); status = _SUCCESS; } - -#else - for (i = 0; i < (txpktbuf_bndy - 1); i++) { - status = _LLTWrite(padapter, i, i + 1); - if (_SUCCESS != status) - return status; - } - - /* end of list */ - status = _LLTWrite(padapter, (txpktbuf_bndy - 1), 0xFF); - if (_SUCCESS != status) - return status; - - /* Make the other pages as ring buffer */ - /* This ring buffer is used as beacon buffer if we config this MAC as two MAC transfer. */ - /* Otherwise used as local loopback buffer. */ - for (i = txpktbuf_bndy; i < Last_Entry_Of_TxPktBuf; i++) { - status = _LLTWrite(padapter, i, (i + 1)); - if (_SUCCESS != status) - return status; - } - - /* Let last entry point to the start entry of ring buffer */ - status = _LLTWrite(padapter, Last_Entry_Of_TxPktBuf, txpktbuf_bndy); - if (_SUCCESS != status) - return status; -#endif return status; } @@ -944,15 +917,6 @@ Hal_ReadPAType_8192E( pHalData->ExternalPA_2G = (GetRegAmplifierType2G(Adapter) & ODM_BOARD_EXT_PA) ? 1 : 0; pHalData->ExternalLNA_2G = (GetRegAmplifierType2G(Adapter) & ODM_BOARD_EXT_LNA) ? 1 : 0; } -#if 0 - if (GetRegAmplifierType5G(Adapter) == 0) { /* AUTO */ - pHalData->external_pa_5g = ((pHalData->PAType_5G & BIT1) && (pHalData->PAType_5G & BIT0)) ? 1 : 0; - pHalData->external_lna_5g = ((pHalData->LNAType_5G & BIT7) && (pHalData->LNAType_5G & BIT3)) ? 1 : 0; /* 5G only now. */ - } else { - pHalData->external_pa_5g = (GetRegAmplifierType5G(Adapter) & ODM_BOARD_EXT_PA_5G) ? 1 : 0; - pHalData->external_lna_5g = (GetRegAmplifierType5G(Adapter) & ODM_BOARD_EXT_LNA_5G) ? 1 : 0; - } -#endif } else { pHalData->ExternalPA_2G = EEPROM_Default_PAType; @@ -967,15 +931,6 @@ Hal_ReadPAType_8192E( pHalData->ExternalPA_2G = (GetRegAmplifierType2G(Adapter) & ODM_BOARD_EXT_PA) ? 1 : 0; pHalData->ExternalLNA_2G = (GetRegAmplifierType2G(Adapter) & ODM_BOARD_EXT_LNA) ? 1 : 0; } -#if 0 - if (GetRegAmplifierType5G(Adapter) == 0) { /* AUTO */ - pHalData->external_pa_5g = 0; - pHalData->external_lna_5g = 0; - } else { - pHalData->external_pa_5g = (GetRegAmplifierType5G(Adapter) & ODM_BOARD_EXT_PA_5G) ? 1 : 0; - pHalData->external_lna_5g = (GetRegAmplifierType5G(Adapter) & ODM_BOARD_EXT_LNA_5G) ? 1 : 0; - } -#endif } RTW_INFO("pHalData->ExternalPA_2G = %d , pHalData->ExternalLNA_2G = %d\n", pHalData->ExternalPA_2G, pHalData->ExternalLNA_2G); @@ -1825,378 +1780,6 @@ rtl8192E_Efuse_PgPacketRead(IN PADAPTER pAdapter, return ret; } -#if 0 -int -hal_EfusePgPacketWrite_8192E(IN PADAPTER pAdapter, - IN u8 offset, - IN u8 word_en, - IN u8 *data, - IN BOOLEAN bPseudoTest) -{ - u8 WriteState = PG_STATE_HEADER; - - int bContinual = _TRUE, bDataEmpty = _TRUE; - /* int bResult = _TRUE; */ - u16 efuse_addr = 0; - u8 efuse_data; - - u8 pg_header = 0, pg_header_temp = 0; - - u8 tmp_word_cnts = 0, target_word_cnts = 0; - u8 tmp_header, match_word_en, tmp_word_en; - - PGPKT_STRUCT target_pkt; - PGPKT_STRUCT tmp_pkt; - - u8 originaldata[sizeof(u8) * 8]; - u8 tmpindex = 0, badworden = 0x0F; - - static int repeat_times = 0; - - BOOLEAN bExtendedHeader = _FALSE; - u8 efuseType = EFUSE_WIFI; - - /* */ - /* Efuse has been pre-programmed dummy 5Bytes at the end of Efuse by CP. */ - /* So we have to prevent unexpected data string connection, which will cause */ - /* incorrect data auto-load from HW. The total size is equal or smaller than 498bytes */ - /* (i.e., offset 0~497, and dummy 1bytes) expected after CP test. */ - /* 2009.02.19. */ - /* */ - if (Efuse_GetCurrentSize(pAdapter, efuseType, bPseudoTest) >= (EFUSE_REAL_CONTENT_LEN_8192E-EFUSE_OOB_PROTECT_BYTES_8192E)) { - RTW_INFO("hal_EfusePgPacketWrite_8812A() error: %x >= %x\n", Efuse_GetCurrentSize(pAdapter, efuseType, bPseudoTest), (EFUSE_REAL_CONTENT_LEN_8192E-EFUSE_OOB_PROTECT_BYTES_8192E)); - return _FALSE; - } - - /* Init the 8 bytes content as 0xff */ - target_pkt.offset = offset; - target_pkt.word_en = word_en; - /* Initial the value to avoid compile warning */ - tmp_pkt.offset = 0; - tmp_pkt.word_en = 0; - - /* RTW_INFO("hal_EfusePgPacketWrite_8812A target offset 0x%x word_en 0x%x\n", target_pkt.offset, target_pkt.word_en); */ - - memset((PVOID)target_pkt.data, 0xFF, sizeof(u8) * 8); - - efuse_WordEnableDataRead(word_en, data, target_pkt.data); - target_word_cnts = Efuse_CalculateWordCnts(target_pkt.word_en); - - /* efuse_reg_ctrl(pAdapter,_TRUE); */ /* power on */ - /* RTW_INFO("EFUSE Power ON\n"); */ - - /* */ - /* Efuse has been pre-programmed dummy 5Bytes at the end of Efuse by CP. */ - /* So we have to prevent unexpected data string connection, which will cause */ - /* incorrect data auto-load from HW. Dummy 1bytes is additional. */ - /* 2009.02.19. */ - /* */ - while (bContinual && (efuse_addr < (EFUSE_REAL_CONTENT_LEN_8192E-EFUSE_OOB_PROTECT_BYTES_8192E))) { - if (WriteState == PG_STATE_HEADER) { - bDataEmpty = _TRUE; - badworden = 0x0F; - /* ************ so ******************* */ - /* RTW_INFO("EFUSE PG_STATE_HEADER\n"); */ - if (efuse_OneByteRead(pAdapter, efuse_addr , &efuse_data, bPseudoTest) && - (efuse_data != 0xFF)) { - if ((efuse_data & 0x1F) == 0x0F) { /* extended header */ - tmp_header = efuse_data; - efuse_addr++; - efuse_OneByteRead(pAdapter, efuse_addr , &efuse_data, bPseudoTest); - if ((efuse_data & 0x0F) == 0x0F) { /* wren fail */ - efuse_addr++; - continue; - } else { - tmp_pkt.offset = ((tmp_header & 0xE0) >> 5) | ((efuse_data & 0xF0) >> 1); - tmp_pkt.word_en = efuse_data & 0x0F; - } - } else { - tmp_header = efuse_data; - tmp_pkt.offset = (tmp_header >> 4) & 0x0F; - tmp_pkt.word_en = tmp_header & 0x0F; - } - tmp_word_cnts = Efuse_CalculateWordCnts(tmp_pkt.word_en); - - /* RTW_INFO("section offset 0x%x worden 0x%x\n", tmp_pkt.offset, tmp_pkt.word_en); */ - - /* ************ so-1 ******************* */ - if (tmp_pkt.offset != target_pkt.offset) { - efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; /* Next pg_packet */ -#if (EFUSE_ERROE_HANDLE == 1) - WriteState = PG_STATE_HEADER; -#endif - } else { /* write the same offset */ - /* RTW_INFO("hal_EfusePgPacketWrite_8812A section offset the same\n"); */ - /* ************ so-2 ******************* */ - for (tmpindex = 0 ; tmpindex < (tmp_word_cnts * 2) ; tmpindex++) { - if (efuse_OneByteRead(pAdapter, (efuse_addr + 1 + tmpindex) , &efuse_data, bPseudoTest) && (efuse_data != 0xFF)) - bDataEmpty = _FALSE; - } - /* ************ so-2-1 ******************* */ - if (bDataEmpty == _FALSE) { - /* RTW_INFO("hal_EfusePgPacketWrite_8812A section offset the same and data is NOT empty\n"); */ - - efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; /* Next pg_packet */ -#if (EFUSE_ERROE_HANDLE == 1) - WriteState = PG_STATE_HEADER; -#endif - } else { - /* ************ so-2-2 ******************* */ - /* RTW_INFO("hal_EfusePgPacketWrite_8812A section data empty\n"); */ - match_word_en = 0x0F; /* same bit as original wren */ - if (!((target_pkt.word_en & BIT0) | (tmp_pkt.word_en & BIT0))) - match_word_en &= (~BIT0); - if (!((target_pkt.word_en & BIT1) | (tmp_pkt.word_en & BIT1))) - match_word_en &= (~BIT1); - if (!((target_pkt.word_en & BIT2) | (tmp_pkt.word_en & BIT2))) - match_word_en &= (~BIT2); - if (!((target_pkt.word_en & BIT3) | (tmp_pkt.word_en & BIT3))) - match_word_en &= (~BIT3); - - /* ************ so-2-2-A ******************* */ - if ((match_word_en & 0x0F) != 0x0F) { - badworden = Efuse_WordEnableDataWrite(pAdapter, efuse_addr + 1, tmp_pkt.word_en , target_pkt.data, bPseudoTest); - - /* ************ so-2-2-A-1 ******************* */ - /* ############################ */ - if (0x0F != (badworden & 0x0F)) { - u8 reorg_offset = offset; - u8 reorg_worden = badworden; - Efuse_PgPacketWrite(pAdapter, reorg_offset, reorg_worden, target_pkt.data, bPseudoTest); - } - /* ############################ */ - - tmp_word_en = 0x0F; /* not the same bit as original wren */ - if ((target_pkt.word_en & BIT0) ^ (match_word_en & BIT0)) - tmp_word_en &= (~BIT0); - if ((target_pkt.word_en & BIT1) ^ (match_word_en & BIT1)) - tmp_word_en &= (~BIT1); - if ((target_pkt.word_en & BIT2) ^ (match_word_en & BIT2)) - tmp_word_en &= (~BIT2); - if ((target_pkt.word_en & BIT3) ^ (match_word_en & BIT3)) - tmp_word_en &= (~BIT3); - - /* ************ so-2-2-A-2 ******************* */ - if ((tmp_word_en & 0x0F) != 0x0F) { - /* reorganize other pg packet - * efuse_addr = efuse_addr + (2*tmp_word_cnts) +1; */ /* next pg packet addr */ - efuse_addr = Efuse_GetCurrentSize(pAdapter, efuseType, bPseudoTest); - /* =========================== */ - target_pkt.offset = offset; - target_pkt.word_en = tmp_word_en; - /* =========================== */ - } else - bContinual = _FALSE; -#if (EFUSE_ERROE_HANDLE == 1) - WriteState = PG_STATE_HEADER; - repeat_times++; - if (repeat_times > EFUSE_REPEAT_THRESHOLD_) { - bContinual = _FALSE; - /* bResult = _FALSE; */ - } -#endif - } else { /* ************ so-2-2-B ******************* */ - /* reorganize other pg packet */ - efuse_addr = efuse_addr + (2 * tmp_word_cnts) + 1; /* next pg packet addr */ - /* =========================== */ - target_pkt.offset = offset; - target_pkt.word_en = target_pkt.word_en; - /* =========================== */ -#if (EFUSE_ERROE_HANDLE == 1) - WriteState = PG_STATE_HEADER; -#endif - } - } - } - RTW_INFO("EFUSE PG_STATE_HEADER-1\n"); - } else { /* ************ s1: header == oxff ******************* */ - bExtendedHeader = _FALSE; - - if (target_pkt.offset >= EFUSE_MAX_SECTION_BASE) { - pg_header = ((target_pkt.offset & 0x07) << 5) | 0x0F; - - /* RTW_INFO("hal_EfusePgPacketWrite_8812A extended pg_header[2:0] |0x0F 0x%x\n", pg_header); */ - - efuse_OneByteWrite(pAdapter, efuse_addr, pg_header, bPseudoTest); - phy_set_mac_reg(pAdapter, EFUSE_TEST, BIT26, 0); - - efuse_OneByteRead(pAdapter, efuse_addr, &tmp_header, bPseudoTest); - phy_set_mac_reg(pAdapter, EFUSE_TEST, BIT26, 1); - - while (tmp_header == 0xFF) { - /* RTW_INFO("hal_EfusePgPacketWrite_8812A extended pg_header[2:0] wirte fail\n"); */ - - repeat_times++; - - if (repeat_times > EFUSE_REPEAT_THRESHOLD_) { - bContinual = _FALSE; - /* bResult = _FALSE; */ - efuse_addr++; - break; - } - efuse_OneByteWrite(pAdapter, efuse_addr, pg_header, bPseudoTest); - efuse_OneByteRead(pAdapter, efuse_addr, &tmp_header, bPseudoTest); - } - - if (!bContinual) - break; - - if (tmp_header == pg_header) { - efuse_addr++; - pg_header_temp = pg_header; - pg_header = ((target_pkt.offset & 0x78) << 1) | target_pkt.word_en; - - /* RTW_INFO("hal_EfusePgPacketWrite_8812A extended pg_header[6:3] | worden 0x%x word_en 0x%x\n", pg_header, target_pkt.word_en); */ - - efuse_OneByteWrite(pAdapter, efuse_addr, pg_header, bPseudoTest); - phy_set_mac_reg(pAdapter, EFUSE_TEST, BIT26, 0); - - efuse_OneByteRead(pAdapter, efuse_addr, &tmp_header, bPseudoTest); - phy_set_mac_reg(pAdapter, EFUSE_TEST, BIT26, 1); - - while (tmp_header == 0xFF) { - repeat_times++; - - if (repeat_times > EFUSE_REPEAT_THRESHOLD_) { - bContinual = _FALSE; - /* bResult = _FALSE; */ - break; - } - efuse_OneByteWrite(pAdapter, efuse_addr, pg_header, bPseudoTest); - efuse_OneByteRead(pAdapter, efuse_addr, &tmp_header, bPseudoTest); - } - - if (!bContinual) - break; - - if ((tmp_header & 0x0F) == 0x0F) { /* wren PG fail */ - repeat_times++; - - if (repeat_times > EFUSE_REPEAT_THRESHOLD_) { - bContinual = _FALSE; - /* bResult = _FALSE; */ - break; - } else { - efuse_addr++; - continue; - } - } else if (pg_header != tmp_header) { /* offset PG fail */ - bExtendedHeader = _TRUE; - tmp_pkt.offset = ((pg_header_temp & 0xE0) >> 5) | ((tmp_header & 0xF0) >> 1); - tmp_pkt.word_en = tmp_header & 0x0F; - tmp_word_cnts = Efuse_CalculateWordCnts(tmp_pkt.word_en); - } - } else if ((tmp_header & 0x1F) == 0x0F) { /* wrong extended header */ - efuse_addr += 2; - continue; - } - } else { - pg_header = ((target_pkt.offset << 4) & 0xf0) | target_pkt.word_en; - efuse_OneByteWrite(pAdapter, efuse_addr, pg_header, bPseudoTest); - efuse_OneByteRead(pAdapter, efuse_addr, &tmp_header, bPseudoTest); - } - - if (tmp_header == pg_header) { - /* ************ s1-1******************* */ - WriteState = PG_STATE_DATA; - } -#if (EFUSE_ERROE_HANDLE == 1) - else if (tmp_header == 0xFF) { /* ************ s1-3: if Write or read func doesn't work ******************* */ - /* efuse_addr doesn't change */ - WriteState = PG_STATE_HEADER; - repeat_times++; - if (repeat_times > EFUSE_REPEAT_THRESHOLD_) { - bContinual = _FALSE; - /* bResult = _FALSE; */ - } - } -#endif - else { - /* ************ s1-2 : fixed the header procedure ******************* */ - if (!bExtendedHeader) { - tmp_pkt.offset = (tmp_header >> 4) & 0x0F; - tmp_pkt.word_en = tmp_header & 0x0F; - tmp_word_cnts = Efuse_CalculateWordCnts(tmp_pkt.word_en); - } - - /* ************ s1-2-A :cover the exist data ******************* */ - memset(originaldata, 0xff, sizeof(u8) * 8); - - if (Efuse_PgPacketRead(pAdapter, tmp_pkt.offset, originaldata, bPseudoTest)) { - /* check if data exist */ - /* efuse_reg_ctrl(pAdapter,_TRUE); */ /* power on */ - badworden = Efuse_WordEnableDataWrite(pAdapter, efuse_addr + 1, tmp_pkt.word_en, originaldata, bPseudoTest); - /* ############################ */ - if (0x0F != (badworden & 0x0F)) { - u8 reorg_offset = tmp_pkt.offset; - u8 reorg_worden = badworden; - Efuse_PgPacketWrite(pAdapter, reorg_offset, reorg_worden, originaldata, bPseudoTest); - efuse_addr = Efuse_GetCurrentSize(pAdapter, efuseType, bPseudoTest); - } - /* ############################ */ - else { - efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; /* Next pg_packet */ - } - } - /* ************ s1-2-B: wrong address******************* */ - else { - efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; /* Next pg_packet */ - } - -#if (EFUSE_ERROE_HANDLE == 1) - WriteState = PG_STATE_HEADER; - repeat_times++; - if (repeat_times > EFUSE_REPEAT_THRESHOLD_) { - bContinual = _FALSE; - /* bResult = _FALSE; */ - } -#endif - - /* RTW_INFO("EFUSE PG_STATE_HEADER-2\n"); */ - } - - } - - } - /* write data state */ - else if (WriteState == PG_STATE_DATA) { - /* ************ s1-1 ******************* */ - /* RTW_INFO("EFUSE PG_STATE_DATA\n"); */ - badworden = 0x0f; - badworden = Efuse_WordEnableDataWrite(pAdapter, efuse_addr + 1, target_pkt.word_en, target_pkt.data, bPseudoTest); - if ((badworden & 0x0F) == 0x0F) { - /* ************ s1-1-A ******************* */ - bContinual = _FALSE; - } else { - /* reorganize other pg packet */ /* ************ s1-1-B ******************* */ - efuse_addr = efuse_addr + (2 * target_word_cnts) + 1; /* next pg packet addr */ - - /* =========================== */ - target_pkt.offset = offset; - target_pkt.word_en = badworden; - target_word_cnts = Efuse_CalculateWordCnts(target_pkt.word_en); - /* =========================== */ -#if (EFUSE_ERROE_HANDLE == 1) - WriteState = PG_STATE_HEADER; - repeat_times++; - if (repeat_times > EFUSE_REPEAT_THRESHOLD_) { - bContinual = _FALSE; - /* bResult = _FALSE; */ - } -#endif - /* RTW_INFO("EFUSE PG_STATE_HEADER-3\n"); */ - } - } - } - - if (efuse_addr >= (EFUSE_REAL_CONTENT_LEN_8192E-EFUSE_OOB_PROTECT_BYTES_8192E)) - RTW_INFO("hal_EfusePgPacketWrite_8812A(): efuse_addr(%#x) Out of size!!\n", efuse_addr); - /* efuse_reg_ctrl(pAdapter,_FALSE); */ /* power off */ - - return _TRUE; -} -#else - BOOLEAN efuse_PgPacketCheck( PADAPTER pAdapter, u8 efuseType, @@ -2793,9 +2376,6 @@ hal_EfusePgPacketWrite_8192E(IN PADAPTER pAdapter, return _TRUE; } -#endif - - static int rtl8192E_Efuse_PgPacketWrite(IN PADAPTER pAdapter, IN u8 offset, @@ -2849,13 +2429,6 @@ static void hw_var_set_monitor(PADAPTER Adapter, u8 variable, u8 *val) /* Append FCS */ rcr_bits |= RCR_APPFCS; #endif -#if 0 - /* - CRC and ICV packet will drop in recvbuf2recvframe() - We no turn on it. - */ - rcr_bits |= (RCR_ACRC32 | RCR_AICV); -#endif rtw_hal_get_hwreg(Adapter, HW_VAR_RCR, (u8 *)&pHalData->rcr_backup); rtw_hal_set_hwreg(Adapter, HW_VAR_RCR, (u8 *)&rcr_bits); @@ -2864,10 +2437,6 @@ static void hw_var_set_monitor(PADAPTER Adapter, u8 variable, u8 *val) value_rxfltmap2 = 0xFFFF; rtw_write16(Adapter, REG_RXFLTMAP2, value_rxfltmap2); -#if 0 - /* tx pause */ - rtw_write8(padapter, REG_TXPAUSE, 0xFF); -#endif } else { /* do nothing */ } @@ -3753,19 +3322,6 @@ u8 SetHwReg8192E(PADAPTER Adapter, u8 variable, u8 *val) rtw_write8(Adapter, REG_RESP_SIFS_OFDM_8192E, val[0]); } -#if 0 - { - /* SIFS_Timer = 0x0a0a0808; */ - /* RESP_SIFS for CCK */ - - rtw_write8(Adapter, REG_RESP_SIFS_CCK, val[0]); /* SIFS_T2T_CCK (0x08) */ - rtw_write8(Adapter, REG_RESP_SIFS_CCK + 1, val[1]); /* SIFS_R2T_CCK(0x08) */ - /* RESP_SIFS for OFDM */ - rtw_write8(Adapter, REG_RESP_SIFS_OFDM, val[2]); /* SIFS_T2T_OFDM (0x0a) */ - rtw_write8(Adapter, REG_RESP_SIFS_OFDM + 1, val[3]); /* SIFS_R2T_OFDM(0x0a) */ - - } -#endif break; case HW_VAR_ACK_PREAMBLE: { u8 regTmp; @@ -4585,10 +4141,8 @@ static void read_chip_version_8192e(PADAPTER Adapter) pHalData->MultiFunc = RT_MULTI_FUNC_NONE; rtw_hal_config_rftype(Adapter); -#if 1 - dump_chip_info(pHalData->version_id); -#endif + dump_chip_info(pHalData->version_id); } void init_hal_spec_8192e(_adapter *adapter) @@ -4773,7 +4327,7 @@ void rtl8192e_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->set_chnl_bw_handler = &PHY_SetSwChnlBWMode8192E; pHalFunc->set_tx_power_level_handler = &PHY_SetTxPowerLevel8192E; - pHalFunc->get_tx_power_level_handler = &PHY_GetTxPowerLevel8192E; + /*pHalFunc->get_tx_power_level_handler = &PHY_GetTxPowerLevel8192E;*/ pHalFunc->set_tx_power_index_handler = PHY_SetTxPowerIndex_8192E; pHalFunc->get_tx_power_index_handler = PHY_GetTxPowerIndex_8192E; diff --git a/hal/rtl8192e/rtl8192e_phycfg.c b/hal/rtl8192e/rtl8192e_phycfg.c index 1a62e05c..42fb484b 100644 --- a/hal/rtl8192e/rtl8192e_phycfg.c +++ b/hal/rtl8192e/rtl8192e_phycfg.c @@ -418,10 +418,8 @@ PHY_BBConfig8192E( hal_set_crystal_cap(Adapter, pHalData->crystal_cap); -#if 1 /* write 0x24= 000f81fb ,suggest by Ed */ rtw_write32(Adapter, REG_AFE_CTRL1_8192E, 0x000f81fb); -#endif return rtStatus; @@ -456,24 +454,6 @@ PHY_RFConfig8192E( return rtStatus; } -VOID -PHY_GetTxPowerLevel8192E( - IN PADAPTER Adapter, - OUT s32 *powerlevel -) -{ -#if 0 - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - s4Byte TxPwrDbm = 13; - - if (pMgntInfo->ClientConfigPwrInDbm != UNSPECIFIED_PWR_DBM) - *powerlevel = pMgntInfo->ClientConfigPwrInDbm; - else - *powerlevel = TxPwrDbm; -#endif -} - VOID PHY_SetTxPowerIndex_8192E( IN PADAPTER Adapter, @@ -1144,15 +1124,7 @@ PHY_HandleSwChnlAndSetBW8192E( } if (bSetBandWidth) { -#if 0 - if (bInitialzed == _FALSE) { - bInitialzed = _TRUE; - pHalData->bSetChnlBW = _TRUE; - } else if ((pHalData->current_channel_bw != ChnlWidth) || (pHalData->nCur40MhzPrimeSC != ExtChnlOffsetOf40MHz) || (pHalData->CurrentCenterFrequencyIndex1 != CenterFrequencyIndex1)) - pHalData->bSetChnlBW = _TRUE; -#else pHalData->bSetChnlBW = _TRUE; -#endif } if (!pHalData->bSetChnlBW && !pHalData->bSwChnl) { @@ -1169,25 +1141,8 @@ PHY_HandleSwChnlAndSetBW8192E( if (pHalData->bSetChnlBW) { pHalData->current_channel_bw = ChnlWidth; -#if 0 - if (ExtChnlOffsetOf40MHz == EXTCHNL_OFFSET_LOWER) - pHalData->nCur40MhzPrimeSC = HAL_PRIME_CHNL_OFFSET_UPPER; - else if (ExtChnlOffsetOf40MHz == EXTCHNL_OFFSET_UPPER) - pHalData->nCur40MhzPrimeSC = HAL_PRIME_CHNL_OFFSET_LOWER; - else - pHalData->nCur40MhzPrimeSC = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - - if (ExtChnlOffsetOf80MHz == EXTCHNL_OFFSET_LOWER) - pHalData->nCur80MhzPrimeSC = HAL_PRIME_CHNL_OFFSET_UPPER; - else if (ExtChnlOffsetOf80MHz == EXTCHNL_OFFSET_UPPER) - pHalData->nCur80MhzPrimeSC = HAL_PRIME_CHNL_OFFSET_LOWER; - else - pHalData->nCur80MhzPrimeSC = HAL_PRIME_CHNL_OFFSET_DONT_CARE; -#else pHalData->nCur40MhzPrimeSC = ExtChnlOffsetOf40MHz; pHalData->nCur80MhzPrimeSC = ExtChnlOffsetOf80MHz; -#endif - pHalData->CurrentCenterFrequencyIndex1 = CenterFrequencyIndex1; } diff --git a/hal/rtl8192e/rtl8192e_sreset.c b/hal/rtl8192e/rtl8192e_sreset.c index 3f5ea29d..bb6fffa7 100644 --- a/hal/rtl8192e/rtl8192e_sreset.c +++ b/hal/rtl8192e/rtl8192e_sreset.c @@ -82,21 +82,6 @@ void rtl8192e_sreset_linked_status_check(_adapter *padapter) rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS); if (rx_dma_status != 0x00) RTW_INFO("%s REG_RXDMA_STATUS:0x%08x\n", __FUNCTION__, rx_dma_status); -#if 0 - u32 regc50, regc58, reg824, reg800; - regc50 = rtw_read32(padapter, 0xc50); - regc58 = rtw_read32(padapter, 0xc58); - reg824 = rtw_read32(padapter, 0x824); - reg800 = rtw_read32(padapter, 0x800); - if (((regc50 & 0xFFFFFF00) != 0x69543400) || - ((regc58 & 0xFFFFFF00) != 0x69543400) || - (((reg824 & 0xFFFFFF00) != 0x00390000) && (((reg824 & 0xFFFFFF00) != 0x80390000))) || - (((reg800 & 0xFFFFFF00) != 0x03040000) && ((reg800 & 0xFFFFFF00) != 0x83040000))) { - RTW_INFO("%s regc50:0x%08x, regc58:0x%08x, reg824:0x%08x, reg800:0x%08x,\n", __FUNCTION__, - regc50, regc58, reg824, reg800); - rtw_hal_sreset_reset(padapter); - } -#endif if (psrtpriv->dbg_trigger_point == SRESET_TGP_LINK_STATUS) { psrtpriv->dbg_trigger_point = SRESET_TGP_NULL; diff --git a/hal/rtl8192e/rtl8192e_xmit.c b/hal/rtl8192e/rtl8192e_xmit.c index caae085f..63838490 100644 --- a/hal/rtl8192e/rtl8192e_xmit.c +++ b/hal/rtl8192e/rtl8192e_xmit.c @@ -330,24 +330,6 @@ void fill_txdesc_vcs(struct pkt_attrib *pattrib, u8 *ptxdesc) default: break; } -#if 0 /* to do */ - /* Protection mode related */ - if (pTcb->bRTSEnable || pTcb->bCTSEnable) { - SET_TX_DESC_CCA_RTS_92E(pDesc, pTcb->RTSCCA); - - /* SET_TX_DESC_RTS_ENABLE_92E(pDesc, ((pTcb->bRTSEnable && !pTcb->bCTSEnable) ? 1 : 0)); */ - /* SET_TX_DESC_CTS2SELF_92E(pDesc, ((pTcb->bCTSEnable) ? 1 : 0)); */ - - SET_TX_DESC_CTROL_STBC_92E(pDesc, ((pTcb->bRTSSTBC) ? 1 : 0)); - SET_TX_DESC_RTS_SHORT_92E(pDesc, pTcb->bRTSShort); - SET_TX_DESC_RTS_RATE_92E(pDesc, MRateToHwRate((u1Byte)pTcb->RTSRate)); - - if (pMgntInfo->ForcedProtectionMode == PROTECTION_MODE_FORCE_ENABLE) - SET_TX_DESC_RTS_RATE_FB_LIMIT_92E(pDesc, 1); - else - SET_TX_DESC_RTS_RATE_FB_LIMIT_92E(pDesc, 0xF); - } -#endif } u8 diff --git a/hal/rtl8192e/usb/rtl8192eu_xmit.c b/hal/rtl8192e/usb/rtl8192eu_xmit.c index b3b5fd81..c217a392 100644 --- a/hal/rtl8192e/usb/rtl8192eu_xmit.c +++ b/hal/rtl8192e/usb/rtl8192eu_xmit.c @@ -23,11 +23,9 @@ s32 rtl8192eu_init_xmit_priv(_adapter *padapter) struct xmit_priv *pxmitpriv = &padapter->xmitpriv; HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); -#ifdef PLATFORM_LINUX tasklet_init(&pxmitpriv->xmit_tasklet, (void(*)(unsigned long))rtl8192eu_xmit_tasklet, (unsigned long)padapter); -#endif rtl8192e_init_xmit_priv(padapter); return _SUCCESS; @@ -890,9 +888,7 @@ s32 rtl8192eu_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmit pxmitpriv->tx_drop++; } else { -#ifdef PLATFORM_LINUX tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); -#endif } return err; @@ -903,128 +899,11 @@ s32 rtl8192eu_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmit static void rtl8192eu_hostap_mgnt_xmit_cb(struct urb *urb) { -#ifdef PLATFORM_LINUX struct sk_buff *skb = (struct sk_buff *)urb->context; /* RTW_INFO("%s\n", __FUNCTION__); */ rtw_skb_free(skb); -#endif } -s32 rtl8192eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt) -{ -#if 0 - /* #ifdef PLATFORM_LINUX */ - u16 fc; - int rc, len, pipe; - bool bmcst, tid, qsel; - struct sk_buff *skb, *pxmit_skb; - struct urb *urb; - unsigned char *pxmitbuf; - struct tx_desc *ptxdesc; - struct ieee80211_hdr *tx_hdr; - struct hostapd_priv *phostapdpriv = padapter->phostapdpriv; - struct net_device *pnetdev = padapter->pnetdev; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter); - - - /* RTW_INFO("%s\n", __FUNCTION__); */ - - skb = pkt; - - len = skb->len; - tx_hdr = (struct ieee80211_hdr *)(skb->data); - fc = le16_to_cpu(tx_hdr->frame_control); - bmcst = is_multicast_ether_addr(tx_hdr->addr1); - - if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) - goto _exit; - - pxmit_skb = rtw_skb_alloc(len + TXDESC_SIZE); - - if (!pxmit_skb) - goto _exit; - - pxmitbuf = pxmit_skb->data; - - urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!urb) - goto _exit; - - /* ----- fill tx desc ----- */ - ptxdesc = (struct tx_desc *)pxmitbuf; - memset(ptxdesc, 0, sizeof(*ptxdesc)); - - /* 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 */ - ptxdesc->txdw0 |= cpu_to_le32(OWN | FSG | LSG); - - if (bmcst) - ptxdesc->txdw0 |= cpu_to_le32(BIT(24)); - - /* offset 4 */ - ptxdesc->txdw1 |= cpu_to_le32(0x00);/* MAC_ID */ - - ptxdesc->txdw1 |= cpu_to_le32((0x12 << QSEL_SHT) & 0x00001f00); - - ptxdesc->txdw1 |= cpu_to_le32((0x06 << 16) & 0x000f0000); /* b mode */ - - /* offset 8 */ - - /* offset 12 */ - ptxdesc->txdw3 |= cpu_to_le32((le16_to_cpu(tx_hdr->seq_ctl) << 16) & 0xffff0000); - - /* offset 16 */ - ptxdesc->txdw4 |= cpu_to_le32(BIT(8));/* driver uses rate */ - - /* offset 20 */ - - - /* HW append seq */ - ptxdesc->txdw4 |= cpu_to_le32(BIT(7)); /* Hw set sequence number */ - ptxdesc->txdw3 |= cpu_to_le32((8 << 28)); /* set bit3 to 1. Suugested by TimChen. 2009.12.29. */ - - - rtl8192e_cal_txdesc_chksum(ptxdesc); - /* ----- end of fill tx desc ----- */ - - /* */ - skb_put(pxmit_skb, len + TXDESC_SIZE); - pxmitbuf = pxmitbuf + TXDESC_SIZE; - _rtw_memcpy(pxmitbuf, skb->data, len); - - /* RTW_INFO("mgnt_xmit, len=%x\n", pxmit_skb->len); */ - - - /* ----- prepare urb for submit ----- */ - - /* translate DMA FIFO addr to pipehandle */ - /* pipe = ffaddr2pipehdl(pdvobj, MGT_QUEUE_INX); */ - pipe = usb_sndbulkpipe(pdvobj->pusbdev, pHalData->Queue2EPNum[(u8)MGT_QUEUE_INX] & 0x0f); - - usb_fill_bulk_urb(urb, pdvobj->pusbdev, pipe, - pxmit_skb->data, pxmit_skb->len, rtl8192eu_hostap_mgnt_xmit_cb, pxmit_skb); - - urb->transfer_flags |= URB_ZERO_PACKET; - usb_anchor_urb(urb, &phostapdpriv->anchored); - rc = usb_submit_urb(urb, GFP_ATOMIC); - if (rc < 0) { - usb_unanchor_urb(urb); - kfree_skb(skb); - } - usb_free_urb(urb); - - -_exit: - - rtw_skb_free(skb); - -#endif - - return 0; - -} #endif diff --git a/hal/rtl8192e/usb/usb_halinit.c b/hal/rtl8192e/usb/usb_halinit.c index 662aced1..f683b6dd 100644 --- a/hal/rtl8192e/usb/usb_halinit.c +++ b/hal/rtl8192e/usb/usb_halinit.c @@ -162,75 +162,6 @@ void rtl8192eu_interface_configure(_adapter *padapter) } -static VOID -_InitBurstPktLen_8192EU(IN PADAPTER Adapter) -{ -#if 0 - u1Byte speedvalue, provalue, temp; - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - - - /* rtw_write16(Adapter, REG_TRXDMA_CTRL_8195, 0xf5b0); */ - /* rtw_write16(Adapter, REG_TRXDMA_CTRL_8812, 0xf5b4); */ - rtw_write16(Adapter, REG_RXDMA_STATUS_8192E, 0x7400); /* burset lenght=4, set 0x3400 for burset length=2 */ - rtw_write8(Adapter, 0x289, 0xf5); /* for rxdma control */ - /* rtw_write8(Adapter, 0x3a, 0x46); */ - - /* 0x456 = 0x70, sugguested by Zhilin */ - /* rtw_write8(Adapter, REG_AMPDU_MAX_TIME_8192E, 0x70); */ - - /* Suggention by SD1 Jong and Pisa, by Maddest 20130107. */ - rtw_write16(Adapter, REG_MAX_AGGR_NUM_8192E, 0x0e0e); - rtw_write8(Adapter, REG_FWHW_TXQ_CTRL_8192E, 0x80);/* EN_AMPDU_RTY_NEW */ - rtw_write8(Adapter, REG_AMPDU_MAX_TIME_8192E, 0x5e); - rtw_write32(Adapter, REG_FAST_EDCA_CTRL_8192E, 0x03087777); - - - /* rtw_write32(Adapter, 0x458, 0xffffffff); */ - rtw_write8(Adapter, REG_USTIME_TSF_8192E, 0x50); - rtw_write8(Adapter, REG_USTIME_EDCA_8192E, 0x50); - - if (IS_HARDWARE_TYPE_8821U(Adapter) || IS_HARDWARE_TYPE_8192EU(Adapter)) - speedvalue = BIT7; - else - speedvalue = rtw_read8(Adapter, 0xff); /* check device operation speed: SS 0xff bit7 */ - - if (speedvalue & BIT7) { /* USB2/1.1 Mode */ - temp = rtw_read8(Adapter, REG_USB_INFO); - if (((temp >> 4) & 0x03) == 0) { - /* pHalData->UsbBulkOutSize = 512; */ - provalue = rtw_read8(Adapter, REG_RXDMA_PRO_8192E); - rtw_write8(Adapter, REG_RXDMA_PRO_8192E, (provalue | BIT(4) & (~BIT(5)))); /* set burst pkt len=512B */ - rtw_write16(Adapter, REG_RXDMA_PRO_8192E, 0x1e); - } else { - /* pHalData->UsbBulkOutSize = 64; */ - provalue = rtw_read8(Adapter, REG_RXDMA_PRO_8192E); - rtw_write8(Adapter, REG_RXDMA_PRO_8192E, ((provalue | BIT(5)) & (~BIT(4)))); /* set burst pkt len=64B */ - } - - rtw_write16(Adapter, REG_RXDMA_AGG_PG_TH_8192E, 0x2005); /* dmc agg th 20K */ - - pHalData->bSupportUSB3 = FALSE; - } - - rtw_write8(Adapter, REG_DWBCN0_CTRL_8192E, 0x10); - - rtw_write8(Adapter, 0x4c7, rtw_read8(Adapter, 0x4c7) | BIT(7)); /* enable single pkt ampdu */ - rtw_write8(Adapter, REG_RX_PKT_LIMIT_8192E, 0x18); /* for VHT packet length 11K */ - - /* rtw_write8(Adapter, REG_MAX_AGGR_NUM_8192E, 0x1f); */ - rtw_write8(Adapter, REG_PIFS_8192E, 0x00); - /* rtw_write8(Adapter, REG_FWHW_TXQ_CTRL_8192E, rtw_read8(Adapter, REG_FWHW_TXQ_CTRL)&(~BIT(7))); */ - -#ifdef CONFIG_TX_EARLY_MODE - if (pHalData->AMPDUBurstMode) - rtw_write8(Adapter, REG_SW_AMPDU_BURST_MODE_CTRL_8192E, 0x5F); -#endif - - rtw_write8(Adapter, 0x1c, rtw_read8(Adapter, 0x1c) | BIT(5) | BIT(6)); /* to prevent mac is reseted by bus. 20111208, by Page */ -#endif -} - static u32 _InitPowerOn_8192EU(_adapter *padapter) { u16 value16; @@ -503,73 +434,6 @@ USB_AggModeSwitch( IN PADAPTER Adapter ) { -#if 0 - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); - - /* pHalData->UsbRxHighSpeedMode = FALSE; */ - /* How to measure the RX speed? We assume that when traffic is more than */ - if (pMgntInfo->bRegAggDMEnable == FALSE) { - return; /* Inf not support. */ - } - - - if (pMgntInfo->LinkDetectInfo.bHigherBusyRxTraffic == TRUE && - pHalData->UsbRxHighSpeedMode == FALSE) { - pHalData->UsbRxHighSpeedMode = TRUE; - } else if (pMgntInfo->LinkDetectInfo.bHigherBusyRxTraffic == FALSE && - pHalData->UsbRxHighSpeedMode == TRUE) { - pHalData->UsbRxHighSpeedMode = FALSE; - } else - return; - - -#if USB_RX_AGGREGATION_92C - if (pHalData->UsbRxHighSpeedMode == TRUE) { - /* 2010/12/10 MH The parameter is tested by SD1 engineer and SD3 channel emulator. */ - /* USB mode */ -#if (RT_PLATFORM == PLATFORM_LINUX) - if (pMgntInfo->LinkDetectInfo.bTxBusyTraffic) { - pHalData->RxAggBlockCount = 16; - pHalData->RxAggBlockTimeout = 7; - } else -#endif - { - pHalData->RxAggBlockCount = 40; - pHalData->RxAggBlockTimeout = 5; - } - /* Mix mode */ - pHalData->RxAggPageCount = 72; - pHalData->RxAggPageTimeout = 6; - } else { - /* USB mode */ - pHalData->RxAggBlockCount = pMgntInfo->RegRxAggBlockCount; - pHalData->RxAggBlockTimeout = pMgntInfo->RegRxAggBlockTimeout; - /* Mix mode */ - pHalData->RxAggPageCount = pMgntInfo->RegRxAggPageCount; - pHalData->RxAggPageTimeout = pMgntInfo->RegRxAggPageTimeout; - } - - if (pHalData->RxAggBlockCount > MAX_RX_AGG_BLKCNT) - pHalData->RxAggBlockCount = MAX_RX_AGG_BLKCNT; -#if (OS_WIN_FROM_VISTA(OS_VERSION)) || (RT_PLATFORM == PLATFORM_LINUX) /* do not support WINXP to prevent usbehci.sys BSOD */ - if (IS_WIRELESS_MODE_N_24G(Adapter) || IS_WIRELESS_MODE_N_5G(Adapter)) { - /* */ - /* 2010/12/24 MH According to V1012 QC IOT test, XP BSOD happen when running chariot test */ - /* with the aggregation dynamic change!! We need to disable the function to prevent it is broken */ - /* in usbehci.sys. */ - /* */ - usb_AggSettingRxUpdate_8188E(Adapter); - - /* 2010/12/27 MH According to designer's suggstion, we can only modify Timeout value. Otheriwse */ - /* there might many HW incorrect behavior, the XP BSOD at usbehci.sys may be relative to the */ - /* issue. Base on the newest test, we can not enable block cnt > 30, otherwise XP usbehci.sys may */ - /* BSOD. */ - } -#endif - -#endif -#endif } /* USB_AggModeSwitch */ enum { @@ -577,60 +441,6 @@ enum { Antenna_Right = 2, }; -#if 0 -/*----------------------------------------------------------------------------- - * Function: HwSuspendModeEnable92Cu() - * - * Overview: HW suspend mode switch. - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 08/23/2010 MHC HW suspend mode switch test.. - *---------------------------------------------------------------------------*/ -static VOID -HwSuspendModeEnable_8192EU( - IN PADAPTER pAdapter, - IN u8 Type -) -{ - /* PRT_USB_DEVICE pDevice = GET_RT_USB_DEVICE(pAdapter); */ - u16 reg = rtw_read16(pAdapter, REG_GPIO_MUXCFG); - - /* if (!pDevice->RegUsbSS) */ - { - return; - } - - /* */ - /* 2010/08/23 MH According to Alfred's suggestion, we need to to prevent HW */ - /* to enter suspend mode automatically. Otherwise, it will shut down major power */ - /* domain and 8051 will stop. When we try to enter selective suspend mode, we */ - /* need to prevent HW to enter D2 mode aumotmatically. Another way, Host will */ - /* issue a S10 signal to power domain. Then it will cleat SIC setting(from Yngli). */ - /* We need to enable HW suspend mode when enter S3/S4 or disable. We need */ - /* to disable HW suspend mode for IPS/radio_off. */ - /* */ - if (Type == _FALSE) { - reg |= BIT14; - rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg); - reg |= BIT12; - rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg); - } else { - reg &= (~BIT12); - rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg); - reg &= (~BIT14); - rtw_write16(pAdapter, REG_GPIO_MUXCFG, reg); - } - -} /* HwSuspendModeEnable92Cu */ -#endif - rt_rf_power_state RfOnOffDetect(IN PADAPTER pAdapter) { struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(pAdapter); @@ -940,8 +750,6 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter) _InitBeaconParameters_8192E(Adapter); _InitBeaconMaxError_8192E(Adapter, _TRUE); - _InitBurstPktLen_8192EU(Adapter); /* added by page. 20110919 */ - /* */ /* Init CR MACTXEN, MACRXEN after setting RxFF boundary REG_TRXFF_BNDY to patch */ /* Hw bug which Hw initials RxFF boundry size to a value which is larger than the real Rx buffer size in 88E. */ @@ -1084,13 +892,6 @@ u32 rtl8192eu_hal_init(PADAPTER Adapter) /* Init BT hw config.*/ rtw_btcoex_HAL_Initialize(Adapter, _FALSE); } -#if 0 - /* else */ - { - /* In combo card run wifi only , must setting some hardware reg. */ - rtl8192e_combo_card_WifiOnlyHwInit(Adapter); - } -#endif #endif /* 2010/08/23 MH According to Alfred's suggestion, we need to to prevent HW enter */ @@ -1160,11 +961,7 @@ hal_poweroff_8192eu( /* MCUFWDL 0x80[1:0]=0 */ /* reset MCU ready status */ rtw_write8(Adapter, REG_MCUFWDL, 0x00); -#if 0 - if ((rtw_read8(Adapter, REG_MCUFWDL) & RAM_DL_SEL) && - GET_HAL_DATA(Adapter)->bFWReady) /* 8051 RAM code */ - _8051Reset8192E(Adapter); -#else + /* Reset MCU IO Wrapper */ u1bTmp = rtw_read8(Adapter, REG_RSV_CTRL + 1); rtw_write8(Adapter, REG_RSV_CTRL + 1, (u1bTmp & (~BIT0))); @@ -1176,8 +973,6 @@ hal_poweroff_8192eu( /* Enable MCU IO Wrapper , for IPS flow */ u1bTmp = rtw_read8(Adapter, REG_RSV_CTRL + 1); rtw_write8(Adapter, REG_RSV_CTRL + 1, u1bTmp | BIT0); -#endif - /* Card disable power action flow */ HalPwrSeqCmdParsing(Adapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, Rtl8192E_NIC_DISABLE_FLOW); @@ -1398,69 +1193,6 @@ hal_CustomizedBehavior_8192EU( #endif } -static void -hal_CustomizeByCustomerID_8192EU( - IN PADAPTER padapter -) -{ -#if 0 - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - - /* For customized behavior. */ - if ((pHalData->EEPROMVID == 0x103C) && (pHalData->EEPROMPID == 0x1629)) /* HP Lite-On for RTL8188CUS Slim Combo. */ - pHalData->CustomerID = RT_CID_819x_HP; - else if ((pHalData->EEPROMVID == 0x9846) && (pHalData->EEPROMPID == 0x9041)) - pHalData->CustomerID = RT_CID_NETGEAR; - else if ((pHalData->EEPROMVID == 0x2019) && (pHalData->EEPROMPID == 0x1201)) - pHalData->CustomerID = RT_CID_PLANEX; - else if ((pHalData->EEPROMVID == 0x0BDA) && (pHalData->EEPROMPID == 0x5088)) - pHalData->CustomerID = RT_CID_CC_C; - - RTW_INFO("PID= 0x%x, VID= %x\n", pHalData->EEPROMPID, pHalData->EEPROMVID); - - /* Decide CustomerID according to VID/DID or EEPROM */ - switch (pHalData->EEPROMCustomerID) { - case EEPROM_CID_DEFAULT: - if ((pHalData->EEPROMVID == 0x2001) && (pHalData->EEPROMPID == 0x3308)) - pHalData->CustomerID = RT_CID_DLINK; - else if ((pHalData->EEPROMVID == 0x2001) && (pHalData->EEPROMPID == 0x3309)) - pHalData->CustomerID = RT_CID_DLINK; - else if ((pHalData->EEPROMVID == 0x2001) && (pHalData->EEPROMPID == 0x330a)) - pHalData->CustomerID = RT_CID_DLINK; - else if ((pHalData->EEPROMVID == 0x0BFF) && (pHalData->EEPROMPID == 0x8160)) { - pHalData->bAutoConnectEnable = _FALSE; - pHalData->CustomerID = RT_CID_CHINA_MOBILE; - } else if ((pHalData->EEPROMVID == 0x0BDA) && (pHalData->EEPROMPID == 0x5088)) - pHalData->CustomerID = RT_CID_CC_C; - - RTW_INFO("PID= 0x%x, VID= %x\n", pHalData->EEPROMPID, pHalData->EEPROMVID); - break; - case EEPROM_CID_WHQL: - /* padapter->bInHctTest = TRUE; */ - - /* pMgntInfo->bSupportTurboMode = FALSE; */ - /* pMgntInfo->bAutoTurboBy8186 = FALSE; */ - - /* pMgntInfo->PowerSaveControl.bInactivePs = FALSE; */ - /* pMgntInfo->PowerSaveControl.bIPSModeBackup = FALSE; */ - /* pMgntInfo->PowerSaveControl.bLeisurePs = FALSE; */ - /* pMgntInfo->PowerSaveControl.bLeisurePsModeBackup = FALSE; */ - /* pMgntInfo->keepAliveLevel = 0; */ - - /* padapter->bUnloadDriverwhenS3S4 = FALSE; */ - break; - default: - pHalData->CustomerID = RT_CID_DEFAULT; - break; - - } - RTW_INFO("MGNT Customer ID: 0x%2x\n", pHalData->CustomerID); - - hal_CustomizedBehavior_8192EU(padapter); -#endif -} - - static VOID ReadLEDSetting_8192EU( IN PADAPTER Adapter, @@ -1517,7 +1249,6 @@ InitAdapterVariablesByPROM_8192EU( Hal_ReadPAType_8192E(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag); Hal_ReadAmplifierType_8192E(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag); Hal_ReadRFEType_8192E(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag); - hal_CustomizeByCustomerID_8192EU(Adapter); ReadLEDSetting_8192EU(Adapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag); @@ -1626,13 +1357,8 @@ u8 SetHwReg8192EU(PADAPTER Adapter, u8 variable, u8 *val) struct ht_priv *phtpriv = &pmlmepriv->htpriv; if (pHalData->rxagg_mode == RX_AGG_USB) { -#if 1 /* BG mode || (wifi_spec=1 && BG mode Testbed) */ if ((threshold == 1) && (_FALSE == phtpriv->ht_option)) -#else - /* (wifi_spec=1 && BG mode Testbed) */ - if ((Adapter->registrypriv.wifi_spec == 1) && (_FALSE == phtpriv->ht_option)) -#endif rtw_write8(Adapter, REG_RXDMA_AGG_PG_TH + 1, 0); else rtw_write8(Adapter, REG_RXDMA_AGG_PG_TH + 1, pHalData->rxagg_usb_timeout); @@ -1810,7 +1536,7 @@ void rtl8192eu_set_hal_ops(_adapter *padapter) #ifdef CONFIG_HOSTAPD_MLME - pHalFunc->hostap_mgnt_xmit_entry = &rtl8192eu_hostap_mgnt_xmit_entry; + pHalFunc->hostap_mgnt_xmit_entry = 0; #endif pHalFunc->interface_ps_func = &rtl8192eu_ps_func; #ifdef CONFIG_XMIT_THREAD_MODE diff --git a/hal/rtl8192e/usb/usb_ops_linux.c b/hal/rtl8192e/usb/usb_ops_linux.c index 60826fd7..c0a64368 100644 --- a/hal/rtl8192e/usb/usb_ops_linux.c +++ b/hal/rtl8192e/usb/usb_ops_linux.c @@ -31,20 +31,6 @@ void interrupt_handler_8192eu(_adapter *padapter, u16 pkt_len, u8 *pbuf) memcpy(&(pHalData->IntArray[0]), &(pbuf[USB_INTR_CONTENT_HISR_OFFSET]), 4); memcpy(&(pHalData->IntArray[1]), &(pbuf[USB_INTR_CONTENT_HISRE_OFFSET]), 4); -#if 0 /* DBG */ - { - u32 hisr = 0 , hisr_ex = 0; - memcpy(&hisr, &(pHalData->IntArray[0]), 4); - hisr = le32_to_cpu(hisr); - - memcpy(&hisr_ex, &(pHalData->IntArray[1]), 4); - hisr_ex = le32_to_cpu(hisr_ex); - - if ((hisr != 0) || (hisr_ex != 0)) - RTW_INFO("===> %s hisr:0x%08x ,hisr_ex:0x%08x\n", __FUNCTION__, hisr, hisr_ex); - } -#endif - #ifdef CONFIG_TDLS #ifdef CONFIG_TDLS_CH_SW if (pHalData->IntArray[0] & IMR_BCNDMAINT0_88E) { @@ -86,14 +72,6 @@ void interrupt_handler_8192eu(_adapter *padapter, u16 pkt_len, u8 *pbuf) if (pHalData->IntArray[0] & (IMR_TBDER_88E | IMR_TBDOK_88E)) #endif { -#if 0 - if (pHalData->IntArray[0] & IMR_BCNDMAINT0_88E) - RTW_INFO("%s: HISR_BCNERLY_INT\n", __func__); - if (pHalData->IntArray[0] & IMR_TBDOK_88E) - RTW_INFO("%s: HISR_TXBCNOK\n", __func__); - if (pHalData->IntArray[0] & IMR_TBDER_88E) - RTW_INFO("%s: HISR_TXBCNERR\n", __func__); -#endif rtw_mi_set_tx_beacon_cmd(padapter); } #endif /* CONFIG_INTERRUPT_BASED_TXBCN */ @@ -200,15 +178,6 @@ int recvbuf2recvframe(PADAPTER padapter, void *ptr) /*RTW_INFO("rx C2H_PACKET\n");*/ rtw_hal_c2h_pkt_pre_hdl(padapter, precvframe->u.hdr.rx_data, pattrib->pkt_len); } -#if 0 - else if (pattrib->pkt_rpt_type == HIS_REPORT) { - /*RTW_INFO("%s, rx USB HISR\n", __func__);*/ -#ifdef CONFIG_SUPPORT_USB_INT - interrupt_handler_8192eu(padapter, pattrib->pkt_len, precvframe->u.hdr.rx_data); -#endif - } -#endif - rtw_free_recvframe(precvframe, pfree_recv_queue); } diff --git a/include/Hal8192EPhyCfg.h b/include/Hal8192EPhyCfg.h index d6394c6f..6282aad6 100644 --- a/include/Hal8192EPhyCfg.h +++ b/include/Hal8192EPhyCfg.h @@ -82,7 +82,6 @@ int PHY_RFConfig8192E(IN PADAPTER Adapter); /* * BB TX Power R/W * */ -void PHY_GetTxPowerLevel8192E(IN PADAPTER Adapter, OUT s32 *powerlevel); void PHY_SetTxPowerLevel8192E(IN PADAPTER Adapter, IN u8 channel); BOOLEAN PHY_UpdateTxPowerDbm8192E(IN PADAPTER Adapter, IN int powerInDbm); diff --git a/include/Hal8814PhyCfg.h b/include/Hal8814PhyCfg.h index 96f07942..5e6ff851 100644 --- a/include/Hal8814PhyCfg.h +++ b/include/Hal8814PhyCfg.h @@ -166,13 +166,6 @@ PHY_GetTxBBSwing_8814A( -/* 1 6. Channel setting API */ -#if 0 -VOID -PHY_SwChnlTimerCallback8814A( - IN struct timer_list *p_timer -); -#endif VOID PHY_SwChnlWorkItemCallback8814A( IN PVOID pContext diff --git a/include/HalVerDef.h b/include/HalVerDef.h index ab1c578d..4eeec980 100644 --- a/include/HalVerDef.h +++ b/include/HalVerDef.h @@ -106,13 +106,6 @@ typedef struct tag_HAL_VERSION { * ---------------------------------------------------------------------------- * HAL_VERSION VersionID */ -/* HAL_IC_TYPE_E */ -#if 0 - #define IS_81XXC(version) (((GET_CVID_IC_TYPE(version) == CHIP_8192C) || (GET_CVID_IC_TYPE(version) == CHIP_8188C)) ? TRUE : FALSE) - #define IS_8723_SERIES(version) ((GET_CVID_IC_TYPE(version) == CHIP_8723A) ? TRUE : FALSE) - #define IS_92D(version) ((GET_CVID_IC_TYPE(version) == CHIP_8192D) ? TRUE : FALSE) -#endif - #define IS_8188E(version) ((GET_CVID_IC_TYPE(version) == CHIP_8188E) ? TRUE : FALSE) #define IS_8188F(version) ((GET_CVID_IC_TYPE(version) == CHIP_8188F) ? TRUE : FALSE) #define IS_8188GTV(version) ((GET_CVID_IC_TYPE(version) == CHIP_8188GTV) ? TRUE : FALSE) @@ -157,29 +150,6 @@ typedef struct tag_HAL_VERSION { #define IS_3T4R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_3T4R) ? TRUE : FALSE) #define IS_4T4R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_4T4R) ? TRUE : FALSE) - - -/* ---------------------------------------------------------------------------- - * Chip version Macro. -- - * ---------------------------------------------------------------------------- */ -#if 0 - #define IS_81XXC_TEST_CHIP(version) ((IS_81XXC(version) && (!IS_NORMAL_CHIP(version))) ? TRUE : FALSE) - - #define IS_92C_SERIAL(version) ((IS_81XXC(version) && IS_2T2R(version)) ? TRUE : FALSE) - #define IS_81xxC_VENDOR_UMC_A_CUT(version) (IS_81XXC(version) ? (IS_CHIP_VENDOR_UMC(version) ? (IS_A_CUT(version) ? TRUE : FALSE) : FALSE) : FALSE) - #define IS_81xxC_VENDOR_UMC_B_CUT(version) (IS_81XXC(version) ? (IS_CHIP_VENDOR_UMC(version) ? (IS_B_CUT(version) ? TRUE : FALSE) : FALSE) : FALSE) - #define IS_81xxC_VENDOR_UMC_C_CUT(version) (IS_81XXC(version) ? (IS_CHIP_VENDOR_UMC(version) ? (IS_C_CUT(version) ? TRUE : FALSE) : FALSE) : FALSE) - - #define IS_NORMAL_CHIP92D(version) ((IS_92D(version)) ? ((GET_CVID_CHIP_TYPE(version) == NORMAL_CHIP) ? TRUE : FALSE) : FALSE) - - #define IS_92D_SINGLEPHY(version) ((IS_92D(version)) ? (IS_2T2R(version) ? TRUE : FALSE) : FALSE) - #define IS_92D_C_CUT(version) ((IS_92D(version)) ? (IS_C_CUT(version) ? TRUE : FALSE) : FALSE) - #define IS_92D_D_CUT(version) ((IS_92D(version)) ? (IS_D_CUT(version) ? TRUE : FALSE) : FALSE) - #define IS_92D_E_CUT(version) ((IS_92D(version)) ? (IS_E_CUT(version) ? TRUE : FALSE) : FALSE) - - #define IS_8723A_A_CUT(version) ((IS_8723_SERIES(version)) ? (IS_A_CUT(version) ? TRUE : FALSE) : FALSE) - #define IS_8723A_B_CUT(version) ((IS_8723_SERIES(version)) ? (IS_B_CUT(version) ? TRUE : FALSE) : FALSE) -#endif #define IS_VENDOR_8188E_I_CUT_SERIES(_Adapter) ((IS_8188E(GET_HAL_DATA(_Adapter)->version_id)) ? ((GET_CVID_CUT_VERSION(GET_HAL_DATA(_Adapter)->version_id) >= I_CUT_VERSION) ? TRUE : FALSE) : FALSE) #define IS_VENDOR_8812A_TEST_CHIP(_Adapter) ((IS_8812_SERIES(GET_HAL_DATA(_Adapter)->version_id)) ? ((IS_NORMAL_CHIP(GET_HAL_DATA(_Adapter)->version_id)) ? FALSE : TRUE) : FALSE) #define IS_VENDOR_8812A_MP_CHIP(_Adapter) ((IS_8812_SERIES(GET_HAL_DATA(_Adapter)->version_id)) ? ((IS_NORMAL_CHIP(GET_HAL_DATA(_Adapter)->version_id)) ? TRUE : FALSE) : FALSE) diff --git a/include/basic_types.h b/include/basic_types.h index 37e0e2ce..f97c16ab 100644 --- a/include/basic_types.h +++ b/include/basic_types.h @@ -31,35 +31,34 @@ #define _FALSE FALSE #endif -#ifdef PLATFORM_LINUX - #include - #include - #include - #include - #include - #include - #define IN - #define OUT - #define VOID void - #define NDIS_OID uint - #define NDIS_STATUS uint - - typedef signed int sint; - - #ifndef RHEL_RELEASE_CODE - #define RHEL_RELEASE_VERSION(a,b) (((a) << 8) + (b)) - #define RHEL_RELEASE_CODE 0 - #endif - - #ifndef PVOID - typedef void *PVOID; - /* #define PVOID (void *) */ - #endif - - #define UCHAR u8 - #define USHORT u16 - #define UINT u32 - #define ULONG u32 +#include +#include +#include +#include +#include +#include +#define IN +#define OUT +#define VOID void +#define NDIS_OID uint +#define NDIS_STATUS uint + +typedef signed int sint; + +#ifndef RHEL_RELEASE_CODE + #define RHEL_RELEASE_VERSION(a,b) (((a) << 8) + (b)) + #define RHEL_RELEASE_CODE 0 +#endif + +#ifndef PVOID + typedef void *PVOID; + /* #define PVOID (void *) */ +#endif + +#define UCHAR u8 +#define USHORT u16 +#define UINT u32 +#define ULONG u32 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)) typedef _Bool bool; @@ -106,7 +105,6 @@ enum { #define ULONG u32 #define PULONG u32* -#endif #define MEM_ALIGNMENT_OFFSET (sizeof (SIZE_T)) diff --git a/include/byteorder/big_endian.h b/include/byteorder/big_endian.h deleted file mode 100644 index 6b1dc449..00000000 --- a/include/byteorder/big_endian.h +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H -#define _LINUX_BYTEORDER_BIG_ENDIAN_H - -#ifndef __BIG_ENDIAN - #define __BIG_ENDIAN 4321 -#endif -#ifndef __BIG_ENDIAN_BITFIELD - #define __BIG_ENDIAN_BITFIELD -#endif - -#include - -#define __constant_htonl(x) ((__u32)(x)) -#define __constant_ntohl(x) ((__u32)(x)) -#define __constant_htons(x) ((__u16)(x)) -#define __constant_ntohs(x) ((__u16)(x)) -#define __constant_cpu_to_le64(x) ___constant_swab64((x)) -#define __constant_le64_to_cpu(x) ___constant_swab64((x)) -#define __constant_cpu_to_le32(x) ___constant_swab32((x)) -#define __constant_le32_to_cpu(x) ___constant_swab32((x)) -#define __constant_cpu_to_le16(x) ___constant_swab16((x)) -#define __constant_le16_to_cpu(x) ___constant_swab16((x)) -#define __constant_cpu_to_be64(x) ((__u64)(x)) -#define __constant_be64_to_cpu(x) ((__u64)(x)) -#define __constant_cpu_to_be32(x) ((__u32)(x)) -#define __constant_be32_to_cpu(x) ((__u32)(x)) -#define __constant_cpu_to_be16(x) ((__u16)(x)) -#define __constant_be16_to_cpu(x) ((__u16)(x)) -#define __cpu_to_le64(x) __swab64((x)) -#define __le64_to_cpu(x) __swab64((x)) -#define __cpu_to_le32(x) __swab32((x)) -#define __le32_to_cpu(x) __swab32((x)) -#define __cpu_to_le16(x) __swab16((x)) -#define __le16_to_cpu(x) __swab16((x)) -#define __cpu_to_be64(x) ((__u64)(x)) -#define __be64_to_cpu(x) ((__u64)(x)) -#define __cpu_to_be32(x) ((__u32)(x)) -#define __be32_to_cpu(x) ((__u32)(x)) -#define __cpu_to_be16(x) ((__u16)(x)) -#define __be16_to_cpu(x) ((__u16)(x)) -#define __cpu_to_le64p(x) __swab64p((x)) -#define __le64_to_cpup(x) __swab64p((x)) -#define __cpu_to_le32p(x) __swab32p((x)) -#define __le32_to_cpup(x) __swab32p((x)) -#define __cpu_to_le16p(x) __swab16p((x)) -#define __le16_to_cpup(x) __swab16p((x)) -#define __cpu_to_be64p(x) (*(__u64 *)(x)) -#define __be64_to_cpup(x) (*(__u64 *)(x)) -#define __cpu_to_be32p(x) (*(__u32 *)(x)) -#define __be32_to_cpup(x) (*(__u32 *)(x)) -#define __cpu_to_be16p(x) (*(__u16 *)(x)) -#define __be16_to_cpup(x) (*(__u16 *)(x)) -#define __cpu_to_le64s(x) __swab64s((x)) -#define __le64_to_cpus(x) __swab64s((x)) -#define __cpu_to_le32s(x) __swab32s((x)) -#define __le32_to_cpus(x) __swab32s((x)) -#define __cpu_to_le16s(x) __swab16s((x)) -#define __le16_to_cpus(x) __swab16s((x)) -#define __cpu_to_be64s(x) do {} while (0) -#define __be64_to_cpus(x) do {} while (0) -#define __cpu_to_be32s(x) do {} while (0) -#define __be32_to_cpus(x) do {} while (0) -#define __cpu_to_be16s(x) do {} while (0) -#define __be16_to_cpus(x) do {} while (0) - -#include - -#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */ diff --git a/include/byteorder/generic.h b/include/byteorder/generic.h deleted file mode 100644 index 4f5de121..00000000 --- a/include/byteorder/generic.h +++ /dev/null @@ -1,188 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _LINUX_BYTEORDER_GENERIC_H -#define _LINUX_BYTEORDER_GENERIC_H - -/* - * linux/byteorder_generic.h - * Generic Byte-reordering support - * - * Francois-Rene Rideau 19970707 - * gathered all the good ideas from all asm-foo/byteorder.h into one file, - * cleaned them up. - * I hope it is compliant with non-GCC compilers. - * I decided to put __BYTEORDER_HAS_U64__ in byteorder.h, - * because I wasn't sure it would be ok to put it in types.h - * Upgraded it to 2.1.43 - * Francois-Rene Rideau 19971012 - * Upgraded it to 2.1.57 - * to please Linus T., replaced huge #ifdef's between little/big endian - * by nestedly #include'd files. - * Francois-Rene Rideau 19971205 - * Made it to 2.1.71; now a facelift: - * Put files under include/linux/byteorder/ - * Split swab from generic support. - * - * TODO: - * = Regular kernel maintainers could also replace all these manual - * byteswap macros that remain, disseminated among drivers, - * after some grep or the sources... - * = Linus might want to rename all these macros and files to fit his taste, - * to fit his personal naming scheme. - * = it seems that a few drivers would also appreciate - * nybble swapping support... - * = every architecture could add their byteswap macro in asm/byteorder.h - * see how some architectures already do (i386, alpha, ppc, etc) - * = cpu_to_beXX and beXX_to_cpu might some day need to be well - * distinguished throughout the kernel. This is not the case currently, - * since little endian, big endian, and pdp endian machines needn't it. - * But this might be the case for, say, a port of Linux to 20/21 bit - * architectures (and F21 Linux addict around?). - */ - -/* - * The following macros are to be defined by : - * - * Conversion of long and short int between network and host format - * ntohl(__u32 x) - * ntohs(__u16 x) - * htonl(__u32 x) - * htons(__u16 x) - * It seems that some programs (which? where? or perhaps a standard? POSIX?) - * might like the above to be functions, not macros (why?). - * if that's true, then detect them, and take measures. - * Anyway, the measure is: define only ___ntohl as a macro instead, - * and in a separate file, have - * unsigned long inline ntohl(x){return ___ntohl(x);} - * - * The same for constant arguments - * __constant_ntohl(__u32 x) - * __constant_ntohs(__u16 x) - * __constant_htonl(__u32 x) - * __constant_htons(__u16 x) - * - * Conversion of XX-bit integers (16- 32- or 64-) - * between native CPU format and little/big endian format - * 64-bit stuff only defined for proper architectures - * cpu_to_[bl]eXX(__uXX x) - * [bl]eXX_to_cpu(__uXX x) - * - * The same, but takes a pointer to the value to convert - * cpu_to_[bl]eXXp(__uXX x) - * [bl]eXX_to_cpup(__uXX x) - * - * The same, but change in situ - * cpu_to_[bl]eXXs(__uXX x) - * [bl]eXX_to_cpus(__uXX x) - * - * See asm-foo/byteorder.h for examples of how to provide - * architecture-optimized versions - * - */ - -/* -* inside the kernel, we can use nicknames; -* outside of it, we must avoid POSIX namespace pollution... -*/ -#define cpu_to_le64 __cpu_to_le64 -#define le64_to_cpu __le64_to_cpu -#define cpu_to_le32 __cpu_to_le32 -#define le32_to_cpu __le32_to_cpu -#define cpu_to_le16 __cpu_to_le16 -#define le16_to_cpu __le16_to_cpu -#define cpu_to_be64 __cpu_to_be64 -#define be64_to_cpu __be64_to_cpu -#define cpu_to_be32 __cpu_to_be32 -#define be32_to_cpu __be32_to_cpu -#define cpu_to_be16 __cpu_to_be16 -#define be16_to_cpu __be16_to_cpu -#define cpu_to_le64p __cpu_to_le64p -#define le64_to_cpup __le64_to_cpup -#define cpu_to_le32p __cpu_to_le32p -#define le32_to_cpup __le32_to_cpup -#define cpu_to_le16p __cpu_to_le16p -#define le16_to_cpup __le16_to_cpup -#define cpu_to_be64p __cpu_to_be64p -#define be64_to_cpup __be64_to_cpup -#define cpu_to_be32p __cpu_to_be32p -#define be32_to_cpup __be32_to_cpup -#define cpu_to_be16p __cpu_to_be16p -#define be16_to_cpup __be16_to_cpup -#define cpu_to_le64s __cpu_to_le64s -#define le64_to_cpus __le64_to_cpus -#define cpu_to_le32s __cpu_to_le32s -#define le32_to_cpus __le32_to_cpus -#define cpu_to_le16s __cpu_to_le16s -#define le16_to_cpus __le16_to_cpus -#define cpu_to_be64s __cpu_to_be64s -#define be64_to_cpus __be64_to_cpus -#define cpu_to_be32s __cpu_to_be32s -#define be32_to_cpus __be32_to_cpus -#define cpu_to_be16s __cpu_to_be16s -#define be16_to_cpus __be16_to_cpus - -/* - * Handle ntohl and suches. These have various compatibility - * issues - like we want to give the prototype even though we - * also have a macro for them in case some strange program - * wants to take the address of the thing or something.. - * - * Note that these used to return a "long" in libc5, even though - * long is often 64-bit these days.. Thus the casts. - * - * They have to be macros in order to do the constant folding - * correctly - if the argument passed into a inline function - * it is no longer constant according to gcc.. - */ - -#undef ntohl -#undef ntohs -#undef htonl -#undef htons - -/* - * Do the prototypes. Somebody might want to take the - * address or some such sick thing.. - */ -#if defined(PLATFORM_LINUX) || (defined(__GLIBC__) && __GLIBC__ >= 2) - extern __u32 ntohl(__u32); - extern __u32 htonl(__u32); -#else /* defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2) */ - extern unsigned long int ntohl(unsigned long int); - extern unsigned long int htonl(unsigned long int); -#endif - extern unsigned short int ntohs(unsigned short int); - extern unsigned short int htons(unsigned short int); - -#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) || defined(PLATFORM_MPIXEL) - - #define ___htonl(x) __cpu_to_be32(x) - #define ___htons(x) __cpu_to_be16(x) - #define ___ntohl(x) __be32_to_cpu(x) - #define ___ntohs(x) __be16_to_cpu(x) - - #if defined(PLATFORM_LINUX) || (defined(__GLIBC__) && __GLIBC__ >= 2) - #define htonl(x) ___htonl(x) - #define ntohl(x) ___ntohl(x) - #else - #define htonl(x) ((unsigned long)___htonl(x)) - #define ntohl(x) ((unsigned long)___ntohl(x)) - #endif - #define htons(x) ___htons(x) - #define ntohs(x) ___ntohs(x) - -#endif /* OPTIMIZE */ - -#endif /* _LINUX_BYTEORDER_GENERIC_H */ diff --git a/include/byteorder/little_endian.h b/include/byteorder/little_endian.h deleted file mode 100644 index c4b64512..00000000 --- a/include/byteorder/little_endian.h +++ /dev/null @@ -1,84 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H -#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H - -#ifndef __LITTLE_ENDIAN - #define __LITTLE_ENDIAN 1234 -#endif -#ifndef __LITTLE_ENDIAN_BITFIELD - #define __LITTLE_ENDIAN_BITFIELD -#endif - -#include - -#ifndef __constant_htonl - #define __constant_htonl(x) ___constant_swab32((x)) - #define __constant_ntohl(x) ___constant_swab32((x)) - #define __constant_htons(x) ___constant_swab16((x)) - #define __constant_ntohs(x) ___constant_swab16((x)) - #define __constant_cpu_to_le64(x) ((__u64)(x)) - #define __constant_le64_to_cpu(x) ((__u64)(x)) - #define __constant_cpu_to_le32(x) ((__u32)(x)) - #define __constant_le32_to_cpu(x) ((__u32)(x)) - #define __constant_cpu_to_le16(x) ((__u16)(x)) - #define __constant_le16_to_cpu(x) ((__u16)(x)) - #define __constant_cpu_to_be64(x) ___constant_swab64((x)) - #define __constant_be64_to_cpu(x) ___constant_swab64((x)) - #define __constant_cpu_to_be32(x) ___constant_swab32((x)) - #define __constant_be32_to_cpu(x) ___constant_swab32((x)) - #define __constant_cpu_to_be16(x) ___constant_swab16((x)) - #define __constant_be16_to_cpu(x) ___constant_swab16((x)) - #define __cpu_to_le64(x) ((__u64)(x)) - #define __le64_to_cpu(x) ((__u64)(x)) - #define __cpu_to_le32(x) ((__u32)(x)) - #define __le32_to_cpu(x) ((__u32)(x)) - #define __cpu_to_le16(x) ((__u16)(x)) - #define __le16_to_cpu(x) ((__u16)(x)) - #define __cpu_to_be64(x) __swab64((x)) - #define __be64_to_cpu(x) __swab64((x)) - #define __cpu_to_be32(x) __swab32((x)) - #define __be32_to_cpu(x) __swab32((x)) - #define __cpu_to_be16(x) __swab16((x)) - #define __be16_to_cpu(x) __swab16((x)) - #define __cpu_to_le64p(x) (*(__u64 *)(x)) - #define __le64_to_cpup(x) (*(__u64 *)(x)) - #define __cpu_to_le32p(x) (*(__u32 *)(x)) - #define __le32_to_cpup(x) (*(__u32 *)(x)) - #define __cpu_to_le16p(x) (*(__u16 *)(x)) - #define __le16_to_cpup(x) (*(__u16 *)(x)) - #define __cpu_to_be64p(x) __swab64p((x)) - #define __be64_to_cpup(x) __swab64p((x)) - #define __cpu_to_be32p(x) __swab32p((x)) - #define __be32_to_cpup(x) __swab32p((x)) - #define __cpu_to_be16p(x) __swab16p((x)) - #define __be16_to_cpup(x) __swab16p((x)) - #define __cpu_to_le64s(x) do {} while (0) - #define __le64_to_cpus(x) do {} while (0) - #define __cpu_to_le32s(x) do {} while (0) - #define __le32_to_cpus(x) do {} while (0) - #define __cpu_to_le16s(x) do {} while (0) - #define __le16_to_cpus(x) do {} while (0) - #define __cpu_to_be64s(x) __swab64s((x)) - #define __be64_to_cpus(x) __swab64s((x)) - #define __cpu_to_be32s(x) __swab32s((x)) - #define __be32_to_cpus(x) __swab32s((x)) - #define __cpu_to_be16s(x) __swab16s((x)) - #define __be16_to_cpus(x) __swab16s((x)) -#endif /* __constant_htonl */ - -#include - -#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */ diff --git a/include/byteorder/swab.h b/include/byteorder/swab.h deleted file mode 100644 index 13c974ca..00000000 --- a/include/byteorder/swab.h +++ /dev/null @@ -1,126 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _LINUX_BYTEORDER_SWAB_H -#define _LINUX_BYTEORDER_SWAB_H - -#if !defined(CONFIG_PLATFORM_MSTAR) -#ifndef __u16 - typedef unsigned short __u16; -#endif - -#ifndef __u32 - typedef unsigned int __u32; -#endif - -#ifndef __u8 - typedef unsigned char __u8; -#endif - -#ifndef __u64 - typedef unsigned long long __u64; -#endif - - -__inline static __u16 ___swab16(__u16 x) -{ - __u16 __x = x; - return - (__u16)( - (((__u16)(__x)&(__u16)0x00ffU) << 8) | - (((__u16)(__x)&(__u16)0xff00U) >> 8)); - -} - -__inline static __u32 ___swab32(__u32 x) -{ - __u32 __x = (x); - return (__u32)( - (((__u32)(__x)&(__u32)0x000000ffUL) << 24) | - (((__u32)(__x)&(__u32)0x0000ff00UL) << 8) | - (((__u32)(__x)&(__u32)0x00ff0000UL) >> 8) | - (((__u32)(__x)&(__u32)0xff000000UL) >> 24)); -} - -__inline static __u64 ___swab64(__u64 x) -{ - __u64 __x = (x); - - return - (__u64)(\ - (__u64)(((__u64)(__x)&(__u64)0x00000000000000ffULL) << 56) | \ - (__u64)(((__u64)(__x)&(__u64)0x000000000000ff00ULL) << 40) | \ - (__u64)(((__u64)(__x)&(__u64)0x0000000000ff0000ULL) << 24) | \ - (__u64)(((__u64)(__x)&(__u64)0x00000000ff000000ULL) << 8) | \ - (__u64)(((__u64)(__x)&(__u64)0x000000ff00000000ULL) >> 8) | \ - (__u64)(((__u64)(__x)&(__u64)0x0000ff0000000000ULL) >> 24) | \ - (__u64)(((__u64)(__x)&(__u64)0x00ff000000000000ULL) >> 40) | \ - (__u64)(((__u64)(__x)&(__u64)0xff00000000000000ULL) >> 56)); - \ -} -#endif /* CONFIG_PLATFORM_MSTAR */ - -#ifndef __arch__swab16 -__inline static __u16 __arch__swab16(__u16 x) -{ - return ___swab16(x); -} - -#endif - -#ifndef __arch__swab32 -__inline static __u32 __arch__swab32(__u32 x) -{ - __u32 __tmp = (x) ; - return ___swab32(__tmp); -} -#endif - -#ifndef __arch__swab64 - -__inline static __u64 __arch__swab64(__u64 x) -{ - __u64 __tmp = (x) ; - return ___swab64(__tmp); -} - - -#endif - -#ifndef __swab16 - #define __swab16(x) __fswab16(x) - #define __swab32(x) __fswab32(x) - #define __swab64(x) __fswab64(x) -#endif /* __swab16 */ - - __inline static const __u16 __fswab16(__u16 x) -{ - return __arch__swab16(x); -} - __inline static const __u32 __fswab32(__u32 x) -{ - return __arch__swab32(x); -} - -#define swab16 __swab16 -#define swab32 __swab32 -#define swab64 __swab64 -#define swab16p __swab16p -#define swab32p __swab32p -#define swab64p __swab64p -#define swab16s __swab16s -#define swab32s __swab32s -#define swab64s __swab64s - -#endif /* _LINUX_BYTEORDER_SWAB_H */ diff --git a/include/byteorder/swabb.h b/include/byteorder/swabb.h deleted file mode 100644 index 634519a0..00000000 --- a/include/byteorder/swabb.h +++ /dev/null @@ -1,151 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef _LINUX_BYTEORDER_SWABB_H -#define _LINUX_BYTEORDER_SWABB_H - -/* - * linux/byteorder/swabb.h - * SWAp Bytes Bizarrely - * swaHHXX[ps]?(foo) - * - * Support for obNUXIous pdp-endian and other bizarre architectures. - * Will Linux ever run on such ancient beasts? if not, this file - * will be but a programming pearl. Still, it's a reminder that we - * shouldn't be making too many assumptions when trying to be portable. - * - */ - -/* - * Meaning of the names I chose (vaxlinux people feel free to correct them): - * swahw32 swap 16-bit half-words in a 32-bit word - * swahb32 swap 8-bit halves of each 16-bit half-word in a 32-bit word - * - * No 64-bit support yet. I don't know NUXI conventions for long longs. - * I guarantee it will be a mess when it's there, though :-> - * It will be even worse if there are conflicting 64-bit conventions. - * Hopefully, no one ever used 64-bit objects on NUXI machines. - * - */ - -#define ___swahw32(x) \ - ({ \ - __u32 __x = (x); \ - ((__u32)(\ - (((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | \ - (((__u32)(__x) & (__u32)0xffff0000UL) >> 16))); \ - }) -#define ___swahb32(x) \ - ({ \ - __u32 __x = (x); \ - ((__u32)(\ - (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \ - (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8))); \ - }) - -#define ___constant_swahw32(x) \ - ((__u32)(\ - (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \ - (((__u32)(x) & (__u32)0xffff0000UL) >> 16))) -#define ___constant_swahb32(x) \ - ((__u32)(\ - (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \ - (((__u32)(x) & (__u32)0xff00ff00UL) >> 8))) - -/* - * provide defaults when no architecture-specific optimization is detected - */ -#ifndef __arch__swahw32 - #define __arch__swahw32(x) ___swahw32(x) -#endif -#ifndef __arch__swahb32 - #define __arch__swahb32(x) ___swahb32(x) -#endif - -#ifndef __arch__swahw32p - #define __arch__swahw32p(x) __swahw32(*(x)) -#endif -#ifndef __arch__swahb32p - #define __arch__swahb32p(x) __swahb32(*(x)) -#endif - -#ifndef __arch__swahw32s - #define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0) -#endif -#ifndef __arch__swahb32s - #define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0) -#endif - - -/* - * Allow constant folding - */ -#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) -# define __swahw32(x) \ - (__builtin_constant_p((__u32)(x)) ? \ - ___swahw32((x)) : \ - __fswahw32((x))) -# define __swahb32(x) \ - (__builtin_constant_p((__u32)(x)) ? \ - ___swahb32((x)) : \ - __fswahb32((x))) -#else -# define __swahw32(x) __fswahw32(x) -# define __swahb32(x) __fswahb32(x) -#endif /* OPTIMIZE */ - - -__inline static__ __const__ __u32 __fswahw32(__u32 x) -{ - return __arch__swahw32(x); -} -__inline static__ __u32 __swahw32p(__u32 *x) -{ - return __arch__swahw32p(x); -} -__inline static__ void __swahw32s(__u32 *addr) -{ - __arch__swahw32s(addr); -} - - -__inline static__ __const__ __u32 __fswahb32(__u32 x) -{ - return __arch__swahb32(x); -} -__inline static__ __u32 __swahb32p(__u32 *x) -{ - return __arch__swahb32p(x); -} -__inline static__ void __swahb32s(__u32 *addr) -{ - __arch__swahb32s(addr); -} - -#ifdef __BYTEORDER_HAS_U64__ - /* - * Not supported yet - */ -#endif /* __BYTEORDER_HAS_U64__ */ - -#if defined(PLATFORM_LINUX) - #define swahw32 __swahw32 - #define swahb32 __swahb32 - #define swahw32p __swahw32p - #define swahb32p __swahb32p - #define swahw32s __swahw32s - #define swahb32s __swahb32s -#endif - -#endif /* _LINUX_BYTEORDER_SWABB_H */ diff --git a/include/custom_gpio.h b/include/custom_gpio.h index a65c9890..6b7e17c6 100644 --- a/include/custom_gpio.h +++ b/include/custom_gpio.h @@ -18,9 +18,7 @@ #include #include -#ifdef PLATFORM_LINUX - #include -#endif +#include typedef enum cust_gpio_modes { WLAN_PWDN_ON, diff --git a/include/drv_types.h b/include/drv_types.h index e37762f5..35592699 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -1074,13 +1074,11 @@ struct dvobj_priv { struct rtw_traffic_statistics traffic_stat; -#ifdef PLATFORM_LINUX _thread_hdl_ rtnl_lock_holder; #if defined(CONFIG_IOCTL_CFG80211) && defined(RTW_SINGLE_WIPHY) struct wiphy *wiphy; #endif -#endif /* PLATFORM_LINUX */ #ifdef CONFIG_SWTIMER_BASED_TXBCN _timer txbcn_timer; @@ -1137,20 +1135,14 @@ struct dvobj_priv { u8 *usb_vendor_req_buf; #endif - -#ifdef PLATFORM_LINUX struct usb_interface *pusbintf; struct usb_device *pusbdev; -#endif/* PLATFORM_LINUX */ - - #endif/* CONFIG_USB_HCI */ /*-------- below is for PCIE INTERFACE --------*/ #ifdef CONFIG_PCI_HCI -#ifdef PLATFORM_LINUX struct pci_dev *ppcidev; /* PCI MEM map */ @@ -1192,7 +1184,6 @@ struct dvobj_priv { u8 b_support_aspm; /* If it supports ASPM, Offset[560h] = 0x40, otherwise Offset[560h] = 0x00. */ u8 b_support_backdoor; u8 bdma64; -#endif/* PLATFORM_LINUX */ #endif/* CONFIG_PCI_HCI */ @@ -1261,12 +1252,8 @@ static inline void dev_clr_drv_stopped(struct dvobj_priv *dvobj) #define dev_is_surprise_removed(dvobj) (atomic_read(&dvobj->bSurpriseRemoved) == _TRUE) #define dev_is_drv_stopped(dvobj) (atomic_read(&dvobj->bDriverStopped) == _TRUE) -#ifdef PLATFORM_LINUX static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj) { - /* todo: get interface type from dvobj and the return the dev accordingly */ -#ifdef RTW_DVOBJ_CHIP_HW_TYPE -#endif #ifdef CONFIG_USB_HCI return &dvobj->pusbintf->dev; @@ -1281,7 +1268,6 @@ static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj) return &dvobj->ppcidev->dev; #endif } -#endif _adapter *dvobj_get_port0_adapter(struct dvobj_priv *dvobj); _adapter *dvobj_get_unregisterd_adapter(struct dvobj_priv *dvobj); @@ -1465,16 +1451,11 @@ struct _ADAPTER { _thread_hdl_ recvThread; #endif u8 registered; -#ifndef PLATFORM_LINUX - NDIS_STATUS(*dvobj_init)(struct dvobj_priv *dvobj); - void (*dvobj_deinit)(struct dvobj_priv *dvobj); -#endif void (*intf_start)(_adapter *adapter); void (*intf_stop)(_adapter *adapter); -#ifdef PLATFORM_LINUX _nic_hdl pnetdev; char old_ifname[IFNAMSIZ]; @@ -1507,7 +1488,6 @@ struct _ADAPTER { #endif /* CONFIG_IOCTL_CFG80211 */ -#endif /* PLATFORM_LINUX */ u8 mac_addr[ETH_ALEN]; int net_closed; diff --git a/include/drv_types_gspi.h b/include/drv_types_gspi.h index c22c4972..79226075 100644 --- a/include/drv_types_gspi.h +++ b/include/drv_types_gspi.h @@ -16,19 +16,17 @@ #define __DRV_TYPES_GSPI_H__ /* SPI Header Files */ -#ifdef PLATFORM_LINUX - #include - #include - #include - /* #include */ - #include - #include - #include - #include - #include - #include - #include -#endif +#include +#include +#include +/* #include */ +#include +#include +#include +#include +#include +#include +#include typedef struct gspi_data { @@ -38,12 +36,10 @@ typedef struct gspi_data { u8 rx_block_mode; u32 block_transfer_len; -#ifdef PLATFORM_LINUX struct spi_device *func; struct workqueue_struct *priv_wq; struct delayed_work irq_work; -#endif } GSPI_DATA, *PGSPI_DATA; #endif /* #ifndef __DRV_TYPES_GSPI_H__ */ diff --git a/include/drv_types_pci.h b/include/drv_types_pci.h index a3a49270..048af08b 100644 --- a/include/drv_types_pci.h +++ b/include/drv_types_pci.h @@ -15,11 +15,7 @@ #ifndef __DRV_TYPES_PCI_H__ #define __DRV_TYPES_PCI_H__ - -#ifdef PLATFORM_LINUX - #include -#endif - +#include #define INTEL_VENDOR_ID 0x8086 #define SIS_VENDOR_ID 0x1039 @@ -117,74 +113,6 @@ typedef struct _PCI_COMMON_CONFIG { u8 MinimumGrant; u8 MaximumLatency; } type0; -#if 0 - struct _PCI_HEADER_TYPE_1 { - ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; - UCHAR PrimaryBusNumber; - UCHAR SecondaryBusNumber; - UCHAR SubordinateBusNumber; - UCHAR SecondaryLatencyTimer; - UCHAR IOBase; - UCHAR IOLimit; - USHORT SecondaryStatus; - USHORT MemoryBase; - USHORT MemoryLimit; - USHORT PrefetchableMemoryBase; - USHORT PrefetchableMemoryLimit; - ULONG PrefetchableMemoryBaseUpper32; - ULONG PrefetchableMemoryLimitUpper32; - USHORT IOBaseUpper; - USHORT IOLimitUpper; - ULONG Reserved2; - ULONG ExpansionROMBase; - UCHAR InterruptLine; - UCHAR InterruptPin; - USHORT BridgeControl; - } type1; - - struct _PCI_HEADER_TYPE_2 { - ULONG BaseAddress; - UCHAR CapabilitiesPtr; - UCHAR Reserved2; - USHORT SecondaryStatus; - UCHAR PrimaryBusNumber; - UCHAR CardbusBusNumber; - UCHAR SubordinateBusNumber; - UCHAR CardbusLatencyTimer; - ULONG MemoryBase0; - ULONG MemoryLimit0; - ULONG MemoryBase1; - ULONG MemoryLimit1; - USHORT IOBase0_LO; - USHORT IOBase0_HI; - USHORT IOLimit0_LO; - USHORT IOLimit0_HI; - USHORT IOBase1_LO; - USHORT IOBase1_HI; - USHORT IOLimit1_LO; - USHORT IOLimit1_HI; - UCHAR InterruptLine; - UCHAR InterruptPin; - USHORT BridgeControl; - USHORT SubVendorID; - USHORT SubSystemID; - ULONG LegacyBaseAddress; - UCHAR Reserved3[56]; - ULONG SystemControl; - UCHAR MultiMediaControl; - UCHAR GeneralStatus; - UCHAR Reserved4[2]; - UCHAR GPIO0Control; - UCHAR GPIO1Control; - UCHAR GPIO2Control; - UCHAR GPIO3Control; - ULONG IRQMuxRouting; - UCHAR RetryStatus; - UCHAR CardControl; - UCHAR DeviceControl; - UCHAR Diagnostic; - } type2; -#endif } u; u8 DeviceSpecific[108]; diff --git a/include/drv_types_sdio.h b/include/drv_types_sdio.h index 27eb5160..582fa3c9 100644 --- a/include/drv_types_sdio.h +++ b/include/drv_types_sdio.h @@ -16,17 +16,15 @@ #define __DRV_TYPES_SDIO_H__ /* SDIO Header Files */ -#ifdef PLATFORM_LINUX - #include - #include - #include - #include +#include +#include +#include +#include - #ifdef CONFIG_PLATFORM_SPRD - #include - #include - #endif /* CONFIG_PLATFORM_SPRD */ -#endif +#ifdef CONFIG_PLATFORM_SPRD + #include + #include +#endif /* CONFIG_PLATFORM_SPRD */ #define RTW_SDIO_CLK_33M 33000000 #define RTW_SDIO_CLK_40M 40000000 @@ -40,13 +38,11 @@ typedef struct sdio_data { u8 rx_block_mode; u32 block_transfer_len; -#ifdef PLATFORM_LINUX struct sdio_func *func; _thread_hdl_ sys_sdio_irq_thd; unsigned int clock; unsigned int timing; u8 sd3_bus_mode; -#endif } SDIO_DATA, *PSDIO_DATA; diff --git a/include/ieee80211.h b/include/ieee80211.h index ed317f4e..56872014 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -166,10 +166,7 @@ extern u8 WLAN_AKM_FT_FILS_SHA384[]; #define WLAN_AKM_TYPE_FT_FILS_SHA384 BIT(14) /* IEEE 802.11i */ -#define PMKID_LEN 16 -#define PMK_LEN 32 -#define PMK_LEN_SUITE_B_192 48 -#define PMK_LEN_MAX 48 + #define WPA_REPLAY_COUNTER_LEN 8 #define WPA_NONCE_LEN 32 #define WPA_KEY_RSC_LEN 8 @@ -177,24 +174,12 @@ extern u8 WLAN_AKM_FT_FILS_SHA384[]; #define WPA_GTK_MAX_LEN 32 /* IEEE 802.11, 8.5.2 EAPOL-Key frames */ -#define WPA_KEY_INFO_TYPE_MASK ((u16) (BIT(0) | BIT(1) | BIT(2))) -#define WPA_KEY_INFO_TYPE_AKM_DEFINED 0 -#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 BIT(0) -#define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES BIT(1) -#define WPA_KEY_INFO_TYPE_AES_128_CMAC 3 #define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */ + /* bit4..5 is used in WPA, but is reserved in IEEE 802.11i/RSN */ -#define WPA_KEY_INFO_KEY_INDEX_MASK (BIT(4) | BIT(5)) -#define WPA_KEY_INFO_KEY_INDEX_SHIFT 4 -#define WPA_KEY_INFO_INSTALL BIT(6) /* pairwise */ -#define WPA_KEY_INFO_TXRX BIT(6) /* group */ + #define WPA_KEY_INFO_ACK BIT(7) #define WPA_KEY_INFO_MIC BIT(8) -#define WPA_KEY_INFO_SECURE BIT(9) -#define WPA_KEY_INFO_ERROR BIT(10) -#define WPA_KEY_INFO_REQUEST BIT(11) -#define WPA_KEY_INFO_ENCR_KEY_DATA BIT(12) /* IEEE 802.11i/RSN only */ -#define WPA_KEY_INFO_SMK_MESSAGE BIT(13) struct ieee802_1x_hdr { u8 version; diff --git a/include/linux/wireless.h b/include/linux/wireless.h deleted file mode 100644 index c7f4a6c9..00000000 --- a/include/linux/wireless.h +++ /dev/null @@ -1,87 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ - -#ifndef _LINUX_WIRELESS_H -#define _LINUX_WIRELESS_H - -/***************************** INCLUDES *****************************/ - -#if 0 - #include /* for __u* and __s* typedefs */ - #include /* for "struct sockaddr" et al */ - #include /* for IFNAMSIZ and co... */ -#else - #define __user - /* typedef uint16_t __u16; */ - #include /* for "struct sockaddr" et al */ - #include /* for IFNAMSIZ and co... */ -#endif - -/****************************** TYPES ******************************/ -#ifdef CONFIG_COMPAT -struct compat_iw_point { - compat_caddr_t pointer; - __u16 length; - __u16 flags; -}; -#endif -/* --------------------------- SUBTYPES --------------------------- */ -/* - * For all data larger than 16 octets, we need to use a - * pointer to memory allocated in user space. - */ -struct iw_point { - void __user *pointer; /* Pointer to the data (in user space) */ - __u16 length; /* number of fields or size in bytes */ - __u16 flags; /* Optional params */ -}; - - -/* ------------------------ IOCTL REQUEST ------------------------ */ -/* - * This structure defines the payload of an ioctl, and is used - * below. - * - * Note that this structure should fit on the memory footprint - * of iwreq (which is the same as ifreq), which mean a max size of - * 16 octets = 128 bits. Warning, pointers might be 64 bits wide... - * You should check this when increasing the structures defined - * above in this file... - */ -union iwreq_data { - /* Config - generic */ - char name[IFNAMSIZ]; - /* Name : used to verify the presence of wireless extensions. - * Name of the protocol/provider... */ - - struct iw_point data; /* Other large parameters */ -}; - -/* - * The structure to exchange data for ioctl. - * This structure is the same as 'struct ifreq', but (re)defined for - * convenience... - * Do I need to remind you about structure size (32 octets) ? - */ -struct iwreq { - union { - char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */ - } ifr_ifrn; - - /* Data part (defined just above) */ - union iwreq_data u; -}; - -#endif /* _LINUX_WIRELESS_H */ diff --git a/include/osdep_intf.h b/include/osdep_intf.h index c140cbbe..57b6f339 100644 --- a/include/osdep_intf.h +++ b/include/osdep_intf.h @@ -43,7 +43,6 @@ struct intf_priv { _mutex ioctl_mutex; -#ifdef PLATFORM_LINUX #ifdef CONFIG_USB_HCI /* when in USB, IO is through interrupt in/out endpoints */ struct usb_device *udev; @@ -55,7 +54,6 @@ struct intf_priv { u8 bio_irp_timeout; u8 bio_timer_cancel; #endif -#endif }; @@ -82,7 +80,6 @@ void rtw_cancel_all_timer(_adapter *padapter); uint loadparam(_adapter *adapter); -#ifdef PLATFORM_LINUX int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname); @@ -114,7 +111,6 @@ void rtw_inetaddr_notifier_unregister(void); u8 rtw_rtnl_lock_needed(struct dvobj_priv *dvobj); void rtw_set_rtnl_lock_holder(struct dvobj_priv *dvobj, _thread_hdl_ thd_hdl); -#endif /* PLATFORM_LINUX */ void rtw_ips_dev_unload(_adapter *padapter); diff --git a/include/osdep_service.h b/include/osdep_service.h index ae08c060..17a70113 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -36,14 +36,12 @@ #undef _FALSE #define _FALSE 0 -#ifdef PLATFORM_LINUX - #include +#include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)) #include #include #endif - #include -#endif +#include /* #include */ @@ -311,9 +309,7 @@ __inline static unsigned char _cancel_timer_ex(_timer *ptimer) static __inline void thread_enter(char *name) { -#ifdef PLATFORM_LINUX allow_signal(SIGTERM); -#endif } void thread_exit(_completion *comp); void _rtw_init_completion(_completion *comp); @@ -322,33 +318,22 @@ void _rtw_wait_for_comp(_completion *comp); static inline bool rtw_thread_stop(_thread_hdl_ th) { -#ifdef PLATFORM_LINUX return kthread_stop(th); -#endif } static inline void rtw_thread_wait_stop(void) { -#ifdef PLATFORM_LINUX - #if 0 - while (!kthread_should_stop()) - msleep(10); - #else set_current_state(TASK_INTERRUPTIBLE); while (!kthread_should_stop()) { schedule(); set_current_state(TASK_INTERRUPTIBLE); } __set_current_state(TASK_RUNNING); - #endif -#endif } __inline static void flush_signals_thread(void) { -#ifdef PLATFORM_LINUX if (signal_pending(current)) flush_signals(current); -#endif } __inline static _OS_STATUS res_to_status(sint res) @@ -359,16 +344,11 @@ __inline static _OS_STATUS res_to_status(sint res) __inline static void rtw_dump_stack(void) { -#ifdef PLATFORM_LINUX dump_stack(); -#endif } -#ifdef PLATFORM_LINUX #define rtw_warn_on(condition) WARN_ON(condition) -#else -#define rtw_warn_on(condition) do {} while (0) -#endif + __inline static int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *parg4) { @@ -377,11 +357,8 @@ __inline static int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *p return ret; } -#ifdef PLATFORM_LINUX + #define RTW_DIV_ROUND_UP(n, d) DIV_ROUND_UP(n, d) -#else /* !PLATFORM_LINUX */ -#define RTW_DIV_ROUND_UP(n, d) (((n) + (d - 1)) / d) -#endif /* !PLATFORM_LINUX */ #define _RND(sz, r) ((((sz)+((r)-1))/(r))*(r)) #define RND4(x) (((x >> 2) + (((x & 3) == 0) ? 0 : 1)) << 2) @@ -647,10 +624,5 @@ int hexstr2bin(const char *hex, u8 *buf, size_t len); /* * Write formatted output to sized buffer */ -#ifdef PLATFORM_LINUX #define rtw_sprintf(buf, size, format, arg...) snprintf(buf, size, format, ##arg) -#else /* !PLATFORM_LINUX */ -#error "NOT DEFINE \"rtw_sprintf\"!!" -#endif /* !PLATFORM_LINUX */ - #endif diff --git a/include/recv_osdep.h b/include/recv_osdep.h index 8c569b6d..f691188e 100644 --- a/include/recv_osdep.h +++ b/include/recv_osdep.h @@ -53,7 +53,6 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, union recv_frame *r void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf); -#ifdef PLATFORM_LINUX #ifdef CONFIG_RTW_NAPI #include /* struct napi_struct */ @@ -62,6 +61,5 @@ int rtw_recv_napi_poll(struct napi_struct *, int budget); void dynamic_napi_th_chk (_adapter *adapter); #endif /* CONFIG_RTW_NAPI_DYNAMIC */ #endif /* CONFIG_RTW_NAPI */ -#endif /* PLATFORM_LINUX */ #endif /* */ diff --git a/include/rtl8188e_cmd.h b/include/rtl8188e_cmd.h index aba0bec1..1e40e2e1 100644 --- a/include/rtl8188e_cmd.h +++ b/include/rtl8188e_cmd.h @@ -15,23 +15,6 @@ #ifndef __RTL8188E_CMD_H__ #define __RTL8188E_CMD_H__ -#if 0 -enum cmd_msg_element_id { - NONE_CMDMSG_EID, - AP_OFFLOAD_EID = 0, - SET_PWRMODE_EID = 1, - JOINBSS_RPT_EID = 2, - RSVD_PAGE_EID = 3, - RSSI_4_EID = 4, - RSSI_SETTING_EID = 5, - MACID_CONFIG_EID = 6, - MACID_PS_MODE_EID = 7, - P2P_PS_OFFLOAD_EID = 8, - SELECTIVE_SUSPEND_ROF_CMD = 9, - P2P_PS_CTW_CMD_EID = 32, - MAX_CMDMSG_EID -}; -#else typedef enum _RTL8188E_H2C_CMD_ID { /* Class Common */ H2C_COM_RSVD_PAGE = 0x00, @@ -77,7 +60,6 @@ typedef enum _RTL8188E_H2C_CMD_ID { /* H2C_RESET_TSF =0xc0, */ } RTL8188E_H2C_CMD_ID; -#endif struct cmd_msg_parm { @@ -112,26 +94,6 @@ typedef struct JOINBSSRPT_PARM_88E { #endif /* CONFIG_WOWLAN */ } JOINBSSRPT_PARM_88E, *PJOINBSSRPT_PARM_88E; -#if 0 -/* move to hal_com_h2c.h */ -typedef struct _RSVDPAGE_LOC_88E { - u8 LocProbeRsp; - u8 LocPsPoll; - u8 LocNullData; - u8 LocQosNull; - u8 LocBTQosNull; -#ifdef CONFIG_WOWLAN - u8 LocRemoteCtrlInfo; - u8 LocArpRsp; - u8 LocNbrAdv; - u8 LocGTKRsp; - u8 LocGTKInfo; - u8 LocProbeReq; - u8 LocNetList; -#endif /* CONFIG_WOWLAN */ -} RSVDPAGE_LOC_88E, *PRSVDPAGE_LOC_88E; -#endif - /* host message to firmware cmd */ void rtl8188e_set_FwPwrMode_cmd(PADAPTER padapter, u8 Mode); void rtl8188e_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus); @@ -151,15 +113,4 @@ u8 GetTxBufferRsvdPageNum8188E(_adapter *padapter, bool wowlan); * ---------------------------------- H2C CMD CONTENT -------------------------------------------------- * --------------------------------------------------------------------------------------------------------- * */ -#if 0 - /* move to hal_com_h2c.h - * _RSVDPAGE_LOC_CMD_0x00 */ - #define SET_8188E_H2CCMD_RSVDPAGE_LOC_PROBE_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE(__pH2CCmd, 0, 8, __Value) - #define SET_8188E_H2CCMD_RSVDPAGE_LOC_PSPOLL(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) - #define SET_8188E_H2CCMD_RSVDPAGE_LOC_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+2, 0, 8, __Value) - #define SET_8188E_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+3, 0, 8, __Value) - /* AOAC_RSVDPAGE_LOC_0x83 */ - #define SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_REMOTE_WAKE_CTRL_INFO(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd), 0, 8, __Value) - #define SET_8188E_H2CCMD_AOAC_RSVDPAGE_LOC_ARP_RSP(__pH2CCmd, __Value) SET_BITS_TO_LE_1BYTE((__pH2CCmd)+1, 0, 8, __Value) -#endif #endif/* __RTL8188E_CMD_H__ */ diff --git a/include/rtl8188e_hal.h b/include/rtl8188e_hal.h index a344e491..60acc915 100644 --- a/include/rtl8188e_hal.h +++ b/include/rtl8188e_hal.h @@ -47,7 +47,6 @@ #define Rtl8188E_NIC_LPS_LEAVE_FLOW rtl8188E_leave_lps_flow -#if 1 /* download firmware related data structure */ #define MAX_FW_8188E_SIZE 0x8000 /* 32768, 32k / 16384, 16k */ #define FW_8188E_SIZE 0x4000 /* 16384, 16k */ @@ -102,7 +101,6 @@ typedef struct _RT_8188E_FIRMWARE_HDR { u32 Rsvd4; u32 Rsvd5; } RT_8188E_FIRMWARE_HDR, *PRT_8188E_FIRMWARE_HDR; -#endif /* download firmware related data structure */ #define DRIVER_EARLY_INT_TIME_8188E 0x05 diff --git a/include/rtl8188f_hal.h b/include/rtl8188f_hal.h index 9d5da6a3..03aac1a4 100644 --- a/include/rtl8188f_hal.h +++ b/include/rtl8188f_hal.h @@ -207,10 +207,6 @@ void Hal_EfuseParseXtal_8188F(PADAPTER pAdapter, u8 *hwinfo, u8 AutoLoadFail); void Hal_EfuseParseThermalMeter_8188F(PADAPTER padapter, u8 *hwinfo, u8 AutoLoadFail); void Hal_EfuseParseKFreeData_8188F(PADAPTER pAdapter, u8 *hwinfo, BOOLEAN AutoLoadFail); -#if 0 /* Do not need for rtl8188f */ -VOID Hal_EfuseParseVoltage_8188F(PADAPTER pAdapter, u8 *hwinfo, BOOLEAN AutoLoadFail); -#endif - void rtl8188f_set_pll_ref_clk_sel(_adapter *adapter, u8 sel); void rtl8188f_set_hal_ops(struct hal_ops *pHalFunc); diff --git a/include/rtl8192e_hal.h b/include/rtl8192e_hal.h index 716995f9..a588ff28 100644 --- a/include/rtl8192e_hal.h +++ b/include/rtl8192e_hal.h @@ -49,8 +49,6 @@ #define Rtl8192E_NIC_LPS_ENTER_FLOW rtl8192E_enter_lps_flow #define Rtl8192E_NIC_LPS_LEAVE_FLOW rtl8192E_leave_lps_flow - -#if 1 /* download firmware related data structure */ #define FW_SIZE_8192E 0x8000 /* Compatible with RTL8192e Maximal RAM code size 32k */ #define FW_START_ADDRESS 0x1000 #define FW_END_ADDRESS 0x5FFF @@ -102,7 +100,6 @@ typedef struct _RT_FIRMWARE_8192E { #define GET_FIRMWARE_HDR_RSVD4_8192E(__FwHdr) LE_BITS_TO_4BYTE(__FwHdr+24, 0, 32) #define GET_FIRMWARE_HDR_RSVD5_8192E(__FwHdr) LE_BITS_TO_4BYTE(__FwHdr+28, 0, 32) -#endif /* download firmware related data structure */ #define DRIVER_EARLY_INT_TIME_8192E 0x05 #define BCN_DMA_ATIME_INT_TIME_8192E 0x02 diff --git a/include/rtl8710b_hal.h b/include/rtl8710b_hal.h index b01dab08..31fcf618 100644 --- a/include/rtl8710b_hal.h +++ b/include/rtl8710b_hal.h @@ -222,29 +222,6 @@ VOID hal_set_syson_reg_8710b(PADAPTER padapter, u32 regaddr, u32 bitmask, u32 da /* EFuse */ u8 GetEEPROMSize8710B(PADAPTER padapter); -#if 0 -void Hal_InitPGData(PADAPTER padapter, u8 *PROMContent); -void Hal_EfuseParseIDCode(PADAPTER padapter, u8 *hwinfo); -void Hal_EfuseParseTxPowerInfo_8710B(PADAPTER padapter, - u8 *PROMContent, BOOLEAN AutoLoadFail); -void Hal_EfuseParseEEPROMVer_8710B(PADAPTER padapter, - u8 *hwinfo, BOOLEAN AutoLoadFail); -void Hal_EfuseParsePackageType_8710B(PADAPTER pAdapter, - u8 *hwinfo, BOOLEAN AutoLoadFail); -void Hal_EfuseParseChnlPlan_8710B(PADAPTER padapter, - u8 *hwinfo, BOOLEAN AutoLoadFail); -void Hal_EfuseParseCustomerID_8710B(PADAPTER padapter, - u8 *hwinfo, BOOLEAN AutoLoadFail); -void Hal_EfuseParseAntennaDiversity_8710B(PADAPTER padapter, - u8 *hwinfo, BOOLEAN AutoLoadFail); -void Hal_EfuseParseXtal_8710B(PADAPTER pAdapter, - u8 *hwinfo, u8 AutoLoadFail); -void Hal_EfuseParseThermalMeter_8710B(PADAPTER padapter, - u8 *hwinfo, u8 AutoLoadFail); -VOID Hal_EfuseParseBoardType_8710B(PADAPTER Adapter, - u8 *PROMContent, BOOLEAN AutoloadFail); -#endif - void rtl8710b_set_hal_ops(struct hal_ops *pHalFunc); void init_hal_spec_8710b(_adapter *adapter); u8 SetHwReg8710B(PADAPTER padapter, u8 variable, u8 *val); diff --git a/include/rtl8812a_hal.h b/include/rtl8812a_hal.h index 1ecfb72e..9caca161 100644 --- a/include/rtl8812a_hal.h +++ b/include/rtl8812a_hal.h @@ -60,8 +60,6 @@ #define Rtl8821A_NIC_LPS_ENTER_FLOW rtl8821A_enter_lps_flow #define Rtl8821A_NIC_LPS_LEAVE_FLOW rtl8821A_leave_lps_flow - -#if 1 /* download firmware related data structure */ #define FW_SIZE_8812 0x8000 /* Compatible with RTL8723 Maximal RAM code size 24K. modified to 32k, TO compatible with 92d maximal fw size 32k */ #define FW_START_ADDRESS 0x1000 #define FW_END_ADDRESS 0x5FFF @@ -112,8 +110,6 @@ typedef struct _RT_FIRMWARE_8812 { #define GET_FIRMWARE_HDR_RSVD4_8812(__FwHdr) LE_BITS_TO_4BYTE(__FwHdr+24, 0, 32) #define GET_FIRMWARE_HDR_RSVD5_8812(__FwHdr) LE_BITS_TO_4BYTE(__FwHdr+28, 0, 32) -#endif /* download firmware related data structure */ - #define DRIVER_EARLY_INT_TIME_8812 0x05 #define BCN_DMA_ATIME_INT_TIME_8812 0x02 @@ -239,13 +235,8 @@ typedef struct _RT_FIRMWARE_8812 { #define EFUSE_HIDDEN_812AU_VL 2 #define EFUSE_HIDDEN_812AU_VN 3 -#if 0 -#define EFUSE_REAL_CONTENT_LEN_JAGUAR 1024 -#define HWSET_MAX_SIZE_JAGUAR 1024 -#else #define EFUSE_REAL_CONTENT_LEN_JAGUAR 512 #define HWSET_MAX_SIZE_JAGUAR 512 -#endif #define EFUSE_MAX_BANK_8812A 2 #define EFUSE_MAP_LEN_JAGUAR 512 diff --git a/include/rtl8814a_hal.h b/include/rtl8814a_hal.h index aa7b4984..08ed9473 100644 --- a/include/rtl8814a_hal.h +++ b/include/rtl8814a_hal.h @@ -197,7 +197,6 @@ Chip specific -------------------------------------------------------------------------*/ /* pic buffer descriptor */ -#if 1 /* according to the define in the rtw_xmit.h, rtw_recv.h */ #define RTL8814AE_SEG_NUM TX_BUFFER_SEG_NUM /* 0:2 seg, 1: 4 seg, 2: 8 seg */ #define TX_DESC_NUM_8814A TX_BD_NUM /* 128 */ #define RX_DESC_NUM_8814A PCI_MAX_RX_COUNT /* 128 */ @@ -206,11 +205,6 @@ Chip specific #else #define BE_QUEUE_TX_DESC_NUM_8814A (TX_BD_NUM+(TX_BD_NUM>>1)) /* 192 */ #endif -#else - #define RTL8814AE_SEG_NUM TX_BUFFER_SEG_NUM /* 0:2 seg, 1: 4 seg, 2: 8 seg */ - #define TX_DESC_NUM_8814A 128 /* 1024//2048 change by ylb 20130624 */ - #define RX_DESC_NUM_8814A 128 /* 1024 //512 change by ylb 20130624 */ -#endif /* To prevent out of boundary programming case, leave 1byte and program full section * 9bytes + 1byt + 5bytes and pre 1byte. diff --git a/include/rtl8814a_recv.h b/include/rtl8814a_recv.h index 68da6333..320dd578 100644 --- a/include/rtl8814a_recv.h +++ b/include/rtl8814a_recv.h @@ -40,17 +40,6 @@ /* #else */ #define MAX_RECVBUF_SZ (4000) /* about 4K * #endif */ - - -#elif defined(CONFIG_SDIO_HCI) - #if 0 - /* temp solution */ - #ifdef CONFIG_SDIO_RX_COPY - #define MAX_RECVBUF_SZ (10240) - #else /* !CONFIG_SDIO_RX_COPY */ - #define MAX_RECVBUF_SZ MAX_RX_DMA_BUFFER_SIZE_8821 - #endif /* !CONFIG_SDIO_RX_COPY */ - #endif #endif @@ -75,12 +64,6 @@ /* DWORD 3*/ /* RESERVED */ - -#if 0 - /* ============= - * RX Info - * ============== */ -#endif /* DWORD 0 */ #define SET_RX_STATUS_DESC_PKT_LEN_8814A(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 0, 14, __Value) #define SET_RX_STATUS_DESC_EOR_8814A(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 30, 1, __Value) @@ -169,14 +152,6 @@ void rtl8814ae_free_recv_priv(PADAPTER padapter); #endif -#if 0 - /* temp solution */ - #ifdef CONFIG_SDIO_HCI - s32 InitRecvPriv8821AS(PADAPTER padapter); - void FreeRecvPriv8821AS(PADAPTER padapter); - #endif /* CONFIG_SDIO_HCI */ -#endif - void rtl8814_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc); #endif /* __RTL8814A_RECV_H__ */ diff --git a/include/rtl8814a_xmit.h b/include/rtl8814a_xmit.h index e3b6311a..b3c454ff 100644 --- a/include/rtl8814a_xmit.h +++ b/include/rtl8814a_xmit.h @@ -34,38 +34,15 @@ typedef struct txdescriptor_8814 { #define SET_TX_DESC_SDIO_TXSEQ_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+28, 16, 8, __Value) #endif /* CONFIG_SDIO_HCI */ -/* ----------------------------------------------------------------- - * RTL8814A TX BUFFER DESC - * ----------------------------------------------------------------- - * -- Each TXBD has 4 segment. - -- For 32 bit, each segment is 8 bytes. - -- For 64 bit, each segment is 16 bytes. -*/ -#if 0 - #if 1 /* 32 bit */ - #define SET_TX_EXTBUFF_DESC_LEN_8814A(__pTxDesc, __Value, __Set) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Set*8), 0, 16, __Value) - #define SET_TX_EXTBUFF_DESC_ADDR_LOW_8814A(__pTxDesc, __Value, __Set) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Set*8)+4, 0, 32, __Value) - #else /* 64 bit */ - #define SET_TX_EXTBUFF_DESC_LEN_8814A(__pTxDesc, __Value, __Set) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Set*16), 0, 16, __Value) - #define SET_TX_EXTBUFF_DESC_ADDR_LOW_8814A(__pTxDesc, __Value, __Set) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Set*16)+4, 0, 32, __Value) - #endif - #define SET_TX_EXTBUFF_DESC_ADDR_HIGH_8814A(__pTxDesc, __Value, __Set) SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Set*16)+8, 0, 32, __Value) -#endif /*c2h-DWORD 2*/ #define GET_RX_STATUS_DESC_RPT_SEL_8814A(__pRxDesc) LE_BITS_TO_4BYTE(__pRxDesc+8, 28, 1) /* ********************************************************* * for Txfilldescroptor8814Ae, fill the desc content. */ -#if 1 /* 32 bit */ - #define SET_TXBUFFER_DESC_LEN_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+((__Offset)*8), 0, 16, __Valeu) - #define SET_TXBUFFER_DESC_AMSDU_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+((__Offset)*8), 31, 1, __Valeu) - #define SET_TXBUFFER_DESC_ADD_LOW_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+((__Offset)*8)+4, 0, 32, __Valeu) -#else /* 64 bit */ - #define SET_TXBUFFER_DESC_LEN_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+((__Offset)*16), 0, 16, __Valeu) - #define SET_TXBUFFER_DESC_AMSDU_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+((__Offset)*16), 31, 1, __Valeu) - #define SET_TXBUFFER_DESC_ADD_LOW_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+((__Offset)*16)+4, 0, 32, __Valeu) -#endif +#define SET_TXBUFFER_DESC_LEN_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+((__Offset)*8), 0, 16, __Valeu) +#define SET_TXBUFFER_DESC_AMSDU_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+((__Offset)*8), 31, 1, __Valeu) +#define SET_TXBUFFER_DESC_ADD_LOW_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+((__Offset)*8)+4, 0, 32, __Valeu) + #define SET_TXBUFFER_DESC_ADD_HIGT_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) SET_BITS_TO_LE_4BYTE(__pTxDesc+((__Offset)*16)+8, 0, 32, __Valeu) /* ********************************************************* */ @@ -86,33 +63,6 @@ typedef struct txdescriptor_8814 { #define GET_TX_BUFF_DESC_ADDR_HIGH_0_8814A(__pTxDesc) LE_BITS_TO_4BYTE(__pTxDesc+8, 0, 32) /* Dword 3 */ /* RESERVED 0 */ -#if 0 /* 64 bit */ - /* Dword 4 */ - #define SET_TX_BUFF_DESC_LEN_1_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+16, 0, 16, __Value) - #define SET_TX_BUFF_DESC_AMSDU_1_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+16, 31, 1, __Value) - /* Dword 5 */ - #define SET_TX_BUFF_DESC_ADDR_LOW_1_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+20, 0, 32, __Value) - /* Dword 6 */ - #define SET_TX_BUFF_DESC_ADDR_HIGH_1_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+24, 0, 32, __Value) - /* Dword 7 */ /* RESERVED 0 */ - /* Dword 8 */ - #define SET_TX_BUFF_DESC_LEN_2_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+32, 0, 16, __Value) - #define SET_TX_BUFF_DESC_AMSDU_2_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+32, 31, 1, __Value) - /* Dword 9 */ - #define SET_TX_BUFF_DESC_ADDR_LOW_2_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+36, 0, 32, __Value) - /* Dword 10 */ - #define SET_TX_BUFF_DESC_ADDR_HIGH_2_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+40, 0, 32, __Value) - /* Dword 11 */ /* RESERVED 0 */ - /* Dword 12 */ - #define SET_TX_BUFF_DESC_LEN_3_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+48, 0, 16, __Value) - #define SET_TX_BUFF_DESC_AMSDU_3_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+48, 31, 1, __Value) - /* Dword 13 */ - #define SET_TX_BUFF_DESC_ADDR_LOW_3_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+52, 0, 32, __Value) - /* Dword 14 */ - #define SET_TX_BUFF_DESC_ADDR_HIGH_3_8814A(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+56, 0, 32, __Value) - /* Dword 15 */ /* RESERVED 0 */ -#endif - /* *****Desc content * TX Info * ************* diff --git a/include/rtl8821a_xmit.h b/include/rtl8821a_xmit.h index 5d973cdc..44e1d656 100644 --- a/include/rtl8821a_xmit.h +++ b/include/rtl8821a_xmit.h @@ -147,27 +147,4 @@ thread_return XmitThread8821AS(thread_context context); #endif /* !CONFIG_SDIO_TX_TASKLET */ #endif /* CONFIG_SDIO_HCI */ -#if 0 -#ifdef CONFIG_USB_HCI -s32 rtl8821au_init_xmit_priv(PADAPTER padapter); -void rtl8821au_free_xmit_priv(PADAPTER padapter); -s32 rtl8821au_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe); -s32 rtl8821au_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe); -s32 rtl8821au_hal_xmitframe_enqueue(PADAPTER padapter, struct xmit_frame *pxmitframe); -s32 rtl8821au_xmit_buf_handler(PADAPTER padapter); -void rtl8821au_xmit_tasklet(void *priv); -s32 rtl8821au_xmitframe_complete(PADAPTER padapter, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); -#endif /* CONFIG_USB_HCI */ - -#ifdef CONFIG_PCI_HCI -s32 rtl8821e_init_xmit_priv(PADAPTER padapter); -void rtl8821e_free_xmit_priv(PADAPTER padapter); -struct xmit_buf *rtl8821e_dequeue_xmitbuf(struct rtw_tx_ring *ring); -void rtl8821e_xmitframe_resume(PADAPTER padapter); -s32 rtl8821e_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe); -s32 rtl8821e_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe); -void rtl8821e_xmit_tasklet(void *priv); -#endif /* CONFIG_PCI_HCI */ -#endif - #endif /* __RTL8821_XMIT_H__ */ diff --git a/include/rtw_br_ext.h b/include/rtw_br_ext.h index 54ba75ea..4dae5c0c 100644 --- a/include/rtw_br_ext.h +++ b/include/rtw_br_ext.h @@ -15,7 +15,6 @@ #ifndef _RTW_BR_EXT_H_ #define _RTW_BR_EXT_H_ -#if 1 /* rtw_wifi_driver */ #define CL_IPV6_PASS 1 #define MACADDRLEN 6 #define _DEBUG_ERR RTW_INFO @@ -25,7 +24,6 @@ #define DEBUG_ERR RTW_INFO /* #define GET_MY_HWADDR ((GET_MIB(priv))->dot11OperationEntry.hwaddr) */ #define GET_MY_HWADDR(padapter) (adapter_mac_addr(padapter)) -#endif /* rtw_wifi_driver */ #define NAT25_HASH_BITS 4 #define NAT25_HASH_SIZE (1 << NAT25_HASH_BITS) diff --git a/include/rtw_btcoex.h b/include/rtw_btcoex.h index fd422489..4e364c9a 100644 --- a/include/rtw_btcoex.h +++ b/include/rtw_btcoex.h @@ -417,11 +417,9 @@ void rtw_btcoex_SetHciVersion(PADAPTER padapter, u16 hciVersion); void rtw_btcoex_StackUpdateProfileInfo(void); void rtw_btcoex_init_socket(_adapter *padapter); void rtw_btcoex_close_socket(_adapter *padapter); -void rtw_btcoex_dump_tx_msg(u8 *tx_msg, u8 len, u8 *msg_name); u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size, bool force); u8 rtw_btcoex_create_kernel_socket(_adapter *padapter); void rtw_btcoex_close_kernel_socket(_adapter *padapter); -void rtw_btcoex_recvmsgbysocket(void *data); u16 rtw_btcoex_parse_recv_data(u8 *msg, u8 msg_size); u8 rtw_btcoex_btinfo_cmd(PADAPTER padapter, u8 *pbuf, u16 length); void rtw_btcoex_parse_hci_cmd(_adapter *padapter, u8 *cmd, u16 len); diff --git a/include/rtw_byteorder.h b/include/rtw_byteorder.h index 8e6bb7a6..d0c5636b 100644 --- a/include/rtw_byteorder.h +++ b/include/rtw_byteorder.h @@ -22,10 +22,10 @@ #if defined(CONFIG_LITTLE_ENDIAN) #ifndef CONFIG_PLATFORM_MSTAR389 - #include + #include #endif #elif defined (CONFIG_BIG_ENDIAN) - #include + #include #else # error "Must be LITTLE/BIG Endian Host" #endif diff --git a/include/rtw_cmd.h b/include/rtw_cmd.h index f608eb14..6947352a 100644 --- a/include/rtw_cmd.h +++ b/include/rtw_cmd.h @@ -359,21 +359,6 @@ struct createbss_parm { s8 req_offset; }; -#if 0 -/* Caller Mode: AP, Ad-HoC, Infra */ -/* Notes: To set the NIC mode of RTL8711 */ -/* Command Mode */ -/* The definition of mode: */ - -#define IW_MODE_AUTO 0 /* Let the driver decides which AP to join */ -#define IW_MODE_ADHOC 1 /* Single cell network (Ad-Hoc Clients) */ -#define IW_MODE_INFRA 2 /* Multi cell network, roaming, .. */ -#define IW_MODE_MASTER 3 /* Synchronisation master or Access Point */ -#define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */ -#define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */ -#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ -#endif - struct setopmode_parm { u8 mode; u8 rsvd[3]; diff --git a/include/rtw_debug.h b/include/rtw_debug.h index ccd8d3ea..31b83ca0 100644 --- a/include/rtw_debug.h +++ b/include/rtw_debug.h @@ -54,13 +54,11 @@ enum { #undef _dbgdump #undef _seqdump -#if defined PLATFORM_LINUX - #define _dbgdump printk - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) - #define KERN_CONT - #endif - #define _seqdump seq_printf +#define _dbgdump printk +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) +#define KERN_CONT #endif +#define _seqdump seq_printf void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring, bool _idx_show, const u8 *_hexdata, int _hexdatalen); @@ -400,12 +398,6 @@ ssize_t proc_set_tx_amsdu_rate(struct file *file, const char __user *buffer, siz int proc_get_en_fwps(struct seq_file *m, void *v); ssize_t proc_set_en_fwps(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); -#if 0 -int proc_get_two_path_rssi(struct seq_file *m, void *v); -int proc_get_rssi_disp(struct seq_file *m, void *v); -ssize_t proc_set_rssi_disp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); -#endif - #ifdef CONFIG_BT_COEXIST int proc_get_btcoex_dbg(struct seq_file *m, void *v); ssize_t proc_set_btcoex_dbg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data); @@ -509,7 +501,6 @@ int proc_get_tx_auth(struct seq_file *m, void *v); #endif /* CONFIG_PROC_DEBUG */ 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); #ifdef CONFIG_CUSTOMER01_SMART_ANTENNA int proc_get_pathb_phase(struct seq_file *m, void *v); diff --git a/include/rtw_eeprom.h b/include/rtw_eeprom.h index 62304d57..6e587df7 100644 --- a/include/rtw_eeprom.h +++ b/include/rtw_eeprom.h @@ -105,12 +105,10 @@ extern void eeprom_read_sz(_adapter *padapter, u16 reg, u8 *data, u32 sz); extern void read_eeprom_content_by_attrib(_adapter *padapter); -#ifdef PLATFORM_LINUX #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE extern int isAdaptorInfoFileValid(void); extern int storeAdaptorInfoFile(char *path, u8 *efuse_data); extern int retriveAdaptorInfoFile(char *path, u8 *efuse_data); #endif /* CONFIG_ADAPTOR_INFO_CACHING_FILE */ -#endif /* PLATFORM_LINUX */ #endif /* __RTL871X_EEPROM_H__ */ diff --git a/include/rtw_efuse.h b/include/rtw_efuse.h index 30527021..8550e202 100644 --- a/include/rtw_efuse.h +++ b/include/rtw_efuse.h @@ -244,12 +244,10 @@ extern const u8 _mac_hidden_proto_to_hal_proto_cap[]; u8 mac_hidden_wl_func_to_hal_wl_func(u8 func); -#ifdef PLATFORM_LINUX u8 rtw_efuse_file_read(PADAPTER padapter, u8 *filepatch, u8 *buf, u32 len); #ifdef CONFIG_EFUSE_CONFIG_FILE u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size); u32 rtw_read_macaddr_from_file(const char *path, u8 *buf); #endif /* CONFIG_EFUSE_CONFIG_FILE */ -#endif /* PLATFORM_LINUX */ #endif diff --git a/include/rtw_io.h b/include/rtw_io.h index 8a0b810b..35ce647c 100644 --- a/include/rtw_io.h +++ b/include/rtw_io.h @@ -18,9 +18,7 @@ #define NUM_IOREQ 8 -#ifdef PLATFORM_LINUX - #define MAX_PROT_SZ (64-16) -#endif +#define MAX_PROT_SZ (64-16) #define _IOREADY 0 #define _IO_WAIT_COMPLETE 1 @@ -141,23 +139,6 @@ struct io_req { struct intf_hdl { -#if 0 - u32 intf_option; - u32 bus_status; - u32 do_flush; - u8 *adapter; - u8 *intf_dev; - struct intf_priv *pintfpriv; - u8 cnt; - void (*intf_hdl_init)(u8 *priv); - void (*intf_hdl_unload)(u8 *priv); - void (*intf_hdl_open)(u8 *priv); - void (*intf_hdl_close)(u8 *priv); - struct _io_ops io_ops; - /* u8 intf_status;//moved to struct intf_priv */ - u16 len; - u16 done_len; -#endif _adapter *padapter; struct dvobj_priv *pintf_dev;/* pointer to &(padapter->dvobjpriv); */ @@ -349,7 +330,6 @@ extern int rtw_write32(_adapter *adapter, u32 addr, u32 val); extern int rtw_writeN(_adapter *adapter, u32 addr, u32 length, u8 *pdata); #ifdef CONFIG_SDIO_HCI -u8 _rtw_sd_f0_read8(_adapter *adapter, u32 addr); #ifdef CONFIG_SDIO_INDIRECT_ACCESS u8 _rtw_sd_iread8(_adapter *adapter, u32 addr); u16 _rtw_sd_iread16(_adapter *adapter, u32 addr); @@ -378,7 +358,6 @@ bool match_rf_read_sniff_ranges(_adapter *adapter, u8 path, u32 addr, u32 mask); bool match_rf_write_sniff_ranges(_adapter *adapter, u8 path, u32 addr, u32 mask); #ifdef CONFIG_SDIO_HCI -u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const int line); #ifdef CONFIG_SDIO_INDIRECT_ACCESS u8 dbg_rtw_sd_iread8(_adapter *adapter, u32 addr, const char *caller, const int line); u16 dbg_rtw_sd_iread16(_adapter *adapter, u32 addr, const char *caller, const int line); @@ -403,7 +382,6 @@ int dbg_rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val, const char *caller #define rtw_write_port_cancel(adapter) _rtw_write_port_cancel(adapter) #ifdef CONFIG_SDIO_HCI -#define rtw_sd_f0_read8(adapter, addr) dbg_rtw_sd_f0_read8((adapter), (addr), __func__, __LINE__) #ifdef CONFIG_SDIO_INDIRECT_ACCESS #define rtw_sd_iread8(adapter, addr) dbg_rtw_sd_iread8((adapter), (addr), __func__, __LINE__) #define rtw_sd_iread16(adapter, addr) dbg_rtw_sd_iread16((adapter), (addr), __func__, __LINE__) @@ -430,7 +408,6 @@ int dbg_rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val, const char *caller #define rtw_write_port_cancel(adapter) _rtw_write_port_cancel((adapter)) #ifdef CONFIG_SDIO_HCI -#define rtw_sd_f0_read8(adapter, addr) _rtw_sd_f0_read8((adapter), (addr)) #ifdef CONFIG_SDIO_INDIRECT_ACCESS #define rtw_sd_iread8(adapter, addr) _rtw_sd_iread8((adapter), (addr)) #define rtw_sd_iread16(adapter, addr) _rtw_sd_iread16((adapter), (addr)) diff --git a/include/rtw_ioctl.h b/include/rtw_ioctl.h index cba984fc..cee2e15a 100644 --- a/include/rtw_ioctl.h +++ b/include/rtw_ioctl.h @@ -84,7 +84,7 @@ struct oid_obj_priv { NDIS_STATUS(*oidfuns)(struct oid_par_priv *poid_par_priv); }; -#if defined(PLATFORM_LINUX) && defined(CONFIG_WIRELESS_EXT) +#ifdef CONFIG_WIRELESS_EXT extern struct iw_handler_def rtw_handlers_def; #endif diff --git a/include/rtw_mlme.h b/include/rtw_mlme.h index f38fb15c..49bb03c5 100644 --- a/include/rtw_mlme.h +++ b/include/rtw_mlme.h @@ -21,15 +21,7 @@ /* #define MAX_JOIN_TIMEOUT 2500 */ #define MAX_JOIN_TIMEOUT 6500 -/* Commented by Albert 20101105 - * Increase the scanning timeout because of increasing the SURVEY_TO value. */ - - -#ifdef PALTFORM_OS_WINCE -#define SCANQUEUE_LIFETIME 12000000 /* unit:us */ -#else #define SCANQUEUE_LIFETIME 20000 /* 20sec, unit:msec */ -#endif #define WIFI_NULL_STATE 0x00000000 #define WIFI_ASOC_STATE 0x00000001 /* Linked */ diff --git a/include/rtw_mlme_ext.h b/include/rtw_mlme_ext.h index 20cfa29a..d93c9c7a 100644 --- a/include/rtw_mlme_ext.h +++ b/include/rtw_mlme_ext.h @@ -1025,10 +1025,6 @@ void addba_timer_hdl(void *ctx); #ifdef CONFIG_IEEE80211W void sa_query_timer_hdl(void *ctx); #endif /* CONFIG_IEEE80211W */ -#if 0 -void reauth_timer_hdl(_adapter *padapter); -void reassoc_timer_hdl(_adapter *padapter); -#endif #define set_survey_timer(mlmeext, ms) \ do { \ diff --git a/include/rtw_mp.h b/include/rtw_mp.h index 63a5b6d6..d03a5124 100644 --- a/include/rtw_mp.h +++ b/include/rtw_mp.h @@ -416,30 +416,9 @@ typedef struct _MP_FIRMWARE { #define RAISE _FALSE /* Hardware Registers */ -#if 0 -#if 0 -#define IOCMD_CTRL_REG 0x102502C0 -#define IOCMD_DATA_REG 0x102502C4 -#else -#define IOCMD_CTRL_REG 0x10250370 -#define IOCMD_DATA_REG 0x10250374 -#endif - -#define IOCMD_GET_THERMAL_METER 0xFD000028 - -#define IOCMD_CLASS_BB_RF 0xF0 -#define IOCMD_BB_READ_IDX 0x00 -#define IOCMD_BB_WRITE_IDX 0x01 -#define IOCMD_RF_READ_IDX 0x02 -#define IOCMD_RF_WRIT_IDX 0x03 -#endif #define BB_REG_BASE_ADDR 0x800 /* MP variables */ -#if 0 -#define _2MAC_MODE_ 0 -#define _LOOPBOOK_MODE_ 1 -#endif typedef enum _MP_MODE_ { MP_OFF, MP_ON, @@ -638,11 +617,6 @@ typedef enum _MPT_TXPWR_DEF { #define IS_MPT_VHT_RATE(_rate) (_rate >= MPT_RATE_VHT1SS_MCS0 && _rate <= MPT_RATE_VHT4SS_MCS9) #define IS_MPT_CCK_RATE(_rate) (_rate >= MPT_RATE_1M && _rate <= MPT_RATE_11M) #define IS_MPT_OFDM_RATE(_rate) (_rate >= MPT_RATE_6M && _rate <= MPT_RATE_54M) -/*************************************************************************/ -#if 0 -extern struct mp_xmit_frame *alloc_mp_xmitframe(struct mp_priv *pmp_priv); -extern int free_mp_xmitframe(struct xmit_priv *pxmitpriv, struct mp_xmit_frame *pmp_xmitframe); -#endif extern s32 init_mp_priv(PADAPTER padapter); extern void free_mp_priv(struct mp_priv *pmp_priv); diff --git a/include/rtw_mp_ioctl.h b/include/rtw_mp_ioctl.h index 2127ec1e..6b8b3e0f 100644 --- a/include/rtw_mp_ioctl.h +++ b/include/rtw_mp_ioctl.h @@ -18,13 +18,6 @@ #include #include -#if 0 -#define TESTFWCMDNUMBER 1000000 -#define TEST_H2CINT_WAIT_TIME 500 -#define TEST_C2HINT_WAIT_TIME 500 -#define HCI_TEST_SYSCFG_HWMASK 1 -#define _BUSCLK_40M (4 << 2) -#endif /* ------------------------------------------------------------------------------ */ typedef struct CFG_DBG_MSG_STRUCT { u32 DebugLevel; diff --git a/include/rtw_mp_phy_regdef.h b/include/rtw_mp_phy_regdef.h index be627800..da6ccc3a 100644 --- a/include/rtw_mp_phy_regdef.h +++ b/include/rtw_mp_phy_regdef.h @@ -1060,15 +1060,6 @@ #define bWMACControl 0x1 #define bWNICControl 0x2 -#if 0 -#define ANTENNA_A 0x1 /* Useless */ -#define ANTENNA_B 0x2 -#define ANTENNA_AB 0x3 /* ANTENNA_A | ANTENNA_B */ - -#define ANTENNA_C 0x4 -#define ANTENNA_D 0x8 -#endif - #define RCR_AAP BIT(0) /* accept all physical address */ #define RCR_APM BIT(1) /* accept physical match */ #define RCR_AM BIT(2) /* accept multicast */ diff --git a/include/rtw_p2p.h b/include/rtw_p2p.h index 1f985ad1..6d71ad5f 100644 --- a/include/rtw_p2p.h +++ b/include/rtw_p2p.h @@ -93,15 +93,6 @@ static inline void _rtw_p2p_set_pre_state(struct wifidirect_info *wdinfo, enum P if (wdinfo->pre_p2p_state != state) wdinfo->pre_p2p_state = state; } -#if 0 -static inline void _rtw_p2p_restore_state(struct wifidirect_info *wdinfo) -{ - if (wdinfo->pre_p2p_state != -1) { - wdinfo->p2p_state = wdinfo->pre_p2p_state; - wdinfo->pre_p2p_state = -1; - } -} -#endif void _rtw_p2p_set_role(struct wifidirect_info *wdinfo, enum P2P_ROLE role); static inline int _rtw_p2p_state(struct wifidirect_info *wdinfo) diff --git a/include/rtw_recv.h b/include/rtw_recv.h index 22e37d49..f379253d 100644 --- a/include/rtw_recv.h +++ b/include/rtw_recv.h @@ -94,24 +94,6 @@ struct stainfo_rxcache { u16 tid_rxseq[16]; u8 iv[16][8]; u8 last_tid; -#if 0 - unsigned short tid0_rxseq; - unsigned short tid1_rxseq; - unsigned short tid2_rxseq; - unsigned short tid3_rxseq; - unsigned short tid4_rxseq; - unsigned short tid5_rxseq; - unsigned short tid6_rxseq; - unsigned short tid7_rxseq; - unsigned short tid8_rxseq; - unsigned short tid9_rxseq; - unsigned short tid10_rxseq; - unsigned short tid11_rxseq; - unsigned short tid12_rxseq; - unsigned short tid13_rxseq; - unsigned short tid14_rxseq; - unsigned short tid15_rxseq; -#endif }; @@ -365,9 +347,7 @@ struct recv_priv { atomic_t rx_pending_cnt; #ifdef CONFIG_USB_INTERRUPT_IN_PIPE -#ifdef PLATFORM_LINUX PURB int_in_urb; -#endif u8 *int_in_buf; #endif /* CONFIG_USB_INTERRUPT_IN_PIPE */ @@ -508,9 +488,7 @@ u32 alloc_sz; #endif -#if defined(PLATFORM_LINUX) _pkt *pskb; -#endif }; diff --git a/include/rtw_xmit.h b/include/rtw_xmit.h index 2ac6101e..491dda77 100644 --- a/include/rtw_xmit.h +++ b/include/rtw_xmit.h @@ -346,53 +346,6 @@ struct hw_xmit { int accnt; }; -#if 0 -struct pkt_attrib { - u8 type; - u8 subtype; - u8 bswenc; - u8 dhcp_pkt; - u16 ether_type; - int pktlen; /* the original 802.3 pkt raw_data len (not include ether_hdr data) */ - int pkt_hdrlen; /* the original 802.3 pkt header len */ - int hdrlen; /* the WLAN Header Len */ - int nr_frags; - int last_txcmdsz; - int encrypt; /* when 0 indicate no encrypt. when non-zero, indicate the encrypt algorith */ - u8 iv[8]; - int iv_len; - u8 icv[8]; - int icv_len; - int priority; - int ack_policy; - int mac_id; - int vcs_mode; /* virtual carrier sense method */ - - u8 dst[ETH_ALEN]; - u8 src[ETH_ALEN]; - u8 ta[ETH_ALEN]; - u8 ra[ETH_ALEN]; - - u8 key_idx; - - u8 qos_en; - u8 ht_en; - u8 raid;/* rate adpative id */ - u8 bwmode; - u8 ch_offset;/* PRIME_CHNL_OFFSET */ - u8 sgi;/* short GI */ - u8 ampdu_en;/* tx ampdu enable */ - u8 mdata;/* more data bit */ - u8 eosp; - - u8 triggered;/* for ap mode handling Power Saving sta */ - - u32 qsel; - u16 seqnum; - - struct sta_info *psta; -}; -#else /* reduce size */ struct pkt_attrib { u8 type; @@ -494,7 +447,6 @@ struct pkt_attrib { #endif }; -#endif #ifdef CONFIG_RTW_MESH #define XATTRIB_GET_MCTRL_LEN(xattrib) ((xattrib)->meshctrl_len) @@ -537,9 +489,7 @@ struct submit_ctx { systime submit_time; /* */ u32 timeout_ms; /* <0: not synchronous, 0: wait forever, >0: up to ms waiting */ int status; /* status for operation */ -#ifdef PLATFORM_LINUX struct completion done; -#endif }; enum { @@ -776,9 +726,7 @@ struct xmit_priv { _sema tx_retevt;/* all tx return event; */ u8 txirp_cnt; -#ifdef PLATFORM_LINUX struct tasklet_struct xmit_tasklet; -#endif /* per AC pending irp */ int beq_cnt; int bkq_cnt; @@ -792,16 +740,12 @@ struct xmit_priv { struct rtw_tx_ring tx_ring[PCI_MAX_TX_QUEUE_COUNT]; int txringcount[PCI_MAX_TX_QUEUE_COUNT]; u8 beaconDMAing; /* flag of indicating beacon is transmiting to HW by DMA */ -#ifdef PLATFORM_LINUX struct tasklet_struct xmit_tasklet; #endif -#endif #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) #ifdef CONFIG_SDIO_TX_TASKLET -#ifdef PLATFORM_LINUX struct tasklet_struct xmit_tasklet; -#endif /* PLATFORM_LINUX */ #else _thread_hdl_ SdioXmitThread; _sema SdioXmitSema; diff --git a/include/sdio_ops.h b/include/sdio_ops.h index f1531bd5..783ac8f8 100644 --- a/include/sdio_ops.h +++ b/include/sdio_ops.h @@ -21,9 +21,7 @@ #define SDIO_ERR_VAL16 0xFFFF #define SDIO_ERR_VAL32 0xFFFFFFFF -#ifdef PLATFORM_LINUX #include -#endif extern void sdio_set_intf_ops(_adapter *padapter, struct _io_ops *pops); @@ -34,10 +32,6 @@ void sdio_deinit(struct dvobj_priv *dvobj); int sdio_alloc_irq(struct dvobj_priv *dvobj); void sdio_free_irq(struct dvobj_priv *dvobj); -#if 0 -extern void sdio_func1cmd52_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem); -extern void sdio_func1cmd52_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem); -#endif extern u8 SdioLocalCmd52Read1Byte(PADAPTER padapter, u32 addr); extern void SdioLocalCmd52Write1Byte(PADAPTER padapter, u32 addr, u8 v); extern s32 _sdio_local_read(PADAPTER padapter, u32 addr, u32 cnt, u8 *pbuf); diff --git a/include/usb_ops.h b/include/usb_ops.h index be74f016..12064c1d 100644 --- a/include/usb_ops.h +++ b/include/usb_ops.h @@ -26,9 +26,7 @@ #define MAX_VENDOR_REQ_CMD_SIZE 254 /* 8188cu SIE Support */ #define MAX_USB_IO_CTL_SIZE (MAX_VENDOR_REQ_CMD_SIZE + ALIGNMENT_UNIT) -#ifdef PLATFORM_LINUX #include -#endif /* PLATFORM_LINUX */ #ifdef CONFIG_RTL8188E void rtl8188eu_set_hw_type(struct dvobj_priv *pdvobj); diff --git a/include/wifi.h b/include/wifi.h index e8cf7f76..2b2fee4a 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -357,16 +357,6 @@ static inline int IsFrameTypeData(unsigned char *pframe) #define _IEEE8021X_MGT_ 1 /* WPA */ #define _IEEE8021X_PSK_ 2 /* WPA with pre-shared key */ -#if 0 -#define _NO_PRIVACY_ 0 -#define _WEP_40_PRIVACY_ 1 -#define _TKIP_PRIVACY_ 2 -#define _WRAP_PRIVACY_ 3 -#define _CCMP_PRIVACY_ 4 -#define _WEP_104_PRIVACY_ 5 -#define _WEP_WPA_MIXED_PRIVACY_ 6 /* WEP + WPA */ -#endif - #define _MME_IE_LENGTH_ 18 /*----------------------------------------------------------------------------- diff --git a/include/wlan_bssdef.h b/include/wlan_bssdef.h index bfaea092..8f780cc7 100644 --- a/include/wlan_bssdef.h +++ b/include/wlan_bssdef.h @@ -18,9 +18,6 @@ #define MAX_IE_SZ 768 - -#ifdef PLATFORM_LINUX - #define NDIS_802_11_LENGTH_SSID 32 #define NDIS_802_11_LENGTH_RATES 8 #define NDIS_802_11_LENGTH_RATES_EX 16 @@ -98,44 +95,6 @@ typedef struct _NDIS_802_11_VARIABLE_IEs { UCHAR data[1]; } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs; - - -/* - - - -Length is the 4 bytes multiples of the sume of - sizeof (NDIS_802_11_MAC_ADDRESS) + 2 + sizeof (NDIS_802_11_SSID) + sizeof (ULONG) -+ sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) + sizeof (NDIS_802_11_CONFIGURATION) -+ sizeof (NDIS_802_11_RATES_EX) + IELength - -Except the IELength, all other fields are fixed length. Therefore, we can define a marco to present the -partial sum. - -*/ -#if 0 -typedef struct _NDIS_WLAN_BSSID_EX { - ULONG Length; - NDIS_802_11_MAC_ADDRESS MacAddress; - UCHAR Reserved[2];/* [0]: IS beacon frame, [1]:optimum_antenna=>For antenna diversity; */ - NDIS_802_11_SSID Ssid; - ULONG Privacy; - NDIS_802_11_RSSI Rssi; - NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; - NDIS_802_11_CONFIGURATION Configuration; - NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; - NDIS_802_11_RATES_EX SupportedRates; - ULONG IELength; - UCHAR IEs[MAX_IE_SZ]; /* (timestamp, beacon interval, and capability information) */ -} NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX; - - -typedef struct _NDIS_802_11_BSSID_LIST_EX { - ULONG NumberOfItems; - NDIS_WLAN_BSSID_EX Bssid[1]; -} NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX; -#endif - typedef enum _NDIS_802_11_AUTHENTICATION_MODE { Ndis802_11AuthModeOpen, Ndis802_11AuthModeShared, @@ -267,7 +226,6 @@ typedef struct _NDIS_802_11_TEST { } NDIS_802_11_TEST, *PNDIS_802_11_TEST; -#endif /* end of #ifdef PLATFORM_LINUX */ #ifndef Ndis802_11APMode #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1) @@ -335,28 +293,7 @@ WLAN_BSSID_EX, *PWLAN_BSSID_EX; __inline static uint get_WLAN_BSSID_EX_sz(WLAN_BSSID_EX *bss) { -#if 0 - uint t_len; - - t_len = sizeof(ULONG) - + sizeof(NDIS_802_11_MAC_ADDRESS) - + 2 - + sizeof(NDIS_802_11_SSID) - + sizeof(ULONG) - + sizeof(NDIS_802_11_RSSI) - + sizeof(NDIS_802_11_NETWORK_TYPE) - + sizeof(NDIS_802_11_CONFIGURATION) - + sizeof(NDIS_802_11_NETWORK_INFRASTRUCTURE) - + sizeof(NDIS_802_11_RATES_EX) - /* all new member add here */ - + sizeof(WLAN_PHY_INFO) - /* all new member add here */ - + sizeof(ULONG) - + bss->IELength; - return t_len; -#else return sizeof(WLAN_BSSID_EX) - MAX_IE_SZ + bss->IELength; -#endif } struct wlan_network { diff --git a/include/xmit_osdep.h b/include/xmit_osdep.h index 793b0c75..89aba285 100644 --- a/include/xmit_osdep.h +++ b/include/xmit_osdep.h @@ -25,9 +25,6 @@ struct pkt_file { SIZE_T buf_len; }; - -#ifdef PLATFORM_LINUX - #define NR_XMITFRAME 256 struct xmit_priv; @@ -39,7 +36,6 @@ struct xmit_buf; extern int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); extern int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev); -#endif /* PLATFORM_LINUX */ void rtw_os_xmit_schedule(_adapter *padapter); diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index b26aaf7f..e754dd80 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -756,9 +756,6 @@ static int rtw_cfg80211_clear_wps_sr_of_non_target_bss(_adapter *padapter, struc psr = rtw_get_wps_attr_content(wpsie, wpsielen, WPS_ATTR_SELECTED_REGISTRAR, &sr, NULL); if (psr && sr) { - if (0) - RTW_INFO("clear sr of non target bss:%s("MAC_FMT")\n" - , pssid->Ssid, MAC_ARG(pnetwork->network.MacAddress)); *psr = 0; /* clear sr */ ret = 1; } @@ -824,10 +821,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net freq = rtw_ch2freq(channel); notify_channel = ieee80211_get_channel(wiphy, freq); - if (0) - notify_timestamp = le64_to_cpu(*(u64 *)rtw_get_timestampe_from_ie(pnetwork->network.IEs)); - else - notify_timestamp = rtw_get_systime_us(); + notify_timestamp = rtw_get_systime_us(); notify_interval = le16_to_cpu(*(u16 *)rtw_get_beacon_interval_from_ie(pnetwork->network.IEs)); notify_capability = le16_to_cpu(*(u16 *)rtw_get_capability_from_ie(pnetwork->network.IEs)); @@ -843,15 +837,6 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net notify_signal = 100 * translate_percentage_to_dbm(pnetwork->network.PhyInfo.SignalStrength); /* dbm */ } -#if 0 - RTW_INFO("bssid: "MAC_FMT"\n", MAC_ARG(pnetwork->network.MacAddress)); - RTW_INFO("Channel: %d(%d)\n", channel, freq); - RTW_INFO("Capability: %X\n", notify_capability); - RTW_INFO("Beacon interval: %d\n", notify_interval); - RTW_INFO("Signal: %d\n", notify_signal); - RTW_INFO("notify_timestamp: %llu\n", notify_timestamp); -#endif - /* pbuf = buf; */ pwlanhdr = (struct ieee80211_hdr *)pbuf; @@ -885,15 +870,8 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net RTW_INFO("%s, got p2p_ie\n", __func__); #endif -#if 1 bss = cfg80211_inform_bss_frame(wiphy, notify_channel, (struct ieee80211_mgmt *)pbuf, len, notify_signal, GFP_ATOMIC); -#else - - bss = cfg80211_inform_bss(wiphy, notify_channel, (const u8 *)pnetwork->network.MacAddress, - notify_timestamp, notify_capability, notify_interval, notify_ie, - notify_ielen, notify_signal, GFP_ATOMIC/*GFP_KERNEL*/); -#endif if (unlikely(!bss)) { RTW_INFO(FUNC_ADPT_FMT" bss NULL\n", FUNC_ADPT_ARG(padapter)); @@ -913,17 +891,6 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net #endif /* COMPAT_KERNEL_RELEASE */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38) */ -#if 0 - { - if (bss->information_elements == bss->proberesp_ies) { - if (bss->len_information_elements != bss->len_proberesp_ies) - RTW_INFO("error!, len_information_elements != bss->len_proberesp_ies\n"); - } else if (bss->len_information_elements < bss->len_beacon_ies) { - bss->information_elements = bss->beacon_ies; - bss->len_information_elements = bss->len_beacon_ies; - } - } -#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) cfg80211_put_bss(wiphy, bss); #else @@ -1030,8 +997,7 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter) /* notify cfg80211 that device joined an IBSS */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)) freq = rtw_ch2freq(cur_network->network.Configuration.DSConfig); - if (1) - RTW_INFO("chan: %d, freq: %d\n", cur_network->network.Configuration.DSConfig, freq); + RTW_INFO("chan: %d, freq: %d\n", cur_network->network.Configuration.DSConfig, freq); notify_channel = ieee80211_get_channel(wiphy, freq); cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, notify_channel, GFP_ATOMIC); #else @@ -2305,23 +2271,6 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy, extern int netdev_open(struct net_device *pnetdev); -#if 0 -enum nl80211_iftype { - NL80211_IFTYPE_UNSPECIFIED, - NL80211_IFTYPE_ADHOC, /* 1 */ - NL80211_IFTYPE_STATION, /* 2 */ - NL80211_IFTYPE_AP, /* 3 */ - NL80211_IFTYPE_AP_VLAN, - NL80211_IFTYPE_WDS, - NL80211_IFTYPE_MONITOR, /* 6 */ - NL80211_IFTYPE_MESH_POINT, - NL80211_IFTYPE_P2P_CLIENT, /* 8 */ - NL80211_IFTYPE_P2P_GO, /* 9 */ - /* keep last */ - NUM_NL80211_IFTYPES, - NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1 -}; -#endif static int cfg80211_rtw_change_iface(struct wiphy *wiphy, struct net_device *ndev, enum nl80211_iftype type, @@ -2453,9 +2402,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy, case NL80211_IFTYPE_MONITOR: networkType = Ndis802_11Monitor; -#if 0 - ndev->type = ARPHRD_IEEE80211; /* IEEE 802.11 : 801 */ -#endif + ndev->type = ARPHRD_IEEE80211_RADIOTAP; /* IEEE 802.11 + radiotap header : 803 */ break; default: @@ -2650,17 +2597,6 @@ static void _rtw_cfg80211_surveydone_event_callback(_adapter *padapter, struct c rtw_cfg80211_clear_wps_sr_of_non_target_bss(padapter, pnetwork, &target_ssid); rtw_cfg80211_inform_bss(padapter, pnetwork); } -#if 0 - /* check ralink testbed RSN IE length */ - { - if (_rtw_memcmp(pnetwork->network.Ssid.Ssid, "Ralink_11n_AP", 13)) { - uint ie_len = 0; - u8 *p = NULL; - p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); - RTW_INFO("ie_len=%d\n", ie_len); - } - } -#endif plist = get_next(plist); } @@ -2920,7 +2856,6 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy RTW_INFO(FUNC_ADPT_FMT"%s\n", FUNC_ADPT_ARG(padapter) , wdev == wiphy_to_pd_wdev(wiphy) ? " PD" : ""); -#if 1 ssc_chk = rtw_sitesurvey_condition_check(padapter, _TRUE); if (ssc_chk == SS_DENY_MP_MODE) @@ -3026,129 +2961,6 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy goto check_need_indicate_scan_done; } -#else - - -#ifdef CONFIG_MP_INCLUDED - if (rtw_mp_mode_check(padapter)) { - RTW_INFO("MP mode block Scan request\n"); - ret = -EPERM; - goto exit; - } -#endif - -#ifdef CONFIG_P2P - if (pwdinfo->driver_interface == DRIVER_CFG80211) { - if (ssids->ssid != NULL - && _rtw_memcmp(ssids->ssid, "DIRECT-", 7) - && rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL) - ) { - if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) - rtw_p2p_enable(padapter, P2P_ROLE_DEVICE); - else { - rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo)); - #ifdef CONFIG_DEBUG_CFG80211 - RTW_INFO("%s, role=%d, p2p_state=%d\n", __func__, rtw_p2p_role(pwdinfo), rtw_p2p_state(pwdinfo)); - #endif - } - rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN); - - if (request->n_channels == 3 && - request->channels[0]->hw_value == 1 && - request->channels[1]->hw_value == 6 && - request->channels[2]->hw_value == 11 - ) - social_channel = 1; - } - } -#endif /*CONFIG_P2P*/ - - if (request->ie && request->ie_len > 0) - rtw_cfg80211_set_probe_req_wpsp2pie(padapter, (u8 *)request->ie, request->ie_len); - -#ifdef CONFIG_RTW_REPEATER_SON - if (padapter->rtw_rson_scanstage == RSON_SCAN_PROCESS) { - RTW_INFO(FUNC_ADPT_FMT" blocking scan for under rson scanning process\n", FUNC_ADPT_ARG(padapter)); - need_indicate_scan_done = _TRUE; - goto check_need_indicate_scan_done; - } -#endif - - if (adapter_wdev_data(padapter)->block_scan == _TRUE) { - RTW_INFO(FUNC_ADPT_FMT" wdev_priv.block_scan is set\n", FUNC_ADPT_ARG(padapter)); - need_indicate_scan_done = _TRUE; - goto check_need_indicate_scan_done; - } - - rtw_ps_deny(padapter, PS_DENY_SCAN); - ps_denied = _TRUE; - if (_FAIL == rtw_pwr_wakeup(padapter)) { - need_indicate_scan_done = _TRUE; - goto check_need_indicate_scan_done; - } - - if (rtw_is_scan_deny(padapter)) { - RTW_INFO(FUNC_ADPT_FMT ": scan deny\n", FUNC_ADPT_ARG(padapter)); -#if CONFIG_NOTIFY_SCAN_ABORT_WITH_BUSY - ret = -EBUSY; - goto exit; -#else - need_indicate_scan_done = _TRUE; - goto check_need_indicate_scan_done; -#endif - } - - /* check fw state*/ - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) { - -#ifdef CONFIG_DEBUG_CFG80211 - RTW_INFO(FUNC_ADPT_FMT" under WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter)); -#endif - - if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS | _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == _TRUE) { - RTW_INFO("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state); - - if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) - RTW_INFO("AP mode process WPS\n"); - - need_indicate_scan_done = _TRUE; - goto check_need_indicate_scan_done; - } - } - - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _TRUE) { - RTW_INFO("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state); - need_indicate_scan_done = _TRUE; - goto check_need_indicate_scan_done; - } else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE) { - RTW_INFO("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state); - ret = -EBUSY; - goto check_need_indicate_scan_done; - } - -#ifdef CONFIG_CONCURRENT_MODE - if (rtw_mi_buddy_check_fwstate(padapter, _FW_UNDER_LINKING | WIFI_UNDER_WPS)) { - RTW_INFO("%s exit due to buddy_intf's mlme state under linking or wps\n", __func__); - need_indicate_scan_done = _TRUE; - goto check_need_indicate_scan_done; - - } else if (rtw_mi_buddy_check_fwstate(padapter, _FW_UNDER_SURVEY)) { - bool scan_via_buddy = rtw_cfg80211_scan_via_buddy(padapter, request); - - if (scan_via_buddy == _FALSE) - need_indicate_scan_done = _TRUE; - - goto check_need_indicate_scan_done; - } -#endif /* CONFIG_CONCURRENT_MODE */ - - /* busy traffic check*/ - if (rtw_mi_busy_traffic_check(padapter, _TRUE)) { - need_indicate_scan_done = _TRUE; - goto check_need_indicate_scan_done; - } -#endif - #ifdef CONFIG_P2P if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) && !rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) { rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH); @@ -3231,43 +3043,6 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy return ret; } -static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed) -{ -#if 0 - struct iwm_priv *iwm = wiphy_to_iwm(wiphy); - - if (changed & WIPHY_PARAM_RTS_THRESHOLD && - (iwm->conf.rts_threshold != wiphy->rts_threshold)) { - int ret; - - iwm->conf.rts_threshold = wiphy->rts_threshold; - - ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX, - CFG_RTS_THRESHOLD, - iwm->conf.rts_threshold); - if (ret < 0) - return ret; - } - - if (changed & WIPHY_PARAM_FRAG_THRESHOLD && - (iwm->conf.frag_threshold != wiphy->frag_threshold)) { - int ret; - - iwm->conf.frag_threshold = wiphy->frag_threshold; - - ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_FA_CFG_FIX, - CFG_FRAG_THRESHOLD, - iwm->conf.frag_threshold); - if (ret < 0) - return ret; - } -#endif - RTW_INFO("%s\n", __func__); - return 0; -} - - - static int rtw_cfg80211_set_wpa_version(struct security_priv *psecuritypriv, u32 wpa_version) { RTW_INFO("%s, wpa_version=%d\n", __func__, wpa_version); @@ -3281,11 +3056,6 @@ static int rtw_cfg80211_set_wpa_version(struct security_priv *psecuritypriv, u32 if (wpa_version & (NL80211_WPA_VERSION_1 | NL80211_WPA_VERSION_2)) psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPAPSK; -#if 0 - if (wpa_version & NL80211_WPA_VERSION_2) - psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPA2PSK; -#endif - #ifdef CONFIG_WAPI_SUPPORT if (wpa_version & NL80211_WAPI_VERSION_1) psecuritypriv->ndisauthtype = Ndis802_11AuthModeWAPI; @@ -4142,32 +3912,6 @@ static int cfg80211_rtw_set_txpower(struct wiphy *wiphy, enum tx_power_setting type, int dbm) #endif { -#if 0 - struct iwm_priv *iwm = wiphy_to_iwm(wiphy); - int ret; - - switch (type) { - case NL80211_TX_POWER_AUTOMATIC: - return 0; - case NL80211_TX_POWER_FIXED: - if (mbm < 0 || (mbm % 100)) - return -EOPNOTSUPP; - - if (!test_bit(IWM_STATUS_READY, &iwm->status)) - return 0; - - ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX, - CFG_TX_PWR_LIMIT_USR, - MBM_TO_DBM(mbm) * 2); - if (ret < 0) - return ret; - - return iwm_tx_power_trigger(iwm); - default: - IWM_ERR(iwm, "Unsupported power type: %d\n", type); - return -EOPNOTSUPP; - } -#endif RTW_INFO("%s\n", __func__); return 0; } @@ -5040,20 +4784,11 @@ static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev, WLAN_BSSID_EX *pbss_network = &adapter->mlmepriv.cur_network.network; WLAN_BSSID_EX *pbss_network_ext = &adapter->mlmeextpriv.mlmext_info.network; - if (0) - RTW_INFO(FUNC_ADPT_FMT" ssid:(%s,%zu), from ie:(%s,%d)\n", FUNC_ADPT_ARG(adapter), - settings->ssid, settings->ssid_len, - pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength); - memcpy(pbss_network->Ssid.Ssid, (void *)settings->ssid, settings->ssid_len); pbss_network->Ssid.SsidLength = settings->ssid_len; memcpy(pbss_network_ext->Ssid.Ssid, (void *)settings->ssid, settings->ssid_len); pbss_network_ext->Ssid.SsidLength = settings->ssid_len; - if (0) - RTW_INFO(FUNC_ADPT_FMT" after ssid:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter), - pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength, - pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength); } exit: @@ -5247,15 +4982,6 @@ void dump_station_parameters(void *sel, struct wiphy *wiphy, const struct statio , nl80211_plink_state_str(params->plink_state)); #endif -#if 0 /* TODO */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) - const struct ieee80211_ht_cap *ht_capa; -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) - const struct ieee80211_vht_cap *vht_capa; -#endif -#endif - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)) if (params->sta_modify_mask & STATION_PARAM_APPLY_UAPSD) RTW_PRINT_SEL(sel, "uapsd_queues:0x%02x\n", params->uapsd_queues); @@ -5271,30 +4997,8 @@ void dump_station_parameters(void *sel, struct wiphy *wiphy, const struct statio if (params->sta_modify_mask & STATION_PARAM_APPLY_CAPABILITY) RTW_PRINT_SEL(sel, "capability:0x%04x\n", params->capability); - -#if 0 /* TODO */ - const u8 *ext_capab; - u8 ext_capab_len; -#endif -#endif - -#if 0 /* TODO */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)) - const u8 *supported_channels; - u8 supported_channels_len; - const u8 *supported_oper_classes; - u8 supported_oper_classes_len; -#endif - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) - u8 opmode_notif; - bool opmode_notif_used; #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) - int support_p2p_ps; -#endif -#endif #endif /* DBG_RTW_CFG80211_STA_PARAM */ } @@ -5836,14 +5540,6 @@ static int cfg80211_rtw_set_txq_params(struct wiphy *wiphy ac = params->queue; #endif -#if 0 - RTW_INFO("ac=%d\n", ac); - RTW_INFO("txop=%u\n", params->txop); - RTW_INFO("cwmin=%u\n", params->cwmin); - RTW_INFO("cwmax=%u\n", params->cwmax); - RTW_INFO("aifs=%u\n", params->aifs); -#endif - if (is_supported_5g(pmlmeext->cur_wireless_mode) || (pmlmeext->cur_wireless_mode & WIRELESS_11_24N)) aSifsTime = 16; @@ -6127,11 +5823,6 @@ void rtw_cfg80211_rx_p2p_action_public(_adapter *adapter, union recv_frame *rfra if (type >= 0) { switch (type) { case P2P_GO_NEGO_CONF: - if (0) { - RTW_INFO(FUNC_ADPT_FMT" Nego confirm. state=%u, status=%u, iaddr="MAC_FMT"\n" - , FUNC_ADPT_ARG(adapter), pwdev_priv->nego_info.state, pwdev_priv->nego_info.status - , MAC_ARG(pwdev_priv->nego_info.iface_addr)); - } if (pwdev_priv->nego_info.state == 2 && pwdev_priv->nego_info.status == 0 && rtw_check_invalid_mac_address(pwdev_priv->nego_info.iface_addr, _FALSE) == _FALSE @@ -6163,9 +5854,7 @@ void rtw_cfg80211_rx_p2p_action_public(_adapter *adapter, union recv_frame *rfra indicate: #if defined(RTW_DEDICATED_P2P_DEVICE) - if (rtw_cfg80211_redirect_pd_wdev(dvobj_to_wiphy(dvobj), get_ra(frame), &wdev)) - if (0) - RTW_INFO("redirect to pd_wdev:%p\n", wdev); + rtw_cfg80211_redirect_pd_wdev(dvobj_to_wiphy(dvobj), get_ra(frame), &wdev) #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) @@ -6481,13 +6170,6 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, if (dump_mgntframe_and_wait_ack(padapter, pmgntframe) != _SUCCESS) RTW_INFO("%s, ack to\n", __func__); - #if 0 - if(wps_devicepassword_id == WPS_DPID_REGISTRAR_SPEC) { - RTW_INFO("waiting for p2p peer key-in PIN CODE\n"); - msleep(15000); /* 15 sec for key in PIN CODE, workaround for GS2 before issuing Nego Req. */ - } - #endif - } #ifdef CONFIG_RTW_80211R @@ -7410,11 +7092,6 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, if (is_p2p) { switch (type) { case P2P_GO_NEGO_CONF: - if (0) { - RTW_INFO(FUNC_ADPT_FMT" Nego confirm. state=%u, status=%u, iaddr="MAC_FMT"\n" - , FUNC_ADPT_ARG(padapter), pwdev_priv->nego_info.state, pwdev_priv->nego_info.status - , MAC_ARG(pwdev_priv->nego_info.iface_addr)); - } if (pwdev_priv->nego_info.state == 2 && pwdev_priv->nego_info.status == 0 && rtw_check_invalid_mac_address(pwdev_priv->nego_info.iface_addr, _FALSE) == _FALSE @@ -7597,7 +7274,6 @@ static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, memcpy(txmgmt.buf, (void *)buf, txmgmt.len); /* Debug purpose */ -#if 1 RTW_INFO("%s %d\n", __FUNCTION__, __LINE__); RTW_INFO("peer:"MAC_FMT", action code:%d, dialog:%d, status code:%d\n", MAC_ARG(txmgmt.peer), txmgmt.action_code, @@ -7608,7 +7284,6 @@ static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, printk("%02x ", *(txmgmt.buf + i)); RTW_INFO("len:%d\n", (u32)txmgmt.len); } -#endif switch (txmgmt.action_code) { case WLAN_TDLS_SETUP_REQUEST: @@ -7977,29 +7652,11 @@ static void rtw_cfg80211_mesh_cfg_set(_adapter *adapter, const struct mesh_confi { struct rtw_mesh_cfg *mcfg = &adapter->mesh_cfg; -#if 0 /* driver MPM */ - if (chk_mesh_attr(NL80211_MESHCONF_RETRY_TIMEOUT, mask)); - if (chk_mesh_attr(NL80211_MESHCONF_CONFIRM_TIMEOUT, mask)); - if (chk_mesh_attr(NL80211_MESHCONF_HOLDING_TIMEOUT, mask)); - if (chk_mesh_attr(NL80211_MESHCONF_MAX_PEER_LINKS, mask)); - if (chk_mesh_attr(NL80211_MESHCONF_MAX_RETRIES, mask)); -#endif - if (chk_mesh_attr(NL80211_MESHCONF_TTL, mask)) mcfg->dot11MeshTTL = conf->dot11MeshTTL; if (chk_mesh_attr(NL80211_MESHCONF_ELEMENT_TTL, mask)) mcfg->element_ttl = conf->element_ttl; -#if 0 /* driver MPM */ - if (chk_mesh_attr(NL80211_MESHCONF_AUTO_OPEN_PLINKS, mask)); -#endif - -#if 0 /* TBD: synchronization */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)) - if (chk_mesh_attr(NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, mask)); -#endif -#endif - if (chk_mesh_attr(NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES, mask)) mcfg->dot11MeshHWMPmaxPREQretries = conf->dot11MeshHWMPmaxPREQretries; if (chk_mesh_attr(NL80211_MESHCONF_PATH_REFRESH_TIME, mask)) @@ -8039,12 +7696,6 @@ static void rtw_cfg80211_mesh_cfg_set(_adapter *adapter, const struct mesh_confi if (chk_mesh_attr(NL80211_MESHCONF_RSSI_THRESHOLD, mask)) mcfg->rssi_threshold = conf->rssi_threshold; #endif - -#if 0 /* controlled by driver */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)) - if (chk_mesh_attr(NL80211_MESHCONF_HT_OPMODE, mask)); -#endif -#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) if (chk_mesh_attr(NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, mask)) @@ -8055,18 +7706,6 @@ static void rtw_cfg80211_mesh_cfg_set(_adapter *adapter, const struct mesh_confi mcfg->dot11MeshHWMPconfirmationInterval = conf->dot11MeshHWMPconfirmationInterval; #endif -#if 0 /* TBD */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)) - if (chk_mesh_attr(NL80211_MESHCONF_POWER_MODE, mask)); - if (chk_mesh_attr(NL80211_MESHCONF_AWAKE_WINDOW, mask)); -#endif -#endif - -#if 0 /* driver MPM */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) - if (chk_mesh_attr(NL80211_MESHCONF_PLINK_TIMEOUT, mask)); -#endif -#endif } u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapter @@ -9784,7 +9423,7 @@ void rtw_cfg80211_external_auth_status(struct wiphy *wiphy, struct net_device *d psta->expire_to = padapter->stapriv.assoc_to; if (params->pmkid != NULL) { - /* RTW_INFO_DUMP("PMKID:", params->pmkid, PMKID_LEN); */ + /* RTW_INFO_DUMP("PMKID:", params->pmkid, WLAN_PMKID_LEN); */ _rtw_set_pmksa(dev, params->bssid, params->pmkid); } @@ -9840,7 +9479,7 @@ static struct cfg80211_ops rtw_cfg80211_ops = { #endif /*CONFIG_GTK_OL*/ .get_station = cfg80211_rtw_get_station, .scan = cfg80211_rtw_scan, - .set_wiphy_params = cfg80211_rtw_set_wiphy_params, + .set_wiphy_params = 0, .connect = cfg80211_rtw_connect, .disconnect = cfg80211_rtw_disconnect, .join_ibss = cfg80211_rtw_join_ibss, diff --git a/os_dep/linux/ioctl_cfg80211.h b/os_dep/linux/ioctl_cfg80211.h index 19e5e1e1..c459dc1c 100644 --- a/os_dep/linux/ioctl_cfg80211.h +++ b/os_dep/linux/ioctl_cfg80211.h @@ -204,7 +204,7 @@ struct rtw_external_auth_params { struct cfg80211_ssid ssid; unsigned int key_mgmt_suite; u16 status; - u8 pmkid[PMKID_LEN]; + u8 pmkid[WLAN_PMKID_LEN]; }; bool rtw_cfg80211_is_connect_requested(_adapter *adapter); diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 7991d4cb..ccfcef47 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -1318,9 +1318,6 @@ static int rtw_wx_set_mode(struct net_device *dev, struct iw_request_info *a, switch (wrqu->mode) { case IW_MODE_MONITOR: networkType = Ndis802_11Monitor; -#if 0 - dev->type = ARPHRD_IEEE80211; /* IEEE 802.11 : 801 */ -#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)) dev->type = ARPHRD_IEEE80211_RADIOTAP; /* IEEE 802.11 + radiotap header : 803 */ @@ -1410,18 +1407,6 @@ static int rtw_wx_set_pmkid(struct net_device *dev, u8 strZeroMacAddress[ETH_ALEN] = { 0x00 }; u8 strIssueBssid[ETH_ALEN] = { 0x00 }; -#if 0 - struct iw_pmksa { - __u32 cmd; - struct sockaddr bssid; - __u8 pmkid[IW_PMKID_LEN]; /* IW_PMKID_LEN=16 */ - } - There are the BSSID information in the bssid.sa_data array. - If cmd is IW_PMKSA_FLUSH, it means the wpa_suppplicant wants to clear all the PMKID information. - If cmd is IW_PMKSA_ADD, it means the wpa_supplicant wants to add a PMKID / BSSID to driver. - If cmd is IW_PMKSA_REMOVE, it means the wpa_supplicant wants to remove a PMKID / BSSID from driver. -#endif - memcpy(strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN); if (pPMK->cmd == IW_PMKSA_ADD) { RTW_INFO("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n"); @@ -1726,19 +1711,6 @@ static int rtw_wx_set_wap(struct net_device *dev, while (1) { if (phead != pmlmepriv->pscanned) { -#if 0 - ret = -EINVAL; - goto cancel_ps_deny; - - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) { - rtw_set_802_11_bssid(padapter, temp->sa_data); - goto cancel_ps_deny; - } else { - ret = -EINVAL; - goto cancel_ps_deny; - } -#endif - break; } @@ -1809,14 +1781,6 @@ static int rtw_wx_set_mlme(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { -#if 0 - /* SIOCSIWMLME data */ - struct iw_mlme { - __u16 cmd; /* IW_MLME_* */ - __u16 reason_code; - struct sockaddr addr; - }; -#endif int ret = 0; u16 reason; @@ -1873,7 +1837,6 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, RTW_INFO("DBG_IOCTL %s:%d\n", __FUNCTION__, __LINE__); #endif -#if 1 ssc_chk = rtw_sitesurvey_condition_check(padapter, _FALSE); #ifdef CONFIG_DOSCAN_IN_BUSYTRAFFIC @@ -1907,67 +1870,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, ret = -1; goto cancel_ps_deny; } -#else -#ifdef CONFIG_MP_INCLUDED - if (rtw_mp_mode_check(padapter)) { - RTW_INFO("MP mode block Scan request\n"); - ret = -EPERM; - goto exit; - } -#endif - if (rtw_is_scan_deny(padapter)) { - indicate_wx_scan_complete_event(padapter); - goto exit; - } - - rtw_ps_deny(padapter, PS_DENY_SCAN); - if (_FAIL == rtw_pwr_wakeup(padapter)) { - ret = -1; - goto cancel_ps_deny; - } - - if (!rtw_is_adapter_up(padapter)) { - ret = -1; - goto cancel_ps_deny; - } - -#ifndef CONFIG_DOSCAN_IN_BUSYTRAFFIC - /* When Busy Traffic, driver do not site survey. So driver return success. */ - /* wpa_supplicant will not issue SIOCSIWSCAN cmd again after scan timeout. */ - /* modify by thomas 2011-02-22. */ - if (rtw_mi_busy_traffic_check(padapter, _FALSE)) { - indicate_wx_scan_complete_event(padapter); - goto cancel_ps_deny; - } -#endif -#ifdef CONFIG_RTW_REPEATER_SON - if (padapter->rtw_rson_scanstage == RSON_SCAN_PROCESS) { - RTW_INFO(FUNC_ADPT_FMT" blocking scan for under rson scanning process\n", FUNC_ADPT_ARG(padapter)); - indicate_wx_scan_complete_event(padapter); - goto cancel_ps_deny; - } -#endif - if (check_fwstate(pmlmepriv, WIFI_AP_STATE) && check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { - RTW_INFO("AP mode process WPS\n"); - indicate_wx_scan_complete_event(padapter); - goto cancel_ps_deny; - } - - if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == _TRUE) { - indicate_wx_scan_complete_event(padapter); - goto cancel_ps_deny; - } - -#ifdef CONFIG_CONCURRENT_MODE - if (rtw_mi_buddy_check_fwstate(padapter, - _FW_UNDER_SURVEY | _FW_UNDER_LINKING | WIFI_UNDER_WPS)) { - - indicate_wx_scan_complete_event(padapter); - goto cancel_ps_deny; - } -#endif -#endif #ifdef CONFIG_P2P if (pwdinfo->p2p_state != P2P_STATE_NONE) { @@ -2067,11 +1970,6 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, pos += 1; len -= 1; break; -#if 0 - case WEXT_CSCAN_NPROBE_SECTION: - RTW_INFO("WEXT_CSCAN_NPROBE_SECTION\n"); - break; -#endif default: /* RTW_INFO("Unknown CSCAN section %c\n", section); */ @@ -2148,7 +2046,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, } #endif /* CONFIG_P2P */ -#if 1 /* Wireless Extension use EAGAIN to try */ + /* Wireless Extension use EAGAIN to try */ wait_status = _FW_UNDER_SURVEY #ifndef CONFIG_ANDROID | _FW_UNDER_LINKING @@ -2157,20 +2055,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, while (check_fwstate(pmlmepriv, wait_status) == _TRUE) return -EAGAIN; -#else - wait_status = _FW_UNDER_SURVEY -#ifndef CONFIG_ANDROID - | _FW_UNDER_LINKING -#endif - ; - while (check_fwstate(pmlmepriv, wait_status) == _TRUE) { - msleep(30); - cnt++; - if (cnt > wait_for_surveydone) - break; - } -#endif _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); phead = get_list_head(queue); @@ -2318,17 +2203,6 @@ static int rtw_wx_set_essid(struct net_device *dev, while (1) { if (phead != pmlmepriv->pscanned) { -#if 0 - if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) { - rtw_set_802_11_ssid(padapter, &ndis_ssid); - - goto cancel_ps_deny; - } else { - ret = -EINVAL; - goto cancel_ps_deny; - } -#endif - break; } @@ -2607,29 +2481,6 @@ static int rtw_wx_get_retry(struct net_device *dev, } -#if 0 - #define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */ - #define IW_ENCODE_FLAGS 0xFF00 /* Flags defined below */ - #define IW_ENCODE_MODE 0xF000 /* Modes defined below */ - #define IW_ENCODE_DISABLED 0x8000 /* Encoding disabled */ - #define IW_ENCODE_ENABLED 0x0000 /* Encoding enabled */ - #define IW_ENCODE_RESTRICTED 0x4000 /* Refuse non-encoded packets */ - #define IW_ENCODE_OPEN 0x2000 /* Accept non-encoded packets */ - #define IW_ENCODE_NOKEY 0x0800 /* Key is write only, so not present */ - #define IW_ENCODE_TEMP 0x0400 /* Temporary key */ - /* - iwconfig wlan0 key on->flags = 0x6001->maybe it means auto - iwconfig wlan0 key off->flags = 0x8800 - iwconfig wlan0 key open->flags = 0x2800 - iwconfig wlan0 key open 1234567890->flags = 0x2000 - iwconfig wlan0 key restricted->flags = 0x4800 - iwconfig wlan0 key open [3] 1234567890->flags = 0x2003 - iwconfig wlan0 key restricted [2] 1234567890->flags = 0x4002 - iwconfig wlan0 key open [3] -> flags = 0x2803 - iwconfig wlan0 key restricted [2] -> flags = 0x4802 - */ -#endif - static int rtw_wx_set_enc(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *keybuf) @@ -3141,53 +2992,6 @@ static int rtw_wx_get_nick(struct net_device *dev, memcpy(extra, "", 14); } - /* rtw_signal_process(pid, SIGUSR1); */ /* for test */ - - /* dump debug info here */ -#if 0 - u32 dot11AuthAlgrthm; /* 802.11 auth, could be open, shared, and 8021x */ - u32 dot11PrivacyAlgrthm; /* This specify the privacy for shared auth. algorithm. */ - u32 dot118021XGrpPrivacy; /* This specify the privacy algthm. used for Grp key */ - u32 ndisauthtype; - u32 ndisencryptstatus; -#endif - - /* RTW_INFO("auth_alg=0x%x, enc_alg=0x%x, auth_type=0x%x, enc_type=0x%x\n", */ - /* psecuritypriv->dot11AuthAlgrthm, psecuritypriv->dot11PrivacyAlgrthm, */ - /* psecuritypriv->ndisauthtype, psecuritypriv->ndisencryptstatus); */ - - /* RTW_INFO("enc_alg=0x%x\n", psecuritypriv->dot11PrivacyAlgrthm); */ - /* RTW_INFO("auth_type=0x%x\n", psecuritypriv->ndisauthtype); */ - /* RTW_INFO("enc_type=0x%x\n", psecuritypriv->ndisencryptstatus); */ - -#if 0 - RTW_INFO("dbg(0x210)=0x%x\n", rtw_read32(padapter, 0x210)); - RTW_INFO("dbg(0x608)=0x%x\n", rtw_read32(padapter, 0x608)); - RTW_INFO("dbg(0x280)=0x%x\n", rtw_read32(padapter, 0x280)); - RTW_INFO("dbg(0x284)=0x%x\n", rtw_read32(padapter, 0x284)); - RTW_INFO("dbg(0x288)=0x%x\n", rtw_read32(padapter, 0x288)); - - RTW_INFO("dbg(0x664)=0x%x\n", rtw_read32(padapter, 0x664)); - - - RTW_INFO("\n"); - - RTW_INFO("dbg(0x430)=0x%x\n", rtw_read32(padapter, 0x430)); - RTW_INFO("dbg(0x438)=0x%x\n", rtw_read32(padapter, 0x438)); - - RTW_INFO("dbg(0x440)=0x%x\n", rtw_read32(padapter, 0x440)); - - RTW_INFO("dbg(0x458)=0x%x\n", rtw_read32(padapter, 0x458)); - - RTW_INFO("dbg(0x484)=0x%x\n", rtw_read32(padapter, 0x484)); - RTW_INFO("dbg(0x488)=0x%x\n", rtw_read32(padapter, 0x488)); - - RTW_INFO("dbg(0x444)=0x%x\n", rtw_read32(padapter, 0x444)); - RTW_INFO("dbg(0x448)=0x%x\n", rtw_read32(padapter, 0x448)); - RTW_INFO("dbg(0x44c)=0x%x\n", rtw_read32(padapter, 0x44c)); - RTW_INFO("dbg(0x450)=0x%x\n", rtw_read32(padapter, 0x450)); -#endif - return 0; } @@ -5256,17 +5060,12 @@ static int rtw_p2p_set_sa(struct net_device *dev, RTW_INFO("[%s] data = %s\n", __FUNCTION__, extra); - if (0) { - RTW_INFO("[%s] WiFi Direct is disable!\n", __FUNCTION__); - return ret; - } else { - if (extra[0] == '0') /* Disable the session available. */ - pwdinfo->session_available = _FALSE; - else if (extra[0] == '1') /* Enable the session available. */ - pwdinfo->session_available = _TRUE; - else - pwdinfo->session_available = _FALSE; - } + if (extra[0] == '0') /* Disable the session available. */ + pwdinfo->session_available = _FALSE; + else if (extra[0] == '1') /* Enable the session available. */ + pwdinfo->session_available = _TRUE; + else + pwdinfo->session_available = _FALSE; printk("[%s] session available = %d\n", __FUNCTION__, pwdinfo->session_available); exit: @@ -7167,17 +6966,6 @@ static int rtw_add_sta(struct net_device *dev, struct ieee_param *param) param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) return -EINVAL; -#if 0 - psta = rtw_get_stainfo(pstapriv, param->sta_addr); - if (psta) { - RTW_INFO("rtw_add_sta(), free has been added psta=%p\n", psta); - /* _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */ - rtw_free_stainfo(padapter, psta); - /* _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL); */ - - psta = NULL; - } -#endif /* psta = rtw_alloc_stainfo(pstapriv, param->sta_addr); */ psta = rtw_get_stainfo(pstapriv, param->sta_addr); if (psta) { @@ -7298,23 +7086,7 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par psta = rtw_get_stainfo(pstapriv, param_ex->sta_addr); if (psta) { -#if 0 - struct { - u16 aid; - u16 capability; - int flags; - u32 sta_set; - u8 tx_supp_rates[16]; - u32 tx_supp_rates_len; - struct ieee80211_ht_cap ht_cap; - u64 rx_pkts; - u64 rx_bytes; - u64 rx_drops; - u64 tx_pkts; - u64 tx_bytes; - u64 tx_drops; - } get_sta; -#endif + psta_data->aid = (u16)psta->cmn.aid; psta_data->capability = psta->capability; psta_data->flags = psta->flags; @@ -7544,21 +7316,11 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, memcpy(ssid, ssid_ie + 2, ssid_len); ssid[ssid_len] = 0x0; - if (0) - RTW_INFO(FUNC_ADPT_FMT" ssid:(%s,%d), from ie:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter), - ssid, ssid_len, - pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength, - pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength); - memcpy(pbss_network->Ssid.Ssid, (void *)ssid, ssid_len); pbss_network->Ssid.SsidLength = ssid_len; memcpy(pbss_network_ext->Ssid.Ssid, (void *)ssid, ssid_len); pbss_network_ext->Ssid.SsidLength = ssid_len; - if (0) - RTW_INFO(FUNC_ADPT_FMT" after ssid:(%s,%d), (%s,%d)\n", FUNC_ADPT_ARG(adapter), - pbss_network->Ssid.Ssid, pbss_network->Ssid.SsidLength, - pbss_network_ext->Ssid.Ssid, pbss_network_ext->Ssid.SsidLength); } RTW_INFO(FUNC_ADPT_FMT" ignore_broadcast_ssid:%d, %s,%d\n", FUNC_ADPT_ARG(adapter), @@ -8481,20 +8243,6 @@ static int rtw_mp_efuse_get(struct net_device *dev, goto exit; } -#if 0 - RTW_INFO("OFFSET\tVALUE(hex)\n"); - for (i = 0; i < mapLen; i += 16) { - RTW_INFO("0x%02x\t", i); - for (j = 0; j < 8; j++) - RTW_INFO("%02X ", efuse[i + j]); - RTW_INFO("\t"); - for (; j < 16; j++) - RTW_INFO("%02X ", efuse[i + j]); - RTW_INFO("\n"); - } - RTW_INFO("\n"); -#endif - shift = blksz * order; efuse += shift; cnt = mapLen - shift; @@ -9555,7 +9303,7 @@ static int rtw_mp_efuse_set(struct net_device *dev, printk("\n"); } printk("\n"); -#if 1 + err = -EFAULT; RTW_INFO("%s: rtw_BT_efuse_map_read _rtw_memcmp\n", __FUNCTION__); if ((rtw_BT_efuse_map_read(padapter, 0x00, EFUSE_BT_MAX_MAP_LEN, pEfuseHal->fakeBTEfuseInitMap) == _SUCCESS)) { @@ -9587,7 +9335,6 @@ static int rtw_mp_efuse_set(struct net_device *dev, goto exit; } } -#endif } else if (strcmp(tmp[0], "wlfk2map") == 0) { *extra = 0; @@ -11061,11 +10808,10 @@ static int rtw_tdls_get_best_ch(struct net_device *dev, best_channel_5G = rfctl->channel_set[i].ChannelNum; } } -#if 1 /* debug */ + RTW_INFO("The rx cnt of channel %3d = %d\n", rfctl->channel_set[i].ChannelNum, rfctl->channel_set[i].rx_count); -#endif } sprintf(extra, "\nbest_channel_24G = %d\n", best_channel_24G); @@ -11383,38 +11129,29 @@ static s32 createpseudoadhoc(PADAPTER padapter) _exit_critical_bh(&pmlmepriv->lock, &irqL); -#if 0 - err = rtw_create_ibss_cmd(padapter, 0); - if (err == _FAIL) - return _FAIL; -#else - { - struct wlan_network *pcur_network; - struct sta_info *psta; + struct wlan_network *pcur_network; + struct sta_info *psta; - /* 3 create a new psta */ - pcur_network = &pmlmepriv->cur_network; + /* 3 create a new psta */ + pcur_network = &pmlmepriv->cur_network; - /* clear psta in the cur_network, if any */ - psta = rtw_get_stainfo(&padapter->stapriv, pcur_network->network.MacAddress); - if (psta) - rtw_free_stainfo(padapter, psta); + /* clear psta in the cur_network, if any */ + psta = rtw_get_stainfo(&padapter->stapriv, pcur_network->network.MacAddress); + if (psta) + rtw_free_stainfo(padapter, psta); - psta = rtw_alloc_stainfo(&padapter->stapriv, pibss); - if (psta == NULL) - return _FAIL; + psta = rtw_alloc_stainfo(&padapter->stapriv, pibss); + if (psta == NULL) + return _FAIL; - /* 3 join psudo AdHoc */ - pcur_network->join_res = 1; - pcur_network->aid = psta->cmn.aid = 1; - memcpy(&pcur_network->network, pdev_network, get_WLAN_BSSID_EX_sz(pdev_network)); + /* 3 join psudo AdHoc */ + pcur_network->join_res = 1; + pcur_network->aid = psta->cmn.aid = 1; + memcpy(&pcur_network->network, pdev_network, get_WLAN_BSSID_EX_sz(pdev_network)); - /* set msr to WIFI_FW_ADHOC_STATE */ - padapter->hw_port = HW_PORT0; - Set_MSR(padapter, WIFI_FW_ADHOC_STATE); - - } -#endif + /* set msr to WIFI_FW_ADHOC_STATE */ + padapter->hw_port = HW_PORT0; + Set_MSR(padapter, WIFI_FW_ADHOC_STATE); return _SUCCESS; } @@ -11579,11 +11316,6 @@ static void printdata(u8 *pbuf, u32 len) for (; i < len, i++) printk("%02X", pbuf + i); #else /* CONFIG_LITTLE_ENDIAN */ -#if 0 - val = 0; - memcpy(&val, pbuf + i, len - i); - printk("%8X", val); -#else u8 str[9]; u8 n; val = 0; @@ -11592,7 +11324,6 @@ static void printdata(u8 *pbuf, u32 len) sprintf(str, "%08X", val); n = (4 - n) * 2; printk("%8s", str + n); -#endif #endif /* CONFIG_LITTLE_ENDIAN */ } printk("\n"); @@ -12042,11 +11773,6 @@ static const struct iw_priv_args rtw_private_args[] = { SIOCIWFIRSTPRIV + 0xD, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | IFNAMSIZ, "rfr" }, -#if 0 - { - SIOCIWFIRSTPRIV + 0xE, 0, 0, "wowlan_ctrl" - }, -#endif { SIOCIWFIRSTPRIV + 0x10, IW_PRIV_TYPE_CHAR | 1024, 0, "p2p_set" diff --git a/os_dep/linux/mlme_linux.c b/os_dep/linux/mlme_linux.c index 4e662012..3235e1d1 100644 --- a/os_dep/linux/mlme_linux.c +++ b/os_dep/linux/mlme_linux.c @@ -331,11 +331,6 @@ static const struct net_device_ops rtl871x_mgnt_netdev_ops = { .ndo_open = mgnt_netdev_open, .ndo_stop = mgnt_netdev_close, .ndo_start_xmit = mgnt_xmit_entry, - #if 0 - .ndo_set_mac_address = r871x_net_set_mac_address, - .ndo_get_stats = r871x_net_get_stats, - .ndo_do_ioctl = r871x_mp_ioctl, - #endif }; #endif diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index cd0a7c97..e76c4e4d 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1245,20 +1245,6 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr) memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */ memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */ -#if 0 - if (rtw_is_hw_init_completed(padapter)) { - rtw_ps_deny(padapter, PS_DENY_IOCTL); - LeaveAllPowerSaveModeDirect(padapter); /* leave PS mode for guaranteeing to access hw register successfully */ - -#ifdef CONFIG_MI_WITH_MBSSID_CAM - rtw_hal_change_macaddr_mbid(padapter, sa->sa_data); -#else - rtw_hal_set_hwreg(padapter, HW_VAR_MAC_ADDR, sa->sa_data); /* set mac addr to mac register */ -#endif - - rtw_ps_deny_cancel(padapter, PS_DENY_IOCTL); - } -#else rtw_ps_deny(padapter, PS_DENY_IOCTL); LeaveAllPowerSaveModeDirect(padapter); /* leave PS mode for guaranteeing to access hw register successfully */ #ifdef CONFIG_MI_WITH_MBSSID_CAM @@ -1267,7 +1253,6 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr) rtw_hal_set_hwreg(padapter, HW_VAR_MAC_ADDR, sa->sa_data); /* set mac addr to mac register */ #endif rtw_ps_deny_cancel(padapter, PS_DENY_IOCTL); -#endif RTW_INFO(FUNC_ADPT_FMT": Set Mac Addr to "MAC_FMT" Successfully\n" , FUNC_ADPT_ARG(padapter), MAC_ARG(sa->sa_data)); @@ -2655,10 +2640,6 @@ int _netdev_vir_if_open(struct net_device *pnetdev) if (padapter->bup == _FALSE && primary_padapter->bup == _TRUE && rtw_is_hw_init_completed(primary_padapter)) { -#if 0 /*#ifdef CONFIG_MI_WITH_MBSSID_CAM*/ - rtw_hal_set_hwreg(padapter, HW_VAR_MAC_ADDR, adapter_mac_addr(padapter)); /* set mac addr to mac register */ -#endif - } if (padapter->bup == _FALSE) { @@ -3405,9 +3386,6 @@ int _netdev_open(struct net_device *pnetdev) if (status == _FAIL) { goto netdev_open_error; } -#if 0/*#ifdef CONFIG_MI_WITH_MBSSID_CAM*/ - rtw_hal_set_hwreg(padapter, HW_VAR_MAC_ADDR, adapter_mac_addr(padapter)); /* set mac addr to mac register */ -#endif RTW_INFO("MAC Address = "MAC_FMT"\n", MAC_ARG(pnetdev->dev_addr)); @@ -3577,9 +3555,7 @@ int ips_netdrv_open(_adapter *padapter) goto netdev_open_error; } #endif -#if 0 - rtw_mi_set_mac_addr(padapter); -#endif + #ifndef RTW_HALMAC rtw_intf_start(padapter); #endif /* !RTW_HALMAC */ @@ -4432,7 +4408,6 @@ int rtw_suspend_wow(_adapter *padapter) clr_fwstate(pmlmepriv, _FW_UNDER_SURVEY); } -#if 1 if (rtw_mi_check_status(padapter, MI_LINKED)) { ch = rtw_mi_get_union_chan(padapter); bw = rtw_mi_get_union_bw(padapter); @@ -4441,14 +4416,7 @@ int rtw_suspend_wow(_adapter *padapter) FUNC_ADPT_ARG(padapter), ch, bw, offset); set_channel_bwmode(padapter, ch, offset, bw); } -#else - if (rtw_mi_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { - RTW_INFO(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", - FUNC_ADPT_ARG(padapter), ch, bw, offset); - set_channel_bwmode(padapter, ch, offset, bw); - rtw_mi_update_union_chan_inf(padapter, ch, offset, bw); - } -#endif + #ifdef CONFIG_CONCURRENT_MODE rtw_mi_buddy_suspend_free_assoc_resource(padapter); #endif @@ -4531,7 +4499,7 @@ int rtw_suspend_ap_wow(_adapter *padapter) rtw_hal_set_hwreg(padapter, HW_VAR_WOWLAN, (u8 *)&poidparam); RTW_PRINT("%s: wowmode suspending\n", __func__); -#if 1 + if (rtw_mi_check_status(padapter, MI_LINKED)) { ch = rtw_mi_get_union_chan(padapter); bw = rtw_mi_get_union_bw(padapter); @@ -4539,13 +4507,6 @@ int rtw_suspend_ap_wow(_adapter *padapter) RTW_INFO("back to linked/linking union - ch:%u, bw:%u, offset:%u\n", ch, bw, offset); set_channel_bwmode(padapter, ch, offset, bw); } -#else - if (rtw_mi_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { - RTW_INFO("back to linked/linking union - ch:%u, bw:%u, offset:%u\n", ch, bw, offset); - set_channel_bwmode(padapter, ch, offset, bw); - rtw_mi_update_union_chan_inf(padapter, ch, offset, bw); - } -#endif /*FOR ONE AP - TODO :Multi-AP*/ { @@ -4922,7 +4883,6 @@ int rtw_resume_process_ap_wow(_adapter *padapter) rtw_mi_start_drv_threads(padapter); -#if 1 if (rtw_mi_check_status(padapter, MI_LINKED)) { ch = rtw_mi_get_union_chan(padapter); bw = rtw_mi_get_union_bw(padapter); @@ -4930,13 +4890,6 @@ int rtw_resume_process_ap_wow(_adapter *padapter) RTW_INFO(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter), ch, bw, offset); set_channel_bwmode(padapter, ch, offset, bw); } -#else - if (rtw_mi_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { - RTW_INFO(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n", FUNC_ADPT_ARG(padapter), ch, bw, offset); - set_channel_bwmode(padapter, ch, offset, bw); - rtw_mi_update_union_chan_inf(padapter, ch, offset, bw); - } -#endif /*FOR ONE AP - TODO :Multi-AP*/ { diff --git a/os_dep/linux/recv_linux.c b/os_dep/linux/recv_linux.c index d79221f9..52293246 100644 --- a/os_dep/linux/recv_linux.c +++ b/os_dep/linux/recv_linux.c @@ -25,21 +25,14 @@ int rtw_os_recvframe_duplicate_skb(_adapter *padapter, union recv_frame *pclonef RTW_INFO("%s [WARN] skb == NULL, drop frag frame\n", __func__); return _FAIL; } -#if 1 + pkt_copy = rtw_skb_copy(pskb); if (pkt_copy == NULL) { RTW_INFO("%s [WARN] rtw_skb_copy fail , drop frag frame\n", __func__); return _FAIL; } -#else - pkt_copy = rtw_skb_clone(pskb); - if (pkt_copy == NULL) { - RTW_INFO("%s [WARN] rtw_skb_clone fail , drop frag frame\n", __func__); - return _FAIL; - } -#endif pkt_copy->dev = padapter->pnetdev; pcloneframe->u.hdr.pkt = pkt_copy; @@ -99,21 +92,6 @@ int rtw_os_alloc_recvframe(_adapter *padapter, union recv_frame *precvframe, u8 memcpy(pkt_copy->data, pdata, skb_len); precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail = pkt_copy->data; } else { -#if 0 - { - rtw_free_recvframe(precvframe_if2, &precvpriv->free_recv_queue); - rtw_enqueue_recvbuf_to_head(precvbuf, &precvpriv->recv_buf_pending_queue); - - /* The case of can't allocate skb is serious and may never be recovered, - once bDriverStopped is enable, this task should be stopped.*/ - if (!rtw_is_drv_stopped(secondary_padapter)) -#ifdef PLATFORM_LINUX - tasklet_schedule(&precvpriv->recv_tasklet); -#endif - return ret; - } - -#endif #ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX RTW_INFO("%s:can not allocate memory for skb copy\n", __func__); @@ -501,12 +479,7 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, union recv_frame *r /* DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n"); */ /* return FAIL; */ - #if 1 /* bypass this frame to upper layer!! */ - #else - rtw_skb_free(sub_skb); - continue; - #endif } } } diff --git a/os_dep/linux/rtw_android.c b/os_dep/linux/rtw_android.c index 1bb2fdef..ac8b12c5 100644 --- a/os_dep/linux/rtw_android.c +++ b/os_dep/linux/rtw_android.c @@ -584,10 +584,6 @@ static int rtw_android_set_aek(struct net_device *ndev, char *command, int total RTW_PRINT(FUNC_NDEV_FMT" addr="MAC_FMT"\n" , FUNC_NDEV_ARG(ndev), MAC_ARG(addr)); - if (0) - RTW_PRINT(FUNC_NDEV_FMT" aek="KEY_FMT KEY_FMT"\n" - , FUNC_NDEV_ARG(ndev), KEY_ARG(aek), KEY_ARG(aek + 16)); - if (rtw_mesh_plink_set_aek(adapter, addr, aek) != _SUCCESS) err = -ENOENT; @@ -767,16 +763,6 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) /* TBD: BTCOEXSCAN-STOP */ break; case ANDROID_WIFI_CMD_BTCOEXMODE: -#if 0 - uint mode = *(command + strlen(CMD_BTCOEXMODE) + 1) - '0'; - if (mode == 1) - net_os_set_packet_filter(net, 0); /* DHCP starts */ - else - net_os_set_packet_filter(net, 1); /* DHCP ends */ -#ifdef WL_CFG80211 - bytes_written = wl_cfg80211_set_btcoex_dhcp(net, command); -#endif -#endif break; case ANDROID_WIFI_CMD_SETSUSPENDMODE: diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c index c57fa32f..5f03a82b 100644 --- a/os_dep/linux/rtw_proc.c +++ b/os_dep/linux/rtw_proc.c @@ -2242,9 +2242,6 @@ static int proc_get_tx_power_idx(struct seq_file *m, void *v) u8 path = (pos & 0xFF00) >> 8; u8 rs = pos & 0xFF; - if (0) - RTW_INFO("%s path=%u, rs=%u\n", __func__, path, rs); - if (path == RF_PATH_A && rs == CCK) dump_tx_power_idx_title(m, adapter); dump_tx_power_idx_by_path_rs(m, adapter, path, rs); diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index 28e47645..916a1b6d 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -510,57 +510,14 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf, const s pdev_desc = &pusbd->descriptor; -#if 0 - RTW_INFO("\n8712_usb_device_descriptor:\n"); - RTW_INFO("bLength=%x\n", pdev_desc->bLength); - RTW_INFO("bDescriptorType=%x\n", pdev_desc->bDescriptorType); - RTW_INFO("bcdUSB=%x\n", pdev_desc->bcdUSB); - RTW_INFO("bDeviceClass=%x\n", pdev_desc->bDeviceClass); - RTW_INFO("bDeviceSubClass=%x\n", pdev_desc->bDeviceSubClass); - RTW_INFO("bDeviceProtocol=%x\n", pdev_desc->bDeviceProtocol); - RTW_INFO("bMaxPacketSize0=%x\n", pdev_desc->bMaxPacketSize0); - RTW_INFO("idVendor=%x\n", pdev_desc->idVendor); - RTW_INFO("idProduct=%x\n", pdev_desc->idProduct); - RTW_INFO("bcdDevice=%x\n", pdev_desc->bcdDevice); - RTW_INFO("iManufacturer=%x\n", pdev_desc->iManufacturer); - RTW_INFO("iProduct=%x\n", pdev_desc->iProduct); - RTW_INFO("iSerialNumber=%x\n", pdev_desc->iSerialNumber); - RTW_INFO("bNumConfigurations=%x\n", pdev_desc->bNumConfigurations); -#endif - phost_conf = pusbd->actconfig; pconf_desc = &phost_conf->desc; -#if 0 - RTW_INFO("\n8712_usb_configuration_descriptor:\n"); - RTW_INFO("bLength=%x\n", pconf_desc->bLength); - RTW_INFO("bDescriptorType=%x\n", pconf_desc->bDescriptorType); - RTW_INFO("wTotalLength=%x\n", pconf_desc->wTotalLength); - RTW_INFO("bNumInterfaces=%x\n", pconf_desc->bNumInterfaces); - RTW_INFO("bConfigurationValue=%x\n", pconf_desc->bConfigurationValue); - RTW_INFO("iConfiguration=%x\n", pconf_desc->iConfiguration); - RTW_INFO("bmAttributes=%x\n", pconf_desc->bmAttributes); - RTW_INFO("bMaxPower=%x\n", pconf_desc->bMaxPower); -#endif - /* RTW_INFO("\n***** num of altsetting = (%d) *****\n", pusb_interface->num_altsetting); */ phost_iface = &usb_intf->altsetting[0]; piface_desc = &phost_iface->desc; -#if 0 - RTW_INFO("\n8712_usb_interface_descriptor:\n"); - RTW_INFO("bLength=%x\n", piface_desc->bLength); - RTW_INFO("bDescriptorType=%x\n", piface_desc->bDescriptorType); - RTW_INFO("bInterfaceNumber=%x\n", piface_desc->bInterfaceNumber); - RTW_INFO("bAlternateSetting=%x\n", piface_desc->bAlternateSetting); - RTW_INFO("bNumEndpoints=%x\n", piface_desc->bNumEndpoints); - RTW_INFO("bInterfaceClass=%x\n", piface_desc->bInterfaceClass); - RTW_INFO("bInterfaceSubClass=%x\n", piface_desc->bInterfaceSubClass); - RTW_INFO("bInterfaceProtocol=%x\n", piface_desc->bInterfaceProtocol); - RTW_INFO("iInterface=%x\n", piface_desc->iInterface); -#endif - pdvobjpriv->NumInterfaces = pconf_desc->bNumInterfaces; pdvobjpriv->InterfaceNumber = piface_desc->bInterfaceNumber; pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints; diff --git a/os_dep/linux/usb_ops_linux.c b/os_dep/linux/usb_ops_linux.c index f09e3327..8ebc6f71 100644 --- a/os_dep/linux/usb_ops_linux.c +++ b/os_dep/linux/usb_ops_linux.c @@ -553,11 +553,6 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem) #endif #endif -#if 0 - if (bwritezero) - purb->transfer_flags |= URB_ZERO_PACKET; -#endif - status = usb_submit_urb(purb, GFP_ATOMIC); if (!status) { #ifdef DBG_CONFIG_ERROR_DETECT @@ -926,8 +921,6 @@ u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) #endif if (precvbuf->pskb == NULL) { - if (0) - RTW_INFO("usb_read_port() enqueue precvbuf=%p\n", precvbuf); /* enqueue precvbuf and wait for free skb */ rtw_enqueue_recvbuf(precvbuf, &precvpriv->recv_buf_pending_queue); goto exit; diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c index 1b91f469..08de127f 100644 --- a/os_dep/linux/wifi_regd.c +++ b/os_dep/linux/wifi_regd.c @@ -139,119 +139,6 @@ static const struct ieee80211_regdomain rtw_regdom_14 = { } }; -#if 0 -static struct rtw_regulatory *rtw_regd; -#endif - -#if 0 /* not_yet */ -static void _rtw_reg_apply_beaconing_flags(struct wiphy *wiphy, - enum nl80211_reg_initiator initiator) -{ - enum nl80211_band band; - struct ieee80211_supported_band *sband; - const struct ieee80211_reg_rule *reg_rule; - struct ieee80211_channel *ch; - unsigned int i; - u32 bandwidth = 0; - int r; - - for (band = 0; band < NUM_NL80211_BANDS; band++) { - - if (!wiphy->bands[band]) - continue; - - sband = wiphy->bands[band]; - - for (i = 0; i < sband->n_channels; i++) { - ch = &sband->channels[i]; - if (rtw_is_dfs_ch(ch->hw_value) || - (ch->flags & IEEE80211_CHAN_RADAR)) - continue; - if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) { - r = freq_reg_info(wiphy, ch->center_freq, - bandwidth, ®_rule); - if (r) - continue; - - /* - *If 11d had a rule for this channel ensure - *we enable adhoc/beaconing if it allows us to - *use it. Note that we would have disabled it - *by applying our static world regdomain by - *default during init, prior to calling our - *regulatory_hint(). - */ - - if (!(reg_rule->flags & NL80211_RRF_NO_IBSS)) - ch->flags &= ~IEEE80211_CHAN_NO_IBSS; - if (! - (reg_rule->flags & - NL80211_RRF_PASSIVE_SCAN)) - ch->flags &= - ~IEEE80211_CHAN_PASSIVE_SCAN; - } else { - if (ch->beacon_found) - ch->flags &= ~(IEEE80211_CHAN_NO_IBSS | - IEEE80211_CHAN_PASSIVE_SCAN); - } - } - } -} - -/* Allows active scan scan on Ch 12 and 13 */ -static void _rtw_reg_apply_active_scan_flags(struct wiphy *wiphy, - enum nl80211_reg_initiator - initiator) -{ - struct ieee80211_supported_band *sband; - struct ieee80211_channel *ch; - const struct ieee80211_reg_rule *reg_rule; - u32 bandwidth = 0; - int r; - - if (!wiphy->bands[NL80211_BAND_2GHZ]) - return; - sband = wiphy->bands[NL80211_BAND_2GHZ]; - - /* - * If no country IE has been received always enable active scan - * on these channels. This is only done for specific regulatory SKUs - */ - if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) { - ch = &sband->channels[11]; /* CH 12 */ - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; - ch = &sband->channels[12]; /* CH 13 */ - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; - return; - } - - /* - * If a country IE has been received check its rule for this - * channel first before enabling active scan. The passive scan - * would have been enforced by the initial processing of our - * custom regulatory domain. - */ - - ch = &sband->channels[11]; /* CH 12 */ - r = freq_reg_info(wiphy, ch->center_freq, bandwidth, ®_rule); - if (!r) { - if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; - } - - ch = &sband->channels[12]; /* CH 13 */ - r = freq_reg_info(wiphy, ch->center_freq, bandwidth, ®_rule); - if (!r) { - if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) - if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) - ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; - } -} -#endif - void rtw_regd_apply_flags(struct wiphy *wiphy) { struct dvobj_priv *dvobj = wiphy_to_dvobj(wiphy); @@ -322,15 +209,8 @@ static const struct ieee80211_regdomain *_rtw_regdomain_select(struct rtw_regulatory *reg) { -#if 0 - switch (reg->country_code) { - case COUNTRY_CODE_USER: - default: - return &rtw_regdom_rd; - } -#else + return &rtw_regdom_rd; -#endif } static void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index dc78eb6d..37b55afb 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -20,7 +20,6 @@ #define RT_TAG '1178' -#if defined(PLATFORM_LINUX) /* * Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE * @return: one of RTW_STATUS_CODE @@ -37,12 +36,7 @@ inline int RTW_STATUS_CODE(int error_code) return _FAIL; } } -#else -inline int RTW_STATUS_CODE(int error_code) -{ - return error_code; -} -#endif + u32 rtw_atoi(u8 *s) { @@ -69,7 +63,6 @@ void *_rtw_malloc(u32 sz) { void *pbuf = NULL; -#ifdef PLATFORM_LINUX #ifdef RTK_DMP_PLATFORM if (sz > 0x4000) pbuf = dvr_malloc(sz); @@ -77,15 +70,11 @@ void *_rtw_malloc(u32 sz) #endif pbuf = kmalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); -#endif - #ifdef DBG_MEMORY_LEAK -#ifdef PLATFORM_LINUX if (pbuf != NULL) { atomic_inc(&_malloc_cnt); atomic_add(sz, &_malloc_size); } -#endif #endif /* DBG_MEMORY_LEAK */ return pbuf; @@ -98,11 +87,7 @@ void *_rtw_zmalloc(u32 sz) void *pbuf = _rtw_malloc(sz); if (pbuf != NULL) { - -#ifdef PLATFORM_LINUX memset(pbuf, 0, sz); -#endif - } return pbuf; @@ -111,7 +96,6 @@ void *_rtw_zmalloc(u32 sz) void _rtw_mfree(void *pbuf, u32 sz) { -#ifdef PLATFORM_LINUX #ifdef RTK_DMP_PLATFORM if (sz > 0x4000) dvr_free(pbuf); @@ -119,23 +103,16 @@ void _rtw_mfree(void *pbuf, u32 sz) #endif kfree(pbuf); -#endif - #ifdef DBG_MEMORY_LEAK -#ifdef PLATFORM_LINUX atomic_dec(&_malloc_cnt); atomic_sub(sz, &_malloc_size); -#endif #endif /* DBG_MEMORY_LEAK */ } inline struct sk_buff *_rtw_skb_alloc(u32 sz) { -#ifdef PLATFORM_LINUX return __dev_alloc_skb(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); -#endif /* PLATFORM_LINUX */ - } inline void _rtw_skb_free(struct sk_buff *skb) @@ -145,60 +122,39 @@ inline void _rtw_skb_free(struct sk_buff *skb) inline struct sk_buff *_rtw_skb_copy(const struct sk_buff *skb) { -#ifdef PLATFORM_LINUX return skb_copy(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); -#endif /* PLATFORM_LINUX */ - } inline struct sk_buff *_rtw_skb_clone(struct sk_buff *skb) { -#ifdef PLATFORM_LINUX return skb_clone(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); -#endif /* PLATFORM_LINUX */ - } inline struct sk_buff *_rtw_pskb_copy(struct sk_buff *skb) { -#ifdef PLATFORM_LINUX #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) return pskb_copy(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); #else return skb_clone(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); #endif -#endif /* PLATFORM_LINUX */ - } inline int _rtw_netif_rx(_nic_hdl ndev, struct sk_buff *skb) { -#if defined(PLATFORM_LINUX) skb->dev = ndev; return netif_rx(skb); -#endif } #ifdef CONFIG_RTW_NAPI inline int _rtw_netif_receive_skb(_nic_hdl ndev, struct sk_buff *skb) { -#if defined(PLATFORM_LINUX) skb->dev = ndev; return netif_receive_skb(skb); -#else - rtw_warn_on(1); - return -1; -#endif } #ifdef CONFIG_RTW_GRO inline gro_result_t _rtw_napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) { -#if defined(PLATFORM_LINUX) return napi_gro_receive(napi, skb); -#else - rtw_warn_on(1); - return -1; -#endif } #endif /* CONFIG_RTW_GRO */ #endif /* CONFIG_RTW_NAPI */ @@ -214,25 +170,19 @@ void _rtw_skb_queue_purge(struct sk_buff_head *list) #ifdef CONFIG_USB_HCI inline void *_rtw_usb_buffer_alloc(struct usb_device *dev, size_t size, dma_addr_t *dma) { -#ifdef PLATFORM_LINUX #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) return usb_alloc_coherent(dev, size, (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), dma); #else return usb_buffer_alloc(dev, size, (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), dma); #endif -#endif /* PLATFORM_LINUX */ - } inline void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_addr_t dma) { -#ifdef PLATFORM_LINUX #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) usb_free_coherent(dev, size, addr, dma); #else usb_buffer_free(dev, size, addr, dma); #endif -#endif /* PLATFORM_LINUX */ - } #endif /* CONFIG_USB_HCI */ @@ -656,30 +606,22 @@ void *rtw_malloc2d(int h, int w, size_t size) inline void rtw_os_pkt_free(_pkt *pkt) { -#if defined(PLATFORM_LINUX) rtw_skb_free(pkt); -#endif } inline _pkt *rtw_os_pkt_copy(_pkt *pkt) { -#if defined(PLATFORM_LINUX) return rtw_skb_copy(pkt); -#endif } inline void *rtw_os_pkt_data(_pkt *pkt) { -#if defined(PLATFORM_LINUX) return pkt->data; -#endif } inline u32 rtw_os_pkt_len(_pkt *pkt) { -#if defined(PLATFORM_LINUX) return pkt->len; -#endif } int _rtw_memcmp(const void *dst, const void *src, u32 sz) @@ -695,13 +637,7 @@ int _rtw_memcmp(const void *dst, const void *src, u32 sz) void _rtw_init_listhead(_list *list) { - -#ifdef PLATFORM_LINUX - INIT_LIST_HEAD(list); - -#endif - } @@ -712,121 +648,72 @@ Otherwise, there will be racing condition. */ u32 rtw_is_list_empty(_list *phead) { - -#ifdef PLATFORM_LINUX - if (list_empty(phead)) return _TRUE; else return _FALSE; - -#endif - } void rtw_list_insert_head(_list *plist, _list *phead) { - -#ifdef PLATFORM_LINUX list_add(plist, phead); -#endif - } void rtw_list_insert_tail(_list *plist, _list *phead) { - -#ifdef PLATFORM_LINUX - list_add_tail(plist, phead); - -#endif } inline void rtw_list_splice(_list *list, _list *head) { -#ifdef PLATFORM_LINUX list_splice(list, head); -#else - #error "TBD\n" -#endif } inline void rtw_list_splice_init(_list *list, _list *head) { -#ifdef PLATFORM_LINUX list_splice_init(list, head); -#else - #error "TBD\n" -#endif } inline void rtw_list_splice_tail(_list *list, _list *head) { -#ifdef PLATFORM_LINUX #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)) if (!list_empty(list)) __list_splice(list, head); #else list_splice_tail(list, head); #endif -#else - #error "TBD\n" -#endif } inline void rtw_hlist_head_init(rtw_hlist_head *h) { -#ifdef PLATFORM_LINUX INIT_HLIST_HEAD(h); -#else - #error "TBD\n" -#endif } inline void rtw_hlist_add_head(rtw_hlist_node *n, rtw_hlist_head *h) { -#ifdef PLATFORM_LINUX hlist_add_head(n, h); -#else - #error "TBD\n" -#endif } inline void rtw_hlist_del(rtw_hlist_node *n) { -#ifdef PLATFORM_LINUX hlist_del(n); -#else - #error "TBD\n" -#endif } inline void rtw_hlist_add_head_rcu(rtw_hlist_node *n, rtw_hlist_head *h) { -#ifdef PLATFORM_LINUX hlist_add_head_rcu(n, h); -#else - #error "TBD\n" -#endif } inline void rtw_hlist_del_rcu(rtw_hlist_node *n) { -#ifdef PLATFORM_LINUX hlist_del_rcu(n); -#else - #error "TBD\n" -#endif } void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc, void *ctx) { _adapter *adapter = (_adapter *)padapter; -#ifdef PLATFORM_LINUX _init_timer(ptimer, adapter->pnetdev, pfunc, ctx); -#endif } /* @@ -838,143 +725,82 @@ Caller must check if the list is empty before calling rtw_list_delete void _rtw_init_sema(_sema *sema, int init_val) { - -#ifdef PLATFORM_LINUX - sema_init(sema, init_val); - -#endif - } void _rtw_up_sema(_sema *sema) { - -#ifdef PLATFORM_LINUX - up(sema); - -#endif - } u32 _rtw_down_sema(_sema *sema) { - -#ifdef PLATFORM_LINUX - if (down_interruptible(sema)) return _FAIL; else return _SUCCESS; -#endif - } inline void thread_exit(_completion *comp) { -#ifdef PLATFORM_LINUX complete_and_exit(comp, 0); -#endif - } inline void _rtw_init_completion(_completion *comp) { -#ifdef PLATFORM_LINUX init_completion(comp); -#endif } inline void _rtw_wait_for_comp_timeout(_completion *comp) { -#ifdef PLATFORM_LINUX wait_for_completion_timeout(comp, msecs_to_jiffies(3000)); -#endif } inline void _rtw_wait_for_comp(_completion *comp) { -#ifdef PLATFORM_LINUX wait_for_completion(comp); -#endif } void _rtw_mutex_init(_mutex *pmutex) { -#ifdef PLATFORM_LINUX - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) mutex_init(pmutex); #else init_MUTEX(pmutex); #endif - -#endif } void _rtw_mutex_free(_mutex *pmutex); void _rtw_mutex_free(_mutex *pmutex) { -#ifdef PLATFORM_LINUX - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) mutex_destroy(pmutex); #endif - -#endif - } void _rtw_spinlock_init(_lock *plock) { - -#ifdef PLATFORM_LINUX - spin_lock_init(plock); - -#endif } void _rtw_spinlock(_lock *plock) { - -#ifdef PLATFORM_LINUX - spin_lock(plock); - -#endif } void _rtw_spinunlock(_lock *plock) { - -#ifdef PLATFORM_LINUX - spin_unlock(plock); - -#endif - } void _rtw_spinlock_ex(_lock *plock) { - -#ifdef PLATFORM_LINUX - spin_lock(plock); - -#endif } void _rtw_spinunlock_ex(_lock *plock) { - -#ifdef PLATFORM_LINUX - spin_unlock(plock); - -#endif } @@ -1012,18 +838,11 @@ inline s32 _rtw_get_time_interval_ms(systime start, systime end) inline bool _rtw_time_after(systime a, systime b) { -#ifdef PLATFORM_LINUX return time_after(a, b); -#else - #error "TBD\n" -#endif } void rtw_usleep_os(int us) { -#ifdef PLATFORM_LINUX - - /* msleep((unsigned int)us); */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) usleep_range(us, us + 1); #else @@ -1032,8 +851,6 @@ void rtw_usleep_os(int us) else msleep((us / 1000) + 1); #endif -#endif - } @@ -1170,32 +987,19 @@ inline void rtw_lock_traffic_suspend_timeout(u32 timeout_ms) inline void rtw_set_bit(int nr, unsigned long *addr) { -#ifdef PLATFORM_LINUX set_bit(nr, addr); -#else - #error "TBD\n"; -#endif } inline void rtw_clear_bit(int nr, unsigned long *addr) { -#ifdef PLATFORM_LINUX clear_bit(nr, addr); -#else - #error "TBD\n"; -#endif } inline int rtw_test_and_clear_bit(int nr, unsigned long *addr) { -#ifdef PLATFORM_LINUX return test_and_clear_bit(nr, addr); -#else - #error "TBD\n"; -#endif } -#ifdef PLATFORM_LINUX /* * Open a file with the specific @param path, @param flag, @param mode * @param fpp the pointer of struct file pointer to get struct file pointer while file opening is success @@ -1403,7 +1207,6 @@ static int storeToFile(const char *path, u8 *buf, u32 sz) } return ret; } -#endif /* PLATFORM_LINUX */ /* * Test if the specifi @param path is a file and readable @@ -1412,15 +1215,10 @@ static int storeToFile(const char *path, u8 *buf, u32 sz) */ int rtw_is_file_readable(const char *path) { -#ifdef PLATFORM_LINUX if (isFileReadable(path, NULL) == 0) return _TRUE; else return _FALSE; -#else - /* Todo... */ - return _FALSE; -#endif } /* @@ -1431,15 +1229,10 @@ int rtw_is_file_readable(const char *path) */ int rtw_is_file_readable_with_size(const char *path, u32 *sz) { -#ifdef PLATFORM_LINUX if (isFileReadable(path, sz) == 0) return _TRUE; else return _FALSE; -#else - /* Todo... */ - return _FALSE; -#endif } /* @@ -1451,13 +1244,8 @@ int rtw_is_file_readable_with_size(const char *path, u32 *sz) */ int rtw_retrieve_from_file(const char *path, u8 *buf, u32 sz) { -#ifdef PLATFORM_LINUX int ret = retriveFromFile(path, buf, sz); return ret >= 0 ? ret : 0; -#else - /* Todo... */ - return 0; -#endif } /* @@ -1469,16 +1257,10 @@ int rtw_retrieve_from_file(const char *path, u8 *buf, u32 sz) */ int rtw_store_to_file(const char *path, u8 *buf, u32 sz) { -#ifdef PLATFORM_LINUX int ret = storeToFile(path, buf, sz); return ret >= 0 ? ret : 0; -#else - /* Todo... */ - return 0; -#endif } -#ifdef PLATFORM_LINUX struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv) { struct net_device *pnetdev; @@ -1604,19 +1386,15 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname) return -1; } -#endif u64 rtw_division64(u64 x, u64 y) { -#ifdef PLATFORM_LINUX do_div(x, y); return x; -#endif } inline u32 rtw_random32(void) { -#ifdef PLATFORM_LINUX #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) return prandom_u32(); #elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)) @@ -1626,7 +1404,6 @@ inline u32 rtw_random32(void) #else return random32(); #endif -#endif } void rtw_buf_free(u8 **buf, u32 *buf_len) @@ -1715,8 +1492,6 @@ bool rtw_cbuf_push(struct rtw_cbuf *cbuf, void *buf) if (rtw_cbuf_full(cbuf)) return _FAIL; - if (0) - RTW_INFO("%s on %u\n", __func__, cbuf->write); cbuf->bufs[cbuf->write] = buf; cbuf->write = (cbuf->write + 1) % cbuf->size; @@ -1736,8 +1511,6 @@ void *rtw_cbuf_pop(struct rtw_cbuf *cbuf) if (rtw_cbuf_empty(cbuf)) return NULL; - if (0) - RTW_INFO("%s on %u\n", __func__, cbuf->read); buf = cbuf->bufs[cbuf->read]; cbuf->read = (cbuf->read + 1) % cbuf->size; diff --git a/platform/platform_aml_s905_sdio.c b/platform/platform_aml_s905_sdio.c index 334ca03c..8bb381d2 100644 --- a/platform/platform_aml_s905_sdio.c +++ b/platform/platform_aml_s905_sdio.c @@ -34,15 +34,6 @@ int platform_wifi_power_on(void) } #endif /* kernel < 3.14.0 */ -#if 0 /* Seems redundancy? Already done before insert driver */ - pr_info("######%s:\n", __func__); - extern_wifi_set_enable(0); - msleep(500); - extern_wifi_set_enable(1); - msleep(500); - sdio_reinit(); -#endif - return ret; } diff --git a/platform/platform_hisilicon_hi3798_sdio.c b/platform/platform_hisilicon_hi3798_sdio.c index 11a08320..4b36a629 100644 --- a/platform/platform_hisilicon_hi3798_sdio.c +++ b/platform/platform_hisilicon_hi3798_sdio.c @@ -26,10 +26,6 @@ typedef enum hi_GPIO_DIR_E { #define REG_BASE_CTRL __io_address(0xf8a20008) int gpio_wlan_reg_on = RTL_REG_ON_GPIO; -#if 0 -module_param(gpio_wlan_reg_on, uint, 0644); -MODULE_PARM_DESC(gpio_wlan_reg_on, "wlan reg_on gpio num (default:gpio4_3)"); -#endif static int hi_gpio_set_value(u32 gpio, u32 value) { diff --git a/platform/platform_sprd_sdio.c b/platform/platform_sprd_sdio.c index 035d00cf..3c55a0d5 100644 --- a/platform/platform_sprd_sdio.c +++ b/platform/platform_sprd_sdio.c @@ -51,15 +51,13 @@ int platform_wifi_power_on(void) #ifdef ANDROID_2X mdelay(200); #else /* !ANDROID_2X */ - if (1) { - int i = 0; + int i = 0; - for (i = 0; i <= 50; i++) { - msleep(10); - if (sdhci_device_attached()) - break; - printk("%s delay times:%d\n", __func__, i); - } + for (i = 0; i <= 50; i++) { + msleep(10); + if (sdhci_device_attached()) + break; + printk("%s delay times:%d\n", __func__, i); } #endif /* !ANDROID_2X */