Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 2026 00:46:53 +0000
From:      Bjoern A. Zeeb <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: ca83c369755b - main - ath10k: usb: make compile using [a future] linuxkpi_usb
Message-ID:  <698a7ffd.31d66.25a37939@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=ca83c369755bcc205090093e6e0d045fae24714e

commit ca83c369755bcc205090093e6e0d045fae24714e
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-02-07 22:13:23 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-02-09 21:49:46 +0000

    ath10k: usb: make compile using [a future] linuxkpi_usb
    
    Make ath10k usb code compile just to gather more USB bits.
    
    Currently (and likely forever) it is useless as the ath10k USB
    implementation never got finished.
    At the moment it lacks an entry for the USB bus attachment in
    core.c ath10k_hw_params_list[].
    
    ath10k_usb0 on uhub1
    ath10k_usb0: <Qualcomm Atheros USBWLAN, rev 2.01/92.10, addr 6> on usbus0
    ath10k_usb0: Warning: ath10k USB support is incomplete, don't expect anything to work!
    ath10k_usb0: Unsupported hardware version: 0x5020001
    ath10k_usb0: could not get hw params (-22)
    ath10k_usb0: could not probe fw (-22)
    
    There is another possible hardware [1] which was also never merged
    upstream.
    [1] https://lists.infradead.org/pipermail/ath10k/2024-August/016037.html
    "[PATCH] wifi: ath10k: add USB device ID for Atheros QCA9377-7"
    
    MFC after:      3 days
---
 sys/contrib/dev/athk/ath10k/usb.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/sys/contrib/dev/athk/ath10k/usb.c b/sys/contrib/dev/athk/ath10k/usb.c
index 9dfa179ba610..a825d442fe33 100644
--- a/sys/contrib/dev/athk/ath10k/usb.c
+++ b/sys/contrib/dev/athk/ath10k/usb.c
@@ -842,14 +842,22 @@ static int ath10k_usb_setup_pipe_resources(struct ath10k *ar,
 				   ATH10K_USB_IS_DIR_IN
 				   (endpoint->bEndpointAddress) ?
 				   "rx" : "tx", endpoint->bEndpointAddress,
+#if defined(__linux__)
 				   le16_to_cpu(endpoint->wMaxPacketSize));
+#elif defined(__FreeBSD__)
+				   UGETW(endpoint->wMaxPacketSize));
+#endif
 		} else if (ATH10K_USB_IS_INT_EP(endpoint->bmAttributes)) {
 			ath10k_dbg(ar, ATH10K_DBG_USB,
 				   "usb %s int ep 0x%2.2x maxpktsz %d interval %d\n",
 				   ATH10K_USB_IS_DIR_IN
 				   (endpoint->bEndpointAddress) ?
 				   "rx" : "tx", endpoint->bEndpointAddress,
+#if defined(__linux__)
 				   le16_to_cpu(endpoint->wMaxPacketSize),
+#elif defined(__FreeBSD__)
+				   UGETW(endpoint->wMaxPacketSize),
+#endif
 				   endpoint->bInterval);
 		} else if (ATH10K_USB_IS_ISOC_EP(endpoint->bmAttributes)) {
 			/* TODO for ISO */
@@ -858,7 +866,11 @@ static int ath10k_usb_setup_pipe_resources(struct ath10k *ar,
 				   ATH10K_USB_IS_DIR_IN
 				   (endpoint->bEndpointAddress) ?
 				   "rx" : "tx", endpoint->bEndpointAddress,
+#if defined(__linux__)
 				   le16_to_cpu(endpoint->wMaxPacketSize),
+#elif defined(__FreeBSD__)
+				   UGETW(endpoint->wMaxPacketSize),
+#endif
 				   endpoint->bInterval);
 		}
 
@@ -881,8 +893,13 @@ static int ath10k_usb_setup_pipe_resources(struct ath10k *ar,
 
 		pipe->ar_usb = ar_usb;
 		pipe->logical_pipe_num = pipe_num;
+#if defined(__linux__)
 		pipe->ep_address = endpoint->bEndpointAddress;
 		pipe->max_packet_size = le16_to_cpu(endpoint->wMaxPacketSize);
+#elif defined(__FreeBSD__)
+		pipe->ep_address = endpoint->bEndpointAddress & UE_ADDR;
+		pipe->max_packet_size = UGETW(endpoint->wMaxPacketSize);
+#endif
 
 		if (ATH10K_USB_IS_BULK_EP(endpoint->bmAttributes)) {
 			if (ATH10K_USB_IS_DIR_IN(pipe->ep_address)) {
@@ -1017,8 +1034,13 @@ static int ath10k_usb_probe(struct usb_interface *interface,
 	netif_napi_add(ar->napi_dev, &ar->napi, ath10k_usb_napi_poll);
 
 	usb_get_dev(dev);
+#if defined(__linux__)
 	vendor_id = le16_to_cpu(dev->descriptor.idVendor);
 	product_id = le16_to_cpu(dev->descriptor.idProduct);
+#elif defined(__FreeBSD__)
+	vendor_id = UGETW(dev->descriptor.idVendor);
+	product_id = UGETW(dev->descriptor.idProduct);
+#endif
 
 	ath10k_dbg(ar, ATH10K_DBG_BOOT,
 		   "usb new func vendor 0x%04x product 0x%04x\n",


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?698a7ffd.31d66.25a37939>