From 9bfd2a355662a1691ad763296593523e520b3b4b Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sat, 3 Nov 2018 21:23:01 -0500 Subject: [PATCH] rtl8188eu: Remove code used bhy devices other than USB in core/ Signed-off-by: Larry Finger --- core/rtw_ap.c | 11 +-- core/rtw_debug.c | 138 ----------------------------- core/rtw_io.c | 206 -------------------------------------------- core/rtw_iol.c | 2 - core/rtw_mi.c | 72 ---------------- core/rtw_mlme.c | 5 -- core/rtw_mlme_ext.c | 4 - core/rtw_pwrctrl.c | 8 -- core/rtw_recv.c | 92 +------------------- core/rtw_sreset.c | 6 -- core/rtw_xmit.c | 98 +-------------------- include/autoconf.h | 2 - 12 files changed, 5 insertions(+), 639 deletions(-) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 69a7885..506af23 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -1413,7 +1413,6 @@ update_beacon: /*update_beacon(padapter, _TIM_IE_, NULL, _TRUE);*/ #if !defined(CONFIG_INTERRUPT_BASED_TXBCN) -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) #ifdef CONFIG_SWTIMER_BASED_TXBCN if (pdvobj->nr_ap_if == 1) { RTW_INFO("start SW BCN TIMER!\n"); @@ -1424,7 +1423,6 @@ update_beacon: if (send_beacon(padapter) == _FAIL) RTW_INFO("issue_beacon, fail!\n"); #endif -#endif #endif /* !defined(CONFIG_INTERRUPT_BASED_TXBCN) */ } @@ -2628,7 +2626,7 @@ static void update_bcn_wps_ie(_adapter *padapter) rtw_mfree(pbackup_remainder_ie, remainder_ielen); /* deal with the case without set_tx_beacon_cmd() in update_beacon() */ -#if defined(CONFIG_INTERRUPT_BASED_TXBCN) || defined(CONFIG_PCI_HCI) +#if defined(CONFIG_INTERRUPT_BASED_TXBCN) if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) { u8 sr = 0; rtw_get_wps_attr_content(pwps_ie_src, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL); @@ -2746,20 +2744,13 @@ void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *ta _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); #ifndef CONFIG_INTERRUPT_BASED_TXBCN -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) if (tx) { /* send_beacon(padapter); */ /* send_beacon must execute on TSR level */ if (0) RTW_INFO(FUNC_ADPT_FMT" ie_id:%u - %s\n", FUNC_ADPT_ARG(padapter), ie_id, tag); set_tx_beacon_cmd(padapter); } -#else - { - /* PCI will issue beacon when BCN interrupt occurs. */ - } -#endif #endif /* !CONFIG_INTERRUPT_BASED_TXBCN */ - } #ifdef CONFIG_80211N_HT diff --git a/core/rtw_debug.c b/core/rtw_debug.c index fae45c6..47e8e4b 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -134,7 +134,6 @@ void dump_drv_cfg(void *sel) RTW_PRINT_SEL(sel, "CONFIG_RTW_80211R\n"); #endif -#ifdef CONFIG_USB_HCI #ifdef CONFIG_SUPPORT_USB_INT RTW_PRINT_SEL(sel, "CONFIG_SUPPORT_USB_INT\n"); #endif @@ -159,23 +158,8 @@ void dump_drv_cfg(void *sel) #ifdef CONFIG_FIX_NR_BULKIN_BUFFER RTW_PRINT_SEL(sel, "CONFIG_FIX_NR_BULKIN_BUFFER\n"); #endif -#endif /*CONFIG_USB_HCI*/ - -#ifdef CONFIG_SDIO_HCI -#ifdef CONFIG_TX_AGGREGATION - RTW_PRINT_SEL(sel, "CONFIG_TX_AGGREGATION\n"); -#endif -#ifdef CONFIG_RX_AGGREGATION - RTW_PRINT_SEL(sel, "CONFIG_RX_AGGREGATION\n"); -#endif -#endif /*CONFIG_SDIO_HCI*/ - -#ifdef CONFIG_PCI_HCI -#endif - RTW_PRINT_SEL(sel, "MAX_XMITBUF_SZ = %d\n", MAX_XMITBUF_SZ); RTW_PRINT_SEL(sel, "MAX_RECVBUF_SZ = %d\n", MAX_RECVBUF_SZ); - } void dump_log_level(void *sel) @@ -194,38 +178,6 @@ void dump_log_level(void *sel) #endif } -#ifdef CONFIG_SDIO_HCI -void sd_f0_reg_dump(void *sel, _adapter *adapter) -{ - int i; - - for (i = 0x0; i <= 0xff; i++) { - if (i % 16 == 0) - RTW_PRINT_SEL(sel, "0x%02x ", i); - - _RTW_PRINT_SEL(sel, "%02x ", rtw_sd_f0_read8(adapter, i)); - - if (i % 16 == 15) - _RTW_PRINT_SEL(sel, "\n"); - else if (i % 8 == 7) - _RTW_PRINT_SEL(sel, "\t"); - } -} - -void sdio_local_reg_dump(void *sel, _adapter *adapter) -{ - int i, j = 1; - - for (i = 0x0; i < 0x100; i += 4) { - if (j % 4 == 1) - RTW_PRINT_SEL(sel, "0x%02x", i); - _RTW_PRINT_SEL(sel, " 0x%08x ", rtw_read32(adapter, (0x1025 << 16) | i)); - if ((j++) % 4 == 0) - _RTW_PRINT_SEL(sel, "\n"); - } -} -#endif /* CONFIG_SDIO_HCI */ - void mac_reg_dump(void *sel, _adapter *adapter) { int i, j = 1; @@ -1527,9 +1479,7 @@ int proc_get_trx_info(struct seq_file *m, void *v) RTW_PRINT_SEL(m, "%d, hwq.accnt=%d\n", i, phwxmit->accnt); } -#ifdef CONFIG_USB_HCI RTW_PRINT_SEL(m, "rx_urb_pending_cn=%d\n", ATOMIC_READ(&(precvpriv->rx_pending_cnt))); -#endif /* Folowing are RX info */ /* Counts of packets whose seq_num is less than preorder_ctrl->indicate_seq, Ex delay, retransmission, redundant packets and so on */ @@ -3480,94 +3430,6 @@ ssize_t proc_set_sreset(struct file *file, const char __user *buffer, size_t cou } #endif /* DBG_CONFIG_ERROR_DETECT */ -#ifdef CONFIG_PCI_HCI - -int proc_get_rx_ring(struct seq_file *m, void *v) -{ - _irqL irqL; - struct net_device *dev = m->private; - _adapter *padapter = (_adapter *) rtw_netdev_priv(dev); - struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); - struct recv_priv *precvpriv = &padapter->recvpriv; - struct rtw_rx_ring *rx_ring = &precvpriv->rx_ring[RX_MPDU_QUEUE]; - int i, j; - - RTW_PRINT_SEL(m, "rx ring (%p)\n", rx_ring); - RTW_PRINT_SEL(m, " dma: 0x%08x\n", (int) rx_ring->dma); - RTW_PRINT_SEL(m, " idx: %d\n", rx_ring->idx); - - _enter_critical(&pdvobjpriv->irq_th_lock, &irqL); - for (i = 0; i < precvpriv->rxringcount; i++) { -#ifdef CONFIG_TRX_BD_ARCH - struct rx_buf_desc *entry = &rx_ring->buf_desc[i]; -#else - struct recv_stat *entry = &rx_ring->desc[i]; -#endif - struct sk_buff *skb = rx_ring->rx_buf[i]; - - RTW_PRINT_SEL(m, " desc[%03d]: %p, rx_buf[%03d]: 0x%08x\n", - i, entry, i, cpu_to_le32(*((dma_addr_t *)skb->cb))); - - for (j = 0; j < sizeof(*entry) / 4; j++) { - if ((j % 4) == 0) - RTW_PRINT_SEL(m, " 0x%03x", j); - - RTW_PRINT_SEL(m, " 0x%08x ", ((int *) entry)[j]); - - if ((j % 4) == 3) - RTW_PRINT_SEL(m, "\n"); - } - } - _exit_critical(&pdvobjpriv->irq_th_lock, &irqL); - - return 0; -} - -int proc_get_tx_ring(struct seq_file *m, void *v) -{ - _irqL irqL; - struct net_device *dev = m->private; - _adapter *padapter = (_adapter *) rtw_netdev_priv(dev); - struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); - struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - int i, j, k; - - _enter_critical(&pdvobjpriv->irq_th_lock, &irqL); - for (i = 0; i < PCI_MAX_TX_QUEUE_COUNT; i++) { - struct rtw_tx_ring *tx_ring = &pxmitpriv->tx_ring[i]; - - RTW_PRINT_SEL(m, "tx ring[%d] (%p)\n", i, tx_ring); - RTW_PRINT_SEL(m, " dma: 0x%08x\n", (int) tx_ring->dma); - RTW_PRINT_SEL(m, " idx: %d\n", tx_ring->idx); - RTW_PRINT_SEL(m, " entries: %d\n", tx_ring->entries); - /* RTW_PRINT_SEL(m, " queue: %d\n", tx_ring->queue); */ - RTW_PRINT_SEL(m, " qlen: %d\n", tx_ring->qlen); - - for (j = 0; j < pxmitpriv->txringcount[i]; j++) { -#ifdef CONFIG_TRX_BD_ARCH - struct tx_buf_desc *entry = &tx_ring->buf_desc[j]; -#else - struct tx_desc *entry = &tx_ring->desc[j]; -#endif - - RTW_PRINT_SEL(m, " desc[%03d]: %p\n", j, entry); - for (k = 0; k < sizeof(*entry) / 4; k++) { - if ((k % 4) == 0) - RTW_PRINT_SEL(m, " 0x%03x", k); - - RTW_PRINT_SEL(m, " 0x%08x ", ((int *) entry)[k]); - - if ((k % 4) == 3) - RTW_PRINT_SEL(m, "\n"); - } - } - } - _exit_critical(&pdvobjpriv->irq_th_lock, &irqL); - - return 0; -} -#endif - #ifdef CONFIG_WOWLAN int proc_get_pattern_info(struct seq_file *m, void *v) { diff --git a/core/rtw_io.c b/core/rtw_io.c index b75fb6b..64ad941 100644 --- a/core/rtw_io.c +++ b/core/rtw_io.c @@ -30,17 +30,8 @@ c. provides the software interface between caller and the hardware interface Compiler Flag Option: -1. CONFIG_SDIO_HCI: - a. USE_SYNC_IRP: Only sync operations are provided. - b. USE_ASYNC_IRP:Both sync/async operations are provided. - 2. CONFIG_USB_HCI: a. USE_ASYNC_IRP: Both sync/async operations are provided. - -3. CONFIG_CFIO_HCI: - b. USE_SYNC_IRP: Only sync operations are provided. - - Only sync read/rtw_write_mem operations are provided. jackson@realtek.com.tw @@ -52,18 +43,10 @@ jackson@realtek.com.tw #include #include -#ifdef CONFIG_SDIO_HCI - #define rtw_le16_to_cpu(val) val - #define rtw_le32_to_cpu(val) val - #define rtw_cpu_to_le16(val) val - #define rtw_cpu_to_le32(val) val -#else #define rtw_le16_to_cpu(val) le16_to_cpu(val) #define rtw_le32_to_cpu(val) le32_to_cpu(val) #define rtw_cpu_to_le16(val) cpu_to_le16(val) #define rtw_cpu_to_le32(val) cpu_to_le32(val) -#endif - u8 _rtw_read8(_adapter *adapter, u32 addr) { @@ -160,130 +143,6 @@ int _rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *pdata) return RTW_STATUS_CODE(ret); } -#ifdef CONFIG_SDIO_HCI -u8 _rtw_sd_f0_read8(_adapter *adapter, u32 addr) -{ - u8 r_val = 0x00; - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &(pio_priv->intf); - u8(*_sd_f0_read8)(struct intf_hdl *pintfhdl, u32 addr); - - _sd_f0_read8 = pintfhdl->io_ops._sd_f0_read8; - - if (_sd_f0_read8) - r_val = _sd_f0_read8(pintfhdl, addr); - else - RTW_WARN(FUNC_ADPT_FMT" _sd_f0_read8 callback is NULL\n", FUNC_ADPT_ARG(adapter)); - - return r_val; -} - -#ifdef CONFIG_SDIO_INDIRECT_ACCESS -u8 _rtw_sd_iread8(_adapter *adapter, u32 addr) -{ - u8 r_val = 0x00; - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &(pio_priv->intf); - u8(*_sd_iread8)(struct intf_hdl *pintfhdl, u32 addr); - - _sd_iread8 = pintfhdl->io_ops._sd_iread8; - - if (_sd_iread8) - r_val = _sd_iread8(pintfhdl, addr); - else - RTW_ERR(FUNC_ADPT_FMT" _sd_iread8 callback is NULL\n", FUNC_ADPT_ARG(adapter)); - - return r_val; -} - -u16 _rtw_sd_iread16(_adapter *adapter, u32 addr) -{ - u16 r_val = 0x00; - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &(pio_priv->intf); - u16(*_sd_iread16)(struct intf_hdl *pintfhdl, u32 addr); - - _sd_iread16 = pintfhdl->io_ops._sd_iread16; - - if (_sd_iread16) - r_val = _sd_iread16(pintfhdl, addr); - else - RTW_ERR(FUNC_ADPT_FMT" _sd_iread16 callback is NULL\n", FUNC_ADPT_ARG(adapter)); - - return r_val; -} - -u32 _rtw_sd_iread32(_adapter *adapter, u32 addr) -{ - u32 r_val = 0x00; - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &(pio_priv->intf); - u32(*_sd_iread32)(struct intf_hdl *pintfhdl, u32 addr); - - _sd_iread32 = pintfhdl->io_ops._sd_iread32; - - if (_sd_iread32) - r_val = _sd_iread32(pintfhdl, addr); - else - RTW_ERR(FUNC_ADPT_FMT" _sd_iread32 callback is NULL\n", FUNC_ADPT_ARG(adapter)); - - return r_val; -} - -int _rtw_sd_iwrite8(_adapter *adapter, u32 addr, u8 val) -{ - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &(pio_priv->intf); - int (*_sd_iwrite8)(struct intf_hdl *pintfhdl, u32 addr, u8 val); - int ret = -1; - - _sd_iwrite8 = pintfhdl->io_ops._sd_iwrite8; - - if (_sd_iwrite8) - ret = _sd_iwrite8(pintfhdl, addr, val); - else - RTW_ERR(FUNC_ADPT_FMT" _sd_iwrite8 callback is NULL\n", FUNC_ADPT_ARG(adapter)); - - return RTW_STATUS_CODE(ret); -} - -int _rtw_sd_iwrite16(_adapter *adapter, u32 addr, u16 val) -{ - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &(pio_priv->intf); - int (*_sd_iwrite16)(struct intf_hdl *pintfhdl, u32 addr, u16 val); - int ret = -1; - - _sd_iwrite16 = pintfhdl->io_ops._sd_iwrite16; - - if (_sd_iwrite16) - ret = _sd_iwrite16(pintfhdl, addr, val); - else - RTW_ERR(FUNC_ADPT_FMT" _sd_iwrite16 callback is NULL\n", FUNC_ADPT_ARG(adapter)); - - return RTW_STATUS_CODE(ret); -} -int _rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val) -{ - struct io_priv *pio_priv = &adapter->iopriv; - struct intf_hdl *pintfhdl = &(pio_priv->intf); - int (*_sd_iwrite32)(struct intf_hdl *pintfhdl, u32 addr, u32 val); - int ret = -1; - - _sd_iwrite32 = pintfhdl->io_ops._sd_iwrite32; - - if (_sd_iwrite32) - ret = _sd_iwrite32(pintfhdl, addr, val); - else - RTW_ERR(FUNC_ADPT_FMT" _sd_iwrite32 callback is NULL\n", FUNC_ADPT_ARG(adapter)); - - return RTW_STATUS_CODE(ret); -} - -#endif /* CONFIG_SDIO_INDIRECT_ACCESS */ - -#endif /* CONFIG_SDIO_HCI */ - int _rtw_write8_async(_adapter *adapter, u32 addr, u8 val) { /* struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue; */ @@ -627,69 +486,4 @@ int dbg_rtw_writeN(_adapter *adapter, u32 addr , u32 length , u8 *data, const ch return _rtw_writeN(adapter, addr, length, data); } -#ifdef CONFIG_SDIO_HCI -u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const int line) -{ - u8 val = _rtw_sd_f0_read8(adapter, addr); - - return val; -} - -#ifdef CONFIG_SDIO_INDIRECT_ACCESS -u8 dbg_rtw_sd_iread8(_adapter *adapter, u32 addr, const char *caller, const int line) -{ - u8 val = rtw_sd_iread8(adapter, addr); - - if (match_read_sniff_ranges(addr, 1)) - RTW_INFO("DBG_IO %s:%d rtw_sd_iread8(0x%04x) return 0x%02x\n", caller, line, addr, val); - - return val; -} - -u16 dbg_rtw_sd_iread16(_adapter *adapter, u32 addr, const char *caller, const int line) -{ - u16 val = _rtw_sd_iread16(adapter, addr); - - if (match_read_sniff_ranges(addr, 2)) - RTW_INFO("DBG_IO %s:%d rtw_sd_iread16(0x%04x) return 0x%04x\n", caller, line, addr, val); - - return val; -} - -u32 dbg_rtw_sd_iread32(_adapter *adapter, u32 addr, const char *caller, const int line) -{ - u32 val = _rtw_sd_iread32(adapter, addr); - - if (match_read_sniff_ranges(addr, 4)) - RTW_INFO("DBG_IO %s:%d rtw_sd_iread32(0x%04x) return 0x%08x\n", caller, line, addr, val); - - return val; -} - -int dbg_rtw_sd_iwrite8(_adapter *adapter, u32 addr, u8 val, const char *caller, const int line) -{ - if (match_write_sniff_ranges(addr, 1)) - RTW_INFO("DBG_IO %s:%d rtw_sd_iwrite8(0x%04x, 0x%02x)\n", caller, line, addr, val); - - return _rtw_sd_iwrite8(adapter, addr, val); -} -int dbg_rtw_sd_iwrite16(_adapter *adapter, u32 addr, u16 val, const char *caller, const int line) -{ - if (match_write_sniff_ranges(addr, 2)) - RTW_INFO("DBG_IO %s:%d rtw_sd_iwrite16(0x%04x, 0x%04x)\n", caller, line, addr, val); - - return _rtw_sd_iwrite16(adapter, addr, val); -} -int dbg_rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val, const char *caller, const int line) -{ - if (match_write_sniff_ranges(addr, 4)) - RTW_INFO("DBG_IO %s:%d rtw_sd_iwrite32(0x%04x, 0x%08x)\n", caller, line, addr, val); - - return _rtw_sd_iwrite32(adapter, addr, val); -} - -#endif /* CONFIG_SDIO_INDIRECT_ACCESS */ - -#endif /* CONFIG_SDIO_HCI */ - #endif diff --git a/core/rtw_iol.c b/core/rtw_iol.c index 66c32e4..e154fe5 100644 --- a/core/rtw_iol.c +++ b/core/rtw_iol.c @@ -101,10 +101,8 @@ bool rtw_IOL_applied(ADAPTER *adapter) if (1 == adapter->registrypriv.fw_iol) return _TRUE; -#ifdef CONFIG_USB_HCI if ((2 == adapter->registrypriv.fw_iol) && (IS_FULL_SPEED_USB(adapter))) return _TRUE; -#endif return _FALSE; } diff --git a/core/rtw_mi.c b/core/rtw_mi.c index 1ebff73..62a5cd2 100644 --- a/core/rtw_mi.c +++ b/core/rtw_mi.c @@ -648,25 +648,6 @@ void rtw_mi_buddy_hal_dump_macaddr(_adapter *padapter) _rtw_mi_process(padapter, _TRUE, NULL, _rtw_mi_hal_dump_macaddr); } -#ifdef CONFIG_PCI_HCI -static u8 _rtw_mi_xmit_tasklet_schedule(_adapter *padapter, void *data) -{ - if (rtw_txframes_pending(padapter)) { - /* try to deal with the pending packets */ - tasklet_hi_schedule(&(padapter->xmitpriv.xmit_tasklet)); - } - return _TRUE; -} -void rtw_mi_xmit_tasklet_schedule(_adapter *padapter) -{ - _rtw_mi_process(padapter, _FALSE, NULL, _rtw_mi_xmit_tasklet_schedule); -} -void rtw_mi_buddy_xmit_tasklet_schedule(_adapter *padapter) -{ - _rtw_mi_process(padapter, _TRUE, NULL, _rtw_mi_xmit_tasklet_schedule); -} -#endif - static u8 _rtw_mi_busy_traffic_check(_adapter *padapter, void *data) { u32 passtime; @@ -835,35 +816,6 @@ u8 rtw_mi_buddy_check_pending_xmitbuf(_adapter *padapter) } #endif -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -static u8 _rtw_mi_dequeue_writeport(_adapter *padapter , bool exclude_self) -{ - int i; - u8 queue_empty = _TRUE; - _adapter *iface; - struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); - - for (i = 0; i < dvobj->iface_nums; i++) { - iface = dvobj->padapters[i]; - if ((iface) && rtw_is_adapter_up(iface)) { - - if ((exclude_self) && (iface == padapter)) - continue; - - queue_empty &= _dequeue_writeport(iface); - } - } - return queue_empty; -} -u8 rtw_mi_dequeue_writeport(_adapter *padapter) -{ - return _rtw_mi_dequeue_writeport(padapter, _FALSE); -} -u8 rtw_mi_buddy_dequeue_writeport(_adapter *padapter) -{ - return _rtw_mi_dequeue_writeport(padapter, _TRUE); -} -#endif static void _rtw_mi_adapter_reset(_adapter *padapter , u8 exclude_self) { int i; @@ -989,9 +941,7 @@ static u8 _rtw_mi_tx_beacon_hdl(_adapter *adapter, void *data) ) { adapter->mlmepriv.update_bcn = _TRUE; #ifndef CONFIG_INTERRUPT_BASED_TXBCN -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) tx_beacon_hdl(adapter, NULL); -#endif #endif } return _TRUE; @@ -1238,28 +1188,6 @@ void rtw_mi_buddy_clone_bcmc_packet(_adapter *padapter, union recv_frame *precvf } -#ifdef CONFIG_PCI_HCI -/*API be created temporary for MI, caller is interrupt-handler, PCIE's interrupt handler cannot apply to multi-AP*/ -_adapter *rtw_mi_get_ap_adapter(_adapter *padapter) -{ - struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); - int i; - _adapter *iface = NULL; - - for (i = 0; i < dvobj->iface_nums; i++) { - iface = dvobj->padapters[i]; - if (!iface) - continue; - - if (check_fwstate(&iface->mlmepriv, WIFI_AP_STATE) == _TRUE - && check_fwstate(&iface->mlmepriv, WIFI_ASOC_STATE) == _TRUE) - break; - - } - return iface; -} -#endif - void rtw_mi_update_ap_bmc_camid(_adapter *padapter, u8 camid_a, u8 camid_b) { #ifdef CONFIG_CONCURRENT_MODE diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index b610a62..39e39e4 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -3790,7 +3790,6 @@ void rtw_joinbss_reset(_adapter *padapter) phtpriv->ampdu_enable = _FALSE;/* reset to disabled */ -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) /* TH=1 => means that invalidate usb rx aggregation */ /* TH=0 => means that validate usb rx aggregation, use init value. */ if (phtpriv->ht_option) { @@ -3803,13 +3802,9 @@ void rtw_joinbss_reset(_adapter *padapter) threshold = 1; rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold)); } -#endif/* #if defined( CONFIG_USB_HCI) || defined (CONFIG_SDIO_HCI) */ - #endif/* #ifdef CONFIG_80211N_HT */ - } - #ifdef CONFIG_80211N_HT void rtw_ht_use_default_setting(_adapter *padapter) { diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index c2d13dc..3f53842 100755 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -10529,7 +10529,6 @@ unsigned int send_beacon(_adapter *padapter) return _SUCCESS; #endif -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) u32 start = rtw_get_current_time(); rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL); @@ -10564,9 +10563,6 @@ unsigned int send_beacon(_adapter *padapter) return _SUCCESS; } - -#endif - } /**************************************************************************** diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index 7efd7f6..53346ce 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -1332,9 +1332,7 @@ void LPS_Leave_check( if (rtw_is_surprise_removed(padapter) || (!rtw_is_hw_init_completed(padapter)) -#ifdef CONFIG_USB_HCI || rtw_is_drv_stopped(padapter) -#endif || (pwrpriv->pwr_mode == PS_MODE_ACTIVE) ) bReady = _TRUE; @@ -2208,9 +2206,7 @@ void rtw_unregister_early_suspend(struct pwrctrl_priv *pwrpriv) #endif /* CONFIG_HAS_EARLYSUSPEND */ #ifdef CONFIG_ANDROID_POWER -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) extern int rtw_resume_process(PADAPTER padapter); -#endif static void rtw_early_suspend(android_early_suspend_t *h) { struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend); @@ -2227,10 +2223,8 @@ static void rtw_late_resume(android_early_suspend_t *h) RTW_INFO("%s\n", __func__); if (pwrpriv->do_late_resume) { -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) rtw_set_do_late_resume(pwrpriv, _FALSE); rtw_resume_process(adapter); -#endif } } @@ -2372,7 +2366,6 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) } if (rf_off == pwrpriv->rf_pwrstate) { -#ifdef CONFIG_USB_HCI #ifdef CONFIG_AUTOSUSPEND if (pwrpriv->brfoffbyhw == _TRUE) { RTW_INFO("hw still in rf_off state ...........\n"); @@ -2386,7 +2379,6 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) goto exit; } } else -#endif #endif { #ifdef CONFIG_IPS diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 711b675..9026bce 100755 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -130,13 +130,9 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter) } -#ifdef CONFIG_USB_HCI + ATOMIC_SET(&(precvpriv->rx_pending_cnt), 1); - ATOMIC_SET(&(precvpriv->rx_pending_cnt), 1); - - _rtw_init_sema(&precvpriv->allrxreturnevt, 0); - -#endif + _rtw_init_sema(&precvpriv->allrxreturnevt, 0); res = rtw_hal_init_recv_priv(padapter); @@ -409,29 +405,20 @@ sint rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, _queue *queue) rtw_list_insert_head(&precvbuf->list, get_list_head(queue)); _exit_critical_bh(&queue->lock, &irqL); - return _SUCCESS; } sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue) { _irqL irqL; -#ifdef CONFIG_SDIO_HCI - _enter_critical_bh(&queue->lock, &irqL); -#else + _enter_critical_ex(&queue->lock, &irqL); -#endif/*#ifdef CONFIG_SDIO_HCI*/ rtw_list_delete(&precvbuf->list); rtw_list_insert_tail(&precvbuf->list, get_list_head(queue)); -#ifdef CONFIG_SDIO_HCI - _exit_critical_bh(&queue->lock, &irqL); -#else _exit_critical_ex(&queue->lock, &irqL); -#endif/*#ifdef CONFIG_SDIO_HCI*/ return _SUCCESS; - } struct recv_buf *rtw_dequeue_recvbuf(_queue *queue) @@ -440,11 +427,7 @@ struct recv_buf *rtw_dequeue_recvbuf(_queue *queue) struct recv_buf *precvbuf; _list *plist, *phead; -#ifdef CONFIG_SDIO_HCI - _enter_critical_bh(&queue->lock, &irqL); -#else _enter_critical_ex(&queue->lock, &irqL); -#endif/*#ifdef CONFIG_SDIO_HCI*/ if (_rtw_queue_empty(queue) == _TRUE) precvbuf = NULL; @@ -456,17 +439,11 @@ struct recv_buf *rtw_dequeue_recvbuf(_queue *queue) precvbuf = LIST_CONTAINOR(plist, struct recv_buf, list); rtw_list_delete(&precvbuf->list); - } -#ifdef CONFIG_SDIO_HCI - _exit_critical_bh(&queue->lock, &irqL); -#else _exit_critical_ex(&queue->lock, &irqL); -#endif/*#ifdef CONFIG_SDIO_HCI*/ return precvbuf; - } sint recvframe_chkmic(_adapter *adapter, union recv_frame *precvframe); @@ -2446,62 +2423,6 @@ exit: } #endif - -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -static void recvframe_expand_pkt( - PADAPTER padapter, - union recv_frame *prframe) -{ - struct recv_frame_hdr *pfhdr; - _pkt *ppkt; - u8 shift_sz; - u32 alloc_sz; - u8 *ptr; - - - pfhdr = &prframe->u.hdr; - - /* 6 is for IP header 8 bytes alignment in QoS packet case. */ - if (pfhdr->attrib.qos) - shift_sz = 6; - else - shift_sz = 0; - - /* for first fragment packet, need to allocate */ - /* (1536 + RXDESC_SIZE + drvinfo_sz) to reassemble packet */ - /* 8 is for skb->data 8 bytes alignment. - * alloc_sz = _RND(1536 + RXDESC_SIZE + pfhdr->attrib.drvinfosize + shift_sz + 8, 128); */ - alloc_sz = 1664; /* round (1536 + 24 + 32 + shift_sz + 8) to 128 bytes alignment */ - - /* 3 1. alloc new skb */ - /* prepare extra space for 4 bytes alignment */ - ppkt = rtw_skb_alloc(alloc_sz); - - if (!ppkt) - return; /* no way to expand */ - - /* 3 2. Prepare new skb to replace & release old skb */ - /* force ppkt->data at 8-byte alignment address */ - skb_reserve(ppkt, 8 - ((SIZE_PTR)ppkt->data & 7)); - /* force ip_hdr at 8-byte alignment address according to shift_sz */ - skb_reserve(ppkt, shift_sz); - - /* copy data to new pkt */ - ptr = skb_put(ppkt, pfhdr->len); - if (ptr) - _rtw_memcpy(ptr, pfhdr->rx_data, pfhdr->len); - - rtw_skb_free(pfhdr->pkt); - - /* attach new pkt to recvframe */ - pfhdr->pkt = ppkt; - pfhdr->rx_head = ppkt->head; - pfhdr->rx_data = ppkt->data; - pfhdr->rx_tail = skb_tail_pointer(ppkt); - pfhdr->rx_end = skb_end_pointer(ppkt); -} -#endif - /* perform defrag */ union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q); union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q) @@ -2531,13 +2452,6 @@ union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q) return NULL; } - -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) -#ifndef CONFIG_SDIO_RX_COPY - recvframe_expand_pkt(adapter, prframe); -#endif -#endif - curfragnum++; plist = get_list_head(defrag_q); diff --git a/core/rtw_sreset.c b/core/rtw_sreset.c index 8a4e3a1..660cc52 100644 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -188,7 +188,6 @@ static void sreset_restore_network_station(_adapter *padapter) { u8 threshold; -#ifdef CONFIG_USB_HCI /* TH=1 => means that invalidate usb rx aggregation */ /* TH=0 => means that validate usb rx aggregation, use init value. */ if (mlmepriv->htpriv.ht_option) { @@ -201,7 +200,6 @@ static void sreset_restore_network_station(_adapter *padapter) threshold = 1; rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold)); } -#endif } doiqk = _TRUE; @@ -264,9 +262,7 @@ void sreset_stop_adapter(_adapter *padapter) rtw_cancel_all_timer(padapter); /* TODO: OS and HCI independent */ -#if defined(CONFIG_USB_HCI) tasklet_kill(&pxmitpriv->xmit_tasklet); -#endif if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) rtw_scan_abort(padapter); @@ -292,9 +288,7 @@ void sreset_start_adapter(_adapter *padapter) sreset_restore_network_status(padapter); /* TODO: OS and HCI independent */ -#if defined(CONFIG_USB_HCI) tasklet_hi_schedule(&pxmitpriv->xmit_tasklet); -#endif if (is_primary_adapter(padapter)) _set_timer(&adapter_to_dvobj(padapter)->dynamic_chk_timer, 2000); diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 5186730..67fdd32 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -158,14 +158,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) if (res == _FAIL) goto exit; } - -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pxmitbuf->phead = pxmitbuf->pbuf; - pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMITBUF_SZ; - pxmitbuf->len = 0; - pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; -#endif - pxmitbuf->flags = XMIT_VO_QUEUE; rtw_list_insert_tail(&pxmitbuf->list, &(pxmitpriv->free_xmitbuf_queue.queue)); @@ -238,13 +230,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) goto exit; } -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pxmitbuf->phead = pxmitbuf->pbuf; - pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMIT_EXTBUF_SZ; - pxmitbuf->len = 0; - pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; -#endif - rtw_list_insert_tail(&pxmitbuf->list, &(pxmitpriv->free_xmit_extbuf_queue.queue)); #ifdef DBG_XMIT_BUF_EXT pxmitbuf->no = i; @@ -269,13 +254,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) res = _FAIL; goto exit; } - -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pxmitbuf->phead = pxmitbuf->pbuf; - pxmitbuf->pend = pxmitbuf->pbuf + MAX_CMDBUF_SZ; - pxmitbuf->len = 0; - pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; -#endif pxmitbuf->alloc_sz = MAX_CMDBUF_SZ + XMITBUF_ALIGN_SZ; } } @@ -286,7 +264,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) for (i = 0; i < 4; i++) pxmitpriv->wmm_para_seq[i] = i; -#ifdef CONFIG_USB_HCI pxmitpriv->txirp_cnt = 1; _rtw_init_sema(&(pxmitpriv->tx_retevt), 0); @@ -296,7 +273,6 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) pxmitpriv->bkq_cnt = 0; pxmitpriv->viq_cnt = 0; pxmitpriv->voq_cnt = 0; -#endif #ifdef CONFIG_XMIT_ACK pxmitpriv->ack_tx = _FALSE; @@ -2754,7 +2730,7 @@ void rtw_count_tx_stats(PADAPTER padapter, struct xmit_frame *pxmitframe, int sz u8 pkt_num = 1; if ((pxmitframe->frame_tag & 0x0f) == DATA_FRAMETAG) { -#if defined(CONFIG_USB_TX_AGGREGATION) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) +#if defined(CONFIG_USB_TX_AGGREGATION) pkt_num = pxmitframe->agg_num; #endif pmlmepriv->LinkDetectInfo.NumTxOkInPeriod += pkt_num; @@ -2794,22 +2770,6 @@ static struct xmit_buf *__rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv, pxmitbuf = &pxmitpriv->pcmd_xmitbuf[buf_type]; if (pxmitbuf != NULL) { pxmitbuf->priv_data = NULL; - -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pxmitbuf->len = 0; - pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; - pxmitbuf->agg_num = 0; - pxmitbuf->pg_num = 0; -#endif -#ifdef CONFIG_PCI_HCI - pxmitbuf->len = 0; -#ifdef CONFIG_TRX_BD_ARCH - /*pxmitbuf->buf_desc = NULL;*/ -#else - pxmitbuf->desc = NULL; -#endif -#endif - if (pxmitbuf->sctx) { RTW_INFO("%s pxmitbuf->sctx is not NULL\n", __func__); rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC); @@ -2886,20 +2846,6 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv) pxmitbuf->priv_data = NULL; -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pxmitbuf->len = 0; - pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; - pxmitbuf->agg_num = 1; -#endif -#ifdef CONFIG_PCI_HCI - pxmitbuf->len = 0; -#ifdef CONFIG_TRX_BD_ARCH - /*pxmitbuf->buf_desc = NULL;*/ -#else - pxmitbuf->desc = NULL; -#endif -#endif - if (pxmitbuf->sctx) { RTW_INFO("%s pxmitbuf->sctx is not NULL\n", __func__); rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC); @@ -2968,21 +2914,6 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) pxmitbuf->priv_data = NULL; -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pxmitbuf->len = 0; - pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead; - pxmitbuf->agg_num = 0; - pxmitbuf->pg_num = 0; -#endif -#ifdef CONFIG_PCI_HCI - pxmitbuf->len = 0; -#ifdef CONFIG_TRX_BD_ARCH - /*pxmitbuf->buf_desc = NULL;*/ -#else - pxmitbuf->desc = NULL; -#endif -#endif - if (pxmitbuf->sctx) { RTW_INFO("%s pxmitbuf->sctx is not NULL\n", __func__); rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC); @@ -3045,7 +2976,6 @@ static void rtw_init_xmitframe(struct xmit_frame *pxframe) pxframe->frame_tag = DATA_FRAMETAG; -#ifdef CONFIG_USB_HCI pxframe->pkt = NULL; #ifdef USB_PACKET_OFFSET_SZ pxframe->pkt_offset = (PACKET_OFFSET_SZ / 8); @@ -3057,13 +2987,6 @@ static void rtw_init_xmitframe(struct xmit_frame *pxframe) pxframe->agg_num = 1; #endif -#endif /* #ifdef CONFIG_USB_HCI */ - -#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) - pxframe->pg_num = 1; - pxframe->agg_num = 1; -#endif - #ifdef CONFIG_XMIT_ACK pxframe->ack_report = 0; #endif @@ -3311,10 +3234,6 @@ static struct xmit_frame *rtw_get_xframe(struct xmit_priv *pxmitpriv, int *num_f struct registry_priv *pregpriv = &padapter->registrypriv; int i, inx[4]; -#ifdef CONFIG_USB_HCI - /* int j, tmp, acirp_cnt[4]; */ -#endif - inx[0] = 0; inx[1] = 1; inx[2] = 2; @@ -3368,9 +3287,6 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi _adapter *padapter = pxmitpriv->adapter; struct registry_priv *pregpriv = &padapter->registrypriv; int i, inx[4]; -#ifdef CONFIG_USB_HCI - /* int j, tmp, acirp_cnt[4]; */ -#endif inx[0] = 0; inx[1] = 1; @@ -3380,10 +3296,8 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi if (pregpriv->wifi_spec == 1) { int j, tmp, acirp_cnt[4]; -#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_PCI_HCI) for (j = 0; j < 4; j++) inx[j] = pxmitpriv->wmm_para_seq[j]; -#endif } _enter_critical_bh(&pxmitpriv->lock, &irqL0); @@ -4750,10 +4664,6 @@ void enqueue_pending_xmitbuf( rtw_list_delete(&pxmitbuf->list); rtw_list_insert_tail(&pxmitbuf->list, get_list_head(pqueue)); _exit_critical_bh(&pqueue->lock, &irql); - -#if defined(CONFIG_SDIO_HCI) && defined(CONFIG_CONCURRENT_MODE) - pri_adapter = GET_PRIMARY_ADAPTER(pri_adapter); -#endif /*SDIO_HCI + CONCURRENT*/ _rtw_up_sema(&(pri_adapter->xmitpriv.xmit_sema)); } @@ -4801,9 +4711,7 @@ static struct xmit_buf *dequeue_pending_xmitbuf_under_survey( { _irqL irql; struct xmit_buf *pxmitbuf; -#ifdef CONFIG_USB_HCI struct xmit_frame *pxmitframe; -#endif _queue *pqueue; pxmitbuf = NULL; @@ -4824,15 +4732,11 @@ static struct xmit_buf *dequeue_pending_xmitbuf_under_survey( pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list); -#ifdef CONFIG_USB_HCI pxmitframe = (struct xmit_frame *)pxmitbuf->priv_data; if (pxmitframe) type = get_frame_sub_type(pxmitbuf->pbuf + TXDESC_SIZE + pxmitframe->pkt_offset * PACKET_OFFSET_SZ); else RTW_INFO("%s, !!!ERROR!!! For USB, TODO ITEM\n", __func__); -#else - type = get_frame_sub_type(pxmitbuf->pbuf + TXDESC_OFFSET); -#endif if ((type == WIFI_PROBEREQ) || (type == WIFI_DATA_NULL) || diff --git a/include/autoconf.h b/include/autoconf.h index 18223e1..3745685 100644 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -32,8 +32,6 @@ #define RTL871X_MODULE_NAME "88EU" #define DRV_NAME "rtl8188eu" -#define CONFIG_USB_HCI - #define PLATFORM_LINUX /* #define CONFIG_IOCTL_CFG80211 */