return _SUCCESS;
}
-int _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt,
- struct recv_buf *rbuf)
-{
- struct _io_ops *io_ops = &adapter->io_ops;
-
- if ((adapter->bDriverStopped == true) ||
- (adapter->bSurpriseRemoved == true)) {
- RT_TRACE(_module_rtl871x_io_c_, _drv_info_,
- ("rtw_read_port:bDriverStopped(%d) OR "
- "bSurpriseRemoved(%d)", adapter->bDriverStopped,
- adapter->bSurpriseRemoved));
- return _FAIL;
- }
-
- return io_ops->_read_port(adapter, addr, cnt, rbuf);
-}
-
void _rtw_read_port23a_cancel(struct rtw_adapter *adapter)
{
void (*_read_port_cancel)(struct rtw_adapter *adapter);
_read_port_cancel(adapter);
}
-int _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt,
- struct xmit_buf *xbuf)
-{
- struct _io_ops *io_ops = &adapter->io_ops;
- int ret = _SUCCESS;
-
- ret = io_ops->_write_port(adapter, addr, cnt, xbuf);
-
- return ret;
-}
-
void _rtw_write_port23a_cancel(struct rtw_adapter *adapter)
{
void (*_write_port_cancel)(struct rtw_adapter *adapter);
}
ff_hwaddr = rtw_get_ff_hwaddr23a(pxmitframe);
- inner_ret = rtw_write_port(padapter, ff_hwaddr, w_sz, pxmitbuf);
+ inner_ret = rtl8723a_usb_write_port(padapter, ff_hwaddr,
+ w_sz, pxmitbuf);
rtw_count_tx_stats23a(padapter, pxmitframe, sz);
RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
int status;
struct _io_ops *io_ops = &Adapter->io_ops;
struct recv_priv *precvpriv = &Adapter->recvpriv;
- int (*_read_port)(struct rtw_adapter *padapter, u32 addr, u32 cnt,
- struct recv_buf *rbuf);
int (*_read_interrupt)(struct rtw_adapter *padapter, u32 addr);
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
- _read_port = io_ops->_read_port;
-
status = _SUCCESS;
RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("===> usb_inirp_init\n"));
- precvpriv->ff_hwaddr = RECV_BULK_IN_ADDR;
-
/* issue Rx irp to receive data */
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
- if (_read_port(Adapter, precvpriv->ff_hwaddr, 0, precvbuf) ==
- _FAIL) {
+ if (rtl8723a_usb_read_port(Adapter, RECV_BULK_IN_ADDR, 0,
+ precvbuf) == _FAIL) {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_,
("usb_rx_init: usb_read_port error\n"));
status = _FAIL;
struct usb_device *pusbd = pdvobj->pusbdev;
/* translate DMA FIFO addr to pipehandle */
- pipe = ffaddr2pipehdl23a(pdvobj, addr);
+ pipe = usb_rcvintpipe(pusbd, pdvobj->RtInPipe[1]);
usb_fill_int_urb(precvpriv->int_in_urb, pusbd, pipe,
precvpriv->int_in_buf, USB_INTR_CONTENT_LENGTH,
("usb_read_port_complete: (purb->actual_"
"length > MAX_RECVBUF_SZ) || (purb->actual_"
"length < RXDESC_SIZE)\n"));
- rtw_read_port(padapter, precvpriv->ff_hwaddr, 0,
- precvbuf);
+ rtl8723a_usb_read_port(padapter, RECV_BULK_IN_ADDR, 0,
+ precvbuf);
DBG_8723A("%s()-%d: RX Warning!\n",
__FUNCTION__, __LINE__);
} else {
tasklet_schedule(&precvpriv->recv_tasklet);
precvbuf->pskb = NULL;
- rtw_read_port(padapter, precvpriv->ff_hwaddr, 0,
- precvbuf);
+ rtl8723a_usb_read_port(padapter, RECV_BULK_IN_ADDR, 0,
+ precvbuf);
}
} else {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
pHalData = GET_HAL_DATA(padapter);
pHalData->srestpriv.Wifi_Error_Status =
USB_READ_PORT_FAIL;
- rtw_read_port(padapter, precvpriv->ff_hwaddr,
- 0, precvbuf);
+ rtl8723a_usb_read_port(padapter, RECV_BULK_IN_ADDR, 0,
+ precvbuf);
break;
case -EINPROGRESS:
DBG_8723A("ERROR: URB IS IN PROGRESS!/n");
}
}
-static int usb_read_port(struct rtw_adapter *adapter, u32 addr, u32 cnt,
- struct recv_buf *precvbuf)
+int rtl8723a_usb_read_port(struct rtw_adapter *adapter, u32 addr, u32 cnt,
+ struct recv_buf *precvbuf)
{
int err;
unsigned int pipe;
purb = precvbuf->purb;
/* translate DMA FIFO addr to pipehandle */
- pipe = ffaddr2pipehdl23a(pdvobj, addr);
+ pipe = usb_rcvbulkpipe(pusbd, pdvobj->RtInPipe[0]);
usb_fill_bulk_urb(purb, pusbd, pipe, precvbuf->pskb->data,
MAX_RECVBUF_SZ, usb_read_port_complete,
pops->_read8 = &usb_read8;
pops->_read16 = &usb_read16;
pops->_read32 = &usb_read32;
- pops->_read_port = &usb_read_port;
pops->_write8 = &usb_write8;
pops->_write16 = &usb_write16;
pops->_write32 = &usb_write32;
pops->_writeN = &usb_writeN;
- pops->_write_port = &usb_write_port23a;
-
pops->_read_port_cancel = &usb_read_port_cancel23a;
pops->_write_port_cancel = &usb_write_port23a_cancel;
int (*_read_interrupt)(struct rtw_adapter *adapter, u32 addr);
- int (*_read_port)(struct rtw_adapter *adapter, u32 addr, u32 cnt,
- struct recv_buf *rbuf);
- int (*_write_port)(struct rtw_adapter *adapter, u32 addr, u32 cnt,
- struct xmit_buf *pmem);
-
void (*_read_port_cancel)(struct rtw_adapter *adapter);
void (*_write_port_cancel)(struct rtw_adapter *adapter);
};
u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr);
u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr);
u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr);
-int _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct recv_buf *rbuf);
void _rtw_read_port23a_cancel(struct rtw_adapter *adapter);
int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val);
int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val);
int _rtw_writeN23a(struct rtw_adapter *adapter, u32 addr, u32 length, u8 *pdata);
-int _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, struct xmit_buf *pmem);
void _rtw_write_port23a_cancel(struct rtw_adapter *adapter);
#ifdef DBG_IO
#define rtw_read8(adapter, addr) dbg_rtw_read823a((adapter), (addr), __FUNCTION__, __LINE__)
#define rtw_read16(adapter, addr) dbg_rtw_read1623a((adapter), (addr), __FUNCTION__, __LINE__)
#define rtw_read32(adapter, addr) dbg_rtw_read3223a((adapter), (addr), __FUNCTION__, __LINE__)
-#define rtw_read_port(adapter, addr, cnt, mem) _rtw_read_port23a((adapter), (addr), (cnt), (mem))
#define rtw_read_port_cancel(adapter) _rtw_read_port23a_cancel((adapter))
#define rtw_write8(adapter, addr, val) dbg_rtw_write823a((adapter), (addr), (val), __FUNCTION__, __LINE__)
#define rtw_write32(adapter, addr, val) dbg_rtw_write3223a((adapter), (addr), (val), __FUNCTION__, __LINE__)
#define rtw_writeN(adapter, addr, length, data) dbg_rtw_writeN23a((adapter), (addr), (length), (data), __FUNCTION__, __LINE__)
-#define rtw_write_port(adapter, addr, cnt, mem) _rtw_write_port23a(adapter, addr, cnt, mem)
#define rtw_write_port_cancel(adapter) _rtw_write_port23a_cancel(adapter)
#else /* DBG_IO */
#define rtw_read8(adapter, addr) _rtw_read823a((adapter), (addr))
#define rtw_read16(adapter, addr) _rtw_read1623a((adapter), (addr))
#define rtw_read32(adapter, addr) _rtw_read3223a((adapter), (addr))
-#define rtw_read_port(adapter, addr, cnt, mem) _rtw_read_port23a((adapter), (addr), (cnt), (mem))
#define rtw_read_port_cancel(adapter) _rtw_read_port23a_cancel((adapter))
#define rtw_write8(adapter, addr, val) _rtw_write823a((adapter), (addr), (val))
#define rtw_write32(adapter, addr, val) _rtw_write3223a((adapter), (addr), (val))
#define rtw_writeN(adapter, addr, length, data) _rtw_writeN23a((adapter), (addr), (length), (data))
-#define rtw_write_port(adapter, addr, cnt, mem) _rtw_write_port23a((adapter), (addr), (cnt), (mem))
#define rtw_write_port_cancel(adapter) _rtw_write_port23a_cancel((adapter))
#endif /* DBG_IO */
uint rx_middlepacket_crcerr;
/* u8 *pallocated_urb_buf; */
- uint ff_hwaddr;
u8 rx_pending_cnt;
struct urb *int_in_urb;
int usb_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt,
struct xmit_buf *wmem);
void usb_write_port23a_cancel(struct rtw_adapter *adapter);
+int rtl8723a_usb_read_port(struct rtw_adapter *adapter, u32 addr, u32 cnt,
+ struct recv_buf *precvbuf);
+int rtl8723a_usb_write_port(struct rtw_adapter *padapter, u32 addr, u32 cnt,
+ struct xmit_buf *pxmitbuf);
#endif
#include <usb_ops_linux.h>
#include <rtw_sreset.h>
-unsigned int ffaddr2pipehdl23a(struct dvobj_priv *pdvobj, u32 addr)
-{
- struct usb_device *pusbd = pdvobj->pusbdev;
- unsigned int pipe = 0, ep_num = 0;
-
- if (addr == RECV_BULK_IN_ADDR) {
- pipe = usb_rcvbulkpipe(pusbd, pdvobj->RtInPipe[0]);
- } else if (addr == RECV_INT_IN_ADDR) {
- pipe = usb_rcvintpipe(pusbd, pdvobj->RtInPipe[1]);
- } else if (addr < HW_QUEUE_ENTRY) {
- ep_num = pdvobj->Queue2Pipe[addr];
- pipe = usb_sndbulkpipe(pusbd, ep_num);
- }
- return pipe;
-}
-
struct zero_bulkout_context {
void *pbuf;
void *purb;
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
}
-int usb_write_port23a(struct rtw_adapter *padapter, u32 addr, u32 cnt,
- struct xmit_buf *pxmitbuf)
+int rtl8723a_usb_write_port(struct rtw_adapter *padapter, u32 addr, u32 cnt,
+ struct xmit_buf *pxmitbuf)
{
struct urb *purb = NULL;
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
struct xmit_frame *pxmitframe;
struct usb_device *pusbd = pdvobj->pusbdev;
unsigned long irqL;
- unsigned int pipe;
+ unsigned int pipe, ep_num;
int status;
int ret = _FAIL;
purb = pxmitbuf->pxmit_urb[0];
/* translate DMA FIFO addr to pipehandle */
- pipe = ffaddr2pipehdl23a(pdvobj, addr);
+ ep_num = pdvobj->Queue2Pipe[addr];
+ pipe = usb_sndbulkpipe(pusbd, ep_num);
usb_fill_bulk_urb(purb, pusbd, pipe,
pxmitframe->buf_addr, /* pxmitbuf->pbuf */