From: Martin Kaiser Date: Fri, 26 Nov 2021 17:31:59 +0000 (+0100) Subject: staging: r8188eu: only the bulk in ep is used for network data X-Git-Tag: v6.1-rc5~2247^2~213 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25b9bd7589109abcdc02a9e953c35f484037620e;p=platform%2Fkernel%2Flinux-starfive.git staging: r8188eu: only the bulk in ep is used for network data All supported devices use a single bulk in endpoint for receiving network data. The rtw_read_port function needs no addr parameter. The ff_hwaddr in struct recv_priv is also a constant value. We can use RECV_BULK_IN_ADDR directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126173205.21352-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c index af90127..4a2445d 100644 --- a/drivers/staging/r8188eu/hal/usb_halinit.c +++ b/drivers/staging/r8188eu/hal/usb_halinit.c @@ -948,12 +948,10 @@ unsigned int rtl8188eu_inirp_init(struct adapter *Adapter) status = _SUCCESS; - 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 (!rtw_read_port(Adapter, precvpriv->ff_hwaddr, (unsigned char *)precvbuf)) { + if (!rtw_read_port(Adapter, (unsigned char *)precvbuf)) { status = _FAIL; goto exit; } diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c index 92fcc44..6af55cd 100644 --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c @@ -401,7 +401,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) if (purb->status == 0) { /* SUCCESS */ if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)) { precvbuf->reuse = true; - rtw_read_port(adapt, precvpriv->ff_hwaddr, (unsigned char *)precvbuf); + rtw_read_port(adapt, (unsigned char *)precvbuf); DBG_88E("%s()-%d: RX Warning!\n", __func__, __LINE__); } else { rtw_reset_continual_urb_error(adapter_to_dvobj(adapt)); @@ -415,7 +415,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) precvbuf->pskb = NULL; precvbuf->reuse = false; - rtw_read_port(adapt, precvpriv->ff_hwaddr, (unsigned char *)precvbuf); + rtw_read_port(adapt, (unsigned char *)precvbuf); } } else { DBG_88E("###=> usb_read_port_complete => urb status(%d)\n", purb->status); @@ -436,7 +436,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) case -EPROTO: case -EOVERFLOW: precvbuf->reuse = true; - rtw_read_port(adapt, precvpriv->ff_hwaddr, (unsigned char *)precvbuf); + rtw_read_port(adapt, (unsigned char *)precvbuf); break; case -EINPROGRESS: DBG_88E("ERROR: URB IS IN PROGRESS!/n"); @@ -447,7 +447,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) } } -u32 rtw_read_port(struct adapter *adapter, u32 addr, u8 *rmem) +u32 rtw_read_port(struct adapter *adapter, u8 *rmem) { struct urb *purb = NULL; struct recv_buf *precvbuf = (struct recv_buf *)rmem; @@ -507,7 +507,7 @@ u32 rtw_read_port(struct adapter *adapter, u32 addr, u8 *rmem) purb = precvbuf->purb; /* translate DMA FIFO addr to pipehandle */ - pipe = ffaddr2pipehdl(pdvobj, addr); + pipe = ffaddr2pipehdl(pdvobj, RECV_BULK_IN_ADDR); usb_fill_bulk_urb(purb, pusbd, pipe, precvbuf->pbuf, diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h index 0e896d0..6910e2b 100644 --- a/drivers/staging/r8188eu/include/rtw_io.h +++ b/drivers/staging/r8188eu/include/rtw_io.h @@ -224,7 +224,7 @@ u8 rtw_read8(struct adapter *adapter, u32 addr); u16 rtw_read16(struct adapter *adapter, u32 addr); u32 rtw_read32(struct adapter *adapter, u32 addr); void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); -u32 rtw_read_port(struct adapter *adapter, u32 addr, u8 *pmem); +u32 rtw_read_port(struct adapter *adapter, u8 *pmem); void rtw_read_port_cancel(struct adapter *adapter); int rtw_write8(struct adapter *adapter, u32 addr, u8 val); diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h index 1e28ec7..b43a468 100644 --- a/drivers/staging/r8188eu/include/rtw_recv.h +++ b/drivers/staging/r8188eu/include/rtw_recv.h @@ -177,7 +177,6 @@ struct recv_priv { uint rx_smallpacket_crcerr; uint rx_middlepacket_crcerr; struct semaphore allrxreturnevt; - uint ff_hwaddr; u8 rx_pending_cnt; struct tasklet_struct irq_prepare_beacon_tasklet;