From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Michael Straube <straube.linux@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 3/8] staging: r8188eu: get the rcv bulk pipe handle directly
Date: Fri, 26 Nov 2021 18:32:00 +0100 [thread overview]
Message-ID: <20211126173205.21352-4-martin@kaiser.cx> (raw)
In-Reply-To: <20211126173205.21352-1-martin@kaiser.cx>
There's no point in calling ffaddr2pipehdl from rtw_read_port if the
endpoint address is constant. We can call usb_rcvbulkpipe ourselves
to get the pipe handle.
We can now remove RECV_BULK_IN_ADDR.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/staging/r8188eu/hal/usb_ops_linux.c | 2 +-
drivers/staging/r8188eu/include/rtl8188e_recv.h | 1 -
drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 4 +---
3 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
index 6af55cd6c061..d66a4b394610 100644
--- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
@@ -507,7 +507,7 @@ u32 rtw_read_port(struct adapter *adapter, u8 *rmem)
purb = precvbuf->purb;
/* translate DMA FIFO addr to pipehandle */
- pipe = ffaddr2pipehdl(pdvobj, RECV_BULK_IN_ADDR);
+ pipe = usb_rcvbulkpipe(pusbd, pdvobj->RtInPipe[0]);
usb_fill_bulk_urb(purb, pusbd, pipe,
precvbuf->pbuf,
diff --git a/drivers/staging/r8188eu/include/rtl8188e_recv.h b/drivers/staging/r8188eu/include/rtl8188e_recv.h
index 2ab395ef579b..3aa28b3ccb30 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_recv.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_recv.h
@@ -9,7 +9,6 @@
#define RECV_BLK_SZ 512
#define RECV_BLK_CNT 16
#define RECV_BLK_TH RECV_BLK_CNT
-#define RECV_BULK_IN_ADDR 0x80
#define RECV_INT_IN_ADDR 0x81
#define NR_PREALLOC_RECV_SKB (8)
diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
index ef2ea68ae873..5c659caa0975 100644
--- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
@@ -12,9 +12,7 @@ unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr)
unsigned int pipe = 0, ep_num = 0;
struct usb_device *pusbd = pdvobj->pusbdev;
- if (addr == RECV_BULK_IN_ADDR) {
- pipe = usb_rcvbulkpipe(pusbd, pdvobj->RtInPipe[0]);
- } else if (addr == RECV_INT_IN_ADDR) {
+ if (addr == RECV_INT_IN_ADDR) {
pipe = usb_rcvbulkpipe(pusbd, pdvobj->RtInPipe[1]);
} else if (addr < HW_QUEUE_ENTRY) {
ep_num = pdvobj->Queue2Pipe[addr];
--
2.20.1
next prev parent reply other threads:[~2021-11-26 17:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 17:31 [PATCH 0/8] staging: r8188eu: simplify usb in ep handling Martin Kaiser
2021-11-26 17:31 ` [PATCH 1/8] staging: r8188eu: rtw_read_port needs no cnt parameter Martin Kaiser
2021-11-26 17:31 ` [PATCH 2/8] staging: r8188eu: only the bulk in ep is used for network data Martin Kaiser
2021-11-26 17:32 ` Martin Kaiser [this message]
2021-11-26 17:32 ` [PATCH 4/8] staging: r8188eu: remove code to get int in pipe handle Martin Kaiser
2021-11-26 17:32 ` [PATCH 5/8] staging: r8188eu: if2 is not used Martin Kaiser
2021-11-26 17:32 ` [PATCH 6/8] staging: r8188eu: remove ep_num array Martin Kaiser
2021-11-26 17:32 ` [PATCH 7/8] staging: r8188eu: don't store nr_endpoint in a global struct Martin Kaiser
2021-11-26 17:32 ` [PATCH 8/8] staging: r8188eu: require a single bulk in endpoint Martin Kaiser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211126173205.21352-4-martin@kaiser.cx \
--to=martin@kaiser.cx \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®