All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Subject: [PATCH rtw-next v2 01/11] wifi: rtw89: usb: Support 2 bulk in endpoints
Date: Sun, 19 Apr 2026 16:40:10 +0300	[thread overview]
Message-ID: <3d30c8d1-fa25-48d0-b27d-7d634c5aa005@gmail.com> (raw)
In-Reply-To: <6ba2910d-020c-41bd-86fa-d1b0e0f7a2f5@gmail.com>

RTL8912AU has 2 bulk in endpoints, not 1, so raise the limit.

The second bulk-in is for USB interrupt mode for SER (system error
recovery) flow. SER is not currently implemented for USB devices in
rtw89.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
---
v2:
 - Add Acked-by.
 - Add more information to the commit message.
---
 drivers/net/wireless/realtek/rtw89/usb.c | 15 +++++++++++----
 drivers/net/wireless/realtek/rtw89/usb.h |  3 ++-
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/usb.c b/drivers/net/wireless/realtek/rtw89/usb.c
index 767a95f759b1..d3c7ed29cfe5 100644
--- a/drivers/net/wireless/realtek/rtw89/usb.c
+++ b/drivers/net/wireless/realtek/rtw89/usb.c
@@ -511,7 +511,7 @@ static void rtw89_usb_rx_resubmit(struct rtw89_usb *rtwusb,
 	rxcb->rx_skb = rx_skb;
 
 	usb_fill_bulk_urb(rxcb->rx_urb, rtwusb->udev,
-			  usb_rcvbulkpipe(rtwusb->udev, rtwusb->in_pipe),
+			  usb_rcvbulkpipe(rtwusb->udev, rtwusb->in_pipe[0]),
 			  rxcb->rx_skb->data, RTW89_USB_RECVBUF_SZ,
 			  rtw89_usb_read_port_complete, rxcb);
 
@@ -948,6 +948,7 @@ static int rtw89_usb_parse(struct rtw89_dev *rtwdev,
 	struct rtw89_usb *rtwusb = rtw89_usb_priv(rtwdev);
 	struct usb_endpoint_descriptor *endpoint;
 	int num_out_pipes = 0;
+	int num_in_pipes = 0;
 	u8 num;
 	int i;
 
@@ -963,13 +964,14 @@ static int rtw89_usb_parse(struct rtw89_dev *rtwdev,
 
 		if (usb_endpoint_dir_in(endpoint) &&
 		    usb_endpoint_xfer_bulk(endpoint)) {
-			if (rtwusb->in_pipe) {
+			if (num_in_pipes >= RTW89_MAX_BULKIN_NUM) {
 				rtw89_err(rtwdev,
-					  "found more than 1 bulk in endpoint\n");
+					  "found more than %d bulk in endpoint\n",
+					  RTW89_MAX_BULKIN_NUM);
 				return -EINVAL;
 			}
 
-			rtwusb->in_pipe = num;
+			rtwusb->in_pipe[num_in_pipes++] = num;
 		}
 
 		if (usb_endpoint_dir_out(endpoint) &&
@@ -985,6 +987,11 @@ static int rtw89_usb_parse(struct rtw89_dev *rtwdev,
 		}
 	}
 
+	if (num_in_pipes < 1) {
+		rtw89_err(rtwdev, "no bulk in endpoints found\n");
+		return -EINVAL;
+	}
+
 	if (num_out_pipes < 1) {
 		rtw89_err(rtwdev, "no bulk out endpoints found\n");
 		return -EINVAL;
diff --git a/drivers/net/wireless/realtek/rtw89/usb.h b/drivers/net/wireless/realtek/rtw89/usb.h
index 507f61f58ed9..82de700eb142 100644
--- a/drivers/net/wireless/realtek/rtw89/usb.h
+++ b/drivers/net/wireless/realtek/rtw89/usb.h
@@ -18,6 +18,7 @@
 #define RTW89_USB_MOD512_PADDING	4
 
 #define RTW89_MAX_ENDPOINT_NUM		9
+#define RTW89_MAX_BULKIN_NUM		2
 #define RTW89_MAX_BULKOUT_NUM		7
 
 #define R_AX_RXAGG_0_V1			0x6000
@@ -65,7 +66,7 @@ struct rtw89_usb {
 
 	atomic_t continual_io_error;
 
-	u8 in_pipe;
+	u8 in_pipe[RTW89_MAX_BULKIN_NUM];
 	u8 out_pipe[RTW89_MAX_BULKOUT_NUM];
 
 	struct workqueue_struct *rxwq;
-- 
2.53.0


  reply	other threads:[~2026-04-19 13:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-19 13:39 [PATCH rtw-next v2 00/11] wifi: rtw89: Add support for RTL8922AU Bitterblue Smith
2026-04-19 13:40 ` Bitterblue Smith [this message]
2026-04-29  3:41   ` [PATCH rtw-next v2 01/11] wifi: rtw89: usb: Support 2 bulk in endpoints Ping-Ke Shih
2026-04-19 13:40 ` [PATCH rtw-next v2 02/11] wifi: rtw89: Fix rtw89_usb_ops_mac_lv1_rcvy() for RTL8922AU Bitterblue Smith
2026-04-19 13:42 ` [PATCH rtw-next v2 03/11] wifi: rtw89: Fix rtw89_usb_ops_mac_pre_init() " Bitterblue Smith
2026-04-19 13:43 ` [PATCH rtw-next v2 04/11] wifi: rtw89: Fix rtw89_usb_ops_mac_post_init() " Bitterblue Smith
2026-04-19 13:43 ` [PATCH rtw-next v2 05/11] wifi: rtw89: usb: Enable RX aggregation " Bitterblue Smith
2026-04-20  8:38   ` Ping-Ke Shih
2026-04-19 13:44 ` [PATCH rtw-next v2 06/11] wifi: rtw89: Fix rtw8922a_pwr_{on,off}_func() for USB Bitterblue Smith
2026-04-19 13:45 ` [PATCH rtw-next v2 07/11] wifi: rtw89: Let hfc_param_ini have separate settings for USB 2/3 Bitterblue Smith
2026-04-20  8:40   ` Ping-Ke Shih
2026-04-19 13:45 ` [PATCH rtw-next v2 08/11] wifi: rtw89: Add rtw8922a_hfc_param_ini_usb{2,3} Bitterblue Smith
2026-04-19 13:46 ` [PATCH rtw-next v2 09/11] wifi: rtw89: Add rtw8922a_dle_mem_usb{2,3} Bitterblue Smith
2026-04-19 13:47 ` [PATCH rtw-next v2 10/11] wifi: rtw89: Add rtw8922au.c Bitterblue Smith
2026-04-20  8:41   ` Ping-Ke Shih
2026-04-19 13:49 ` [PATCH rtw-next v2 11/11] wifi: rtw89: Enable the new rtw89_8922au module Bitterblue Smith
2026-04-20  8:20 ` [PATCH rtw-next v2 00/11] wifi: rtw89: Add support for RTL8922AU Ping-Ke Shih
2026-04-20 18:22   ` Bitterblue Smith
2026-04-21  1:09     ` Ping-Ke Shih
2026-04-21  1:18       ` Ping-Ke Shih

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=3d30c8d1-fa25-48d0-b27d-7d634c5aa005@gmail.com \
    --to=rtl8821cerfe2@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.