From ab2764354786ec299fe67da1cbe8beb06e085e5d Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Mon, 15 Oct 2018 03:55:32 -0500 Subject: [PATCH] rtl8188eu: Remove all unused code for DM_ODM_SUPPORT_TYPE of ODM_WIN and ODM_AP Signed-off-by: Larry Finger --- hal/phydm/phydm.c | 841 +------------------- hal/phydm/phydm_debug.h | 57 +- hal/phydm/phydm_dig.h | 54 +- hal/phydm/phydm_dynamic_rx_path.c | 47 -- hal/phydm/phydm_dynamic_rx_path.h | 32 +- hal/phydm/phydm_precomp.h | 208 ++--- hal/phydm/phydm_rainfo.c | 1184 +---------------------------- include/rtw_recv.h | 34 - 8 files changed, 65 insertions(+), 2392 deletions(-) diff --git a/hal/phydm/phydm.c b/hal/phydm/phydm.c index b7188e1..9f4cea4 100644 --- a/hal/phydm/phydm.c +++ b/hal/phydm/phydm.c @@ -157,29 +157,11 @@ odm_init_mp_driver_status( struct PHY_DM_STRUCT *p_dm_odm ) { -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) - - /* Decide when compile time */ -#if (MP_DRIVER == 1) - p_dm_odm->mp_mode = true; -#else - p_dm_odm->mp_mode = false; -#endif - -#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) - struct _ADAPTER *adapter = p_dm_odm->adapter; /* Update information every period */ p_dm_odm->mp_mode = (bool)adapter->registrypriv.mp_mode; -#else - - struct rtl8192cd_priv *priv = p_dm_odm->priv; - - p_dm_odm->mp_mode = (bool)priv->pshare->rf_ft_var.mp_specific; - -#endif } void @@ -187,21 +169,10 @@ odm_update_mp_driver_status( struct PHY_DM_STRUCT *p_dm_odm ) { -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) - - /* Do nothing. */ - -#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) struct _ADAPTER *adapter = p_dm_odm->adapter; /* Update information erery period */ p_dm_odm->mp_mode = (bool)adapter->registrypriv.mp_mode; - -#else - - /* Do nothing. */ - -#endif } void @@ -247,26 +218,14 @@ phydm_traffic_load_decision( p_dm_odm->last_tx_ok_cnt = *(p_dm_odm->p_num_tx_bytes_unicast); p_dm_odm->last_rx_ok_cnt = *(p_dm_odm->p_num_rx_bytes_unicast); -#if (DM_ODM_SUPPORT_TYPE & ODM_AP) - p_dm_odm->tx_tp = ((p_dm_odm->tx_tp) >> 1) + (u32)(((p_dm_odm->cur_tx_ok_cnt) >> 17) >> 1); /* <<3(8bit), >>20(10^6,M)*/ - p_dm_odm->rx_tp = ((p_dm_odm->rx_tp) >> 1) + (u32)(((p_dm_odm->cur_rx_ok_cnt) >> 17) >> 1); /* <<3(8bit), >>20(10^6,M)*/ -#else p_dm_odm->tx_tp = ((p_dm_odm->tx_tp) >> 1) + (u32)(((p_dm_odm->cur_tx_ok_cnt) >> 18) >> 1); /* <<3(8bit), >>20(10^6,M), >>1(2sec)*/ p_dm_odm->rx_tp = ((p_dm_odm->rx_tp) >> 1) + (u32)(((p_dm_odm->cur_rx_ok_cnt) >> 18) >> 1); /* <<3(8bit), >>20(10^6,M), >>1(2sec)*/ -#endif p_dm_odm->total_tp = p_dm_odm->tx_tp + p_dm_odm->rx_tp; if (p_dm_odm->total_tp == 0) p_dm_odm->consecutive_idlel_time += PHYDM_WATCH_DOG_PERIOD; else p_dm_odm->consecutive_idlel_time = 0; - /* - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("cur_tx_ok_cnt = %d, cur_rx_ok_cnt = %d, last_tx_ok_cnt = %d, last_rx_ok_cnt = %d\n", - p_dm_odm->cur_tx_ok_cnt, p_dm_odm->cur_rx_ok_cnt, p_dm_odm->last_tx_ok_cnt, p_dm_odm->last_rx_ok_cnt)); - - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("tx_tp = %d, rx_tp = %d\n", - p_dm_odm->tx_tp, p_dm_odm->rx_tp)); - */ p_dm_odm->pre_traffic_load = p_dm_odm->traffic_load; @@ -512,11 +471,6 @@ phydm_init_cck_setting( #if (RTL8192E_SUPPORT == 1) if (p_dm_odm->support_ic_type & (ODM_RTL8192E)) { -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - phydm_config_cck_rx_antenna_init(p_dm_odm); - phydm_config_cck_rx_path(p_dm_odm, PHYDM_A, CCA_PATHDIV_DISABLE); -#endif - /* 0x824[9] = 0x82C[9] = 0xA80[7] those registers setting should be equal or CCK RSSI report may be incorrect */ value_824 = odm_get_bb_reg(p_dm_odm, 0x824, BIT(9)); value_82c = odm_get_bb_reg(p_dm_odm, 0x82c, BIT(9)); @@ -591,11 +545,6 @@ odm_common_info_self_init( { phydm_init_cck_setting(p_dm_odm); p_dm_odm->rf_path_rx_enable = (u8) odm_get_bb_reg(p_dm_odm, ODM_REG(BB_RX_PATH, p_dm_odm), ODM_BIT(BB_RX_PATH, p_dm_odm)); -#if (DM_ODM_SUPPORT_TYPE != ODM_CE) - p_dm_odm->p_is_net_closed = &p_dm_odm->BOOLEAN_temp; - - phydm_init_debug_setting(p_dm_odm); -#endif odm_init_mp_driver_status(p_dm_odm); phydm_init_trx_antenna_setting(p_dm_odm); phydm_init_soft_ml_setting(p_dm_odm); @@ -640,50 +589,6 @@ odm_common_info_self_update( u32 i, one_entry_macid = 0, ma_rx_tp = 0; struct sta_info *p_entry; -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - - struct _ADAPTER *adapter = p_dm_odm->adapter; - PMGNT_INFO p_mgnt_info = &adapter->MgntInfo; - - p_entry = p_dm_odm->p_odm_sta_info[0]; - if (p_mgnt_info->mAssoc) { - p_entry->bUsed = true; - for (i = 0; i < 6; i++) - p_entry->MacAddr[i] = p_mgnt_info->Bssid[i]; - } else if (GetFirstClientPort(adapter)) { - struct _ADAPTER *p_client_adapter = GetFirstClientPort(adapter); - - p_entry->bUsed = true; - for (i = 0; i < 6; i++) - p_entry->MacAddr[i] = p_client_adapter->MgntInfo.Bssid[i]; - } else { - p_entry->bUsed = false; - for (i = 0; i < 6; i++) - p_entry->MacAddr[i] = 0; - } - - /* STA mode is linked to AP */ - if (IS_STA_VALID(p_dm_odm->p_odm_sta_info[0]) && !ACTING_AS_AP(adapter)) - p_dm_odm->bsta_state = true; - else - p_dm_odm->bsta_state = false; -#endif - - /* THis variable cannot be used because it is wrong*/ -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - if (*(p_dm_odm->p_band_width) == ODM_BW40M) { - if (*(p_dm_odm->p_sec_ch_offset) == 1) - p_dm_odm->control_channel = *(p_dm_odm->p_channel) + 2; - else if (*(p_dm_odm->p_sec_ch_offset) == 2) - p_dm_odm->control_channel = *(p_dm_odm->p_channel) - 2; - } else if (*(p_dm_odm->p_band_width) == ODM_BW80M) { - if (*(p_dm_odm->p_sec_ch_offset) == 1) - p_dm_odm->control_channel = *(p_dm_odm->p_channel) + 6; - else if (*(p_dm_odm->p_sec_ch_offset) == 2) - p_dm_odm->control_channel = *(p_dm_odm->p_channel) - 6; - } else - p_dm_odm->control_channel = *(p_dm_odm->p_channel); -#else if (*(p_dm_odm->p_band_width) == ODM_BW40M) { if (*(p_dm_odm->p_sec_ch_offset) == 1) p_dm_odm->control_channel = *(p_dm_odm->p_channel) - 2; @@ -691,7 +596,6 @@ odm_common_info_self_update( p_dm_odm->control_channel = *(p_dm_odm->p_channel) + 2; } else p_dm_odm->control_channel = *(p_dm_odm->p_channel); -#endif for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { p_entry = p_dm_odm->p_odm_sta_info[i]; @@ -699,15 +603,6 @@ odm_common_info_self_update( entry_cnt++; if (entry_cnt == 1) one_entry_macid = i; - -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - ma_rx_tp = (p_entry->rx_byte_cnt_low_maw) << 3; /* low moving average RX TP ( bit /sec)*/ - - ODM_RT_TRACE(p_dm_odm, PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("ClientTP[%d]: ((%d )) bit/sec\n", i, ma_rx_tp)); - - if (ma_rx_tp > ACTIVE_TP_THRESHOLD) - num_active_client++; -#endif } } @@ -737,9 +632,7 @@ odm_common_info_self_reset( struct PHY_DM_STRUCT *p_dm_odm ) { -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) p_dm_odm->phy_dbg_info.num_qry_beacon_pkt = 0; -#endif } void * @@ -823,10 +716,6 @@ phydm_supportability_init( { struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; u32 support_ability = 0; -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - struct _ADAPTER *adapter = p_dm_odm->adapter; - PMGNT_INFO p_mgnt_info = &adapter->MgntInfo; -#endif if (p_dm_odm->support_ic_type != ODM_RTL8821C) return; @@ -970,12 +859,8 @@ phydm_supportability_init( ODM_BB_RSSI_MONITOR | ODM_BB_RATE_ADAPTIVE | ODM_RF_TX_PWR_TRACK | -#if (DM_ODM_SUPPORT_TYPE & (ODM_CE)) ODM_MAC_EDCA_TURBO | -#endif - ODM_BB_CFO_TRACKING; /* | - * ODM_BB_DYNAMIC_TXPWR | - * ODM_BB_NHM_CNT;*/ + ODM_BB_CFO_TRACKING; break; default: dbg_print("[Warning] Supportability Init error !!!\n"); @@ -991,15 +876,6 @@ phydm_supportability_init( ODM_RT_TRACE(p_dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("ODM adaptivity is set to Enabled!!!\n")); support_ability |= ODM_BB_ADAPTIVITY; - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - phydm_adaptivity_info_init(p_dm_odm, PHYDM_ADAPINFO_CARRIER_SENSE_ENABLE, p_mgnt_info->RegEnableCarrierSense); - phydm_adaptivity_info_init(p_dm_odm, PHYDM_ADAPINFO_DCBACKOFF, p_mgnt_info->RegDCbackoff); - phydm_adaptivity_info_init(p_dm_odm, PHYDM_ADAPINFO_DYNAMICLINKADAPTIVITY, p_mgnt_info->RegDmLinkAdaptivity); - phydm_adaptivity_info_init(p_dm_odm, PHYDM_ADAPINFO_AP_NUM_TH, p_mgnt_info->RegAPNumTH); - phydm_adaptivity_info_init(p_dm_odm, PHYDM_ADAPINFO_TH_L2H_INI, p_mgnt_info->RegL2HForAdaptivity); - phydm_adaptivity_info_init(p_dm_odm, PHYDM_ADAPINFO_TH_EDCCA_HL_DIFF, p_mgnt_info->RegHLDiffForAdaptivity); -#endif } else { ODM_RT_TRACE(p_dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("ODM adaptivity is set to disnabled!!!\n")); /**/ @@ -1017,11 +893,6 @@ odm_dm_init( struct PHY_DM_STRUCT *p_dm_odm ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - struct _ADAPTER *adapter = p_dm_odm->adapter; - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(adapter); -#endif - #if SUPPORTABLITY_PHYDMLIZE phydm_supportability_init(p_dm_odm); #endif @@ -1057,14 +928,12 @@ odm_dm_init( #endif -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) #ifdef BEAMFORMING_VERSION_1 if (p_hal_data->beamforming_version == BEAMFORMING_VERSION_1) #endif { phydm_beamforming_init(p_dm_odm); } -#endif if (p_dm_odm->support_ic_type & ODM_IC_11N_SERIES) { #if (defined(CONFIG_BB_POWER_SAVING)) @@ -1078,7 +947,6 @@ odm_dm_init( } #endif -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) #if (RTL8723B_SUPPORT == 1) if (p_dm_odm->support_ic_type == ODM_RTL8723B) @@ -1089,9 +957,6 @@ odm_dm_init( if (p_dm_odm->support_ic_type == ODM_RTL8192E) odm_primary_cca_check_init(p_dm_odm); #endif - -#endif - } } @@ -1176,27 +1041,6 @@ phydm_support_ability_debug( PHYDM_SNPRINTF((output + used, out_len - used, "%s\n", "================================")); } -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) -/* - * tmp modify for LC Only - * */ -void -odm_dm_watchdog_lps( - struct PHY_DM_STRUCT *p_dm_odm -) -{ - odm_common_info_self_update(p_dm_odm); - odm_false_alarm_counter_statistics(p_dm_odm); - odm_rssi_monitor_check(p_dm_odm); - odm_dig_by_rssi_lps(p_dm_odm); - odm_cck_packet_detection_thresh(p_dm_odm); - odm_common_info_self_reset(p_dm_odm); - - if (*(p_dm_odm->p_is_power_saving) == true) - return; -} -#endif - void phydm_watchdog_mp( struct PHY_DM_STRUCT *p_dm_odm @@ -1221,13 +1065,6 @@ odm_dm_watchdog( phydm_receiver_blocking(p_dm_odm); odm_hw_setting(p_dm_odm); -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - { - struct rtl8192cd_priv *priv = p_dm_odm->priv; - if ((priv->auto_channel != 0) && (priv->auto_channel != 2)) /* if struct _ACS_ running, do not do FA/CCA counter read */ - return; - } -#endif odm_false_alarm_counter_statistics(p_dm_odm); phydm_noisy_detection(p_dm_odm); @@ -1236,9 +1073,7 @@ odm_dm_watchdog( if (*(p_dm_odm->p_is_power_saving) == true) { odm_dig_by_rssi_lps(p_dm_odm); phydm_adaptivity(p_dm_odm); -#if (DM_ODM_SUPPORT_TYPE & (ODM_CE)) odm_antenna_diversity(p_dm_odm); /*enable AntDiv in PS mode, request from SD4 Jeff*/ -#endif ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("DMWatchdog in power saving mode\n")); return; } @@ -1261,9 +1096,7 @@ odm_dm_watchdog( phydm_dynamic_rx_path(p_dm_odm); #endif -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) phydm_beamforming_watchdog(p_dm_odm); -#endif phydm_rf_watchdog(p_dm_odm); @@ -1274,24 +1107,16 @@ odm_dm_watchdog( odm_dynamic_primary_cca(p_dm_odm); #endif -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) - #if (RTL8192E_SUPPORT == 1) if (p_dm_odm->support_ic_type == ODM_RTL8192E) odm_dynamic_primary_cca_check(p_dm_odm); -#endif #endif } - -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) odm_dtc(p_dm_odm); -#endif odm_common_info_self_reset(p_dm_odm); - } - /* * Init /.. Fixed HW value. Only init time. * */ @@ -1646,13 +1471,7 @@ odm_cmn_info_ptr_array_hook( p_dm_odm->p_odm_sta_info[index] = (struct sta_info *)p_value; if (IS_STA_VALID(p_dm_odm->p_odm_sta_info[index])) -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - p_dm_odm->platform2phydm_macid_table[((struct sta_info *)p_value)->AssociatedMacId] = index; /*associated_mac_id are unique bttween different adapter*/ -#elif (DM_ODM_SUPPORT_TYPE == ODM_AP) - p_dm_odm->platform2phydm_macid_table[((struct sta_info *)p_value)->aid] = index; -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) p_dm_odm->platform2phydm_macid_table[((struct sta_info *)p_value)->mac_id] = index; -#endif break; /* To remove the compiler warning, must add an empty default statement to handle the other values. */ @@ -1758,15 +1577,6 @@ odm_cmn_info_update( p_dm_odm->is_bt_disable_edca_turbo = (bool)value; break; #endif - -#if (DM_ODM_SUPPORT_TYPE & ODM_AP) /* for repeater mode add by YuChen 2014.06.23 */ -#ifdef UNIVERSAL_REPEATER - case ODM_CMNINFO_VXD_LINK: - p_dm_odm->vxd_linked = (bool)value; - break; -#endif -#endif - case ODM_CMNINFO_AP_TOTAL_NUM: p_dm_odm->ap_total_num = (u8)value; break; @@ -1780,42 +1590,10 @@ odm_cmn_info_update( p_dm_odm->dfs_region_domain = (u8)value; break; #endif - -#if 0 - case ODM_CMNINFO_OP_MODE: - p_dm_odm->op_mode = (u8)value; - break; - - case ODM_CMNINFO_WM_MODE: - p_dm_odm->wireless_mode = (u8)value; - break; - - case ODM_CMNINFO_BAND: - p_dm_odm->band_type = (u8)value; - break; - - case ODM_CMNINFO_SEC_CHNL_OFFSET: - p_dm_odm->sec_ch_offset = (u8)value; - break; - - case ODM_CMNINFO_SEC_MODE: - p_dm_odm->security = (u8)value; - break; - - case ODM_CMNINFO_BW: - p_dm_odm->band_width = (u8)value; - break; - - case ODM_CMNINFO_CHNL: - p_dm_odm->channel = (u8)value; - break; -#endif default: /* do nothing */ break; } - - } u32 @@ -1887,266 +1665,6 @@ phydm_cmn_info_query( } } - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -void -odm_init_all_work_items(struct PHY_DM_STRUCT *p_dm_odm) -{ - - struct _ADAPTER *p_adapter = p_dm_odm->adapter; -#if USE_WORKITEM - -#if CONFIG_DYNAMIC_RX_PATH - odm_initialize_work_item(p_dm_odm, - &p_dm_odm->dm_drp_table.phydm_dynamic_rx_path_workitem, - (RT_WORKITEM_CALL_BACK)phydm_dynamic_rx_path_workitem_callback, - (void *)p_adapter, - "DynamicRxPathWorkitem"); - -#endif -#ifdef CONFIG_S0S1_SW_ANTENNA_DIVERSITY - odm_initialize_work_item(p_dm_odm, - &p_dm_odm->dm_swat_table.phydm_sw_antenna_switch_workitem, - (RT_WORKITEM_CALL_BACK)odm_sw_antdiv_workitem_callback, - (void *)p_adapter, - "AntennaSwitchWorkitem"); -#endif -#ifdef CONFIG_HL_SMART_ANTENNA_TYPE1 - odm_initialize_work_item(p_dm_odm, - &p_dm_odm->dm_sat_table.hl_smart_antenna_workitem, - (RT_WORKITEM_CALL_BACK)phydm_beam_switch_workitem_callback, - (void *)p_adapter, - "hl_smart_ant_workitem"); - - odm_initialize_work_item(p_dm_odm, - &p_dm_odm->dm_sat_table.hl_smart_antenna_decision_workitem, - (RT_WORKITEM_CALL_BACK)phydm_beam_decision_workitem_callback, - (void *)p_adapter, - "hl_smart_ant_decision_workitem"); -#endif - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->path_div_switch_workitem), - (RT_WORKITEM_CALL_BACK)odm_path_div_chk_ant_switch_workitem_callback, - (void *)p_adapter, - "SWAS_WorkItem"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->cck_path_diversity_workitem), - (RT_WORKITEM_CALL_BACK)odm_cck_tx_path_diversity_work_item_callback, - (void *)p_adapter, - "CCKTXPathDiversityWorkItem"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->mpt_dig_workitem), - (RT_WORKITEM_CALL_BACK)odm_mpt_dig_work_item_callback, - (void *)p_adapter, - "mpt_dig_workitem"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->ra_rpt_workitem), - (RT_WORKITEM_CALL_BACK)odm_update_init_rate_work_item_callback, - (void *)p_adapter, - "ra_rpt_workitem"); - -#if (defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY)) || (defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY)) - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->fast_ant_training_workitem), - (RT_WORKITEM_CALL_BACK)odm_fast_ant_training_work_item_callback, - (void *)p_adapter, - "fast_ant_training_workitem"); -#endif - -#endif /*#if USE_WORKITEM*/ - -#if (BEAMFORMING_SUPPORT == 1) - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->beamforming_info.txbf_info.txbf_enter_work_item), - (RT_WORKITEM_CALL_BACK)hal_com_txbf_enter_work_item_callback, - (void *)p_adapter, - "txbf_enter_work_item"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->beamforming_info.txbf_info.txbf_leave_work_item), - (RT_WORKITEM_CALL_BACK)hal_com_txbf_leave_work_item_callback, - (void *)p_adapter, - "txbf_leave_work_item"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->beamforming_info.txbf_info.txbf_fw_ndpa_work_item), - (RT_WORKITEM_CALL_BACK)hal_com_txbf_fw_ndpa_work_item_callback, - (void *)p_adapter, - "txbf_fw_ndpa_work_item"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->beamforming_info.txbf_info.txbf_clk_work_item), - (RT_WORKITEM_CALL_BACK)hal_com_txbf_clk_work_item_callback, - (void *)p_adapter, - "txbf_clk_work_item"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->beamforming_info.txbf_info.txbf_rate_work_item), - (RT_WORKITEM_CALL_BACK)hal_com_txbf_rate_work_item_callback, - (void *)p_adapter, - "txbf_rate_work_item"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->beamforming_info.txbf_info.txbf_status_work_item), - (RT_WORKITEM_CALL_BACK)hal_com_txbf_status_work_item_callback, - (void *)p_adapter, - "txbf_status_work_item"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->beamforming_info.txbf_info.txbf_reset_tx_path_work_item), - (RT_WORKITEM_CALL_BACK)hal_com_txbf_reset_tx_path_work_item_callback, - (void *)p_adapter, - "txbf_reset_tx_path_work_item"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->beamforming_info.txbf_info.txbf_get_tx_rate_work_item), - (RT_WORKITEM_CALL_BACK)hal_com_txbf_get_tx_rate_work_item_callback, - (void *)p_adapter, - "txbf_get_tx_rate_work_item"); -#endif - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->adaptivity.phydm_pause_edcca_work_item), - (RT_WORKITEM_CALL_BACK)phydm_pause_edcca_work_item_callback, - (void *)p_adapter, - "phydm_pause_edcca_work_item"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->adaptivity.phydm_resume_edcca_work_item), - (RT_WORKITEM_CALL_BACK)phydm_resume_edcca_work_item_callback, - (void *)p_adapter, - "phydm_resume_edcca_work_item"); - -#if (PHYDM_LA_MODE_SUPPORT == 1) - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->adcsmp.adc_smp_work_item), - (RT_WORKITEM_CALL_BACK)adc_smp_work_item_callback, - (void *)p_adapter, - "adc_smp_work_item"); - - odm_initialize_work_item( - p_dm_odm, - &(p_dm_odm->adcsmp.adc_smp_work_item_1), - (RT_WORKITEM_CALL_BACK)adc_smp_work_item_callback, - (void *)p_adapter, - "adc_smp_work_item_1"); -#endif - -} - -void -odm_free_all_work_items(struct PHY_DM_STRUCT *p_dm_odm) -{ -#if USE_WORKITEM - -#ifdef CONFIG_S0S1_SW_ANTENNA_DIVERSITY - odm_free_work_item(&(p_dm_odm->dm_swat_table.phydm_sw_antenna_switch_workitem)); -#endif - -#if CONFIG_DYNAMIC_RX_PATH - odm_free_work_item(&(p_dm_odm->dm_drp_table.phydm_dynamic_rx_path_workitem)); -#endif - - - -#ifdef CONFIG_HL_SMART_ANTENNA_TYPE1 - odm_free_work_item(&(p_dm_odm->dm_sat_table.hl_smart_antenna_workitem)); - odm_free_work_item(&(p_dm_odm->dm_sat_table.hl_smart_antenna_decision_workitem)); -#endif - - odm_free_work_item(&(p_dm_odm->path_div_switch_workitem)); - odm_free_work_item(&(p_dm_odm->cck_path_diversity_workitem)); -#if (defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY)) || (defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY)) - odm_free_work_item(&(p_dm_odm->fast_ant_training_workitem)); -#endif - odm_free_work_item(&(p_dm_odm->mpt_dig_workitem)); - odm_free_work_item(&(p_dm_odm->ra_rpt_workitem)); - /*odm_free_work_item((&p_dm_odm->sbdcnt_workitem));*/ -#endif - -#if (BEAMFORMING_SUPPORT == 1) - odm_free_work_item((&p_dm_odm->beamforming_info.txbf_info.txbf_enter_work_item)); - odm_free_work_item((&p_dm_odm->beamforming_info.txbf_info.txbf_leave_work_item)); - odm_free_work_item((&p_dm_odm->beamforming_info.txbf_info.txbf_fw_ndpa_work_item)); - odm_free_work_item((&p_dm_odm->beamforming_info.txbf_info.txbf_clk_work_item)); - odm_free_work_item((&p_dm_odm->beamforming_info.txbf_info.txbf_rate_work_item)); - odm_free_work_item((&p_dm_odm->beamforming_info.txbf_info.txbf_status_work_item)); - odm_free_work_item((&p_dm_odm->beamforming_info.txbf_info.txbf_reset_tx_path_work_item)); - odm_free_work_item((&p_dm_odm->beamforming_info.txbf_info.txbf_get_tx_rate_work_item)); -#endif - - odm_free_work_item((&p_dm_odm->adaptivity.phydm_pause_edcca_work_item)); - odm_free_work_item((&p_dm_odm->adaptivity.phydm_resume_edcca_work_item)); - -#if (PHYDM_LA_MODE_SUPPORT == 1) - odm_free_work_item((&p_dm_odm->adcsmp.adc_smp_work_item)); - odm_free_work_item((&p_dm_odm->adcsmp.adc_smp_work_item_1)); -#endif - -} -#endif /*#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)*/ - -#if 0 -void -odm_FindMinimumRSSI( - struct PHY_DM_STRUCT *p_dm_odm -) -{ - u32 i; - u8 rssi_min = 0xFF; - - for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { - /* if(p_dm_odm->p_odm_sta_info[i] != NULL) */ - if (IS_STA_VALID(p_dm_odm->p_odm_sta_info[i])) { - if (p_dm_odm->p_odm_sta_info[i]->rssi_ave < rssi_min) - rssi_min = p_dm_odm->p_odm_sta_info[i]->rssi_ave; - } - } - - p_dm_odm->rssi_min = rssi_min; - -} - -void -odm_IsLinked( - struct PHY_DM_STRUCT *p_dm_odm -) -{ - u32 i; - bool Linked = false; - - for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { - if (IS_STA_VALID(p_dm_odm->p_odm_sta_info[i])) { - Linked = true; - break; - } - - } - - p_dm_odm->is_linked = Linked; -} -#endif - void odm_init_all_timers( struct PHY_DM_STRUCT *p_dm_odm @@ -2160,36 +1678,10 @@ odm_init_all_timers( phydm_dynamic_rx_path_timers(p_dm_odm, INIT_DRP_TIMMER); #endif -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -#ifdef MP_TEST - if (p_dm_odm->priv->pshare->rf_ft_var.mp_specific) - odm_initialize_timer(p_dm_odm, &p_dm_odm->mpt_dig_timer, - (void *)odm_mpt_dig_callback, NULL, "mpt_dig_timer"); -#endif -#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) - odm_initialize_timer(p_dm_odm, &p_dm_odm->mpt_dig_timer, - (void *)odm_mpt_dig_callback, NULL, "mpt_dig_timer"); -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - odm_initialize_timer(p_dm_odm, &p_dm_odm->path_div_switch_timer, - (void *)odm_path_div_chk_ant_switch_callback, NULL, "PathDivTimer"); - odm_initialize_timer(p_dm_odm, &p_dm_odm->cck_path_diversity_timer, - (void *)odm_cck_tx_path_diversity_callback, NULL, "cck_path_diversity_timer"); - odm_initialize_timer(p_dm_odm, &p_dm_odm->sbdcnt_timer, - (void *)phydm_sbd_callback, NULL, "SbdTimer"); -#if (BEAMFORMING_SUPPORT == 1) - odm_initialize_timer(p_dm_odm, &p_dm_odm->beamforming_info.txbf_info.txbf_fw_ndpa_timer, - (void *)hal_com_txbf_fw_ndpa_timer_callback, NULL, "txbf_fw_ndpa_timer"); -#endif -#endif - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) #if (BEAMFORMING_SUPPORT == 1) odm_initialize_timer(p_dm_odm, &p_dm_odm->beamforming_info.beamforming_timer, (void *)beamforming_sw_timer_callback, NULL, "beamforming_timer"); #endif -#endif } void @@ -2197,14 +1689,6 @@ odm_cancel_all_timers( struct PHY_DM_STRUCT *p_dm_odm ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - /* */ - /* 2012/01/12 MH Temp BSOD fix. We need to find NIC allocate mem fail reason in */ - /* win7 platform. */ - /* */ - HAL_ADAPTER_STS_CHK(p_dm_odm); -#endif - #if (defined(CONFIG_PHYDM_ANTENNA_DIVERSITY)) odm_ant_div_timers(p_dm_odm, CANCEL_ANTDIV_TIMMER); #endif @@ -2213,31 +1697,9 @@ odm_cancel_all_timers( phydm_dynamic_rx_path_timers(p_dm_odm, CANCEL_DRP_TIMMER); #endif -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -#ifdef MP_TEST - if (p_dm_odm->priv->pshare->rf_ft_var.mp_specific) - odm_cancel_timer(p_dm_odm, &p_dm_odm->mpt_dig_timer); -#endif -#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) - odm_cancel_timer(p_dm_odm, &p_dm_odm->mpt_dig_timer); -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - odm_cancel_timer(p_dm_odm, &p_dm_odm->path_div_switch_timer); - odm_cancel_timer(p_dm_odm, &p_dm_odm->cck_path_diversity_timer); - odm_cancel_timer(p_dm_odm, &p_dm_odm->mpt_dig_timer); - odm_cancel_timer(p_dm_odm, &p_dm_odm->sbdcnt_timer); -#if (BEAMFORMING_SUPPORT == 1) - odm_cancel_timer(p_dm_odm, &p_dm_odm->beamforming_info.txbf_info.txbf_fw_ndpa_timer); -#endif -#endif - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) #if (BEAMFORMING_SUPPORT == 1) odm_cancel_timer(p_dm_odm, &p_dm_odm->beamforming_info.beamforming_timer); #endif -#endif - } @@ -2254,30 +1716,9 @@ odm_release_all_timers( phydm_dynamic_rx_path_timers(p_dm_odm, RELEASE_DRP_TIMMER); #endif -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -#ifdef MP_TEST - if (p_dm_odm->priv->pshare->rf_ft_var.mp_specific) - odm_release_timer(p_dm_odm, &p_dm_odm->mpt_dig_timer); -#endif -#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) - odm_release_timer(p_dm_odm, &p_dm_odm->mpt_dig_timer); -#endif - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - odm_release_timer(p_dm_odm, &p_dm_odm->path_div_switch_timer); - odm_release_timer(p_dm_odm, &p_dm_odm->cck_path_diversity_timer); - odm_release_timer(p_dm_odm, &p_dm_odm->mpt_dig_timer); - odm_release_timer(p_dm_odm, &p_dm_odm->sbdcnt_timer); -#if (BEAMFORMING_SUPPORT == 1) - odm_release_timer(p_dm_odm, &p_dm_odm->beamforming_info.txbf_info.txbf_fw_ndpa_timer); -#endif -#endif - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) #if (BEAMFORMING_SUPPORT == 1) odm_release_timer(p_dm_odm, &p_dm_odm->beamforming_info.beamforming_timer); #endif -#endif } @@ -2285,98 +1726,9 @@ odm_release_all_timers( * 3 Tx Power Tracking * 3============================================================ */ - - - -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -void -odm_init_all_threads( - struct PHY_DM_STRUCT *p_dm_odm -) -{ -#ifdef TPT_THREAD - k_tpt_task_init(p_dm_odm->priv); -#endif -} - -void -odm_stop_all_threads( - struct PHY_DM_STRUCT *p_dm_odm -) -{ -#ifdef TPT_THREAD - k_tpt_task_stop(p_dm_odm->priv); -#endif -} -#endif - - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -/* - * 2011/07/26 MH Add an API for testing IQK fail case. - * */ -bool -odm_check_power_status( - struct _ADAPTER *adapter) -{ - - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(adapter); - struct PHY_DM_STRUCT *p_dm_odm = &p_hal_data->DM_OutSrc; - RT_RF_POWER_STATE rt_state; - PMGNT_INFO p_mgnt_info = &(adapter->MgntInfo); - - /* 2011/07/27 MH We are not testing ready~~!! We may fail to get correct value when init sequence. */ - if (p_mgnt_info->init_adpt_in_progress == true) { - ODM_RT_TRACE(p_dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("odm_check_power_status Return true, due to initadapter\n")); - return true; - } - - /* */ - /* 2011/07/19 MH We can not execute tx pwoer tracking/ LLC calibrate or IQK. */ - /* */ - adapter->HalFunc.GetHwRegHandler(adapter, HW_VAR_RF_STATE, (u8 *)(&rt_state)); - if (adapter->bDriverStopped || adapter->bDriverIsGoingToPnpSetPowerSleep || rt_state == eRfOff) { - ODM_RT_TRACE(p_dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("odm_check_power_status Return false, due to %d/%d/%d\n", - adapter->bDriverStopped, adapter->bDriverIsGoingToPnpSetPowerSleep, rt_state)); - return false; - } - return true; -} -#elif (DM_ODM_SUPPORT_TYPE == ODM_AP) -bool -odm_check_power_status( - struct _ADAPTER *adapter) -{ -#if 0 - /* HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(adapter); */ - struct PHY_DM_STRUCT *p_dm_odm = &p_hal_data->DM_OutSrc; - RT_RF_POWER_STATE rt_state; - PMGNT_INFO p_mgnt_info = &(adapter->MgntInfo); - - /* 2011/07/27 MH We are not testing ready~~!! We may fail to get correct value when init sequence. */ - if (p_mgnt_info->init_adpt_in_progress == true) { - ODM_RT_TRACE(p_dm_odm, COMP_INIT, DBG_LOUD, ("odm_check_power_status Return true, due to initadapter")); - return true; - } - - /* */ - /* 2011/07/19 MH We can not execute tx pwoer tracking/ LLC calibrate or IQK. */ - /* */ - phydm_get_hw_reg_interface(p_dm_odm, HW_VAR_RF_STATE, (u8 *)(&rt_state)); - if (adapter->is_driver_stopped || adapter->is_driver_is_going_to_pnp_set_power_sleep || rt_state == eRfOff) { - ODM_RT_TRACE(p_dm_odm, COMP_INIT, DBG_LOUD, ("odm_check_power_status Return false, due to %d/%d/%d\n", - adapter->is_driver_stopped, adapter->is_driver_is_going_to_pnp_set_power_sleep, rt_state)); - return false; - } -#endif - return true; -} -#endif - /* need to ODM CE Platform * move to here for ANT detection mechanism using */ -#if ((DM_ODM_SUPPORT_TYPE == ODM_WIN) || (DM_ODM_SUPPORT_TYPE == ODM_CE)) u32 get_psd_data( struct PHY_DM_STRUCT *p_dm_odm, @@ -2408,16 +1760,10 @@ get_psd_data( /* Read PSD report, Reg8B4[15:0] */ psd_report = odm_get_bb_reg(p_dm_odm, 0x8B4, MASKDWORD) & 0x0000FFFF; -#if 1/* (DEV_BUS_TYPE == RT_PCI_INTERFACE) && ((RT_PLATFORM == PLATFORM_LINUX) || (RT_PLATFORM == PLATFORM_MACOSX)) */ psd_report = (u32)(odm_convert_to_db(psd_report)) + (u32)(initial_gain_psd - 0x1c); -#else - psd_report = (int)(20 * log10((double)psd_report)) + (int)(initial_gain_psd - 0x1c); -#endif return psd_report; - } -#endif u32 odm_convert_to_db( @@ -2476,47 +1822,8 @@ odm_asoc_entry_init( struct PHY_DM_STRUCT *p_dm_odm ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - struct _ADAPTER *p_loop_adapter = GetDefaultAdapter(p_dm_odm->adapter); - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(p_loop_adapter); - struct PHY_DM_STRUCT *p_dm_out_src = &p_hal_data->DM_OutSrc; - u8 total_assoc_entry_num = 0; - u8 index = 0; - u8 adaptercount = 0; - - odm_cmn_info_ptr_array_hook(p_dm_out_src, ODM_CMNINFO_STA_STATUS, 0, &p_loop_adapter->MgntInfo.DefaultPort[0]); - p_loop_adapter->MgntInfo.DefaultPort[0].MultiPortStationIdx = total_assoc_entry_num; - - adaptercount += 1; - RT_TRACE(COMP_INIT, DBG_LOUD, ("adaptercount=%d\n", adaptercount)); - p_loop_adapter = GetNextExtAdapter(p_loop_adapter); - total_assoc_entry_num += 1; - - while (p_loop_adapter) { - for (index = 0; index < ASSOCIATE_ENTRY_NUM; index++) { - odm_cmn_info_ptr_array_hook(p_dm_out_src, ODM_CMNINFO_STA_STATUS, total_assoc_entry_num + index, &p_loop_adapter->MgntInfo.AsocEntry[index]); - p_loop_adapter->MgntInfo.AsocEntry[index].MultiPortStationIdx = total_assoc_entry_num + index; - } - - total_assoc_entry_num += index; - if (IS_HARDWARE_TYPE_8188E((p_dm_odm->adapter))) - p_loop_adapter->RASupport = true; - adaptercount += 1; - RT_TRACE(COMP_INIT, DBG_LOUD, ("adaptercount=%d\n", adaptercount)); - p_loop_adapter = GetNextExtAdapter(p_loop_adapter); - } - - RT_TRACE(COMP_INIT, DBG_LOUD, ("total_assoc_entry_num = %d\n", total_assoc_entry_num)); - if (total_assoc_entry_num < (ODM_ASSOCIATE_ENTRY_NUM - 1)) { - - RT_TRACE(COMP_INIT, DBG_LOUD, ("In hook null\n")); - for (index = total_assoc_entry_num; index < ODM_ASSOCIATE_ENTRY_NUM; index++) - odm_cmn_info_ptr_array_hook(p_dm_out_src, ODM_CMNINFO_STA_STATUS, index, NULL); - } -#endif } -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) /* Justin: According to the current RRSI to adjust Response Frame TX power, 2012/11/05 */ void odm_dtc(struct PHY_DM_STRUCT *p_dm_odm) { @@ -2554,12 +1861,6 @@ void odm_dtc(struct PHY_DM_STRUCT *p_dm_odm) u8 sign; u8 resp_txagc = 0; -#if 0 - /* As DIG is disabled, DTC is also disable */ - if (!(p_dm_odm->support_ability & ODM_XXXXXX)) - return; -#endif - if (DTC_BASE < p_dm_odm->rssi_min) { /* need to decade the CTS TX power */ sign = 1; @@ -2569,21 +1870,7 @@ void odm_dtc(struct PHY_DM_STRUCT *p_dm_odm) else dtc_steps++; } - } -#if 0 - else if (DTC_DWN_BASE > p_dm_odm->rssi_min) { - /* 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] <= p_dm_odm->rssi_min) || (dtc_steps >= 10)) - break; - else - dtc_steps++; - } - } -#endif - else { + } else { sign = 0; dtc_steps = 0; } @@ -2597,14 +1884,11 @@ void odm_dtc(struct PHY_DM_STRUCT *p_dm_odm) #endif /* CONFIG_RESP_TXAGC_ADJUST */ } -#endif /* #if (DM_ODM_SUPPORT_TYPE == ODM_CE) */ - void odm_update_power_training_state( struct PHY_DM_STRUCT *p_dm_odm ) { -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) struct _FALSE_ALARM_STATISTICS *false_alm_cnt = (struct _FALSE_ALARM_STATISTICS *)phydm_get_structure(p_dm_odm, PHYDM_FALSEALMCNT); struct _dynamic_initial_gain_threshold_ *p_dm_dig_table = &p_dm_odm->dm_dig_table; u32 score = 0; @@ -2697,7 +1981,6 @@ odm_update_power_training_state( p_dm_odm->phy_dbg_info.num_qry_phy_status_ofdm = 0; p_dm_odm->phy_dbg_info.num_qry_phy_status_cck = 0; -#endif } @@ -2706,27 +1989,6 @@ odm_update_power_training_state( /* The following is for compile only*/ /*===========================================================*/ /*#define TARGET_CHNL_NUM_2G_5G 59*/ -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -u8 get_right_chnl_place_for_iqk(u8 chnl) -{ - u8 channel_all[TARGET_CHNL_NUM_2G_5G] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 100, - 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 149, 151, 153, 155, 157, 159, 161, 163, 165 - }; - u8 place = chnl; - - - if (chnl > 14) { - for (place = 14; place < sizeof(channel_all); place++) { - if (channel_all[place] == chnl) - return place - 13; - } - } - - return 0; -} - -#endif /*===========================================================*/ void @@ -2740,30 +2002,6 @@ phydm_noisy_detection( total_cca_cnt = p_dm_odm->false_alm_cnt.cnt_cca_all; total_fa_cnt = p_dm_odm->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; @@ -2778,81 +2016,6 @@ phydm_noisy_detection( score_smooth = (total_cca_cnt >= 300) ? ((p_dm_odm->noisy_decision_smooth + 3) >> 3) : 0; p_dm_odm->noisy_decision = (score_smooth >= 3) ? 1 : 0; -#if 0 - switch (score_smooth) { - case 0: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=0%%\n")); - break; - case 1: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=6.25%%\n")); - break; - case 2: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=12.5%%\n")); - break; - case 3: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=18.75%%\n")); - break; - case 4: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=25%%\n")); - break; - case 5: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=31.25%%\n")); - break; - case 6: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=37.5%%\n")); - break; - case 7: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=43.75%%\n")); - break; - case 8: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=50%%\n")); - break; - case 9: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=56.25%%\n")); - break; - case 10: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=62.5%%\n")); - break; - case 11: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=68.75%%\n")); - break; - case 12: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=75%%\n")); - break; - case 13: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=81.25%%\n")); - break; - case 14: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=87.5%%\n")); - break; - case 15: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=93.75%%\n")); - break; - case 16: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] total_fa_cnt/total_cca_cnt=100%%\n")); - break; - default: - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, - ("[NoisyDetection] Unknown value!! Need Check!!\n")); - } -#endif ODM_RT_TRACE(p_dm_odm, ODM_COMP_NOISY_DETECT, ODM_DBG_LOUD, ("[NoisyDetection] total_cca_cnt=%d, total_fa_cnt=%d, noisy_decision_smooth=%d, score=%d, score_smooth=%d, p_dm_odm->noisy_decision=%d\n", total_cca_cnt, total_fa_cnt, p_dm_odm->noisy_decision_smooth, score, score_smooth, p_dm_odm->noisy_decision)); diff --git a/hal/phydm/phydm_debug.h b/hal/phydm/phydm_debug.h index e81a2cf..34d75eb 100644 --- a/hal/phydm/phydm_debug.h +++ b/hal/phydm/phydm_debug.h @@ -130,19 +130,9 @@ #define config_phydm_read_txagc_check(data) (data != INVALID_TXAGC_DATA) -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #define dbg_print DbgPrint - #define dcmd_printf DCMD_Printf - #define dcmd_scanf DCMD_Scanf - #define RT_PRINTK dbg_print -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #define dbg_print printk - #define RT_PRINTK(fmt, args...) dbg_print("%s(): " fmt, __FUNCTION__, ## args); - #define RT_DISP(dbgtype, dbgflag, printstr) -#else - #define dbg_print panic_printk - #define RT_PRINTK(fmt, args...) dbg_print("%s(): " fmt, __FUNCTION__, ## args); -#endif +#define dbg_print printk +#define RT_PRINTK(fmt, args...) dbg_print("%s(): " fmt, __FUNCTION__, ## args); +#define RT_DISP(dbgtype, dbgflag, printstr) #ifndef ASSERT #define ASSERT(expr) @@ -224,29 +214,7 @@ phydm_init_debug_setting(struct PHY_DM_STRUCT *p_dm_odm); void phydm_basic_dbg_message(void *p_dm_void); -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) #define PHYDM_DBGPRINT 0 -#define PHYDM_SSCANF(x, y, z) dcmd_scanf(x, y, z) -#define PHYDM_VAST_INFO_SNPRINTF PHYDM_SNPRINTF -#if (PHYDM_DBGPRINT == 1) -#define PHYDM_SNPRINTF(msg) \ - do {\ - rsprintf msg;\ - dbg_print(output);\ - } while (0) -#else -#define PHYDM_SNPRINTF(msg) \ - do {\ - rsprintf msg;\ - dcmd_printf(output);\ - } while (0) -#endif -#else -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) || defined(__OSK__) - #define PHYDM_DBGPRINT 0 -#else - #define PHYDM_DBGPRINT 1 -#endif #define MAX_ARGC 20 #define MAX_ARGV 16 #define DCMD_DECIMAL "%d" @@ -274,8 +242,6 @@ void phydm_basic_dbg_message(void *p_dm_void); used += snprintf msg;\ } while (0) #endif -#endif - void phydm_basic_profile( void *p_dm_void, @@ -283,7 +249,6 @@ void phydm_basic_profile( char *output, u32 *_out_len ); -#if (DM_ODM_SUPPORT_TYPE & (ODM_CE | ODM_AP)) s32 phydm_cmd( struct PHY_DM_STRUCT *p_dm_odm, @@ -293,7 +258,7 @@ phydm_cmd( char *output, u32 out_len ); -#endif + void phydm_cmd_parser( struct PHY_DM_STRUCT *p_dm_odm, @@ -312,20 +277,6 @@ phydm_api_trx_mode( bool is_tx2_path ); -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -void phydm_sbd_check( - struct PHY_DM_STRUCT *p_dm_odm -); - -void phydm_sbd_callback( - struct timer_list *p_timer -); - -void phydm_sbd_workitem_callback( - void *p_context -); -#endif - void phydm_fw_trace_en_h2c( void *p_dm_void, diff --git a/hal/phydm/phydm_dig.h b/hal/phydm/phydm_dig.h index 5fe2b93..7d16c1e 100644 --- a/hal/phydm/phydm_dig.h +++ b/hal/phydm/phydm_dig.h @@ -94,14 +94,6 @@ struct _dynamic_initial_gain_threshold_ { u32 cck_fa_ma; enum dig_goupcheck_level dig_go_up_check_level; -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) - bool is_tp_target; - bool is_noise_est; - u32 tp_train_th_min; - u8 igi_offset_a; - u8 igi_offset_b; -#endif - #if (RTL8822B_SUPPORT == 1 || RTL8197F_SUPPORT == 1 || RTL8821C_SUPPORT == 1) u8 rf_gain_idx; u8 agc_table_idx; @@ -232,24 +224,10 @@ enum phydm_pause_level { #define DM_DIG_MAX_AP_HP 0x42 #define DM_DIG_MIN_AP_HP 0x30 -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) - #define DM_DIG_MAX_AP_COVERAGR 0x26 - #define DM_DIG_MIN_AP_COVERAGE 0x1c - #define DM_DIG_MAX_OF_MIN_COVERAGE 0x22 - - #define dm_dig_tp_target_th0 500 - #define dm_dig_tp_target_th1 1000 - #define dm_dig_tp_training_period 10 -#endif - /* vivi 92c&92d has different definition, 20110504 * this is for 92c */ -#if (DM_ODM_SUPPORT_TYPE & ODM_CE) - #ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV - #define DM_DIG_FA_TH0 0x80/* 0x20 */ - #else - #define DM_DIG_FA_TH0 0x200/* 0x20 */ - #endif +#ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV + #define DM_DIG_FA_TH0 0x80/* 0x20 */ #else #define DM_DIG_FA_TH0 0x200/* 0x20 */ #endif @@ -337,32 +315,4 @@ phydm_dig_go_up_check( void *p_dm_void ); -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -void -odm_mpt_dig_callback( - struct timer_list *p_timer -); - -void -odm_mpt_dig_work_item_callback( - void *p_context -); - -#endif - -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) -void -odm_mpt_dig_callback( - void *p_dm_void -); -#endif - -#if (DM_ODM_SUPPORT_TYPE != ODM_CE) -void -ODM_MPT_DIG( - void *p_dm_void -); -#endif - - #endif diff --git a/hal/phydm/phydm_dynamic_rx_path.c b/hal/phydm/phydm_dynamic_rx_path.c index 4ef4b9f..3226121 100644 --- a/hal/phydm/phydm_dynamic_rx_path.c +++ b/hal/phydm/phydm_dynamic_rx_path.c @@ -185,45 +185,6 @@ phydm_dynamic_rx_path( } -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -void -phydm_dynamic_rx_path_callback( - struct timer_list *p_timer -) -{ - struct _ADAPTER *adapter = (struct _ADAPTER *)p_timer->adapter; - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(adapter); - struct PHY_DM_STRUCT *p_dm_odm = &(p_hal_data->DM_OutSrc); - struct _DYNAMIC_RX_PATH_ *p_dm_drp_table = &(p_dm_odm->dm_drp_table); - -#if DEV_BUS_TYPE == RT_PCI_INTERFACE -#if USE_WORKITEM - odm_schedule_work_item(&(p_dm_drp_table->phydm_dynamic_rx_path_workitem)); -#else - { - /* dbg_print("phydm_dynamic_rx_path\n"); */ - phydm_dynamic_rx_path(p_dm_odm); - } -#endif -#else - odm_schedule_work_item(&(p_dm_drp_table->phydm_dynamic_rx_path_workitem)); -#endif -} - -void -phydm_dynamic_rx_path_workitem_callback( - void *p_context -) -{ - struct _ADAPTER *p_adapter = (struct _ADAPTER *)p_context; - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(p_adapter); - struct PHY_DM_STRUCT *p_dm_odm = &(p_hal_data->DM_OutSrc); - - /* dbg_print("phydm_dynamic_rx_path\n"); */ - phydm_dynamic_rx_path(p_dm_odm); -} -#else if (DM_ODM_SUPPORT_TYPE == ODM_CE) - void phydm_dynamic_rx_path_callback( void *function_context @@ -234,16 +195,8 @@ phydm_dynamic_rx_path_callback( if (padapter->net_closed == _TRUE) return; - -#if 0 /* Can't do I/O in timer callback*/ - odm_s0s1_sw_ant_div(p_dm_odm, SWAW_STEP_DETERMINE); -#else - /*rtw_run_in_thread_cmd(padapter, odm_sw_antdiv_workitem_callback, padapter);*/ -#endif } -#endif - void phydm_dynamic_rx_path_timers( void *p_dm_void, diff --git a/hal/phydm/phydm_dynamic_rx_path.h b/hal/phydm/phydm_dynamic_rx_path.h index b38f63b..48f0e72 100644 --- a/hal/phydm/phydm_dynamic_rx_path.h +++ b/hal/phydm/phydm_dynamic_rx_path.h @@ -64,14 +64,7 @@ struct _DYNAMIC_RX_PATH_ { u8 drp_skip_counter; u8 drp_period; u8 drp_init_finished; - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -#if USE_WORKITEM - RT_WORK_ITEM phydm_dynamic_rx_path_workitem; -#endif -#endif struct timer_list phydm_dynamic_rx_path_timer; - }; @@ -83,30 +76,9 @@ phydm_process_phy_status_for_dynamic_rx_path( void *p_pkt_info_void ); -void -phydm_dynamic_rx_path( - void *p_dm_void -); +void phydm_dynamic_rx_path(void *p_dm_void); -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -void -phydm_dynamic_rx_path_callback( - struct timer_list *p_timer -); - -void -phydm_dynamic_rx_path_workitem_callback( - void *p_context -); - -#else if (DM_ODM_SUPPORT_TYPE == ODM_CE) - -void -phydm_dynamic_rx_path_callback( - void *function_context -); - -#endif +void phydm_dynamic_rx_path_callback(void *function_context); void phydm_dynamic_rx_path_timers( diff --git a/hal/phydm/phydm_precomp.h b/hal/phydm/phydm_precomp.h index 5ca623d..280be1f 100644 --- a/hal/phydm/phydm_precomp.h +++ b/hal/phydm/phydm_precomp.h @@ -23,40 +23,12 @@ #include "phydm_types.h" -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #include "Precomp.h" /* We need to include mp_precomp.h due to batch file setting. */ -#else - #define TEST_FALG___ 1 -#endif +#define TEST_FALG___ 1 /* 2 Config Flags and Structs - defined by each ODM type */ -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) - #include "../8192cd_cfg.h" - #include "../odm_inc.h" - - #include "../8192cd.h" - #include "../8192cd_util.h" - #ifdef _BIG_ENDIAN_ - #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG - #else - #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE - #endif - - #ifdef AP_BUILD_WORKAROUND - #include "../8192cd_headers.h" - #include "../8192cd_debug.h" - #endif - -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #define __PACK - #define __WLAN_ATTRIB_PACK__ -#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #include "mp_precomp.h" - #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE - #define __PACK - #define __WLAN_ATTRIB_PACK__ -#endif +#define __PACK +#define __WLAN_ATTRIB_PACK__ /* 2 OutSrc Header Files */ @@ -70,7 +42,6 @@ #include "phydm_adc_sampling.h" -#if (DM_ODM_SUPPORT_TYPE & ODM_CE) void phy_set_tx_power_limit( @@ -84,14 +55,6 @@ phy_set_tx_power_limit( u8 *power_limit ); -#endif - -#if (DM_ODM_SUPPORT_TYPE & ODM_AP) - #define RTL8703B_SUPPORT 0 - #define RTL8188F_SUPPORT 0 - #define RTL8723D_SUPPORT 0 -#endif - #if RTL8188E_SUPPORT == 1 #define RTL8188E_T_SUPPORT 1 #ifdef CONFIG_SFW_SUPPORTED @@ -112,66 +75,37 @@ phy_set_tx_power_limit( #include "rtl8188e/phydm_rtl8188e.h" #include "rtl8188e/hal8188ereg.h" #include "rtl8188e/version_rtl8188e.h" - #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8188e_hal.h" - #include "rtl8188e/halphyrf_8188e_ce.h" - #endif - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #include "rtl8188e/halphyrf_8188e_win.h" - #endif - #if (DM_ODM_SUPPORT_TYPE == ODM_AP) - #include "rtl8188e/halphyrf_8188e_ap.h" - #endif + #include "rtl8188e_hal.h" + #include "rtl8188e/halphyrf_8188e_ce.h" #endif /* 88E END */ #if (RTL8192E_SUPPORT == 1) - - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #include "rtl8192e/halphyrf_8192e_win.h" /*FOR_8192E_IQK*/ - #elif (DM_ODM_SUPPORT_TYPE == ODM_AP) - #include "rtl8192e/halphyrf_8192e_ap.h" /*FOR_8192E_IQK*/ - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8192e/halphyrf_8192e_ce.h" /*FOR_8192E_IQK*/ - #endif + #include "rtl8192e/halphyrf_8192e_ce.h" /*FOR_8192E_IQK*/ #include "rtl8192e/phydm_rtl8192e.h" /* FOR_8192E_IQK */ #include "rtl8192e/version_rtl8192e.h" - #if (DM_ODM_SUPPORT_TYPE != ODM_AP) - #include "rtl8192e/halhwimg8192e_bb.h" - #include "rtl8192e/halhwimg8192e_mac.h" - #include "rtl8192e/halhwimg8192e_rf.h" - #include "rtl8192e/phydm_regconfig8192e.h" - #include "rtl8192e/halhwimg8192e_fw.h" - #include "rtl8192e/hal8192ereg.h" - #endif - #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8192e_hal.h" - #endif + #include "rtl8192e/halhwimg8192e_bb.h" + #include "rtl8192e/halhwimg8192e_mac.h" + #include "rtl8192e/halhwimg8192e_rf.h" + #include "rtl8192e/phydm_regconfig8192e.h" + #include "rtl8192e/halhwimg8192e_fw.h" + #include "rtl8192e/hal8192ereg.h" + #include "rtl8192e_hal.h" #endif /* 92E END */ #if (RTL8812A_SUPPORT == 1) - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #include "rtl8812a/halphyrf_8812a_win.h" - #elif (DM_ODM_SUPPORT_TYPE == ODM_AP) - #include "rtl8812a/halphyrf_8812a_ap.h" - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8812a/halphyrf_8812a_ce.h" - #endif + #include "rtl8812a/halphyrf_8812a_ce.h" /* #include "rtl8812a/HalPhyRf_8812A.h" */ /* FOR_8812_IQK */ - #if (DM_ODM_SUPPORT_TYPE != ODM_AP) - #include "rtl8812a/halhwimg8812a_bb.h" - #include "rtl8812a/halhwimg8812a_mac.h" - #include "rtl8812a/halhwimg8812a_rf.h" - #include "rtl8812a/phydm_regconfig8812a.h" - #include "rtl8812a/halhwimg8812a_fw.h" - #include "rtl8812a/phydm_rtl8812a.h" - #endif + #include "rtl8812a/halhwimg8812a_bb.h" + #include "rtl8812a/halhwimg8812a_mac.h" + #include "rtl8812a/halhwimg8812a_rf.h" + #include "rtl8812a/phydm_regconfig8812a.h" + #include "rtl8812a/halhwimg8812a_fw.h" + #include "rtl8812a/phydm_rtl8812a.h" - #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8812a_hal.h" - #endif + #include "rtl8812a_hal.h" #include "rtl8812a/version_rtl8812a.h" #endif /* 8812 END */ @@ -183,35 +117,15 @@ phy_set_tx_power_limit( #include "rtl8814a/halhwimg8814a_bb.h" #include "rtl8814a/version_rtl8814a.h" #include "rtl8814a/phydm_rtl8814a.h" - #if (DM_ODM_SUPPORT_TYPE != ODM_AP) - #include "rtl8814a/halhwimg8814a_fw.h" - #endif - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #include "rtl8814a/halphyrf_8814a_win.h" - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8814a/halphyrf_8814a_ce.h" - #elif (DM_ODM_SUPPORT_TYPE == ODM_AP) - #include "rtl8814a/halphyrf_8814a_ap.h" - #endif + #include "rtl8814a/halhwimg8814a_fw.h" + #include "rtl8814a/halphyrf_8814a_ce.h" #include "rtl8814a/phydm_regconfig8814a.h" - #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8814a_hal.h" - #include "rtl8814a/phydm_iqk_8814a.h" - #endif + #include "rtl8814a_hal.h" + #include "rtl8814a/phydm_iqk_8814a.h" #endif /* 8814 END */ #if (RTL8881A_SUPPORT == 1)/* FOR_8881_IQK */ - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #include "rtl8821a/phydm_iqk_8821a_win.h" - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8821a/phydm_iqk_8821a_ce.h" - #else - #include "rtl8821a/phydm_iqk_8821a_ap.h" - #endif - /* #include "rtl8881a/HalHWImg8881A_BB.h" */ - /* #include "rtl8881a/HalHWImg8881A_MAC.h" */ - /* #include "rtl8881a/HalHWImg8881A_RF.h" */ - /* #include "rtl8881a/odm_RegConfig8881A.h" */ + #include "rtl8821a/phydm_iqk_8821a_ce.h" #endif #if (RTL8723B_SUPPORT == 1) @@ -223,15 +137,9 @@ phy_set_tx_power_limit( #include "rtl8723b/phydm_rtl8723b.h" #include "rtl8723b/hal8723breg.h" #include "rtl8723b/version_rtl8723b.h" - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #include "rtl8723b/halphyrf_8723b_win.h" - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8723b/halphyrf_8723b_ce.h" - #include "rtl8723b/halhwimg8723b_mp.h" - #include "rtl8723b_hal.h" - #else - #include "rtl8723b/halphyrf_8723b_ap.h" - #endif + #include "rtl8723b/halphyrf_8723b_ce.h" + #include "rtl8723b/halhwimg8723b_mp.h" + #include "rtl8723b_hal.h" #endif #if (RTL8821A_SUPPORT == 1) @@ -242,15 +150,10 @@ phy_set_tx_power_limit( #include "rtl8821a/phydm_regconfig8821a.h" #include "rtl8821a/phydm_rtl8821a.h" #include "rtl8821a/version_rtl8821a.h" - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #include "rtl8821a/halphyrf_8821a_win.h" - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8821a/halphyrf_8821a_ce.h" - #include "rtl8821a/phydm_iqk_8821a_ce.h"/*for IQK*/ - #include "rtl8812a/halphyrf_8812a_ce.h"/*for IQK,LCK,Power-tracking*/ - #include "rtl8812a_hal.h" - #else - #endif + #include "rtl8821a/halphyrf_8821a_ce.h" + #include "rtl8821a/phydm_iqk_8821a_ce.h"/*for IQK*/ + #include "rtl8812a/halphyrf_8812a_ce.h"/*for IQK,LCK,Power-tracking*/ + #include "rtl8812a_hal.h" #endif #if (RTL8822B_SUPPORT == 1) @@ -264,12 +167,8 @@ phy_set_tx_power_limit( #include "rtl8822b/phydm_hal_api8822b.h" #include "rtl8822b/version_rtl8822b.h" - #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include /* struct HAL_DATA_TYPE */ - #include /* RX_SMOOTH_FACTOR, reg definition and etc.*/ - #elif (DM_ODM_SUPPORT_TYPE == ODM_AP) - #endif + #include /* struct HAL_DATA_TYPE */ + #include /* RX_SMOOTH_FACTOR, reg definition and etc.*/ #endif @@ -281,9 +180,7 @@ phy_set_tx_power_limit( #include "rtl8703b/halhwimg8703b_fw.h" #include "rtl8703b/halphyrf_8703b.h" #include "rtl8703b/version_rtl8703b.h" - #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8703b_hal.h" - #endif + #include "rtl8703b_hal.h" #endif #if (RTL8188F_SUPPORT == 1) @@ -296,27 +193,20 @@ phy_set_tx_power_limit( #include "rtl8188f/phydm_regconfig8188f.h" #include "rtl8188f/halphyrf_8188f.h" /* for IQK,LCK,Power-tracking */ #include "rtl8188f/version_rtl8188f.h" - #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8188f_hal.h" - #endif + #include "rtl8188f_hal.h" #endif #if (RTL8723D_SUPPORT == 1) - #if (DM_ODM_SUPPORT_TYPE != ODM_AP) - - #include "rtl8723d/halhwimg8723d_bb.h" - #include "rtl8723d/halhwimg8723d_mac.h" - #include "rtl8723d/halhwimg8723d_rf.h" - #include "rtl8723d/phydm_regconfig8723d.h" - #include "rtl8723d/halhwimg8723d_fw.h" - #include "rtl8723d/hal8723dreg.h" - #include "rtl8723d/phydm_rtl8723d.h" - #include "rtl8723d/halphyrf_8723d.h" - #include "rtl8723d/version_rtl8723d.h" - #endif - #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8723d_hal.h" - #endif + #include "rtl8723d/halhwimg8723d_bb.h" + #include "rtl8723d/halhwimg8723d_mac.h" + #include "rtl8723d/halhwimg8723d_rf.h" + #include "rtl8723d/phydm_regconfig8723d.h" + #include "rtl8723d/halhwimg8723d_fw.h" + #include "rtl8723d/hal8723dreg.h" + #include "rtl8723d/phydm_rtl8723d.h" + #include "rtl8723d/halphyrf_8723d.h" + #include "rtl8723d/version_rtl8723d.h" + #include "rtl8723d_hal.h" #endif /* 8723D End */ #if (RTL8197F_SUPPORT == 1) @@ -343,9 +233,7 @@ phy_set_tx_power_limit( #include "rtl8821c/phydm_regconfig8821c.h" #include "rtl8821c/halphyrf_8821c.h" #include "rtl8821c/version_rtl8821c.h" - #if (DM_ODM_SUPPORT_TYPE == ODM_CE) - #include "rtl8821c_hal.h" - #endif + #include "rtl8821c_hal.h" #endif #endif /* __ODM_PRECOMP_H__ */ diff --git a/hal/phydm/phydm_rainfo.c b/hal/phydm/phydm_rainfo.c index 4599f9a..72465c4 100644 --- a/hal/phydm/phydm_rainfo.c +++ b/hal/phydm/phydm_rainfo.c @@ -142,11 +142,7 @@ phydm_ra_print_msg( ODM_RT_TRACE(p_dm_odm, PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" |rate index| |Current-value| |Default-value| |Modify?|\n")); for (i = 0 ; i <= (p_ra_table->rate_length); i++) { -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - ODM_RT_TRACE(p_dm_odm, PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" [ %d ] %20d %25d %20s\n", i, value[i], value_default[i], ((modify_note[i] == 1) ? "V" : " . "))); -#else ODM_RT_TRACE(p_dm_odm, PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, (" [ %d ] %10d %14d %14s\n", i, value[i], value_default[i], ((modify_note[i] == 1) ? "V" : " . "))); -#endif } } @@ -475,9 +471,6 @@ phydm_reset_retry_limit_table( struct _rate_adaptive_table_ *p_ra_table = &p_dm_odm->dm_ra_table; u8 i; -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) /*support all IC platform*/ - -#else #if ((RTL8192E_SUPPORT == 1) || (RTL8723B_SUPPORT == 1) || (RTL8188E_SUPPORT == 1)) u8 per_rate_retrylimit_table_20M[ODM_RATEMCS15 + 1] = { 1, 1, 2, 4, /*CCK*/ @@ -500,7 +493,6 @@ phydm_reset_retry_limit_table( #else -#endif #endif memcpy(&(p_ra_table->per_rate_retrylimit_20M[0]), &(per_rate_retrylimit_table_20M[0]), ODM_NUM_RATE_IDX); @@ -713,12 +705,6 @@ phydm_c2h_ra_report_handler( u8 rate_idx = rate & 0x7f; /*remove bit7 SGI*/ u8 pre_rate = p_ra_table->link_tx_rate[macid]; u8 rate_order; -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - struct _ADAPTER *adapter = p_dm_odm->adapter; - - GET_HAL_DATA(adapter)->CurrentRARate = HwRateToMRate(rate_idx); -#endif - if (cmd_len >= 4) { if (cmd_buf[3] == 0) { @@ -755,7 +741,6 @@ phydm_c2h_ra_report_handler( p_ra_table->link_tx_rate[macid] = rate; /*trigger power training*/ -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) rate_order = phydm_rate_order_compute(p_dm_odm, rate_idx); @@ -766,8 +751,6 @@ phydm_c2h_ra_report_handler( p_ra_table->power_tracking_flag = 0; } -#endif - /*trigger dynamic rate ID*/ #if (defined(CONFIG_RA_DYNAMIC_RATE_ID)) if (p_dm_odm->support_ic_type & (ODM_RTL8812 | ODM_RTL8192E)) @@ -781,23 +764,10 @@ odm_rssi_monitor_init( void *p_dm_void ) { -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct _rate_adaptive_table_ *p_ra_table = &p_dm_odm->dm_ra_table; -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - struct _ADAPTER *adapter = p_dm_odm->adapter; - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(adapter); - - p_ra_table->PT_collision_pre = true; /*used in odm_dynamic_arfb_select(WIN only)*/ - - p_hal_data->UndecoratedSmoothedPWDB = -1; - p_hal_data->ra_rpt_linked = false; -#endif p_ra_table->firstconnect = false; - - -#endif } void @@ -851,272 +821,8 @@ odm_rssi_monitor_check_mp( void *p_dm_void ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; - struct _rate_adaptive_table_ *p_ra_table = &p_dm_odm->dm_ra_table; - u8 h2c_parameter[H2C_0X42_LENGTH] = {0}; - u32 i; - bool is_ext_ra_info = true; - u8 cmdlen = H2C_0X42_LENGTH; - u8 tx_bf_en = 0, stbc_en = 0; - - struct _ADAPTER *adapter = p_dm_odm->adapter; - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(adapter); - struct sta_info *p_entry = NULL; - s32 tmp_entry_max_pwdb = 0, tmp_entry_min_pwdb = 0xff; - PMGNT_INFO p_mgnt_info = &adapter->MgntInfo; - PMGNT_INFO p_default_mgnt_info = &adapter->MgntInfo; - u64 cur_tx_ok_cnt = 0, cur_rx_ok_cnt = 0; -#if (BEAMFORMING_SUPPORT == 1) -#ifndef BEAMFORMING_VERSION_1 - enum beamforming_cap beamform_cap = BEAMFORMING_CAP_NONE; -#endif -#endif - struct _ADAPTER *p_loop_adapter = GetDefaultAdapter(adapter); - - if (p_dm_odm->support_ic_type == ODM_RTL8188E) { - is_ext_ra_info = false; - cmdlen = 3; - } - - while (p_loop_adapter) { - - if (p_loop_adapter != NULL) { - p_mgnt_info = &p_loop_adapter->MgntInfo; - cur_tx_ok_cnt = p_loop_adapter->TxStats.NumTxBytesUnicast - p_mgnt_info->lastTxOkCnt; - cur_rx_ok_cnt = p_loop_adapter->RxStats.NumRxBytesUnicast - p_mgnt_info->lastRxOkCnt; - p_mgnt_info->lastTxOkCnt = cur_tx_ok_cnt; - p_mgnt_info->lastRxOkCnt = cur_rx_ok_cnt; - } - - for (i = 0; i < ASSOCIATE_ENTRY_NUM; i++) { - - if (IsAPModeExist(p_loop_adapter)) { - if (GetFirstExtAdapter(p_loop_adapter) != NULL && - GetFirstExtAdapter(p_loop_adapter) == p_loop_adapter) - p_entry = AsocEntry_EnumStation(p_loop_adapter, i); - else if (GetFirstGOPort(p_loop_adapter) != NULL && - IsFirstGoAdapter(p_loop_adapter)) - p_entry = AsocEntry_EnumStation(p_loop_adapter, i); - } else { - if (GetDefaultAdapter(p_loop_adapter) == p_loop_adapter) - p_entry = AsocEntry_EnumStation(p_loop_adapter, i); - } - - if (p_entry != NULL) { - if (p_entry->bAssociated) { - - RT_DISP_ADDR(FDM, DM_PWDB, ("p_entry->mac_addr ="), p_entry->MacAddr); - RT_DISP(FDM, DM_PWDB, ("p_entry->rssi = 0x%x(%d)\n", - p_entry->rssi_stat.undecorated_smoothed_pwdb, p_entry->rssi_stat.undecorated_smoothed_pwdb)); - - /* 2 BF_en */ -#if (BEAMFORMING_SUPPORT == 1) -#ifndef BEAMFORMING_VERSION_1 - beamform_cap = phydm_beamforming_get_entry_beam_cap_by_mac_id(p_dm_odm, p_entry->AssociatedMacId); - if (beamform_cap & (BEAMFORMER_CAP_HT_EXPLICIT | BEAMFORMER_CAP_VHT_SU)) - tx_bf_en = 1; -#else - if (Beamform_GetSupportBeamformerCap(GetDefaultAdapter(adapter), p_entry)) - tx_bf_en = 1; -#endif -#endif - /* 2 STBC_en */ - if ((IS_WIRELESS_MODE_AC(adapter) && TEST_FLAG(p_entry->VHTInfo.STBC, STBC_VHT_ENABLE_TX)) || - TEST_FLAG(p_entry->HTInfo.STBC, STBC_HT_ENABLE_TX)) - stbc_en = 1; - - if (p_entry->rssi_stat.undecorated_smoothed_pwdb < tmp_entry_min_pwdb) - tmp_entry_min_pwdb = p_entry->rssi_stat.undecorated_smoothed_pwdb; - if (p_entry->rssi_stat.undecorated_smoothed_pwdb > tmp_entry_max_pwdb) - tmp_entry_max_pwdb = p_entry->rssi_stat.undecorated_smoothed_pwdb; - - h2c_parameter[4] = (p_ra_table->RA_threshold_offset & 0x7f) | (p_ra_table->RA_offset_direction << 7); - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RA_threshold_offset = (( %s%d ))\n", ((p_ra_table->RA_threshold_offset == 0) ? " " : ((p_ra_table->RA_offset_direction) ? "+" : "-")), p_ra_table->RA_threshold_offset)); - - if (is_ext_ra_info) { - if (cur_rx_ok_cnt > (cur_tx_ok_cnt * 6)) - h2c_parameter[3] |= RAINFO_BE_RX_STATE; - - if (tx_bf_en) - h2c_parameter[3] |= RAINFO_BF_STATE; - else { - if (stbc_en) - h2c_parameter[3] |= RAINFO_STBC_STATE; - } - - if (p_dm_odm->noisy_decision) - h2c_parameter[3] |= RAINFO_NOISY_STATE; - else - h2c_parameter[3] &= (~RAINFO_NOISY_STATE); -#if 1 - if (p_dm_odm->h2c_rarpt_connect) { - h2c_parameter[3] |= RAINFO_INIT_RSSI_RATE_STATE; - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("h2c_rarpt_connect = (( %d ))\n", p_dm_odm->h2c_rarpt_connect)); - } -#else - - if (p_entry->rssi_stat.ra_rpt_linked == false) { - h2c_parameter[3] |= RAINFO_INIT_RSSI_RATE_STATE; - p_entry->rssi_stat.ra_rpt_linked = true; - - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RSSI_MONITOR, ODM_DBG_LOUD, ("RA First Link, RSSI[%d] = ((%d))\n", - p_entry->associated_mac_id, p_entry->rssi_stat.undecorated_smoothed_pwdb)); - } -#endif - } - - h2c_parameter[2] = (u8)(p_entry->rssi_stat.undecorated_smoothed_pwdb & 0xFF); - /* h2c_parameter[1] = 0x20; */ /* fw v12 cmdid 5:use max macid ,for nic ,default macid is 0 ,max macid is 1 */ - h2c_parameter[0] = (p_entry->AssociatedMacId); - - odm_fill_h2c_cmd(p_dm_odm, ODM_H2C_RSSI_REPORT, cmdlen, h2c_parameter); - } - } else - break; - } - - p_loop_adapter = GetNextExtAdapter(p_loop_adapter); - } - - - /*Default port*/ - if (tmp_entry_max_pwdb != 0) { /* If associated entry is found */ - p_hal_data->EntryMaxUndecoratedSmoothedPWDB = tmp_entry_max_pwdb; - RT_DISP(FDM, DM_PWDB, ("EntryMaxPWDB = 0x%x(%d)\n", tmp_entry_max_pwdb, tmp_entry_max_pwdb)); - } else - p_hal_data->EntryMaxUndecoratedSmoothedPWDB = 0; - - if (tmp_entry_min_pwdb != 0xff) { /* If associated entry is found */ - p_hal_data->EntryMinUndecoratedSmoothedPWDB = tmp_entry_min_pwdb; - RT_DISP(FDM, DM_PWDB, ("EntryMinPWDB = 0x%x(%d)\n", tmp_entry_min_pwdb, tmp_entry_min_pwdb)); - - } else - p_hal_data->EntryMinUndecoratedSmoothedPWDB = 0; - - /* Default porti sent RSSI to FW */ - if (p_hal_data->bUseRAMask) { - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RSSI_MONITOR, ODM_DBG_LOUD, ("1 RA First Link, RSSI[%d] = ((%d)) , ra_rpt_linked = ((%d))\n", - WIN_DEFAULT_PORT_MACID, p_hal_data->UndecoratedSmoothedPWDB, p_hal_data->ra_rpt_linked)); - if (p_hal_data->UndecoratedSmoothedPWDB > 0) { - - PRT_HIGH_THROUGHPUT p_ht_info = GET_HT_INFO(p_default_mgnt_info); - PRT_VERY_HIGH_THROUGHPUT p_vht_info = GET_VHT_INFO(p_default_mgnt_info); - - /* BF_en*/ -#if (BEAMFORMING_SUPPORT == 1) -#ifndef BEAMFORMING_VERSION_1 - beamform_cap = phydm_beamforming_get_entry_beam_cap_by_mac_id(p_dm_odm, p_default_mgnt_info->m_mac_id); - - if (beamform_cap & (BEAMFORMER_CAP_HT_EXPLICIT | BEAMFORMER_CAP_VHT_SU)) - tx_bf_en = 1; -#else - if (Beamform_GetSupportBeamformerCap(GetDefaultAdapter(adapter), NULL)) - tx_bf_en = 1; -#endif -#endif - - /* STBC_en*/ - if ((IS_WIRELESS_MODE_AC(adapter) && TEST_FLAG(p_vht_info->VhtCurStbc, STBC_VHT_ENABLE_TX)) || - TEST_FLAG(p_ht_info->HtCurStbc, STBC_HT_ENABLE_TX)) - stbc_en = 1; - - h2c_parameter[4] = (p_ra_table->RA_threshold_offset & 0x7f) | (p_ra_table->RA_offset_direction << 7); - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RA_threshold_offset = (( %s%d ))\n", ((p_ra_table->RA_threshold_offset == 0) ? " " : ((p_ra_table->RA_offset_direction) ? "+" : "-")), p_ra_table->RA_threshold_offset)); - - if (is_ext_ra_info) { - if (tx_bf_en) - h2c_parameter[3] |= RAINFO_BF_STATE; - else { - if (stbc_en) - h2c_parameter[3] |= RAINFO_STBC_STATE; - } - -#if 1 - if (p_dm_odm->h2c_rarpt_connect) { - h2c_parameter[3] |= RAINFO_INIT_RSSI_RATE_STATE; - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("h2c_rarpt_connect = (( %d ))\n", p_dm_odm->h2c_rarpt_connect)); - } -#else - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RSSI_MONITOR, ODM_DBG_LOUD, ("2 RA First Link, RSSI[%d] = ((%d)) , ra_rpt_linked = ((%d))\n", - WIN_DEFAULT_PORT_MACID, p_hal_data->undecorated_smoothed_pwdb, p_hal_data->ra_rpt_linked)); - - if (p_hal_data->ra_rpt_linked == false) { - - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RSSI_MONITOR, ODM_DBG_LOUD, ("3 RA First Link, RSSI[%d] = ((%d)) , ra_rpt_linked = ((%d))\n", - WIN_DEFAULT_PORT_MACID, p_hal_data->undecorated_smoothed_pwdb, p_hal_data->ra_rpt_linked)); - - h2c_parameter[3] |= RAINFO_INIT_RSSI_RATE_STATE; - p_hal_data->ra_rpt_linked = true; - - - } -#endif - - if (p_dm_odm->noisy_decision == 1) { - h2c_parameter[3] |= RAINFO_NOISY_STATE; - ODM_RT_TRACE(p_dm_odm, ODM_COMP_NOISY_DETECT, ODM_DBG_LOUD, ("[RSSIMonitorCheckMP] Send H2C to FW\n")); - } else - h2c_parameter[3] &= (~RAINFO_NOISY_STATE); - - ODM_RT_TRACE(p_dm_odm, ODM_COMP_NOISY_DETECT, ODM_DBG_LOUD, ("[RSSIMonitorCheckMP] h2c_parameter=%x\n", h2c_parameter[3])); - } - - h2c_parameter[2] = (u8)(p_hal_data->UndecoratedSmoothedPWDB & 0xFF); - /*h2c_parameter[1] = 0x20;*/ /* fw v12 cmdid 5:use max macid ,for nic ,default macid is 0 ,max macid is 1*/ - h2c_parameter[0] = WIN_DEFAULT_PORT_MACID; /* fw v12 cmdid 5:use max macid ,for nic ,default macid is 0 ,max macid is 1*/ - - odm_fill_h2c_cmd(p_dm_odm, ODM_H2C_RSSI_REPORT, cmdlen, h2c_parameter); - } - - /* BT 3.0 HS mode rssi */ - if (p_dm_odm->is_bt_hs_operation) { - h2c_parameter[2] = p_dm_odm->bt_hs_rssi; - /* h2c_parameter[1] = 0x0; */ - h2c_parameter[0] = WIN_BT_PORT_MACID; - - odm_fill_h2c_cmd(p_dm_odm, ODM_H2C_RSSI_REPORT, cmdlen, h2c_parameter); - } - } else - PlatformEFIOWrite1Byte(adapter, 0x4fe, (u8)p_hal_data->UndecoratedSmoothedPWDB); - - if ((p_dm_odm->support_ic_type == ODM_RTL8812) || (p_dm_odm->support_ic_type == ODM_RTL8192E)) - odm_rssi_dump_to_register(p_dm_odm); - - - { - struct _ADAPTER *p_loop_adapter = GetDefaultAdapter(adapter); - bool default_pointer_value, *p_is_link_temp = &default_pointer_value; - s32 global_rssi_min = 0xFF, local_rssi_min; - bool is_link = false; - - while (p_loop_adapter) { - local_rssi_min = phydm_find_minimum_rssi(p_dm_odm, p_loop_adapter, p_is_link_temp); - /* dbg_print("p_hal_data->is_linked=%d, local_rssi_min=%d\n", p_hal_data->is_linked, local_rssi_min); */ - - if (*p_is_link_temp) - is_link = true; - - if ((local_rssi_min < global_rssi_min) && (*p_is_link_temp)) - global_rssi_min = local_rssi_min; - - p_loop_adapter = GetNextExtAdapter(p_loop_adapter); - } - - p_hal_data->bLinked = is_link; - odm_cmn_info_update(&p_hal_data->DM_OutSrc, ODM_CMNINFO_LINK, (u64)is_link); - - if (is_link) - odm_cmn_info_update(&p_hal_data->DM_OutSrc, ODM_CMNINFO_RSSI_MIN, (u64)global_rssi_min); - else - odm_cmn_info_update(&p_hal_data->DM_OutSrc, ODM_CMNINFO_RSSI_MIN, 0); - - } - -#endif /* #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) */ } -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) /*H2C_RSSI_REPORT*/ s8 phydm_rssi_report(struct PHY_DM_STRUCT *p_dm_odm, u8 mac_id) { @@ -1256,14 +962,12 @@ void phydm_ra_rssi_rpt_wk(void *p_context) rtw_run_in_thread_cmd(p_dm_odm->adapter, phydm_ra_rssi_rpt_wk_hdl, p_dm_odm); } -#endif void odm_rssi_monitor_check_ce( void *p_dm_void ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct _ADAPTER *adapter = p_dm_odm->adapter; HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(adapter); @@ -1309,139 +1013,13 @@ odm_rssi_monitor_check_ce( p_dm_odm->rssi_min = p_hal_data->min_undecorated_pwdb_for_dm; /* odm_cmn_info_update(&p_hal_data->odmpriv,ODM_CMNINFO_RSSI_MIN, pdmpriv->min_undecorated_pwdb_for_dm); */ -#endif/* if (DM_ODM_SUPPORT_TYPE == ODM_CE) */ } - void odm_rssi_monitor_check_ap( void *p_dm_void ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) -#if (RTL8812A_SUPPORT || RTL8881A_SUPPORT || RTL8192E_SUPPORT || RTL8814A_SUPPORT || RTL8197F_SUPPORT) - - struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; - struct _rate_adaptive_table_ *p_ra_table = &p_dm_odm->dm_ra_table; - u8 h2c_parameter[H2C_0X42_LENGTH] = {0}; - u32 i; - bool is_ext_ra_info = true; - u8 cmdlen = H2C_0X42_LENGTH; - u8 tx_bf_en = 0, stbc_en = 0; - - struct rtl8192cd_priv *priv = p_dm_odm->priv; - struct sta_info *pstat; - bool act_bfer = false; - -#if (BEAMFORMING_SUPPORT == 1) - u8 idx = 0xff; -#if (defined(CONFIG_PHYDM_ANTENNA_DIVERSITY)) - struct _BF_DIV_COEX_ *p_dm_bdc_table = &p_dm_odm->dm_bdc_table; - p_dm_bdc_table->num_txbfee_client = 0; - p_dm_bdc_table->num_txbfer_client = 0; -#endif -#endif - if (!p_dm_odm->h2c_rarpt_connect && (priv->up_time % 2)) - return; - - if (p_dm_odm->support_ic_type == ODM_RTL8188E) { - is_ext_ra_info = false; - cmdlen = 3; - } - - for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { - pstat = p_dm_odm->p_odm_sta_info[i]; - - if (IS_STA_VALID(pstat)) { - if (pstat->sta_in_firmware != 1) - continue; - - /* 2 BF_en */ -#if (BEAMFORMING_SUPPORT == 1) - BEAMFORMING_CAP beamform_cap = Beamforming_GetEntryBeamCapByMacId(priv, pstat->aid); - PRT_BEAMFORMING_ENTRY p_entry = Beamforming_GetEntryByMacId(priv, pstat->aid, &idx); - - if (beamform_cap & (BEAMFORMER_CAP_HT_EXPLICIT | BEAMFORMER_CAP_VHT_SU)) { - - if (p_entry->Sounding_En) - tx_bf_en = 1; - else - tx_bf_en = 0; - - act_bfer = true; - } - -#if (defined(CONFIG_PHYDM_ANTENNA_DIVERSITY)) /*BDC*/ - if (act_bfer == true) { - p_dm_bdc_table->w_bfee_client[i] = 1; /* AP act as BFer */ - p_dm_bdc_table->num_txbfee_client++; - } else { - p_dm_bdc_table->w_bfee_client[i] = 0; /* AP act as BFer */ - } - - if ((beamform_cap & BEAMFORMEE_CAP_HT_EXPLICIT) || (beamform_cap & BEAMFORMEE_CAP_VHT_SU)) { - p_dm_bdc_table->w_bfer_client[i] = 1; /* AP act as BFee */ - p_dm_bdc_table->num_txbfer_client++; - } else { - p_dm_bdc_table->w_bfer_client[i] = 0; /* AP act as BFer */ - } -#endif -#endif - - /* 2 STBC_en */ - if ((priv->pmib->dot11nConfigEntry.dot11nSTBC) && - ((pstat->ht_cap_buf.ht_cap_info & cpu_to_le16(_HTCAP_RX_STBC_CAP_)) -#ifdef RTK_AC_SUPPORT - || (pstat->vht_cap_buf.vht_cap_info & cpu_to_le32(_VHTCAP_RX_STBC_CAP_)) -#endif - )) - stbc_en = 1; - - /* 2 RAINFO */ - - h2c_parameter[4] = (p_ra_table->RA_threshold_offset & 0x7f) | (p_ra_table->RA_offset_direction << 7); - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RA_threshold_offset = (( %s%d ))\n", ((p_ra_table->RA_threshold_offset == 0) ? " " : ((p_ra_table->RA_offset_direction) ? "+" : "-")), p_ra_table->RA_threshold_offset)); - - if (is_ext_ra_info) { - if ((pstat->rx_avarage) > ((pstat->tx_avarage) * 6)) - h2c_parameter[3] |= RAINFO_BE_RX_STATE; - - if (tx_bf_en) - h2c_parameter[3] |= RAINFO_BF_STATE; - else { - if (stbc_en) - h2c_parameter[3] |= RAINFO_STBC_STATE; - } - - if (p_dm_odm->noisy_decision) - h2c_parameter[3] |= RAINFO_NOISY_STATE; - else - h2c_parameter[3] &= (~RAINFO_NOISY_STATE); - - if (pstat->H2C_rssi_rpt) { - h2c_parameter[3] |= RAINFO_INIT_RSSI_RATE_STATE; - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("[RA Init] set Init rate by RSSI, STA %d\n", pstat->aid)); - } - - /*ODM_RT_TRACE(p_dm_odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[RAINFO] H2C_Para[3] = %x\n",h2c_parameter[3]));*/ - } - - h2c_parameter[2] = (u8)(pstat->rssi & 0xFF); - h2c_parameter[0] = REMAP_AID(pstat); - - ODM_RT_TRACE(p_dm_odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("h2c_parameter[3]=%d\n", h2c_parameter[3])); - - /* ODM_RT_TRACE(p_dm_odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[RSSI] H2C_Para[2] = %x,\n",h2c_parameter[2])); */ - /* ODM_RT_TRACE(p_dm_odm,PHYDM_COMP_RA_DBG, ODM_DBG_LOUD, ("[MACID] H2C_Para[0] = %x,\n",h2c_parameter[0])); */ - - odm_fill_h2c_cmd(p_dm_odm, ODM_H2C_RSSI_REPORT, cmdlen, h2c_parameter); - - } - } - -#endif -#endif - } void @@ -1481,51 +1059,19 @@ odm_rate_adaptive_mask_init( struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct _ODM_RATE_ADAPTIVE *p_odm_ra = &p_dm_odm->rate_adaptive; -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - PMGNT_INFO p_mgnt_info = &p_dm_odm->adapter->MgntInfo; - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(p_dm_odm->adapter); - - p_mgnt_info->Ratr_State = DM_RATR_STA_INIT; - - if (p_mgnt_info->DM_Type == dm_type_by_driver) - p_hal_data->bUseRAMask = true; - else - p_hal_data->bUseRAMask = false; - -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) p_odm_ra->type = dm_type_by_driver; if (p_odm_ra->type == dm_type_by_driver) p_dm_odm->is_use_ra_mask = _TRUE; else p_dm_odm->is_use_ra_mask = _FALSE; -#endif p_odm_ra->ratr_state = DM_RATR_STA_INIT; -#if (DM_ODM_SUPPORT_TYPE & ODM_WIN) - if (p_dm_odm->support_ic_type == ODM_RTL8812) - p_odm_ra->ldpc_thres = 50; - else - p_odm_ra->ldpc_thres = 35; - - p_odm_ra->rts_thres = 35; - -#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) p_odm_ra->ldpc_thres = 35; p_odm_ra->is_use_ldpc = false; -#else - p_odm_ra->ultra_low_rssi_thresh = 9; - -#endif - p_odm_ra->high_rssi_thresh = 50; -#if (DM_ODM_SUPPORT_TYPE == ODM_AP) && \ - ((DEV_BUS_TYPE == RT_USB_INTERFACE) || (DEV_BUS_TYPE == RT_SDIO_INTERFACE)) - p_odm_ra->low_rssi_thresh = 23; -#else p_odm_ra->low_rssi_thresh = 20; -#endif } /*----------------------------------------------------------------------------- * Function: odm_refresh_rate_adaptive_mask() @@ -1587,7 +1133,6 @@ phydm_trans_platform_bw( u8 BW ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) if (BW == CHANNEL_WIDTH_20) BW = PHYDM_BW_20; @@ -1603,46 +1148,7 @@ phydm_trans_platform_bw( else if (BW == CHANNEL_WIDTH_80_80) BW = PHYDM_BW_80_80; -#elif (DM_ODM_SUPPORT_TYPE == ODM_AP) - - if (BW == HT_CHANNEL_WIDTH_20) - BW = PHYDM_BW_20; - - else if (BW == HT_CHANNEL_WIDTH_20_40) - BW = PHYDM_BW_40; - - else if (BW == HT_CHANNEL_WIDTH_80) - BW = PHYDM_BW_80; - - else if (BW == HT_CHANNEL_WIDTH_160) - BW = PHYDM_BW_160; - - else if (BW == HT_CHANNEL_WIDTH_10) - BW = PHYDM_BW_10; - - else if (BW == HT_CHANNEL_WIDTH_5) - BW = PHYDM_BW_5; - -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - - if (BW == CHANNEL_WIDTH_20) - BW = PHYDM_BW_20; - - else if (BW == CHANNEL_WIDTH_40) - BW = PHYDM_BW_40; - - else if (BW == CHANNEL_WIDTH_80) - BW = PHYDM_BW_80; - - else if (BW == CHANNEL_WIDTH_160) - BW = PHYDM_BW_160; - - else if (BW == CHANNEL_WIDTH_80_80) - BW = PHYDM_BW_80_80; -#endif - return BW; - } u8 @@ -1651,7 +1157,6 @@ phydm_trans_platform_rf_type( u8 rf_type ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) if (rf_type == RF_1T2R) rf_type = PHYDM_RF_1T2R; @@ -1679,65 +1184,7 @@ phydm_trans_platform_rf_type( else if (rf_type == RF_3T4R) rf_type = PHYDM_RF_3T4R; -#elif (DM_ODM_SUPPORT_TYPE == ODM_AP) - - if (rf_type == MIMO_1T2R) - rf_type = PHYDM_RF_1T2R; - - else if (rf_type == MIMO_2T4R) - rf_type = PHYDM_RF_2T4R; - - else if (rf_type == MIMO_2T2R) - rf_type = PHYDM_RF_2T2R; - - else if (rf_type == MIMO_1T1R) - rf_type = PHYDM_RF_1T1R; - - else if (rf_type == MIMO_3T3R) - rf_type = PHYDM_RF_3T3R; - - else if (rf_type == MIMO_4T4R) - rf_type = PHYDM_RF_4T4R; - - else if (rf_type == MIMO_2T3R) - rf_type = PHYDM_RF_1T2R; - - else if (rf_type == MIMO_3T4R) - rf_type = PHYDM_RF_3T4R; - -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - - if (rf_type == RF_1T2R) - rf_type = PHYDM_RF_1T2R; - - else if (rf_type == RF_2T4R) - rf_type = PHYDM_RF_2T4R; - - else if (rf_type == RF_2T2R) - rf_type = PHYDM_RF_2T2R; - - else if (rf_type == RF_1T1R) - rf_type = PHYDM_RF_1T1R; - - else if (rf_type == RF_2T2R_GREEN) - rf_type = PHYDM_RF_2T2R_GREEN; - - else if (rf_type == RF_3T3R) - rf_type = PHYDM_RF_3T3R; - - else if (rf_type == RF_4T4R) - rf_type = PHYDM_RF_4T4R; - - else if (rf_type == RF_2T3R) - rf_type = PHYDM_RF_1T2R; - - else if (rf_type == RF_3T4R) - rf_type = PHYDM_RF_3T4R; - -#endif - return rf_type; - } u32 @@ -1746,12 +1193,6 @@ phydm_trans_platform_wireless_mode( u32 wireless_mode ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -#elif (DM_ODM_SUPPORT_TYPE == ODM_AP) - -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) - if (wireless_mode == WIRELESS_11A) wireless_mode = PHYDM_WIRELESS_MODE_A; @@ -1764,8 +1205,13 @@ phydm_trans_platform_wireless_mode( else if (wireless_mode == WIRELESS_AUTO) wireless_mode = PHYDM_WIRELESS_MODE_AUTO; - else if ((wireless_mode == WIRELESS_11_24N) || (wireless_mode == WIRELESS_11G_24N) || (wireless_mode == WIRELESS_11B_24N) || - (wireless_mode == WIRELESS_11BG_24N) || (wireless_mode == WIRELESS_MODE_24G) || (wireless_mode == WIRELESS_11ABGN) || (wireless_mode == WIRELESS_11AGN)) + else if ((wireless_mode == WIRELESS_11_24N) || + (wireless_mode == WIRELESS_11G_24N) || + (wireless_mode == WIRELESS_11B_24N) || + (wireless_mode == WIRELESS_11BG_24N) || + (wireless_mode == WIRELESS_MODE_24G) || + (wireless_mode == WIRELESS_11ABGN) || + (wireless_mode == WIRELESS_11AGN)) wireless_mode = PHYDM_WIRELESS_MODE_N_24G; else if ((wireless_mode == WIRELESS_11_5N) || (wireless_mode == WIRELESS_11A_5N)) @@ -1784,10 +1230,8 @@ phydm_trans_platform_wireless_mode( wireless_mode = PHYDM_WIRELESS_MODE_MAX; else wireless_mode = PHYDM_WIRELESS_MODE_UNKNOWN; -#endif return wireless_mode; - } u8 @@ -1826,9 +1270,7 @@ phydm_rate_id_mapping( phydm_BW = phydm_trans_platform_bw(p_dm_odm, bw); phydm_rf_type = phydm_trans_platform_rf_type(p_dm_odm, rf_type); -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) wireless_mode = phydm_trans_platform_wireless_mode(p_dm_odm, wireless_mode); -#endif ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("wireless_mode= (( 0x%x )), rf_type = (( 0x%x )), BW = (( 0x%x ))\n", wireless_mode, phydm_rf_type, phydm_BW)); @@ -1947,11 +1389,8 @@ phydm_update_hal_ra_mask( u8 phydm_rf_type; u8 phydm_BW; u32 ratr_bitmap = *ratr_bitmap_lsb_in, ratr_bitmap_msb = *ratr_bitmap_msb_in; - /*struct _ODM_RATE_ADAPTIVE* p_ra = &(p_dm_odm->rate_adaptive);*/ -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) wireless_mode = phydm_trans_platform_wireless_mode(p_dm_odm, wireless_mode); -#endif phydm_rf_type = phydm_trans_platform_rf_type(p_dm_odm, rf_type); phydm_BW = phydm_trans_platform_bw(p_dm_odm, BW); @@ -2122,131 +1561,13 @@ odm_refresh_rate_adaptive_mask_mp( void *p_dm_void ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; - struct _rate_adaptive_table_ *p_ra_table = &p_dm_odm->dm_ra_table; - struct _ADAPTER *p_adapter = p_dm_odm->adapter; - struct _ADAPTER *p_target_adapter = NULL; - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(p_adapter); - PMGNT_INFO p_mgnt_info = GetDefaultMgntInfo(p_adapter); - u32 i; - struct sta_info *p_entry; - u8 ratr_state_new; - - if (p_adapter->bDriverStopped) { - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("<---- odm_refresh_rate_adaptive_mask(): driver is going to unload\n")); - return; - } - - if (!p_hal_data->bUseRAMask) { - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("<---- odm_refresh_rate_adaptive_mask(): driver does not control rate adaptive mask\n")); - return; - } - - /* if default port is connected, update RA table for default port (infrastructure mode only) */ - if (p_mgnt_info->mAssoc && (!ACTING_AS_AP(p_adapter))) { - odm_refresh_ldpc_rts_mp(p_adapter, p_dm_odm, p_mgnt_info->mMacId, p_mgnt_info->IOTPeer, p_hal_data->UndecoratedSmoothedPWDB); - /*ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Infrasture mode\n"));*/ - -#if RA_MASK_PHYDMLIZE_WIN - ratr_state_new = phydm_RA_level_decision(p_dm_odm, p_hal_data->UndecoratedSmoothedPWDB, p_mgnt_info->Ratr_State); - - if ((p_mgnt_info->Ratr_State != ratr_state_new) || (p_ra_table->force_update_ra_mask_count >= FORCED_UPDATE_RAMASK_PERIOD)) { - - p_ra_table->force_update_ra_mask_count = 0; - ODM_PRINT_ADDR(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target AP addr :"), p_mgnt_info->Bssid); - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Update RA Level: ((%x)) -> ((%x)), RSSI = ((%d))\n\n", - p_mgnt_info->Ratr_State, ratr_state_new, p_hal_data->UndecoratedSmoothedPWDB)); - - p_mgnt_info->Ratr_State = ratr_state_new; - p_adapter->HalFunc.UpdateHalRAMaskHandler(p_adapter, p_mgnt_info->mMacId, NULL, ratr_state_new); - } else { - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Stay in RA level = (( %d ))\n\n", ratr_state_new)); - /**/ - } - -#else - if (odm_ra_state_check(p_dm_odm, p_hal_data->UndecoratedSmoothedPWDB, p_mgnt_info->bSetTXPowerTrainingByOid, &p_mgnt_info->Ratr_State)) { - ODM_PRINT_ADDR(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target AP addr : "), p_mgnt_info->Bssid); - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", p_hal_data->UndecoratedSmoothedPWDB, p_mgnt_info->Ratr_State)); - p_adapter->HalFunc.UpdateHalRAMaskHandler(p_adapter, p_mgnt_info->mMacId, NULL, p_mgnt_info->Ratr_State); - } else if (p_dm_odm->is_change_state) { - ODM_PRINT_ADDR(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target AP addr : "), p_mgnt_info->Bssid); - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Change Power Training state, is_disable_power_training = %d\n", p_dm_odm->is_disable_power_training)); - p_adapter->HalFunc.UpdateHalRAMaskHandler(p_adapter, p_mgnt_info->mMacId, NULL, p_mgnt_info->Ratr_State); - } -#endif - } - - /* */ - /* The following part configure AP/VWifi/IBSS rate adaptive mask. */ - /* */ - - if (p_mgnt_info->mIbss) /* Target: AP/IBSS peer. */ - p_target_adapter = GetDefaultAdapter(p_adapter); - else - p_target_adapter = GetFirstAPAdapter(p_adapter); - - /* if extension port (softap) is started, updaet RA table for more than one clients associate */ - if (p_target_adapter != NULL) { - for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { - - p_entry = AsocEntry_EnumStation(p_target_adapter, i); - - if (IS_STA_VALID(p_entry)) { - - odm_refresh_ldpc_rts_mp(p_adapter, p_dm_odm, p_entry->AssociatedMacId, p_entry->IOTPeer, p_entry->rssi_stat.undecorated_smoothed_pwdb); - -#if RA_MASK_PHYDMLIZE_WIN - ratr_state_new = phydm_RA_level_decision(p_dm_odm, p_entry->rssi_stat.undecorated_smoothed_pwdb, p_entry->Ratr_State); - - if ((p_entry->Ratr_State != ratr_state_new) || (p_ra_table->force_update_ra_mask_count >= FORCED_UPDATE_RAMASK_PERIOD)) { - - p_ra_table->force_update_ra_mask_count = 0; - ODM_PRINT_ADDR(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target AP addr :"), p_entry->MacAddr); - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Update Tx RA Level: ((%x)) -> ((%x)), RSSI = ((%d))\n", - p_entry->Ratr_State, ratr_state_new, p_entry->rssi_stat.undecorated_smoothed_pwdb)); - - p_entry->Ratr_State = ratr_state_new; - p_adapter->HalFunc.UpdateHalRAMaskHandler(p_adapter, p_entry->AssociatedMacId, NULL, ratr_state_new); - } else { - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Stay in RA level = (( %d ))\n\n", ratr_state_new)); - /**/ - } - - -#else - - if (odm_ra_state_check(p_dm_odm, p_entry->rssi_stat.undecorated_smoothed_pwdb, p_mgnt_info->bSetTXPowerTrainingByOid, &p_entry->Ratr_State)) { - ODM_PRINT_ADDR(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target STA addr : "), p_entry->mac_addr); - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", p_entry->rssi_stat.undecorated_smoothed_pwdb, p_entry->Ratr_State)); - p_adapter->hal_func.update_hal_ra_mask_handler(p_target_adapter, p_entry->AssociatedMacId, p_entry, p_entry->Ratr_State); - } else if (p_dm_odm->is_change_state) { - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Change Power Training state, is_disable_power_training = %d\n", p_dm_odm->is_disable_power_training)); - p_adapter->HalFunc.UpdateHalRAMaskHandler(p_adapter, p_mgnt_info->mMacId, NULL, p_mgnt_info->Ratr_State); - } -#endif - - } - } - } - -#if RA_MASK_PHYDMLIZE_WIN - -#else - if (p_mgnt_info->bSetTXPowerTrainingByOid) - p_mgnt_info->bSetTXPowerTrainingByOid = false; -#endif -#endif /* #if (DM_ODM_SUPPORT_TYPE == ODM_WIN) */ } - void odm_refresh_rate_adaptive_mask_ce( void *p_dm_void ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_CE) struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; struct _rate_adaptive_table_ *p_ra_table = &p_dm_odm->dm_ra_table; struct _ADAPTER *p_adapter = p_dm_odm->adapter; @@ -2321,128 +1642,13 @@ odm_refresh_rate_adaptive_mask_ce( } } - -#endif } -#if (DM_ODM_SUPPORT_TYPE & ODM_AP) -void -phydm_gen_ramask_h2c_AP( - void *p_dm_void, - struct rtl8192cd_priv *priv, - struct sta_info *p_entry, - u8 rssi_level -) -{ - struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; - - if (p_dm_odm->support_ic_type == ODM_RTL8812) { - -#if (RTL8812A_SUPPORT == 1) - UpdateHalRAMask8812(priv, p_entry, rssi_level); - /**/ -#endif - } else if (p_dm_odm->support_ic_type == ODM_RTL8188E) { - -#if (RTL8188E_SUPPORT == 1) -#ifdef TXREPORT - add_RATid(priv, p_entry); - /**/ -#endif -#endif - } else { - -#ifdef CONFIG_WLAN_HAL - GET_HAL_INTERFACE(priv)->UpdateHalRAMaskHandler(priv, p_entry, rssi_level); -#endif - - } -} - -#endif - void odm_refresh_rate_adaptive_mask_apadsl( void *p_dm_void ) { -#if (DM_ODM_SUPPORT_TYPE & ODM_AP) - struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; - struct _rate_adaptive_table_ *p_ra_table = &p_dm_odm->dm_ra_table; - struct rtl8192cd_priv *priv = p_dm_odm->priv; - struct aid_obj *aidarray; - u32 i; - struct sta_info *p_entry; - u8 ratr_state_new; - - if (priv->up_time % 2) - return; - - for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { - p_entry = p_dm_odm->p_odm_sta_info[i]; - - if (IS_STA_VALID(p_entry)) { - -#if defined(UNIVERSAL_REPEATER) || defined(MBSSID) - aidarray = container_of(p_entry, struct aid_obj, station); - priv = aidarray->priv; -#endif - - if (!priv->pmib->dot11StationConfigEntry.autoRate) - continue; - -#if RA_MASK_PHYDMLIZE_AP - ratr_state_new = phydm_RA_level_decision(p_dm_odm, (u32)p_entry->rssi, p_entry->rssi_level); - - if ((p_entry->rssi_level != ratr_state_new) || (p_ra_table->force_update_ra_mask_count >= FORCED_UPDATE_RAMASK_PERIOD)) { - - p_ra_table->force_update_ra_mask_count = 0; - ODM_PRINT_ADDR(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target AP addr :"), p_entry->hwaddr); - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Update Tx RA Level: ((%x)) -> ((%x)), RSSI = ((%d))\n", p_entry->rssi_level, ratr_state_new, p_entry->rssi)); - - p_entry->rssi_level = ratr_state_new; - phydm_gen_ramask_h2c_AP(p_dm_odm, priv, p_entry, p_entry->rssi_level); - } else { - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Stay in RA level = (( %d ))\n\n", ratr_state_new)); - /**/ - } - -#else - if (odm_ra_state_check(p_dm_odm, (s32)p_entry->rssi, false, &p_entry->rssi_level)) { - ODM_PRINT_ADDR(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("Target STA addr : "), p_entry->hwaddr); - ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", p_entry->rssi, p_entry->rssi_level)); - -#ifdef CONFIG_WLAN_HAL - if (IS_HAL_CHIP(priv)) { -#ifdef WDS - /*if(!(pstat->state & WIFI_WDS))*/ /*if WDS donot setting*/ -#endif - GET_HAL_INTERFACE(priv)->update_hal_ra_mask_handler(priv, p_entry, p_entry->rssi_level); - } else -#endif - -#ifdef CONFIG_RTL_8812_SUPPORT - if (GET_CHIP_VER(priv) == VERSION_8812E) - update_hal_ra_mask8812(priv, p_entry, 3); - else -#endif - { -#ifdef CONFIG_RTL_88E_SUPPORT - if (GET_CHIP_VER(priv) == VERSION_8188E) { -#ifdef TXREPORT - add_ra_tid(priv, p_entry); -#endif - } -#endif - - - } - } -#endif /*#ifdef RA_MASK_PHYDMLIZE*/ - - } - } -#endif /*#if (DM_ODM_SUPPORT_TYPE & ODM_AP)*/ } void @@ -2450,38 +1656,6 @@ odm_refresh_basic_rate_mask( void *p_dm_void ) { -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; - struct _ADAPTER *adapter = p_dm_odm->adapter; - static u8 stage = 0; - u8 cur_stage = 0; - OCTET_STRING os_rate_set; - PMGNT_INFO p_mgnt_info = GetDefaultMgntInfo(adapter); - u8 rate_set[5] = {MGN_1M, MGN_2M, MGN_5_5M, MGN_11M, MGN_6M}; - - if (p_dm_odm->support_ic_type != ODM_RTL8812 && p_dm_odm->support_ic_type != ODM_RTL8821) - return; - - if (p_dm_odm->is_linked == false) /* unlink Default port information */ - cur_stage = 0; - else if (p_dm_odm->rssi_min < 40) /* link RSSI < 40% */ - cur_stage = 1; - else if (p_dm_odm->rssi_min > 45) /* link RSSI > 45% */ - cur_stage = 3; - else - cur_stage = 2; /* link 25% <= RSSI <= 30% */ - - if (cur_stage != stage) { - if (cur_stage == 1) { - FillOctetString(os_rate_set, rate_set, 5); - FilterSupportRate(p_mgnt_info->mBrates, &os_rate_set, false); - phydm_set_hw_reg_handler_interface(p_dm_odm, HW_VAR_BASIC_RATE, (u8 *)&os_rate_set); - } else if (cur_stage == 3 && (stage == 1 || stage == 2)) - phydm_set_hw_reg_handler_interface(p_dm_odm, HW_VAR_BASIC_RATE, (u8 *)(&p_mgnt_info->mBrates)); - } - - stage = cur_stage; -#endif } u8 @@ -2601,8 +1775,6 @@ phydm_ra_info_init( } - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN | ODM_CE)) u8 odm_find_rts_rate( void *p_dm_void, @@ -2744,315 +1916,8 @@ phydm_update_pwr_track( ODM_RT_TRACE(p_dm_odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("Pwr Track Get rate=0x%x\n", rate)); p_dm_odm->tx_rate = rate; - -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) -#if DEV_BUS_TYPE == RT_PCI_INTERFACE -#if USE_WORKITEM - odm_schedule_work_item(&p_dm_odm->ra_rpt_workitem); -#else - if (p_dm_odm->support_ic_type == ODM_RTL8821) { -#if (RTL8821A_SUPPORT == 1) - odm_tx_pwr_track_set_pwr8821a(p_dm_odm, MIX_MODE, ODM_RF_PATH_A, 0); -#endif - } else if (p_dm_odm->support_ic_type == ODM_RTL8812) { - for (path_idx = ODM_RF_PATH_A; path_idx < MAX_PATH_NUM_8812A; path_idx++) { -#if (RTL8812A_SUPPORT == 1) - odm_tx_pwr_track_set_pwr8812a(p_dm_odm, MIX_MODE, path_idx, 0); -#endif - } - } else if (p_dm_odm->support_ic_type == ODM_RTL8723B) { -#if (RTL8723B_SUPPORT == 1) - odm_tx_pwr_track_set_pwr_8723b(p_dm_odm, MIX_MODE, ODM_RF_PATH_A, 0); -#endif - } else if (p_dm_odm->support_ic_type == ODM_RTL8192E) { - for (path_idx = ODM_RF_PATH_A; path_idx < MAX_PATH_NUM_8192E; path_idx++) { -#if (RTL8192E_SUPPORT == 1) - odm_tx_pwr_track_set_pwr92_e(p_dm_odm, MIX_MODE, path_idx, 0); -#endif - } - } else if (p_dm_odm->support_ic_type == ODM_RTL8188E) { -#if (RTL8188E_SUPPORT == 1) - odm_tx_pwr_track_set_pwr88_e(p_dm_odm, MIX_MODE, ODM_RF_PATH_A, 0); -#endif - } -#endif -#else - odm_schedule_work_item(&p_dm_odm->ra_rpt_workitem); -#endif -#endif - } -#if (DM_ODM_SUPPORT_TYPE == ODM_WIN) - -s32 -phydm_find_minimum_rssi( - struct PHY_DM_STRUCT *p_dm_odm, - struct _ADAPTER *p_adapter, - OUT bool *p_is_link_temp - -) -{ - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(p_adapter); - PMGNT_INFO p_mgnt_info = &(p_adapter->MgntInfo); - bool act_as_ap = ACTING_AS_AP(p_adapter); - - /* 1.Determine the minimum RSSI */ - if ((!p_mgnt_info->bMediaConnect) || - (act_as_ap && (p_hal_data->EntryMinUndecoratedSmoothedPWDB == 0))) {/* We should check AP mode and Entry info.into consideration, revised by Roger, 2013.10.18*/ - - p_hal_data->MinUndecoratedPWDBForDM = 0; - *p_is_link_temp = false; - - } else - *p_is_link_temp = true; - - - if (p_mgnt_info->bMediaConnect) { /* Default port*/ - - if (act_as_ap || p_mgnt_info->mIbss) { - p_hal_data->MinUndecoratedPWDBForDM = p_hal_data->EntryMinUndecoratedSmoothedPWDB; - /**/ - } else { - p_hal_data->MinUndecoratedPWDBForDM = p_hal_data->UndecoratedSmoothedPWDB; - /**/ - } - } else { /* associated entry pwdb*/ - p_hal_data->MinUndecoratedPWDBForDM = p_hal_data->EntryMinUndecoratedSmoothedPWDB; - /**/ - } - - return p_hal_data->MinUndecoratedPWDBForDM; -} - -void -odm_update_init_rate_work_item_callback( - void *p_context -) -{ - struct _ADAPTER *adapter = (struct _ADAPTER *)p_context; - HAL_DATA_TYPE *p_hal_data = GET_HAL_DATA(adapter); - struct PHY_DM_STRUCT *p_dm_odm = &p_hal_data->DM_OutSrc; - u8 p = 0; - - if (p_dm_odm->support_ic_type == ODM_RTL8821) { - odm_tx_pwr_track_set_pwr8821a(p_dm_odm, MIX_MODE, ODM_RF_PATH_A, 0); - /**/ - } else if (p_dm_odm->support_ic_type == ODM_RTL8812) { - for (p = ODM_RF_PATH_A; p < MAX_PATH_NUM_8812A; p++) { /*DOn't know how to include &c*/ - - odm_tx_pwr_track_set_pwr8812a(p_dm_odm, MIX_MODE, p, 0); - /**/ - } - } else if (p_dm_odm->support_ic_type == ODM_RTL8723B) { - odm_tx_pwr_track_set_pwr_8723b(p_dm_odm, MIX_MODE, ODM_RF_PATH_A, 0); - /**/ - } else if (p_dm_odm->support_ic_type == ODM_RTL8192E) { - for (p = ODM_RF_PATH_A; p < MAX_PATH_NUM_8192E; p++) { /*DOn't know how to include &c*/ - odm_tx_pwr_track_set_pwr92_e(p_dm_odm, MIX_MODE, p, 0); - /**/ - } - } else if (p_dm_odm->support_ic_type == ODM_RTL8188E) { - odm_tx_pwr_track_set_pwr88_e(p_dm_odm, MIX_MODE, ODM_RF_PATH_A, 0); - /**/ - } -} - -void -odm_rssi_dump_to_register( - void *p_dm_void -) -{ - struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; - struct _ADAPTER *adapter = p_dm_odm->adapter; - - if (p_dm_odm->support_ic_type == ODM_RTL8812) { - PlatformEFIOWrite1Byte(adapter, REG_A_RSSI_DUMP_JAGUAR, adapter->RxStats.RxRSSIPercentage[0]); - PlatformEFIOWrite1Byte(adapter, REG_B_RSSI_DUMP_JAGUAR, adapter->RxStats.RxRSSIPercentage[1]); - - /* Rx EVM*/ - PlatformEFIOWrite1Byte(adapter, REG_S1_RXEVM_DUMP_JAGUAR, adapter->RxStats.RxEVMdbm[0]); - PlatformEFIOWrite1Byte(adapter, REG_S2_RXEVM_DUMP_JAGUAR, adapter->RxStats.RxEVMdbm[1]); - - /* Rx SNR*/ - PlatformEFIOWrite1Byte(adapter, REG_A_RX_SNR_DUMP_JAGUAR, (u8)(adapter->RxStats.RxSNRdB[0])); - PlatformEFIOWrite1Byte(adapter, REG_B_RX_SNR_DUMP_JAGUAR, (u8)(adapter->RxStats.RxSNRdB[1])); - - /* Rx Cfo_Short*/ - PlatformEFIOWrite2Byte(adapter, REG_A_CFO_SHORT_DUMP_JAGUAR, adapter->RxStats.RxCfoShort[0]); - PlatformEFIOWrite2Byte(adapter, REG_B_CFO_SHORT_DUMP_JAGUAR, adapter->RxStats.RxCfoShort[1]); - - /* Rx Cfo_Tail*/ - PlatformEFIOWrite2Byte(adapter, REG_A_CFO_LONG_DUMP_JAGUAR, adapter->RxStats.RxCfoTail[0]); - PlatformEFIOWrite2Byte(adapter, REG_B_CFO_LONG_DUMP_JAGUAR, adapter->RxStats.RxCfoTail[1]); - } else if (p_dm_odm->support_ic_type == ODM_RTL8192E) { - PlatformEFIOWrite1Byte(adapter, REG_A_RSSI_DUMP_92E, adapter->RxStats.RxRSSIPercentage[0]); - PlatformEFIOWrite1Byte(adapter, REG_B_RSSI_DUMP_92E, adapter->RxStats.RxRSSIPercentage[1]); - /* Rx EVM*/ - PlatformEFIOWrite1Byte(adapter, REG_S1_RXEVM_DUMP_92E, adapter->RxStats.RxEVMdbm[0]); - PlatformEFIOWrite1Byte(adapter, REG_S2_RXEVM_DUMP_92E, adapter->RxStats.RxEVMdbm[1]); - /* Rx SNR*/ - PlatformEFIOWrite1Byte(adapter, REG_A_RX_SNR_DUMP_92E, (u8)(adapter->RxStats.RxSNRdB[0])); - PlatformEFIOWrite1Byte(adapter, REG_B_RX_SNR_DUMP_92E, (u8)(adapter->RxStats.RxSNRdB[1])); - /* Rx Cfo_Short*/ - PlatformEFIOWrite2Byte(adapter, REG_A_CFO_SHORT_DUMP_92E, adapter->RxStats.RxCfoShort[0]); - PlatformEFIOWrite2Byte(adapter, REG_B_CFO_SHORT_DUMP_92E, adapter->RxStats.RxCfoShort[1]); - /* Rx Cfo_Tail*/ - PlatformEFIOWrite2Byte(adapter, REG_A_CFO_LONG_DUMP_92E, adapter->RxStats.RxCfoTail[0]); - PlatformEFIOWrite2Byte(adapter, REG_B_CFO_LONG_DUMP_92E, adapter->RxStats.RxCfoTail[1]); - } -} - -void -odm_refresh_ldpc_rts_mp( - struct _ADAPTER *p_adapter, - struct PHY_DM_STRUCT *p_dm_odm, - u8 m_mac_id, - u8 iot_peer, - s32 undecorated_smoothed_pwdb -) -{ - bool is_ctl_ldpc = false; - struct _ODM_RATE_ADAPTIVE *p_ra = &p_dm_odm->rate_adaptive; - - if (p_dm_odm->support_ic_type != ODM_RTL8821 && p_dm_odm->support_ic_type != ODM_RTL8812) - return; - - if ((p_dm_odm->support_ic_type == ODM_RTL8821) && (p_dm_odm->cut_version == ODM_CUT_A)) - is_ctl_ldpc = true; - else if (p_dm_odm->support_ic_type == ODM_RTL8812 && - iot_peer == HT_IOT_PEER_REALTEK_JAGUAR_CCUTAP) - is_ctl_ldpc = true; - - if (is_ctl_ldpc) { - if (undecorated_smoothed_pwdb < (p_ra->ldpc_thres - 5)) - MgntSet_TX_LDPC(p_adapter, m_mac_id, true); - else if (undecorated_smoothed_pwdb > p_ra->ldpc_thres) - MgntSet_TX_LDPC(p_adapter, m_mac_id, false); - } - - if (undecorated_smoothed_pwdb < (p_ra->rts_thres - 5)) - p_ra->is_lower_rts_rate = true; - else if (undecorated_smoothed_pwdb > p_ra->rts_thres) - p_ra->is_lower_rts_rate = false; -} - -#if 0 -void -odm_dynamic_arfb_select( - void *p_dm_void, - u8 rate, - bool collision_state -) -{ - struct PHY_DM_STRUCT *p_dm_odm = (struct PHY_DM_STRUCT *)p_dm_void; - struct _rate_adaptive_table_ *p_ra_table = &p_dm_odm->dm_ra_table; - - if (p_dm_odm->support_ic_type != ODM_RTL8192E) - return; - - if (collision_state == p_ra_table->PT_collision_pre) - return; - - if (rate >= DESC_RATEMCS8 && rate <= DESC_RATEMCS12) { - if (collision_state == 1) { - if (rate == DESC_RATEMCS12) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x0); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x07060501); - } else if (rate == DESC_RATEMCS11) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x0); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x07070605); - } else if (rate == DESC_RATEMCS10) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x0); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x08080706); - } else if (rate == DESC_RATEMCS9) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x0); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x08080707); - } else { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x0); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x09090808); - } - } else { /* collision_state == 0*/ - if (rate == DESC_RATEMCS12) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x05010000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x09080706); - } else if (rate == DESC_RATEMCS11) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x06050000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x09080807); - } else if (rate == DESC_RATEMCS10) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x07060000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x0a090908); - } else if (rate == DESC_RATEMCS9) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x07070000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x0a090808); - } else { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x08080000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x0b0a0909); - } - } - } else { /* MCS13~MCS15, 1SS, G-mode*/ - if (collision_state == 1) { - if (rate == DESC_RATEMCS15) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x00000000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x05040302); - } else if (rate == DESC_RATEMCS14) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x00000000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x06050302); - } else if (rate == DESC_RATEMCS13) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x00000000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x07060502); - } else { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x00000000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x06050402); - } - } else { /* collision_state == 0 */ - if (rate == DESC_RATEMCS15) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x03020000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x07060504); - } else if (rate == DESC_RATEMCS14) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x03020000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x08070605); - } else if (rate == DESC_RATEMCS13) { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x05020000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x09080706); - } else { - - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E, 0x04020000); - odm_write_4byte(p_dm_odm, REG_DARFRC_8192E+4, 0x08070605); - } - } - } - p_ra_table->PT_collision_pre = collision_state; -} -#endif - -void -odm_rate_adaptive_state_ap_init( - void *PADAPTER_VOID, - struct sta_info *p_entry -) -{ - struct _ADAPTER *adapter = (struct _ADAPTER *)PADAPTER_VOID; - p_entry->Ratr_State = DM_RATR_STA_INIT; -} -#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) /*#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)*/ static void find_minimum_rssi( @@ -3333,14 +2198,6 @@ odm_get_rate_bitmap( } -#endif /* #if (DM_ODM_SUPPORT_TYPE == ODM_CE) */ - -#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP)) - - -#endif /*#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN| ODM_CE))*/ - - /* RA_MASK_PHYDMLIZE, will delete it later*/ #if (RA_MASK_PHYDMLIZE_CE || RA_MASK_PHYDMLIZE_AP || RA_MASK_PHYDMLIZE_WIN) @@ -3365,35 +2222,17 @@ odm_ra_state_check( /* threshold Adjustment:*/ /* when RSSI state trends to go up one or two levels, make sure RSSI is high enough.*/ /* Here go_up_gap is added to solve the boundary's level alternation issue.*/ -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) - u8 ultra_low_rssi_thresh_for_ra = p_ra->ultra_low_rssi_thresh; - - if (p_dm_odm->support_ic_type == ODM_RTL8881A) - low_rssi_thresh_for_ra = 30; /* for LDPC / BCC switch*/ -#endif - switch (*p_ra_tr_state) { case DM_RATR_STA_INIT: case DM_RATR_STA_HIGH: break; - case DM_RATR_STA_MIDDLE: high_rssi_thresh_for_ra += go_up_gap; break; - case DM_RATR_STA_LOW: high_rssi_thresh_for_ra += go_up_gap; low_rssi_thresh_for_ra += go_up_gap; break; - -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) - case DM_RATR_STA_ULTRA_LOW: - high_rssi_thresh_for_ra += go_up_gap; - low_rssi_thresh_for_ra += go_up_gap; - ultra_low_rssi_thresh_for_ra += go_up_gap; - break; -#endif - default: ODM_RT_ASSERT(p_dm_odm, false, ("wrong rssi level setting %d !", *p_ra_tr_state)); break; @@ -3405,18 +2244,9 @@ odm_ra_state_check( else if (RSSI > low_rssi_thresh_for_ra) ratr_state = DM_RATR_STA_MIDDLE; -#if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) - else if (RSSI > ultra_low_rssi_thresh_for_ra) - ratr_state = DM_RATR_STA_LOW; - else - ratr_state = DM_RATR_STA_ULTRA_LOW; -#else else ratr_state = DM_RATR_STA_LOW; -#endif ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("[Mod RA RSSI Thresh] High= (( %d )), Low = (( %d ))\n", high_rssi_thresh_for_ra, low_rssi_thresh_for_ra)); - /*printk("==>%s,ratr_state:0x%02x,RSSI:%d\n",__FUNCTION__,ratr_state,RSSI);*/ - if (*p_ra_tr_state != ratr_state || is_force_update) { ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("[RSSI Level Update] %d->%d\n", *p_ra_tr_state, ratr_state)); *p_ra_tr_state = ratr_state; diff --git a/include/rtw_recv.h b/include/rtw_recv.h index 9853e1f..db41d6c 100644 --- a/include/rtw_recv.h +++ b/include/rtw_recv.h @@ -143,40 +143,6 @@ struct signal_stat { u32 total_num; /* num of valid elements */ u32 total_val; /* sum of valid elements */ }; -#if 0 -typedef struct _ODM_Phy_Status_Info_ { - /* */ - /* Be care, if you want to add any element please insert between */ - /* RxPWDBAll & SignalStrength. */ - /* */ -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN)) - u4Byte RxPWDBAll; -#else - u1Byte RxPWDBAll; -#endif - - u1Byte SignalQuality; /* in 0-100 index. */ - s1Byte RxMIMOSignalQuality[4]; /* per-path's EVM */ - u1Byte RxMIMOEVMdbm[4]; /* per-path's EVM dbm */ - - u1Byte RxMIMOSignalStrength[4];/* in 0~100 index */ - - u2Byte Cfo_short[4]; /* per-path's Cfo_short */ - u2Byte Cfo_tail[4]; /* per-path's Cfo_tail */ - -#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE)) - s1Byte RxPower; /* in dBm Translate from PWdB */ - s1Byte RecvSignalPower; /* Real power in dBm for this packet, no beautification and aggregation. Keep this raw info to be used for the other procedures. */ - u1Byte BTRxRSSIPercentage; - u1Byte SignalStrength; /* in 0-100 index. */ - - u1Byte RxPwr[4]; /* per-path's pwdb */ -#endif - u1Byte RxSNR[4]; /* per-path's SNR */ - u1Byte BandWidth; - u1Byte btCoexPwrAdjust; -} ODM_PHY_INFO_T, *PODM_PHY_INFO_T; -#endif struct phy_info { u8 RxPWDBAll;