rtl8188eu: Remove CONFIG_USB_INTERRUPT_IN_PIPE - not defined

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-07-20 17:33:31 -05:00
parent 974a768133
commit 3184153e26
5 changed files with 24 additions and 230 deletions

View file

@ -61,21 +61,6 @@ int rtl8188eu_init_recv_priv(_adapter *padapter)
(void(*)(unsigned long))rtl8188eu_recv_tasklet, (void(*)(unsigned long))rtl8188eu_recv_tasklet,
(unsigned long)padapter); (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 */ /* init recv_buf */
_rtw_init_queue(&precvpriv->free_recv_buf_queue); _rtw_init_queue(&precvpriv->free_recv_buf_queue);
@ -173,16 +158,6 @@ void rtl8188eu_free_recv_priv (_adapter *padapter)
if (precvpriv->pallocated_recv_buf) if (precvpriv->pallocated_recv_buf)
rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF *sizeof(struct recv_buf) + 4); 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)) if (skb_queue_len(&precvpriv->rx_skb_queue))
DBG_88E(KERN_WARNING "rx_skb_queue not empty\n"); DBG_88E(KERN_WARNING "rx_skb_queue not empty\n");
skb_queue_purge(&precvpriv->rx_skb_queue); skb_queue_purge(&precvpriv->rx_skb_queue);

View file

@ -323,11 +323,7 @@ _InitInterrupt(
usb_opt = rtw_read8(Adapter, REG_USB_SPECIAL_OPTION); usb_opt = rtw_read8(Adapter, REG_USB_SPECIAL_OPTION);
if (!adapter_to_dvobj(Adapter)->ishighspeed if (!adapter_to_dvobj(Adapter)->ishighspeed)
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
|| pHalData->RtIntInPipe == 0x05
#endif
)
usb_opt = usb_opt & (~INT_BULK_SEL); usb_opt = usb_opt & (~INT_BULK_SEL);
else else
usb_opt = usb_opt | (INT_BULK_SEL); 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 intf_hdl * pintfhdl=&Adapter->iopriv.intf;
struct recv_priv *precvpriv = &(Adapter->recvpriv); struct recv_priv *precvpriv = &(Adapter->recvpriv);
u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem); 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_; _func_enter_;
@ -1733,21 +1725,6 @@ _func_enter_;
precvpriv->free_recv_buf_queue_cnt--; 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: exit:
RT_TRACE(_module_hci_hal_init_c_,_drv_info_,("<=== usb_inirp_init\n")); RT_TRACE(_module_hci_hal_init_c_,_drv_info_,("<=== usb_inirp_init\n"));
@ -1755,7 +1732,6 @@ exit:
_func_exit_; _func_exit_;
return status; return status;
} }
static unsigned int rtl8188eu_inirp_deinit(PADAPTER Adapter) static unsigned int rtl8188eu_inirp_deinit(PADAPTER Adapter)

View file

@ -371,97 +371,6 @@ static void interrupt_handler_8188eu(_adapter *padapter,u16 pkt_len,u8 *pbuf)
} }
#endif #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) static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxstat, struct phy_stat *pphy_status)
{ {
return _SUCCESS; return _SUCCESS;
@ -961,12 +870,7 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops)
pops->_read_port_cancel = &usb_read_port_cancel; pops->_read_port_cancel = &usb_read_port_cancel;
pops->_write_port_cancel = &usb_write_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_; _func_exit_;
} }
void rtl8188eu_set_hw_type(_adapter *padapter) void rtl8188eu_set_hw_type(_adapter *padapter)

View file

@ -215,10 +215,6 @@ struct recv_priv
uint ff_hwaddr; uint ff_hwaddr;
u8 rx_pending_cnt; 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 irq_prepare_beacon_tasklet;
struct tasklet_struct recv_tasklet; struct tasklet_struct recv_tasklet;
struct sk_buff_head free_recv_skb_queue; struct sk_buff_head free_recv_skb_queue;

View file

@ -151,10 +151,6 @@ void usb_read_port_cancel(struct intf_hdl *pintfhdl)
} }
precvbuf++; 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) 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; _irqL irqL;
int i; int i;
struct xmit_buf *pxmitbuf = (struct xmit_buf *)purb->context; 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; _adapter *padapter = pxmitbuf->padapter;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
//struct pkt_attrib *pattrib = &pxmitframe->attrib;
_func_enter_; _func_enter_;
switch (pxmitbuf->flags) switch (pxmitbuf->flags) {
{ case VO_QUEUE_INX:
case VO_QUEUE_INX: pxmitpriv->voq_cnt--;
pxmitpriv->voq_cnt--; break;
break; case VI_QUEUE_INX:
case VI_QUEUE_INX: pxmitpriv->viq_cnt--;
pxmitpriv->viq_cnt--; break;
break; case BE_QUEUE_INX:
case BE_QUEUE_INX: pxmitpriv->beq_cnt--;
pxmitpriv->beq_cnt--; break;
break; case BK_QUEUE_INX:
case BK_QUEUE_INX: pxmitpriv->bkq_cnt--;
pxmitpriv->bkq_cnt--; break;
break; case HIGH_QUEUE_INX:
case HIGH_QUEUE_INX:
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
rtw_chk_hi_queue_cmd(padapter); rtw_chk_hi_queue_cmd(padapter);
#endif #endif
break; break;
default: default:
break; break;
} }
if (padapter->bSurpriseRemoved || padapter->bDriverStopped ||padapter->bWritePortCancel) {
/* RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
_enter_critical(&pxmitpriv->lock, &irqL); ("usb_write_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)",
padapter->bDriverStopped, padapter->bSurpriseRemoved));
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));
DBG_88E("%s(): TX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bWritePortCancel(%d) pxmitbuf->ext_tag(%x)\n", 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); __func__,padapter->bDriverStopped, padapter->bSurpriseRemoved,padapter->bReadPortCancel,pxmitbuf->ext_tag);
goto check_completion; goto check_completion;
} }
if (purb->status==0) { if (purb->status==0) {
} else { } else {
@ -253,26 +202,20 @@ _func_enter_;
DBG_88E("###=> urb_write_port_complete status(%d)\n",purb->status); DBG_88E("###=> urb_write_port_complete status(%d)\n",purb->status);
if ((purb->status==-EPIPE)||(purb->status==-EPROTO)) 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); sreset_set_wifi_error_status(padapter, USB_WRITE_PORT_FAIL);
} else if (purb->status == -EINPROGRESS) { } else if (purb->status == -EINPROGRESS) {
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete: EINPROGESS\n")); RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete: EINPROGESS\n"));
goto check_completion; goto check_completion;
} else if (purb->status == -ENOENT) { } else if (purb->status == -ENOENT) {
DBG_88E("%s: -ENOENT\n", __func__); DBG_88E("%s: -ENOENT\n", __func__);
goto check_completion; goto check_completion;
} else if (purb->status == -ECONNRESET) { } else if (purb->status == -ECONNRESET) {
DBG_88E("%s: -ECONNRESET\n", __func__); DBG_88E("%s: -ECONNRESET\n", __func__);
goto check_completion; goto check_completion;
} else if (purb->status == -ESHUTDOWN) { } else if (purb->status == -ESHUTDOWN) {
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete: ESHUTDOWN\n")); RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete: ESHUTDOWN\n"));
padapter->bDriverStopped=true; padapter->bDriverStopped=true;
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bDriverStopped=true\n")); RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bDriverStopped=true\n"));
goto check_completion; goto check_completion;
} }
else else