aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-02-07 22:13:23 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-02-09 21:49:46 +0000
commitca83c369755bcc205090093e6e0d045fae24714e (patch)
tree51baf07da4fc4fc9312c7a05acc2a6f4bd172a62
parentc45b60cab05b47b1d87bf49e58f669d9aaf72765 (diff)
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
-rw-r--r--sys/contrib/dev/athk/ath10k/usb.c22
1 files changed, 22 insertions, 0 deletions
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",