diff --git a/hal/rtl8188eu_recv.c b/hal/rtl8188eu_recv.c index 2c3c9b2..d4810ab 100644 --- a/hal/rtl8188eu_recv.c +++ b/hal/rtl8188eu_recv.c @@ -61,21 +61,6 @@ int rtl8188eu_init_recv_priv(_adapter *padapter) (void(*)(unsigned long))rtl8188eu_recv_tasklet, (unsigned long)padapter); -#ifdef CONFIG_USB_INTERRUPT_IN_PIPE - precvpriv->int_in_urb = usb_alloc_urb(0, GFP_KERNEL); - if (precvpriv->int_in_urb == NULL){ - res= _FAIL; - DBG_88E("alloc_urb for interrupt in endpoint fail !!!!\n"); - goto exit; - } - precvpriv->int_in_buf = rtw_zmalloc(INTERRUPT_MSG_FORMAT_LEN); - if (precvpriv->int_in_buf == NULL){ - res= _FAIL; - DBG_88E("alloc_mem for interrupt in endpoint fail !!!!\n"); - goto exit; - } -#endif - /* init recv_buf */ _rtw_init_queue(&precvpriv->free_recv_buf_queue); @@ -173,16 +158,6 @@ void rtl8188eu_free_recv_priv (_adapter *padapter) if (precvpriv->pallocated_recv_buf) rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF *sizeof(struct recv_buf) + 4); -#ifdef CONFIG_USB_INTERRUPT_IN_PIPE - if (precvpriv->int_in_urb) - { - usb_free_urb(precvpriv->int_in_urb); - } - - if (precvpriv->int_in_buf) - rtw_mfree(precvpriv->int_in_buf, INTERRUPT_MSG_FORMAT_LEN); -#endif/* CONFIG_USB_INTERRUPT_IN_PIPE */ - if (skb_queue_len(&precvpriv->rx_skb_queue)) DBG_88E(KERN_WARNING "rx_skb_queue not empty\n"); skb_queue_purge(&precvpriv->rx_skb_queue); diff --git a/hal/usb_halinit.c b/hal/usb_halinit.c index 5bad00a..741f826 100644 --- a/hal/usb_halinit.c +++ b/hal/usb_halinit.c @@ -323,11 +323,7 @@ _InitInterrupt( usb_opt = rtw_read8(Adapter, REG_USB_SPECIAL_OPTION); - if (!adapter_to_dvobj(Adapter)->ishighspeed - #ifdef CONFIG_USB_INTERRUPT_IN_PIPE - || pHalData->RtIntInPipe == 0x05 - #endif - ) + if (!adapter_to_dvobj(Adapter)->ishighspeed) usb_opt = usb_opt & (~INT_BULK_SEL); else usb_opt = usb_opt | (INT_BULK_SEL); @@ -1704,10 +1700,6 @@ static unsigned int rtl8188eu_inirp_init(PADAPTER Adapter) struct intf_hdl * pintfhdl=&Adapter->iopriv.intf; struct recv_priv *precvpriv = &(Adapter->recvpriv); u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); -#ifdef CONFIG_USB_INTERRUPT_IN_PIPE - HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); - u32 (*_read_interrupt)(struct intf_hdl *pintfhdl, u32 addr); -#endif _func_enter_; @@ -1733,21 +1725,6 @@ _func_enter_; precvpriv->free_recv_buf_queue_cnt--; } -#ifdef CONFIG_USB_INTERRUPT_IN_PIPE - if (pHalData->RtIntInPipe != 0x05) { - status = _FAIL; - DBG_88E("%s =>Warning !! Have not USB Int-IN pipe, pHalData->RtIntInPipe(%d)!!!\n", - __func__,i pHalData->RtIntInPipe); - goto exit; - } - _read_interrupt = pintfhdl->io_ops._read_interrupt; - if (_read_interrupt(pintfhdl, RECV_INT_IN_ADDR) == false ) { - RT_TRACE(_module_hci_hal_init_c_, _drv_err_, - ("usb_rx_init: usb_read_interrupt error\n")); - status = _FAIL; - } -#endif - exit: RT_TRACE(_module_hci_hal_init_c_,_drv_info_,("<=== usb_inirp_init\n")); @@ -1755,7 +1732,6 @@ exit: _func_exit_; return status; - } static unsigned int rtl8188eu_inirp_deinit(PADAPTER Adapter) diff --git a/hal/usb_ops_linux.c b/hal/usb_ops_linux.c index d73596c..24f656f 100644 --- a/hal/usb_ops_linux.c +++ b/hal/usb_ops_linux.c @@ -371,97 +371,6 @@ static void interrupt_handler_8188eu(_adapter *padapter,u16 pkt_len,u8 *pbuf) } #endif -#ifdef CONFIG_USB_INTERRUPT_IN_PIPE -static void usb_read_interrupt_complete(struct urb *purb, struct pt_regs *regs) -{ - int err; - _adapter *padapter = (_adapter *)purb->context; - - if (padapter->bSurpriseRemoved || padapter->bDriverStopped||padapter->bReadPortCancel) - { - DBG_88E("%s() RX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bReadPortCancel(%d)\n", - __func__,padapter->bDriverStopped, padapter->bSurpriseRemoved,padapter->bReadPortCancel); - - return; - } - - if (purb->status==0)/* SUCCESS */ - { - if (purb->actual_length > INTERRUPT_MSG_FORMAT_LEN) - { - DBG_88E("usb_read_interrupt_complete: purb->actual_length > INTERRUPT_MSG_FORMAT_LEN(%d)\n",INTERRUPT_MSG_FORMAT_LEN); - } - - interrupt_handler_8188eu(padapter, purb->actual_length,purb->transfer_buffer ); - - err = usb_submit_urb(purb, GFP_ATOMIC); - if ((err) && (err != (-EPERM))) - { - DBG_88E("cannot submit interrupt in-token(err = 0x%08x),urb_status = %d\n",err, purb->status); - } - } - else - { - DBG_88E("###=> usb_read_interrupt_complete => urb status(%d)\n", purb->status); - - switch (purb->status) { - case -EINVAL: - case -EPIPE: - case -ENODEV: - case -ESHUTDOWN: - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bSurpriseRemoved=true\n")); - /* fall through here */ - case -ENOENT: - padapter->bDriverStopped=true; - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped=true\n")); - break; - case -EPROTO: - break; - case -EINPROGRESS: - DBG_88E("ERROR: URB IS IN PROGRESS!/n"); - break; - default: - break; - } - } - -} - -static u32 usb_read_interrupt(struct intf_hdl *pintfhdl, u32 addr) -{ - int err; - unsigned int pipe; - u32 ret = _SUCCESS; - _adapter *adapter = pintfhdl->padapter; - struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter); - struct recv_priv *precvpriv = &adapter->recvpriv; - struct usb_device *pusbd = pdvobj->pusbdev; - -_func_enter_; - - /* translate DMA FIFO addr to pipehandle */ - pipe = ffaddr2pipehdl(pdvobj, addr); - - usb_fill_int_urb(precvpriv->int_in_urb, pusbd, pipe, - precvpriv->int_in_buf, - INTERRUPT_MSG_FORMAT_LEN, - usb_read_interrupt_complete, - adapter, - 1); - - err = usb_submit_urb(precvpriv->int_in_urb, GFP_ATOMIC); - if ((err) && (err != (-EPERM))) - { - DBG_88E("cannot submit interrupt in-token(err = 0x%08x),urb_status = %d\n",err, precvpriv->int_in_urb->status); - ret = _FAIL; - } - -_func_exit_; - - return ret; -} -#endif - static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxstat, struct phy_stat *pphy_status) { return _SUCCESS; @@ -961,12 +870,7 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops) pops->_read_port_cancel = &usb_read_port_cancel; pops->_write_port_cancel = &usb_write_port_cancel; -#ifdef CONFIG_USB_INTERRUPT_IN_PIPE - pops->_read_interrupt = &usb_read_interrupt; -#endif - _func_exit_; - } void rtl8188eu_set_hw_type(_adapter *padapter) diff --git a/include/rtw_recv.h b/include/rtw_recv.h index 96a2340..d212134 100644 --- a/include/rtw_recv.h +++ b/include/rtw_recv.h @@ -215,10 +215,6 @@ struct recv_priv uint ff_hwaddr; u8 rx_pending_cnt; -#ifdef CONFIG_USB_INTERRUPT_IN_PIPE - PURB int_in_urb; - u8 *int_in_buf; -#endif //CONFIG_USB_INTERRUPT_IN_PIPE struct tasklet_struct irq_prepare_beacon_tasklet; struct tasklet_struct recv_tasklet; struct sk_buff_head free_recv_skb_queue; diff --git a/os_dep/usb_ops_linux.c b/os_dep/usb_ops_linux.c index 410f304..6fcd0ed 100644 --- a/os_dep/usb_ops_linux.c +++ b/os_dep/usb_ops_linux.c @@ -151,10 +151,6 @@ void usb_read_port_cancel(struct intf_hdl *pintfhdl) } precvbuf++; } - -#ifdef CONFIG_USB_INTERRUPT_IN_PIPE - usb_kill_urb(padapter->recvpriv.int_in_urb); -#endif } static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs) @@ -162,90 +158,43 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs) _irqL irqL; int i; struct xmit_buf *pxmitbuf = (struct xmit_buf *)purb->context; - //struct xmit_frame *pxmitframe = (struct xmit_frame *)pxmitbuf->priv_data; - //_adapter *padapter = pxmitframe->padapter; _adapter *padapter = pxmitbuf->padapter; - struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - //struct pkt_attrib *pattrib = &pxmitframe->attrib; + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; _func_enter_; - switch (pxmitbuf->flags) - { - case VO_QUEUE_INX: - pxmitpriv->voq_cnt--; - break; - case VI_QUEUE_INX: - pxmitpriv->viq_cnt--; - break; - case BE_QUEUE_INX: - pxmitpriv->beq_cnt--; - break; - case BK_QUEUE_INX: - pxmitpriv->bkq_cnt--; - break; - case HIGH_QUEUE_INX: + switch (pxmitbuf->flags) { + case VO_QUEUE_INX: + pxmitpriv->voq_cnt--; + break; + case VI_QUEUE_INX: + pxmitpriv->viq_cnt--; + break; + case BE_QUEUE_INX: + pxmitpriv->beq_cnt--; + break; + case BK_QUEUE_INX: + pxmitpriv->bkq_cnt--; + break; + case HIGH_QUEUE_INX: #ifdef CONFIG_AP_MODE - rtw_chk_hi_queue_cmd(padapter); + rtw_chk_hi_queue_cmd(padapter); #endif - break; - default: - break; + break; + default: + break; } - -/* - _enter_critical(&pxmitpriv->lock, &irqL); - - pxmitpriv->txirp_cnt--; - - switch (pattrib->priority) - { - case 1: - case 2: - pxmitpriv->bkq_cnt--; - //DBG_88E("pxmitpriv->bkq_cnt=%d\n", pxmitpriv->bkq_cnt); - break; - case 4: - case 5: - pxmitpriv->viq_cnt--; - //DBG_88E("pxmitpriv->viq_cnt=%d\n", pxmitpriv->viq_cnt); - break; - case 6: - case 7: - pxmitpriv->voq_cnt--; - //DBG_88E("pxmitpriv->voq_cnt=%d\n", pxmitpriv->voq_cnt); - break; - case 0: - case 3: - default: - pxmitpriv->beq_cnt--; - //DBG_88E("pxmitpriv->beq_cnt=%d\n", pxmitpriv->beq_cnt); - break; - - } - - _exit_critical(&pxmitpriv->lock, &irqL); - - - if (pxmitpriv->txirp_cnt==0) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete: txirp_cnt== 0, set allrxreturnevt!\n")); - _rtw_up_sema(&(pxmitpriv->tx_retevt)); - } -*/ - //rtw_free_xmitframe(pxmitpriv, pxmitframe); - - if (padapter->bSurpriseRemoved || padapter->bDriverStopped ||padapter->bWritePortCancel) - { - RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved)); + if (padapter->bSurpriseRemoved || padapter->bDriverStopped ||padapter->bWritePortCancel) { + RT_TRACE(_module_hci_ops_os_c_, _drv_err_, + ("usb_write_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)", + padapter->bDriverStopped, padapter->bSurpriseRemoved)); DBG_88E("%s(): TX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bWritePortCancel(%d) pxmitbuf->ext_tag(%x)\n", __func__,padapter->bDriverStopped, padapter->bSurpriseRemoved,padapter->bReadPortCancel,pxmitbuf->ext_tag); goto check_completion; } - if (purb->status==0) { } else { @@ -253,26 +202,20 @@ _func_enter_; DBG_88E("###=> urb_write_port_complete status(%d)\n",purb->status); if ((purb->status==-EPIPE)||(purb->status==-EPROTO)) { - //usb_clear_halt(pusbdev, purb->pipe); - //msleep(10); sreset_set_wifi_error_status(padapter, USB_WRITE_PORT_FAIL); } else if (purb->status == -EINPROGRESS) { RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete: EINPROGESS\n")); goto check_completion; - } else if (purb->status == -ENOENT) { DBG_88E("%s: -ENOENT\n", __func__); goto check_completion; - } else if (purb->status == -ECONNRESET) { DBG_88E("%s: -ECONNRESET\n", __func__); goto check_completion; - } else if (purb->status == -ESHUTDOWN) { RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete: ESHUTDOWN\n")); padapter->bDriverStopped=true; RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bDriverStopped=true\n")); - goto check_completion; } else