From 2abe0258871dd152f871e341ad7de4d9a4097aca Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sat, 3 Nov 2018 19:31:49 -0500 Subject: [PATCH] rtl8188eu: Remove code for other than USB devices in hal/ Signed-off-by: Larry Finger --- hal/hal_btcoex.c | 8 -- hal/hal_btcoex_wifionly.c | 8 -- hal/hal_com.c | 84 --------------- hal/hal_dm.c | 22 ---- hal/hal_intf.c | 87 +-------------- hal/phydm/hal8188erateadaptive.c | 5 - hal/phydm/phydm_types.h | 56 +--------- hal/rtl8188e_dm.c | 113 +------------------- hal/rtl8188e_hal_init.c | 132 ----------------------- hal/rtl8188e_phycfg.c | 178 ++++--------------------------- hal/rtl8188e_sreset.c | 5 - hal/rtl8188eu_xmit.c | 3 - hal/usb_halinit.c | 14 --- 13 files changed, 27 insertions(+), 688 deletions(-) diff --git a/hal/hal_btcoex.c b/hal/hal_btcoex.c index 5a0ab55..47b380c 100644 --- a/hal/hal_btcoex.c +++ b/hal/hal_btcoex.c @@ -2334,15 +2334,7 @@ u8 EXhalbtcoutsrc_InitlizeVariables(void *padapter) halbtcoutsrc_coex_offload_init(); -#ifdef CONFIG_PCI_HCI - pBtCoexist->chip_interface = BTC_INTF_PCI; -#elif defined(CONFIG_USB_HCI) pBtCoexist->chip_interface = BTC_INTF_USB; -#elif defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pBtCoexist->chip_interface = BTC_INTF_SDIO; -#else - pBtCoexist->chip_interface = BTC_INTF_UNKNOWN; -#endif EXhalbtcoutsrc_BindBtCoexWithAdapter(padapter); diff --git a/hal/hal_btcoex_wifionly.c b/hal/hal_btcoex_wifionly.c index b669ca8..8d08a8a 100644 --- a/hal/hal_btcoex_wifionly.c +++ b/hal/hal_btcoex_wifionly.c @@ -120,15 +120,7 @@ void hal_btcoex_wifionly_initlizevariables(PADAPTER padapter) pwifionlycfg->Adapter = padapter; -#ifdef CONFIG_PCI_HCI - pwifionlycfg->chip_interface = WIFIONLY_INTF_PCI; -#elif defined(CONFIG_USB_HCI) pwifionlycfg->chip_interface = WIFIONLY_INTF_USB; -#elif defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pwifionlycfg->chip_interface = WIFIONLY_INTF_SDIO; -#else - pwifionlycfg->chip_interface = WIFIONLY_INTF_UNKNOWN; -#endif pwifionly_haldata->customer_id = CUSTOMER_NORMAL; pwifionly_haldata->efuse_pg_antnum = pHalData->EEPROMBluetoothAntNum; diff --git a/hal/hal_com.c b/hal/hal_com.c index b352222..6d9cbab 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -1487,13 +1487,11 @@ int hal_read_mac_hidden_rpt(_adapter *adapter) u8 id = C2H_DEFEATURE_RSVD; int i; -#if defined(CONFIG_USB_HCI) || defined(CONFIG_PCI_HCI) u8 hci_type = rtw_get_intf_type(adapter); if ((hci_type == RTW_USB || hci_type == RTW_PCIE) && !rtw_is_hw_init_completed(adapter)) rtw_hal_power_on(adapter); -#endif /* inform FW mac hidden rpt from reg is needed */ rtw_write8(adapter, REG_C2HEVT_MSG_NORMAL, C2H_DEFEATURE_RSVD); @@ -1533,11 +1531,9 @@ mac_hidden_rpt_hdl: exit: -#if defined(CONFIG_USB_HCI) || defined(CONFIG_PCI_HCI) if ((hci_type == RTW_USB || hci_type == RTW_PCIE) && !rtw_is_hw_init_completed(adapter)) rtw_hal_power_off(adapter); -#endif RTW_INFO("%s %s! (%u, %dms), fwdl:%d, id:0x%02x\n", __func__ , (ret == _SUCCESS) ? "OK" : "Fail", cnt, rtw_get_passing_time_ms(start), ret_fwdl, id); @@ -3306,33 +3302,22 @@ static u8 rtw_hal_pause_rx_dma(_adapter *adapter) (rtw_read32(adapter, REG_RXPKT_NUM) | RW_RELEASE_EN)); do { if ((rtw_read32(adapter, REG_RXPKT_NUM) & RXDMA_IDLE)) { -#ifdef CONFIG_USB_HCI /* stop interface before leave */ if (_TRUE == hal->usb_intf_start) { rtw_intf_stop(adapter); RTW_ENABLE_FUNC(adapter, DF_RX_BIT); RTW_ENABLE_FUNC(adapter, DF_TX_BIT); } -#endif /* CONFIG_USB_HCI */ RTW_PRINT("RX_DMA_IDLE is true\n"); ret = _SUCCESS; break; } -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - else { - res = RecvOnePkt(adapter); - RTW_PRINT("RecvOnePkt Result: %d\n", res); - } -#endif /* CONFIG_SDIO_HCI || CONFIG_GSPI_HCI */ - -#ifdef CONFIG_USB_HCI else { /* to avoid interface start repeatedly */ if (_FALSE == hal->usb_intf_start) rtw_intf_start(adapter); } -#endif /* CONFIG_USB_HCI */ } while (trycnt--); if (trycnt < 0) { @@ -3354,41 +3339,6 @@ static u8 rtw_hal_pause_rx_dma(_adapter *adapter) return ret; } -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -#ifndef RTW_HALMAC -static u8 rtw_hal_enable_cpwm2(_adapter *adapter) -{ - u8 ret = 0; - int res = 0; - u32 tmp = 0; -#ifdef CONFIG_GPIO_WAKEUP - return _SUCCESS; -#else - RTW_PRINT("%s\n", __func__); - - res = sdio_local_read(adapter, SDIO_REG_HIMR, 4, (u8 *)&tmp); - if (!res) - RTW_INFO("read SDIO_REG_HIMR: 0x%08x\n", tmp); - else - RTW_INFO("sdio_local_read fail\n"); - - tmp = SDIO_HIMR_CPWM2_MSK; - - res = sdio_local_write(adapter, SDIO_REG_HIMR, 4, (u8 *)&tmp); - - if (!res) { - res = sdio_local_read(adapter, SDIO_REG_HIMR, 4, (u8 *)&tmp); - RTW_INFO("read again SDIO_REG_HIMR: 0x%08x\n", tmp); - ret = _SUCCESS; - } else { - RTW_INFO("sdio_local_write fail\n"); - ret = _FAIL; - } - return ret; -#endif /* CONFIG_CPIO_WAKEUP */ -} -#endif -#endif /* CONFIG_SDIO_HCI, CONFIG_GSPI_HCI */ #endif /* CONFIG_WOWLAN || CONFIG_AP_WOWLAN */ #ifdef CONFIG_WOWLAN @@ -4102,9 +4052,7 @@ static u8 rtw_hal_set_ap_ps_cmd(_adapter *adapter, u8 enable) RTW_INFO("%s(): enable=%d\n" , __func__ , enable); SET_H2CCMD_AP_WOW_PS_EN(ap_ps_parm, enable); -#ifndef CONFIG_USB_HCI SET_H2CCMD_AP_WOW_PS_32K_EN(ap_ps_parm, enable); -#endif /*CONFIG_USB_HCI*/ SET_H2CCMD_AP_WOW_PS_RF(ap_ps_parm, enable); if (enable) @@ -4209,28 +4157,16 @@ static void rtw_hal_ap_wow_enable(_adapter *padapter) if (res == _FAIL) RTW_PRINT("[WARNING] pause RX DMA fail\n"); -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - /* Enable CPWM2 only. */ - res = rtw_hal_enable_cpwm2(padapter); - if (res == _FAIL) - RTW_PRINT("[WARNING] enable cpwm2 fail\n"); -#endif - -#ifdef CONFIG_GPIO_WAKEUP - rtw_hal_switch_gpio_wl_ctrl(padapter, WAKEUP_GPIO_IDX, _TRUE); -#endif /* 5. Set Enable WOWLAN H2C command. */ RTW_PRINT("Set Enable AP WOWLan cmd\n"); rtw_hal_set_fw_ap_wow_related_cmd(padapter, 1); rtw_write8(padapter, REG_MCUTST_WOWLAN, 0); -#ifdef CONFIG_USB_HCI rtw_mi_intf_stop(padapter); /* Invoid SE0 reset signal during suspending*/ rtw_write8(padapter, REG_RSV_CTRL, 0x20); if (IS_8188F(pHalData->version_id) == FALSE) rtw_write8(padapter, REG_RSV_CTRL, 0x60); -#endif /*CONFIG_USB_HCI*/ } static void rtw_hal_ap_wow_disable(_adapter *padapter) @@ -7608,15 +7544,6 @@ static void rtw_hal_wow_enable(_adapter *adapter) } } -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - /* Enable CPWM2 only. */ - res = rtw_hal_enable_cpwm2(adapter); - if (res == _FAIL) - RTW_PRINT("[WARNING] enable cpwm2 fail\n"); -#endif -#ifdef CONFIG_GPIO_WAKEUP - rtw_hal_switch_gpio_wl_ctrl(adapter, WAKEUP_GPIO_IDX, _TRUE); -#endif /* Set WOWLAN H2C command. */ RTW_PRINT("Set WOWLan cmd\n"); rtw_hal_set_fw_wow_related_cmd(adapter, 1); @@ -7635,7 +7562,6 @@ static void rtw_hal_wow_enable(_adapter *adapter) dump_sec_cam(RTW_DBGDUMP, adapter); dump_sec_cam_cache(RTW_DBGDUMP, adapter); #endif -#ifdef CONFIG_USB_HCI /* free adapter's resource */ rtw_mi_intf_stop(adapter); @@ -7643,7 +7569,6 @@ static void rtw_hal_wow_enable(_adapter *adapter) rtw_write8(adapter, REG_RSV_CTRL, 0x20); if (IS_8188F(pHalData->version_id) == FALSE) rtw_write8(adapter, REG_RSV_CTRL, 0x60); -#endif /*CONFIG_USB_HCI*/ rtw_hal_gate_bb(adapter, _FALSE); } @@ -8362,11 +8287,7 @@ download_page: pattrib->qsel = QSLT_BEACON; pattrib->pktlen = TotalPacketLen - TxDescOffset; pattrib->last_txcmdsz = TotalPacketLen - TxDescOffset; -#ifdef CONFIG_PCI_HCI - dump_mgntframe(adapter, pcmdframe); -#else dump_mgntframe_and_wait(adapter, pcmdframe, 100); -#endif } RTW_INFO("%s: Set RSVD page location to Fw ,TotalPacketLen(%d), TotalPageNum(%d)\n", @@ -8737,11 +8658,6 @@ u8 rtw_hal_query_txbfer_rf_num(_adapter *adapter) if ((pregistrypriv->beamformer_rf_num) && (IS_HARDWARE_TYPE_8814AE(adapter) || IS_HARDWARE_TYPE_8814AU(adapter) || IS_HARDWARE_TYPE_8822BU(adapter) || IS_HARDWARE_TYPE_8821C(adapter))) return pregistrypriv->beamformer_rf_num; else if (IS_HARDWARE_TYPE_8814AE(adapter) -#if 0 -#if defined(CONFIG_USB_HCI) - || (IS_HARDWARE_TYPE_8814AU(adapter) && (pUsbModeMech->CurUsbMode == 2 || pUsbModeMech->HubUsbMode == 2)) /* for USB3.0 */ -#endif -#endif ) { /*BF cap provided by Yu Chen, Sean, 2015, 01 */ if (hal_data->rf_type == RF_3T3R) diff --git a/hal/hal_dm.c b/hal/hal_dm.c index 2198617..6f136ea 100644 --- a/hal/hal_dm.c +++ b/hal/hal_dm.c @@ -26,22 +26,6 @@ enum odm_board_type_e boardType(u8 InterfaceSel) { enum odm_board_type_e board = ODM_BOARD_DEFAULT; -#ifdef CONFIG_PCI_HCI - INTERFACE_SELECT_PCIE pcie = (INTERFACE_SELECT_PCIE)InterfaceSel; - switch (pcie) { - case INTF_SEL0_SOLO_MINICARD: - board |= ODM_BOARD_MINICARD; - break; - case INTF_SEL1_BT_COMBO_MINICARD: - board |= ODM_BOARD_BT; - board |= ODM_BOARD_MINICARD; - break; - default: - board = ODM_BOARD_DEFAULT; - break; - } - -#elif defined(CONFIG_USB_HCI) INTERFACE_SELECT_USB usb = (INTERFACE_SELECT_USB)InterfaceSel; switch (usb) { case INTF_SEL1_USB_High_Power: @@ -63,10 +47,6 @@ enum odm_board_type_e boardType(u8 InterfaceSel) board = ODM_BOARD_DEFAULT; break; } - -#endif - /* RTW_INFO("===> boardType(): (pHalData->InterfaceSel, pDM_Odm->BoardType) = (%d, %d)\n", InterfaceSel, board); */ - return board; } @@ -210,9 +190,7 @@ void Init_ODM_ComInfo(_adapter *adapter) odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_TX_TP, &(dvobj->traffic_stat.cur_tx_tp)); odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_RX_TP, &(dvobj->traffic_stat.cur_rx_tp)); odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_ANT_TEST, &(pHalData->antenna_test)); -#ifdef CONFIG_USB_HCI odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_HUBUSBMODE, &(dvobj->usb_speed)); -#endif for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) odm_cmn_info_ptr_array_hook(pDM_Odm, ODM_CMNINFO_STA_STATUS, i, NULL); diff --git a/hal/hal_intf.c b/hal/hal_intf.c index 4bea51d..b16bd9f 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -289,20 +289,13 @@ void rtw_hal_get_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID p /* FOR SDIO & PCIE */ void rtw_hal_enable_interrupt(_adapter *padapter) { -#if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined (CONFIG_GSPI_HCI) - padapter->hal_func.enable_interrupt(padapter); -#endif /* #if defined(CONFIG_PCI_HCI) || defined (CONFIG_SDIO_HCI) || defined (CONFIG_GSPI_HCI) */ } /* FOR SDIO & PCIE */ void rtw_hal_disable_interrupt(_adapter *padapter) { -#if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined (CONFIG_GSPI_HCI) - padapter->hal_func.disable_interrupt(padapter); -#endif /* #if defined(CONFIG_PCI_HCI) || defined (CONFIG_SDIO_HCI) || defined (CONFIG_GSPI_HCI) */ } - u8 rtw_hal_check_ips_status(_adapter *padapter) { u8 val = _FALSE; @@ -322,13 +315,9 @@ s32 rtw_hal_fw_dl(_adapter *padapter, u8 wowlan) #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) void rtw_hal_clear_interrupt(_adapter *padapter) { -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - padapter->hal_func.clear_interrupt(padapter); -#endif } #endif -#if defined(CONFIG_USB_HCI) || defined(CONFIG_PCI_HCI) u32 rtw_hal_inirp_init(_adapter *padapter) { if (is_primary_adapter(padapter)) @@ -343,14 +332,6 @@ u32 rtw_hal_inirp_deinit(_adapter *padapter) return _SUCCESS; } -#endif /* #if defined(CONFIG_USB_HCI) || defined (CONFIG_PCI_HCI) */ - -#if defined(CONFIG_PCI_HCI) -void rtw_hal_irp_reset(_adapter *padapter) -{ - padapter->hal_func.irp_reset(GET_PRIMARY_ADAPTER(padapter)); -} -#endif /* #if defined(CONFIG_PCI_HCI) */ /* for USB Auto-suspend */ u8 rtw_hal_intf_ps_func(_adapter *padapter, HAL_INTF_PS_FUNC efunc_id, u8 *val) @@ -527,22 +508,10 @@ void rtw_hal_update_ra_mask(struct sta_info *psta, u8 rssi_level, u8 is_update_b /* Start specifical interface thread */ void rtw_hal_start_thread(_adapter *padapter) { -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -#ifndef CONFIG_SDIO_TX_TASKLET - padapter->hal_func.run_thread(padapter); -#endif -#endif } /* Start specifical interface thread */ void rtw_hal_stop_thread(_adapter *padapter) { -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -#ifndef CONFIG_SDIO_TX_TASKLET - - padapter->hal_func.cancel_thread(padapter); - -#endif -#endif } u32 rtw_hal_read_bbreg(_adapter *padapter, u32 RegAddr, u32 BitMask) @@ -585,22 +554,10 @@ void rtw_hal_write_rfreg(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMa padapter->hal_func.write_rfreg(padapter, eRFPath, RegAddr, BitMask, Data); -#ifdef CONFIG_PCI_HCI - if (!IS_HARDWARE_TYPE_JAGUAR_AND_JAGUAR2(padapter)) /*For N-Series IC, suggest by Jenyu*/ - rtw_udelay_os(2); -#endif } } -#if defined(CONFIG_PCI_HCI) -s32 rtw_hal_interrupt_handler(_adapter *padapter) -{ - s32 ret = _FAIL; - ret = padapter->hal_func.interrupt_handler(padapter); - return ret; -} -#endif -#if defined(CONFIG_USB_HCI) && defined(CONFIG_SUPPORT_USB_INT) +#if defined(CONFIG_SUPPORT_USB_INT) void rtw_hal_interrupt_handler(_adapter *padapter, u16 pkt_len, u8 *pbuf) { padapter->hal_func.interrupt_handler(padapter, pkt_len, pbuf); @@ -1165,18 +1122,6 @@ u8 rtw_hal_ops_check(_adapter *padapter) rtw_hal_error_msg("hal_xmitframe_enqueue"); ret = _FAIL; } -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -#ifndef CONFIG_SDIO_TX_TASKLET - if (NULL == padapter->hal_func.run_thread) { - rtw_hal_error_msg("run_thread"); - ret = _FAIL; - } - if (NULL == padapter->hal_func.cancel_thread) { - rtw_hal_error_msg("cancel_thread"); - ret = _FAIL; - } -#endif -#endif /*** recv section ***/ if (NULL == padapter->hal_func.init_recv_priv) { @@ -1193,7 +1138,6 @@ u8 rtw_hal_ops_check(_adapter *padapter) ret = _FAIL; } #endif -#if defined(CONFIG_USB_HCI) || defined(CONFIG_PCI_HCI) if (NULL == padapter->hal_func.inirp_init) { rtw_hal_error_msg("inirp_init"); ret = _FAIL; @@ -1202,34 +1146,15 @@ u8 rtw_hal_ops_check(_adapter *padapter) rtw_hal_error_msg("inirp_deinit"); ret = _FAIL; } -#endif /* #if defined(CONFIG_USB_HCI) || defined (CONFIG_PCI_HCI) */ /*** interrupt hdl section ***/ -#if defined(CONFIG_PCI_HCI) - if (NULL == padapter->hal_func.irp_reset) { - rtw_hal_error_msg("irp_reset"); - ret = _FAIL; - } -#endif/*#if defined(CONFIG_PCI_HCI)*/ -#if (defined(CONFIG_PCI_HCI)) || (defined(CONFIG_USB_HCI) && defined(CONFIG_SUPPORT_USB_INT)) +#if (defined(CONFIG_SUPPORT_USB_INT)) if (NULL == padapter->hal_func.interrupt_handler) { rtw_hal_error_msg("interrupt_handler"); ret = _FAIL; } -#endif /*#if (defined(CONFIG_PCI_HCI)) || (defined(CONFIG_USB_HCI) && defined(CONFIG_SUPPORT_USB_INT))*/ - -#if defined(CONFIG_PCI_HCI) || defined(CONFIG_SDIO_HCI) || defined (CONFIG_GSPI_HCI) - if (NULL == padapter->hal_func.enable_interrupt) { - rtw_hal_error_msg("enable_interrupt"); - ret = _FAIL; - } - if (NULL == padapter->hal_func.disable_interrupt) { - rtw_hal_error_msg("disable_interrupt"); - ret = _FAIL; - } -#endif /* defined(CONFIG_PCI_HCI) || defined (CONFIG_SDIO_HCI) || defined (CONFIG_GSPI_HCI) */ - +#endif /*#if ((CONFIG_SUPPORT_USB_INT))*/ /*** DM section ***/ if (NULL == padapter->hal_func.dm_init) { @@ -1315,12 +1240,6 @@ u8 rtw_hal_ops_check(_adapter *padapter) } #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - if (NULL == padapter->hal_func.clear_interrupt) { - rtw_hal_error_msg("clear_interrupt"); - ret = _FAIL; - } -#endif #endif /* CONFIG_WOWLAN */ if (NULL == padapter->hal_func.fw_dl) { diff --git a/hal/phydm/hal8188erateadaptive.c b/hal/phydm/hal8188erateadaptive.c index db4a6e9..1257de7 100644 --- a/hal/phydm/hal8188erateadaptive.c +++ b/hal/phydm/hal8188erateadaptive.c @@ -1142,11 +1142,7 @@ odm_ra_set_tx_rpt_time( { #if (DM_ODM_SUPPORT_TYPE & (ODM_AP)) if (min_rpt_time != 0xffff) { -#if defined(CONFIG_PCI_HCI) - odm_write_2byte(p_dm_odm, REG_TX_RPT_TIME, min_rpt_time); -#elif defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) notify_tx_report_interval_change(p_dm_odm->priv, min_rpt_time); -#endif } #else odm_write_2byte(p_dm_odm, REG_TX_RPT_TIME, min_rpt_time); @@ -1154,7 +1150,6 @@ odm_ra_set_tx_rpt_time( } - void odm_ra_tx_rpt2_handle_8188e(struct PHY_DM_STRUCT *p_dm_odm, u8 *tx_rpt_buf, __le16 tx_rpt_len, u32 mac_id_valid_entry0, diff --git a/hal/phydm/phydm_types.h b/hal/phydm/phydm_types.h index 62e36b8..0707e5a 100644 --- a/hal/phydm/phydm_types.h +++ b/hal/phydm/phydm_types.h @@ -167,11 +167,6 @@ enum rt_spinlock_type { typedef long long s64, *s64 *; #endif - - #ifdef CONFIG_PCI_HCI - #define DEV_BUS_TYPE RT_PCI_INTERFACE - #endif - #define _TRUE 1 #define _FALSE 0 @@ -185,51 +180,7 @@ enum rt_spinlock_type { #elif (DM_ODM_SUPPORT_TYPE == ODM_CE) #include - #if 0 - typedef u8 u8, *u8 *; - typedef u16 u16, *u16 *; - typedef u32 u32, *u32 *; - typedef u64 u64, *u64 *; - typedef s8 s8, *s8 *; - typedef s16 s16, *s16 *; - typedef s32 s32, *s32 *; - typedef s64 s64, *s64 *; - #elif 0 - #define u8 u8 - #define u8 *u8* - - #define u16 u16 - #define u16 *u16* - - #define u32 u32 - #define u32 *u32* - - #define u64 u64 - #define u64* u64* - - #define s8 s8 - #define s8* s8* - - #define s16 s16 - #define s16* s16* - - #define s32 s32 - #define s32* s32* - - #define s64 s64 - #define s64* s64* - - #endif - #ifdef CONFIG_USB_HCI - #define DEV_BUS_TYPE RT_USB_INTERFACE - #elif defined(CONFIG_PCI_HCI) - #define DEV_BUS_TYPE RT_PCI_INTERFACE - #elif defined(CONFIG_SDIO_HCI) - #define DEV_BUS_TYPE RT_SDIO_INTERFACE - #elif defined(CONFIG_GSPI_HCI) - #define DEV_BUS_TYPE RT_SDIO_INTERFACE - #endif - + #define DEV_BUS_TYPE RT_USB_INTERFACE #if defined(__LITTLE_ENDIAN) #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE @@ -237,11 +188,6 @@ enum rt_spinlock_type { #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG #endif - //#define struct sta_info struct sta_info - //#define struct sta_info* struct sta_info * - - - #define true _TRUE #define false _FALSE diff --git a/hal/rtl8188e_dm.c b/hal/rtl8188e_dm.c index e925da1..365f562 100644 --- a/hal/rtl8188e_dm.c +++ b/hal/rtl8188e_dm.c @@ -91,7 +91,6 @@ static void dm_CheckPbcGPIO(_adapter *padapter) if (!padapter->registrypriv.hw_wps_pbc) return; -#ifdef CONFIG_USB_HCI tmp1byte = rtw_read8(padapter, GPIO_IO_SEL); tmp1byte |= (HAL_8188E_HW_GPIO_WPS_BIT); rtw_write8(padapter, GPIO_IO_SEL, tmp1byte); /* enable GPIO[2] as output mode */ @@ -110,15 +109,6 @@ static void dm_CheckPbcGPIO(_adapter *padapter) if (tmp1byte & HAL_8188E_HW_GPIO_WPS_BIT) bPbcPressed = _TRUE; -#else - tmp1byte = rtw_read8(padapter, GPIO_IN); - - if (tmp1byte == 0xff || padapter->init_adpt_in_progress) - return ; - - if ((tmp1byte & HAL_8188E_HW_GPIO_WPS_BIT) == 0) - bPbcPressed = _TRUE; -#endif if (_TRUE == bPbcPressed) { /* Here we only set bPbcPressed to true */ @@ -129,89 +119,7 @@ static void dm_CheckPbcGPIO(_adapter *padapter) } #endif/* #ifdef CONFIG_SUPPORT_HW_WPS_PBC */ -#ifdef CONFIG_PCI_HCI -/* - * Description: - * Perform interrupt migration dynamically to reduce CPU utilization. - * - * Assumption: - * 1. Do not enable migration under WIFI test. - * - * Created by Roger, 2010.03.05. - * */ -VOID -dm_InterruptMigration( - IN PADAPTER Adapter -) -{ - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv); - BOOLEAN bCurrentIntMt, bCurrentACIntDisable; - BOOLEAN IntMtToSet = _FALSE; - BOOLEAN ACIntToSet = _FALSE; - - - /* Retrieve current interrupt migration and Tx four ACs IMR settings first. */ - bCurrentIntMt = pHalData->bInterruptMigration; - bCurrentACIntDisable = pHalData->bDisableTxInt; - - /* */ - /* Currently we use busy traffic for reference instead of RxIntOK counts to prevent non-linear Rx statistics */ - /* when interrupt migration is set before. 2010.03.05. */ - /* */ - if (!Adapter->registrypriv.wifi_spec && - (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) && - pmlmepriv->LinkDetectInfo.bHigherBusyTraffic) { - IntMtToSet = _TRUE; - - /* To check whether we should disable Tx interrupt or not. */ - if (pmlmepriv->LinkDetectInfo.bHigherBusyRxTraffic) - ACIntToSet = _TRUE; - } - - /* Update current settings. */ - if (bCurrentIntMt != IntMtToSet) { - RTW_INFO("%s(): Update interrrupt migration(%d)\n", __func__, IntMtToSet); - if (IntMtToSet) { - /* */ - /* Set interrrupt migration timer and corresponging Tx/Rx counter. */ - /* timer 25ns*0xfa0=100us for 0xf packets. */ - /* 2010.03.05. */ - /* */ - rtw_write32(Adapter, REG_INT_MIG, 0xff000fa0);/* 0x306:Rx, 0x307:Tx */ - pHalData->bInterruptMigration = IntMtToSet; - } else { - /* Reset all interrupt migration settings. */ - rtw_write32(Adapter, REG_INT_MIG, 0); - pHalData->bInterruptMigration = IntMtToSet; - } - } - -#if 0 - if (bCurrentACIntDisable != ACIntToSet) { - RTW_INFO("%s(): Update AC interrrupt(%d)\n", __func__, ACIntToSet); - if (ACIntToSet) { /* Disable four ACs interrupts. */ - /* */ - /* Disable VO, VI, BE and BK four AC interrupts to gain more efficient CPU utilization. */ - /* When extremely highly Rx OK occurs, we will disable Tx interrupts. */ - /* 2010.03.05. */ - /* */ - UpdateInterruptMask8192CE(Adapter, 0, RT_AC_INT_MASKS); - pHalData->bDisableTxInt = ACIntToSet; - } else { /* Enable four ACs interrupts. */ - UpdateInterruptMask8192CE(Adapter, RT_AC_INT_MASKS, 0); - pHalData->bDisableTxInt = ACIntToSet; - } - } -#endif - -} - -#endif - -/* - * Initialize GPIO setting registers - * */ +/* Initialize GPIO setting registers */ static void dm_InitGPIOSetting( IN PADAPTER Adapter @@ -321,9 +229,7 @@ rtl8188e_InitHalDm( struct PHY_DM_STRUCT *pDM_Odm = &(pHalData->odmpriv); u8 i; -#ifdef CONFIG_USB_HCI dm_InitGPIOSetting(Adapter); -#endif pHalData->DM_Type = dm_type_by_driver; @@ -360,29 +266,12 @@ rtl8188e_HalDmWatchDog( if ((rtw_is_hw_init_completed(Adapter)) && ((!bFwCurrentInPSMode) && bFwPSAwake)) { - /* */ /* Calculate Tx/Rx statistics. */ - /* */ dm_CheckStatistics(Adapter); rtw_hal_check_rxfifo_full(Adapter); - /* */ - /* Dynamically switch RTS/CTS protection. */ - /* */ - /* dm_CheckProtection(Adapter); */ - -#ifdef CONFIG_PCI_HCI - /* 20100630 Joseph: Disable Interrupt Migration mechanism temporarily because it degrades Rx throughput. */ - /* Tx Migration settings. */ - /* dm_InterruptMigration(Adapter); */ - - /* if(Adapter->hal_func.TxCheckStuckHandler(Adapter)) */ - /* PlatformScheduleWorkItem(&(GET_HAL_DATA(Adapter)->HalResetWorkItem)); */ -#endif - } - /* ODM */ if (rtw_is_hw_init_completed(Adapter)) { u8 bLinked = _FALSE; diff --git a/hal/rtl8188e_hal_init.c b/hal/rtl8188e_hal_init.c index 6e28825..4dc1527 100644 --- a/hal/rtl8188e_hal_init.c +++ b/hal/rtl8188e_hal_init.c @@ -456,7 +456,6 @@ static int rtl8188e_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit if (rtw_IOL_append_END_cmd(xmit_frame) != _SUCCESS) goto exit; -#ifdef CONFIG_USB_HCI { struct pkt_attrib *pattrib = &xmit_frame->attrib; if (rtw_usb_bulk_size_boundary(adapter, TXDESC_SIZE + pattrib->last_txcmdsz)) { @@ -464,7 +463,6 @@ static int rtl8188e_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit goto exit; } } -#endif /* CONFIG_USB_HCI */ /* rtw_IOL_cmd_buf_dump(adapter,xmit_frame->attrib.pktlen+TXDESC_OFFSET,xmit_frame->buf_addr); */ /* rtw_hal_mgnt_xmit(adapter, xmit_frame); */ @@ -570,14 +568,8 @@ _BlockWrite( u32 remainSize_p1 = 0, remainSize_p2 = 0; u8 *bufferPtr = (u8 *)buffer; u32 i = 0, offset = 0; -#ifdef CONFIG_PCI_HCI - u8 remainFW[4] = {0, 0, 0, 0}; - u8 *p = NULL; -#endif -#ifdef CONFIG_USB_HCI blockSize_p1 = MAX_REG_BOLCK_SIZE; -#endif /* 3 Phase #1 */ blockCount_p1 = buffSize / blockSize_p1; @@ -586,35 +578,12 @@ _BlockWrite( for (i = 0; i < blockCount_p1; i++) { -#ifdef CONFIG_USB_HCI ret = rtw_writeN(padapter, (FW_8188E_START_ADDRESS + i * blockSize_p1), blockSize_p1, (bufferPtr + i * blockSize_p1)); -#else - ret = rtw_write32(padapter, (FW_8188E_START_ADDRESS + i * blockSize_p1), le32_to_cpu(*((u32 *)(bufferPtr + i * blockSize_p1)))); -#endif if (ret == _FAIL) goto exit; } -#ifdef CONFIG_PCI_HCI - p = (u8 *)((u32 *)(bufferPtr + blockCount_p1 * blockSize_p1)); - if (remainSize_p1) { - switch (remainSize_p1) { - case 0: - break; - case 3: - remainFW[2] = *(p + 2); - case 2: - remainFW[1] = *(p + 1); - case 1: - remainFW[0] = *(p); - ret = rtw_write32(padapter, (FW_8188E_START_ADDRESS + blockCount_p1 * blockSize_p1), - le32_to_cpu(*(u32 *)remainFW)); - } - return ret; - } -#endif - /* 3 Phase #2 */ if (remainSize_p1) { offset = blockCount_p1 * blockSize_p1; @@ -624,14 +593,12 @@ _BlockWrite( -#ifdef CONFIG_USB_HCI for (i = 0; i < blockCount_p2; i++) { ret = rtw_writeN(padapter, (FW_8188E_START_ADDRESS + offset + i * blockSize_p2), blockSize_p2, (bufferPtr + offset + i * blockSize_p2)); if (ret == _FAIL) goto exit; } -#endif } /* 3 Phase #3 */ @@ -702,12 +669,6 @@ _WriteFW( u32 page, offset; u8 *bufferPtr = (u8 *)buffer; -#ifdef CONFIG_PCI_HCI - /* 20100120 Joseph: Add for 88CE normal chip. */ - /* Fill in zero to make firmware image to dword alignment. - * _FillDummy(bufferPtr, &size); */ -#endif - pageNums = size / MAX_DLFW_PAGE_SIZE ; /* RT_ASSERT((pageNums <= 4), ("Page numbers should not greater then 4\n")); */ remainSize = size % MAX_DLFW_PAGE_SIZE; @@ -2473,31 +2434,10 @@ static void read_chip_version_8188e(PADAPTER padapter) void rtl8188e_start_thread(_adapter *padapter) { -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -#ifndef CONFIG_SDIO_TX_TASKLET - struct xmit_priv *xmitpriv = &padapter->xmitpriv; - - xmitpriv->SdioXmitThread = kthread_run(rtl8188es_xmit_thread, padapter, "RTWHALXT"); - if (IS_ERR(xmitpriv->SdioXmitThread)) - RTW_ERR("%s: start rtl8188es_xmit_thread FAIL!!\n", __func__); -#endif -#endif } void rtl8188e_stop_thread(_adapter *padapter) { -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -#ifndef CONFIG_SDIO_TX_TASKLET - struct xmit_priv *xmitpriv = &padapter->xmitpriv; - - /* stop xmit_buf_thread */ - if (xmitpriv->SdioXmitThread) { - _rtw_up_sema(&xmitpriv->SdioXmitSema); - _rtw_down_sema(&xmitpriv->SdioXmitTerminateSema); - xmitpriv->SdioXmitThread = 0; - } -#endif -#endif } static void hal_notch_filter_8188e(_adapter *adapter, bool enable) @@ -2570,21 +2510,8 @@ bool rtl8188e_gpio_radio_on_off_check(_adapter *adapter, u8 *valid) u32 tmp32; bool ret; -#ifdef CONFIG_PCI_HCI -#if 1 *valid = 0; return _FALSE; /* unblock */ -#else - tmp32 = rtw_read32(adapter, REG_GSSR); - ret = (tmp32 & BIT(31)) ? _FALSE : _TRUE; /* Power down pin output value, low active */ - *valid = 1; - - return ret; -#endif -#else - *valid = 0; - return _FALSE; /* unblock */ -#endif } #endif @@ -2676,7 +2603,6 @@ u8 GetEEPROMSize8188E(PADAPTER padapter) return size; } -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_PCI_HCI) || defined(CONFIG_GSPI_HCI) /* ------------------------------------------------------------------------- * * LLT R/W/Init function @@ -2768,8 +2694,6 @@ s32 InitLLTTable(PADAPTER padapter, u8 txpktbuf_bndy) return status; } -#endif - void Hal_InitPGData88E(PADAPTER padapter) @@ -2852,9 +2776,7 @@ void Hal_ReadPowerSavingMode88E( /* decide hw if support remote wakeup function */ /* if hw supported, 8051 (SIE) will generate WeakUP signal( D+/D- toggle) when autoresume */ -#ifdef CONFIG_USB_HCI pwrctl->bSupportRemoteWakeup = (hwinfo[EEPROM_USB_OPTIONAL_FUNCTION0] & BIT1) ? _TRUE : _FALSE; -#endif /* CONFIG_USB_HCI */ RTW_INFO("%s...bHWPwrPindetect(%x)-bHWPowerdown(%x) ,bSupportRemoteWakeup(%x)\n", __func__, pwrctl->bHWPwrPindetect, pwrctl->bHWPowerdown, pwrctl->bSupportRemoteWakeup); @@ -3323,12 +3245,6 @@ void SetBcnCtrlReg( pHalData->RegBcnCtrlVal |= SetBits; pHalData->RegBcnCtrlVal &= ~ClearBits; -#if 0 - /* #ifdef CONFIG_SDIO_HCI */ - if (pHalData->sdio_himr & (SDIO_HIMR_TXBCNOK_MSK | SDIO_HIMR_TXBCNERR_MSK)) - pHalData->RegBcnCtrlVal |= EN_TXBCN_RPT; -#endif - rtw_write8(padapter, REG_BCN_CTRL, (u8)pHalData->RegBcnCtrlVal); } @@ -3425,28 +3341,17 @@ static void hw_var_set_opmode(PADAPTER Adapter, u8 variable, u8 *val) #ifdef CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT rtw_write8(Adapter, REG_DRVERLYINT, 0x05);/* restore early int time to 5ms */ -#if defined(CONFIG_USB_HCI) UpdateInterruptMask8188EU(Adapter, _TRUE, 0, IMR_BCNDMAINT0_88E); -#elif defined(CONFIG_SDIO_HCI) - UpdateInterruptMask8188ESdio(Adapter, 0, SDIO_HIMR_BCNERLY_INT_MSK); -#endif #endif /* CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT */ #ifdef CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR -#if defined(CONFIG_USB_HCI) UpdateInterruptMask8188EU(Adapter, _TRUE , 0, (IMR_TBDER_88E | IMR_TBDOK_88E)); -#elif defined(CONFIG_SDIO_HCI) - UpdateInterruptMask8188ESdio(Adapter, 0, (SDIO_HIMR_TXBCNOK_MSK | SDIO_HIMR_TXBCNERR_MSK)); -#endif #endif/* CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR */ #endif /* CONFIG_INTERRUPT_BASED_TXBCN */ StopTxBeacon(Adapter); -#if defined(CONFIG_PCI_HCI) - UpdateInterruptMask8188EE(Adapter, 0, 0, RT_BCN_INT_MASKS, 0); -#endif } rtw_write8(Adapter, REG_BCN_CTRL_1, 0x11); /* disable atim wnd and disable beacon function */ @@ -3462,19 +3367,11 @@ static void hw_var_set_opmode(PADAPTER Adapter, u8 variable, u8 *val) } else if (mode == _HW_STATE_AP_) { #ifdef CONFIG_INTERRUPT_BASED_TXBCN #ifdef CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT -#if defined(CONFIG_USB_HCI) UpdateInterruptMask8188EU(Adapter, _TRUE , IMR_BCNDMAINT0_88E, 0); -#elif defined(CONFIG_SDIO_HCI) - UpdateInterruptMask8188ESdio(Adapter, SDIO_HIMR_BCNERLY_INT_MSK, 0); -#endif #endif/* CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT */ #ifdef CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR -#if defined(CONFIG_USB_HCI) UpdateInterruptMask8188EU(Adapter, _TRUE , (IMR_TBDER_88E | IMR_TBDOK_88E), 0); -#elif defined(CONFIG_SDIO_HCI) - UpdateInterruptMask8188ESdio(Adapter, (SDIO_HIMR_TXBCNOK_MSK | SDIO_HIMR_TXBCNERR_MSK), 0); -#endif #endif/* CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR */ #endif /* CONFIG_INTERRUPT_BASED_TXBCN */ @@ -3546,9 +3443,6 @@ static void hw_var_set_opmode(PADAPTER Adapter, u8 variable, u8 *val) __func__, __LINE__); } #endif /* CONFIG_TSF_RESET_OFFLOAD */ -#if defined(CONFIG_PCI_HCI) - UpdateInterruptMask8188EE(Adapter, RT_BCN_INT_MASKS, 0, 0, 0); -#endif } } else /* (Adapter->hw_port == HW_PORT1)*/ #endif /* CONFIG_CONCURRENT_MODE */ @@ -3570,26 +3464,15 @@ static void hw_var_set_opmode(PADAPTER Adapter, u8 variable, u8 *val) #ifdef CONFIG_INTERRUPT_BASED_TXBCN #ifdef CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT rtw_write8(Adapter, REG_DRVERLYINT, 0x05);/* restore early int time to 5ms */ -#if defined(CONFIG_USB_HCI) UpdateInterruptMask8188EU(Adapter, _TRUE, 0, IMR_BCNDMAINT0_88E); -#elif defined(CONFIG_SDIO_HCI) - UpdateInterruptMask8188ESdio(Adapter, 0, SDIO_HIMR_BCNERLY_INT_MSK); -#endif #endif/* CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT */ #ifdef CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR -#if defined(CONFIG_USB_HCI) UpdateInterruptMask8188EU(Adapter, _TRUE , 0, (IMR_TBDER_88E | IMR_TBDOK_88E)); -#elif defined(CONFIG_SDIO_HCI) - UpdateInterruptMask8188ESdio(Adapter, 0, (SDIO_HIMR_TXBCNOK_MSK | SDIO_HIMR_TXBCNERR_MSK)); -#endif #endif /* CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR */ #endif /* CONFIG_INTERRUPT_BASED_TXBCN */ StopTxBeacon(Adapter); -#if defined(CONFIG_PCI_HCI) - UpdateInterruptMask8188EE(Adapter, 0, 0, RT_BCN_INT_MASKS, 0); -#endif } rtw_write8(Adapter, REG_BCN_CTRL, 0x19); /* disable atim wnd */ @@ -3605,19 +3488,11 @@ static void hw_var_set_opmode(PADAPTER Adapter, u8 variable, u8 *val) } else if (mode == _HW_STATE_AP_) { #ifdef CONFIG_INTERRUPT_BASED_TXBCN #ifdef CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT -#if defined(CONFIG_USB_HCI) UpdateInterruptMask8188EU(Adapter, _TRUE , IMR_BCNDMAINT0_88E, 0); -#elif defined(CONFIG_SDIO_HCI) - UpdateInterruptMask8188ESdio(Adapter, SDIO_HIMR_BCNERLY_INT_MSK, 0); -#endif #endif/* CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT */ #ifdef CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR -#if defined(CONFIG_USB_HCI) UpdateInterruptMask8188EU(Adapter, _TRUE , (IMR_TBDER_88E | IMR_TBDOK_88E), 0); -#elif defined(CONFIG_SDIO_HCI) - UpdateInterruptMask8188ESdio(Adapter, (SDIO_HIMR_TXBCNOK_MSK | SDIO_HIMR_TXBCNERR_MSK), 0); -#endif #endif/* CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR */ #endif /* CONFIG_INTERRUPT_BASED_TXBCN */ @@ -3689,9 +3564,6 @@ static void hw_var_set_opmode(PADAPTER Adapter, u8 variable, u8 *val) __func__, __LINE__); } #endif /* CONFIG_TSF_RESET_OFFLOAD */ -#if defined(CONFIG_PCI_HCI) - UpdateInterruptMask8188EE(Adapter, RT_BCN_INT_MASKS, 0, 0, 0); -#endif } #endif } @@ -4770,11 +4642,7 @@ GetHalDefVar8188E( *((u32 *)pValue) = DRVINFO_SZ; break; case HAL_DEF_MAX_RECVBUF_SZ: -#ifdef CONFIG_SDIO_HCI - *((u32 *)pValue) = MAX_RX_DMA_BUFFER_SIZE_88E(Adapter); -#else *((u32 *)pValue) = MAX_RECVBUF_SZ; -#endif break; case HAL_DEF_RX_PACKET_OFFSET: *((u32 *)pValue) = RXDESC_SIZE + DRVINFO_SZ * 8; diff --git a/hal/rtl8188e_phycfg.c b/hal/rtl8188e_phycfg.c index 9e15d6b..d936762 100644 --- a/hal/rtl8188e_phycfg.c +++ b/hal/rtl8188e_phycfg.c @@ -104,7 +104,7 @@ sic_CalculateBitShift( static u32 sic_Read4Byte( - PVOID Adapter, + Pvoid Adapter, u32 offset ) { @@ -153,9 +153,9 @@ sic_Read4Byte( return u4ret; } -static VOID +static void sic_Write4Byte( - PVOID Adapter, + Pvoid Adapter, u32 offset, u32 data ) @@ -198,7 +198,7 @@ sic_Write4Byte( /* ************************************************************ * extern function * ************************************************************ */ -static VOID +static void SIC_SetBBReg( IN PADAPTER Adapter, IN u32 RegAddr, @@ -279,7 +279,7 @@ SIC_QueryBBReg( return ReturnValue; } -VOID +void SIC_Init( IN PADAPTER Adapter ) @@ -378,7 +378,7 @@ PHY_QueryBBReg8188E( * Note: This function is equal to "PutRegSetting" in PHY programming guide */ -VOID +void PHY_SetBBReg8188E( IN PADAPTER Adapter, IN u32 RegAddr, @@ -558,7 +558,7 @@ phy_RFSerialRead( * * */ -static VOID +static void phy_RFSerialWrite( IN PADAPTER Adapter, IN u8 eRFPath, @@ -647,27 +647,11 @@ PHY_QueryRFReg8188E( #endif -#ifdef CONFIG_USB_HCI - /* PlatformAcquireMutex(&pHalData->mxRFOperate); */ -#else - /* _enter_critical(&pHalData->rf_lock, &irqL); */ -#endif - - Original_Value = phy_RFSerialRead(Adapter, eRFPath, RegAddr); BitShift = PHY_CalculateBitShift(BitMask); Readback_Value = (Original_Value & BitMask) >> BitShift; -#ifdef CONFIG_USB_HCI - /* PlatformReleaseMutex(&pHalData->mxRFOperate); */ -#else - /* _exit_critical(&pHalData->rf_lock, &irqL); */ -#endif - - - /* RTPRINT(FPHY, PHY_RFR, ("RFR-%d MASK=0x%lx Addr[0x%lx]=0x%lx\n", eRFPath, BitMask, RegAddr, Original_Value));//BitMask(%#lx),BitMask, */ - return Readback_Value; } @@ -689,7 +673,7 @@ PHY_QueryRFReg8188E( * Return: None * Note: This function is equal to "PutRFRegSetting" in PHY programming guide */ -VOID +void PHY_SetRFReg8188E( IN PADAPTER Adapter, IN u8 eRFPath, @@ -708,17 +692,6 @@ PHY_SetRFReg8188E( return; #endif - /* RTPRINT(FINIT, INIT_RF, ("phy_set_rf_reg(): RegAddr(%#lx), BitMask(%#lx), Data(%#lx), eRFPath(%#x)\n", */ - /* RegAddr, BitMask, Data, eRFPath)); */ - - -#ifdef CONFIG_USB_HCI - /* PlatformAcquireMutex(&pHalData->mxRFOperate); */ -#else - /* _enter_critical(&pHalData->rf_lock, &irqL); */ -#endif - - /* RF data is 12 bits only */ if (BitMask != bRFRegOffsetMask) { Original_Value = phy_RFSerialRead(Adapter, eRFPath, RegAddr); @@ -727,16 +700,6 @@ PHY_SetRFReg8188E( } phy_RFSerialWrite(Adapter, eRFPath, RegAddr, Data); - - -#ifdef CONFIG_USB_HCI - /* PlatformReleaseMutex(&pHalData->mxRFOperate); */ -#else - /* _exit_critical(&pHalData->rf_lock, &irqL); */ -#endif - - /* phy_query_rf_reg(Adapter,eRFPath,RegAddr,BitMask); */ - } @@ -805,7 +768,7 @@ s32 PHY_MACConfig8188E(PADAPTER Adapter) * Return: None * Note: The initialization value is constant and it should never be changes -----------------------------------------------------------------------------*/ -static VOID +static void phy_InitBBRFRegisterDefinition( IN PADAPTER Adapter ) @@ -848,7 +811,7 @@ phy_InitBBRFRegisterDefinition( } -static VOID +static void phy_BB8192C_Config_1T( IN PADAPTER Adapter ) @@ -989,47 +952,16 @@ PHY_BBConfig8188E( rtw_write8(Adapter, REG_RF_CTRL, RF_EN | RF_RSTB | RF_SDMRSTB); -#ifdef CONFIG_USB_HCI rtw_write8(Adapter, REG_SYS_FUNC_EN, FEN_USBA | FEN_USBD | FEN_BB_GLB_RSTn | FEN_BBRSTB); -#else - rtw_write8(Adapter, REG_SYS_FUNC_EN, FEN_PPLL | FEN_PCIEA | FEN_DIO_PCIE | FEN_BB_GLB_RSTn | FEN_BBRSTB); -#endif -#if 0 -#ifdef CONFIG_USB_HCI - /* To Fix MAC loopback mode fail. Suggested by SD4 Johnny. 2010.03.23. */ - rtw_write8(Adapter, REG_LDOHCI12_CTRL, 0x0f); - rtw_write8(Adapter, 0x15, 0xe9); -#endif - - rtw_write8(Adapter, REG_AFE_XTAL_CTRL + 1, 0x80); -#endif - -#ifdef CONFIG_USB_HCI - /* rtw_write8(Adapter, 0x15, 0xe9); */ -#endif - - -#ifdef CONFIG_PCI_HCI - /* Force use left antenna by default for 88C. */ - if (Adapter->ledpriv.LedStrategy != SW_LED_MODE10) { - RegVal = rtw_read32(Adapter, REG_LEDCFG0); - rtw_write32(Adapter, REG_LEDCFG0, RegVal | BIT23); - } -#endif - - /* */ /* Config BB and AGC */ - /* */ rtStatus = phy_BB8188E_Config_ParaFile(Adapter); hal_set_crystal_cap(Adapter, pHalData->crystal_cap); return rtStatus; - } - int PHY_RFConfig8188E( IN PADAPTER Adapter @@ -1038,30 +970,8 @@ PHY_RFConfig8188E( HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); int rtStatus = _SUCCESS; - /* */ /* RF config */ - /* */ rtStatus = PHY_RF6052_Config8188E(Adapter); -#if 0 - switch (pHalData->rf_chip) { - case RF_6052: - rtStatus = PHY_RF6052_Config(Adapter); - break; - case RF_8225: - rtStatus = PHY_RF8225_Config(Adapter); - break; - case RF_8256: - rtStatus = PHY_RF8256_Config(Adapter); - break; - case RF_8258: - break; - case RF_PSEUDO_11N: - rtStatus = PHY_RF8225_Config(Adapter); - break; - default: /* for MacOs Warning: "RF_TYPE_MIN" not handled in switch */ - break; - } -#endif return rtStatus; } @@ -1130,7 +1040,7 @@ static u32 Rtl8192S_HighPower_RadioA_Array[HighPowerRadioAArrayLen] = { * Return: NONE * *---------------------------------------------------------------------------*/ -VOID +void PHY_GetTxPowerLevel8188E( IN PADAPTER Adapter, OUT s32 *powerlevel @@ -1165,7 +1075,7 @@ PHY_GetTxPowerLevel8188E( * 2009/01/21 MHC Support new EEPROM format from SD3 requirement. * *---------------------------------------------------------------------------*/ -VOID +void PHY_SetTxPowerLevel8188E( IN PADAPTER Adapter, IN u8 Channel @@ -1178,7 +1088,7 @@ PHY_SetTxPowerLevel8188E( /* RTW_INFO("<==PHY_SetTxPowerLevel8188E()\n"); */ } -VOID +void PHY_SetTxPowerIndex_8188E( IN PADAPTER Adapter, IN u32 PowerIndex, @@ -1546,7 +1456,7 @@ phy_SpurCalibration_8188E( * (2) Will two workitem of "switch channel" and "switch channel bandwidth" run * concurrently? *---------------------------------------------------------------------------*/ -static VOID +static void _PHY_SetBWMode88E( IN PADAPTER Adapter ) @@ -1698,7 +1608,7 @@ _PHY_SetBWMode88E( * * Note: We do not take j mode into consideration now * *--------------------------------------------------------------------------- */ #endif -VOID +void PHY_SetBWMode8188E( IN PADAPTER Adapter, IN CHANNEL_WIDTH Bandwidth, /* 20M or 40M */ @@ -1744,15 +1654,9 @@ PHY_SetBWMode8188E( #endif if (!RTW_CANNOT_RUN(Adapter)) { -#if 0 - /* PlatformSetTimer(Adapter, &(pHalData->SetBWModeTimer), 0); */ -#else _PHY_SetBWMode88E(Adapter); -#endif -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) if (IS_VENDOR_8188E_I_CUT_SERIES(Adapter)) phy_SpurCalibration_8188E(Adapter); -#endif } else { /* pHalData->SetBWModeInProgress= FALSE; */ pHalData->current_channel_bw = tmpBW; @@ -1785,27 +1689,18 @@ static void _PHY_SwChnl8188E(PADAPTER Adapter, u8 channel) /* s3. post common command - CmdID_End, None */ } -VOID +void PHY_SwChnl8188E(/* Call after initialization */ IN PADAPTER Adapter, IN u8 channel ) { - /* PADAPTER Adapter = ADJUST_TO_ADAPTIVE_ADAPTER(pAdapter, _TRUE); */ HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); u8 tmpchannel = pHalData->current_channel; BOOLEAN bResult = _TRUE; - if (pHalData->rf_chip == RF_PSEUDO_11N) { - /* pHalData->SwChnlInProgress=FALSE; */ + if (pHalData->rf_chip == RF_PSEUDO_11N) return; /* return immediately if it is peudo-phy */ - } - - /* if(pHalData->SwChnlInProgress) */ - /* return; */ - - /* if(pHalData->SetBWModeInProgress) */ - /* return; */ while (pHalData->odmpriv.rf_calibrate_info.is_lck_in_progress) rtw_msleep_os(50); @@ -1814,65 +1709,38 @@ PHY_SwChnl8188E(/* Call after initialization */ switch (pHalData->CurrentWirelessMode) { case WIRELESS_MODE_A: case WIRELESS_MODE_N_5G: - /* RT_ASSERT((channel>14), ("WIRELESS_MODE_A but channel<=14")); */ break; - case WIRELESS_MODE_B: - /* RT_ASSERT((channel<=14), ("WIRELESS_MODE_B but channel>14")); */ break; - case WIRELESS_MODE_G: case WIRELESS_MODE_N_24G: - /* RT_ASSERT((channel<=14), ("WIRELESS_MODE_G but channel>14")); */ break; - default: - /* RT_ASSERT(FALSE, ("Invalid WirelessMode(%#x)!!\n", pHalData->CurrentWirelessMode)); */ break; } /* -------------------------------------------- */ - /* pHalData->SwChnlInProgress = TRUE; */ if (channel == 0) channel = 1; pHalData->current_channel = channel; - /* pHalData->SwChnlStage=0; */ - /* pHalData->SwChnlStep=0; */ - if (!RTW_CANNOT_RUN(Adapter)) { -#if 0 - /* PlatformSetTimer(Adapter, &(pHalData->SwChnlTimer), 0); */ -#else _PHY_SwChnl8188E(Adapter, channel); -#endif -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) if (IS_VENDOR_8188E_I_CUT_SERIES(Adapter)) phy_SpurCalibration_8188E(Adapter); -#endif - if (!bResult) { - /* if(IS_HARDWARE_TYPE_8192SU(Adapter)) */ - /* { */ - /* pHalData->SwChnlInProgress = FALSE; */ + if (!bResult) pHalData->current_channel = tmpchannel; - /* } */ - } - } else { - /* if(IS_HARDWARE_TYPE_8192SU(Adapter)) */ - /* { */ - /* pHalData->SwChnlInProgress = FALSE; */ pHalData->current_channel = tmpchannel; - /* } */ } } -VOID +void PHY_SetSwChnlBWMode8188E( IN PADAPTER Adapter, IN u8 channel, @@ -1889,7 +1757,7 @@ PHY_SetSwChnlBWMode8188E( /* RTW_INFO("<==%s()\n",__func__); */ } -static VOID _PHY_SetRFPathSwitch( +static void _PHY_SetRFPathSwitch( IN PADAPTER pAdapter, IN BOOLEAN bMain, IN BOOLEAN is2T @@ -1948,7 +1816,7 @@ static BOOLEAN _PHY_QueryRFPathSwitch( } -static VOID +static void _PHY_DumpRFReg(IN PADAPTER pAdapter) { u32 rfRegValue, rfRegOffset; @@ -1967,7 +1835,6 @@ _PHY_DumpRFReg(IN PADAPTER pAdapter) * Move from phycfg.c to gen.c to be code independent later * * -------------------------Move to other DIR later---------------------------- */ -#ifdef CONFIG_USB_HCI /* * Description: @@ -1990,9 +1857,8 @@ static void DumpBBDbgPort_92CU(PADAPTER Adapter) phy_set_bb_reg(Adapter, 0x0908, 0xffff, 0x0100); phy_set_bb_reg(Adapter, 0x0a28, 0x00ff0000, 0x00150000); } -#endif -VOID +void PHY_SetRFEReg_8188E( IN PADAPTER Adapter ) diff --git a/hal/rtl8188e_sreset.c b/hal/rtl8188e_sreset.c index 299e2c1..4f48097 100644 --- a/hal/rtl8188e_sreset.c +++ b/hal/rtl8188e_sreset.c @@ -39,10 +39,6 @@ void rtl8188e_sreset_xmit_status_check(_adapter *padapter) RTW_INFO("%s REG_TXDMA_STATUS:0x%08x\n", __func__, txdma_status); rtw_hal_sreset_reset(padapter); } -#ifdef CONFIG_USB_HCI - /* total xmit irp = 4 */ - /* RTW_INFO("==>%s free_xmitbuf_cnt(%d),txirp_cnt(%d)\n",__func__,pxmitpriv->free_xmitbuf_cnt,pxmitpriv->txirp_cnt); */ - /* if(pxmitpriv->txirp_cnt == NR_XMITBUFF+1) */ current_time = rtw_get_current_time(); if (0 == pxmitpriv->free_xmitbuf_cnt || 0 == pxmitpriv->free_xmit_extbuf_cnt) { @@ -68,7 +64,6 @@ void rtl8188e_sreset_xmit_status_check(_adapter *padapter) } } } -#endif /* CONFIG_USB_HCI */ if (psrtpriv->dbg_trigger_point == SRESET_TGP_XMIT_STATUS) { psrtpriv->dbg_trigger_point = SRESET_TGP_NULL; diff --git a/hal/rtl8188eu_xmit.c b/hal/rtl8188eu_xmit.c index 6cc9b43..f7d37d1 100644 --- a/hal/rtl8188eu_xmit.c +++ b/hal/rtl8188eu_xmit.c @@ -139,12 +139,9 @@ void rtl8188e_fill_fake_txdesc( break; } } - -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) /* USB interface drop packet if the checksum of descriptor isn't correct. */ /* Using this checksum can let hardware recovery from packet bulk out error (e.g. Cancel URC, Bulk out error.). */ rtl8188eu_cal_txdesc_chksum(ptxdesc); -#endif } static void fill_txdesc_sectype(struct pkt_attrib *pattrib, struct tx_desc *ptxdesc) diff --git a/hal/usb_halinit.c b/hal/usb_halinit.c index ab29bc7..bf826bc 100644 --- a/hal/usb_halinit.c +++ b/hal/usb_halinit.c @@ -23,12 +23,6 @@ #include #include "hal_com_h2c.h" -#ifndef CONFIG_USB_HCI - - #error "CONFIG_USB_HCI shall be on!\n" - -#endif - static VOID _ConfigNormalChipOutEP_8188E( IN PADAPTER pAdapter, @@ -1790,14 +1784,6 @@ readAdapterInfo_8188EU( Hal_ReadRFGainOffset(padapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag); #endif /*CONFIG_RF_POWER_TRIM*/ - /* */ - /* The following part initialize some vars by PG info. */ - /* */ - -#if defined(CONFIG_WOWLAN) && defined(CONFIG_SDIO_HCI) - Hal_DetectWoWMode(padapter); -#endif /* CONFIG_WOWLAN && CONFIG_SDIO_HCI */ - Hal_CustomizeByCustomerID_8188EU(padapter); _ReadLEDSetting(padapter, pHalData->efuse_eeprom_data, pHalData->bautoload_fail_flag);