u8 read_usb_rxcmd_cancel(_adapter * padapter){ #if 0 s8 i; struct dvobj_priv *pdev=&padapter->dvobjpriv; DEBUG_ERR(("\n ===> read_usb_hisr_cancel(pdev->ts_in_cnt=%d) \n",pdev->ts_in_cnt)); pdev->ts_in_cnt--;//pdev->tsint_cnt--; //decrease 1 forInitialize ++ if (pdev->ts_in_cnt) {//if (pdev->tsint_cnt) { // Canceling Pending Irp if ( pdev->ts_in_pendding == _TRUE) {//if ( pdev->tsint_pendding[pdev->tsint_idx] == _TRUE) { DEBUG_ERR(("\n read_usb_hisr_cancel:sb_kill_urb\n")); usb_kill_urb(pdev->ts_in_urb); } DEBUG_ERR(("\n read_usb_hisr_cancel:cancel ts_in_pendding\n")); // while (_TRUE) { // if (NdisWaitEvent(&pdev->interrupt_retevt, 2000)) { // break; // } // } _down_sema(&(pdev->hisr_retevt)); DEBUG_ERR(("\n read_usb_hisr_cancel:down sema\n")); } DEBUG_ERR(("\n <=== read_usb_hisr_cancel \n")); #endif return _SUCCESS; }
void usb_write_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem) { _irqL irqL; int status, pipe; struct io_req *pio_req=NULL; _adapter *padapter = (_adapter *)pintfhdl->adapter; struct intf_priv *pintfpriv = pintfhdl->pintfpriv; struct io_queue *pio_queue = (struct io_queue *)padapter->pio_queue; struct dvobj_priv *pdvobj = (struct dvobj_priv *)pintfpriv->intf_dev; struct usb_device *pusbd = pdvobj->pusbdev; PURB piorw_urb = pintfpriv->piorw_urb; _func_enter_; RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("+usb_write_mem\n")); if((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||(padapter->pwrctrlpriv.pnp_bstop_trx)) { RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_mem:( padapter->bDriverStopped ||padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n")); goto exit; } //translate DMA FIFO addr to pipehandle pipe = ffaddr2pipehdl(pdvobj, addr); if(pipe==0) { RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_mem, pipe=%x\n", pipe)); goto exit; } usb_fill_bulk_urb(piorw_urb, pusbd, pipe, wmem, cnt, usb_write_mem_complete, pio_queue); //piorw_urb->transfer_flags |= URB_ZERO_PACKET; status = usb_submit_urb(piorw_urb, GFP_ATOMIC); if (!status) { } else { //TODO: RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("usb_write_mem(): usb_submit_urb err, status=%x\n", status)); } _down_sema(&pintfpriv->io_retevt); RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("-usb_write_mem\n")); exit: _func_exit_; }
void r8712_stop_drv_threads(struct _adapter *padapter) { /*Below is to termindate r8712_cmd_thread & event_thread...*/ up(&padapter->cmdpriv.cmd_queue_sema); if (padapter->cmdThread) _down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); padapter->cmdpriv.cmd_seq = 1; }
void r8712_usb_write_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem) { unsigned int pipe; struct _adapter *padapter = (struct _adapter *)pintfhdl->adapter; struct intf_priv *pintfpriv = pintfhdl->pintfpriv; struct io_queue *pio_queue = padapter->pio_queue; struct dvobj_priv *pdvobj = (struct dvobj_priv *)pintfpriv->intf_dev; struct usb_device *pusbd = pdvobj->pusbdev; struct urb *piorw_urb = pintfpriv->piorw_urb; if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) || (padapter->pwrctrlpriv.pnp_bstop_trx)) return; /* translate DMA FIFO addr to pipehandle */ pipe = ffaddr2pipehdl(pdvobj, addr); if (pipe == 0) return; usb_fill_bulk_urb(piorw_urb, pusbd, pipe, wmem, cnt, usb_write_mem_complete, pio_queue); usb_submit_urb(piorw_urb, GFP_ATOMIC); _down_sema(&pintfpriv->io_retevt); }