CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Sat Jul 6 07:09:22 UTC 2024 Modified Files: src/sys/dev/usb: if_cdce.c Log Message: There is no link state for CDCE. Pretend that the link is always up so that programs like dhcpcd will handle the interface. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/dev/usb/if_cdce.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Sat Jul 6 07:09:22 UTC 2024 Modified Files: src/sys/dev/usb: if_cdce.c Log Message: There is no link state for CDCE. Pretend that the link is always up so that programs like dhcpcd will handle the interface. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/dev/usb/if_cdce.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/if_cdce.c diff -u src/sys/dev/usb/if_cdce.c:1.81 src/sys/dev/usb/if_cdce.c:1.82 --- src/sys/dev/usb/if_cdce.c:1.81 Thu Mar 3 05:56:28 2022 +++ src/sys/dev/usb/if_cdce.c Sat Jul 6 07:09:22 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cdce.c,v 1.81 2022/03/03 05:56:28 riastradh Exp $ */ +/* $NetBSD: if_cdce.c,v 1.82 2024/07/06 07:09:22 mlelstv Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.81 2022/03/03 05:56:28 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.82 2024/07/06 07:09:22 mlelstv Exp $"); #include @@ -251,6 +251,9 @@ cdce_attach(device_t parent, device_t se usbnet_attach(un); usbnet_attach_ifp(un, IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST, 0, NULL); + + /* XXX There is no link state, pretend we are always on */ + if_link_state_change(usbnet_ifp(un), LINK_STATE_UP); } static void
CVS commit: src/sys/dev/usb
Module Name:src Committed By: christos Date: Thu Jul 4 00:23:48 UTC 2024 Modified Files: src/sys/dev/usb: u3g.c Log Message: PR/58396: Reinhard Speyerer: u3g(4): add support for Sierra Wireless MC7304 devices To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/dev/usb/u3g.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/u3g.c diff -u src/sys/dev/usb/u3g.c:1.44 src/sys/dev/usb/u3g.c:1.45 --- src/sys/dev/usb/u3g.c:1.44 Mon Feb 13 09:05:26 2023 +++ src/sys/dev/usb/u3g.c Wed Jul 3 20:23:48 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: u3g.c,v 1.44 2023/02/13 14:05:26 manu Exp $ */ +/* $NetBSD: u3g.c,v 1.45 2024/07/04 00:23:48 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: u3g.c,v 1.44 2023/02/13 14:05:26 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: u3g.c,v 1.45 2024/07/04 00:23:48 christos Exp $"); #include #include @@ -234,6 +234,7 @@ static const struct usb_devno u3g_devs[] { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720 }, { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720_2 }, { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5725 }, + { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC7304 }, { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755 }, { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755_2 }, { USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755_3 }, @@ -264,6 +265,39 @@ static const struct usb_devno u3g_devs[] { USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DWM222 }, }; +static bool +ignoreSierra(const struct usbif_attach_arg *uiaa, +const usb_interface_descriptor_t *id) +{ + if (uiaa->uiaa_vendor != USB_VENDOR_SIERRA) + return false; + + if (id->bInterfaceClass != UICLASS_VENDOR) + return false; + + switch (uiaa->uiaa_product) { + case USB_PRODUCT_SIERRA_MC7304: + /* + * Some modems use the vendor-specific class also for + * ADB/Fastboot interfaces, which we should avoid attaching to. + */ + if (id->bInterfaceSubClass == 0x42) + return true; + /*FALLTHROUGH*/ + case USB_PRODUCT_SIERRA_USB305: + /* + * Sierra Wireless modems use the vendor-specific class also + * for Direct IP or QMI interfaces, which we should avoid + * attaching to. + */ + if (uiaa->uiaa_ifaceno >= 7) + return true; + /*FALLTHROUGH*/ + default: + return false; + } +} + /* * Second personality: * @@ -282,7 +316,8 @@ u3g_match(device_t parent, cfdata_t matc id = usbd_get_interface_descriptor(iface); if (id == NULL) { - printf("u3g_match: failed to get interface descriptor\n"); + aprint_error("%s: failed to get interface descriptor\n", + __func__); return UMATCH_NONE; } @@ -295,14 +330,7 @@ u3g_match(device_t parent, cfdata_t matc (id->bInterfaceProtocol & 0xf) == 6) /* 0x16, 0x46, 0x76 */ return UMATCH_NONE; - /* - * Sierra Wireless modems use the vendor-specific class also for - * Direct IP or QMI interfaces, which we should avoid attaching to. - */ - if (uiaa->uiaa_vendor == USB_VENDOR_SIERRA && - id->bInterfaceClass == UICLASS_VENDOR && - uiaa->uiaa_product == USB_PRODUCT_SIERRA_USB305 && - uiaa->uiaa_ifaceno >= 7) + if (ignoreSierra(uiaa, id)) return UMATCH_NONE; /*
CVS commit: src/sys/dev/usb
Module Name:src Committed By: christos Date: Thu Jul 4 00:23:48 UTC 2024 Modified Files: src/sys/dev/usb: u3g.c Log Message: PR/58396: Reinhard Speyerer: u3g(4): add support for Sierra Wireless MC7304 devices To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/dev/usb/u3g.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/dev/usb
> Module Name:src > Committed By: riastradh > Date: Sun Jun 30 16:35:19 UTC 2024 > > Modified Files: > src/sys/dev/usb: if_url.c > > Log Message: > url(4): uint32_t for 32-bit hash so h>>31 becomes 0/1, not +1/-1. That was supposed to read: url(4): uint32_t for 32-bit hash so h>>31 becomes 0/1, not 0/-1.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sun Jun 30 16:35:19 UTC 2024 Modified Files: src/sys/dev/usb: if_url.c Log Message: url(4): uint32_t for 32-bit hash so h>>31 becomes 0/1, not +1/-1. Should avoid buffer overrun in PR 58382. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/sys/dev/usb/if_url.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/if_url.c diff -u src/sys/dev/usb/if_url.c:1.97 src/sys/dev/usb/if_url.c:1.98 --- src/sys/dev/usb/if_url.c:1.97 Sat Aug 20 14:08:59 2022 +++ src/sys/dev/usb/if_url.c Sun Jun 30 16:35:19 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: if_url.c,v 1.97 2022/08/20 14:08:59 riastradh Exp $ */ +/* $NetBSD: if_url.c,v 1.98 2024/06/30 16:35:19 riastradh Exp $ */ /* * Copyright (c) 2001, 2002 @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.97 2022/08/20 14:08:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.98 2024/06/30 16:35:19 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -422,7 +422,7 @@ url_uno_mcast(struct ifnet *ifp) struct ether_multi *enm; struct ether_multistep step; uint32_t mchash[2] = { 0, 0 }; - int h = 0, rcr; + uint32_t h = 0, rcr; DPRINTF(("%s: %s: enter\n", device_xname(un->un_dev), __func__));
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sun Jun 30 16:35:19 UTC 2024 Modified Files: src/sys/dev/usb: if_url.c Log Message: url(4): uint32_t for 32-bit hash so h>>31 becomes 0/1, not +1/-1. Should avoid buffer overrun in PR 58382. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/sys/dev/usb/if_url.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Mon May 20 11:36:21 UTC 2024 Modified Files: src/sys/dev/usb: xhci.c Log Message: xhci(4): Narrow some more variable scopes in xhci_device_isoc_enter. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.183 -r1.184 src/sys/dev/usb/xhci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/xhci.c diff -u src/sys/dev/usb/xhci.c:1.183 src/sys/dev/usb/xhci.c:1.184 --- src/sys/dev/usb/xhci.c:1.183 Mon May 20 11:35:54 2024 +++ src/sys/dev/usb/xhci.c Mon May 20 11:36:20 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.183 2024/05/20 11:35:54 riastradh Exp $ */ +/* $NetBSD: xhci.c,v 1.184 2024/05/20 11:36:20 riastradh Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.183 2024/05/20 11:35:54 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.184 2024/05/20 11:36:20 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -4560,14 +4560,12 @@ xhci_device_isoc_enter(struct usbd_xfer uint64_t parameter; uint32_t status; uint32_t control; - uint32_t mfindex; uint32_t offs; int i, ival; const bool polling = xhci_polling_p(sc); const uint16_t MPS = UGETW(xfer->ux_pipe->up_endpoint->ue_edesc->wMaxPacketSize); const uint16_t mps = UE_GET_SIZE(MPS); const uint8_t maxb = xpipe->xp_maxb; - u_int tdpc, tbc, tlbpc; XHCIHIST_FUNC(); XHCIHIST_CALLARGS("%#jx slot %ju dci %ju", @@ -4593,7 +4591,8 @@ xhci_device_isoc_enter(struct usbd_xfer ival = 1; /* fake something up */ if (xpipe->xp_isoc_next == -1) { - mfindex = xhci_rt_read_4(sc, XHCI_MFINDEX); + uint32_t mfindex = xhci_rt_read_4(sc, XHCI_MFINDEX); + DPRINTF("mfindex %jx", (uintmax_t)mfindex, 0, 0, 0); mfindex = XHCI_MFINDEX_GET(mfindex + 1); mfindex /= USB_UFRAMES_PER_FRAME; @@ -4604,11 +4603,10 @@ xhci_device_isoc_enter(struct usbd_xfer offs = 0; for (i = 0; i < xfer->ux_nframes; i++) { const uint32_t len = xfer->ux_frlengths[i]; - - tdpc = howmany(len, mps); - tbc = howmany(tdpc, maxb) - 1; - tlbpc = tdpc % maxb; - tlbpc = tlbpc ? tlbpc - 1 : maxb - 1; + const unsigned tdpc = howmany(len, mps); + const unsigned tbc = howmany(tdpc, maxb) - 1; + const unsigned tlbpc1 = tdpc % maxb; + const unsigned tlbpc = tlbpc1 ? tlbpc1 - 1 : maxb - 1; KASSERTMSG(len <= 0x1, "len %d", len); parameter = DMAADDR(dma, offs);
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Mon May 20 11:36:21 UTC 2024 Modified Files: src/sys/dev/usb: xhci.c Log Message: xhci(4): Narrow some more variable scopes in xhci_device_isoc_enter. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.183 -r1.184 src/sys/dev/usb/xhci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Mon May 20 11:35:55 UTC 2024 Modified Files: src/sys/dev/usb: xhci.c Log Message: xhci(4): Narrow scope of variable. Nix spurious initialization in wider scope. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.182 -r1.183 src/sys/dev/usb/xhci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/xhci.c diff -u src/sys/dev/usb/xhci.c:1.182 src/sys/dev/usb/xhci.c:1.183 --- src/sys/dev/usb/xhci.c:1.182 Mon May 20 11:35:36 2024 +++ src/sys/dev/usb/xhci.c Mon May 20 11:35:54 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.182 2024/05/20 11:35:36 riastradh Exp $ */ +/* $NetBSD: xhci.c,v 1.183 2024/05/20 11:35:54 riastradh Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.182 2024/05/20 11:35:36 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.183 2024/05/20 11:35:54 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -4556,7 +4556,6 @@ xhci_device_isoc_enter(struct usbd_xfer struct xhci_ring * const tr = xs->xs_xr[dci]; struct xhci_xfer * const xx = XHCI_XFER2XXFER(xfer); struct xhci_pipe * const xpipe = (struct xhci_pipe *)xfer->ux_pipe; - uint32_t len = xfer->ux_length; usb_dma_t * const dma = &xfer->ux_dmabuf; uint64_t parameter; uint32_t status; @@ -4604,7 +4603,7 @@ xhci_device_isoc_enter(struct usbd_xfer offs = 0; for (i = 0; i < xfer->ux_nframes; i++) { - len = xfer->ux_frlengths[i]; + const uint32_t len = xfer->ux_frlengths[i]; tdpc = howmany(len, mps); tbc = howmany(tdpc, maxb) - 1;
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Mon May 20 11:35:55 UTC 2024 Modified Files: src/sys/dev/usb: xhci.c Log Message: xhci(4): Narrow scope of variable. Nix spurious initialization in wider scope. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.182 -r1.183 src/sys/dev/usb/xhci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Mon May 20 11:35:37 UTC 2024 Modified Files: src/sys/dev/usb: xhci.c Log Message: xhci.c: Fix confusing line break. No functionanl change intended. To generate a diff of this commit: cvs rdiff -u -r1.181 -r1.182 src/sys/dev/usb/xhci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Mon May 20 11:35:37 UTC 2024 Modified Files: src/sys/dev/usb: xhci.c Log Message: xhci.c: Fix confusing line break. No functionanl change intended. To generate a diff of this commit: cvs rdiff -u -r1.181 -r1.182 src/sys/dev/usb/xhci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/xhci.c diff -u src/sys/dev/usb/xhci.c:1.181 src/sys/dev/usb/xhci.c:1.182 --- src/sys/dev/usb/xhci.c:1.181 Fri Apr 5 18:57:10 2024 +++ src/sys/dev/usb/xhci.c Mon May 20 11:35:36 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.181 2024/04/05 18:57:10 riastradh Exp $ */ +/* $NetBSD: xhci.c,v 1.182 2024/05/20 11:35:36 riastradh Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.181 2024/04/05 18:57:10 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.182 2024/05/20 11:35:36 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -2496,8 +2496,7 @@ xhci_event_transfer(struct xhci_softc * xfer->ux_frlengths[xx->xx_isoc_done] -= XHCI_TRB_2_REM_GET(trb_2); xfer->ux_actlen += xfer->ux_frlengths[xx->xx_isoc_done]; - } else - if ((trb_3 & XHCI_TRB_3_ED_BIT) == 0) { + } else if ((trb_3 & XHCI_TRB_3_ED_BIT) == 0) { if (xfer->ux_actlen == 0) xfer->ux_actlen = xfer->ux_length - XHCI_TRB_2_REM_GET(trb_2);
CVS commit: src/sys/dev/usb
Module Name:src Committed By: christos Date: Sun May 12 17:18:34 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs.h usbdevs_data.h Log Message: Regen To generate a diff of this commit: cvs rdiff -u -r1.807 -r1.808 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs.h diff -u src/sys/dev/usb/usbdevs.h:1.807 src/sys/dev/usb/usbdevs.h:1.808 --- src/sys/dev/usb/usbdevs.h:1.807 Tue Apr 16 22:33:04 2024 +++ src/sys/dev/usb/usbdevs.h Sun May 12 13:18:34 2024 @@ -1,10 +1,10 @@ -/* $NetBSD: usbdevs.h,v 1.807 2024/04/17 02:33:04 maya Exp $ */ +/* $NetBSD: usbdevs.h,v 1.808 2024/05/12 17:18:34 christos Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: usbdevs,v 1.814 2024/02/28 21:50:51 dholland Exp + * NetBSD: usbdevs,v 1.816 2024/05/12 17:17:56 christos Exp */ /*- @@ -3474,6 +3474,7 @@ #define USB_PRODUCT_TPLINK_T4UV2 0x010d /* Archer T4U ver 2 */ #define USB_PRODUCT_TPLINK_T4UHV2 0x010e /* Archer T4UH ver 2 */ #define USB_PRODUCT_TPLINK_T2UNANO 0x011e /* Archer T2U Nano */ +#define USB_PRODUCT_TPLINK_UE300 0x0601 /* UE300 10/100/1000 LAN */ /* Trek Technology products */ #define USB_PRODUCT_TREK_THUMBDRIVE 0x /* ThumbDrive */ Index: src/sys/dev/usb/usbdevs_data.h diff -u src/sys/dev/usb/usbdevs_data.h:1.807 src/sys/dev/usb/usbdevs_data.h:1.808 --- src/sys/dev/usb/usbdevs_data.h:1.807 Tue Apr 16 22:33:04 2024 +++ src/sys/dev/usb/usbdevs_data.h Sun May 12 13:18:34 2024 @@ -1,10 +1,10 @@ -/* $NetBSD: usbdevs_data.h,v 1.807 2024/04/17 02:33:04 maya Exp $ */ +/* $NetBSD: usbdevs_data.h,v 1.808 2024/05/12 17:18:34 christos Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: usbdevs,v 1.814 2024/02/28 21:50:51 dholland Exp + * NetBSD: usbdevs,v 1.816 2024/05/12 17:17:56 christos Exp */ /*- @@ -4767,168 +4767,170 @@ static const uint32_t usb_products[] = { 20027, 20038, 7643, 6624, 0, USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_T2UNANO, 20027, 20043, 6975, 0, + USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_UE300, + 20047, 20053, 7459, 0, USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE, - 20047, 0, + 20065, 0, USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE_8MB, - 20047, 20058, 0, + 20065, 20076, 0, USB_VENDOR_TRENDNET, USB_PRODUCT_TRENDNET_RTL8192CU, 5282, 0, USB_VENDOR_TRENDNET, USB_PRODUCT_TRENDNET_RTL8188CU, 5302, 0, USB_VENDOR_TRENDNET, USB_PRODUCT_TRENDNET_TEW648UBM, - 20062, 0, + 20080, 0, USB_VENDOR_TRIPPLITE, USB_PRODUCT_TRIPPLITE_U209, - 20073, 7044, 5007, 0, + 20091, 7044, 5007, 0, USB_VENDOR_TRIPPLITE2, USB_PRODUCT_TRIPPLITE2_UPS, 3207, 3213, 480, 0, USB_VENDOR_TRIPPLITE2, USB_PRODUCT_TRIPPLITE2_SMARTLCD, - 20078, 480, 0, + 20096, 480, 0, USB_VENDOR_TRIPPLITE2, USB_PRODUCT_TRIPPLITE2_AVR550U, - 3207, 3213, 20087, 0, + 3207, 3213, 20105, 0, USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_T33521, - 20095, 20103, 0, + 20113, 20121, 0, USB_VENDOR_TRUMPION, USB_PRODUCT_TRUMPION_XXX1100, - 16365, 20111, 0, + 16365, 20129, 0, USB_VENDOR_TSUNAMI, USB_PRODUCT_TSUNAMI_SM2000, - 20116, 0, + 20134, 0, USB_VENDOR_TWINMOS, USB_PRODUCT_TWINMOS_G240, - 20124, 0, + 20142, 0, USB_VENDOR_ULTIMA, USB_PRODUCT_ULTIMA_1200UBPLUS, 11625, 15247, 11515, 7345, 0, USB_VENDOR_ULTIMA, USB_PRODUCT_ULTIMA_T14BR, - 20129, 20135, 6945, 0, + 20147, 20153, 6945, 0, USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA1236U, - 20141, 5778, 20147, 0, + 20159, 5778, 20165, 0, USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA1220U, - 20141, 20155, 20147, 0, + 20159, 20173, 20165, 0, USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA2000U, - 20141, 20161, 20147, 0, + 20159, 20179, 20165, 0, USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA3400, - 20141, 20167, 20147, 0, + 20159, 20185, 20165, 0, USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA2100U, - 20141, 20172, 20147, 0, + 20159, 20190, 20165, 0, USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA2200U, - 20141, 20178, 20147, 0, + 20159, 20196, 20165, 0, USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UB_A, - 20184, 0, + 20202, 0, USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UB, - 20196, 0, + 20214, 0, USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW429UBC1, - 20196, 9551, 0, + 20214, 9551, 0, USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_RT2870_1, 5161, 0, USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_TEW645UB, - 20206, 0, + 20224, 0, USB_VENDOR_UMEDIA, USB_PRODUCT_UMEDIA_ALL0298V2, - 20216, 7632, 0, + 20234, 7632, 0, USB_VENDOR_UNIACCESS, USB_PRODUCT_UNIACCESS
CVS commit: src/sys/dev/usb
Module Name:src Committed By: christos Date: Sun May 12 17:18:34 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs.h usbdevs_data.h Log Message: Regen To generate a diff of this commit: cvs rdiff -u -r1.807 -r1.808 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: christos Date: Sun May 12 17:17:56 UTC 2024 Modified Files: src/sys/dev/usb: if_ure.c usbdevs Log Message: PR/58250: RVP: Add TP-Link UE300 USB LAN adapter To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/if_ure.c cvs rdiff -u -r1.815 -r1.816 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/if_ure.c diff -u src/sys/dev/usb/if_ure.c:1.59 src/sys/dev/usb/if_ure.c:1.60 --- src/sys/dev/usb/if_ure.c:1.59 Mon Oct 9 07:28:05 2023 +++ src/sys/dev/usb/if_ure.c Sun May 12 13:17:56 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ure.c,v 1.59 2023/10/09 11:28:05 riastradh Exp $ */ +/* $NetBSD: if_ure.c,v 1.60 2024/05/12 17:17:56 christos Exp $ */ /* $OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $ */ /*- @@ -30,7 +30,7 @@ /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.59 2023/10/09 11:28:05 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.60 2024/05/12 17:17:56 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -72,7 +72,8 @@ int uredebug = 0; static const struct usb_devno ure_devs[] = { { USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8152 }, - { USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8153 } + { USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8153 }, + { USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_UE300 }, }; #define URE_BUFSZ (16 * 1024) Index: src/sys/dev/usb/usbdevs diff -u src/sys/dev/usb/usbdevs:1.815 src/sys/dev/usb/usbdevs:1.816 --- src/sys/dev/usb/usbdevs:1.815 Tue Apr 16 22:32:08 2024 +++ src/sys/dev/usb/usbdevs Sun May 12 13:17:56 2024 @@ -1,4 +1,4 @@ -$NetBSD: usbdevs,v 1.815 2024/04/17 02:32:08 maya Exp $ +$NetBSD: usbdevs,v 1.816 2024/05/12 17:17:56 christos Exp $ /*- * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -3467,6 +3467,7 @@ product TPLINK RTL8188EU 0x010c RTL8188E product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 product TPLINK T2UNANO 0x011e Archer T2U Nano +product TPLINK UE300 0x0601 UE300 10/100/1000 LAN /* Trek Technology products */ product TREK THUMBDRIVE 0x ThumbDrive
CVS commit: src/sys/dev/usb
Module Name:src Committed By: christos Date: Sun May 12 17:17:56 UTC 2024 Modified Files: src/sys/dev/usb: if_ure.c usbdevs Log Message: PR/58250: RVP: Add TP-Link UE300 USB LAN adapter To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/if_ure.c cvs rdiff -u -r1.815 -r1.816 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Sat May 4 12:49:16 UTC 2024 Modified Files: src/sys/dev/usb: uhub.c Log Message: Use device_printf instead of autoconf messages for errors. To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/dev/usb/uhub.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Sat May 4 12:49:16 UTC 2024 Modified Files: src/sys/dev/usb: uhub.c Log Message: Use device_printf instead of autoconf messages for errors. To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/dev/usb/uhub.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/uhub.c diff -u src/sys/dev/usb/uhub.c:1.161 src/sys/dev/usb/uhub.c:1.162 --- src/sys/dev/usb/uhub.c:1.161 Wed Apr 6 22:01:45 2022 +++ src/sys/dev/usb/uhub.c Sat May 4 12:49:15 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: uhub.c,v 1.161 2022/04/06 22:01:45 mlelstv Exp $ */ +/* $NetBSD: uhub.c,v 1.162 2024/05/04 12:49:15 mlelstv Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */ /* $OpenBSD: uhub.c,v 1.86 2015/06/29 18:27:40 mpi Exp $ */ @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.161 2022/04/06 22:01:45 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.162 2024/05/04 12:49:15 mlelstv Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -864,7 +864,7 @@ uhub_explore(struct usbd_device *dev) * some other serious problem. Since we cannot leave * at 0 we have to disable the port instead. */ - aprint_error_dev(sc->sc_dev, + device_printf(sc->sc_dev, "device problem, disabling port %d\n", port); usbd_clear_port_feature(dev, port, UHF_PORT_ENABLE); } else {
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Sat May 4 12:45:14 UTC 2024 Modified Files: src/sys/dev/usb: usb_subr.c Log Message: Make usb address and hub topology available to drvctl. To generate a diff of this commit: cvs rdiff -u -r1.278 -r1.279 src/sys/dev/usb/usb_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usb_subr.c diff -u src/sys/dev/usb/usb_subr.c:1.278 src/sys/dev/usb/usb_subr.c:1.279 --- src/sys/dev/usb/usb_subr.c:1.278 Tue Apr 11 08:50:07 2023 +++ src/sys/dev/usb/usb_subr.c Sat May 4 12:45:13 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: usb_subr.c,v 1.278 2023/04/11 08:50:07 riastradh Exp $ */ +/* $NetBSD: usb_subr.c,v 1.279 2024/05/04 12:45:13 mlelstv Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.278 2023/04/11 08:50:07 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.279 2024/05/04 12:45:13 mlelstv Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -1083,6 +1083,24 @@ usbd_properties(device_t dv, struct usbd vendor = UGETW(dd->idVendor); product = UGETW(dd->idProduct); + prop_dictionary_set_uint8(dict, "address", dev->ud_addr); + + if (dev->ud_myhub) { + struct usbd_device *hdev = dev->ud_myhub; + struct usbd_hub *hub = hdev->ud_hub; + int p; + + KASSERT(hub != NULL); + + prop_dictionary_set_uint8(dict, "hub-address", hdev->ud_addr); + for (p=1; p <= hub->uh_hubdesc.bNbrPorts; ++p) { + if (hub->uh_ports[p-1].up_dev == dev) { +prop_dictionary_set_uint8(dict, "hub-port", p); +break; + } + } + } + prop_dictionary_set_uint8(dict, "class", class); prop_dictionary_set_uint8(dict, "subclass", subclass); prop_dictionary_set_uint16(dict, "release", release);
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Sat May 4 12:45:14 UTC 2024 Modified Files: src/sys/dev/usb: usb_subr.c Log Message: Make usb address and hub topology available to drvctl. To generate a diff of this commit: cvs rdiff -u -r1.278 -r1.279 src/sys/dev/usb/usb_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Sat May 4 12:41:03 UTC 2024 Modified Files: src/sys/dev/usb: usbnet.c Log Message: Use device_printf instead of autoconf messages for errors. To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/sys/dev/usb/usbnet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbnet.c diff -u src/sys/dev/usb/usbnet.c:1.119 src/sys/dev/usb/usbnet.c:1.120 --- src/sys/dev/usb/usbnet.c:1.119 Fri Feb 2 22:00:33 2024 +++ src/sys/dev/usb/usbnet.c Sat May 4 12:41:03 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: usbnet.c,v 1.119 2024/02/02 22:00:33 andvar Exp $ */ +/* $NetBSD: usbnet.c,v 1.120 2024/05/04 12:41:03 mlelstv Exp $ */ /* * Copyright (c) 2019 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.119 2024/02/02 22:00:33 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.120 2024/05/04 12:41:03 mlelstv Exp $"); #include #include @@ -377,7 +377,7 @@ usbnet_rxeof(struct usbd_xfer *xfer, voi usbd_get_xfer_status(xfer, NULL, NULL, &total_len, NULL); if (total_len > un->un_rx_bufsz) { - aprint_error_dev(un->un_dev, + device_printf(un->un_dev, "rxeof: too large transfer (%u > %u)\n", total_len, un->un_rx_bufsz); goto done; @@ -471,7 +471,7 @@ usbnet_pipe_intr(struct usbd_xfer *xfer, if (status != USBD_NORMAL_COMPLETION) { if (usbd_ratecheck(&unp->unp_intr_notice)) { - aprint_error_dev(un->un_dev, "usb error on intr: %s\n", + device_printf(un->un_dev, "usb error on intr: %s\n", usbd_errstr(status)); } if (status == USBD_STALLED)
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Sat May 4 12:41:03 UTC 2024 Modified Files: src/sys/dev/usb: usbnet.c Log Message: Use device_printf instead of autoconf messages for errors. To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/sys/dev/usb/usbnet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Apr 28 08:55:03 UTC 2024 Modified Files: src/sys/dev/usb: ohci.c Log Message: Fix some usb_syncmem calls and add some missing ones. To generate a diff of this commit: cvs rdiff -u -r1.327 -r1.328 src/sys/dev/usb/ohci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ohci.c diff -u src/sys/dev/usb/ohci.c:1.327 src/sys/dev/usb/ohci.c:1.328 --- src/sys/dev/usb/ohci.c:1.327 Sun Apr 28 07:52:52 2024 +++ src/sys/dev/usb/ohci.c Sun Apr 28 08:55:03 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ohci.c,v 1.327 2024/04/28 07:52:52 skrll Exp $ */ +/* $NetBSD: ohci.c,v 1.328 2024/04/28 08:55:03 skrll Exp $ */ /* * Copyright (c) 1998, 2004, 2005, 2012, 2016, 2020 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.327 2024/04/28 07:52:52 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.328 2024/04/28 08:55:03 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -844,6 +844,9 @@ ohci_init(ohci_softc_t *sc) goto bad1; } sc->sc_ctrl_head->ed.ed_flags |= HTOO32(OHCI_ED_SKIP); + usb_syncmem(&sc->sc_ctrl_head->dma, sc->sc_ctrl_head->offs, + sizeof(sc->sc_ctrl_head->ed), + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); /* Allocate dummy ED that starts the bulk list. */ sc->sc_bulk_head = ohci_alloc_sed(sc); @@ -1609,6 +1612,10 @@ ohci_softintr(void *v) for (i = 0, sitd = xfer->ux_hcpriv;; sitd = next) { next = sitd->nextitd; + +usb_syncmem(&sitd->dma, sitd->offs, sizeof(sitd->itd), +BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); + if (OHCI_ITD_GET_CC(O32TOH(sitd-> itd.itd_flags)) != OHCI_CC_NO_ERROR) xfer->ux_status = USBD_IOERROR; @@ -2259,8 +2266,7 @@ ohci_abortx(struct usbd_xfer *xfer) * waiting for the next start of frame (OHCI_SF) */ DPRINTFN(1, "stop ed=%#jx", (uintptr_t)sed, 0, 0, 0); - usb_syncmem(&sed->dma, sed->offs + offsetof(ohci_ed_t, ed_flags), - sizeof(sed->ed.ed_flags), + usb_syncmem(&sed->dma, sed->offs, sizeof(sed->ed), BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); if (!(sed->ed.ed_flags & OHCI_HALTED)) { /* force hardware skip */ @@ -2337,6 +2343,9 @@ ohci_abortx(struct usbd_xfer *xfer) hit |= headp == p->physaddr; n = p->nexttd; + usb_syncmem(&p->dma, p->offs + offsetof(ohci_td_t, td_flags), + sizeof(p->td.td_flags), + BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); int cc = OHCI_TD_GET_CC(O32TOH(p->td.td_flags)); if (!OHCI_CC_ACCESSED_P(cc)) { ohci_hash_rem_td(sc, p); @@ -2951,8 +2960,17 @@ ohci_device_clear_toggle(struct usbd_pip { struct ohci_pipe *opipe = OHCI_PIPE2OPIPE(pipe); ohci_softc_t *sc = OHCI_PIPE2SC(pipe); + ohci_soft_ed_t *sed = opipe->sed; + + usb_syncmem(&sed->dma, sed->offs + offsetof(ohci_ed_t, ed_headp), + sizeof(sed->ed.ed_headp), + BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); opipe->sed->ed.ed_headp &= HTOO32(~OHCI_TOGGLECARRY); + + usb_syncmem(&sed->dma, sed->offs + offsetof(ohci_ed_t, ed_headp), + sizeof(sed->ed.ed_headp), + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } Static void @@ -3403,17 +3421,21 @@ ohci_device_setintr(ohci_softc_t *sc, st mutex_enter(&sc->sc_lock); hsed = sc->sc_eds[best]; sed->next = hsed->next; - usb_syncmem(&hsed->dma, hsed->offs + offsetof(ohci_ed_t, ed_flags), - sizeof(hsed->ed.ed_flags), + usb_syncmem(&sed->dma, sed->offs + offsetof(ohci_ed_t, ed_nexted), + sizeof(sed->ed.ed_nexted), BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); sed->ed.ed_nexted = hsed->ed.ed_nexted; - usb_syncmem(&sed->dma, sed->offs + offsetof(ohci_ed_t, ed_flags), - sizeof(sed->ed.ed_flags), + usb_syncmem(&sed->dma, sed->offs + offsetof(ohci_ed_t, ed_nexted), + sizeof(sed->ed.ed_nexted), BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + hsed->next = sed; + usb_syncmem(&hsed->dma, hsed->offs + offsetof(ohci_ed_t, ed_nexted), + sizeof(hsed->ed.ed_nexted), + BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); hsed->ed.ed_nexted = HTOO32(sed->physaddr); - usb_syncmem(&hsed->dma, hsed->offs + offsetof(ohci_ed_t, ed_flags), - sizeof(hsed->ed.ed_flags), + usb_syncmem(&hsed->dma, hsed->offs + offsetof(ohci_ed_t, ed_nexted), + sizeof(hsed->ed.ed_nexted), BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); mutex_exit(&sc->sc_lock); @@ -3685,8 +3707,7 @@ ohci_device_isoc_enter(struct usbd_xfer BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); sed->ed.ed_tailp = HTOO32(tail->physaddr); sed->ed.ed_flags &= HTOO32(~OHCI_ED_SKIP); - usb_syncmem(&sed->dma, sed->offs + offsetof(ohci_ed_t, ed_flags), - sizeof(sed->ed.ed_flags), + usb_syncmem(&sed->dma, sed->offs, sizeof(sed->ed), BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); }
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Apr 28 08:55:03 UTC 2024 Modified Files: src/sys/dev/usb: ohci.c Log Message: Fix some usb_syncmem calls and add some missing ones. To generate a diff of this commit: cvs rdiff -u -r1.327 -r1.328 src/sys/dev/usb/ohci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Apr 28 07:52:52 UTC 2024 Modified Files: src/sys/dev/usb: ohci.c Log Message: Whitespace. To generate a diff of this commit: cvs rdiff -u -r1.326 -r1.327 src/sys/dev/usb/ohci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ohci.c diff -u src/sys/dev/usb/ohci.c:1.326 src/sys/dev/usb/ohci.c:1.327 --- src/sys/dev/usb/ohci.c:1.326 Fri Apr 5 18:57:10 2024 +++ src/sys/dev/usb/ohci.c Sun Apr 28 07:52:52 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ohci.c,v 1.326 2024/04/05 18:57:10 riastradh Exp $ */ +/* $NetBSD: ohci.c,v 1.327 2024/04/28 07:52:52 skrll Exp $ */ /* * Copyright (c) 1998, 2004, 2005, 2012, 2016, 2020 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.326 2024/04/05 18:57:10 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.327 2024/04/28 07:52:52 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -826,8 +826,8 @@ ohci_init(ohci_softc_t *sc) /* XXX determine alignment by R/W */ /* Allocate the HCCA area. */ - err = usb_allocmem(sc->sc_bus.ub_dmatag, OHCI_HCCA_SIZE, OHCI_HCCA_ALIGN, - USBMALLOC_COHERENT, &sc->sc_hccadma); + err = usb_allocmem(sc->sc_bus.ub_dmatag, OHCI_HCCA_SIZE, + OHCI_HCCA_ALIGN, USBMALLOC_COHERENT, &sc->sc_hccadma); if (err) { sc->sc_hcca = NULL; return err;
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Apr 28 07:52:52 UTC 2024 Modified Files: src/sys/dev/usb: ohci.c Log Message: Whitespace. To generate a diff of this commit: cvs rdiff -u -r1.326 -r1.327 src/sys/dev/usb/ohci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: thorpej Date: Thu Apr 25 01:33:04 UTC 2024 Modified Files: src/sys/dev/usb: uftdi.c Log Message: Add a match quirk to prevent matching any interface on SiPEED FPGA development boards (e.g. Tang Nano 9K). The FT2232s on these boards are wired up only for JTAG. To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/dev/usb/uftdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/uftdi.c diff -u src/sys/dev/usb/uftdi.c:1.78 src/sys/dev/usb/uftdi.c:1.79 --- src/sys/dev/usb/uftdi.c:1.78 Wed Apr 17 02:34:45 2024 +++ src/sys/dev/usb/uftdi.c Thu Apr 25 01:33:03 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: uftdi.c,v 1.78 2024/04/17 02:34:45 maya Exp $ */ +/* $NetBSD: uftdi.c,v 1.79 2024/04/25 01:33:03 thorpej Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.78 2024/04/17 02:34:45 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.79 2024/04/25 01:33:03 thorpej Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -229,7 +229,19 @@ static const struct uftdi_match_quirk_en .vendor_str = "SecuringHardware.com", .product_str = "Tigard V1.1", .match_ret = UMATCH_NONE, - } + }, + /* + * The SiPEED Tang Nano 9K (and other SiPEED Tang FPGA development + * boards) have an FT2232 on-board, wired up only for JTAG. + */ + { + .vendor_id = USB_VENDOR_FTDI, + .product_id = USB_PRODUCT_FTDI_SERIAL_2232C, + .iface_no = -1, + .vendor_str = "SIPEED", + .product_str = "JTAG Debugger", + .match_ret = UMATCH_NONE, + }, }; static int @@ -243,7 +255,7 @@ uftdi_quirk_match(struct usbif_attach_ar q = &uftdi_match_quirks[i]; if (uiaa->uiaa_vendor != q->vendor_id || uiaa->uiaa_product != q->product_id || - uiaa->uiaa_ifaceno != q->iface_no) { + (q->iface_no != -1 && uiaa->uiaa_ifaceno != q->iface_no)) { continue; } if (q->vendor_str != NULL &&
CVS commit: src/sys/dev/usb
Module Name:src Committed By: thorpej Date: Thu Apr 25 01:33:04 UTC 2024 Modified Files: src/sys/dev/usb: uftdi.c Log Message: Add a match quirk to prevent matching any interface on SiPEED FPGA development boards (e.g. Tang Nano 9K). The FT2232s on these boards are wired up only for JTAG. To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/dev/usb/uftdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maya Date: Wed Apr 17 02:34:45 UTC 2024 Modified Files: src/sys/dev/usb: uftdi.c Log Message: Add support for a range of USB serial adapters >From Cameron Williams in PR kern/58127 To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/dev/usb/uftdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/uftdi.c diff -u src/sys/dev/usb/uftdi.c:1.77 src/sys/dev/usb/uftdi.c:1.78 --- src/sys/dev/usb/uftdi.c:1.77 Tue Mar 26 03:38:02 2024 +++ src/sys/dev/usb/uftdi.c Wed Apr 17 02:34:45 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: uftdi.c,v 1.77 2024/03/26 03:38:02 thorpej Exp $ */ +/* $NetBSD: uftdi.c,v 1.78 2024/04/17 02:34:45 maya Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.77 2024/03/26 03:38:02 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.78 2024/04/17 02:34:45 maya Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -126,6 +126,25 @@ static const struct ucom_methods uftdi_m */ static const struct usb_devno uftdi_devs[] = { { USB_VENDOR_BBELECTRONICS, USB_PRODUCT_BBELECTRONICS_USOTL4 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US101 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US159 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US235 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US257 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US279_12 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US279_34 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US279_56 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US279_78 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US313 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US320 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US324 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US346_12 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US346_34 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US701_12 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US701_34 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US842_12 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US842_34 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US842_56 }, + { USB_VENDOR_BRAINBOXES, USB_PRODUCT_BRAINBOXES_US842_78 }, { USB_VENDOR_FALCOM, USB_PRODUCT_FALCOM_TWIST }, { USB_VENDOR_FALCOM, USB_PRODUCT_FALCOM_SAMBA }, { USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_230X },
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maya Date: Wed Apr 17 02:34:45 UTC 2024 Modified Files: src/sys/dev/usb: uftdi.c Log Message: Add support for a range of USB serial adapters >From Cameron Williams in PR kern/58127 To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/dev/usb/uftdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maya Date: Wed Apr 17 02:33:04 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs.h usbdevs_data.h Log Message: Regen after usbdevs change To generate a diff of this commit: cvs rdiff -u -r1.806 -r1.807 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maya Date: Wed Apr 17 02:32:09 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs Log Message: Add some USB serial adapters >From Cameron Williams in PR kern/58127 To generate a diff of this commit: cvs rdiff -u -r1.814 -r1.815 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs diff -u src/sys/dev/usb/usbdevs:1.814 src/sys/dev/usb/usbdevs:1.815 --- src/sys/dev/usb/usbdevs:1.814 Wed Feb 28 21:50:51 2024 +++ src/sys/dev/usb/usbdevs Wed Apr 17 02:32:08 2024 @@ -1,4 +1,4 @@ -$NetBSD: usbdevs,v 1.814 2024/02/28 21:50:51 dholland Exp $ +$NetBSD: usbdevs,v 1.815 2024/04/17 02:32:08 maya Exp $ /*- * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -1118,6 +1118,27 @@ product BILLIONTON USBEL100 0x0988 USB10 product BILLIONTON USBE100 0x8511 USBE100 product BILLIONTON USB2AR 0x90ff USB2AR Ethernet +/* Brainboxes Limited products */ +product BRAINBOXES US101 0x1011 US-101 USB2Serial 1xRS232 +product BRAINBOXES US159 0x1021 US-159 USB2Serial 1xRS232 +product BRAINBOXES US235 0x1017 US-235 USB2Serial 1xRS232 +product BRAINBOXES US257 0x5001 US-257 USB2Serial 2xRS232 +product BRAINBOXES US279_12 0x2021 US-279 USB2Serial 8xRS232 (Port 1 and 2) +product BRAINBOXES US279_34 0x2022 US-279 USB2Serial 8xRS232 (Port 3 and 4) +product BRAINBOXES US279_56 0x2023 US-279 USB2Serial 8xRS232 (Port 5 and 6) +product BRAINBOXES US279_78 0x2024 US-279 USB2Serial 8xRS232 (Port 7 and 8) +product BRAINBOXES US313 0x6001 US-313 USB2Serial 2xRS422/485 +product BRAINBOXES US320 0x1019 US-320 USB2Serial 1xRS422/485 +product BRAINBOXES US324 0x1013 US-324 USB2Serial 1xRS422/485 +product BRAINBOXES US346_12 0x3011 US-346 USB2Serial 4xRS422/485 (Port 1 and 2) +product BRAINBOXES US346_34 0x3012 US-346 USB2Serial 4xRS422/485 (Port 3 and 4) +product BRAINBOXES US701_12 0x2011 US-701 USB2Serial 4xRS232 (Port 1 and 2) +product BRAINBOXES US701_34 0x2012 US-701 USB2Serial 4xRS232 (Port 3 and 4) +product BRAINBOXES US842_12 0x8001 US-842 USB2Serial 8xRS422/485 (Port 1 and 2) +product BRAINBOXES US842_34 0x8002 US-842 USB2Serial 8xRS422/485 (Port 3 and 4) +product BRAINBOXES US842_56 0x8003 US-842 USB2Serial 8xRS422/485 (Port 5 and 6) +product BRAINBOXES US842_78 0x8004 US-842 USB2Serial 8xRS422/485 (Port 7 and 8) + /* Broadcom products */ product BROADCOM BCMFW 0x0bdc BCMFW product BROADCOM BCM2033 0x2000 BCM2033
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maya Date: Wed Apr 17 02:32:09 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs Log Message: Add some USB serial adapters >From Cameron Williams in PR kern/58127 To generate a diff of this commit: cvs rdiff -u -r1.814 -r1.815 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jakllsch Date: Fri Apr 12 16:54:37 UTC 2024 Modified Files: src/sys/dev/usb: ucom.c Log Message: include opt_ntp.h for PPS_SYNC To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139 src/sys/dev/usb/ucom.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ucom.c diff -u src/sys/dev/usb/ucom.c:1.138 src/sys/dev/usb/ucom.c:1.139 --- src/sys/dev/usb/ucom.c:1.138 Sun Mar 5 23:28:54 2023 +++ src/sys/dev/usb/ucom.c Fri Apr 12 16:54:37 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ucom.c,v 1.138 2023/03/05 23:28:54 riastradh Exp $ */ +/* $NetBSD: ucom.c,v 1.139 2024/04/12 16:54:37 jakllsch Exp $ */ /* * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -34,9 +34,10 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.138 2023/03/05 23:28:54 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.139 2024/04/12 16:54:37 jakllsch Exp $"); #ifdef _KERNEL_OPT +#include "opt_ntp.h" #include "opt_usb.h" #endif
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jakllsch Date: Fri Apr 12 16:54:37 UTC 2024 Modified Files: src/sys/dev/usb: ucom.c Log Message: include opt_ntp.h for PPS_SYNC To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139 src/sys/dev/usb/ucom.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: thorpej Date: Fri Mar 29 19:30:09 UTC 2024 Modified Files: src/sys/dev/usb: ugen.c Log Message: ugen and ugenif share the same /dev/ugenN.xx namespace in such a way that the device unit number does not necessarily match the /dev/ugenN.xx unit number (N). If you ONLY have ugen devices, it happens to work out and devpubd scripts can be extremely naive. If you ONLY have ugenif devices, it also happens to work out, but your devpubd scripts have to slightly more informed. If you have a mix of ugen AND ugenif devices, though, you're pretty much out of luck. So, this change adds a "ugen-unit" device property which devpubd scripts can query to determine which /dev/ugenN.xx nodes a given ugen or ugenif device is using. To generate a diff of this commit: cvs rdiff -u -r1.176 -r1.177 src/sys/dev/usb/ugen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ugen.c diff -u src/sys/dev/usb/ugen.c:1.176 src/sys/dev/usb/ugen.c:1.177 --- src/sys/dev/usb/ugen.c:1.176 Tue Mar 26 03:24:14 2024 +++ src/sys/dev/usb/ugen.c Fri Mar 29 19:30:09 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ugen.c,v 1.176 2024/03/26 03:24:14 thorpej Exp $ */ +/* $NetBSD: ugen.c,v 1.177 2024/03/29 19:30:09 thorpej Exp $ */ /* * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.176 2024/03/26 03:24:14 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.177 2024/03/29 19:30:09 thorpej Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -238,12 +238,18 @@ ugenif_get_unit(struct ugen_softc *sc) KASSERT(sc0 == sc); KASSERT(rb_tree_find_node(&ugenif.tree, &i) == sc); mutex_exit(&ugenif.lock); + + prop_dictionary_set_uint(device_properties(sc->sc_dev), + "ugen-unit", sc->sc_unit); } static void ugenif_put_unit(struct ugen_softc *sc) { + prop_dictionary_remove(device_properties(sc->sc_dev), + "ugen-unit"); + mutex_enter(&ugenif.lock); KASSERT(rb_tree_find_node(&ugenif.tree, &sc->sc_unit) == sc); rb_tree_remove_node(&ugenif.tree, sc);
CVS commit: src/sys/dev/usb
Module Name:src Committed By: thorpej Date: Fri Mar 29 19:30:09 UTC 2024 Modified Files: src/sys/dev/usb: ugen.c Log Message: ugen and ugenif share the same /dev/ugenN.xx namespace in such a way that the device unit number does not necessarily match the /dev/ugenN.xx unit number (N). If you ONLY have ugen devices, it happens to work out and devpubd scripts can be extremely naive. If you ONLY have ugenif devices, it also happens to work out, but your devpubd scripts have to slightly more informed. If you have a mix of ugen AND ugenif devices, though, you're pretty much out of luck. So, this change adds a "ugen-unit" device property which devpubd scripts can query to determine which /dev/ugenN.xx nodes a given ugen or ugenif device is using. To generate a diff of this commit: cvs rdiff -u -r1.176 -r1.177 src/sys/dev/usb/ugen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: thorpej Date: Tue Mar 26 03:38:02 UTC 2024 Modified Files: src/sys/dev/usb: uftdi.c usbdevices.config Log Message: Add a "match quirk" mechanism to the uftdi driver that allows it to selectively reject individual interfaces based on the combination of - Vendor ID - Product ID - Interface number - Vendor string - Product string This is necessary[*] to allow some devices that would otherwise match uftdi (and thus instantiate a ucom) to be matched by ugenif instead, which is required to make the device available to libusb1. [*] ...due to a deficiency in the USB stack that does not provide a mechanism for a user-space driver to claim a device from a kernel driver and then return it back at a later time. Use this new match quirk mechanism to reject "interface 1" of the FTDI 2232C-based Tigard debug board; On this board, "interface 0" is brought out to regular TTL-level UART pins, but "interface 1" is brought out to SWD and JTAG headers, and is really only useful when used with something like openocd. Because the FTDI 2232C on this board just uses the standard FTDI vendor and product IDs, it can only be distinguished by the strings, which cannot be specified usbdevices.config, thus necessitating the match quirk entry (that works in combination with the ugenif entry added in usbdevices.config). To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/sys/dev/usb/uftdi.c cvs rdiff -u -r1.42 -r1.43 src/sys/dev/usb/usbdevices.config Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/uftdi.c diff -u src/sys/dev/usb/uftdi.c:1.76 src/sys/dev/usb/uftdi.c:1.77 --- src/sys/dev/usb/uftdi.c:1.76 Sat Aug 7 16:19:17 2021 +++ src/sys/dev/usb/uftdi.c Tue Mar 26 03:38:02 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: uftdi.c,v 1.76 2021/08/07 16:19:17 thorpej Exp $ */ +/* $NetBSD: uftdi.c,v 1.77 2024/03/26 03:38:02 thorpej Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.76 2021/08/07 16:19:17 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.77 2024/03/26 03:38:02 thorpej Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -47,6 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1. #include #include +#include #include #include @@ -184,10 +185,72 @@ static int uftdi_detach(device_t, int); CFATTACH_DECL2_NEW(uftdi, sizeof(struct uftdi_softc), uftdi_match, uftdi_attach, uftdi_detach, NULL, NULL, uftdi_childdet); +struct uftdi_match_quirk_entry { + uint16_t vendor_id; + uint16_t product_id; + int iface_no; + const char * vendor_str; + const char * product_str; + int match_ret; +}; + +static const struct uftdi_match_quirk_entry uftdi_match_quirks[] = { + /* + * The Tigard board (https://github.com/tigard-tools/tigard) + * has two interfaces, one of which is meant to act as a + * regular USB serial port (interface 0), the other of which + * is meant for other protocols (SWD, JTAG, etc.). We must + * reject interface 1 so that ugenif matches, thus allowing + * full user-space control of that port. + */ + { + .vendor_id = USB_VENDOR_FTDI, + .product_id = USB_PRODUCT_FTDI_SERIAL_2232C, + .iface_no = 1, + .vendor_str = "SecuringHardware.com", + .product_str = "Tigard V1.1", + .match_ret = UMATCH_NONE, + } +}; + +static int +uftdi_quirk_match(struct usbif_attach_arg *uiaa, int rv) +{ + struct usbd_device *dev = uiaa->uiaa_device; + const struct uftdi_match_quirk_entry *q; + int i; + + for (i = 0; i < __arraycount(uftdi_match_quirks); i++) { + q = &uftdi_match_quirks[i]; + if (uiaa->uiaa_vendor != q->vendor_id || + uiaa->uiaa_product != q->product_id || + uiaa->uiaa_ifaceno != q->iface_no) { + continue; + } + if (q->vendor_str != NULL && + (dev->ud_vendor == NULL || + strcmp(dev->ud_vendor, q->vendor_str) != 0)) { + continue; + } + if (q->product_str != NULL && + (dev->ud_product == NULL || + strcmp(dev->ud_product, q->product_str) != 0)) { + continue; + } + /* + * Got a match! + */ + rv = q->match_ret; + break; + } + return rv; +} + static int uftdi_match(device_t parent, cfdata_t match, void *aux) { struct usbif_attach_arg *uiaa = aux; + int rv; DPRINTFN(20,("uftdi: vendor=%#x, product=%#x\n", uiaa->uiaa_vendor, uiaa->uiaa_product)); @@ -195,8 +258,12 @@ uftdi_match(device_t parent, cfdata_t ma if (uiaa->uiaa_configno != UFTDI_CONFIG_NO) return UMATCH_NONE; - return uftdi_lookup(uiaa->uiaa_vendor, uiaa->uiaa_product) != NULL ? + rv = uftdi_lookup(uiaa->uiaa_vendor, uiaa->uiaa_product) != NULL ? UMATCH_VENDOR_PRODUCT_CONF_IFACE : UMATCH_NONE; + if (rv != UMATCH_NONE) { + rv = uftdi_quirk_match(uiaa, rv); + } + return rv; } static void Index: src/sys/dev/usb/usbdevices.config diff -u src/sys/dev/usb/usbdevices.config:1.42 src/sys/dev/usb/usbdevices.config:
CVS commit: src/sys/dev/usb
Module Name:src Committed By: thorpej Date: Tue Mar 26 03:38:02 UTC 2024 Modified Files: src/sys/dev/usb: uftdi.c usbdevices.config Log Message: Add a "match quirk" mechanism to the uftdi driver that allows it to selectively reject individual interfaces based on the combination of - Vendor ID - Product ID - Interface number - Vendor string - Product string This is necessary[*] to allow some devices that would otherwise match uftdi (and thus instantiate a ucom) to be matched by ugenif instead, which is required to make the device available to libusb1. [*] ...due to a deficiency in the USB stack that does not provide a mechanism for a user-space driver to claim a device from a kernel driver and then return it back at a later time. Use this new match quirk mechanism to reject "interface 1" of the FTDI 2232C-based Tigard debug board; On this board, "interface 0" is brought out to regular TTL-level UART pins, but "interface 1" is brought out to SWD and JTAG headers, and is really only useful when used with something like openocd. Because the FTDI 2232C on this board just uses the standard FTDI vendor and product IDs, it can only be distinguished by the strings, which cannot be specified usbdevices.config, thus necessitating the match quirk entry (that works in combination with the ugenif entry added in usbdevices.config). To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/sys/dev/usb/uftdi.c cvs rdiff -u -r1.42 -r1.43 src/sys/dev/usb/usbdevices.config Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jakllsch Date: Mon Mar 18 15:15:27 UTC 2024 Modified Files: src/sys/dev/usb: ums.c Log Message: Use HUD_PEN instead of 0x0002 as appropriate To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/sys/dev/usb/ums.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jakllsch Date: Mon Mar 18 15:15:27 UTC 2024 Modified Files: src/sys/dev/usb: ums.c Log Message: Use HUD_PEN instead of 0x0002 as appropriate To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/sys/dev/usb/ums.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ums.c diff -u src/sys/dev/usb/ums.c:1.105 src/sys/dev/usb/ums.c:1.106 --- src/sys/dev/usb/ums.c:1.105 Sat Jan 13 15:26:36 2024 +++ src/sys/dev/usb/ums.c Mon Mar 18 15:15:27 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ums.c,v 1.105 2024/01/13 15:26:36 hgutch Exp $ */ +/* $NetBSD: ums.c,v 1.106 2024/03/18 15:15:27 jakllsch Exp $ */ /* * Copyright (c) 1998, 2017 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.105 2024/01/13 15:26:36 hgutch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.106 2024/03/18 15:15:27 jakllsch Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -170,7 +170,7 @@ ums_match(device_t parent, cfdata_t matc !hid_is_collection(desc, size, uha->reportid, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_POINTER)) && !hid_is_collection(desc, size, uha->reportid, - HID_USAGE2(HUP_DIGITIZERS, 0x0002))) + HID_USAGE2(HUP_DIGITIZERS, HUD_PEN))) return UMATCH_NONE; return UMATCH_IFACECLASS;
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jakllsch Date: Sun Mar 17 20:10:52 UTC 2024 Modified Files: src/sys/dev/usb: ucycom.c Log Message: Prevent errant ucycom-presenting device from causing up to 225 bytes of kernel memory following input buffer to leak to tty application. Probably not practically expolitable, but you never know. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/dev/usb/ucycom.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ucycom.c diff -u src/sys/dev/usb/ucycom.c:1.56 src/sys/dev/usb/ucycom.c:1.57 --- src/sys/dev/usb/ucycom.c:1.56 Wed Oct 26 23:50:28 2022 +++ src/sys/dev/usb/ucycom.c Sun Mar 17 20:10:52 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ucycom.c,v 1.56 2022/10/26 23:50:28 riastradh Exp $ */ +/* $NetBSD: ucycom.c,v 1.57 2024/03/17 20:10:52 jakllsch Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.56 2022/10/26 23:50:28 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.57 2024/03/17 20:10:52 jakllsch Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -978,6 +978,7 @@ ucycom_intr(void *cookie, void *ibuf, u_ st = cp[0]; n = cp[1]; cp += 2; + n = uimin(n, 30); break; default:
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jakllsch Date: Sun Mar 17 20:10:52 UTC 2024 Modified Files: src/sys/dev/usb: ucycom.c Log Message: Prevent errant ucycom-presenting device from causing up to 225 bytes of kernel memory following input buffer to leak to tty application. Probably not practically expolitable, but you never know. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/dev/usb/ucycom.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Fri Mar 8 07:05:02 UTC 2024 Modified Files: src/sys/dev/usb: ehcireg.h Log Message: give some anonymous structures names To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/dev/usb/ehcireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Fri Mar 8 07:05:02 UTC 2024 Modified Files: src/sys/dev/usb: ehcireg.h Log Message: give some anonymous structures names To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/dev/usb/ehcireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ehcireg.h diff -u src/sys/dev/usb/ehcireg.h:1.39 src/sys/dev/usb/ehcireg.h:1.40 --- src/sys/dev/usb/ehcireg.h:1.39 Tue Feb 6 23:57:41 2024 +++ src/sys/dev/usb/ehcireg.h Fri Mar 8 07:05:02 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ehcireg.h,v 1.39 2024/02/06 23:57:41 mrg Exp $ */ +/* $NetBSD: ehcireg.h,v 1.40 2024/03/08 07:05:02 mrg Exp $ */ /* * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc. @@ -206,7 +206,7 @@ typedef uint32_t ehci_isoc_bufr_ptr_t; #define EHCI_ITD_ALIGN 32 #define EHCI_ITD_NUFRAMES USB_UFRAMES_PER_FRAME #define EHCI_ITD_NBUFFERS 7 -typedef struct { +typedef struct ehci_itd_t { volatile ehci_link_t itd_next; volatile ehci_isoc_trans_t itd_ctl[EHCI_ITD_NUFRAMES]; #define EHCI_ITD_STATUS_MASK __BITS(31,28) @@ -252,7 +252,7 @@ typedef struct { /* Split Transaction Isochronous Transfer Descriptor */ #define EHCI_SITD_ALIGN 32 -typedef struct { +typedef struct ehci_sitd_t { volatile ehci_link_t sitd_next; volatile uint32_t sitd_endp; #define EHCI_SITD_DIR_MASK __BIT(31) @@ -301,7 +301,7 @@ typedef struct { #define EHCI_QTD_NBUFFERS 5 #define EHCI_QTD_MAXTRANSFER (EHCI_QTD_NBUFFERS * EHCI_PAGE_SIZE) #define EHCI_QTD_ALIGN 32 -typedef struct { +typedef struct ehci_qtd_t { volatile ehci_link_t qtd_next; volatile ehci_link_t qtd_altnext; volatile uint32_t qtd_status; @@ -343,7 +343,7 @@ typedef struct { /* Queue Head */ #define EHCI_QH_ALIGN 32 -typedef struct { +typedef struct ehci_qh_t { volatile ehci_link_t qh_link; volatile uint32_t qh_endp; #define EHCI_QH_ADDR_MASK __BITS(6,0) /* endpoint addr */ @@ -405,7 +405,7 @@ typedef struct { /* Periodic Frame Span Traversal Node */ #define EHCI_FSTN_ALIGN 32 -typedef struct { +typedef struct ehci_fstn_t { volatile ehci_link_t fstn_link; volatile ehci_link_t fstn_back; } __aligned(EHCI_FSTN_ALIGN) ehci_fstn_t;
CVS commit: src/sys/dev/usb
Module Name:src Committed By: dholland Date: Wed Feb 28 21:52:40 UTC 2024 Modified Files: src/sys/dev/usb: usb_quirks.c usbdevs.h usbdevs_data.h Log Message: usbdevs: regen; usb_quirks.c: update to match Regen for additional Logitech B100, and update the UQ_ALWAYS_ON entry to refer to both device ids. To generate a diff of this commit: cvs rdiff -u -r1.107 -r1.108 src/sys/dev/usb/usb_quirks.c cvs rdiff -u -r1.805 -r1.806 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usb_quirks.c diff -u src/sys/dev/usb/usb_quirks.c:1.107 src/sys/dev/usb/usb_quirks.c:1.108 --- src/sys/dev/usb/usb_quirks.c:1.107 Sun May 14 23:58:35 2023 +++ src/sys/dev/usb/usb_quirks.c Wed Feb 28 21:52:40 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: usb_quirks.c,v 1.107 2023/05/14 23:58:35 pgoyette Exp $ */ +/* $NetBSD: usb_quirks.c,v 1.108 2024/02/28 21:52:40 dholland Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_quirks.c,v 1.30 2003/01/02 04:15:55 imp Exp $ */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.107 2023/05/14 23:58:35 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usb_quirks.c,v 1.108 2024/02/28 21:52:40 dholland Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -399,7 +399,9 @@ Static const struct usbd_quirk_entry { { UQ_ALWAYS_ON, NULL }}, { USB_VENDOR_PIXART, USB_PRODUCT_PIXART_RPIMOUSE, ANY, { UQ_ALWAYS_ON, NULL }}, - { USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_B100, ANY, + { USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_B100_1, ANY, + { UQ_ALWAYS_ON, NULL }}, + { USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_B100_2, ANY, { UQ_ALWAYS_ON, NULL }}, { USB_VENDOR_LENOVO, USB_PRODUCT_LENOVO_OPTUSBMOUSE, ANY, { UQ_ALWAYS_ON, NULL }}, /* Index: src/sys/dev/usb/usbdevs.h diff -u src/sys/dev/usb/usbdevs.h:1.805 src/sys/dev/usb/usbdevs.h:1.806 --- src/sys/dev/usb/usbdevs.h:1.805 Sat Jan 13 15:22:40 2024 +++ src/sys/dev/usb/usbdevs.h Wed Feb 28 21:52:40 2024 @@ -1,10 +1,10 @@ -/* $NetBSD: usbdevs.h,v 1.805 2024/01/13 15:22:40 hgutch Exp $ */ +/* $NetBSD: usbdevs.h,v 1.806 2024/02/28 21:52:40 dholland Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: usbdevs,v 1.813 2024/01/13 14:42:14 hgutch Exp + * NetBSD: usbdevs,v 1.814 2024/02/28 21:50:51 dholland Exp */ /*- @@ -2204,7 +2204,8 @@ #define USB_PRODUCT_LOGITECH_USBPS2MOUSE 0xc00e /* USB-PS/2 Optical Mouse */ #define USB_PRODUCT_LOGITECH_MUV55A 0xc016 /* M-UV55a */ #define USB_PRODUCT_LOGITECH_UN58A 0xc030 /* iFeel Mouse */ -#define USB_PRODUCT_LOGITECH_B100 0xc077 /* B100 Optical Mouse */ +#define USB_PRODUCT_LOGITECH_B100_1 0xc05a /* B100 Optical Mouse */ +#define USB_PRODUCT_LOGITECH_B100_2 0xc077 /* B100 Optical Mouse */ #define USB_PRODUCT_LOGITECH_WMPAD 0xc208 /* WingMan GamePad Extreme */ #define USB_PRODUCT_LOGITECH_WMRPAD 0xc20a /* WingMan RumblePad */ #define USB_PRODUCT_LOGITECH_WMJOY 0xc281 /* WingMan Force joystick */ Index: src/sys/dev/usb/usbdevs_data.h diff -u src/sys/dev/usb/usbdevs_data.h:1.805 src/sys/dev/usb/usbdevs_data.h:1.806 --- src/sys/dev/usb/usbdevs_data.h:1.805 Sat Jan 13 15:22:40 2024 +++ src/sys/dev/usb/usbdevs_data.h Wed Feb 28 21:52:40 2024 @@ -1,10 +1,10 @@ -/* $NetBSD: usbdevs_data.h,v 1.805 2024/01/13 15:22:40 hgutch Exp $ */ +/* $NetBSD: usbdevs_data.h,v 1.806 2024/02/28 21:52:40 dholland Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: usbdevs,v 1.813 2024/01/13 14:42:14 hgutch Exp + * NetBSD: usbdevs,v 1.814 2024/02/28 21:50:51 dholland Exp */ /*- @@ -2903,7 +2903,9 @@ static const uint32_t usb_products[] = { 13531, 0, USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_UN58A, 13539, 6494, 0, - USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_B100, + USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_B100_1, + 13545, 3370, 6494, 0, + USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_B100_2, 13545, 3370, 6494, 0, USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_WMPAD, 13502, 10939, 13550, 0, @@ -5519,7 +5521,7 @@ static const char usb_words[] = { "." "Cambridge\0" /* 1 refs @ 3349 */ "Radio\0" /* 8 refs @ 3359 */ "Trek\0" /* 1 refs @ 3365 */ - "Optical\0" /* 9 refs @ 3370 */ + "Optical\0" /* 10 refs @ 3370 */ "ShanTou\0" /* 1 refs @ 3378 */ "MediaGear\0" /* 1 refs @ 3386 */ "Broadcom\0" /* 2 refs @ 3396 */ @@ -5926,7 +5928,7 @@ static const char usb_words[] = { "." "(Wellspring2/JIS)\0" /* 1 refs @ 6463 */ "mouse\0" /* 16 refs @ 6481 */ "Mighty\0" /* 2 refs @ 6487 */ - "Mouse\0" /* 18 refs @ 6494 */ + "Mouse\0" /* 19 refs @ 6494 */ "Trackpad\0" /* 3 refs @ 6500 */ "(Fountain)\0" /* 1 refs @ 6509 */ "(Geyser)\0" /* 1 refs @ 6520 */ @@ -6877,7 +6879,7 @@ static const
CVS commit: src/sys/dev/usb
Module Name:src Committed By: dholland Date: Wed Feb 28 21:52:40 UTC 2024 Modified Files: src/sys/dev/usb: usb_quirks.c usbdevs.h usbdevs_data.h Log Message: usbdevs: regen; usb_quirks.c: update to match Regen for additional Logitech B100, and update the UQ_ALWAYS_ON entry to refer to both device ids. To generate a diff of this commit: cvs rdiff -u -r1.107 -r1.108 src/sys/dev/usb/usb_quirks.c cvs rdiff -u -r1.805 -r1.806 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: dholland Date: Wed Feb 28 21:50:51 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs Log Message: usbdevs: add another device id for LOGITECH B100. The mouse I'm looking at says "Logitech B100" on the back but has a different device id from the one already here. To generate a diff of this commit: cvs rdiff -u -r1.813 -r1.814 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs diff -u src/sys/dev/usb/usbdevs:1.813 src/sys/dev/usb/usbdevs:1.814 --- src/sys/dev/usb/usbdevs:1.813 Sat Jan 13 14:42:14 2024 +++ src/sys/dev/usb/usbdevs Wed Feb 28 21:50:51 2024 @@ -1,4 +1,4 @@ -$NetBSD: usbdevs,v 1.813 2024/01/13 14:42:14 hgutch Exp $ +$NetBSD: usbdevs,v 1.814 2024/02/28 21:50:51 dholland Exp $ /*- * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -2197,7 +2197,8 @@ product LOGITECH BD58 0xc00c BD58 mouse product LOGITECH USBPS2MOUSE 0xc00e USB-PS/2 Optical Mouse product LOGITECH MUV55A 0xc016 M-UV55a product LOGITECH UN58A 0xc030 iFeel Mouse -product LOGITECH B100 0xc077 B100 Optical Mouse +product LOGITECH B100_1 0xc05a B100 Optical Mouse +product LOGITECH B100_2 0xc077 B100 Optical Mouse product LOGITECH WMPAD 0xc208 WingMan GamePad Extreme product LOGITECH WMRPAD 0xc20a WingMan RumblePad product LOGITECH WMJOY 0xc281 WingMan Force joystick
CVS commit: src/sys/dev/usb
Module Name:src Committed By: dholland Date: Wed Feb 28 21:50:51 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs Log Message: usbdevs: add another device id for LOGITECH B100. The mouse I'm looking at says "Logitech B100" on the back but has a different device id from the one already here. To generate a diff of this commit: cvs rdiff -u -r1.813 -r1.814 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Wed Feb 28 20:18:13 UTC 2024 Modified Files: src/sys/dev/usb: if_urtwn.c Log Message: urtwn(4): Ditch old queued commands on overflow. Don't increment ring->queued past what the task will decrement. This is a stop-gap measure; really, we should just have one task for each operation that is deferred to the task thread. PR kern/57965 To generate a diff of this commit: cvs rdiff -u -r1.108 -r1.109 src/sys/dev/usb/if_urtwn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/if_urtwn.c diff -u src/sys/dev/usb/if_urtwn.c:1.108 src/sys/dev/usb/if_urtwn.c:1.109 --- src/sys/dev/usb/if_urtwn.c:1.108 Sat Jan 6 00:26:26 2024 +++ src/sys/dev/usb/if_urtwn.c Wed Feb 28 20:18:13 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: if_urtwn.c,v 1.108 2024/01/06 00:26:26 maya Exp $ */ +/* $NetBSD: if_urtwn.c,v 1.109 2024/02/28 20:18:13 riastradh Exp $ */ /* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */ /*- @@ -25,7 +25,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.108 2024/01/06 00:26:26 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.109 2024/02/28 20:18:13 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -872,6 +872,24 @@ urtwn_tx_beacon(struct urtwn_softc *sc, } static void +urtwn_cmdq_invariants(struct urtwn_softc *sc) +{ + struct urtwn_host_cmd_ring *const ring = &sc->cmdq; + + KASSERT(mutex_owned(&sc->sc_task_mtx)); + KASSERTMSG((ring->cur >= 0 && ring->cur < URTWN_HOST_CMD_RING_COUNT), + "%s: cur=%d next=%d queued=%d", + device_xname(sc->sc_dev), ring->cur, ring->next, ring->queued); + KASSERTMSG((ring->next >= 0 && ring->next < URTWN_HOST_CMD_RING_COUNT), + "%s: cur=%d next=%d queued=%d", + device_xname(sc->sc_dev), ring->cur, ring->next, ring->queued); + KASSERTMSG((ring->queued >= 0 && + ring->queued <= URTWN_HOST_CMD_RING_COUNT), + "%s: %d commands queued", + device_xname(sc->sc_dev), ring->queued); +} + +static void urtwn_task(void *arg) { struct urtwn_softc *sc = arg; @@ -903,7 +921,11 @@ urtwn_task(void *arg) /* Process host commands. */ s = splusb(); mutex_spin_enter(&sc->sc_task_mtx); + urtwn_cmdq_invariants(sc); while (ring->next != ring->cur) { + KASSERTMSG(ring->queued > 0, "%s: cur=%d next=%d queued=%d", + device_xname(sc->sc_dev), + ring->cur, ring->next, ring->queued); cmd = &ring->cmd[ring->next]; mutex_spin_exit(&sc->sc_task_mtx); splx(s); @@ -911,6 +933,10 @@ urtwn_task(void *arg) cmd->cb(sc, cmd->data); s = splusb(); mutex_spin_enter(&sc->sc_task_mtx); + urtwn_cmdq_invariants(sc); + KASSERTMSG(ring->queued > 0, "%s: cur=%d next=%d queued=%d", + device_xname(sc->sc_dev), + ring->cur, ring->next, ring->queued); ring->queued--; ring->next = (ring->next + 1) % URTWN_HOST_CMD_RING_COUNT; } @@ -925,6 +951,7 @@ urtwn_do_async(struct urtwn_softc *sc, v { struct urtwn_host_cmd_ring *ring = &sc->cmdq; struct urtwn_host_cmd *cmd; + bool schedtask = false; int s; URTWNHIST_FUNC(); @@ -933,19 +960,27 @@ urtwn_do_async(struct urtwn_softc *sc, v s = splusb(); mutex_spin_enter(&sc->sc_task_mtx); + urtwn_cmdq_invariants(sc); cmd = &ring->cmd[ring->cur]; cmd->cb = cb; KASSERT(len <= sizeof(cmd->data)); memcpy(cmd->data, arg, len); ring->cur = (ring->cur + 1) % URTWN_HOST_CMD_RING_COUNT; - /* If there is no pending command already, schedule a task. */ - if (!sc->sc_dying && ++ring->queued == 1) { - mutex_spin_exit(&sc->sc_task_mtx); - usb_add_task(sc->sc_udev, &sc->sc_task, USB_TASKQ_DRIVER); - } else - mutex_spin_exit(&sc->sc_task_mtx); + /* + * Schedule a task to process the command if need be. + */ + if (!sc->sc_dying) { + if (ring->queued == URTWN_HOST_CMD_RING_COUNT) + device_printf(sc->sc_dev, "command queue overflow\n"); + else if (ring->queued++ == 0) + schedtask = true; + } + mutex_spin_exit(&sc->sc_task_mtx); splx(s); + + if (schedtask) + usb_add_task(sc->sc_udev, &sc->sc_task, USB_TASKQ_DRIVER); } static void
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Wed Feb 28 20:18:13 UTC 2024 Modified Files: src/sys/dev/usb: if_urtwn.c Log Message: urtwn(4): Ditch old queued commands on overflow. Don't increment ring->queued past what the task will decrement. This is a stop-gap measure; really, we should just have one task for each operation that is deferred to the task thread. PR kern/57965 To generate a diff of this commit: cvs rdiff -u -r1.108 -r1.109 src/sys/dev/usb/if_urtwn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Tue Feb 6 23:57:41 UTC 2024 Modified Files: src/sys/dev/usb: ehci.c ehcireg.h Log Message: avoid different struct type problem. To generate a diff of this commit: cvs rdiff -u -r1.321 -r1.322 src/sys/dev/usb/ehci.c cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/ehcireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ehci.c diff -u src/sys/dev/usb/ehci.c:1.321 src/sys/dev/usb/ehci.c:1.322 --- src/sys/dev/usb/ehci.c:1.321 Mon Feb 5 23:04:18 2024 +++ src/sys/dev/usb/ehci.c Tue Feb 6 23:57:41 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.321 2024/02/05 23:04:18 jmcneill Exp $ */ +/* $NetBSD: ehci.c,v 1.322 2024/02/06 23:57:41 mrg Exp $ */ /* * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc. @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.321 2024/02/05 23:04:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.322 2024/02/06 23:57:41 mrg Exp $"); #include "ohci.h" #include "uhci.h" @@ -294,6 +294,7 @@ void ehci_dump(void); Static void ehci_dump_regs(ehci_softc_t *); Static void ehci_dump_sqtds(ehci_soft_qtd_t *); Static void ehci_dump_sqtd(ehci_soft_qtd_t *); +Static void ehci_dump_qh_qtd(struct ehci_qh_qtd_t *); Static void ehci_dump_qtd(ehci_qtd_t *); Static void ehci_dump_sqh(ehci_soft_qh_t *); Static void ehci_dump_sitd(struct ehci_soft_itd *); @@ -1755,6 +1756,24 @@ ehci_dump_sqtd(ehci_soft_qtd_t *sqtd) } Static void +ehci_dump_qh_qtd(struct ehci_qh_qtd_t *qh_qtd) +{ + ehci_qtd_t qtd = { + .qtd_next = qh_qtd->qtd_next, + .qtd_altnext = qh_qtd->qtd_altnext, + .qtd_status = qh_qtd->qtd_status, + }; + + /* Manually memcpy(), because of volatile. */ + for (unsigned i = 0; i < EHCI_QTD_NBUFFERS; i++) { + qtd.qtd_buffer[i] = qh_qtd->qtd_buffer[i]; + qtd.qtd_buffer_hi[i] = qh_qtd->qtd_buffer_hi[i]; + } + + ehci_dump_qtd(&qtd); +} + +Static void ehci_dump_qtd(ehci_qtd_t *qtd) { EHCIHIST_FUNC(); EHCIHIST_CALLED(); @@ -1830,7 +1849,7 @@ ehci_dump_sqh(ehci_soft_qh_t *sqh) link = le32toh(qh->qh_curqtd); ehci_dump_link(link, false); DPRINTFN(10, "Overlay qTD:", 0, 0, 0, 0); - ehci_dump_qtd(&qh->qh_qtd); + ehci_dump_qh_qtd(&qh->qh_qtd); usb_syncmem(&sqh->dma, sqh->offs, sizeof(sqh->qh), BUS_DMASYNC_PREREAD); Index: src/sys/dev/usb/ehcireg.h diff -u src/sys/dev/usb/ehcireg.h:1.38 src/sys/dev/usb/ehcireg.h:1.39 --- src/sys/dev/usb/ehcireg.h:1.38 Mon Feb 5 23:07:42 2024 +++ src/sys/dev/usb/ehcireg.h Tue Feb 6 23:57:41 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ehcireg.h,v 1.38 2024/02/05 23:07:42 jmcneill Exp $ */ +/* $NetBSD: ehcireg.h,v 1.39 2024/02/06 23:57:41 mrg Exp $ */ /* * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc. @@ -394,7 +394,7 @@ typedef struct { * 32-byte aligned, so declare the fields instead of embedding * a ehci_qtd_t directly. */ - struct { + struct ehci_qh_qtd_t { volatile ehci_link_t qtd_next; volatile ehci_link_t qtd_altnext; volatile uint32_t qtd_status;
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Tue Feb 6 23:57:41 UTC 2024 Modified Files: src/sys/dev/usb: ehci.c ehcireg.h Log Message: avoid different struct type problem. To generate a diff of this commit: cvs rdiff -u -r1.321 -r1.322 src/sys/dev/usb/ehci.c cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/ehcireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Mon Feb 5 23:07:42 UTC 2024 Modified Files: src/sys/dev/usb: ehcireg.h Log Message: Ensure proper alignment/padding of EHCI hardware descriptors. These descriptor structs are embedded in structs that contain additional context for software. With a non cache coherent device and non-padded descriptors, the device may issue a read/modify/write past the end of the descriptor, clobbering software state in the process. This was the root cause of multiple crashes on evbppc with a non cache coherent EHCI. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/dev/usb/ehcireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Mon Feb 5 23:07:42 UTC 2024 Modified Files: src/sys/dev/usb: ehcireg.h Log Message: Ensure proper alignment/padding of EHCI hardware descriptors. These descriptor structs are embedded in structs that contain additional context for software. With a non cache coherent device and non-padded descriptors, the device may issue a read/modify/write past the end of the descriptor, clobbering software state in the process. This was the root cause of multiple crashes on evbppc with a non cache coherent EHCI. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/dev/usb/ehcireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ehcireg.h diff -u src/sys/dev/usb/ehcireg.h:1.37 src/sys/dev/usb/ehcireg.h:1.38 --- src/sys/dev/usb/ehcireg.h:1.37 Sat Apr 23 10:15:31 2016 +++ src/sys/dev/usb/ehcireg.h Mon Feb 5 23:07:42 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ehcireg.h,v 1.37 2016/04/23 10:15:31 skrll Exp $ */ +/* $NetBSD: ehcireg.h,v 1.38 2024/02/05 23:07:42 jmcneill Exp $ */ /* * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc. @@ -203,6 +203,7 @@ typedef uint32_t ehci_isoc_trans_t; typedef uint32_t ehci_isoc_bufr_ptr_t; /* Isochronous Transfer Descriptor */ +#define EHCI_ITD_ALIGN 32 #define EHCI_ITD_NUFRAMES USB_UFRAMES_PER_FRAME #define EHCI_ITD_NBUFFERS 7 typedef struct { @@ -247,10 +248,10 @@ typedef struct { #define EHCI_ITD_GET_MULTI(x) __SHIFTOUT((x), EHCI_ITD_MULTI_MASK) #define EHCI_ITD_SET_MULTI(x) __SHIFTIN((x), EHCI_ITD_MULTI_MASK) volatile ehci_isoc_bufr_ptr_t itd_bufr_hi[EHCI_ITD_NBUFFERS]; -} ehci_itd_t; -#define EHCI_ITD_ALIGN 32 +} __aligned(EHCI_ITD_ALIGN) ehci_itd_t; /* Split Transaction Isochronous Transfer Descriptor */ +#define EHCI_SITD_ALIGN 32 typedef struct { volatile ehci_link_t sitd_next; volatile uint32_t sitd_endp; @@ -294,12 +295,12 @@ typedef struct { volatile ehci_link_t sitd_back; volatile uint32_t sitd_buffer_hi[EHCI_SITD_BUFFERS]; -} ehci_sitd_t; -#define EHCI_SITD_ALIGN 32 +} __aligned(EHCI_SITD_ALIGN) ehci_sitd_t; /* Queue Element Transfer Descriptor */ #define EHCI_QTD_NBUFFERS 5 #define EHCI_QTD_MAXTRANSFER (EHCI_QTD_NBUFFERS * EHCI_PAGE_SIZE) +#define EHCI_QTD_ALIGN 32 typedef struct { volatile ehci_link_t qtd_next; volatile ehci_link_t qtd_altnext; @@ -338,10 +339,10 @@ typedef struct { #define EHCI_QTD_SET_TOGGLE(x) __SHIFTIN((x), EHCI_QTD_TOGGLE_MASK) volatile ehci_physaddr_t qtd_buffer[EHCI_QTD_NBUFFERS]; volatile ehci_physaddr_t qtd_buffer_hi[EHCI_QTD_NBUFFERS]; -} ehci_qtd_t; -#define EHCI_QTD_ALIGN 32 +} __aligned(EHCI_QTD_ALIGN) ehci_qtd_t; /* Queue Head */ +#define EHCI_QH_ALIGN 32 typedef struct { volatile ehci_link_t qh_link; volatile uint32_t qh_endp; @@ -388,16 +389,26 @@ typedef struct { #define EHCI_QH_GET_MULT(x) __SHIFTOUT((x), EHCI_QH_MULTI_MASK) #define EHCI_QH_SET_MULT(x) __SHIFTIN((x), EHCI_QH_MULTI_MASK) volatile ehci_link_t qh_curqtd; - ehci_qtd_t qh_qtd; -} ehci_qh_t; -#define EHCI_QH_ALIGN 32 + /* + * The QH descriptor contains a TD overlay, but it is not + * 32-byte aligned, so declare the fields instead of embedding + * a ehci_qtd_t directly. + */ + struct { + volatile ehci_link_t qtd_next; + volatile ehci_link_t qtd_altnext; + volatile uint32_t qtd_status; + volatile ehci_physaddr_t qtd_buffer[EHCI_QTD_NBUFFERS]; + volatile ehci_physaddr_t qtd_buffer_hi[EHCI_QTD_NBUFFERS]; + } qh_qtd; +} __aligned(EHCI_QH_ALIGN) ehci_qh_t; /* Periodic Frame Span Traversal Node */ +#define EHCI_FSTN_ALIGN 32 typedef struct { volatile ehci_link_t fstn_link; volatile ehci_link_t fstn_back; -} ehci_fstn_t; -#define EHCI_FSTN_ALIGN 32 +} __aligned(EHCI_FSTN_ALIGN) ehci_fstn_t; /* Debug Port */ #define PCI_CAP_DEBUGPORT_OFFSET __BITS(28,16)
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Mon Feb 5 23:04:18 UTC 2024 Modified Files: src/sys/dev/usb: ehci.c Log Message: Fix DMA sync flags in ehci_append_sqtd To generate a diff of this commit: cvs rdiff -u -r1.320 -r1.321 src/sys/dev/usb/ehci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Mon Feb 5 23:04:18 UTC 2024 Modified Files: src/sys/dev/usb: ehci.c Log Message: Fix DMA sync flags in ehci_append_sqtd To generate a diff of this commit: cvs rdiff -u -r1.320 -r1.321 src/sys/dev/usb/ehci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ehci.c diff -u src/sys/dev/usb/ehci.c:1.320 src/sys/dev/usb/ehci.c:1.321 --- src/sys/dev/usb/ehci.c:1.320 Sun Feb 4 05:43:06 2024 +++ src/sys/dev/usb/ehci.c Mon Feb 5 23:04:18 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.320 2024/02/04 05:43:06 mrg Exp $ */ +/* $NetBSD: ehci.c,v 1.321 2024/02/05 23:04:18 jmcneill Exp $ */ /* * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc. @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.320 2024/02/04 05:43:06 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.321 2024/02/05 23:04:18 jmcneill Exp $"); #include "ohci.h" #include "uhci.h" @@ -3065,7 +3065,7 @@ ehci_append_sqtd(ehci_soft_qtd_t *sqtd, prev->qtd.qtd_next = htole32(sqtd->physaddr); prev->qtd.qtd_altnext = prev->qtd.qtd_next; usb_syncmem(&prev->dma, prev->offs, sizeof(prev->qtd), - BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } }
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Sat Jan 20 21:09:28 UTC 2024 Modified Files: src/sys/dev/usb: usb.h Log Message: usb: increase USB_PORT_RESET_RECOVERY from 10ms to 20ms I changed this from 250ms to 10ms back in 2021 based on a similar FreeBSD change, but it seems to be a bit too aggressive for some platforms. To generate a diff of this commit: cvs rdiff -u -r1.123 -r1.124 src/sys/dev/usb/usb.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usb.h diff -u src/sys/dev/usb/usb.h:1.123 src/sys/dev/usb/usb.h:1.124 --- src/sys/dev/usb/usb.h:1.123 Mon Jul 31 23:52:12 2023 +++ src/sys/dev/usb/usb.h Sat Jan 20 21:09:28 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: usb.h,v 1.123 2023/07/31 23:52:12 christos Exp $ */ +/* $NetBSD: usb.h,v 1.124 2024/01/20 21:09:28 jmcneill Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -778,7 +778,7 @@ typedef struct { /* Allow for marginal (i.e. non-conforming) devices. */ #define USB_PORT_RESET_DELAY 50 /* ms */ #define USB_PORT_ROOT_RESET_DELAY 250 /* ms */ -#define USB_PORT_RESET_RECOVERY 10 /* ms */ +#define USB_PORT_RESET_RECOVERY 20 /* ms */ #define USB_PORT_POWERUP_DELAY 300 /* ms */ #define USB_SET_ADDRESS_SETTLE 10 /* ms */ #define USB_RESUME_DELAY (50*5) /* ms */
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Sat Jan 20 21:09:28 UTC 2024 Modified Files: src/sys/dev/usb: usb.h Log Message: usb: increase USB_PORT_RESET_RECOVERY from 10ms to 20ms I changed this from 250ms to 10ms back in 2021 based on a similar FreeBSD change, but it seems to be a bit too aggressive for some platforms. To generate a diff of this commit: cvs rdiff -u -r1.123 -r1.124 src/sys/dev/usb/usb.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Sat Jan 20 00:51:29 UTC 2024 Modified Files: src/sys/dev/usb: ehcivar.h Log Message: ehci: add EHCIF_32BIT_ACCESS flag to force 32-bit MMIO To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/usb/ehcivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ehcivar.h diff -u src/sys/dev/usb/ehcivar.h:1.51 src/sys/dev/usb/ehcivar.h:1.52 --- src/sys/dev/usb/ehcivar.h:1.51 Sun Mar 13 11:29:21 2022 +++ src/sys/dev/usb/ehcivar.h Sat Jan 20 00:51:29 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ehcivar.h,v 1.51 2022/03/13 11:29:21 riastradh Exp $ */ +/* $NetBSD: ehcivar.h,v 1.52 2024/01/20 00:51:29 jmcneill Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -178,6 +178,7 @@ typedef struct ehci_softc { int sc_flags; /* misc flags */ #define EHCIF_DROPPED_INTR_WORKAROUND 0x01 #define EHCIF_ETTF 0x02 /* Emb. Transaction Translater func. */ +#define EHCIF_32BIT_ACCESS 0x04 /* 32-bit MMIO access req'd */ uint32_t sc_cmd; /* shadow of cmd reg during suspend */ @@ -235,17 +236,75 @@ typedef struct ehci_softc { int (*sc_vendor_port_status)(struct ehci_softc *, uint32_t, int); } ehci_softc_t; -#define EREAD1(sc, a) bus_space_read_1((sc)->iot, (sc)->ioh, (a)) -#define EREAD2(sc, a) bus_space_read_2((sc)->iot, (sc)->ioh, (a)) +static inline uint8_t +ehci_read_1(struct ehci_softc *sc, u_int offset) +{ + if (ISSET(sc->sc_flags, EHCIF_32BIT_ACCESS)) { + uint32_t val; + + val = bus_space_read_4(sc->iot, sc->ioh, offset & ~3); + return (val >> ((offset & 3) * NBBY)) & 0xff; + } else { + return bus_space_read_1(sc->iot, sc->ioh, offset); + } +} + +static inline uint16_t +ehci_read_2(struct ehci_softc *sc, u_int offset) +{ + if (ISSET(sc->sc_flags, EHCIF_32BIT_ACCESS)) { + uint32_t val; + + val = bus_space_read_4(sc->iot, sc->ioh, offset & ~3); + return (val >> ((offset & 3) * NBBY)) & 0x; + } else { + return bus_space_read_2(sc->iot, sc->ioh, offset); + } +} + +static inline void +ehci_write_1(struct ehci_softc *sc, u_int offset, uint8_t data) +{ + if (ISSET(sc->sc_flags, EHCIF_32BIT_ACCESS)) { + const uint32_t mask = 0xffU << ((offset & 3) * NBBY); + uint32_t val; + + val = bus_space_read_4(sc->iot, sc->ioh, offset & ~3); + val &= ~mask; + val |= __SHIFTIN(data, mask); + bus_space_write_4(sc->iot, sc->ioh, offset & ~3, val); + } else { + bus_space_write_1(sc->iot, sc->ioh, offset, data); + } +} + +static inline void +ehci_write_2(struct ehci_softc *sc, u_int offset, uint16_t data) +{ + if (ISSET(sc->sc_flags, EHCIF_32BIT_ACCESS)) { + const uint32_t mask = 0xU << ((offset & 3) * NBBY); + uint32_t val; + + val = bus_space_read_4(sc->iot, sc->ioh, offset & ~3); + val &= ~mask; + val |= __SHIFTIN(data, mask); + bus_space_write_4(sc->iot, sc->ioh, offset & ~3, val); + } else { + bus_space_write_2(sc->iot, sc->ioh, offset, data); + } +} + +#define EREAD1(sc, a) ehci_read_1((sc), (a)) +#define EREAD2(sc, a) ehci_read_2((sc), (a)) #define EREAD4(sc, a) bus_space_read_4((sc)->iot, (sc)->ioh, (a)) -#define EWRITE1(sc, a, x) bus_space_write_1((sc)->iot, (sc)->ioh, (a), (x)) -#define EWRITE2(sc, a, x) bus_space_write_2((sc)->iot, (sc)->ioh, (a), (x)) +#define EWRITE1(sc, a, x) ehci_write_1((sc), (a), (x)) +#define EWRITE2(sc, a, x) ehci_write_2((sc), (a), (x)) #define EWRITE4(sc, a, x) bus_space_write_4((sc)->iot, (sc)->ioh, (a), (x)) -#define EOREAD1(sc, a) bus_space_read_1((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a)) -#define EOREAD2(sc, a) bus_space_read_2((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a)) +#define EOREAD1(sc, a) ehci_read_1((sc), (sc)->sc_offs+(a)) +#define EOREAD2(sc, a) ehci_read_2((sc), (sc)->sc_offs+(a)) #define EOREAD4(sc, a) bus_space_read_4((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a)) -#define EOWRITE1(sc, a, x) bus_space_write_1((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a), (x)) -#define EOWRITE2(sc, a, x) bus_space_write_2((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a), (x)) +#define EOWRITE1(sc, a, x) ehci_write_1((sc), (sc)->sc_offs+(a), (x)) +#define EOWRITE2(sc, a, x) ehci_write_2((sc), (sc)->sc_offs+(a), (x)) #define EOWRITE4(sc, a, x) bus_space_write_4((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a), (x)) int ehci_init(ehci_softc_t *);
CVS commit: src/sys/dev/usb
Module Name:src Committed By: jmcneill Date: Sat Jan 20 00:51:29 UTC 2024 Modified Files: src/sys/dev/usb: ehcivar.h Log Message: ehci: add EHCIF_32BIT_ACCESS flag to force 32-bit MMIO To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/usb/ehcivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: andvar Date: Sun Jan 14 12:53:41 UTC 2024 Modified Files: src/sys/dev/usb: uftdireg.h Log Message: s/asynchrounous/asynchronous/, s/assistence/assistance/ in comments. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/usb/uftdireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/uftdireg.h diff -u src/sys/dev/usb/uftdireg.h:1.11 src/sys/dev/usb/uftdireg.h:1.12 --- src/sys/dev/usb/uftdireg.h:1.11 Fri Sep 13 20:50:45 2019 +++ src/sys/dev/usb/uftdireg.h Sun Jan 14 12:53:41 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: uftdireg.h,v 1.11 2019/09/13 20:50:45 ryo Exp $ */ +/* $NetBSD: uftdireg.h,v 1.12 2024/01/14 12:53:41 andvar Exp $ */ /* * Definitions for the FTDI USB Single Port Serial Converter - @@ -8,7 +8,7 @@ * USB on the other. * * Thanx to FTDI (http://www.ftdichip.com) for so kindly providing details - * of the protocol required to talk to the device and ongoing assistence + * of the protocol required to talk to the device and ongoing assistance * during development. * * Bill Ryder - bry...@sgi.com of Silicon Graphics, Inc. is the original @@ -343,7 +343,7 @@ enum { */ /* FTDI_SIO_SET_BITMODE */ #define FTDI_BITMODE_RESET 0x00 /* UART mode */ -#define FTDI_BITMODE_BITBANG 0x01 /* asynchrounous bitbang mode */ +#define FTDI_BITMODE_BITBANG 0x01 /* asynchronous bitbang mode */ #define FTDI_BITMODE_MPSSE 0x02 /* MPSSE mode */ #define FTDI_BITMODE_SYNCBB 0x04 /* synchronous bitbang mode */ #define FTDI_BITMODE_MCU 0x08 /* MCU Host Bus Emulation mode */
CVS commit: src/sys/dev/usb
Module Name:src Committed By: andvar Date: Sun Jan 14 12:53:41 UTC 2024 Modified Files: src/sys/dev/usb: uftdireg.h Log Message: s/asynchrounous/asynchronous/, s/assistence/assistance/ in comments. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/usb/uftdireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sat Jan 13 18:22:13 UTC 2024 Modified Files: src/sys/dev/usb: usbdi.c Log Message: usbdi(9): Assert not polling in abort path. XXX Not sure if this is safe. To generate a diff of this commit: cvs rdiff -u -r1.249 -r1.250 src/sys/dev/usb/usbdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdi.c diff -u src/sys/dev/usb/usbdi.c:1.249 src/sys/dev/usb/usbdi.c:1.250 --- src/sys/dev/usb/usbdi.c:1.249 Sat Jan 13 12:42:10 2024 +++ src/sys/dev/usb/usbdi.c Sat Jan 13 18:22:13 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.249 2024/01/13 12:42:10 riastradh Exp $ */ +/* $NetBSD: usbdi.c,v 1.250 2024/01/13 18:22:13 riastradh Exp $ */ /* * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.249 2024/01/13 12:42:10 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.250 2024/01/13 18:22:13 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -417,11 +417,9 @@ usbd_transfer(struct usbd_xfer *xfer) * XXX For synchronous transfers this is fine. What to * do for asynchronous transfers? The callback is * never run, not even with status USBD_CANCELLED. - * - * XXX Does it make sense to abort while polling? */ - if (pipe->up_dev->ud_bus->ub_usepolling == 0) - usbd_unlock_pipe(pipe); + KASSERT(pipe->up_dev->ud_bus->ub_usepolling == 0); + usbd_unlock_pipe(pipe); USBHIST_LOG(usbdebug, "<- done xfer %#jx, aborting", (uintptr_t)xfer, 0, 0, 0); SDT_PROBE2(usb, device, xfer, done, xfer, USBD_CANCELLED); @@ -1036,6 +1034,7 @@ usbd_ar_pipe(struct usbd_pipe *pipe) ASSERT_SLEEPABLE(); KASSERT(mutex_owned(pipe->up_dev->ud_bus->ub_lock)); + KASSERT(pipe->up_dev->ud_bus->ub_usepolling == 0); /* * Allow only one thread at a time to abort the pipe, so we
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sat Jan 13 18:22:13 UTC 2024 Modified Files: src/sys/dev/usb: usbdi.c Log Message: usbdi(9): Assert not polling in abort path. XXX Not sure if this is safe. To generate a diff of this commit: cvs rdiff -u -r1.249 -r1.250 src/sys/dev/usb/usbdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: hgutch Date: Sat Jan 13 15:26:36 UTC 2024 Modified Files: src/sys/dev/usb: ums.c Log Message: Add workaround for Microsoft Sculpt Wireless keyboard/mouse. >From M. Boerschig in PR 57845. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/dev/usb/ums.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ums.c diff -u src/sys/dev/usb/ums.c:1.104 src/sys/dev/usb/ums.c:1.105 --- src/sys/dev/usb/ums.c:1.104 Thu Jul 20 20:00:34 2023 +++ src/sys/dev/usb/ums.c Sat Jan 13 15:26:36 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: ums.c,v 1.104 2023/07/20 20:00:34 mrg Exp $ */ +/* $NetBSD: ums.c,v 1.105 2024/01/13 15:26:36 hgutch Exp $ */ /* * Copyright (c) 1998, 2017 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.104 2023/07/20 20:00:34 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.105 2024/01/13 15:26:36 hgutch Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -224,6 +224,7 @@ ums_attach(device_t parent, device_t sel fixpos = 24; break; case USB_PRODUCT_MICROSOFT_24GHZ_XCVR80: + case USB_PRODUCT_MICROSOFT_24GHZ_XCVR90: fixpos = 40; woffset = sc->sc_ms.hidms_loc_z.size; break;
CVS commit: src/sys/dev/usb
Module Name:src Committed By: hgutch Date: Sat Jan 13 15:26:36 UTC 2024 Modified Files: src/sys/dev/usb: ums.c Log Message: Add workaround for Microsoft Sculpt Wireless keyboard/mouse. >From M. Boerschig in PR 57845. To generate a diff of this commit: cvs rdiff -u -r1.104 -r1.105 src/sys/dev/usb/ums.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: hgutch Date: Sat Jan 13 15:22:41 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs.h usbdevs_data.h Log Message: Regen To generate a diff of this commit: cvs rdiff -u -r1.804 -r1.805 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: hgutch Date: Sat Jan 13 14:42:14 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs Log Message: Add Microsoft Sculpt Wireless keyboard/mouse. >From M. Boerschig in PR 57845. To generate a diff of this commit: cvs rdiff -u -r1.812 -r1.813 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: hgutch Date: Sat Jan 13 14:42:14 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs Log Message: Add Microsoft Sculpt Wireless keyboard/mouse. >From M. Boerschig in PR 57845. To generate a diff of this commit: cvs rdiff -u -r1.812 -r1.813 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs diff -u src/sys/dev/usb/usbdevs:1.812 src/sys/dev/usb/usbdevs:1.813 --- src/sys/dev/usb/usbdevs:1.812 Sat Jan 6 00:24:07 2024 +++ src/sys/dev/usb/usbdevs Sat Jan 13 14:42:14 2024 @@ -1,4 +1,4 @@ -$NetBSD: usbdevs,v 1.812 2024/01/06 00:24:07 maya Exp $ +$NetBSD: usbdevs,v 1.813 2024/01/13 14:42:14 hgutch Exp $ /*- * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -2368,6 +2368,7 @@ product MICROSOFT 24GHZ_XCVR10 0x071d 2 product MICROSOFT 24GHZ_XCVR20 0x071f 2.4GHz Transceiver V2.0 product MICROSOFT 24GHZ_XCVR70 0x0745 2.4GHz Transceiver V7.0 product MICROSOFT 24GHZ_XCVR80 0x07b2 2.4GHz Transceiver V8.0 +product MICROSOFT 24GHZ_XCVR90 0x07a5 2.4GHz Transceiver V9.0 product MICROSOFT CM6000 0x077d Comfort Mouse 6000
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sat Jan 13 12:42:10 UTC 2024 Modified Files: src/sys/dev/usb: usbdi.c Log Message: usbdi(9): Avoid taking locks in usbd_transfer while polling. PR kern/57783 XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.248 -r1.249 src/sys/dev/usb/usbdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdi.c diff -u src/sys/dev/usb/usbdi.c:1.248 src/sys/dev/usb/usbdi.c:1.249 --- src/sys/dev/usb/usbdi.c:1.248 Sat Jan 13 12:27:54 2024 +++ src/sys/dev/usb/usbdi.c Sat Jan 13 12:42:10 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.248 2024/01/13 12:27:54 riastradh Exp $ */ +/* $NetBSD: usbdi.c,v 1.249 2024/01/13 12:42:10 riastradh Exp $ */ /* * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.248 2024/01/13 12:27:54 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.249 2024/01/13 12:42:10 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -410,14 +410,18 @@ usbd_transfer(struct usbd_xfer *xfer) } } - usbd_lock_pipe(pipe); + if (pipe->up_dev->ud_bus->ub_usepolling == 0) + usbd_lock_pipe(pipe); if (pipe->up_aborting) { /* * XXX For synchronous transfers this is fine. What to * do for asynchronous transfers? The callback is * never run, not even with status USBD_CANCELLED. + * + * XXX Does it make sense to abort while polling? */ - usbd_unlock_pipe(pipe); + if (pipe->up_dev->ud_bus->ub_usepolling == 0) + usbd_unlock_pipe(pipe); USBHIST_LOG(usbdebug, "<- done xfer %#jx, aborting", (uintptr_t)xfer, 0, 0, 0); SDT_PROBE2(usb, device, xfer, done, xfer, USBD_CANCELLED); @@ -443,7 +447,8 @@ usbd_transfer(struct usbd_xfer *xfer) } while (0); SDT_PROBE3(usb, device, pipe, transfer__done, pipe, xfer, err); - usbd_unlock_pipe(pipe); + if (pipe->up_dev->ud_bus->ub_usepolling == 0) + usbd_unlock_pipe(pipe); if (err != USBD_IN_PROGRESS && err) { /* @@ -453,7 +458,8 @@ usbd_transfer(struct usbd_xfer *xfer) */ USBHIST_LOG(usbdebug, "xfer failed: %jd, reinserting", err, 0, 0, 0); - usbd_lock_pipe(pipe); + if (pipe->up_dev->ud_bus->ub_usepolling == 0) + usbd_lock_pipe(pipe); SDT_PROBE1(usb, device, xfer, preabort, xfer); #ifdef DIAGNOSTIC xfer->ux_state = XFER_BUSY; @@ -461,7 +467,8 @@ usbd_transfer(struct usbd_xfer *xfer) SIMPLEQ_REMOVE_HEAD(&pipe->up_queue, ux_next); if (pipe->up_serialise) usbd_start_next(pipe); - usbd_unlock_pipe(pipe); + if (pipe->up_dev->ud_bus->ub_usepolling == 0) + usbd_unlock_pipe(pipe); } if (!(flags & USBD_SYNCHRONOUS)) { @@ -480,7 +487,8 @@ usbd_transfer(struct usbd_xfer *xfer) } /* Sync transfer, wait for completion. */ - usbd_lock_pipe(pipe); + if (pipe->up_dev->ud_bus->ub_usepolling == 0) + usbd_lock_pipe(pipe); while (!xfer->ux_done) { if (pipe->up_dev->ud_bus->ub_usepolling) panic("usbd_transfer: not done"); @@ -503,7 +511,8 @@ usbd_transfer(struct usbd_xfer *xfer) } err = xfer->ux_status; SDT_PROBE2(usb, device, xfer, done, xfer, err); - usbd_unlock_pipe(pipe); + if (pipe->up_dev->ud_bus->ub_usepolling == 0) + usbd_unlock_pipe(pipe); return err; }
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sat Jan 13 12:42:10 UTC 2024 Modified Files: src/sys/dev/usb: usbdi.c Log Message: usbdi(9): Avoid taking locks in usbd_transfer while polling. PR kern/57783 XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.248 -r1.249 src/sys/dev/usb/usbdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sat Jan 13 12:27:54 UTC 2024 Modified Files: src/sys/dev/usb: usbdi.c Log Message: usbdi(9): Avoid calling ubm_softint with lock held and polling on. PR kern/57783 XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.247 -r1.248 src/sys/dev/usb/usbdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sat Jan 13 12:27:54 UTC 2024 Modified Files: src/sys/dev/usb: usbdi.c Log Message: usbdi(9): Avoid calling ubm_softint with lock held and polling on. PR kern/57783 XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.247 -r1.248 src/sys/dev/usb/usbdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdi.c diff -u src/sys/dev/usb/usbdi.c:1.247 src/sys/dev/usb/usbdi.c:1.248 --- src/sys/dev/usb/usbdi.c:1.247 Tue Sep 13 10:32:58 2022 +++ src/sys/dev/usb/usbdi.c Sat Jan 13 12:27:54 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.247 2022/09/13 10:32:58 riastradh Exp $ */ +/* $NetBSD: usbdi.c,v 1.248 2024/01/13 12:27:54 riastradh Exp $ */ /* * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.247 2022/09/13 10:32:58 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.248 2024/01/13 12:27:54 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -1362,14 +1362,34 @@ usbd_dopoll(struct usbd_interface *iface void usbd_set_polling(struct usbd_device *dev, int on) { - if (on) - dev->ud_bus->ub_usepolling++; - else - dev->ud_bus->ub_usepolling--; - /* Kick the host controller when switching modes */ mutex_enter(dev->ud_bus->ub_lock); - dev->ud_bus->ub_methods->ubm_softint(dev->ud_bus); + if (on) { + /* + * Enabling polling. If we're enabling for the first + * time, call the softint routine on transition while + * we hold the lock and polling is still disabled, and + * then enable polling -- once polling is enabled, we + * must not hold the lock when we call the softint + * routine. + */ + KASSERT(dev->ud_bus->ub_usepolling < __type_max(char)); + if (dev->ud_bus->ub_usepolling == 0) + dev->ud_bus->ub_methods->ubm_softint(dev->ud_bus); + dev->ud_bus->ub_usepolling++; + } else { + /* + * Disabling polling. If we're disabling polling for + * the last time, disable polling first and then call + * the softint routine while we hold the lock -- until + * polling is disabled, we must not hold the lock when + * we call the softint routine. + */ + KASSERT(dev->ud_bus->ub_usepolling > 0); + dev->ud_bus->ub_usepolling--; + if (dev->ud_bus->ub_usepolling == 0) + dev->ud_bus->ub_methods->ubm_softint(dev->ud_bus); + } mutex_exit(dev->ud_bus->ub_lock); }
CVS commit: src/sys/dev/usb
Module Name:src Committed By: gutteridge Date: Thu Jan 11 00:31:02 UTC 2024 Modified Files: src/sys/dev/usb: if_athn_usb.c Log Message: if_athn_usb.c: provide the usual device information To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/if_athn_usb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/if_athn_usb.c diff -u src/sys/dev/usb/if_athn_usb.c:1.38 src/sys/dev/usb/if_athn_usb.c:1.39 --- src/sys/dev/usb/if_athn_usb.c:1.38 Sat Mar 14 02:35:33 2020 +++ src/sys/dev/usb/if_athn_usb.c Thu Jan 11 00:31:02 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: if_athn_usb.c,v 1.38 2020/03/14 02:35:33 christos Exp $ */ +/* $NetBSD: if_athn_usb.c,v 1.39 2024/01/11 00:31:02 gutteridge Exp $ */ /* $OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $ */ /*- @@ -22,7 +22,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.38 2020/03/14 02:35:33 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.39 2024/01/11 00:31:02 gutteridge Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -247,6 +247,7 @@ athn_usb_attach(device_t parent, device_ struct athn_usb_softc *usc; struct athn_softc *sc; struct usb_attach_arg *uaa; + char *devinfop; int error; usc = device_private(self); @@ -258,6 +259,10 @@ athn_usb_attach(device_t parent, device_ aprint_naive("\n"); aprint_normal("\n"); + devinfop = usbd_devinfo_alloc(usc->usc_udev, 0); + aprint_normal_dev(sc->sc_dev, "%s\n", devinfop); + usbd_devinfo_free(devinfop); + DPRINTFN(DBG_FN, sc, "\n"); usc->usc_init_state = ATHN_INIT_NONE;
CVS commit: src/sys/dev/usb
Module Name:src Committed By: gutteridge Date: Thu Jan 11 00:31:02 UTC 2024 Modified Files: src/sys/dev/usb: if_athn_usb.c Log Message: if_athn_usb.c: provide the usual device information To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/if_athn_usb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maya Date: Sat Jan 6 00:26:26 UTC 2024 Modified Files: src/sys/dev/usb: if_urtwn.c Log Message: Add Mercusys NW150US V2 USB support No changes needed, other than recognizing it as working. >From Daeil Lee in PR/57819 To generate a diff of this commit: cvs rdiff -u -r1.107 -r1.108 src/sys/dev/usb/if_urtwn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maya Date: Sat Jan 6 00:26:26 UTC 2024 Modified Files: src/sys/dev/usb: if_urtwn.c Log Message: Add Mercusys NW150US V2 USB support No changes needed, other than recognizing it as working. >From Daeil Lee in PR/57819 To generate a diff of this commit: cvs rdiff -u -r1.107 -r1.108 src/sys/dev/usb/if_urtwn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/if_urtwn.c diff -u src/sys/dev/usb/if_urtwn.c:1.107 src/sys/dev/usb/if_urtwn.c:1.108 --- src/sys/dev/usb/if_urtwn.c:1.107 Tue Aug 1 07:04:16 2023 +++ src/sys/dev/usb/if_urtwn.c Sat Jan 6 00:26:26 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: if_urtwn.c,v 1.107 2023/08/01 07:04:16 mrg Exp $ */ +/* $NetBSD: if_urtwn.c,v 1.108 2024/01/06 00:26:26 maya Exp $ */ /* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */ /*- @@ -25,7 +25,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.107 2023/08/01 07:04:16 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.108 2024/01/06 00:26:26 maya Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -215,6 +215,7 @@ static const struct urtwn_dev { /* URTWN_RTL8188E */ URTWN_RTL8188E_DEV(DLINK, DWA125D1), URTWN_RTL8188E_DEV(ELECOM, WDC150SU2M), + URTWN_RTL8188E_DEV(MERCUSYS, MW150USV2), URTWN_RTL8188E_DEV(REALTEK, RTL8188ETV), URTWN_RTL8188E_DEV(REALTEK, RTL8188EU), URTWN_RTL8188E_DEV(ABOCOM, RTL8188EU),
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maya Date: Sat Jan 6 00:24:37 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs.h usbdevs_data.h Log Message: Regen usbdevs To generate a diff of this commit: cvs rdiff -u -r1.803 -r1.804 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maya Date: Sat Jan 6 00:24:07 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs Log Message: Add Mercusys and Mercusys MW150USV2 >From Daeil Lee in PR/57819 To generate a diff of this commit: cvs rdiff -u -r1.811 -r1.812 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs diff -u src/sys/dev/usb/usbdevs:1.811 src/sys/dev/usb/usbdevs:1.812 --- src/sys/dev/usb/usbdevs:1.811 Sun Dec 24 02:42:51 2023 +++ src/sys/dev/usb/usbdevs Sat Jan 6 00:24:07 2024 @@ -1,4 +1,4 @@ -$NetBSD: usbdevs,v 1.811 2023/12/24 02:42:51 gutteridge Exp $ +$NetBSD: usbdevs,v 1.812 2024/01/06 00:24:07 maya Exp $ /*- * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -586,6 +586,7 @@ vendor HIROSE 0x2631 Hirose Electric vendor ONEPLUS 0x2717 ONEPLUS vendor NHJ 0x2770 NHJ vendor PLANEX 0x2c02 Planex Communications +vendor MERCUSYS 0x2c4e Mercusys vendor VIDZMEDIA 0x3275 VidzMedia Pte Ltd vendor AEI 0x3334 AEI vendor HANK 0x3353 Hank Connection @@ -2288,6 +2289,9 @@ product MELCO WLIUCGNM 0x01a2 WLI-UC-GN product MELCO WLIUCGNM2T 0x01ee WLI-UC-GNM2T product MELCO WIU2300D 0x0241 WI-U2-300D +/* Mercusys products */ +product MERCUSYS MW150USV2 0x0102 MW150US V2 + /* Merlin products */ product MERLIN V620 0x1110 Merlin V620
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maya Date: Sat Jan 6 00:24:07 UTC 2024 Modified Files: src/sys/dev/usb: usbdevs Log Message: Add Mercusys and Mercusys MW150USV2 >From Daeil Lee in PR/57819 To generate a diff of this commit: cvs rdiff -u -r1.811 -r1.812 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: gutteridge Date: Sun Dec 24 02:47:47 UTC 2023 Modified Files: src/sys/dev/usb: usbdevs.h usbdevs_data.h Log Message: usbdevs.h & usbdevs_data.h: regen To generate a diff of this commit: cvs rdiff -u -r1.802 -r1.803 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs.h diff -u src/sys/dev/usb/usbdevs.h:1.802 src/sys/dev/usb/usbdevs.h:1.803 --- src/sys/dev/usb/usbdevs.h:1.802 Mon Dec 11 13:35:40 2023 +++ src/sys/dev/usb/usbdevs.h Sun Dec 24 02:47:47 2023 @@ -1,10 +1,10 @@ -/* $NetBSD: usbdevs.h,v 1.802 2023/12/11 13:35:40 mlelstv Exp $ */ +/* $NetBSD: usbdevs.h,v 1.803 2023/12/24 02:47:47 gutteridge Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: usbdevs,v 1.810 2023/12/11 13:33:35 mlelstv Exp + * NetBSD: usbdevs,v 1.811 2023/12/24 02:42:51 gutteridge Exp */ /*- @@ -2929,6 +2929,7 @@ #define USB_PRODUCT_REALTEK_RTL8713 0x8713 /* RTL8713 */ #define USB_PRODUCT_REALTEK_RTL8188CU_COMBO 0x8754 /* RTL8188CU */ #define USB_PRODUCT_REALTEK_RTL8192SU 0xc512 /* RTL8192SU */ +#define USB_PRODUCT_REALTEK_RTL8188FU 0xf179 /* RTL8188FU */ /* Research In Motion */ #define USB_PRODUCT_RIM_BLACKBERRY 0x0001 /* BlackBerry */ Index: src/sys/dev/usb/usbdevs_data.h diff -u src/sys/dev/usb/usbdevs_data.h:1.802 src/sys/dev/usb/usbdevs_data.h:1.803 --- src/sys/dev/usb/usbdevs_data.h:1.802 Mon Dec 11 13:35:40 2023 +++ src/sys/dev/usb/usbdevs_data.h Sun Dec 24 02:47:47 2023 @@ -1,10 +1,10 @@ -/* $NetBSD: usbdevs_data.h,v 1.802 2023/12/11 13:35:40 mlelstv Exp $ */ +/* $NetBSD: usbdevs_data.h,v 1.803 2023/12/24 02:47:47 gutteridge Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: usbdevs,v 1.810 2023/12/11 13:33:35 mlelstv Exp + * NetBSD: usbdevs,v 1.811 2023/12/24 02:42:51 gutteridge Exp */ /*- @@ -3968,162 +3968,164 @@ static const uint32_t usb_products[] = { 5293, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8192SU, 5431, 0, - USB_VENDOR_RIM, USB_PRODUCT_RIM_BLACKBERRY, + USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8188FU, 17332, 0, + USB_VENDOR_RIM, USB_PRODUCT_RIM_BLACKBERRY, + 17342, 0, USB_VENDOR_RIM, USB_PRODUCT_RIM_BLACKBERRY_PEARL_DUAL, - 17332, 17343, 13673, 0, + 17342, 17353, 13673, 0, USB_VENDOR_RIM, USB_PRODUCT_RIM_BLACKBERRY_PEARL, - 17332, 17343, 0, + 17342, 17353, 0, USB_VENDOR_ROCKFIRE, USB_PRODUCT_ROCKFIRE_GAMEPAD, - 12974, 17349, 0, + 12974, 17359, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_UA100, - 17356, 4959, 7316, 17363, 0, + 17366, 4959, 7316, 17373, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_UM4, - 17367, 17372, 17363, 0, + 17377, 17382, 17373, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_SC8850, - 17377, 17386, 17394, 17400, 17372, 17407, 0, + 17387, 17396, 17404, 17410, 17382, 17417, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_U8, - 17414, 4959, 7316, 17363, 0, + 17424, 4959, 7316, 17373, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_UM2, - 17418, 17372, 17363, 0, + 17428, 17382, 17373, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_SC8820, - 17423, 17435, 17372, 17407, 0, + 17433, 17445, 17382, 17417, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_PC300, - 17443, 17372, 5993, 0, + 17453, 17382, 5993, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_UM1, - 17450, 17372, 17363, 0, + 17460, 17382, 17373, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_SK500, - 17423, 17455, 17372, 5993, 0, + 17433, 17465, 17382, 5993, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_SCD70, - 17462, 17372, 17407, 0, + 17472, 17382, 17417, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_UA3, - 17469, 17476, 4959, 17481, 17363, 0, + 17479, 17486, 4959, 17491, 17373, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_XV5050, - 17487, 17372, 17407, 0, + 17497, 17382, 17417, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_UM880N, - 17469, 17495, 17372, 17363, 17502, 0, + 17479, 17505, 17382, 17373, 17512, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_UM880G, - 17469, 17495, 17372, 17363, 17511, 0, + 17479, 17505, 17382, 17373, 17521, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_SD90, - 17469, 17521, 17527, 17400, 17372, 17407, 0, + 17479, 17531, 17537, 17410, 17382, 17417, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_UA1A, - 17533, 4959, 7316, 17363, 0, + 17543, 4959, 7316, 17373, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_UM550, - 17539, 17372, 17363, 0, + 17549, 17382, 17373, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_SD20, - 17546, 17372, 17407, 0, + 17556, 17382, 17417, 0, USB_VENDOR_ROLAND, USB_PRO
CVS commit: src/sys/dev/usb
Module Name:src Committed By: gutteridge Date: Sun Dec 24 02:47:47 UTC 2023 Modified Files: src/sys/dev/usb: usbdevs.h usbdevs_data.h Log Message: usbdevs.h & usbdevs_data.h: regen To generate a diff of this commit: cvs rdiff -u -r1.802 -r1.803 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: gutteridge Date: Sun Dec 24 02:42:51 UTC 2023 Modified Files: src/sys/dev/usb: usbdevs Log Message: usbdevs: add RTL8188FU To generate a diff of this commit: cvs rdiff -u -r1.810 -r1.811 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs diff -u src/sys/dev/usb/usbdevs:1.810 src/sys/dev/usb/usbdevs:1.811 --- src/sys/dev/usb/usbdevs:1.810 Mon Dec 11 13:33:35 2023 +++ src/sys/dev/usb/usbdevs Sun Dec 24 02:42:51 2023 @@ -1,4 +1,4 @@ -$NetBSD: usbdevs,v 1.810 2023/12/11 13:33:35 mlelstv Exp $ +$NetBSD: usbdevs,v 1.811 2023/12/24 02:42:51 gutteridge Exp $ /*- * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -2922,6 +2922,7 @@ product REALTEK RTL8712 0x8712 RTL8712 product REALTEK RTL8713 0x8713 RTL8713 product REALTEK RTL8188CU_COMBO 0x8754 RTL8188CU product REALTEK RTL8192SU 0xc512 RTL8192SU +product REALTEK RTL8188FU 0xf179 RTL8188FU /* Research In Motion */ product RIM BLACKBERRY 0x0001 BlackBerry
CVS commit: src/sys/dev/usb
Module Name:src Committed By: gutteridge Date: Sun Dec 24 02:42:51 UTC 2023 Modified Files: src/sys/dev/usb: usbdevs Log Message: usbdevs: add RTL8188FU To generate a diff of this commit: cvs rdiff -u -r1.810 -r1.811 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Tue Dec 19 08:19:42 UTC 2023 Modified Files: src/sys/dev/usb: if_axen.c Log Message: Use un_flags as pointed out by mrg@ thanks. To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/sys/dev/usb/if_axen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/if_axen.c diff -u src/sys/dev/usb/if_axen.c:1.95 src/sys/dev/usb/if_axen.c:1.96 --- src/sys/dev/usb/if_axen.c:1.95 Tue Dec 19 07:05:36 2023 +++ src/sys/dev/usb/if_axen.c Tue Dec 19 08:19:42 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_axen.c,v 1.95 2023/12/19 07:05:36 skrll Exp $ */ +/* $NetBSD: if_axen.c,v 1.96 2023/12/19 08:19:42 skrll Exp $ */ /* $OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $ */ /* @@ -23,7 +23,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.95 2023/12/19 07:05:36 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.96 2023/12/19 08:19:42 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -55,11 +55,6 @@ struct axen_type { #define AX179A 0x0004 /* AX88179A */ }; -struct axen_softc { - struct usbnet axen_un; - uint16_t axen_flags; -}; - /* * Various supported device vendors/products. */ @@ -76,7 +71,7 @@ static const struct axen_type axen_devs[ static int axen_match(device_t, cfdata_t, void *); static void axen_attach(device_t, device_t, void *); -CFATTACH_DECL_NEW(axen, sizeof(struct axen_softc), +CFATTACH_DECL_NEW(axen, sizeof(struct usbnet), axen_match, axen_attach, usbnet_detach, usbnet_activate); static int axen_cmd(struct usbnet *, int, int, int, void *); @@ -578,8 +573,7 @@ static void axen_attach(device_t parent, device_t self, void *aux) { USBNET_MII_DECL_DEFAULT(unm); - struct axen_softc * const sc = device_private(self); - struct usbnet * const un = &sc->axen_un; + struct usbnet * const un = device_private(self); struct usb_attach_arg *uaa = aux; struct usbd_device *dev = uaa->uaa_device; usbd_status err; @@ -596,7 +590,7 @@ axen_attach(device_t parent, device_t se un->un_dev = self; un->un_udev = dev; - un->un_sc = sc; + un->un_sc = un; un->un_ops = &axen_ops; un->un_rx_xfer_flags = USBD_SHORT_XFER_OK; un->un_tx_xfer_flags = USBD_FORCE_SHORT_XFER; @@ -610,11 +604,11 @@ axen_attach(device_t parent, device_t se return; } - sc->axen_flags = + un->un_flags = axen_lookup(uaa->uaa_vendor, uaa->uaa_product)->axen_flags; if (UGETW(usbd_get_device_descriptor(dev)->bcdDevice) == 0x0200) { - sc->axen_flags &= ~(AX178A | AX179); - sc->axen_flags |= AX179A; + un->un_flags &= ~(AX178A | AX179); + un->un_flags |= AX179A; } err = usbd_device2interface_handle(dev, AXEN_IFACE_IDX, &un->un_iface); @@ -678,7 +672,7 @@ axen_attach(device_t parent, device_t se #define AXEN_FW_MODE0x08 #define AXEN_FW_MODE_178A179 0x #define AXEN_FW_MODE_179A 0x0001 - if (sc->axen_flags & AX179A) { + if (un->un_flags & AX179A) { uint8_t bval = 0; /* len dir cmd */ int cmd = (1 << 12) | (1 << 8) | (AXEN_FW_MODE & 0x00FF); @@ -687,11 +681,11 @@ axen_attach(device_t parent, device_t se #endif /* An ASIX chip was detected. Inform the world. */ - if (sc->axen_flags & AX178A) + if (un->un_flags & AX178A) aprint_normal_dev(self, "AX88178a\n"); - else if (sc->axen_flags & AX179) + else if (un->un_flags & AX179) aprint_normal_dev(self, "AX88179\n"); - else if (sc->axen_flags & AX179A) + else if (un->un_flags & AX179A) aprint_normal_dev(self, "AX88179A\n"); else aprint_normal_dev(self, "(unknown)\n"); @@ -760,7 +754,6 @@ axen_csum_flags_rx(struct ifnet *ifp, ui static void axen_uno_rx_loop(struct usbnet *un, struct usbnet_chain *c, uint32_t total_len) { - struct axen_softc * const sc = usbnet_softc(un); struct ifnet *ifp = usbnet_ifp(un); uint8_t *buf = c->unc_buf; uint32_t rx_hdr, pkt_hdr; @@ -842,7 +835,7 @@ axen_uno_rx_loop(struct usbnet *un, stru goto nextpkt; } - if (sc->axen_flags & AX179A) { + if (un->un_flags & AX179A) { /* each 88179A frame doesn't contain FCS. */ usbnet_enqueue(un, buf + ETHER_ALIGN, pkt_len - 2, axen_csum_flags_rx(ifp, pkt_hdr), 0, 0);
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Tue Dec 19 08:19:42 UTC 2023 Modified Files: src/sys/dev/usb: if_axen.c Log Message: Use un_flags as pointed out by mrg@ thanks. To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/sys/dev/usb/if_axen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
re: CVS commit: src/sys/dev/usb
"Nick Hudson" writes: > Module Name: src > Committed By: skrll > Date: Tue Dec 19 07:05:36 UTC 2023 > > Modified Files: > src/sys/dev/usb: if_axen.c > > Log Message: > Add support for AX88179A. From sc.dying on current-users. > > > To generate a diff of this commit: > cvs rdiff -u -r1.94 -r1.95 src/sys/dev/usb/if_axen.c cool. this can probably go back to not having a device softc by using un_flags: /* * This section is for driver to use, not touched by usbnet. */ unsignedun_flags; in struct usbnet, and axen_softc becomes just usbnet again. .mrg.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Tue Dec 19 07:05:36 UTC 2023 Modified Files: src/sys/dev/usb: if_axen.c Log Message: Add support for AX88179A. From sc.dying on current-users. To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/dev/usb/if_axen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/if_axen.c diff -u src/sys/dev/usb/if_axen.c:1.94 src/sys/dev/usb/if_axen.c:1.95 --- src/sys/dev/usb/if_axen.c:1.94 Sat Aug 20 14:08:59 2022 +++ src/sys/dev/usb/if_axen.c Tue Dec 19 07:05:36 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: if_axen.c,v 1.94 2022/08/20 14:08:59 riastradh Exp $ */ +/* $NetBSD: if_axen.c,v 1.95 2023/12/19 07:05:36 skrll Exp $ */ /* $OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $ */ /* @@ -23,7 +23,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.94 2022/08/20 14:08:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.95 2023/12/19 07:05:36 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -52,6 +52,12 @@ struct axen_type { uint16_t axen_flags; #define AX178A 0x0001 /* AX88178a */ #define AX179 0x0002 /* AX88179 */ +#define AX179A 0x0004 /* AX88179A */ +}; + +struct axen_softc { + struct usbnet axen_un; + uint16_t axen_flags; }; /* @@ -70,7 +76,7 @@ static const struct axen_type axen_devs[ static int axen_match(device_t, cfdata_t, void *); static void axen_attach(device_t, device_t, void *); -CFATTACH_DECL_NEW(axen, sizeof(struct usbnet), +CFATTACH_DECL_NEW(axen, sizeof(struct axen_softc), axen_match, axen_attach, usbnet_detach, usbnet_activate); static int axen_cmd(struct usbnet *, int, int, int, void *); @@ -572,14 +578,14 @@ static void axen_attach(device_t parent, device_t self, void *aux) { USBNET_MII_DECL_DEFAULT(unm); - struct usbnet * const un = device_private(self); + struct axen_softc * const sc = device_private(self); + struct usbnet * const un = &sc->axen_un; struct usb_attach_arg *uaa = aux; struct usbd_device *dev = uaa->uaa_device; usbd_status err; usb_interface_descriptor_t *id; usb_endpoint_descriptor_t *ed; char *devinfop; - uint16_t axen_flags; int i; aprint_naive("\n"); @@ -590,7 +596,7 @@ axen_attach(device_t parent, device_t se un->un_dev = self; un->un_udev = dev; - un->un_sc = un; + un->un_sc = sc; un->un_ops = &axen_ops; un->un_rx_xfer_flags = USBD_SHORT_XFER_OK; un->un_tx_xfer_flags = USBD_FORCE_SHORT_XFER; @@ -604,7 +610,12 @@ axen_attach(device_t parent, device_t se return; } - axen_flags = axen_lookup(uaa->uaa_vendor, uaa->uaa_product)->axen_flags; + sc->axen_flags = + axen_lookup(uaa->uaa_vendor, uaa->uaa_product)->axen_flags; + if (UGETW(usbd_get_device_descriptor(dev)->bcdDevice) == 0x0200) { + sc->axen_flags &= ~(AX178A | AX179); + sc->axen_flags |= AX179A; + } err = usbd_device2interface_handle(dev, AXEN_IFACE_IDX, &un->un_iface); if (err) { @@ -663,11 +674,25 @@ axen_attach(device_t parent, device_t se axen_ax88179_init(un); +#if 0 +#define AXEN_FW_MODE0x08 +#define AXEN_FW_MODE_178A179 0x +#define AXEN_FW_MODE_179A 0x0001 + if (sc->axen_flags & AX179A) { + uint8_t bval = 0; + /* len dir cmd */ + int cmd = (1 << 12) | (1 << 8) | (AXEN_FW_MODE & 0x00FF); + axen_cmd(un, cmd, 1, AXEN_FW_MODE_178A179, &bval); + } +#endif + /* An ASIX chip was detected. Inform the world. */ - if (axen_flags & AX178A) + if (sc->axen_flags & AX178A) aprint_normal_dev(self, "AX88178a\n"); - else if (axen_flags & AX179) + else if (sc->axen_flags & AX179) aprint_normal_dev(self, "AX88179\n"); + else if (sc->axen_flags & AX179A) + aprint_normal_dev(self, "AX88179A\n"); else aprint_normal_dev(self, "(unknown)\n"); @@ -735,6 +760,7 @@ axen_csum_flags_rx(struct ifnet *ifp, ui static void axen_uno_rx_loop(struct usbnet *un, struct usbnet_chain *c, uint32_t total_len) { + struct axen_softc * const sc = usbnet_softc(un); struct ifnet *ifp = usbnet_ifp(un); uint8_t *buf = c->unc_buf; uint32_t rx_hdr, pkt_hdr; @@ -752,7 +778,7 @@ axen_uno_rx_loop(struct usbnet *un, stru /* * buffer map * [packet #0]...[packet #n][pkt hdr#0]..[pkt hdr#n][recv_hdr] - * each packet has 0x as psuedo header.. + * each packet has 0x as pseudo header.. */ hdr_p = (uint32_t *)(buf + total_len - sizeof(uint32_t)); rx_hdr = le32toh(*hdr_p); @@ -789,7 +815,7 @@ axen_uno_rx_loop(struct usbnet *un, stru if (pkt_count) rnd_add_uint32(usbnet_rndsrc(un), pkt_count); - do { + while (pkt_count > 0) { if ((buf[0] != 0xee) || (buf[1] != 0xee)) { aprint_error_dev(un->un_dev, "invalid buffer(pkt#%d), continue\n", pkt_count); @@ -803,6 +829,9 @@ axen_uno_rx_loop(struct usbnet *un, stru ("%s: rxeof: packet#%d, pkt_hdr 0x%08x, pkt_len %zu\n", device_xname(un->un_dev), pkt_count, pkt_hdr, pkt_len)); + if (pkt_len < sizeof(struct ether_heade
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Tue Dec 19 07:05:36 UTC 2023 Modified Files: src/sys/dev/usb: if_axen.c Log Message: Add support for AX88179A. From sc.dying on current-users. To generate a diff of this commit: cvs rdiff -u -r1.94 -r1.95 src/sys/dev/usb/if_axen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Mon Dec 11 13:35:40 UTC 2023 Modified Files: src/sys/dev/usb: usbdevs.h usbdevs_data.h Log Message: Regen To generate a diff of this commit: cvs rdiff -u -r1.801 -r1.802 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs.h diff -u src/sys/dev/usb/usbdevs.h:1.801 src/sys/dev/usb/usbdevs.h:1.802 --- src/sys/dev/usb/usbdevs.h:1.801 Thu Sep 7 20:04:18 2023 +++ src/sys/dev/usb/usbdevs.h Mon Dec 11 13:35:40 2023 @@ -1,10 +1,10 @@ -/* $NetBSD: usbdevs.h,v 1.801 2023/09/07 20:04:18 ad Exp $ */ +/* $NetBSD: usbdevs.h,v 1.802 2023/12/11 13:35:40 mlelstv Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: usbdevs,v 1.808 2023/05/14 22:30:13 pgoyette Exp + * NetBSD: usbdevs,v 1.810 2023/12/11 13:33:35 mlelstv Exp */ /*- @@ -2902,6 +2902,7 @@ #define USB_PRODUCT_REALTEK_RTL8151 0x8151 /* RTL8151 PNA */ #define USB_PRODUCT_REALTEK_RTL8152 0x8152 /* RTL8152 */ #define USB_PRODUCT_REALTEK_RTL8153 0x8153 /* RTL8153 */ +#define USB_PRODUCT_REALTEK_RTL8156 0x8156 /* RTL8156 */ #define USB_PRODUCT_REALTEK_RTL8188CE_0 0x8170 /* RTL8188CE */ #define USB_PRODUCT_REALTEK_RTL8171 0x8171 /* RTL8171 */ #define USB_PRODUCT_REALTEK_RTL8172 0x8172 /* RTL8172 */ Index: src/sys/dev/usb/usbdevs_data.h diff -u src/sys/dev/usb/usbdevs_data.h:1.801 src/sys/dev/usb/usbdevs_data.h:1.802 --- src/sys/dev/usb/usbdevs_data.h:1.801 Thu Sep 7 20:04:18 2023 +++ src/sys/dev/usb/usbdevs_data.h Mon Dec 11 13:35:40 2023 @@ -1,10 +1,10 @@ -/* $NetBSD: usbdevs_data.h,v 1.801 2023/09/07 20:04:18 ad Exp $ */ +/* $NetBSD: usbdevs_data.h,v 1.802 2023/12/11 13:35:40 mlelstv Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * NetBSD: usbdevs,v 1.808 2023/05/14 22:30:13 pgoyette Exp + * NetBSD: usbdevs,v 1.810 2023/12/11 13:33:35 mlelstv Exp */ /*- @@ -3914,20 +3914,22 @@ static const uint32_t usb_products[] = { 17221, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8153, 17229, 0, + USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8156, + 17237, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8188CE_0, 7357, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8171, - 17237, 0, - USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8172, 17245, 0, - USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8173, + USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8172, 17253, 0, - USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8174, + USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8173, 17261, 0, + USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8174, + 17269, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8188CU_0, 5293, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8191CU, - 17269, 0, + 17277, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8192CU, 5273, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8188EU, @@ -3937,7 +3939,7 @@ static const uint32_t usb_products[] = { USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8188CU_2, 5293, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8192CE, - 17279, 0, + 17287, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8188RU, 17177, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8188CE_1, @@ -3947,181 +3949,181 @@ static const uint32_t usb_products[] = { USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8187, 8936, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8187B_0, - 17289, 0, + 17297, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8188CUS, 7504, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8192EU, - 17298, 0, + 17306, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8188CU_3, 5293, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8187B_1, - 17289, 0, + 17297, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8187B_2, - 17289, 0, + 17297, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8712, - 17308, 0, - USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8713, 17316, 0, + USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8713, + 17324, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8188CU_COMBO, 5293, 0, USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8192SU, 5431, 0, USB_VENDOR_RIM, USB_PRODUCT_RIM_BLACKBERRY, - 17324, 0, + 17332, 0, USB_VENDOR_RIM, USB_PRODUCT_RIM_BLACKBERRY_PEARL_DUAL, - 17324, 17335, 13673, 0, + 17332, 17343, 13673, 0, USB_VENDOR_RIM, USB_PRODUCT_RIM_BLACKBERRY_PEARL, - 17324, 17335, 0, + 17332, 17343, 0, USB_VENDOR_ROCKFIRE, USB_PRODUCT_ROCKFIRE_GAMEPAD, - 12974, 17341, 0, + 12974, 17349, 0, USB_VENDOR_ROLAND, USB_PRODUCT_ROLAND_UA
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Mon Dec 11 13:35:40 UTC 2023 Modified Files: src/sys/dev/usb: usbdevs.h usbdevs_data.h Log Message: Regen To generate a diff of this commit: cvs rdiff -u -r1.801 -r1.802 src/sys/dev/usb/usbdevs.h \ src/sys/dev/usb/usbdevs_data.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Mon Dec 11 13:33:35 UTC 2023 Modified Files: src/sys/dev/usb: usbdevs Log Message: Add RTL8156 To generate a diff of this commit: cvs rdiff -u -r1.809 -r1.810 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdevs diff -u src/sys/dev/usb/usbdevs:1.809 src/sys/dev/usb/usbdevs:1.810 --- src/sys/dev/usb/usbdevs:1.809 Thu Sep 7 20:04:18 2023 +++ src/sys/dev/usb/usbdevs Mon Dec 11 13:33:35 2023 @@ -1,4 +1,4 @@ -$NetBSD: usbdevs,v 1.809 2023/09/07 20:04:18 ad Exp $ +$NetBSD: usbdevs,v 1.810 2023/12/11 13:33:35 mlelstv Exp $ /*- * Copyright (c) 1998-2004 The NetBSD Foundation, Inc. @@ -2895,6 +2895,7 @@ product REALTEK RTL8150L 0x8150 RTL8150L product REALTEK RTL8151 0x8151 RTL8151 PNA product REALTEK RTL8152 0x8152 RTL8152 product REALTEK RTL8153 0x8153 RTL8153 +product REALTEK RTL8156 0x8156 RTL8156 product REALTEK RTL8188CE_0 0x8170 RTL8188CE product REALTEK RTL8171 0x8171 RTL8171 product REALTEK RTL8172 0x8172 RTL8172
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mlelstv Date: Mon Dec 11 13:33:35 UTC 2023 Modified Files: src/sys/dev/usb: usbdevs Log Message: Add RTL8156 To generate a diff of this commit: cvs rdiff -u -r1.809 -r1.810 src/sys/dev/usb/usbdevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: hannken Date: Mon Nov 6 12:16:52 UTC 2023 Modified Files: src/sys/dev/usb: ugen.c Log Message: Undo the DPRINTFN part of the last commit. It breaks i386 at least when KERNHIST_LOG casts the pointer to uintmax_t. Kernel ALL/i386 compiles again. To generate a diff of this commit: cvs rdiff -u -r1.174 -r1.175 src/sys/dev/usb/ugen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: hannken Date: Mon Nov 6 12:16:52 UTC 2023 Modified Files: src/sys/dev/usb: ugen.c Log Message: Undo the DPRINTFN part of the last commit. It breaks i386 at least when KERNHIST_LOG casts the pointer to uintmax_t. Kernel ALL/i386 compiles again. To generate a diff of this commit: cvs rdiff -u -r1.174 -r1.175 src/sys/dev/usb/ugen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ugen.c diff -u src/sys/dev/usb/ugen.c:1.174 src/sys/dev/usb/ugen.c:1.175 --- src/sys/dev/usb/ugen.c:1.174 Tue Oct 10 10:58:03 2023 +++ src/sys/dev/usb/ugen.c Mon Nov 6 12:16:52 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ugen.c,v 1.174 2023/10/10 10:58:03 simonb Exp $ */ +/* $NetBSD: ugen.c,v 1.175 2023/11/06 12:16:52 hannken Exp $ */ /* * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.174 2023/10/10 10:58:03 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.175 2023/11/06 12:16:52 hannken Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -1346,8 +1346,8 @@ ugenintr(struct usbd_xfer *xfer, void *a usbd_get_xfer_status(xfer, NULL, NULL, &count, NULL); ibuf = sce->ibuf; - DPRINTFN(5, "xfer=%p status=%d count=%d", - xfer, status, count, 0); + DPRINTFN(5, "xfer=%#jx status=%d count=%d", + (uintptr_t)xfer, status, count, 0); DPRINTFN(5, " data = %02x %02x %02x", ibuf[0], ibuf[1], ibuf[2], 0);
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sat Oct 28 21:18:32 UTC 2023 Modified Files: src/sys/dev/usb: ehci.c Log Message: ehci(4): Fix bug causing missed wakeups since ehci.c 1.308. For reasons beyond me now, I used cv_signal on the same cv that is used to wait for the doorbell to be available _and_ to wait for the host controller to acknowledge the doorbell. Which means when the host controller acknowledges the doorbell, we might wake some thread waiting for the doorbell to be available -- and leave the thread waiting for the doorbell acknowledgment hanging indefinitely. PR port-i386/57662 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.318 -r1.319 src/sys/dev/usb/ehci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ehci.c diff -u src/sys/dev/usb/ehci.c:1.318 src/sys/dev/usb/ehci.c:1.319 --- src/sys/dev/usb/ehci.c:1.318 Sat Oct 28 21:18:15 2023 +++ src/sys/dev/usb/ehci.c Sat Oct 28 21:18:31 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.318 2023/10/28 21:18:15 riastradh Exp $ */ +/* $NetBSD: ehci.c,v 1.319 2023/10/28 21:18:31 riastradh Exp $ */ /* * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc. @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.318 2023/10/28 21:18:15 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.319 2023/10/28 21:18:31 riastradh Exp $"); #include "ohci.h" #include "uhci.h" @@ -826,7 +826,7 @@ ehci_doorbell(void *addr) if (sc->sc_doorbelllwp == NULL) DPRINTF("spurious doorbell interrupt", 0, 0, 0, 0); sc->sc_doorbelllwp = NULL; - cv_signal(&sc->sc_doorbell); + cv_broadcast(&sc->sc_doorbell); mutex_exit(&sc->sc_lock); } @@ -2279,7 +2279,7 @@ ehci_sync_hc(ehci_softc_t *sc) now = getticks(); if (now - starttime >= delta) { sc->sc_doorbelllwp = NULL; - cv_signal(&sc->sc_doorbell); + cv_broadcast(&sc->sc_doorbell); DPRINTF("doorbell timeout", 0, 0, 0, 0); #ifdef DIAGNOSTIC /* XXX DIAGNOSTIC abuse, do this differently */ printf("ehci_sync_hc: timed out\n");
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sat Oct 28 21:18:32 UTC 2023 Modified Files: src/sys/dev/usb: ehci.c Log Message: ehci(4): Fix bug causing missed wakeups since ehci.c 1.308. For reasons beyond me now, I used cv_signal on the same cv that is used to wait for the doorbell to be available _and_ to wait for the host controller to acknowledge the doorbell. Which means when the host controller acknowledges the doorbell, we might wake some thread waiting for the doorbell to be available -- and leave the thread waiting for the doorbell acknowledgment hanging indefinitely. PR port-i386/57662 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.318 -r1.319 src/sys/dev/usb/ehci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: riastradh Date: Sat Oct 28 21:18:15 UTC 2023 Modified Files: src/sys/dev/usb: ehci.c Log Message: ehci(4): Fix cv_timedwait loop in ehci_sync_hc. Stop when now - starttime >= delta, i.e., when at least delta ticks have elapsed since the start, not when endtime - now > delta, i.e., more than delta ticks _remain_ to sleep, which is never going to happen (except on arithmetic overflow). As is, what will happen in the case that should time out is that we wake up after delta ticks, and find now = getticks() is exactly endtime, so we retry cv_timedwait with timo=(endtime - now)=0 which means sleep indefinitely with no timeout as if with cv_wait. PR port-i386/57662 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.317 -r1.318 src/sys/dev/usb/ehci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ehci.c diff -u src/sys/dev/usb/ehci.c:1.317 src/sys/dev/usb/ehci.c:1.318 --- src/sys/dev/usb/ehci.c:1.317 Sun Jul 30 12:17:02 2023 +++ src/sys/dev/usb/ehci.c Sat Oct 28 21:18:15 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.317 2023/07/30 12:17:02 skrll Exp $ */ +/* $NetBSD: ehci.c,v 1.318 2023/10/28 21:18:15 riastradh Exp $ */ /* * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc. @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.317 2023/07/30 12:17:02 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.318 2023/10/28 21:18:15 riastradh Exp $"); #include "ohci.h" #include "uhci.h" @@ -2277,7 +2277,7 @@ ehci_sync_hc(ehci_softc_t *sc) */ while (sc->sc_doorbelllwp == curlwp) { now = getticks(); - if (endtime - now > delta) { + if (now - starttime >= delta) { sc->sc_doorbelllwp = NULL; cv_signal(&sc->sc_doorbell); DPRINTF("doorbell timeout", 0, 0, 0, 0);