From 0b6d7bb4e82198105eb07dc55427d4c4252342a2 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 24 Jun 2011 17:54:45 +0000 Subject: [PATCH 01/49] Don't die if either of INET or INET6 aren't in the running kernel. Instead, report "protocol not supported" errors at runtime if a user attempts to use a protocol that the kernel doesn't support. Reviewed by: bz MFC after: 1 week --- usr.sbin/mtest/mtest.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/usr.sbin/mtest/mtest.c b/usr.sbin/mtest/mtest.c index 442c3c41247..60f7e09626b 100644 --- a/usr.sbin/mtest/mtest.c +++ b/usr.sbin/mtest/mtest.c @@ -204,14 +204,16 @@ main(int argc, char **argv) s6 = -1; #ifdef INET s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (s == -1) + if (s == -1 && errno != EPROTONOSUPPORT) err(1, "can't open IPv4 socket"); #endif #ifdef INET6 s6 = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); - if (s6 == -1) + if (s6 == -1 && errno != EPROTONOSUPPORT) err(1, "can't open IPv6 socket"); #endif + if (s == -1 && s6 == -1) + errc(1, EPROTONOSUPPORT, "can't open socket"); if (argc < 2) { if (isatty(STDIN_FILENO)) { @@ -371,7 +373,7 @@ af2socklen(const int af) } static void -process_cmd(char *cmd, int s, int s6 __unused, FILE *fp __unused) +process_cmd(char *cmd, int s, int s6, FILE *fp __unused) { char str1[STR_SIZE]; char str2[STR_SIZE]; @@ -457,7 +459,10 @@ process_cmd(char *cmd, int s, int s6 __unused, FILE *fp __unused) optval = (void *)&mr.mr; optlen = sizeof(mr.mr); } - if (setsockopt(s, level, optname, optval, + if (s < 0) { + warnc(EPROTONOSUPPORT, "setsockopt %s", + toptname); + } else if (setsockopt(s, level, optname, optval, optlen) == 0) { printf("ok\n"); break; @@ -496,7 +501,10 @@ process_cmd(char *cmd, int s, int s6 __unused, FILE *fp __unused) optval = (void *)&mr.mr6; optlen = sizeof(mr.mr6); } - if (setsockopt(s6, level, optname, optval, + if (s6 < 0) { + warnc(EPROTONOSUPPORT, "setsockopt %s", + toptname); + } else if (setsockopt(s6, level, optname, optval, optlen) == 0) { printf("ok\n"); break; @@ -534,6 +542,10 @@ process_cmd(char *cmd, int s, int s6 __unused, FILE *fp __unused) break; } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "setsourcefilter"); + break; + } memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; @@ -593,6 +605,10 @@ process_cmd(char *cmd, int s, int s6 __unused, FILE *fp __unused) break; } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "getsourcefilter"); + break; + } /* First determine our current filter mode. */ n = 0; @@ -700,6 +716,10 @@ process_cmd(char *cmd, int s, int s6 __unused, FILE *fp __unused) } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "getsourcefilter"); + break; + } nsrc = nreqsrc; if (getsourcefilter(af2sock(af, s, s6), ifindex, &su.sa, su.sa.sa_len, &fmode, &nsrc, &sources[0].ss) != 0) { From d16e5e1a8447c17369b3bf7ca018be3931789ba9 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 24 Jun 2011 18:11:55 +0000 Subject: [PATCH 02/49] - Export the URIO USB device ID's. - Add checks for configuration and interface index. MFC after: 3 days --- sys/dev/usb/storage/urio.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/sys/dev/usb/storage/urio.c b/sys/dev/usb/storage/urio.c index ee93439fb30..66871730331 100644 --- a/sys/dev/usb/storage/urio.c +++ b/sys/dev/usb/storage/urio.c @@ -198,22 +198,25 @@ DRIVER_MODULE(urio, uhub, urio_driver, urio_devclass, NULL, 0); MODULE_DEPEND(urio, usb, 1, 1, 1); MODULE_VERSION(urio, 1); +static const STRUCT_USB_HOST_ID urio_devs[] = { + {USB_VPI(USB_VENDOR_DIAMOND, USB_PRODUCT_DIAMOND_RIO500USB, 0)}, + {USB_VPI(USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO600USB, 0)}, + {USB_VPI(USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO800USB, 0)}, +}; + static int urio_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } - if ((((uaa->info.idVendor == USB_VENDOR_DIAMOND) && - (uaa->info.idProduct == USB_PRODUCT_DIAMOND_RIO500USB)) || - ((uaa->info.idVendor == USB_VENDOR_DIAMOND2) && - ((uaa->info.idProduct == USB_PRODUCT_DIAMOND2_RIO600USB) || - (uaa->info.idProduct == USB_PRODUCT_DIAMOND2_RIO800USB))))) - return (0); - else + if (uaa->info.bConfigIndex != 0) return (ENXIO); + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(urio_devs, sizeof(urio_devs), uaa)); } static int From a6b60150631ab8ada529a0f3d39e4793fcda76ab Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 24 Jun 2011 18:14:43 +0000 Subject: [PATCH 03/49] - Move execution of event handlers into the probe and attach function so that dynamically loaded device drivers get a chance to run their event hooks. - Decouple the USB suspend and resume lock from witness. It produces some false warnings due to reusing the lock name among multiple devices. MFC after: 3 days --- sys/dev/usb/usb_device.c | 22 ++++++++++++++++------ sys/dev/usb/usb_msctest.c | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index 893e79dba07..76c976b70cd 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -1297,6 +1297,21 @@ usb_probe_and_attach(struct usb_device *udev, uint8_t iface_index) usb_init_attach_arg(udev, &uaa); + /* + * If the whole USB device is targeted, invoke the USB event + * handler(s): + */ + if (iface_index == USB_IFACE_INDEX_ANY) { + + EVENTHANDLER_INVOKE(usb_dev_configured, udev, &uaa); + + if (uaa.dev_state != UAA_DEV_READY) { + /* leave device unconfigured */ + usb_unconfigure(udev, 0); + goto done; + } + } + /* Check if only one interface should be probed: */ if (iface_index != USB_IFACE_INDEX_ANY) { i = iface_index; @@ -1526,7 +1541,7 @@ usb_alloc_device(device_t parent_dev, struct usb_bus *bus, /* initialise our SX-lock */ sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); - sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_DUPOK); + sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS); cv_init(&udev->ctrlreq_cv, "WCTRL"); cv_init(&udev->ref_cv, "UGONE"); @@ -1834,11 +1849,6 @@ repeat_set_config: } } } - EVENTHANDLER_INVOKE(usb_dev_configured, udev, &uaa); - if (uaa.dev_state != UAA_DEV_READY) { - /* leave device unconfigured */ - usb_unconfigure(udev, 0); - } config_done: DPRINTF("new dev (addr %d), udev=%p, parent_hub=%p\n", diff --git a/sys/dev/usb/usb_msctest.c b/sys/dev/usb/usb_msctest.c index 909615e5f99..45bd36384fa 100644 --- a/sys/dev/usb/usb_msctest.c +++ b/sys/dev/usb/usb_msctest.c @@ -489,6 +489,24 @@ bbb_attach(struct usb_device *udev, uint8_t iface_index) struct usb_interface_descriptor *id; struct bbb_transfer *sc; usb_error_t err; + uint8_t do_unlock; + + /* automatic locking */ + if (usbd_enum_is_locked(udev)) { + do_unlock = 0; + } else { + do_unlock = 1; + usbd_enum_lock(udev); + } + + /* + * Make sure any driver which is hooked up to this interface, + * like umass is gone: + */ + usb_detach_device(udev, iface_index, 0); + + if (do_unlock) + usbd_enum_unlock(udev); iface = usbd_get_iface(udev, iface_index); if (iface == NULL) From d43ffe946528531ec23ba4271a90bcefd6da6da5 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 24 Jun 2011 19:02:56 +0000 Subject: [PATCH 04/49] - Ensure that we get all the required nomatch devd events. MFC after: 3 days --- sys/dev/usb/usb_device.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index 76c976b70cd..932c0222272 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -1358,17 +1358,18 @@ usb_probe_and_attach(struct usb_device *udev, uint8_t iface_index) uaa.info.bIfaceIndex, uaa.info.bIfaceNum); - if (usb_probe_and_attach_sub(udev, &uaa)) { - /* ignore */ - } - } + usb_probe_and_attach_sub(udev, &uaa); - if (uaa.temp_dev) { - /* remove the last created child; it is unused */ - - if (device_delete_child(udev->parent_dev, uaa.temp_dev)) { + /* + * Remove the leftover child, if any, to enforce that + * a new nomatch devd event is generated for the next + * interface if no driver is found: + */ + if (uaa.temp_dev == NULL) + continue; + if (device_delete_child(udev->parent_dev, uaa.temp_dev)) DPRINTFN(0, "device delete child failed\n"); - } + uaa.temp_dev = NULL; } done: if (do_unlock) From 9cfbe3e76b84d2cbde596b5c1ea43f021a2771cb Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 24 Jun 2011 19:32:29 +0000 Subject: [PATCH 05/49] - Export more USB device ID's. MFC after: 3 days --- sys/dev/usb/misc/udbp.c | 41 +++++++++++++------------------------ sys/dev/usb/misc/ufm.c | 18 +++++++++------- sys/dev/usb/serial/ufoma.c | 30 ++++++++++++++++----------- sys/dev/usb/serial/umodem.c | 9 +++++--- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/sys/dev/usb/misc/udbp.c b/sys/dev/usb/misc/udbp.c index 38a4fee685c..1a72cae89a4 100644 --- a/sys/dev/usb/misc/udbp.c +++ b/sys/dev/usb/misc/udbp.c @@ -288,40 +288,27 @@ udbp_modload(module_t mod, int event, void *data) return (error); } +static const STRUCT_USB_HOST_ID udbp_devs[] = { + {USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_TURBOCONNECT, 0)}, + {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301, 0)}, + {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302, 0)}, + {USB_VPI(USB_VENDOR_ANCHOR, USB_PRODUCT_ANCHOR_EZLINK, 0)}, + {USB_VPI(USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL620USB, 0)}, +}; + static int udbp_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != 0) + return (ENXIO); + if (uaa->info.bIfaceIndex != 0) return (ENXIO); - } - /* - * XXX Julian, add the id of the device if you have one to test - * things with. run 'usbdevs -v' and note the 3 ID's that appear. - * The Vendor Id and Product Id are in hex and the Revision Id is in - * bcd. But as usual if the revision is 0x101 then you should - * compare the revision id in the device descriptor with 0x101 Or go - * search the file usbdevs.h. Maybe the device is already in there. - */ - if (((uaa->info.idVendor == USB_VENDOR_NETCHIP) && - (uaa->info.idProduct == USB_PRODUCT_NETCHIP_TURBOCONNECT))) - return (0); - if (((uaa->info.idVendor == USB_VENDOR_PROLIFIC) && - ((uaa->info.idProduct == USB_PRODUCT_PROLIFIC_PL2301) || - (uaa->info.idProduct == USB_PRODUCT_PROLIFIC_PL2302)))) - return (0); - - if ((uaa->info.idVendor == USB_VENDOR_ANCHOR) && - (uaa->info.idProduct == USB_PRODUCT_ANCHOR_EZLINK)) - return (0); - - if ((uaa->info.idVendor == USB_VENDOR_GENESYS) && - (uaa->info.idProduct == USB_PRODUCT_GENESYS_GL620USB)) - return (0); - - return (ENXIO); + return (usbd_lookup_id_by_uaa(udbp_devs, sizeof(udbp_devs), uaa)); } static int diff --git a/sys/dev/usb/misc/ufm.c b/sys/dev/usb/misc/ufm.c index 75e2b7faf10..11bea65ae56 100644 --- a/sys/dev/usb/misc/ufm.c +++ b/sys/dev/usb/misc/ufm.c @@ -118,19 +118,23 @@ DRIVER_MODULE(ufm, uhub, ufm_driver, ufm_devclass, NULL, 0); MODULE_DEPEND(ufm, usb, 1, 1, 1); MODULE_VERSION(ufm, 1); +static const STRUCT_USB_HOST_ID ufm_devs[] = { + {USB_VPI(USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_FMRADIO, 0)}, +}; + static int ufm_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } - if ((uaa->info.idVendor == USB_VENDOR_CYPRESS) && - (uaa->info.idProduct == USB_PRODUCT_CYPRESS_FMRADIO)) { - return (0); - } - return (ENXIO); + if (uaa->info.bConfigIndex != 0) + return (ENXIO); + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(ufm_devs, sizeof(ufm_devs), uaa)); } static int diff --git a/sys/dev/usb/serial/ufoma.c b/sys/dev/usb/serial/ufoma.c index a32fd478afb..31be85ceab0 100644 --- a/sys/dev/usb/serial/ufoma.c +++ b/sys/dev/usb/serial/ufoma.c @@ -327,6 +327,11 @@ MODULE_DEPEND(ufoma, ucom, 1, 1, 1); MODULE_DEPEND(ufoma, usb, 1, 1, 1); MODULE_VERSION(ufoma, 1); +static const STRUCT_USB_HOST_ID ufoma_devs[] = { + {USB_IFACE_CLASS(UICLASS_CDC), + USB_IFACE_SUBCLASS(UISUBCLASS_MCPC),}, +}; + static int ufoma_probe(device_t dev) { @@ -334,30 +339,31 @@ ufoma_probe(device_t dev) struct usb_interface_descriptor *id; struct usb_config_descriptor *cd; usb_mcpc_acm_descriptor *mad; + int error; - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } + + error = usbd_lookup_id_by_uaa(ufoma_devs, sizeof(ufoma_devs), uaa); + if (error) + return (error); + id = usbd_get_interface_descriptor(uaa->iface); cd = usbd_get_config_descriptor(uaa->device); - if ((id == NULL) || - (cd == NULL) || - (id->bInterfaceClass != UICLASS_CDC) || - (id->bInterfaceSubClass != UISUBCLASS_MCPC)) { + if (id == NULL || cd == NULL) return (ENXIO); - } + mad = ufoma_get_intconf(cd, id, UDESC_VS_INTERFACE, UDESCSUB_MCPC_ACM); - if (mad == NULL) { + if (mad == NULL) return (ENXIO); - } + #ifndef UFOMA_HANDSFREE if ((mad->bType == UMCPC_ACM_TYPE_AB5) || - (mad->bType == UMCPC_ACM_TYPE_AB6)) { + (mad->bType == UMCPC_ACM_TYPE_AB6)) return (ENXIO); - } #endif - return (0); + return (BUS_PROBE_GENERIC); } static int diff --git a/sys/dev/usb/serial/umodem.c b/sys/dev/usb/serial/umodem.c index 92bfe930f00..ed5162f2e70 100644 --- a/sys/dev/usb/serial/umodem.c +++ b/sys/dev/usb/serial/umodem.c @@ -276,11 +276,14 @@ umodem_probe(device_t dev) DPRINTFN(11, "\n"); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } + error = usbd_lookup_id_by_uaa(umodem_devs, sizeof(umodem_devs), uaa); - return (error); + if (error) + return (error); + + return (BUS_PROBE_GENERIC); } static int From b97989d6598263b367646de39f8c4e39f0d8b7dd Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Fri, 24 Jun 2011 20:23:50 +0000 Subject: [PATCH 06/49] sh(1): Document the case command better. Suggested by: netchild Reviewed by: gjb --- bin/sh/sh.1 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index e318216262a..bb10133601e 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 18, 2011 +.Dd June 24, 2011 .Dt SH 1 .Os .Sh NAME @@ -994,11 +994,22 @@ described later), separated by .Ql \&| characters. +Tilde expansion, parameter expansion, command substitution, +arithmetic expansion and quote removal are applied to the word. +Then, each pattern is expanded in turn using tilde expansion, +parameter expansion, command substitution and arithmetic expansion and +the expanded form of the word is checked against it. +If a match is found, the corresponding list is executed. If the selected list is terminated by the control operator .Ql ;& instead of .Ql ;; , -execution continues with the next list. +execution continues with the next list, +continuing until a list terminated with +.Ql ;; +or the end of the +.Ic case +command. The exit code of the .Ic case command is the exit code of the last command executed in the list or From a433a3d8c910078a69ed8c32fd56f0132bdd5954 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 24 Jun 2011 21:27:33 +0000 Subject: [PATCH 07/49] - We need to sort all USB device ID's together. Else the matching order will be wrong. This is required because devd only executes one entry. MFC after: 14 days --- tools/tools/bus_autoconf/bus_autoconf.c | 151 +++++++++++++++++------ tools/tools/bus_autoconf/bus_autoconf.h | 3 + tools/tools/bus_autoconf/bus_autoconf.sh | 63 +++++++--- 3 files changed, 163 insertions(+), 54 deletions(-) diff --git a/tools/tools/bus_autoconf/bus_autoconf.c b/tools/tools/bus_autoconf/bus_autoconf.c index 38fbd29760d..3ddab5a8ebf 100644 --- a/tools/tools/bus_autoconf/bus_autoconf.c +++ b/tools/tools/bus_autoconf/bus_autoconf.c @@ -43,15 +43,67 @@ static char *type; static char *file_name; -static char *module; static const char *mode; +struct usb_info; +static void usb_dump_sub(struct usb_device_id *, struct usb_info *); + +/* + * To ensure that the correct USB driver is loaded, the driver having + * the most information about the device must be probed first. Then + * more generic drivers shall be probed. + */ static int usb_compare(const void *_a, const void *_b) { const struct usb_device_id *a = _a; const struct usb_device_id *b = _b; + /* vendor matches first */ + + if (a->match_flag_vendor > b->match_flag_vendor) + return (-1); + if (a->match_flag_vendor < b->match_flag_vendor) + return (1); + + /* product matches first */ + + if (a->match_flag_product > b->match_flag_product) + return (-1); + if (a->match_flag_product < b->match_flag_product) + return (1); + + /* device class matches first */ + + if (a->match_flag_dev_class > b->match_flag_dev_class) + return (-1); + if (a->match_flag_dev_class < b->match_flag_dev_class) + return (1); + + if (a->match_flag_dev_subclass > b->match_flag_dev_subclass) + return (-1); + if (a->match_flag_dev_subclass < b->match_flag_dev_subclass) + return (1); + + /* interface class matches first */ + + if (a->match_flag_int_class > b->match_flag_int_class) + return (-1); + if (a->match_flag_int_class < b->match_flag_int_class) + return (1); + + if (a->match_flag_int_subclass > b->match_flag_int_subclass) + return (-1); + if (a->match_flag_int_subclass < b->match_flag_int_subclass) + return (1); + + if (a->match_flag_int_protocol > b->match_flag_int_protocol) + return (-1); + if (a->match_flag_int_protocol < b->match_flag_int_protocol) + return (1); + + /* then sort according to value */ + if (a->idVendor > b->idVendor) return (1); if (a->idVendor < b->idVendor) @@ -85,7 +137,9 @@ usb_compare(const void *_a, const void *_b) if (a->bInterfaceProtocol < b->bInterfaceProtocol) return (-1); - return (0); + /* in the end sort by module name */ + + return (strcmp(a->module_name, b->module_name)); } static void @@ -105,39 +159,55 @@ static void usb_dump_sub(struct usb_device_id *id, struct usb_info *pinfo) { #if USB_HAVE_COMPAT_LINUX - if (id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) - id->match_flag_vendor = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) - id->match_flag_product = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) - id->match_flag_dev_lo = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) - id->match_flag_dev_hi = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) - id->match_flag_dev_class = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) - id->match_flag_dev_subclass = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) - id->match_flag_dev_protocol = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) - id->match_flag_int_class = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) - id->match_flag_int_subclass = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) - id->match_flag_int_protocol = 1; + if (id->match_flags != 0) { + if (id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) + id->match_flag_vendor = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) + id->match_flag_product = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) + id->match_flag_dev_lo = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) + id->match_flag_dev_hi = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) + id->match_flag_dev_class = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) + id->match_flag_dev_subclass = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) + id->match_flag_dev_protocol = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) + id->match_flag_int_class = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) + id->match_flag_int_subclass = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) + id->match_flag_int_protocol = 1; + id->match_flags = 0; + } #endif + if (pinfo != NULL) { - pinfo->is_iface = id->match_flag_int_class | - id->match_flag_int_protocol | - id->match_flag_int_subclass; + pinfo->is_iface = id->match_flag_int_class | + id->match_flag_int_protocol | + id->match_flag_int_subclass; - pinfo->is_dev = id->match_flag_dev_class | - id->match_flag_dev_subclass; + pinfo->is_dev = id->match_flag_dev_class | + id->match_flag_dev_subclass; - pinfo->is_vp = id->match_flag_vendor | - id->match_flag_product; + pinfo->is_vp = id->match_flag_vendor | + id->match_flag_product; - pinfo->is_any = pinfo->is_vp + pinfo->is_dev + pinfo->is_iface; + pinfo->is_any = pinfo->is_vp + pinfo->is_dev + pinfo->is_iface; + } +} + +static char * +usb_trim(char *ptr) +{ + char *end; + + end = strchr(ptr, ' '); + if (end) + *end = 0; + return (ptr); } static uint32_t @@ -149,7 +219,7 @@ usb_dump(struct usb_device_id *id, uint32_t nid) usb_dump_sub(id, &info); if (info.is_any) { - printf("nomatch 10 {\n" + printf("nomatch 32 {\n" " match \"bus\" \"uhub[0-9]+\";\n" " match \"mode\" \"%s\";\n", mode); } else { @@ -212,7 +282,7 @@ usb_dump(struct usb_device_id *id, uint32_t nid) id->bInterfaceProtocol); } printf(" action \"kldload %s\";\n" - "};\n\n", module); + "};\n\n", usb_trim(id->module_name)); return (n); } @@ -239,12 +309,21 @@ usb_parse_and_dump(int f, off_t size) } nid = size / sizeof(*id); + for (x = 0; x != nid; x++) { + /* make sure flag bits are correct */ + usb_dump_sub(id + x, NULL); + /* zero terminate string */ + id[x].module_name[sizeof(id[0].module_name) - 1] = 0; + } + usb_sort(id, nid); for (x = 0; x != nid;) x += usb_dump(id + x, nid - x); free(id); + + printf("# %d %s entries processed\n\n", (int)nid, type); } static void @@ -253,7 +332,6 @@ usage(void) fprintf(stderr, "bus_autoconf - devd config file generator\n" " -i \n" - " -m \n" " -t \n" " -h show usage\n" ); @@ -263,7 +341,7 @@ usage(void) int main(int argc, char **argv) { - const char *params = "i:m:ht:"; + const char *params = "i:ht:"; int c; int f; off_t off; @@ -276,16 +354,13 @@ main(int argc, char **argv) case 't': type = optarg; break; - case 'm': - module = optarg; - break; default: usage(); break; } } - if (type == NULL || module == NULL || file_name == NULL) + if (type == NULL || file_name == NULL) usage(); f = open(file_name, O_RDONLY); diff --git a/tools/tools/bus_autoconf/bus_autoconf.h b/tools/tools/bus_autoconf/bus_autoconf.h index a247109b2f7..7dbc4865d2d 100644 --- a/tools/tools/bus_autoconf/bus_autoconf.h +++ b/tools/tools/bus_autoconf/bus_autoconf.h @@ -33,6 +33,9 @@ struct usb_device_id { + /* Internal field */ + char module_name[32]; + /* Hook for driver specific information */ unsigned long driver_info; diff --git a/tools/tools/bus_autoconf/bus_autoconf.sh b/tools/tools/bus_autoconf/bus_autoconf.sh index 4815572261a..21a4df063dd 100644 --- a/tools/tools/bus_autoconf/bus_autoconf.sh +++ b/tools/tools/bus_autoconf/bus_autoconf.sh @@ -29,6 +29,30 @@ OS=FreeBSD DOLLAR=$ +cleanup() +{ + # Cleanup + rm -f usb_dual.ids + rm -f usb_host.ids + rm -f usb_device.ids +} + +usb_format() +{ + [ -f ${1} ] || return + + # Split into one and one record + split -b 32 ${1} ${1}. + + # Prefix each record by the module name + for G in $(ls ${1}.*) + do + printf "%-32s" ${3} >> ${2} + cat ${G} >> ${2} + rm -f ${G} + done +} + cat < /dev/null -[ -f ${F}.ids ] && ( -bus_autoconf -i ${F}.ids -t usb_host -m ${H} ; -rm ${F}.ids -) +objcopy -j usb_host_id -O binary ${F} temp.ids 2> /dev/null +usb_format temp.ids usb_host.ids ${H} + # USB Device -objcopy -j usb_device_id -O binary ${F} ${F}.ids 2> /dev/null -[ -f ${F}.ids ] && ( -bus_autoconf -i ${F}.ids -t usb_device -m ${H} ; -rm ${F}.ids -) +objcopy -j usb_device_id -O binary ${F} temp.ids 2> /dev/null +usb_format temp.ids usb_device.ids ${H} + # USB Dual mode -objcopy -j usb_dual_id -O binary ${F} ${F}.ids 2> /dev/null -[ -f ${F}.ids ] && ( -bus_autoconf -i ${F}.ids -t usb_dual -m ${H} ; -rm ${F}.ids -) +objcopy -j usb_dual_id -O binary ${F} temp.ids 2> /dev/null +usb_format temp.ids usb_dual.ids ${H} + done + +# Dump all data +[ -f usb_dual.ids ] && bus_autoconf -i usb_dual.ids -t usb_dual +[ -f usb_host.ids ] && bus_autoconf -i usb_host.ids -t usb_host +[ -f usb_device.ids ] && bus_autoconf -i usb_device.ids -t usb_device + +# Cleanup +cleanup From 2854ca4726c1db4e7e937fb3e030b1eea7b2415c Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 24 Jun 2011 21:32:03 +0000 Subject: [PATCH 08/49] - Add auto-load devd config file for USB kernel modules. MFC after: 14 days --- etc/devd/bus_auto.conf | 2347 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2347 insertions(+) create mode 100644 etc/devd/bus_auto.conf diff --git a/etc/devd/bus_auto.conf b/etc/devd/bus_auto.conf new file mode 100644 index 00000000000..596fa7e0eaf --- /dev/null +++ b/etc/devd/bus_auto.conf @@ -0,0 +1,2347 @@ +# +# $FreeBSD$ +# +# This file was automatically generated by "tools/bus_autoconf.sh". +# Please do not edit! +# + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "(host|device)"; + match "intclass" "0x02"; + match "intsubclass" "0x06"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "(host|device)"; + match "intclass" "0x02"; + match "intsubclass" "0x0a"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "(host|device)"; + match "intclass" "0x02"; + match "intsubclass" "0x0d"; + action "kldload if_cdce"; +}; + +# 3 usb_dual entries processed + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1290"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1292"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1294"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1297"; + match "intclass" "0xff"; + match "intsubclass" "0xfd"; + match "intprotocol" "0x01"; + action "kldload if_ipheth"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0104"; + match "product" "0x00be"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03e8"; + match "product" "0x0008"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03eb"; + match "product" "0x2109"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x0121|0x1016|0x1116|0x1216|0x1b1d|0x1e1d|0x2016|0x2116|0x2216|0x3016|0x3116|0x3216|0x3524|0x4016|0x4116|0x4216|0x5016|0x5116|0x5216|0x811c|0xca02)"; + action "kldload ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0402"; + match "product" "0x5632"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0403"; + match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0408"; + match "product" "(0x0304|0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0409"; + match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x0001|0x0005|0x0009|0x0012|0x003d|0x005e|0x0066|0x0067|0x006e|0x008b|0x00b3|0x00d8|0x00d9|0x00da|0x00e8|0x0116|0x0119|0x012e|0x0137|0x0148|0x0150|0x015d|0x016f)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0413"; + match "product" "0x2101"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0423"; + match "product" "(0x000a|0x000c)"; + action "kldload if_cue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x043e"; + match "product" "0x9c01"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045a"; + match "product" "(0x5001|0x5002)"; + action "kldload urio"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045b"; + match "product" "0x0053"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045e"; + match "product" "(0x0079|0x007a|0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0471"; + match "product" "(0x066a|0x1236|0x200f)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0482"; + match "product" "0x0203"; + action "kldload umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0489"; + match "product" "(0xe000|0xe003)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x049f"; + match "product" "(0x0003|0x0032|0x505a)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a4"; + match "product" "0x0014"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a5"; + match "product" "(0x4027|0x4068)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04ad"; + match "product" "(0x0301|0x0302|0x0303|0x0306)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b4"; + match "product" "0x1002"; + action "kldload ufm"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b7"; + match "product" "0x0531"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04b8"; + match "product" "(0x0521|0x0522)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "(0x0901|0x0904|0x0913|0x0930|0x0944|0x0945|0x0947|0x0948|0x0a03|0x0a0e)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bf"; + match "product" "(0x0115|0x0117)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04c5"; + match "product" "(0x1058|0x1079)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04da"; + match "product" "(0x2500|0x3900)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04dd"; + match "product" "(0x8004|0x8005|0x8006|0x8007|0x9031|0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04|0x6601|0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632|0x8001)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04f1"; + match "product" "(0x3008|0x3011|0x3012)"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0502"; + match "product" "(0x1631|0x1632|0x16e1|0x16e2|0x16e3)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0506"; + match "product" "(0x03e8|0x11f8|0x4601)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "(0x0103|0x0109|0x0121|0x0257|0x0409|0x1203|0x4050|0x5055|0x7050|0x7050|0x7051|0x705a|0x705c|0x705e|0x8053|0x805c|0x815c|0x825a|0x905b|0x935a)"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0525"; + match "product" "(0x1080|0xa4a2)"; + action "kldload udbp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0536"; + match "product" "0x01a0"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0543"; + match "product" "(0x0ed9|0x1527|0x1529|0x152b|0x152e|0x1921|0x1922|0x1923)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0547"; + match "product" "(0x2008|0x2720)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x054c"; + match "product" "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169|0x0437)"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "(0x2002|0x2007|0x2008|0x2009|0x4000)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x055d"; + match "product" "0x2018"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0565"; + match "product" "(0x0001|0x0002|0x0003|0x0005)"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0567"; + match "product" "(0x2000|0x2002)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056c"; + match "product" "0x8007"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056e"; + match "product" "(0x200c|0x4002|0x4005|0x400b|0x4010|0x5003|0x5004|0xabc1)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x057c"; + match "product" "(0x2200|0x3800)"; + action "kldload ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0584"; + match "product" "(0xb000|0xb020)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "(0x3401|0x3407|0x3409|0x340a|0x340f|0x3410|0x3416|0x341a)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x058f"; + match "product" "0x9720"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05a6"; + match "product" "0x0101"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c|0x0229|0x022a|0x022b|0x030a|0x030b|0x1402)"; + action "kldload atp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ad"; + match "product" "0x0fba"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05c6"; + match "product" "(0x6000|0x6613)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05cc"; + match "product" "0x3000"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05db"; + match "product" "(0x0003|0x0005|0x0009|0x000a|0x0011)"; + action "kldload uvscom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05e0"; + match "product" "(0x2000|0x2001|0x2002|0x2003|0x2004|0x2005|0x2006|0x2007|0x2008|0x2009|0x200a)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05e3"; + match "product" "0x0501"; + action "kldload udbp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05e9"; + match "product" "(0x0008|0x0009)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x066b"; + match "product" "(0x200c|0x2202|0x2202|0x2203|0x2204|0x2206|0x400b)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0675"; + match "product" "0x0550"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067b"; + match "product" "(0x0000|0x0001|0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303|0x2501|0x331a|0xaaa0|0xaaa2)"; + action "kldload udbp"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067c"; + match "product" "0x1001"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067e"; + match "product" "0x1001"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0681"; + match "product" "0x3c06"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x06e1"; + match "product" "(0x0008|0x0009)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x06f8"; + match "product" "(0xe000|0xe010|0xe020|0xe030)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0707"; + match "product" "(0x0100|0x0200|0x0201|0xee13|0xee13)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0711"; + match "product" "(0x0200|0x0210|0x0230)"; + action "kldload umct"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0731"; + match "product" "(0x0528|0x2003)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0745"; + match "product" "(0x0001|0x1000)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0769"; + match "product" "(0x11f2|0x11f3|0x31f3)"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x077b"; + match "product" "0x2226"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0789"; + match "product" "(0x010c|0x0160|0x0162|0x0163|0x0164)"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x078b"; + match "product" "0x1234"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x079b"; + match "product" "(0x0027|0x004a|0x0062)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07a6"; + match "product" "(0x07c2|0x0986|0x8511|0x8513|0x8515)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "(0x0001|0x0004|0x000d|0x0017|0x002a|0x002d|0x002e|0x002f|0x003c|0x003f|0x0041|0x0042|0x9601)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "(0x110c|0x200c|0x2770|0x2870|0x3070|0x3071|0x3072|0x4000|0x4002|0x4003|0x4004|0x4007|0x400b|0x400c|0x4102|0x4104|0x420a|0x6001|0xabc1|0xb21b|0xb21c|0xb21d|0xb21e|0xb21f)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07c9"; + match "product" "0xb100"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07cf"; + match "product" "(0x2001|0x2002|0x2003)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "(0x3a0c|0x3c03|0x3c04|0x3c06|0x3c07|0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x081e"; + match "product" "0xdf00"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x082d"; + match "product" "(0x0100|0x0200|0x0300)"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0830"; + match "product" "(0x0001|0x0002|0x0003|0x0020|0x0031|0x0040|0x0050|0x0060|0x0061|0x0070)"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0833"; + match "product" "(0x012e|0x039f)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x083a"; + match "product" "(0x1046|0x4506|0x4506|0x4508|0x4521|0x5046|0x6618|0x7511|0x7512|0x7522|0x8522|0xa512|0xa618|0xa701|0xa702|0xb522|0xc522|0xd522|0xe501)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0841"; + match "product" "0x0001"; + action "kldload urio"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "(0x1001|0x1002|0x1020|0x1040|0x4240|0x4260|0x4300|0x6100|0x6a00)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0856"; + match "product" "0xac01"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x085a"; + match "product" "(0x0008|0x0009)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x086e"; + match "product" "0x1920"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x087d"; + match "product" "0x5704"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08d1"; + match "product" "(0x0001|0x0003)"; + action "kldload if_cue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08dd"; + match "product" "(0x0986|0x0987|0x0988|0x8511|0x90ff)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08e6"; + match "product" "0x5501"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08fd"; + match "product" "0x000a"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0915"; + match "product" "(0x2000|0x2002)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x091e"; + match "product" "0x0004"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0921"; + match "product" "0x1001"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0930"; + match "product" "(0x0700|0x0705|0x0706|0x0707|0x0708|0x0709|0x070a|0x070b|0x0a07|0x0d45|0x1302)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x093c"; + match "product" "(0x0601|0x0701)"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x094b"; + match "product" "0x0001"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0951"; + match "product" "(0x0008|0x000a)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x095a"; + match "product" "0x3003"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0960"; + match "product" "(0x0065|0x0066|0x0067)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0961"; + match "product" "0x0010"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x099e"; + match "product" "(0x0052|0x4000)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x09aa"; + match "product" "0x1000"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x09d7"; + match "product" "0x0100"; + action "kldload ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0a46"; + match "product" "(0x0268|0x8515|0x9601)"; + action "kldload if_udav"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0a5c"; + match "product" "0x2033"; + action "kldload ubtbcmfw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0ace"; + match "product" "(0x1211|0x1215)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701|0x6721|0x6741|0x6761|0x6800|0x6901|0x6911|0x6971|0x6971|0x7001|0x7011|0x7021|0x7041|0x7061|0x7100|0x7201|0x7211|0x7251|0x7301|0x7361|0x7381|0x7401|0x7501|0x7601|0x7601|0xc031|0xd013|0xd031|0xd033|0xd033|0xd055|0xd055)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "(0x1706|0x1707|0x170c|0x171b|0x171d|0x1723|0x1724|0x1731|0x1732|0x1742|0x1760|0x1761|0x1784|0x1790|0x4200|0x4201|0x4202|0x420f|0x9200|0x9202)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b39"; + match "product" "(0x0109|0x0421)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b3b"; + match "product" "(0x1630|0x5630|0x6630)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b41"; + match "product" "0x0011"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b63"; + match "product" "0x6530"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b8c"; + match "product" "0x2303"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b95"; + match "product" "(0x1720|0x1780|0x7720|0x772a)"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0baf"; + match "product" "(0x0118|0x0121)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bb2"; + match "product" "0x6098"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bb4"; + match "product" "(0x00ce|0x00cf|0x00cf|0x0a01|0x0a02|0x0a03|0x0a04|0x0a05|0x0a06|0x0a07|0x0a08|0x0a09|0x0a0a|0x0a0b|0x0a0c|0x0a0d|0x0a0e|0x0a0f|0x0a10|0x0a11|0x0a12|0x0a13|0x0a14|0x0a15|0x0a16|0x0a17|0x0a18|0x0a19|0x0a1a|0x0a1b|0x0a1c|0x0a1d|0x0a1e|0x0a1f|0x0a20|0x0a21|0x0a22|0x0a23|0x0a24|0x0a25|0x0a26|0x0a27|0x0a28|0x0a29|0x0a2a|0x0a2b|0x0a2c|0x0a2d|0x0a2e|0x0a2f|0x0a30|0x0a31|0x0a32|0x0a33|0x0a34|0x0a35|0x0a36|0x0a37|0x0a38|0x0a39|0x0a3a|0x0a3b|0x0a3c|0x0a3d|0x0a3e|0x0a3f|0x0a40|0x0a41|0x0a42|0x0a43|0x0a44|0x0a45|0x0a46|0x0a47|0x0a48|0x0a49|0x0a4a|0x0a4b|0x0a4c|0x0a4d|0x0a4e|0x0a4f|0x0a50|0x0a51|0x0a52|0x0a53|0x0a54|0x0a55|0x0a56|0x0a57|0x0a58|0x0a59|0x0a5a|0x0a5b|0x0a5c|0x0a5d|0x0a5e|0x0a5f|0x0a60|0x0a61|0x0a62|0x0a63|0x0a64|0x0a65|0x0a66|0x0a67|0x0a68|0x0a69|0x0a6a|0x0a6b|0x0a6c|0x0a6d|0x0a6e|0x0a6f|0x0a70|0x0a71|0x0a72|0x0a73|0x0a74|0x0a75|0x0a76|0x0a77|0x0a78|0x0a79|0x0a7a|0x0a7b|0x0a7c|0x0a7d|0x0a7e|0x0a7f|0x0a80|0x0a81|0x0a82|0x0a83|0x0a84|0x0a85|0x0a86|0x0a87|0x0a88|0x0a89|0x0a8a|0x0a8b|0x0a8c|0x0a8d|0x0a8e|0x0a8f|0x0a90|0x0a91|0x0a92|0x0a93|0x0a94|0x0a95|0x0a96|0x0a97|0x0a98|0x0a99|0x0a9a|0x0a9b|0x0a9c|0x0a9d|0x0a9e|0x0a9f|0x0bce)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bda"; + match "product" "(0x8150|0x8187|0x8189|0x8197|0x8198)"; + action "kldload if_rue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bed"; + match "product" "(0x1100|0x1101)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bf8"; + match "product" "(0x1001|0x1009)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c44"; + match "product" "0x03a2"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c88"; + match "product" "(0x17da|0x17da|0x180a)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c8e"; + match "product" "0x6000"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cad"; + match "product" "0x9001"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "(0x0008|0x0011|0x0012|0x0015|0x001a|0x0022|0x0025)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cf3"; + match "product" "(0x0001|0x0003|0x0005)"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0d8e"; + match "product" "(0x3762|0x7801|0x7811)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0db0"; + match "product" "(0x3820|0x3821|0x3822|0x3870|0x3871|0x6861|0x6865|0x6869|0x6874|0x6877|0x6899|0x821a|0x822a|0x870a|0x871a|0x899a|0xa861|0xa874)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0db7"; + match "product" "0x0002"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "(0x000d|0x0017|0x0021|0x0028|0x002b|0x002c|0x002d|0x0039|0x003b|0x003c|0x003d|0x003e|0x003f|0x0040|0x0041|0x0042|0x0047|0x0048|0x004a|0x004d|0x061c|0x9071|0x9075|0x90ac|0x9712)"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df7"; + match "product" "0x0620"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e0b"; + match "product" "(0x9031|0x9041)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e55"; + match "product" "0x110b"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e66"; + match "product" "(0x0001|0x0003|0x0009|0x000b|0x400c)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e67"; + match "product" "0x0002"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e7e"; + match "product" "0x1001"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0ea0"; + match "product" "0x6858"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0eab"; + match "product" "0xc893"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0eb0"; + match "product" "(0x9020|0x9021)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0eba"; + match "product" "(0x1080|0x2080)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f3d"; + match "product" "(0x0112|0x0112)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f4e"; + match "product" "0x0200"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f88"; + match "product" "(0x3012|0x3014)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f94"; + match "product" "0x0001"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f98"; + match "product" "0x0201"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0fb8"; + match "product" "(0x3001|0x3002|0x3003|0x4001)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0fcf"; + match "product" "(0x1003|0x1004|0x1006)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0fe6"; + match "product" "(0x8101|0x9700)"; + action "kldload if_udav"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x100d"; + match "product" "(0x9031|0x9032)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1011"; + match "product" "0x3198"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1044"; + match "product" "(0x8001|0x8002|0x8007|0x8008|0x800a|0x800b|0x800c|0x800d)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1066"; + match "product" "(0x00ce|0x0300|0x0500|0x0600|0x0700)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x106c"; + match "product" "0x3701"; + action "kldload umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10a6"; + match "product" "0xaa26"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10ab"; + match "product" "0x10c5"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10b5"; + match "product" "(0xac70|0xac70)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10bd"; + match "product" "0x1427"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10c4"; + match "product" "(0x0f91|0x1101|0x1601|0x800a|0x803b|0x8043|0x8044|0x8053|0x8066|0x806f|0x807a|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x818b|0x819f|0x81a6|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x8411|0x846e|0x8477|0xea60|0xea61|0xea71|0xf001|0xf002|0xf003|0xf004)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10c5"; + match "product" "0xea61"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10ce"; + match "product" "0xea61"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1114"; + match "product" "(0x0001|0x0004|0x0006)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x114b"; + match "product" "(0x0110|0x0150)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1163"; + match "product" "0x0100"; + action "kldload ucycom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1182"; + match "product" "0x1388"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1186"; + match "product" "0x3e04"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1189"; + match "product" "0x0893"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1199"; + match "product" "(0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0112|0x0120|0x0218|0x0218|0x0220|0x0224|0x0fff|0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x11ad"; + match "product" "0x0701"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x11d9"; + match "product" "(0x1002|0x1003)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x11f5"; + match "product" "(0x0001|0x0003|0x0004|0x0005)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x11f6"; + match "product" "0x2001"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x11f7"; + match "product" "0x02df"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1231"; + match "product" "(0xce01|0xce02)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x126f"; + match "product" "0xa006"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x129b"; + match "product" "(0x1666|0x1828)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12d1"; + match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1465|0x14ac|0x1520)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x12ef"; + match "product" "0x0100"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1342"; + match "product" "0x0204"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1371"; + match "product" "(0x9022|0x9032|0x9401)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1385"; + match "product" "(0x4250|0x5f00|0x5f02)"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13ad"; + match "product" "0x9999"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13b1"; + match "product" "(0x000c|0x000d|0x0011|0x0018|0x001a|0x0020|0x0023|0x0024)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13d2"; + match "product" "0x0400"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13d3"; + match "product" "(0x3247|0x3262|0x3273|0x3284|0x3305)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1410"; + match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5100|0x6000|0x6002|0x7042)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1416"; + match "product" "0x1110"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1435"; + match "product" "(0x0427|0x0711|0x0826|0x082a)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1453"; + match "product" "0x4026"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1472"; + match "product" "0x0009"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1482"; + match "product" "0x3c09"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1485"; + match "product" "(0x0001|0x0002)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "(0x1706|0x2070|0x2570|0x2573|0x2671|0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x8070|0x9020|0x9021)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14b2"; + match "product" "(0x3c02|0x3c06|0x3c07|0x3c08|0x3c09|0x3c11|0x3c12|0x3c22|0x3c23|0x3c25|0x3c25|0x3c27|0x3c28)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14ea"; + match "product" "(0xab10|0xab11|0xab13)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1555"; + match "product" "0x0004"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1557"; + match "product" "(0x7720|0x8150)"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x157e"; + match "product" "(0x3006|0x300a|0x300b|0x300d|0x300e|0x3204|0x3205)"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1582"; + match "product" "0x6003"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x15a9"; + match "product" "(0x0004|0x0006|0x0010)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x15c5"; + match "product" "0x0008"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x15e8"; + match "product" "(0x9100|0x9110)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1614"; + match "product" "(0x0800|0x0802|0x7002)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1631"; + match "product" "(0x6200|0xc019)"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1645"; + match "product" "(0x0005|0x0008|0x8005)"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x166a"; + match "product" "0x0303"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x167b"; + match "product" "0x4001"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x168c"; + match "product" "0x0001"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1690"; + match "product" "(0x0601|0x0710|0x0712|0x0722|0x0740|0x0744)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16ab"; + match "product" "(0x7801|0x7811)"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d5"; + match "product" "(0x6202|0x6501|0x6501|0x6502|0x6502)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d6"; + match "product" "(0x0001|0x0001)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d8"; + match "product" "(0x6006|0x6280|0x6280)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16dc"; + match "product" "(0x0010|0x0011|0x0012|0x0015)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1726"; + match "product" "(0x1000|0x1000)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1737"; + match "product" "(0x0039|0x0070|0x0071|0x0073|0x0077|0x0078|0x0079)"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1740"; + match "product" "(0x0605|0x0615|0x2000|0x9701|0x9702|0x9703|0x9705|0x9706|0x9707|0x9708|0x9709|0x9801)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1761"; + match "product" "0x0b05"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x177f"; + match "product" "(0x0153|0x0302|0x0313)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x17f4"; + match "product" "0xaaaa"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1843"; + match "product" "0x0200"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18c5"; + match "product" "(0x0002|0x0008|0x0012)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18e8"; + match "product" "(0x6196|0x6229|0x6232|0x6238|0x6259)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18ef"; + match "product" "0xe00f"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x19d2"; + match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x2000|0x2002|0x2003|0xfff1|0xfff5|0xfffe)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1a86"; + match "product" "0x7523"; + action "kldload uchcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1a8d"; + match "product" "(0x1002|0x1003|0x1004|0x1005|0x1006|0x1007|0x1008|0x1009|0x100a|0x100b|0x100c|0x100d|0x100e|0x100f|0x1010|0x1011|0x1012)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1b3d"; + match "product" "0x0153"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1b75"; + match "product" "(0x3072|0x8187)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1bbb"; + match "product" "(0x0000|0xf000)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1bc7"; + match "product" "(0x1003|0x1004)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1be3"; + match "product" "0x07a6"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1c9e"; + match "product" "(0x6061|0x9603|0xf000)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1cf1"; + match "product" "(0x0001|0x0004)"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1d09"; + match "product" "0x4000"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1d4d"; + match "product" "(0x0002|0x000c|0x000e|0x0010)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1da5"; + match "product" "(0x4512|0x4515|0x4519|0x4523)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1e0e"; + match "product" "(0x9000|0x9200|0xce16)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1eda"; + match "product" "0x2310"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "(0x1a00|0x200c|0x3a00|0x3a02|0x3a04|0x3c00|0x3c05|0x3c09|0x3c0a|0x4000|0x4001|0x4002|0x4003|0x400b|0x4102|0xabc1)"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "(0x5303|0xab01|0xab24|0xab25|0xab50|0xc007|0xed01|0xed02|0xed06|0xed14)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x203d"; + match "product" "(0x1480|0x14a1|0x14a9)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x20b8"; + match "product" "0x8888"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x20b9"; + match "product" "0x1682"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x22b8"; + match "product" "(0x4204|0x4214|0x4224|0x4234|0x4244|0x600c|0x6027)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2478"; + match "product" "0x2008"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x3334"; + match "product" "0x1701"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x3340"; + match "product" "(0x011c|0x0326|0x0426|0x043a|0x051c|0x053a|0x071c|0x0b1c|0x0e3a|0x0f1c|0x0f3a|0x1326|0x191c|0x2326|0x3326)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x3708"; + match "product" "(0x20ce|0x21ce)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x4113"; + match "product" "(0x0210|0x0211|0x0400|0x0410)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x413c"; + match "product" "(0x4001|0x4002|0x4003|0x4004|0x4005|0x4006|0x4007|0x4008|0x4009|0x8102|0x8104|0x8114|0x8115|0x8116|0x8117|0x8118|0x8128|0x8129|0x8133|0x8134|0x8135|0x8136|0x8137|0x8138|0x8180|0x8181|0x8182|0x9500)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x4348"; + match "product" "0x5523"; + action "kldload uchcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x4505"; + match "product" "0x0010"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x4766"; + match "product" "0x0001"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x5173"; + match "product" "0x1809"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x5372"; + match "product" "0x2303"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x5a57"; + match "product" "(0x0260|0x0280|0x0282|0x0283|0x0284|0x5257)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x5e04"; + match "product" "0xce00"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x6189"; + match "product" "(0x182d|0x2068)"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x6547"; + match "product" "0x0232"; + action "kldload uark"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x6891"; + match "product" "0xa727"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x7392"; + match "product" "(0x7318|0x7711|0x7717|0x7718)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x8516"; + match "product" "(0x2070|0x2770|0x2870|0x3070|0x3071|0x3072|0x3572)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x9710"; + match "product" "(0x7703|0x7730|0x7820|0x7830|0x7840)"; + action "kldload umoscom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x9e88"; + match "product" "0x9e8f"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0xdaae"; + match "product" "0xead6"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; + match "intprotocol" "0x01"; + action "kldload umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x07"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload ulpt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x07"; + match "intsubclass" "0x01"; + match "intprotocol" "0x02"; + action "kldload ulpt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x07"; + match "intsubclass" "0x01"; + match "intprotocol" "0x03"; + action "kldload ulpt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0xe0"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload ng_ubt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0xff"; + match "intsubclass" "0x5d"; + match "intprotocol" "0x01"; + action "kldload uhid"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x01"; + match "intsubclass" "0x01"; + action "kldload snd_uaudio"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x01"; + match "intsubclass" "0x03"; + action "kldload snd_uaudio"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x88"; + action "kldload ufoma"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x03"; + action "kldload uhid"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x08"; + action "kldload umass"; +}; + +# 1626 usb_host entries processed + From 0dbe859d2fdfda3291d5086e66e51c14b2a2dd44 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 24 Jun 2011 21:39:38 +0000 Subject: [PATCH 09/49] Split out host_pcib_get_busno() from the generic PCI-PCI bridge driver to start a new file that will hold utility APIs used by various Host-PCI bridge drivers and drivers that provide PCI domains. --- sys/conf/files | 1 + sys/dev/pci/pci_pci.c | 92 ----------------------------- sys/dev/pci/pci_subr.c | 130 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+), 92 deletions(-) create mode 100644 sys/dev/pci/pci_subr.c diff --git a/sys/conf/files b/sys/conf/files index 1a8d5ff1f55..26c59234f9f 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1552,6 +1552,7 @@ dev/pci/isa_pci.c optional pci isa dev/pci/pci.c optional pci dev/pci/pci_if.m standard dev/pci/pci_pci.c optional pci +dev/pci/pci_subr.c optional pci dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard dev/pci/vga_pci.c optional pci diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index da8465cfaa2..93bbf3ab91f 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -38,16 +38,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include -#include -#include - #include #include #include @@ -1432,91 +1428,3 @@ pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate) bus = device_get_parent(pcib); return (PCIB_POWER_FOR_SLEEP(bus, dev, pstate)); } - -/* - * Try to read the bus number of a host-PCI bridge using appropriate config - * registers. - */ -int -host_pcib_get_busno(pci_read_config_fn read_config, int bus, int slot, int func, - uint8_t *busnum) -{ - uint32_t id; - - id = read_config(bus, slot, func, PCIR_DEVVENDOR, 4); - if (id == 0xffffffff) - return (0); - - switch (id) { - case 0x12258086: - /* Intel 824?? */ - /* XXX This is a guess */ - /* *busnum = read_config(bus, slot, func, 0x41, 1); */ - *busnum = bus; - break; - case 0x84c48086: - /* Intel 82454KX/GX (Orion) */ - *busnum = read_config(bus, slot, func, 0x4a, 1); - break; - case 0x84ca8086: - /* - * For the 450nx chipset, there is a whole bundle of - * things pretending to be host bridges. The MIOC will - * be seen first and isn't really a pci bridge (the - * actual busses are attached to the PXB's). We need to - * read the registers of the MIOC to figure out the - * bus numbers for the PXB channels. - * - * Since the MIOC doesn't have a pci bus attached, we - * pretend it wasn't there. - */ - return (0); - case 0x84cb8086: - switch (slot) { - case 0x12: - /* Intel 82454NX PXB#0, Bus#A */ - *busnum = read_config(bus, 0x10, func, 0xd0, 1); - break; - case 0x13: - /* Intel 82454NX PXB#0, Bus#B */ - *busnum = read_config(bus, 0x10, func, 0xd1, 1) + 1; - break; - case 0x14: - /* Intel 82454NX PXB#1, Bus#A */ - *busnum = read_config(bus, 0x10, func, 0xd3, 1); - break; - case 0x15: - /* Intel 82454NX PXB#1, Bus#B */ - *busnum = read_config(bus, 0x10, func, 0xd4, 1) + 1; - break; - } - break; - - /* ServerWorks -- vendor 0x1166 */ - case 0x00051166: - case 0x00061166: - case 0x00081166: - case 0x00091166: - case 0x00101166: - case 0x00111166: - case 0x00171166: - case 0x01011166: - case 0x010f1014: - case 0x01101166: - case 0x02011166: - case 0x02251166: - case 0x03021014: - *busnum = read_config(bus, slot, func, 0x44, 1); - break; - - /* Compaq/HP -- vendor 0x0e11 */ - case 0x60100e11: - *busnum = read_config(bus, slot, func, 0xc8, 1); - break; - default: - /* Don't know how to read bus number. */ - return 0; - } - - return 1; -} diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c new file mode 100644 index 00000000000..7f0c806f8fe --- /dev/null +++ b/sys/dev/pci/pci_subr.c @@ -0,0 +1,130 @@ +/*- + * Copyright (c) 2011 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Support APIs for Host to PCI bridge drivers and drivers that + * provide PCI domains. + */ + +#include +#include +#include + +#include +#include +#include + +/* + * Try to read the bus number of a host-PCI bridge using appropriate config + * registers. + */ +int +host_pcib_get_busno(pci_read_config_fn read_config, int bus, int slot, int func, + uint8_t *busnum) +{ + uint32_t id; + + id = read_config(bus, slot, func, PCIR_DEVVENDOR, 4); + if (id == 0xffffffff) + return (0); + + switch (id) { + case 0x12258086: + /* Intel 824?? */ + /* XXX This is a guess */ + /* *busnum = read_config(bus, slot, func, 0x41, 1); */ + *busnum = bus; + break; + case 0x84c48086: + /* Intel 82454KX/GX (Orion) */ + *busnum = read_config(bus, slot, func, 0x4a, 1); + break; + case 0x84ca8086: + /* + * For the 450nx chipset, there is a whole bundle of + * things pretending to be host bridges. The MIOC will + * be seen first and isn't really a pci bridge (the + * actual busses are attached to the PXB's). We need to + * read the registers of the MIOC to figure out the + * bus numbers for the PXB channels. + * + * Since the MIOC doesn't have a pci bus attached, we + * pretend it wasn't there. + */ + return (0); + case 0x84cb8086: + switch (slot) { + case 0x12: + /* Intel 82454NX PXB#0, Bus#A */ + *busnum = read_config(bus, 0x10, func, 0xd0, 1); + break; + case 0x13: + /* Intel 82454NX PXB#0, Bus#B */ + *busnum = read_config(bus, 0x10, func, 0xd1, 1) + 1; + break; + case 0x14: + /* Intel 82454NX PXB#1, Bus#A */ + *busnum = read_config(bus, 0x10, func, 0xd3, 1); + break; + case 0x15: + /* Intel 82454NX PXB#1, Bus#B */ + *busnum = read_config(bus, 0x10, func, 0xd4, 1) + 1; + break; + } + break; + + /* ServerWorks -- vendor 0x1166 */ + case 0x00051166: + case 0x00061166: + case 0x00081166: + case 0x00091166: + case 0x00101166: + case 0x00111166: + case 0x00171166: + case 0x01011166: + case 0x010f1014: + case 0x01101166: + case 0x02011166: + case 0x02251166: + case 0x03021014: + *busnum = read_config(bus, slot, func, 0x44, 1); + break; + + /* Compaq/HP -- vendor 0x0e11 */ + case 0x60100e11: + *busnum = read_config(bus, slot, func, 0xc8, 1); + break; + default: + /* Don't know how to read bus number. */ + return 0; + } + + return 1; +} From 9c916c627f1101d584cbf35444fe32a2bc16c07f Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 24 Jun 2011 22:01:56 +0000 Subject: [PATCH 10/49] - Export more USB device ID's. - Update bus_auto.conf accordingly. MFC after: 3 days --- etc/devd/bus_auto.conf | 36 +++++++++++++++++++++++++++++++++++- sys/dev/usb/input/uep.c | 21 +++++++++++---------- sys/dev/usb/input/ukbd.c | 7 +++++++ sys/dev/usb/input/ums.c | 7 +++++++ 4 files changed, 60 insertions(+), 11 deletions(-) diff --git a/etc/devd/bus_auto.conf b/etc/devd/bus_auto.conf index 596fa7e0eaf..a1c7236a515 100644 --- a/etc/devd/bus_auto.conf +++ b/etc/devd/bus_auto.conf @@ -83,6 +83,14 @@ nomatch 32 { action "kldload uipaq"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0123"; + match "product" "0x0001"; + action "kldload uep"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1251,6 +1259,14 @@ nomatch 32 { action "kldload uplcom"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0eef"; + match "product" "(0x0001|0x0002)"; + action "kldload uep"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2260,6 +2276,24 @@ nomatch 32 { action "kldload umodem"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x03"; + match "intsubclass" "0x01"; + match "intprotocol" "0x01"; + action "kldload ukbd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "intclass" "0x03"; + match "intsubclass" "0x01"; + match "intprotocol" "0x02"; + action "kldload ums"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2343,5 +2377,5 @@ nomatch 32 { action "kldload umass"; }; -# 1626 usb_host entries processed +# 1631 usb_host entries processed diff --git a/sys/dev/usb/input/uep.c b/sys/dev/usb/input/uep.c index 048452d84b1..e90298bd1d0 100644 --- a/sys/dev/usb/input/uep.c +++ b/sys/dev/usb/input/uep.c @@ -288,6 +288,12 @@ static const struct usb_config uep_config[UEP_N_TRANSFER] = { }, }; +static const STRUCT_USB_HOST_ID uep_devs[] = { + {USB_VPI(USB_VENDOR_EGALAX, USB_PRODUCT_EGALAX_TPANEL, 0)}, + {USB_VPI(USB_VENDOR_EGALAX, USB_PRODUCT_EGALAX_TPANEL2, 0)}, + {USB_VPI(USB_VENDOR_EGALAX2, USB_PRODUCT_EGALAX2_TPANEL, 0)}, +}; + static int uep_probe(device_t dev) { @@ -295,17 +301,12 @@ uep_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); + if (uaa->info.bConfigIndex != 0) + return (ENXIO); + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); - if ((uaa->info.idVendor == USB_VENDOR_EGALAX) && - ((uaa->info.idProduct == USB_PRODUCT_EGALAX_TPANEL) || - (uaa->info.idProduct == USB_PRODUCT_EGALAX_TPANEL2))) - return (BUS_PROBE_SPECIFIC); - - if ((uaa->info.idVendor == USB_VENDOR_EGALAX2) && - (uaa->info.idProduct == USB_PRODUCT_EGALAX2_TPANEL)) - return (BUS_PROBE_SPECIFIC); - - return (ENXIO); + return (usbd_lookup_id_by_uaa(uep_devs, sizeof(uep_devs), uaa)); } static int diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 918266389a4..b03f884ce03 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -745,6 +745,13 @@ static const struct usb_config ukbd_config[UKBD_N_TRANSFER] = { }, }; +/* A match on these entries will load ukbd */ +static const STRUCT_USB_HOST_ID __used ukbd_devs[] = { + {USB_IFACE_CLASS(UICLASS_HID), + USB_IFACE_SUBCLASS(UISUBCLASS_BOOT), + USB_IFACE_PROTOCOL(UIPROTO_BOOT_KEYBOARD),}, +}; + static int ukbd_probe(device_t dev) { diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index af9aa1f3a98..3c4f36e21ab 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -355,6 +355,13 @@ static const struct usb_config ums_config[UMS_N_TRANSFER] = { }, }; +/* A match on these entries will load ums */ +static const STRUCT_USB_HOST_ID __used ums_devs[] = { + {USB_IFACE_CLASS(UICLASS_HID), + USB_IFACE_SUBCLASS(UISUBCLASS_BOOT), + USB_IFACE_PROTOCOL(UIPROTO_MOUSE),}, +}; + static int ums_probe(device_t dev) { From 519c4ef391b272b7746a5ccbd5526157380fe911 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Fri, 24 Jun 2011 22:08:26 +0000 Subject: [PATCH 11/49] sh(1): Improve documentation of shell patterns: * Shell patterns are also for ${var#pat} and the like. * An '!' by itself will not trigger pathname generation so do not call it a meta-character, even though it has a special meaning directly after an '['. * Character ranges are locale-dependent. * A '^' will complement a character class like '!' but is non-standard. MFC after: 1 week --- bin/sh/sh.1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index bb10133601e..4a9fe069985 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -1629,15 +1629,15 @@ There are two restrictions on this: first, a pattern cannot match a string containing a slash, and second, a pattern cannot match a string starting with a period unless the first character of the pattern is a period. -The next section describes the patterns used for both -Pathname Expansion and the +The next section describes the patterns used for +Pathname Expansion, +the four varieties of parameter expansion for substring processing and the .Ic case command. .Ss Shell Patterns A pattern consists of normal characters, which match themselves, and meta-characters. The meta-characters are -.Ql \&! , .Ql * , .Ql \&? , and @@ -1667,7 +1667,7 @@ matches a .Ql \&[ rather than introducing a character class. A character class matches any of the characters between the square brackets. -A range of characters may be specified using a minus sign. +A locale-dependent range of characters may be specified using a minus sign. A named class of characters (see .Xr wctype 3 ) may be specified by surrounding the name with @@ -1680,12 +1680,17 @@ is a shell pattern that matches a single letter. The character class may be complemented by making an exclamation point .Pq Ql !\& the first character of the character class. +A caret +.Pq Ql ^ +has the same effect but is non-standard. .Pp To include a .Ql \&] in a character class, make it the first character listed (after the -.Ql \&! , +.Ql \&! +or +.Ql ^ , if any). To include a .Ql - , From 3a1b9c049eb3a32a8d1cebaeef2848dab890e871 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Fri, 24 Jun 2011 23:26:45 +0000 Subject: [PATCH 12/49] Comment out AH_DEBUG, to get this kernel to compile, until AH_DEBUG is fixed. --- sys/arm/conf/CAMBRIA | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/conf/CAMBRIA b/sys/arm/conf/CAMBRIA index 6862129713e..befe28af723 100644 --- a/sys/arm/conf/CAMBRIA +++ b/sys/arm/conf/CAMBRIA @@ -130,7 +130,7 @@ options ATH_DIAGAPI #options ATH_TX99_DIAG device ath_rate_sample # SampleRate tx rate control for ath -options AH_DEBUG +#options AH_DEBUG #options AH_ASSERT options AH_PRIVATE_DIAG #device ath_ar5210 From 8fc0556a5e4d73a30d5fdd09508d803a17b3cfee Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Fri, 24 Jun 2011 23:59:14 +0000 Subject: [PATCH 13/49] Small fix to bring the non-debug definitions of HALDEBUG/HALDEBUG_G in line with the debug definitions. --- sys/dev/ath/ath_hal/ah_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h index 2bb163fefe0..120620c8751 100644 --- a/sys/dev/ath/ath_hal/ah_internal.h +++ b/sys/dev/ath/ath_hal/ah_internal.h @@ -528,8 +528,8 @@ extern int ath_hal_debug; /* Global debug flags */ extern void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) __printflike(3,4); #else -#define HALDEBUG(_ah, __m, _fmt, ...) -#define HALDEBUG_G(_ah, __m, _fmt, ...) +#define HALDEBUG(_ah, __m, ...) +#define HALDEBUG_G(_ah, __m, ...) #endif /* AH_DEBUG */ /* From 1a940429c73fc17b601fdfa3e3902849f2ca5223 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sat, 25 Jun 2011 00:34:40 +0000 Subject: [PATCH 14/49] Commit missing piece from a couple days ago - re-add ath_hal_debug. --- sys/dev/ath/ah_osdep.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/ath/ah_osdep.c b/sys/dev/ath/ah_osdep.c index c0f9b8c8e26..cfcfc4a23ea 100644 --- a/sys/dev/ath/ah_osdep.c +++ b/sys/dev/ath/ah_osdep.c @@ -76,6 +76,14 @@ extern void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...); /* NB: put this here instead of the driver to avoid circular references */ SYSCTL_NODE(_hw, OID_AUTO, ath, CTLFLAG_RD, 0, "Atheros driver parameters"); +SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); + +#ifdef AH_DEBUG +int ath_hal_debug = 0; +SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, CTLFLAG_RW, &ath_hal_debug, + 0, "Atheros HAL debugging printfs"); +TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug); +#endif /* AH_DEBUG */ MALLOC_DEFINE(M_ATH_HAL, "ath_hal", "ath hal data"); @@ -147,8 +155,6 @@ DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) #include #include -SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); - static struct alq *ath_hal_alq; static int ath_hal_alq_emitdev; /* need to emit DEVICE record */ static u_int ath_hal_alq_lost; /* count of lost records */ From e920e3978e4821531f2f72ea4178fcadbb666a4a Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 25 Jun 2011 02:15:14 +0000 Subject: [PATCH 15/49] Switch to the event timers infrastructure. This includes: o Setting td_intr_frame to the XIVs trap frame because it's referenced by the ET event handler. o Signal EOI to the CPU before calling the registered XIV handlers. This prevents lost ITC interrupts, which cause starvation in one-shot mode. o Adding support for IPI_HARDCLOCK with corresponding per-CPU counters. o Have the APs call cpu_initclocks() so as to limited the scattering of clock related initialization. cpu_initclocks() calls the _bsp() or _ap() version accordingly. o Uncomment the ET clock handling in cpu_idle(). o Update the DDB 'show pcpu' output for the new MD fields. o Entirely rewritten ia64_ih_clock(). Note that we don't create as many clock XIVs as we have CPUs, as is done on PowerPC. It doesn't scale. We can only have 240 XIVs and we can have more CPUs than that. There's a single intrcnt index for the cumulative clock ticks and we keep per CPU counts in the PCPU stats structure. o Register the ITC by hooking SI_SUB_CONFIGURE (2nd order). Open issues: o Clock interrupts can still be lost. Some tweaking is still necessary. Thanks to: mav@ for his support, feedback and explanations. ET stats while committing: eris% sysctl machdep.cpu | grep nclks machdep.cpu.0.nclks: 24007 machdep.cpu.1.nclks: 22895 machdep.cpu.2.nclks: 13523 machdep.cpu.3.nclks: 9342 machdep.cpu.4.nclks: 9103 machdep.cpu.5.nclks: 9298 machdep.cpu.6.nclks: 10039 machdep.cpu.7.nclks: 9479 eris% vmstat -i | grep clock clock 108599 50 --- sys/conf/files.ia64 | 1 + sys/ia64/ia64/clock.c | 197 +++++++++++++++++++------------------ sys/ia64/ia64/db_machdep.c | 12 ++- sys/ia64/ia64/interrupt.c | 8 +- sys/ia64/ia64/machdep.c | 9 +- sys/ia64/ia64/mp_machdep.c | 18 +++- sys/ia64/include/pcpu.h | 4 +- sys/ia64/include/smp.h | 2 + 8 files changed, 141 insertions(+), 110 deletions(-) diff --git a/sys/conf/files.ia64 b/sys/conf/files.ia64 index 15ef939097f..e3412306571 100644 --- a/sys/conf/files.ia64 +++ b/sys/conf/files.ia64 @@ -120,6 +120,7 @@ ia64/pci/pci_cfgreg.c optional pci isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/imgact_elf32.c optional compat_freebsd32 +kern/kern_clocksource.c standard libkern/bcmp.c standard libkern/ffsl.c standard libkern/fls.c standard diff --git a/sys/ia64/ia64/clock.c b/sys/ia64/ia64/clock.c index 33dbb2e3c1e..5f0e2fe5826 100644 --- a/sys/ia64/ia64/clock.c +++ b/sys/ia64/ia64/clock.c @@ -32,9 +32,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include @@ -45,26 +47,12 @@ __FBSDID("$FreeBSD$"); #include #include -SYSCTL_NODE(_debug, OID_AUTO, clock, CTLFLAG_RW, 0, "clock statistics"); - -static int adjust_edges = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_edges, CTLFLAG_RD, - &adjust_edges, 0, "Number of times ITC got more than 12.5% behind"); - -static int adjust_excess = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_excess, CTLFLAG_RD, - &adjust_excess, 0, "Total number of ignored ITC interrupts"); - -static int adjust_lost = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_lost, CTLFLAG_RD, - &adjust_lost, 0, "Total number of lost ITC interrupts"); - -static int adjust_ticks = 0; -SYSCTL_INT(_debug_clock, OID_AUTO, adjust_ticks, CTLFLAG_RD, - &adjust_ticks, 0, "Total number of ITC interrupts with adjustment"); +#define CLOCK_ET_OFF 0 +#define CLOCK_ET_PERIODIC 1 +#define CLOCK_ET_ONESHOT 2 +static struct eventtimer ia64_clock_et; static u_int ia64_clock_xiv; -static uint64_t ia64_clock_reload; #ifndef SMP static timecounter_get_t ia64_get_timecount; @@ -87,75 +75,100 @@ ia64_get_timecount(struct timecounter* tc) static u_int ia64_ih_clock(struct thread *td, u_int xiv, struct trapframe *tf) { - uint64_t adj, clk, itc; - int64_t delta; - int count; + struct eventtimer *et; + uint64_t itc, load; + uint32_t mode; PCPU_INC(md.stats.pcs_nclks); + intrcnt[INTRCNT_CLOCK]++; - if (PCPU_GET(cpuid) == 0) { - /* - * Clock processing on the BSP. - */ - intrcnt[INTRCNT_CLOCK]++; + itc = ia64_get_itc(); + PCPU_SET(md.clock, itc); - itc = ia64_get_itc(); - - adj = PCPU_GET(md.clockadj); - clk = PCPU_GET(md.clock); - - delta = itc - clk; - count = 0; - while (delta >= ia64_clock_reload) { -#ifdef SMP - ipi_all_but_self(ia64_clock_xiv); -#endif - hardclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); - if (profprocs != 0) - profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); - statclock(TRAPF_USERMODE(tf)); - delta -= ia64_clock_reload; - clk += ia64_clock_reload; - if (adj != 0) - adjust_ticks++; - count++; - } - ia64_set_itm(ia64_get_itc() + ia64_clock_reload - adj); - ia64_srlz_d(); - if (count > 0) { - adjust_lost += count - 1; - if (delta > (ia64_clock_reload >> 3)) { - if (adj == 0) - adjust_edges++; - adj = ia64_clock_reload >> 4; - } else - adj = 0; - } else { - adj = 0; - adjust_excess++; - } - PCPU_SET(md.clock, clk); - PCPU_SET(md.clockadj, adj); - } else { - /* - * Clock processing on the BSP. - */ - hardclock_cpu(TRAPF_USERMODE(tf)); - if (profprocs != 0) - profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf)); - statclock(TRAPF_USERMODE(tf)); - } + mode = PCPU_GET(md.clock_mode); + if (mode == CLOCK_ET_PERIODIC) { + load = PCPU_GET(md.clock_load); + ia64_set_itm(itc + load); + } else + ia64_set_itv((1 << 16) | xiv); + ia64_srlz_d(); + et = &ia64_clock_et; + if (et->et_active) + et->et_event_cb(et, et->et_arg); return (0); } /* - * Start the real-time and statistics clocks. We use ar.itc and cr.itm - * to implement a 1000hz clock. + * Event timer start method. + */ +static int +ia64_clock_start(struct eventtimer *et, struct bintime *first, + struct bintime *period) +{ + u_long itc, load; + register_t is; + + if (period != NULL) { + PCPU_SET(md.clock_mode, CLOCK_ET_PERIODIC); + load = (et->et_frequency * (period->frac >> 32)) >> 32; + if (period->sec > 0) + load += et->et_frequency * period->sec; + } else { + PCPU_SET(md.clock_mode, CLOCK_ET_ONESHOT); + load = 0; + } + + PCPU_SET(md.clock_load, load); + + if (first != NULL) { + load = (et->et_frequency * (first->frac >> 32)) >> 32; + if (first->sec > 0) + load += et->et_frequency * first->sec; + } + + is = intr_disable(); + itc = ia64_get_itc(); + ia64_set_itm(itc + load); + ia64_set_itv(ia64_clock_xiv); + ia64_srlz_d(); + intr_restore(is); + return (0); +} + +/* + * Event timer stop method. + */ +static int +ia64_clock_stop(struct eventtimer *et) +{ + + ia64_set_itv((1 << 16) | ia64_clock_xiv); + ia64_srlz_d(); + PCPU_SET(md.clock_mode, CLOCK_ET_OFF); + PCPU_SET(md.clock_load, 0); + return (0); +} + +/* + * We call cpu_initclocks() on the APs as well. It allows us to + * group common initialization in the same function. */ void cpu_initclocks() { + + ia64_clock_stop(NULL); + if (PCPU_GET(cpuid) == 0) + cpu_initclocks_bsp(); + else + cpu_initclocks_ap(); +} + +static void +clock_configure(void *dummy) +{ + struct eventtimer *et; u_long itc_freq; ia64_clock_xiv = ia64_xiv_alloc(PI_REALTIME, IA64_XIV_IPI, @@ -165,31 +178,23 @@ cpu_initclocks() itc_freq = (u_long)ia64_itc_freq() * 1000000ul; - stathz = hz; - ia64_clock_reload = (itc_freq + hz/2) / hz; + et = &ia64_clock_et; + et->et_name = "ITC"; + et->et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; + et->et_quality = 1000; + et->et_frequency = itc_freq; + et->et_min_period.sec = 0; + et->et_min_period.frac = ((1ul << 32) / itc_freq) << 32; + et->et_max_period.sec = 0xfffffff0 / itc_freq; + et->et_max_period.frac = ((0xfffffffeul << 32) / itc_freq) << 32; + et->et_start = ia64_clock_start; + et->et_stop = ia64_clock_stop; + et->et_priv = NULL; + et_register(et); #ifndef SMP ia64_timecounter.tc_frequency = itc_freq; tc_init(&ia64_timecounter); #endif - - PCPU_SET(md.clockadj, 0); - PCPU_SET(md.clock, ia64_get_itc()); - ia64_set_itm(PCPU_GET(md.clock) + ia64_clock_reload); - ia64_set_itv(ia64_clock_xiv); - ia64_srlz_d(); -} - -void -cpu_startprofclock(void) -{ - - /* nothing to do */ -} - -void -cpu_stopprofclock(void) -{ - - /* nothing to do */ } +SYSINIT(clkcfg, SI_SUB_CONFIGURE, SI_ORDER_SECOND, clock_configure, NULL); diff --git a/sys/ia64/ia64/db_machdep.c b/sys/ia64/ia64/db_machdep.c index 9d583a19955..b689a3c21dd 100644 --- a/sys/ia64/ia64/db_machdep.c +++ b/sys/ia64/ia64/db_machdep.c @@ -578,11 +578,13 @@ db_show_mdpcpu(struct pcpu *pc) { struct pcpu_md *md = &pc->pc_md; - db_printf("MD: vhpt = %#lx\n", md->vhpt); - db_printf("MD: lid = %#lx\n", md->lid); - db_printf("MD: clock = %#lx/%#lx\n", md->clock, md->clockadj); - db_printf("MD: stats = %p\n", &md->stats); - db_printf("MD: pmap = %p\n", md->current_pmap); + db_printf("MD: vhpt = %#lx\n", md->vhpt); + db_printf("MD: lid = %#lx\n", md->lid); + db_printf("MD: clock = %#lx\n", md->clock); + db_printf("MD: clock_mode = %u\n", md->clock_mode); + db_printf("MD: clock_load = %#lx\n", md->clock_load); + db_printf("MD: stats = %p\n", &md->stats); + db_printf("MD: pmap = %p\n", md->current_pmap); } void diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c index adb16ece9d5..f4e55944059 100644 --- a/sys/ia64/ia64/interrupt.c +++ b/sys/ia64/ia64/interrupt.c @@ -309,6 +309,7 @@ void ia64_handle_intr(struct trapframe *tf) { struct thread *td; + struct trapframe *stf; u_int xiv; td = curthread; @@ -323,17 +324,20 @@ ia64_handle_intr(struct trapframe *tf) } critical_enter(); + stf = td->td_intr_frame; + td->td_intr_frame = tf; do { + ia64_set_eoi(0); + ia64_srlz_d(); CTR2(KTR_INTR, "INTR: ITC=%u, XIV=%u", (u_int)tf->tf_special.ifa, xiv); (ia64_handler[xiv])(td, xiv, tf); - ia64_set_eoi(0); - ia64_srlz_d(); xiv = ia64_get_ivr(); ia64_srlz_d(); } while (xiv != 15); + td->td_intr_frame = stf; critical_exit(); out: diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 185e13c9893..2bfd62e4ee4 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -345,6 +345,11 @@ cpu_startup(void *dummy) "nextints", CTLFLAG_RD, &pcs->pcs_nextints, "Number of ExtINT interrupts"); + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "nhardclocks", CTLFLAG_RD, &pcs->pcs_nhardclocks, + "Number of IPI_HARDCLOCK interrupts"); + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nhighfps", CTLFLAG_RD, &pcs->pcs_nhighfps, @@ -416,12 +421,10 @@ cpu_idle(int busy) { register_t ie; -#if 0 if (!busy) { critical_enter(); cpu_idleclock(); } -#endif ie = intr_disable(); KASSERT(ie != 0, ("%s called with interrupts disabled\n", __func__)); @@ -436,12 +439,10 @@ cpu_idle(int busy) ia64_enable_intr(); } -#if 0 if (!busy) { cpu_activeclock(); critical_exit(); } -#endif } int diff --git a/sys/ia64/ia64/mp_machdep.c b/sys/ia64/ia64/mp_machdep.c index 15afea03018..59b14d03f3e 100644 --- a/sys/ia64/ia64/mp_machdep.c +++ b/sys/ia64/ia64/mp_machdep.c @@ -77,6 +77,7 @@ void ia64_ap_startup(void); struct ia64_ap_state ia64_ap_state; int ia64_ipi_ast; +int ia64_ipi_hardclock; int ia64_ipi_highfp; int ia64_ipi_nmi; int ia64_ipi_preempt; @@ -107,6 +108,16 @@ ia64_ih_ast(struct thread *td, u_int xiv, struct trapframe *tf) return (0); } +static u_int +ia64_ih_hardclock(struct thread *td, u_int xiv, struct trapframe *tf) +{ + + PCPU_INC(md.stats.pcs_nhardclocks); + CTR1(KTR_SMP, "IPI_HARDCLOCK, cpuid=%d", PCPU_GET(cpuid)); + hardclockintr(); + return (0); +} + static u_int ia64_ih_highfp(struct thread *td, u_int xiv, struct trapframe *tf) { @@ -233,10 +244,11 @@ ia64_ap_startup(void) CTR1(KTR_SMP, "SMP: cpu%d launched", PCPU_GET(cpuid)); - /* Mask interval timer interrupts on APs. */ - ia64_set_itv(0x10000); + cpu_initclocks(); + ia64_set_tpr(0); ia64_srlz_d(); + ia64_enable_intr(); sched_throw(NULL); @@ -413,6 +425,8 @@ cpu_mp_unleash(void *dummy) /* Allocate XIVs for IPIs */ ia64_ipi_ast = ia64_xiv_alloc(PI_DULL, IA64_XIV_IPI, ia64_ih_ast); + ia64_ipi_hardclock = ia64_xiv_alloc(PI_REALTIME, IA64_XIV_IPI, + ia64_ih_hardclock); ia64_ipi_highfp = ia64_xiv_alloc(PI_AV, IA64_XIV_IPI, ia64_ih_highfp); ia64_ipi_preempt = ia64_xiv_alloc(PI_SOFT, IA64_XIV_IPI, ia64_ih_preempt); diff --git a/sys/ia64/include/pcpu.h b/sys/ia64/include/pcpu.h index 05e2cc1b300..5ad61ba9a8b 100644 --- a/sys/ia64/include/pcpu.h +++ b/sys/ia64/include/pcpu.h @@ -37,6 +37,7 @@ struct pcpu_stats { u_long pcs_nasts; /* IPI_AST counter. */ u_long pcs_nclks; /* Clock interrupt counter. */ u_long pcs_nextints; /* ExtINT counter. */ + u_long pcs_nhardclocks; /* IPI_HARDCLOCK counter. */ u_long pcs_nhighfps; /* IPI_HIGH_FP counter. */ u_long pcs_nhwints; /* Hardware int. counter. */ u_long pcs_npreempts; /* IPI_PREEMPT counter. */ @@ -51,7 +52,8 @@ struct pcpu_md { vm_offset_t vhpt; /* Address of VHPT */ uint64_t lid; /* local CPU ID */ uint64_t clock; /* Clock counter. */ - uint64_t clockadj; /* Clock adjust. */ + uint64_t clock_load; /* Clock reload value. */ + uint32_t clock_mode; /* Clock ET mode */ uint32_t awake:1; /* CPU is awake? */ struct pcpu_stats stats; /* Interrupt stats. */ #ifdef _KERNEL diff --git a/sys/ia64/include/smp.h b/sys/ia64/include/smp.h index d2aff76c3ad..b80d6a0e847 100644 --- a/sys/ia64/include/smp.h +++ b/sys/ia64/include/smp.h @@ -7,6 +7,7 @@ #ifdef _KERNEL #define IPI_AST ia64_ipi_ast +#define IPI_HARDCLOCK ia64_ipi_hardclock #define IPI_PREEMPT ia64_ipi_preempt #define IPI_RENDEZVOUS ia64_ipi_rndzvs #define IPI_STOP ia64_ipi_stop @@ -37,6 +38,7 @@ struct ia64_ap_state { }; extern int ia64_ipi_ast; +extern int ia64_ipi_hardclock; extern int ia64_ipi_highfp; extern int ia64_ipi_nmi; extern int ia64_ipi_preempt; From 6d064c97588d4401dd60ea6fc11a70355794594a Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 25 Jun 2011 02:49:47 +0000 Subject: [PATCH 16/49] Now that ia64 has been switched to the event timers, remove the conditional compilation work-arounds. --- sys/dev/acpica/acpi_cpu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index b0a7210a981..d26903d22a5 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -856,10 +856,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc *sc) sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; -#ifndef __ia64__ else cpu_can_deep_sleep = 1; -#endif } sbuf_trim(&sb); sbuf_finish(&sb); @@ -929,11 +927,9 @@ acpi_cpu_idle() /* Find the lowest state that has small enough latency. */ cx_next_idx = 0; -#ifndef __ia64__ if (cpu_disable_deep_sleep) i = min(sc->cpu_cx_lowest, sc->cpu_non_c3); else -#endif i = sc->cpu_cx_lowest; for (; i >= 0; i--) { if (sc->cpu_cx_states[i].trans_lat * 3 <= sc->cpu_prev_sleep) { From 3f5deb80b762c313679fc7d6e03064b88681d4ff Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 25 Jun 2011 03:37:40 +0000 Subject: [PATCH 17/49] Update copyright. --- sys/ia64/ia64/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ia64/ia64/clock.c b/sys/ia64/ia64/clock.c index 5f0e2fe5826..881c46f7d13 100644 --- a/sys/ia64/ia64/clock.c +++ b/sys/ia64/ia64/clock.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 Marcel Moolenaar + * Copyright (c) 2005, 2009-2011 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without From dbd57cbf8f7f3815b2eb47ecdbcbb6fc461128fa Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 25 Jun 2011 03:43:58 +0000 Subject: [PATCH 18/49] Replace the original copyright notice with my own. Everything in this file is written by me and has no bearing on the initial or original version. --- sys/ia64/ia64/interrupt.c | 52 +++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/sys/ia64/ia64/interrupt.c b/sys/ia64/ia64/interrupt.c index f4e55944059..27d5e60cb08 100644 --- a/sys/ia64/ia64/interrupt.c +++ b/sys/ia64/ia64/interrupt.c @@ -1,41 +1,33 @@ -/* $FreeBSD$ */ -/* $NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $ */ - /*- - * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. + * Copyright (c) 2010-2011 Marcel Moolenaar * All rights reserved. * - * Authors: Keith Bostic, Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ -/*- - * Additional Copyright (c) 1997 by Matthew Jacob for NASA/Ames Research Center. - * Redistribute and modify at will, leaving only this additional copyright - * notice. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include "opt_ddb.h" -#include /* RCS ID & Copyright macro defns */ +#include +__FBSDID("$FreeBSD$"); #include #include From 1aac6ac94a070ab24ceaf96086475a4d92df8df5 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Sat, 25 Jun 2011 10:01:43 +0000 Subject: [PATCH 19/49] generic_stop_cpus: pull timeout logic from under DIAGNOSTIC ... and also increase the timeout. It's better to try to proceed somehow despite stuck CPUs than to hang indefinitely. Especially so during shutdown and when entering kdb or panic. Timeout value is still an aribitrary value. Timeout diagnostic is just a printf; the work on something more debuggable is planned by attilio. Need to be careful here as stop_cpus_hard is called very early while enetering kdb and soon(-ish) it may become called very early when entering panic. Reviewed by: attilio MFC after: 2 months --- sys/kern/subr_smp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index c38177b4e71..0929ab90758 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -236,12 +236,10 @@ generic_stop_cpus(cpuset_t map, u_int type) /* spin */ cpu_spinwait(); i++; -#ifdef DIAGNOSTIC - if (i == 100000) { + if (i == 100000000) { printf("timeout stopping cpus\n"); break; } -#endif } stopping_cpu = NOCPU; From 31c5a6e2b8de66a2bdaf69be8c209ae7ec7dc493 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Sat, 25 Jun 2011 10:28:16 +0000 Subject: [PATCH 20/49] unconditionally stop other cpus when entering kdb in smp system ... and thus retire debug.kdb.stop_cpus tunable/sysctl. The knob was to work around CPU stopping issues, which since have been either fixed or greatly reduced. kdb should really operate in a special environment with scheduler stopped and interrupts disabled to provide deterministic debugging. Discussed with: attilio, rwatson X-MFC after: 2 months or never --- sys/kern/subr_kdb.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index c2f6e99531d..2bc5ab230e6 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -87,20 +87,6 @@ SYSCTL_PROC(_debug_kdb, OID_AUTO, trap, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_code, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, kdb_sysctl_trap_code, "I", "set to cause a page fault via code access"); -/* - * Flag indicating whether or not to IPI the other CPUs to stop them on - * entering the debugger. Sometimes, this will result in a deadlock as - * stop_cpus() waits for the other cpus to stop, so we allow it to be - * disabled. In order to maximize the chances of success, use a hard - * stop for that. - */ -#ifdef SMP -static int kdb_stop_cpus = 1; -SYSCTL_INT(_debug_kdb, OID_AUTO, stop_cpus, CTLFLAG_RW | CTLFLAG_TUN, - &kdb_stop_cpus, 0, "stop other CPUs when entering the debugger"); -TUNABLE_INT("debug.kdb.stop_cpus", &kdb_stop_cpus); -#endif - /* * Flag to indicate to debuggers why the debugger was entered. */ @@ -515,9 +501,6 @@ kdb_trap(int type, int code, struct trapframe *tf) { struct kdb_dbbe *be; register_t intr; -#ifdef SMP - int did_stop_cpus; -#endif int handled; be = kdb_dbbe; @@ -531,8 +514,7 @@ kdb_trap(int type, int code, struct trapframe *tf) intr = intr_disable(); #ifdef SMP - if ((did_stop_cpus = kdb_stop_cpus) != 0) - stop_cpus_hard(PCPU_GET(other_cpus)); + stop_cpus_hard(PCPU_GET(other_cpus)); #endif kdb_active++; @@ -558,8 +540,7 @@ kdb_trap(int type, int code, struct trapframe *tf) kdb_active--; #ifdef SMP - if (did_stop_cpus) - restart_cpus(stopped_cpus); + restart_cpus(stopped_cpus); #endif intr_restore(intr); From 76341556c97f686a7474a1f4b5573f9c8fe68e2e Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Sat, 25 Jun 2011 11:21:23 +0000 Subject: [PATCH 21/49] Add missing libkvm and libutil dependencies. Now libprocstat takes care of its own dependencies and does not require applications to specify them. Reviewed by: stas, jilles --- lib/libprocstat/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libprocstat/Makefile b/lib/libprocstat/Makefile index e5091694e86..05a64e782b5 100644 --- a/lib/libprocstat/Makefile +++ b/lib/libprocstat/Makefile @@ -19,6 +19,8 @@ INCS= libprocstat.h CFLAGS+= -I. -I${.CURDIR} -D_KVM_VNODE SHLIB_MAJOR= 1 WITHOUT_MAN= yes +DPADD= ${LIBKVM} ${LIBUTIL} +LDADD= -lkvm -lutil .if ${MK_NCP} != "no" CFLAGS+= -DLIBPROCSTAT_NWFS From 54350dfa3394b86a24dc4b1ac20651789051aacc Mon Sep 17 00:00:00 2001 From: Jonathan Anderson Date: Sat, 25 Jun 2011 12:37:06 +0000 Subject: [PATCH 22/49] Remove redundant Capsicum sysctl. Since we're now declaring FEATURE(security_capabilities), there's no need for an explicit SYSCTL_NODE. Approved by: rwatson --- sys/kern/sys_capability.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/kern/sys_capability.c b/sys/kern/sys_capability.c index 89dc923d9b0..c6d9826c804 100644 --- a/sys/kern/sys_capability.c +++ b/sys/kern/sys_capability.c @@ -63,13 +63,6 @@ __FBSDID("$FreeBSD$"); FEATURE(security_capabilities, "Capsicum Capability Mode"); -/* - * We don't currently have any MIB entries for sysctls, but we do expose - * security.capabilities so that it's easy to tell if options CAPABILITIES is - * compiled into the kernel. - */ -SYSCTL_NODE(_security, OID_AUTO, capabilities, CTLFLAG_RW, 0, "Capsicum"); - /* * System call to enter capability mode for the process. */ From 4449ead376c34328941ddfbe5a7a537a8d8e9dab Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 25 Jun 2011 13:44:05 +0000 Subject: [PATCH 23/49] - Improve bus_autoconf tool. - Implement simple and generic language which can be used to describe any kind of device ID structures. - Fix endian issues. - Add an example format file. Suggested by: imp @ MFC after: 14 days --- tools/tools/bus_autoconf/Makefile | 5 +- tools/tools/bus_autoconf/bus_autoconf.c | 375 +++-------------- tools/tools/bus_autoconf/bus_autoconf.h | 55 --- tools/tools/bus_autoconf/bus_autoconf.sh | 57 +-- .../bus_autoconf_format_example.txt | 111 +++++ tools/tools/bus_autoconf/bus_load_file.c | 72 ++++ tools/tools/bus_autoconf/bus_load_file.h | 33 ++ tools/tools/bus_autoconf/bus_sections.c | 223 ++++++++++ tools/tools/bus_autoconf/bus_sections.h | 35 ++ tools/tools/bus_autoconf/bus_usb.c | 382 ++++++++++++++++++ tools/tools/bus_autoconf/bus_usb.h | 73 ++++ 11 files changed, 1005 insertions(+), 416 deletions(-) create mode 100644 tools/tools/bus_autoconf/bus_autoconf_format_example.txt create mode 100644 tools/tools/bus_autoconf/bus_load_file.c create mode 100644 tools/tools/bus_autoconf/bus_load_file.h create mode 100644 tools/tools/bus_autoconf/bus_sections.c create mode 100644 tools/tools/bus_autoconf/bus_sections.h create mode 100644 tools/tools/bus_autoconf/bus_usb.c create mode 100644 tools/tools/bus_autoconf/bus_usb.h diff --git a/tools/tools/bus_autoconf/Makefile b/tools/tools/bus_autoconf/Makefile index c2f1b138594..c7104de478e 100644 --- a/tools/tools/bus_autoconf/Makefile +++ b/tools/tools/bus_autoconf/Makefile @@ -36,7 +36,10 @@ PROG= bus_autoconf MAN= BINDIR?= /usr/local/bin -SRCS= bus_autoconf.c +SRCS+= bus_autoconf.c +SRCS+= bus_load_file.c +SRCS+= bus_sections.c +SRCS+= bus_usb.c WARNS= 6 diff --git a/tools/tools/bus_autoconf/bus_autoconf.c b/tools/tools/bus_autoconf/bus_autoconf.c index 3ddab5a8ebf..adbf6e455e1 100644 --- a/tools/tools/bus_autoconf/bus_autoconf.c +++ b/tools/tools/bus_autoconf/bus_autoconf.c @@ -33,306 +33,23 @@ #include #include #include -#include -#include -#include -#include #include +#include +#include +#include #include "bus_autoconf.h" - -static char *type; -static char *file_name; -static const char *mode; - -struct usb_info; -static void usb_dump_sub(struct usb_device_id *, struct usb_info *); - -/* - * To ensure that the correct USB driver is loaded, the driver having - * the most information about the device must be probed first. Then - * more generic drivers shall be probed. - */ -static int -usb_compare(const void *_a, const void *_b) -{ - const struct usb_device_id *a = _a; - const struct usb_device_id *b = _b; - - /* vendor matches first */ - - if (a->match_flag_vendor > b->match_flag_vendor) - return (-1); - if (a->match_flag_vendor < b->match_flag_vendor) - return (1); - - /* product matches first */ - - if (a->match_flag_product > b->match_flag_product) - return (-1); - if (a->match_flag_product < b->match_flag_product) - return (1); - - /* device class matches first */ - - if (a->match_flag_dev_class > b->match_flag_dev_class) - return (-1); - if (a->match_flag_dev_class < b->match_flag_dev_class) - return (1); - - if (a->match_flag_dev_subclass > b->match_flag_dev_subclass) - return (-1); - if (a->match_flag_dev_subclass < b->match_flag_dev_subclass) - return (1); - - /* interface class matches first */ - - if (a->match_flag_int_class > b->match_flag_int_class) - return (-1); - if (a->match_flag_int_class < b->match_flag_int_class) - return (1); - - if (a->match_flag_int_subclass > b->match_flag_int_subclass) - return (-1); - if (a->match_flag_int_subclass < b->match_flag_int_subclass) - return (1); - - if (a->match_flag_int_protocol > b->match_flag_int_protocol) - return (-1); - if (a->match_flag_int_protocol < b->match_flag_int_protocol) - return (1); - - /* then sort according to value */ - - if (a->idVendor > b->idVendor) - return (1); - if (a->idVendor < b->idVendor) - return (-1); - if (a->idProduct > b->idProduct) - return (1); - if (a->idProduct < b->idProduct) - return (-1); - if (a->bDeviceClass > b->bDeviceClass) - return (1); - if (a->bDeviceClass < b->bDeviceClass) - return (-1); - if (a->bDeviceSubClass > b->bDeviceSubClass) - return (1); - if (a->bDeviceSubClass < b->bDeviceSubClass) - return (-1); - if (a->bDeviceProtocol > b->bDeviceProtocol) - return (1); - if (a->bDeviceProtocol < b->bDeviceProtocol) - return (-1); - if (a->bInterfaceClass > b->bInterfaceClass) - return (1); - if (a->bInterfaceClass < b->bInterfaceClass) - return (-1); - if (a->bInterfaceSubClass > b->bInterfaceSubClass) - return (1); - if (a->bInterfaceSubClass < b->bInterfaceSubClass) - return (-1); - if (a->bInterfaceProtocol > b->bInterfaceProtocol) - return (1); - if (a->bInterfaceProtocol < b->bInterfaceProtocol) - return (-1); - - /* in the end sort by module name */ - - return (strcmp(a->module_name, b->module_name)); -} - -static void -usb_sort(struct usb_device_id *id, uint32_t nid) -{ - qsort(id, nid, sizeof(*id), &usb_compare); -} - -struct usb_info { - uint8_t is_iface; - uint8_t is_any; - uint8_t is_vp; - uint8_t is_dev; -}; - -static void -usb_dump_sub(struct usb_device_id *id, struct usb_info *pinfo) -{ -#if USB_HAVE_COMPAT_LINUX - if (id->match_flags != 0) { - if (id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) - id->match_flag_vendor = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) - id->match_flag_product = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) - id->match_flag_dev_lo = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) - id->match_flag_dev_hi = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) - id->match_flag_dev_class = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) - id->match_flag_dev_subclass = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) - id->match_flag_dev_protocol = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) - id->match_flag_int_class = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) - id->match_flag_int_subclass = 1; - if (id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) - id->match_flag_int_protocol = 1; - id->match_flags = 0; - } -#endif - if (pinfo != NULL) { - - pinfo->is_iface = id->match_flag_int_class | - id->match_flag_int_protocol | - id->match_flag_int_subclass; - - pinfo->is_dev = id->match_flag_dev_class | - id->match_flag_dev_subclass; - - pinfo->is_vp = id->match_flag_vendor | - id->match_flag_product; - - pinfo->is_any = pinfo->is_vp + pinfo->is_dev + pinfo->is_iface; - } -} - -static char * -usb_trim(char *ptr) -{ - char *end; - - end = strchr(ptr, ' '); - if (end) - *end = 0; - return (ptr); -} - -static uint32_t -usb_dump(struct usb_device_id *id, uint32_t nid) -{ - uint32_t n = 1; - struct usb_info info; - - usb_dump_sub(id, &info); - - if (info.is_any) { - printf("nomatch 32 {\n" - " match \"bus\" \"uhub[0-9]+\";\n" - " match \"mode\" \"%s\";\n", mode); - } else { - return (n); - } - - if (id->match_flag_vendor) { - printf(" match \"vendor\" \"0x%04x\";\n", - id->idVendor); - } - if (id->match_flag_product) { - uint32_t x; - - if (info.is_any == 1 && info.is_vp == 1) { - /* try to join similar entries */ - while (n < nid) { - usb_dump_sub(id + n, &info); - - if (info.is_any != 1 || info.is_vp != 1) - break; - if (id[n].idVendor != id[0].idVendor) - break; - n++; - } - /* restore infos */ - usb_dump_sub(id, &info); - } - if (n == 1) { - printf(" match \"product\" \"0x%04x\";\n", - id->idProduct); - } else { - printf(" match \"product\" \"("); - - for (x = 0; x != n; x++) { - printf("0x%04x%s", id[x].idProduct, - (x == (n - 1)) ? "" : "|"); - } - - printf(")\";\n"); - } - } - if (id->match_flag_dev_class) { - printf(" match \"devclass\" \"0x%02x\";\n", - id->bDeviceClass); - } - if (id->match_flag_dev_subclass) { - printf(" match \"devsubclass\" \"0x%02x\";\n", - id->bDeviceSubClass); - } - if (id->match_flag_int_class) { - printf(" match \"intclass\" \"0x%02x\";\n", - id->bInterfaceClass); - } - if (id->match_flag_int_subclass) { - printf(" match \"intsubclass\" \"0x%02x\";\n", - id->bInterfaceSubClass); - } - if (id->match_flag_int_protocol) { - printf(" match \"intprotocol\" \"0x%02x\";\n", - id->bInterfaceProtocol); - } - printf(" action \"kldload %s\";\n" - "};\n\n", usb_trim(id->module_name)); - - return (n); -} - -static void -usb_parse_and_dump(int f, off_t size) -{ - struct usb_device_id *id; - uint32_t nid; - uint32_t x; - - if (size % sizeof(struct usb_device_id)) { - errx(EX_NOINPUT, "Size is not divisible by %d", - (int)sizeof(struct usb_device_id)); - } - lseek(f, 0, SEEK_SET); - - id = malloc(size); - if (id == NULL) { - errx(EX_SOFTWARE, "Out of memory"); - } - if (read(f, id, size) != size) { - err(EX_NOINPUT, "Cannot read all data"); - } - nid = size / sizeof(*id); - - for (x = 0; x != nid; x++) { - /* make sure flag bits are correct */ - usb_dump_sub(id + x, NULL); - /* zero terminate string */ - id[x].module_name[sizeof(id[0].module_name) - 1] = 0; - } - - usb_sort(id, nid); - - for (x = 0; x != nid;) - x += usb_dump(id + x, nid - x); - - free(id); - - printf("# %d %s entries processed\n\n", (int)nid, type); -} +#include "bus_sections.h" +#include "bus_load_file.h" +#include "bus_usb.h" static void usage(void) { fprintf(stderr, "bus_autoconf - devd config file generator\n" - " -i \n" - " -t \n" + " -i \n" + " -F \n" " -h show usage\n" ); exit(EX_USAGE); @@ -341,50 +58,68 @@ usage(void) int main(int argc, char **argv) { - const char *params = "i:ht:"; + const char *params = "i:F:h"; + char *fname; + char *section; + char *module; + char *postfix; + uint8_t *ptr; + uint32_t len; int c; - int f; - off_t off; + int any_opt = 0; while ((c = getopt(argc, argv, params)) != -1) { switch (c) { case 'i': - file_name = optarg; + fname = optarg; + load_file(fname, &ptr, &len); + + module = strchr(fname, ','); + if (module == NULL) { + errx(EX_USAGE, "Invalid input " + "file name '%s'", fname); + } + /* split module and section */ + *module++ = 0; + + /* remove postfix */ + postfix = strchr(module, '.'); + if (postfix) + *postfix = 0; + + /* get section name */ + section = fname; + + /* check section type */ + if (strncmp(section, "usb_", 4) == 0) + usb_import_entries(section, module, ptr, len); + else + errx(EX_USAGE, "Invalid section '%s'", section); + + free(ptr); + + any_opt = 1; break; - case 't': - type = optarg; + + case 'F': + fname = optarg; + load_file(fname, &ptr, &len); + format_parse_entries(ptr, len); + free(ptr); + + any_opt = 1; break; + default: usage(); break; } } - if (type == NULL || file_name == NULL) + if (any_opt == 0) usage(); - f = open(file_name, O_RDONLY); - if (f < 0) - err(EX_NOINPUT, "Cannot open file '%s'", file_name); - - off = lseek(f, 0, SEEK_END); - if (off <= 0) - err(EX_NOINPUT, "Cannot seek to end of file"); - - if (strcmp(type, "usb_host") == 0) { - mode = "host"; - usb_parse_and_dump(f, off); - } else if (strcmp(type, "usb_device") == 0) { - mode = "device"; - usb_parse_and_dump(f, off); - } else if (strcmp(type, "usb_dual") == 0) { - mode = "(host|device)"; - usb_parse_and_dump(f, off); - } else { - err(EX_USAGE, "Unsupported structure type: %s", type); - } - - close(f); + usb_dump_entries(); return (0); } diff --git a/tools/tools/bus_autoconf/bus_autoconf.h b/tools/tools/bus_autoconf/bus_autoconf.h index 7dbc4865d2d..0a1ca3fb316 100644 --- a/tools/tools/bus_autoconf/bus_autoconf.h +++ b/tools/tools/bus_autoconf/bus_autoconf.h @@ -28,59 +28,4 @@ #ifndef _BUS_AUTOCONF_H_ #define _BUS_AUTOCONF_H_ -/* Make sure we get the have compat linux definition. */ -#include - -struct usb_device_id { - - /* Internal field */ - char module_name[32]; - - /* Hook for driver specific information */ - unsigned long driver_info; - - /* Used for product specific matches; the BCD range is inclusive */ - uint16_t idVendor; - uint16_t idProduct; - uint16_t bcdDevice_lo; - uint16_t bcdDevice_hi; - - /* Used for device class matches */ - uint8_t bDeviceClass; - uint8_t bDeviceSubClass; - uint8_t bDeviceProtocol; - - /* Used for interface class matches */ - uint8_t bInterfaceClass; - uint8_t bInterfaceSubClass; - uint8_t bInterfaceProtocol; - - /* Select which fields to match against */ - uint8_t match_flag_vendor:1; - uint8_t match_flag_product:1; - uint8_t match_flag_dev_lo:1; - uint8_t match_flag_dev_hi:1; - uint8_t match_flag_dev_class:1; - uint8_t match_flag_dev_subclass:1; - uint8_t match_flag_dev_protocol:1; - uint8_t match_flag_int_class:1; - uint8_t match_flag_int_subclass:1; - uint8_t match_flag_int_protocol:1; - -#if USB_HAVE_COMPAT_LINUX - /* which fields to match against */ - uint16_t match_flags; -#define USB_DEVICE_ID_MATCH_VENDOR 0x0001 -#define USB_DEVICE_ID_MATCH_PRODUCT 0x0002 -#define USB_DEVICE_ID_MATCH_DEV_LO 0x0004 -#define USB_DEVICE_ID_MATCH_DEV_HI 0x0008 -#define USB_DEVICE_ID_MATCH_DEV_CLASS 0x0010 -#define USB_DEVICE_ID_MATCH_DEV_SUBCLASS 0x0020 -#define USB_DEVICE_ID_MATCH_DEV_PROTOCOL 0x0040 -#define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080 -#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 -#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 -#endif -}; - #endif /* _BUS_AUTOCONF_H_ */ diff --git a/tools/tools/bus_autoconf/bus_autoconf.sh b/tools/tools/bus_autoconf/bus_autoconf.sh index 21a4df063dd..1d1d038c4fd 100644 --- a/tools/tools/bus_autoconf/bus_autoconf.sh +++ b/tools/tools/bus_autoconf/bus_autoconf.sh @@ -29,30 +29,6 @@ OS=FreeBSD DOLLAR=$ -cleanup() -{ - # Cleanup - rm -f usb_dual.ids - rm -f usb_host.ids - rm -f usb_device.ids -} - -usb_format() -{ - [ -f ${1} ] || return - - # Split into one and one record - split -b 32 ${1} ${1}. - - # Prefix each record by the module name - for G in $(ls ${1}.*) - do - printf "%-32s" ${3} >> ${2} - cat ${G} >> ${2} - rm -f ${G} - done -} - cat < /dev/null -usb_format temp.ids usb_host.ids ${H} +# Format information +objcopy -j bus_autoconf_format -O binary ${F} temp.ids 2> /dev/null +[ -f temp.ids ] && cat temp.ids >> bus_autoconf_format.bin -# USB Device -objcopy -j usb_device_id -O binary ${F} temp.ids 2> /dev/null -usb_format temp.ids usb_device.ids ${H} +# USB Host mode +objcopy -j usb_host_id -O binary ${F} "usb_host_id,${G}" 2> /dev/null +[ -f "usb_host_id,${G}" ] && (echo -n " -i usb_host_id,${G}" >> bus_autoconf_args.txt) + +# USB Device mode +objcopy -j usb_device_id -O binary ${F} "usb_device_id,${G}" 2> /dev/null +[ -f "usb_device_id,${G}" ] && (echo -n " -i usb_device_id,${G}" >> bus_autoconf_args.txt) # USB Dual mode -objcopy -j usb_dual_id -O binary ${F} temp.ids 2> /dev/null -usb_format temp.ids usb_dual.ids ${H} +objcopy -j usb_dual_id -O binary ${F} "usb_dual_id,${G}" 2> /dev/null +[ -f "usb_dual_id,${G}" ] && (echo -n " -i usb_dual_id,${G}" >> bus_autoconf_args.txt) done # Dump all data -[ -f usb_dual.ids ] && bus_autoconf -i usb_dual.ids -t usb_dual -[ -f usb_host.ids ] && bus_autoconf -i usb_host.ids -t usb_host -[ -f usb_device.ids ] && bus_autoconf -i usb_device.ids -t usb_device +bus_autoconf -F bus_autoconf_format.bin $(cat bus_autoconf_args.txt) # Cleanup -cleanup +rm -f -- bus_autoconf_format.bin $(cat bus_autoconf_args.txt) diff --git a/tools/tools/bus_autoconf/bus_autoconf_format_example.txt b/tools/tools/bus_autoconf/bus_autoconf_format_example.txt new file mode 100644 index 00000000000..e118f1faebc --- /dev/null +++ b/tools/tools/bus_autoconf/bus_autoconf_format_example.txt @@ -0,0 +1,111 @@ +/* $FreeBSD$ */ + +#if BYTE_ORDER == BIG_ENDIAN +#define U16_XOR "8" +#define U32_XOR "12" +#define U64_XOR "56" +#define U8_BITFIELD_XOR "7" +#define U16_BITFIELD_XOR "15" +#define U32_BITFIELD_XOR "31" +#define U64_BITFIELD_XOR "63" +#else +#define U16_XOR "0" +#define U32_XOR "0" +#define U64_XOR "0" +#define U8_BITFIELD_XOR "0" +#define U16_BITFIELD_XOR "0" +#define U32_BITFIELD_XOR "0" +#define U64_BITFIELD_XOR "0" +#endif + +#if USB_HAVE_COMPAT_LINUX +#define MFL_SIZE "1" +#else +#define MFL_SIZE "0" +#endif + +static const char __section("bus_autoconf_format") __used usb_id_format[] = { + + /* + * Declare three different sections that use the same format. + * All sizes are in bits. Fields cannot be greater than + * 8 bits in size. Bitfields having a size greater than 1 + * must fit within the byte in which the bitfield is defined. + */ + + "usb_host_id{256,:}" + "usb_device_id{256,:}" + "usb_dual_id{256,:}" + + /* + * Describe all fields in the usb_device_id structure + * which is found in sys/dev/usb/usbdi.h. + */ + +#if BITS_PER_LONG == 32 || BITS_PER_LONG == 64 + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" +#if BITS_PER_LONG == 64 + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" +#endif +#else +#error "Please update code." +#endif + + "idVendor[0]{" U16_XOR ",8}" + "idVendor[1]{" U16_XOR ",8}" + "idProduct[0]{" U16_XOR ",8}" + "idProduct[1]{" U16_XOR ",8}" + "bcdDevice_lo[0]{" U16_XOR ",8}" + "bcdDevice_lo[1]{" U16_XOR ",8}" + "bcdDevice_hi[0]{" U16_XOR ",8}" + "bcdDevice_hi[1]{" U16_XOR ",8}" + + "bDeviceClass{0,8}" + "bDeviceSubClass{0,8}" + "bDeviceProtocol{0,8}" + "bInterfaceClass{0,8}" + "bInterfaceSubClass{0,8}" + "bInterfaceProtocol{0,8}" + +/* NOTE: On big endian machines bitfields are bitreversed. */ + + "mf_vendor{" U8_BITFIELD_XOR ",1}" + "mf_product{" U8_BITFIELD_XOR ",1}" + "mf_dev_lo{" U8_BITFIELD_XOR ",1}" + "mf_dev_hi{" U8_BITFIELD_XOR ",1}" + + "mf_dev_class{" U8_BITFIELD_XOR ",1}" + "mf_dev_subclass{" U8_BITFIELD_XOR ",1}" + "mf_dev_protocol{" U8_BITFIELD_XOR ",1}" + "mf_int_class{" U8_BITFIELD_XOR ",1}" + + "mf_int_subclass{" U8_BITFIELD_XOR ",1}" + "mf_int_protocol{" U8_BITFIELD_XOR ",1}" + "unused{" U8_BITFIELD_XOR ",6}" + + "mfl_vendor{" U16_XOR "," MFL_SIZE "}" + "mfl_product{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_lo{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_hi{" U16_XOR "," MFL_SIZE "}" + + "mfl_dev_class{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_subclass{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_protocol{" U16_XOR "," MFL_SIZE "}" + "mfl_int_class{" U16_XOR "," MFL_SIZE "}" + + "mfl_int_subclass{" U16_XOR "," MFL_SIZE "}" + "mfl_int_protocol{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" +}; diff --git a/tools/tools/bus_autoconf/bus_load_file.c b/tools/tools/bus_autoconf/bus_load_file.c new file mode 100644 index 00000000000..88f806a15b4 --- /dev/null +++ b/tools/tools/bus_autoconf/bus_load_file.c @@ -0,0 +1,72 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "bus_load_file.h" + +void +load_file(const char *fname, uint8_t **pptr, uint32_t *plen) +{ + uint8_t *ptr; + uint32_t len; + off_t off; + int f; + + f = open(fname, O_RDONLY); + if (f < 0) + err(EX_NOINPUT, "Cannot open file '%s'", fname); + + off = lseek(f, 0, SEEK_END); + if (off <= 0) + err(EX_NOINPUT, "Cannot seek to end of file"); + + if (lseek(f, 0, SEEK_SET) < 0) + err(EX_NOINPUT, "Cannot seek to beginning of file"); + + len = off; + if (len != off) + err(EX_NOINPUT, "File '%s' is too big", fname); + + ptr = malloc(len); + if (ptr == NULL) + errx(EX_SOFTWARE, "Out of memory"); + + if (read(f, ptr, len) != len) + err(EX_NOINPUT, "Cannot read all data"); + + close(f); + + *pptr = ptr; + *plen = len; +} diff --git a/tools/tools/bus_autoconf/bus_load_file.h b/tools/tools/bus_autoconf/bus_load_file.h new file mode 100644 index 00000000000..57e7739c615 --- /dev/null +++ b/tools/tools/bus_autoconf/bus_load_file.h @@ -0,0 +1,33 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _BUS_LOAD_FILE_H_ +#define _BUS_LOAD_FILE_H_ + +void load_file(const char *, uint8_t **, uint32_t *); + +#endif /* _BUS_LOAD_FILE_H_ */ diff --git a/tools/tools/bus_autoconf/bus_sections.c b/tools/tools/bus_autoconf/bus_sections.c new file mode 100644 index 00000000000..c3260487d1c --- /dev/null +++ b/tools/tools/bus_autoconf/bus_sections.c @@ -0,0 +1,223 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "bus_sections.h" + +#define MAX_STRING 64 + +struct format_info; +typedef TAILQ_HEAD(,format_info) format_info_head_t; +typedef TAILQ_ENTRY(format_info) format_info_entry_t; + +static format_info_head_t format_head = TAILQ_HEAD_INITIALIZER(format_head); + +struct format_info { + format_info_entry_t entry; + format_info_head_t fields; + char name[MAX_STRING]; + uint16_t bit_offset; + uint16_t bit_size; +}; + +static struct format_info * +format_info_new(char *pstr, uint16_t bo, uint16_t bs) +{ + struct format_info *pfi; + + pfi = malloc(sizeof(*pfi)); + if (pfi == NULL) + errx(EX_SOFTWARE, "Out of memory."); + + memset(pfi, 0, sizeof(*pfi)); + + TAILQ_INIT(&pfi->fields); + + strlcpy(pfi->name, pstr, sizeof(pfi->name)); + pfi->bit_offset = bo; + pfi->bit_size = bs; + return (pfi); +} + +static const struct format_info * +format_get_section(const char *section) +{ + const struct format_info *psub; + static const struct format_info *psub_last; + static const char *psub_cache; + + if (psub_cache && strcmp(psub_cache, section) == 0) + return (psub_last); + + TAILQ_FOREACH(psub, &format_head, entry) { + if (strcmp(section, psub->name) == 0) { + psub_cache = section; + psub_last = psub; + return (psub); + } + } + warnx("Section '%s' not found", section); + psub_cache = section; + psub_last = psub; + return (NULL); +} + +uint16_t +format_get_section_size(const char *section) +{ + const struct format_info *pfi; + + pfi = format_get_section(section); + if (pfi == NULL) + return (0); + + return ((pfi->bit_offset + 7) / 8); +} + + +uint8_t +format_get_field(const char *section, const char *field, + const uint8_t *ptr, uint16_t size) +{ + const struct format_info *pfi; + const struct format_info *psub; + uint16_t rem; + uint16_t off; + uint16_t sz; + + pfi = format_get_section(section); + if (pfi == NULL) + return (0); + + /* skip until we find the fields */ + while (pfi && TAILQ_FIRST(&pfi->fields) == NULL) + pfi = TAILQ_NEXT(pfi, entry); + + if (pfi == NULL) + return (0); + + TAILQ_FOREACH(psub, &pfi->fields, entry) { + if (strcmp(field, psub->name) == 0) { + + /* range check */ + if (((psub->bit_offset + psub->bit_size) / 8) > size) + return (0); + + /* compute byte offset */ + rem = psub->bit_offset & 7; + off = psub->bit_offset / 8; + sz = psub->bit_size; + + /* extract bit-field */ + return ((ptr[off] >> rem) & ((1 << sz) - 1)); + } + } + warnx("Field '%s' not found in '%s'", field, pfi->name); + return (0); +} + +void +format_parse_entries(const uint8_t *ptr, uint32_t len) +{ + static const char *command_list = "012345678:"; + const char *cmd; + struct format_info *pfi; + struct format_info *pfi_last = NULL; + char linebuf[3][MAX_STRING]; + uint32_t off = 0; + uint16_t bit_offset = 0; + uint8_t state = 0; + uint8_t cmd_index; + int c; + + /* + * The format we are parsing: + * {string,string}{...} + */ + while (len--) { + c = *(ptr++); + + /* skip some characters */ + if (c == 0 || c == '\n' || c == '\r' || c == ' ' || c == '\t') + continue; + + /* accumulate non-field delimiters */ + if (strchr("{,}", c) == NULL) { + if (off < (MAX_STRING - 1)) { + linebuf[state][off] = c; + off++; + } + continue; + } + /* parse keyword */ + linebuf[state][off] = 0; + off = 0; + state++; + if (state == 3) { + /* check for command in command list */ + cmd = strchr(command_list, linebuf[2][0]); + if (cmd != NULL) + cmd_index = cmd - command_list; + else + cmd_index = 255; + + /* + * Check for new field, format is: + * + * {bit_offset_xor, bit_size} + */ + if (cmd_index < 9 && pfi_last != NULL) { + pfi = format_info_new(linebuf[0], bit_offset ^ + atoi(linebuf[1]), cmd_index); + TAILQ_INSERT_TAIL(&pfi_last->fields, pfi, entry); + bit_offset += cmd_index; + } + /* + * Check for new section, format is: + * + * {section_bit_size, :} + */ + if (cmd_index == 9) { + pfi_last = format_info_new(linebuf[0], + atoi(linebuf[1]), cmd_index); + TAILQ_INSERT_TAIL(&format_head, pfi_last, entry); + bit_offset = 0; + } + state = 0; + continue; + } + } +} diff --git a/tools/tools/bus_autoconf/bus_sections.h b/tools/tools/bus_autoconf/bus_sections.h new file mode 100644 index 00000000000..2c4c6fc86f2 --- /dev/null +++ b/tools/tools/bus_autoconf/bus_sections.h @@ -0,0 +1,35 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _BUS_SECTIONS_H_ +#define _BUS_SECTIONS_H_ + +uint16_t format_get_section_size(const char *); +uint8_t format_get_field(const char *, const char *, const uint8_t *, uint16_t); +void format_parse_entries(const uint8_t *, uint32_t); + +#endif /* _BUS_SECTIONS_H_ */ diff --git a/tools/tools/bus_autoconf/bus_usb.c b/tools/tools/bus_autoconf/bus_usb.c new file mode 100644 index 00000000000..e3d60e84894 --- /dev/null +++ b/tools/tools/bus_autoconf/bus_usb.c @@ -0,0 +1,382 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bus_autoconf.h" +#include "bus_sections.h" +#include "bus_usb.h" + +struct usb_blob; +typedef TAILQ_HEAD(,usb_blob) usb_blob_head_t; +typedef TAILQ_ENTRY(usb_blob) usb_blob_entry_t; + +static usb_blob_head_t usb_blob_head = TAILQ_HEAD_INITIALIZER(usb_blob_head); +static uint32_t usb_blob_count; + +struct usb_blob { + usb_blob_entry_t entry; + struct usb_device_id temp; +}; + +/* + * To ensure that the correct USB driver is loaded, the driver having + * the most information about the device must be probed first. Then + * more generic drivers shall be probed. + */ +static int +usb_compare(const void *_a, const void *_b) +{ + const struct usb_device_id *a = _a; + const struct usb_device_id *b = _b; + int retval; + + /* vendor matches first */ + + if (a->match_flag_vendor > b->match_flag_vendor) + return (-1); + if (a->match_flag_vendor < b->match_flag_vendor) + return (1); + + /* product matches first */ + + if (a->match_flag_product > b->match_flag_product) + return (-1); + if (a->match_flag_product < b->match_flag_product) + return (1); + + /* device class matches first */ + + if (a->match_flag_dev_class > b->match_flag_dev_class) + return (-1); + if (a->match_flag_dev_class < b->match_flag_dev_class) + return (1); + + if (a->match_flag_dev_subclass > b->match_flag_dev_subclass) + return (-1); + if (a->match_flag_dev_subclass < b->match_flag_dev_subclass) + return (1); + + /* interface class matches first */ + + if (a->match_flag_int_class > b->match_flag_int_class) + return (-1); + if (a->match_flag_int_class < b->match_flag_int_class) + return (1); + + if (a->match_flag_int_subclass > b->match_flag_int_subclass) + return (-1); + if (a->match_flag_int_subclass < b->match_flag_int_subclass) + return (1); + + if (a->match_flag_int_protocol > b->match_flag_int_protocol) + return (-1); + if (a->match_flag_int_protocol < b->match_flag_int_protocol) + return (1); + + /* then sort according to value */ + + if (a->idVendor > b->idVendor) + return (1); + if (a->idVendor < b->idVendor) + return (-1); + if (a->idProduct > b->idProduct) + return (1); + if (a->idProduct < b->idProduct) + return (-1); + if (a->bDeviceClass > b->bDeviceClass) + return (1); + if (a->bDeviceClass < b->bDeviceClass) + return (-1); + if (a->bDeviceSubClass > b->bDeviceSubClass) + return (1); + if (a->bDeviceSubClass < b->bDeviceSubClass) + return (-1); + if (a->bDeviceProtocol > b->bDeviceProtocol) + return (1); + if (a->bDeviceProtocol < b->bDeviceProtocol) + return (-1); + if (a->bInterfaceClass > b->bInterfaceClass) + return (1); + if (a->bInterfaceClass < b->bInterfaceClass) + return (-1); + if (a->bInterfaceSubClass > b->bInterfaceSubClass) + return (1); + if (a->bInterfaceSubClass < b->bInterfaceSubClass) + return (-1); + if (a->bInterfaceProtocol > b->bInterfaceProtocol) + return (1); + if (a->bInterfaceProtocol < b->bInterfaceProtocol) + return (-1); + + /* in the end sort by module name and mode */ + + retval = strcmp(a->module_name, b->module_name); + if (retval == 0) + retval = strcmp(a->module_mode, b->module_mode); + return (retval); +} + +static void +usb_sort_entries(struct usb_device_id *id, uint32_t nid) +{ + qsort(id, nid, sizeof(*id), &usb_compare); +} + +static void +usb_import_entry(struct usb_device_id *id, const char *type, + const char *module, const uint8_t *ptr, uint16_t size) +{ + const char *mode; + + if (strstr(type, "_host_")) + mode = "host"; + else if (strstr(type, "_device_")) + mode = "device"; + else + mode = "(host|device)"; + + strlcpy(id->module_name, module, sizeof(id->module_name)); + strlcpy(id->module_mode, mode, sizeof(id->module_mode)); + + /* import data from binary object */ + + if (format_get_field(type, "mfl_vendor", ptr, size)) + id->match_flag_vendor = 1; + if (format_get_field(type, "mfl_product", ptr, size)) + id->match_flag_product = 1; + if (format_get_field(type, "mfl_dev_lo", ptr, size)) + id->match_flag_dev_lo = 1; + if (format_get_field(type, "mfl_dev_hi", ptr, size)) + id->match_flag_dev_hi = 1; + if (format_get_field(type, "mfl_dev_class", ptr, size)) + id->match_flag_dev_class = 1; + if (format_get_field(type, "mfl_dev_subclass", ptr, size)) + id->match_flag_dev_subclass = 1; + if (format_get_field(type, "mfl_dev_protocol", ptr, size)) + id->match_flag_dev_protocol = 1; + if (format_get_field(type, "mfl_int_class", ptr, size)) + id->match_flag_int_class = 1; + if (format_get_field(type, "mfl_int_subclass", ptr, size)) + id->match_flag_int_subclass = 1; + if (format_get_field(type, "mfl_int_protocol", ptr, size)) + id->match_flag_int_protocol = 1; + + id->idVendor = format_get_field(type, "idVendor[0]", ptr, size) | + (format_get_field(type, "idVendor[1]", ptr, size) << 8); + id->idProduct = format_get_field(type, "idProduct[0]", ptr, size) | + (format_get_field(type, "idProduct[1]", ptr, size) << 8); + + id->bcdDevice_lo = format_get_field(type, "bcdDevice_lo[0]", ptr, size) | + (format_get_field(type, "bcdDevice_lo[1]", ptr, size) << 8); + + id->bcdDevice_hi = format_get_field(type, "bcdDevice_hi[0]", ptr, size) | + (format_get_field(type, "bcdDevice_hi[1]", ptr, size) << 8); + + id->bDeviceClass = format_get_field(type, "bDeviceClass", ptr, size); + id->bDeviceSubClass = format_get_field(type, "bDeviceSubClass", ptr, size); + id->bDeviceProtocol = format_get_field(type, "bDeviceProtocol", ptr, size); + + id->bInterfaceClass = format_get_field(type, "bInterfaceClass", ptr, size); + id->bInterfaceSubClass = format_get_field(type, "bInterfaceSubClass", ptr, size); + id->bInterfaceProtocol = format_get_field(type, "bInterfaceProtocol", ptr, size); + + if (format_get_field(type, "mf_vendor", ptr, size)) + id->match_flag_vendor = 1; + if (format_get_field(type, "mf_product", ptr, size)) + id->match_flag_product = 1; + if (format_get_field(type, "mf_dev_lo", ptr, size)) + id->match_flag_dev_lo = 1; + if (format_get_field(type, "mf_dev_hi", ptr, size)) + id->match_flag_dev_hi = 1; + if (format_get_field(type, "mf_dev_class", ptr, size)) + id->match_flag_dev_class = 1; + if (format_get_field(type, "mf_dev_subclass", ptr, size)) + id->match_flag_dev_subclass = 1; + if (format_get_field(type, "mf_dev_protocol", ptr, size)) + id->match_flag_dev_protocol = 1; + if (format_get_field(type, "mf_int_class", ptr, size)) + id->match_flag_int_class = 1; + if (format_get_field(type, "mf_int_subclass", ptr, size)) + id->match_flag_int_subclass = 1; + if (format_get_field(type, "mf_int_protocol", ptr, size)) + id->match_flag_int_protocol = 1; + + /* compute some internal fields */ + id->is_iface = id->match_flag_int_class | + id->match_flag_int_protocol | + id->match_flag_int_subclass; + + id->is_dev = id->match_flag_dev_class | + id->match_flag_dev_subclass; + + id->is_vp = id->match_flag_vendor | + id->match_flag_product; + + id->is_any = id->is_vp + id->is_dev + id->is_iface; +} + +static uint32_t +usb_dump(struct usb_device_id *id, uint32_t nid) +{ + uint32_t n = 1; + + if (id->is_any) { + printf("nomatch 32 {\n" + " match \"bus\" \"uhub[0-9]+\";\n" + " match \"mode\" \"%s\";\n", id->module_mode); + } else { + printf("# skipped entry on module %s\n", + id->module_name); + return (n); + } + + if (id->match_flag_vendor) { + printf(" match \"vendor\" \"0x%04x\";\n", + id->idVendor); + } + if (id->match_flag_product) { + uint32_t x; + + if (id->is_any == 1 && id->is_vp == 1) { + /* try to join similar entries */ + while (n < nid) { + if (id[n].is_any != 1 || id[n].is_vp != 1) + break; + if (id[n].idVendor != id[0].idVendor) + break; + n++; + } + } + if (n == 1) { + printf(" match \"product\" \"0x%04x\";\n", + id->idProduct); + } else { + printf(" match \"product\" \"("); + + for (x = 0; x != n; x++) { + printf("0x%04x%s", id[x].idProduct, + (x == (n - 1)) ? "" : "|"); + } + + printf(")\";\n"); + } + } + if (id->match_flag_dev_class) { + printf(" match \"devclass\" \"0x%02x\";\n", + id->bDeviceClass); + } + if (id->match_flag_dev_subclass) { + printf(" match \"devsubclass\" \"0x%02x\";\n", + id->bDeviceSubClass); + } + if (id->match_flag_int_class) { + printf(" match \"intclass\" \"0x%02x\";\n", + id->bInterfaceClass); + } + if (id->match_flag_int_subclass) { + printf(" match \"intsubclass\" \"0x%02x\";\n", + id->bInterfaceSubClass); + } + if (id->match_flag_int_protocol) { + printf(" match \"intprotocol\" \"0x%02x\";\n", + id->bInterfaceProtocol); + } + printf(" action \"kldload %s\";\n" + "};\n\n", id->module_name); + + return (n); +} + +void +usb_import_entries(const char *section, const char *module, + const uint8_t *ptr, uint32_t len) +{ + struct usb_blob *pub; + uint32_t section_size; + uint32_t off; + + section_size = format_get_section_size(section); + if (section_size == 0) { + errx(EX_DATAERR, "Invalid or non-existing " + "section format '%s'", section); + } + if (len % section_size) { + errx(EX_DATAERR, "Length %d is not " + "divisible by %d. Section format '%s'", + len, section_size, section); + } + for (off = 0; off != len; off += section_size) { + pub = malloc(sizeof(*pub)); + if (pub == NULL) + errx(EX_SOFTWARE, "Out of memory"); + + memset(pub, 0, sizeof(*pub)); + + usb_import_entry(&pub->temp, section, + module, ptr + off, section_size); + + TAILQ_INSERT_TAIL(&usb_blob_head, pub, entry); + + usb_blob_count++; + if (usb_blob_count == 0) + errx(EX_SOFTWARE, "Too many entries"); + } +} + +void +usb_dump_entries(void) +{ + struct usb_blob *pub; + struct usb_device_id *id; + uint32_t x; + + id = malloc(usb_blob_count * sizeof(*id)); + if (id == NULL) + errx(EX_SOFTWARE, "Out of memory"); + + /* make linear array of all USB blobs */ + x = 0; + TAILQ_FOREACH(pub, &usb_blob_head, entry) + id[x++] = pub->temp; + + usb_sort_entries(id, usb_blob_count); + + for (x = 0; x != usb_blob_count;) + x += usb_dump(id + x, usb_blob_count - x); + + free(id); + + printf("# %d USB entries processed\n\n", usb_blob_count); +} diff --git a/tools/tools/bus_autoconf/bus_usb.h b/tools/tools/bus_autoconf/bus_usb.h new file mode 100644 index 00000000000..378df9a64c3 --- /dev/null +++ b/tools/tools/bus_autoconf/bus_usb.h @@ -0,0 +1,73 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _BUS_USB_H_ +#define _BUS_USB_H_ + +struct usb_device_id { + + /* Internal fields */ + char module_name[32]; + char module_mode[32]; + uint8_t is_iface; + uint8_t is_vp; + uint8_t is_dev; + uint8_t is_any; + + /* Used for product specific matches; the BCD range is inclusive */ + uint16_t idVendor; + uint16_t idProduct; + uint16_t bcdDevice_lo; + uint16_t bcdDevice_hi; + + /* Used for device class matches */ + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + + /* Used for interface class matches */ + uint8_t bInterfaceClass; + uint8_t bInterfaceSubClass; + uint8_t bInterfaceProtocol; + + /* Select which fields to match against */ + uint8_t match_flag_vendor:1; + uint8_t match_flag_product:1; + uint8_t match_flag_dev_lo:1; + uint8_t match_flag_dev_hi:1; + uint8_t match_flag_dev_class:1; + uint8_t match_flag_dev_subclass:1; + uint8_t match_flag_dev_protocol:1; + uint8_t match_flag_int_class:1; + uint8_t match_flag_int_subclass:1; + uint8_t match_flag_int_protocol:1; +}; + +void usb_import_entries(const char *, const char *, const uint8_t *, uint32_t); +void usb_dump_entries(void); + +#endif /* _BUS_USB_H_ */ From c9a6ce0cd8c5aae359136f6749f216131c304006 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 25 Jun 2011 15:22:44 +0000 Subject: [PATCH 24/49] - Need to respect the module name and the USB mode when accumulating device ID's. - Be more verbose on file seek failures. Allow a file size of zero. - Improve the wrapper shell. MFC after: 14 days --- tools/tools/bus_autoconf/bus_autoconf.sh | 18 ++++++++++++------ tools/tools/bus_autoconf/bus_load_file.c | 12 ++++++++---- tools/tools/bus_autoconf/bus_usb.c | 4 ++++ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/tools/tools/bus_autoconf/bus_autoconf.sh b/tools/tools/bus_autoconf/bus_autoconf.sh index 1d1d038c4fd..c99df91e18f 100644 --- a/tools/tools/bus_autoconf/bus_autoconf.sh +++ b/tools/tools/bus_autoconf/bus_autoconf.sh @@ -28,6 +28,7 @@ OS=FreeBSD DOLLAR=$ +OBJCOPY=objcopy cat < /dev/null -[ -f temp.ids ] && cat temp.ids >> bus_autoconf_format.bin +${OBJCOPY} -j bus_autoconf_format -O binary ${F} bus_autoconf.ids 2> /dev/null +[ -f bus_autoconf.ids ] && cat bus_autoconf.ids >> bus_autoconf_format.bin # USB Host mode -objcopy -j usb_host_id -O binary ${F} "usb_host_id,${G}" 2> /dev/null +${OBJCOPY} -j usb_host_id -O binary ${F} "usb_host_id,${G}" 2> /dev/null [ -f "usb_host_id,${G}" ] && (echo -n " -i usb_host_id,${G}" >> bus_autoconf_args.txt) # USB Device mode -objcopy -j usb_device_id -O binary ${F} "usb_device_id,${G}" 2> /dev/null +${OBJCOPY} -j usb_device_id -O binary ${F} "usb_device_id,${G}" 2> /dev/null [ -f "usb_device_id,${G}" ] && (echo -n " -i usb_device_id,${G}" >> bus_autoconf_args.txt) # USB Dual mode -objcopy -j usb_dual_id -O binary ${F} "usb_dual_id,${G}" 2> /dev/null +${OBJCOPY} -j usb_dual_id -O binary ${F} "usb_dual_id,${G}" 2> /dev/null [ -f "usb_dual_id,${G}" ] && (echo -n " -i usb_dual_id,${G}" >> bus_autoconf_args.txt) done @@ -69,4 +71,8 @@ done bus_autoconf -F bus_autoconf_format.bin $(cat bus_autoconf_args.txt) # Cleanup -rm -f -- bus_autoconf_format.bin $(cat bus_autoconf_args.txt) +rm -f -- \ + $(cat bus_autoconf_args.txt) \ + bus_autoconf_args.txt \ + bus_autoconf_format.bin \ + bus_autoconf.ids diff --git a/tools/tools/bus_autoconf/bus_load_file.c b/tools/tools/bus_autoconf/bus_load_file.c index 88f806a15b4..527e5bce49b 100644 --- a/tools/tools/bus_autoconf/bus_load_file.c +++ b/tools/tools/bus_autoconf/bus_load_file.c @@ -48,11 +48,15 @@ load_file(const char *fname, uint8_t **pptr, uint32_t *plen) err(EX_NOINPUT, "Cannot open file '%s'", fname); off = lseek(f, 0, SEEK_END); - if (off <= 0) - err(EX_NOINPUT, "Cannot seek to end of file"); + if (off < 0) { + err(EX_NOINPUT, "Cannot seek to " + "end of file '%s'", fname); + } - if (lseek(f, 0, SEEK_SET) < 0) - err(EX_NOINPUT, "Cannot seek to beginning of file"); + if (lseek(f, 0, SEEK_SET) < 0) { + err(EX_NOINPUT, "Cannot seek to " + "beginning of file '%s'", fname); + } len = off; if (len != off) diff --git a/tools/tools/bus_autoconf/bus_usb.c b/tools/tools/bus_autoconf/bus_usb.c index e3d60e84894..ab794c13a2a 100644 --- a/tools/tools/bus_autoconf/bus_usb.c +++ b/tools/tools/bus_autoconf/bus_usb.c @@ -276,6 +276,10 @@ usb_dump(struct usb_device_id *id, uint32_t nid) break; if (id[n].idVendor != id[0].idVendor) break; + if (strcmp(id[n].module_name, id[0].module_name)) + break; + if (strcmp(id[n].module_mode, id[0].module_mode)) + break; n++; } } From fe38e11f25fd0d0fa2c88b0bff8125d656e6e8f1 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 25 Jun 2011 15:42:33 +0000 Subject: [PATCH 25/49] - Move auto-load devd config file into etc/defaults folder. - Regenerate file after bugfix in the generator. Suggested by: Jeremy Messenger MFC after: 14 days --- etc/defaults/Makefile | 2 +- .../bus_auto.conf => defaults/devd.conf} | 2130 ++++++++++++++++- 2 files changed, 2013 insertions(+), 119 deletions(-) rename etc/{devd/bus_auto.conf => defaults/devd.conf} (52%) diff --git a/etc/defaults/Makefile b/etc/defaults/Makefile index c6555e6de00..0d3a81ad964 100644 --- a/etc/defaults/Makefile +++ b/etc/defaults/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= bluetooth.device.conf devfs.rules periodic.conf rc.conf +FILES= bluetooth.device.conf devd.conf devfs.rules periodic.conf rc.conf NO_OBJ= FILESDIR= /etc/defaults diff --git a/etc/devd/bus_auto.conf b/etc/defaults/devd.conf similarity index 52% rename from etc/devd/bus_auto.conf rename to etc/defaults/devd.conf index a1c7236a515..5dbbd0a8d32 100644 --- a/etc/devd/bus_auto.conf +++ b/etc/defaults/devd.conf @@ -5,32 +5,6 @@ # Please do not edit! # -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "(host|device)"; - match "intclass" "0x02"; - match "intsubclass" "0x06"; - action "kldload if_cdce"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "(host|device)"; - match "intclass" "0x02"; - match "intsubclass" "0x0a"; - action "kldload if_cdce"; -}; - -nomatch 32 { - match "bus" "uhub[0-9]+"; - match "mode" "(host|device)"; - match "intclass" "0x02"; - match "intsubclass" "0x0d"; - action "kldload if_cdce"; -}; - -# 3 usb_dual entries processed - nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -111,10 +85,66 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x03f0"; - match "product" "(0x0121|0x1016|0x1116|0x1216|0x1b1d|0x1e1d|0x2016|0x2116|0x2216|0x3016|0x3116|0x3216|0x3524|0x4016|0x4116|0x4216|0x5016|0x5116|0x5216|0x811c|0xca02)"; + match "product" "0x0121"; action "kldload ugensa"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x1016|0x1116|0x1216)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x1b1d|0x1e1d)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x2016|0x2116|0x2216|0x3016|0x3116|0x3216)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "0x3524"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "(0x4016|0x4116|0x4216|0x5016|0x5116|0x5216)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "0x811c"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x03f0"; + match "product" "0xca02"; + action "kldload if_urtw"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -135,10 +165,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0408"; - match "product" "(0x0304|0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; + match "product" "0x0304"; action "kldload if_run"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0408"; + match "product" "(0x1000|0xea02|0xea03|0xea04|0xea05|0xea06)"; + action "kldload u3g"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -151,10 +189,114 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0411"; - match "product" "(0x0001|0x0005|0x0009|0x0012|0x003d|0x005e|0x0066|0x0067|0x006e|0x008b|0x00b3|0x00d8|0x00d9|0x00da|0x00e8|0x0116|0x0119|0x012e|0x0137|0x0148|0x0150|0x015d|0x016f)"; + match "product" "(0x0001|0x0005|0x0009)"; action "kldload if_aue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x0012"; + action "kldload if_rue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x003d"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x005e|0x0066|0x0067)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x006e"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x008b"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x00b3"; + action "kldload uftdi"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x00d8|0x00d9)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x00da"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x00e8"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x0116|0x0119)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x012e"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "0x0137"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0411"; + match "product" "(0x0148|0x0150|0x015d|0x016f)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -199,18 +341,50 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x045e"; - match "product" "(0x0079|0x007a|0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)"; + match "product" "0x0079"; action "kldload uplcom"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045e"; + match "product" "0x007a"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x045e"; + match "product" "(0x00ce|0x0400|0x0401|0x0402|0x0403|0x0404|0x0405|0x0406|0x0407|0x0408|0x0409|0x040a|0x040b|0x040c|0x040d|0x040e|0x040f|0x0410|0x0411|0x0412|0x0413|0x0414|0x0415|0x0416|0x0417|0x0432|0x0433|0x0434|0x0435|0x0436|0x0437|0x0438|0x0439|0x043a|0x043b|0x043c|0x043d|0x043e|0x043f|0x0440|0x0441|0x0442|0x0443|0x0444|0x0445|0x0446|0x0447|0x0448|0x0449|0x044a|0x044b|0x044c|0x044d|0x044e|0x044f|0x0450|0x0451|0x0452|0x0453|0x0454|0x0455|0x0456|0x0457|0x0458|0x0459|0x045a|0x045b|0x045c|0x045d|0x045e|0x045f|0x0460|0x0461|0x0462|0x0463|0x0464|0x0465|0x0466|0x0467|0x0468|0x0469|0x046a|0x046b|0x046c|0x046d|0x046e|0x046f|0x0470|0x0471|0x0472|0x0473|0x0474|0x0475|0x0476|0x0477|0x0478|0x0479|0x047a|0x047b|0x04c8|0x04c9|0x04ca|0x04cb|0x04cc|0x04cd|0x04ce|0x04d7|0x04d8|0x04d9|0x04da|0x04db|0x04dc|0x04dd|0x04de|0x04df|0x04e0|0x04e1|0x04e2|0x04e3|0x04e4|0x04e5|0x04e6|0x04e7|0x04e8|0x04e9|0x04ea)"; + action "kldload uipaq"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0471"; - match "product" "(0x066a|0x1236|0x200f)"; + match "product" "0x066a"; action "kldload uslcom"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0471"; + match "product" "0x1236"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0471"; + match "product" "0x200f"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -231,10 +405,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x049f"; - match "product" "(0x0003|0x0032|0x505a)"; + match "product" "(0x0003|0x0032)"; action "kldload uipaq"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x049f"; + match "product" "0x505a"; + action "kldload if_cdce"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -247,10 +429,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x04a5"; - match "product" "(0x4027|0x4068)"; + match "product" "0x4027"; action "kldload uplcom"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04a5"; + match "product" "0x4068"; + action "kldload u3g"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -287,10 +477,42 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x04bb"; - match "product" "(0x0901|0x0904|0x0913|0x0930|0x0944|0x0945|0x0947|0x0948|0x0a03|0x0a0e)"; + match "product" "0x0901"; action "kldload if_kue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "(0x0904|0x0913)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "0x0930"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "(0x0944|0x0945|0x0947|0x0948)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04bb"; + match "product" "(0x0a03|0x0a0e)"; + action "kldload uplcom"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -311,34 +533,82 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x04da"; - match "product" "(0x2500|0x3900)"; + match "product" "0x2500"; action "kldload uipaq"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04da"; + match "product" "0x3900"; + action "kldload uplcom"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x04dd"; - match "product" "(0x8004|0x8005|0x8006|0x8007|0x9031|0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)"; + match "product" "(0x8004|0x8005|0x8006|0x8007|0x9031)"; action "kldload if_cdce"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x04e8"; - match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04|0x6601|0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632|0x8001)"; + match "vendor" "0x04dd"; + match "product" "(0x9102|0x9121|0x9123|0x9151|0x91ac|0x9242)"; action "kldload uipaq"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "(0x5f00|0x5f01|0x5f02|0x5f03|0x5f04)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "0x6601"; + action "kldload uvisor"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "(0x6611|0x6613|0x6615|0x6617|0x6619|0x661b|0x662e|0x6630|0x6632)"; + action "kldload uipaq"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04e8"; + match "product" "0x8001"; + action "kldload uplcom"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x04f1"; - match "product" "(0x3008|0x3011|0x3012)"; + match "product" "0x3008"; action "kldload if_axe"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x04f1"; + match "product" "(0x3011|0x3012)"; + action "kldload uipaq"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -351,26 +621,162 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0506"; - match "product" "(0x03e8|0x11f8|0x4601)"; + match "product" "(0x03e8|0x11f8)"; action "kldload if_kue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0506"; + match "product" "0x4601"; + action "kldload if_aue"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x050d"; - match "product" "(0x0103|0x0109|0x0121|0x0257|0x0409|0x1203|0x4050|0x5055|0x7050|0x7050|0x7051|0x705a|0x705c|0x705e|0x8053|0x805c|0x815c|0x825a|0x905b|0x935a)"; + match "product" "0x0103"; action "kldload ubsa"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0109"; + action "kldload umct"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0121"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0257"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x0409"; + action "kldload umct"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x1203"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x4050"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x5055"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x7050"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "(0x7050|0x7051)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x705a"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x705c"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x705e"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "(0x8053|0x805c|0x815c|0x825a)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x905b"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x050d"; + match "product" "0x935a"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0525"; - match "product" "(0x1080|0xa4a2)"; + match "product" "0x1080"; action "kldload udbp"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0525"; + match "product" "0xa4a2"; + action "kldload if_cdce"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -391,23 +797,71 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0547"; - match "product" "(0x2008|0x2720)"; + match "product" "0x2008"; action "kldload uplcom"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0547"; + match "product" "0x2720"; + action "kldload udbp"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x054c"; - match "product" "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169|0x0437)"; + match "product" "(0x0038|0x0066|0x0095|0x009a|0x00da|0x0169)"; action "kldload uvisor"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x054c"; + match "product" "0x0437"; + action "kldload uplcom"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0557"; - match "product" "(0x2002|0x2007|0x2008|0x2009|0x4000)"; + match "product" "0x2002"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x2007"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x2008"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x2009"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0557"; + match "product" "0x4000"; action "kldload if_kue"; }; @@ -423,10 +877,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0565"; - match "product" "(0x0001|0x0002|0x0003|0x0005)"; + match "product" "0x0001"; action "kldload ubsa"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0565"; + match "product" "(0x0002|0x0003|0x0005)"; + action "kldload if_kue"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -447,7 +909,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x056e"; - match "product" "(0x200c|0x4002|0x4005|0x400b|0x4010|0x5003|0x5004|0xabc1)"; + match "product" "(0x200c|0x4002|0x4005|0x400b|0x4010)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056e"; + match "product" "(0x5003|0x5004)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x056e"; + match "product" "0xabc1"; action "kldload if_aue"; }; @@ -463,18 +941,34 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0584"; - match "product" "(0xb000|0xb020)"; + match "product" "0xb000"; action "kldload uplcom"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0584"; + match "product" "0xb020"; + action "kldload uftdi"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0586"; - match "product" "(0x3401|0x3407|0x3409|0x340a|0x340f|0x3410|0x3416|0x341a)"; + match "product" "(0x3401|0x3407|0x3409|0x340a|0x340f|0x3410)"; action "kldload if_zyd"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0586"; + match "product" "(0x3416|0x341a)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -495,10 +989,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05ac"; - match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c|0x0229|0x022a|0x022b|0x030a|0x030b|0x1402)"; + match "product" "(0x020d|0x020e|0x020f|0x0215|0x0217|0x0218|0x0219|0x021a|0x021b|0x021c|0x0229|0x022a|0x022b|0x030a|0x030b)"; action "kldload atp"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x05ac"; + match "product" "0x1402"; + action "kldload if_axe"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -559,7 +1061,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x066b"; - match "product" "(0x200c|0x2202|0x2202|0x2203|0x2204|0x2206|0x400b)"; + match "product" "(0x200c|0x2202)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x066b"; + match "product" "0x2202"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x066b"; + match "product" "(0x2203|0x2204|0x2206|0x400b)"; action "kldload if_aue"; }; @@ -575,10 +1093,34 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x067b"; - match "product" "(0x0000|0x0001|0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303|0x2501|0x331a|0xaaa0|0xaaa2)"; + match "product" "(0x0000|0x0001)"; action "kldload udbp"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067b"; + match "product" "(0x04bb|0x0609|0x0611|0x0612|0x1234|0x206a|0x2303)"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067b"; + match "product" "0x2501"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x067b"; + match "product" "(0x331a|0xaaa0|0xaaa2)"; + action "kldload uplcom"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -615,18 +1157,58 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x06f8"; - match "product" "(0xe000|0xe010|0xe020|0xe030)"; + match "product" "0xe000"; action "kldload if_ural"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x06f8"; + match "product" "(0xe010|0xe020)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x06f8"; + match "product" "0xe030"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0707"; - match "product" "(0x0100|0x0200|0x0201|0xee13|0xee13)"; + match "product" "0x0100"; action "kldload if_kue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0707"; + match "product" "(0x0200|0x0201)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0707"; + match "product" "0xee13"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0707"; + match "product" "0xee13"; + action "kldload if_ural"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -647,18 +1229,42 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0745"; - match "product" "(0x0001|0x1000)"; + match "product" "0x0001"; action "kldload uplcom"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0745"; + match "product" "0x1000"; + action "kldload uslcom"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0769"; - match "product" "(0x11f2|0x11f3|0x31f3)"; + match "product" "0x11f2"; action "kldload if_urtw"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0769"; + match "product" "0x11f3"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0769"; + match "product" "0x31f3"; + action "kldload if_rum"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -671,10 +1277,26 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0789"; - match "product" "(0x010c|0x0160|0x0162|0x0163|0x0164)"; + match "product" "0x010c"; action "kldload if_urtw"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0789"; + match "product" "0x0160"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0789"; + match "product" "(0x0162|0x0163|0x0164)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -687,10 +1309,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x079b"; - match "product" "(0x0027|0x004a|0x0062)"; + match "product" "0x0027"; action "kldload uplcom"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x079b"; + match "product" "(0x004a|0x0062)"; + action "kldload if_zyd"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -703,7 +1333,79 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07aa"; - match "product" "(0x0001|0x0004|0x000d|0x0017|0x002a|0x002d|0x002e|0x002f|0x003c|0x003f|0x0041|0x0042|0x9601)"; + match "product" "0x0001"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "(0x0004|0x000d)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "0x0017"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "0x002a"; + action "kldload uplcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "(0x002d|0x002e)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "(0x002f|0x003c|0x003f|0x0041|0x0042)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07aa"; + match "product" "0x9601"; + action "kldload if_udav"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "(0x110c|0x200c)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "0x4000"; action "kldload if_kue"; }; @@ -711,10 +1413,42 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07b8"; - match "product" "(0x110c|0x200c|0x2770|0x2870|0x3070|0x3071|0x3072|0x4000|0x4002|0x4003|0x4004|0x4007|0x400b|0x400c|0x4102|0x4104|0x420a|0x6001|0xabc1|0xb21b|0xb21c|0xb21d|0xb21e|0xb21f)"; + match "product" "(0x4002|0x4003|0x4004|0x4007|0x400b|0x400c|0x4102|0x4104)"; action "kldload if_aue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "0x420a"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "0x6001"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "0xabc1"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07b8"; + match "product" "(0xb21b|0xb21c|0xb21d|0xb21e|0xb21f)"; + action "kldload if_rum"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -735,10 +1469,26 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07d1"; - match "product" "(0x3a0c|0x3c03|0x3c04|0x3c06|0x3c07|0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; + match "product" "0x3a0c"; action "kldload if_uath"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "(0x3c03|0x3c04|0x3c06|0x3c07)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x07d1"; + match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -775,10 +1525,66 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x083a"; - match "product" "(0x1046|0x4506|0x4506|0x4508|0x4521|0x5046|0x6618|0x7511|0x7512|0x7522|0x8522|0xa512|0xa618|0xa701|0xa702|0xb522|0xc522|0xd522|0xe501)"; + match "product" "0x1046"; action "kldload if_aue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x083a"; + match "product" "0x4506"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x083a"; + match "product" "0x4506"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x083a"; + match "product" "0x4508"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x083a"; + match "product" "0x4521"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x083a"; + match "product" "0x5046"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x083a"; + match "product" "(0x6618|0x7511|0x7512|0x7522|0x8522|0xa512|0xa618|0xa701|0xa702|0xb522|0xc522|0xd522)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x083a"; + match "product" "0xe501"; + action "kldload if_zyd"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -791,10 +1597,58 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0846"; - match "product" "(0x1001|0x1002|0x1020|0x1040|0x4240|0x4260|0x4300|0x6100|0x6a00)"; + match "product" "(0x1001|0x1002)"; action "kldload if_kue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x1020"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x1040"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x4240"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x4260"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "0x4300"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0846"; + match "product" "(0x6100|0x6a00)"; + action "kldload if_urtw"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -831,18 +1685,34 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x08d1"; - match "product" "(0x0001|0x0003)"; + match "product" "0x0001"; action "kldload if_cue"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; - match "vendor" "0x08dd"; - match "product" "(0x0986|0x0987|0x0988|0x8511|0x90ff)"; + match "vendor" "0x08d1"; + match "product" "0x0003"; action "kldload if_aue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08dd"; + match "product" "(0x0986|0x0987|0x0988|0x8511)"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x08dd"; + match "product" "0x90ff"; + action "kldload if_axe"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -887,10 +1757,26 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0930"; - match "product" "(0x0700|0x0705|0x0706|0x0707|0x0708|0x0709|0x070a|0x070b|0x0a07|0x0d45|0x1302)"; + match "product" "(0x0700|0x0705|0x0706|0x0707|0x0708|0x0709|0x070a|0x070b)"; action "kldload uipaq"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0930"; + match "product" "0x0a07"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0930"; + match "product" "(0x0d45|0x1302)"; + action "kldload u3g"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -911,10 +1797,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0951"; - match "product" "(0x0008|0x000a)"; + match "product" "0x0008"; action "kldload if_kue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0951"; + match "product" "0x000a"; + action "kldload if_aue"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -991,26 +1885,162 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0af0"; - match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701|0x6721|0x6741|0x6761|0x6800|0x6901|0x6911|0x6971|0x6971|0x7001|0x7011|0x7021|0x7041|0x7061|0x7100|0x7201|0x7211|0x7251|0x7301|0x7361|0x7381|0x7401|0x7501|0x7601|0x7601|0xc031|0xd013|0xd031|0xd033|0xd033|0xd055|0xd055)"; + match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701|0x6721|0x6741|0x6761|0x6800|0x6901)"; action "kldload u3g"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "0x6911"; + action "kldload uhso"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "0x6971"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "0x6971"; + action "kldload uhso"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "0x7001"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "0x7011"; + action "kldload uhso"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "(0x7021|0x7041|0x7061|0x7100|0x7201|0x7211)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "(0x7251|0x7301|0x7361|0x7381|0x7401|0x7501)"; + action "kldload uhso"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "0x7601"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "(0x7601|0xc031|0xd013|0xd031)"; + action "kldload uhso"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "0xd033"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0af0"; + match "product" "(0xd033|0xd055|0xd055)"; + action "kldload uhso"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b05"; - match "product" "(0x1706|0x1707|0x170c|0x171b|0x171d|0x1723|0x1724|0x1731|0x1732|0x1742|0x1760|0x1761|0x1784|0x1790|0x4200|0x4201|0x4202|0x420f|0x9200|0x9202)"; + match "product" "(0x1706|0x1707)"; action "kldload if_ural"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "(0x170c|0x171b)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "0x171d"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "(0x1723|0x1724)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "(0x1731|0x1732|0x1742|0x1760|0x1761|0x1784|0x1790)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b05"; + match "product" "(0x4200|0x4201|0x4202|0x420f|0x9200|0x9202)"; + action "kldload uipaq"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b39"; - match "product" "(0x0109|0x0421)"; + match "product" "0x0109"; action "kldload if_aue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0b39"; + match "product" "0x0421"; + action "kldload uftdi"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1055,10 +2085,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0baf"; - match "product" "(0x0118|0x0121)"; + match "product" "0x0118"; action "kldload if_upgt"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0baf"; + match "product" "0x0121"; + action "kldload if_zyd"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1079,10 +2117,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bda"; - match "product" "(0x8150|0x8187|0x8189|0x8197|0x8198)"; + match "product" "0x8150"; action "kldload if_rue"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bda"; + match "product" "(0x8187|0x8189|0x8197|0x8198)"; + action "kldload if_urtw"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1095,10 +2141,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0bf8"; - match "product" "(0x1001|0x1009)"; + match "product" "0x1001"; action "kldload uipaq"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0bf8"; + match "product" "0x1009"; + action "kldload if_upgt"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1111,7 +2165,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0c88"; - match "product" "(0x17da|0x17da|0x180a)"; + match "product" "0x17da"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c88"; + match "product" "0x17da"; + action "kldload ugensa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0c88"; + match "product" "0x180a"; action "kldload u3g"; }; @@ -1135,10 +2205,50 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0cde"; - match "product" "(0x0008|0x0011|0x0012|0x0015|0x001a|0x0022|0x0025)"; + match "product" "0x0008"; action "kldload if_upgt"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0011"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0012"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x0015"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "0x001a"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0cde"; + match "product" "(0x0022|0x0025)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1151,18 +2261,58 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0d8e"; - match "product" "(0x3762|0x7801|0x7811)"; + match "product" "0x3762"; action "kldload if_upgt"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0d8e"; + match "product" "(0x7801|0x7811)"; + action "kldload if_uath"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0db0"; - match "product" "(0x3820|0x3821|0x3822|0x3870|0x3871|0x6861|0x6865|0x6869|0x6874|0x6877|0x6899|0x821a|0x822a|0x870a|0x871a|0x899a|0xa861|0xa874)"; + match "product" "(0x3820|0x3821|0x3822|0x3870|0x3871)"; action "kldload if_run"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0db0"; + match "product" "(0x6861|0x6865|0x6869)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0db0"; + match "product" "(0x6874|0x6877)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0db0"; + match "product" "(0x6899|0x821a|0x822a|0x870a|0x871a|0x899a)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0db0"; + match "product" "(0xa861|0xa874)"; + action "kldload if_rum"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1175,10 +2325,66 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0df6"; - match "product" "(0x000d|0x0017|0x0021|0x0028|0x002b|0x002c|0x002d|0x0039|0x003b|0x003c|0x003d|0x003e|0x003f|0x0040|0x0041|0x0042|0x0047|0x0048|0x004a|0x004d|0x061c|0x9071|0x9075|0x90ac|0x9712)"; + match "product" "0x000d"; action "kldload if_urtw"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "0x0017"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "0x0021"; + action "kldload if_mos"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "0x0028"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "(0x002b|0x002c|0x002d|0x0039|0x003b|0x003c|0x003d|0x003e|0x003f|0x0040|0x0041|0x0042|0x0047|0x0048|0x004a|0x004d)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "0x061c"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "(0x9071|0x9075)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "(0x90ac|0x9712)"; + action "kldload if_rum"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1207,10 +2413,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0e66"; - match "product" "(0x0001|0x0003|0x0009|0x000b|0x400c)"; + match "product" "(0x0001|0x0003|0x0009|0x000b)"; action "kldload if_run"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0e66"; + match "product" "0x400c"; + action "kldload if_aue"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1247,10 +2461,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0eb0"; - match "product" "(0x9020|0x9021)"; + match "product" "0x9020"; action "kldload if_ural"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0eb0"; + match "product" "0x9021"; + action "kldload if_rum"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1271,10 +2493,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0f3d"; - match "product" "(0x0112|0x0112)"; + match "product" "0x0112"; action "kldload u3g"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f3d"; + match "product" "0x0112"; + action "kldload ugensa"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1287,10 +2517,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0f88"; - match "product" "(0x3012|0x3014)"; + match "product" "0x3012"; action "kldload if_ural"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0f88"; + match "product" "0x3014"; + action "kldload if_zyd"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1351,10 +2589,42 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1044"; - match "product" "(0x8001|0x8002|0x8007|0x8008|0x800a|0x800b|0x800c|0x800d)"; + match "product" "0x8001"; action "kldload if_ural"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1044"; + match "product" "0x8002"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1044"; + match "product" "0x8007"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1044"; + match "product" "(0x8008|0x800a)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1044"; + match "product" "(0x800b|0x800c|0x800d)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1391,10 +2661,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x10b5"; - match "product" "(0xac70|0xac70)"; + match "product" "0xac70"; action "kldload uplcom"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10b5"; + match "product" "0xac70"; + action "kldload uslcom"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1407,7 +2685,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x10c4"; - match "product" "(0x0f91|0x1101|0x1601|0x800a|0x803b|0x8043|0x8044|0x8053|0x8066|0x806f|0x807a|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x818b|0x819f|0x81a6|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x8411|0x846e|0x8477|0xea60|0xea61|0xea71|0xf001|0xf002|0xf003|0xf004)"; + match "product" "(0x0f91|0x1101|0x1601|0x800a|0x803b|0x8043|0x8044)"; + action "kldload uslcom"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10c4"; + match "product" "0x8053"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x10c4"; + match "product" "(0x8066|0x806f|0x807a|0x80ca|0x80dd|0x80ed|0x80f6|0x8115|0x813d|0x813f|0x814a|0x814a|0x814b|0x8156|0x815e|0x818b|0x819f|0x81a6|0x81ac|0x81ad|0x81c8|0x81e2|0x81e7|0x81e8|0x81f2|0x8218|0x822b|0x826b|0x8293|0x82f9|0x8341|0x8382|0x83a8|0x8411|0x846e|0x8477|0xea60|0xea61|0xea71|0xf001|0xf002|0xf003|0xf004)"; action "kldload uslcom"; }; @@ -1439,10 +2733,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x114b"; - match "product" "(0x0110|0x0150)"; + match "product" "0x0110"; action "kldload if_ural"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x114b"; + match "product" "0x0150"; + action "kldload if_urtw"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1479,7 +2781,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1199"; - match "product" "(0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0112|0x0120|0x0218|0x0218|0x0220|0x0224|0x0fff|0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3)"; + match "product" "(0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0112|0x0120|0x0218)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1199"; + match "product" "0x0218"; + action "kldload umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1199"; + match "product" "(0x0220|0x0224|0x0fff|0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3)"; action "kldload u3g"; }; @@ -1543,10 +2861,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x129b"; - match "product" "(0x1666|0x1828)"; + match "product" "0x1666"; action "kldload if_zyd"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x129b"; + match "product" "0x1828"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1575,10 +2901,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1371"; - match "product" "(0x9022|0x9032|0x9401)"; + match "product" "(0x9022|0x9032)"; action "kldload if_rum"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1371"; + match "product" "0x9401"; + action "kldload if_urtw"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1599,10 +2933,50 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x13b1"; - match "product" "(0x000c|0x000d|0x0011|0x0018|0x001a|0x0020|0x0023|0x0024)"; + match "product" "0x000c"; action "kldload if_upgt"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13b1"; + match "product" "(0x000d|0x0011)"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13b1"; + match "product" "0x0018"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13b1"; + match "product" "0x001a"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13b1"; + match "product" "(0x0020|0x0023)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x13b1"; + match "product" "0x0024"; + action "kldload if_zyd"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1639,10 +3013,26 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1435"; - match "product" "(0x0427|0x0711|0x0826|0x082a)"; + match "product" "0x0427"; action "kldload if_upgt"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1435"; + match "product" "0x0711"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1435"; + match "product" "(0x0826|0x082a)"; + action "kldload if_uath"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1679,7 +3069,63 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x148f"; - match "product" "(0x1706|0x2070|0x2570|0x2573|0x2671|0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x8070|0x9020|0x9021)"; + match "product" "0x1706"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "0x2070"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "0x2570"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "(0x2573|0x2671)"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "(0x2770|0x2870|0x3070|0x3071|0x3072|0x3370|0x3572|0x8070)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "0x9020"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x148f"; + match "product" "0x9021"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14b2"; + match "product" "0x3c02"; action "kldload if_ural"; }; @@ -1687,15 +3133,47 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x14b2"; - match "product" "(0x3c02|0x3c06|0x3c07|0x3c08|0x3c09|0x3c11|0x3c12|0x3c22|0x3c23|0x3c25|0x3c25|0x3c27|0x3c28)"; - action "kldload if_ural"; + match "product" "(0x3c06|0x3c07|0x3c08|0x3c09|0x3c11|0x3c12)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14b2"; + match "product" "0x3c22"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14b2"; + match "product" "(0x3c23|0x3c25|0x3c25|0x3c27|0x3c28)"; + action "kldload if_run"; }; nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x14ea"; - match "product" "(0xab10|0xab11|0xab13)"; + match "product" "0xab10"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14ea"; + match "product" "0xab11"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x14ea"; + match "product" "0xab13"; action "kldload if_zyd"; }; @@ -1711,15 +3189,55 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1557"; - match "product" "(0x7720|0x8150)"; + match "product" "0x7720"; action "kldload if_axe"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1557"; + match "product" "0x8150"; + action "kldload if_rue"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x157e"; - match "product" "(0x3006|0x300a|0x300b|0x300d|0x300e|0x3204|0x3205)"; + match "product" "0x3006"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x157e"; + match "product" "(0x300a|0x300b|0x300d)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x157e"; + match "product" "0x300e"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x157e"; + match "product" "0x3204"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x157e"; + match "product" "0x3205"; action "kldload if_uath"; }; @@ -1735,10 +3253,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x15a9"; - match "product" "(0x0004|0x0006|0x0010)"; + match "product" "0x0004"; action "kldload if_rum"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x15a9"; + match "product" "(0x0006|0x0010)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1767,10 +3293,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1631"; - match "product" "(0x6200|0xc019)"; + match "product" "0x6200"; action "kldload if_axe"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1631"; + match "product" "0xc019"; + action "kldload if_rum"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1807,10 +3341,34 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1690"; - match "product" "(0x0601|0x0710|0x0712|0x0722|0x0740|0x0744)"; + match "product" "0x0601"; action "kldload uipaq"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1690"; + match "product" "(0x0710|0x0712)"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1690"; + match "product" "0x0722"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1690"; + match "product" "(0x0740|0x0744)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1823,10 +3381,34 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x16d5"; - match "product" "(0x6202|0x6501|0x6501|0x6502|0x6502)"; + match "product" "(0x6202|0x6501)"; action "kldload u3g"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d5"; + match "product" "0x6501"; + action "kldload ubsa"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d5"; + match "product" "0x6502"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d5"; + match "product" "0x6502"; + action "kldload ubsa"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1839,10 +3421,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x16d8"; - match "product" "(0x6006|0x6280|0x6280)"; + match "product" "(0x6006|0x6280)"; action "kldload u3g"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x16d8"; + match "product" "0x6280"; + action "kldload ugensa"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1855,23 +3445,71 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1726"; - match "product" "(0x1000|0x1000)"; + match "product" "0x1000"; action "kldload u3g"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1726"; + match "product" "0x1000"; + action "kldload ubsa"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1737"; - match "product" "(0x0039|0x0070|0x0071|0x0073|0x0077|0x0078|0x0079)"; + match "product" "0x0039"; action "kldload if_axe"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1737"; + match "product" "(0x0070|0x0071)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1737"; + match "product" "0x0073"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1737"; + match "product" "(0x0077|0x0078|0x0079)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1740"; - match "product" "(0x0605|0x0615|0x2000|0x9701|0x9702|0x9703|0x9705|0x9706|0x9707|0x9708|0x9709|0x9801)"; + match "product" "(0x0605|0x0615)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1740"; + match "product" "0x2000"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1740"; + match "product" "(0x9701|0x9702|0x9703|0x9705|0x9706|0x9707|0x9708|0x9709|0x9801)"; action "kldload if_run"; }; @@ -1911,7 +3549,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x18c5"; - match "product" "(0x0002|0x0008|0x0012)"; + match "product" "0x0002"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18c5"; + match "product" "(0x0008|0x0012)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18e8"; + match "product" "(0x6196|0x6229)"; action "kldload if_rum"; }; @@ -1919,10 +3573,26 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x18e8"; - match "product" "(0x6196|0x6229|0x6232|0x6238|0x6259)"; + match "product" "0x6232"; + action "kldload if_urtw"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18e8"; + match "product" "0x6238"; action "kldload if_rum"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x18e8"; + match "product" "0x6259"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -1967,10 +3637,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1b75"; - match "product" "(0x3072|0x8187)"; + match "product" "0x3072"; action "kldload if_run"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x1b75"; + match "product" "0x8187"; + action "kldload if_urtw"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2055,18 +3733,122 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x1a00|0x200c|0x3a00|0x3a02|0x3a04|0x3c00|0x3c05|0x3c09|0x3c0a|0x4000|0x4001|0x4002|0x4003|0x400b|0x4102|0xabc1)"; + match "product" "0x1a00"; action "kldload if_axe"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "0x200c"; + action "kldload if_aue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "(0x3a00|0x3a02|0x3a04)"; + action "kldload if_uath"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "0x3c00"; + action "kldload if_ural"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "0x3c05"; + action "kldload if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "(0x3c09|0x3c0a)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "0x4000"; + action "kldload if_kue"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2001"; + match "product" "(0x4001|0x4002|0x4003|0x400b|0x4102|0xabc1)"; + action "kldload if_aue"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2019"; - match "product" "(0x5303|0xab01|0xab24|0xab25|0xab50|0xc007|0xed01|0xed02|0xed06|0xed14)"; + match "product" "0x5303"; action "kldload if_zyd"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "0xab01"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "(0xab24|0xab25)"; + action "kldload if_run"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "0xab50"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "(0xc007|0xed01)"; + action "kldload if_zyd"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "0xed02"; + action "kldload if_rum"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x2019"; + match "product" "(0xed06|0xed14)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2095,10 +3877,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x22b8"; - match "product" "(0x4204|0x4214|0x4224|0x4234|0x4244|0x600c|0x6027)"; + match "product" "(0x4204|0x4214|0x4224|0x4234|0x4244)"; action "kldload uipaq"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x22b8"; + match "product" "(0x600c|0x6027)"; + action "kldload if_cdce"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2143,10 +3933,34 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x413c"; - match "product" "(0x4001|0x4002|0x4003|0x4004|0x4005|0x4006|0x4007|0x4008|0x4009|0x8102|0x8104|0x8114|0x8115|0x8116|0x8117|0x8118|0x8128|0x8129|0x8133|0x8134|0x8135|0x8136|0x8137|0x8138|0x8180|0x8181|0x8182|0x9500)"; + match "product" "(0x4001|0x4002|0x4003|0x4004|0x4005|0x4006|0x4007|0x4008|0x4009)"; action "kldload uipaq"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x413c"; + match "product" "(0x8102|0x8104)"; + action "kldload if_upgt"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x413c"; + match "product" "(0x8114|0x8115|0x8116|0x8117|0x8118|0x8128|0x8129|0x8133|0x8134|0x8135|0x8136|0x8137|0x8138|0x8180|0x8181|0x8182)"; + action "kldload u3g"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x413c"; + match "product" "0x9500"; + action "kldload uslcom"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2191,10 +4005,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x5a57"; - match "product" "(0x0260|0x0280|0x0282|0x0283|0x0284|0x5257)"; + match "product" "0x0260"; action "kldload if_ural"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x5a57"; + match "product" "(0x0280|0x0282|0x0283|0x0284|0x5257)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2207,10 +4029,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x6189"; - match "product" "(0x182d|0x2068)"; + match "product" "0x182d"; action "kldload if_axe"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x6189"; + match "product" "0x2068"; + action "kldload uplcom"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2231,10 +4061,18 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x7392"; - match "product" "(0x7318|0x7711|0x7717|0x7718)"; + match "product" "0x7318"; action "kldload if_rum"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x7392"; + match "product" "(0x7711|0x7717|0x7718)"; + action "kldload if_run"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2247,10 +4085,42 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x9710"; - match "product" "(0x7703|0x7730|0x7820|0x7830|0x7840)"; + match "product" "0x7703"; action "kldload umoscom"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x9710"; + match "product" "0x7730"; + action "kldload if_mos"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x9710"; + match "product" "0x7820"; + action "kldload umcs"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x9710"; + match "product" "0x7830"; + action "kldload if_mos"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x9710"; + match "product" "0x7840"; + action "kldload umcs"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2355,6 +4225,30 @@ nomatch 32 { action "kldload snd_uaudio"; }; +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "(host|device)"; + match "intclass" "0x02"; + match "intsubclass" "0x06"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "(host|device)"; + match "intclass" "0x02"; + match "intsubclass" "0x0a"; + action "kldload if_cdce"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "(host|device)"; + match "intclass" "0x02"; + match "intsubclass" "0x0d"; + action "kldload if_cdce"; +}; + nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; @@ -2377,5 +4271,5 @@ nomatch 32 { action "kldload umass"; }; -# 1631 usb_host entries processed +# 1634 USB entries processed From 4c8ffb2300fc8c507996d39d44dc1b0da2784099 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 25 Jun 2011 15:46:24 +0000 Subject: [PATCH 26/49] - Remove duplicate USB ID. MFC after: 3 days --- sys/dev/usb/wlan/if_zyd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c index f8d905ec984..4221c3441ea 100644 --- a/sys/dev/usb/wlan/if_zyd.c +++ b/sys/dev/usb/wlan/if_zyd.c @@ -229,7 +229,6 @@ static const STRUCT_USB_HOST_ID zyd_devs[] = { ZYD_ZD1211_DEV(ZYXEL, ZYAIRG220), ZYD_ZD1211_DEV(ZYXEL, G200V2), /* ZYD_ZD1211B */ - ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), ZYD_ZD1211B_DEV(ACCTON, ZD1211B), ZYD_ZD1211B_DEV(ASUS, A9T_WIFI), From 1d63770b39da8b86e5205ad507f0b3177b36bc1e Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 25 Jun 2011 15:51:44 +0000 Subject: [PATCH 27/49] - Export the USB device ID format to userspace tools. MFC after: 14 days --- sys/dev/usb/usb_lookup.c | 107 +++++++++++++++++++++++++++++++++++++++ sys/dev/usb/usbdi.h | 8 ++- 2 files changed, 114 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/usb_lookup.c b/sys/dev/usb/usb_lookup.c index 3b2d16d48d5..e03f9b60b24 100644 --- a/sys/dev/usb/usb_lookup.c +++ b/sys/dev/usb/usb_lookup.c @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include @@ -144,3 +146,108 @@ usbd_lookup_id_by_uaa(const struct usb_device_id *id, usb_size_t sizeof_id, } return (ENXIO); } + +/*------------------------------------------------------------------------* + * Export the USB device ID format we use to userspace tools. + *------------------------------------------------------------------------*/ +#if BYTE_ORDER == BIG_ENDIAN +#define U16_XOR "8" +#define U32_XOR "12" +#define U64_XOR "56" +#define U8_BITFIELD_XOR "7" +#define U16_BITFIELD_XOR "15" +#define U32_BITFIELD_XOR "31" +#define U64_BITFIELD_XOR "63" +#else +#define U16_XOR "0" +#define U32_XOR "0" +#define U64_XOR "0" +#define U8_BITFIELD_XOR "0" +#define U16_BITFIELD_XOR "0" +#define U32_BITFIELD_XOR "0" +#define U64_BITFIELD_XOR "0" +#endif + +#if USB_HAVE_COMPAT_LINUX +#define MFL_SIZE "1" +#else +#define MFL_SIZE "0" +#endif + +#ifdef KLD_MODULE +static const char __section("bus_autoconf_format") __used usb_id_format[] = { + + /* Declare that three different sections use the same format */ + + "usb_host_id{256,:}" + "usb_device_id{256,:}" + "usb_dual_id{256,:}" + + /* List size of fields in the usb_device_id structure */ + +#if ULONG_MAX >= 0xFFFFFFFFUL + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" +#if ULONG_MAX >= 0xFFFFFFFFFFFFFFFFULL + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" + "unused{0,8}" +#endif +#else +#error "Please update code." +#endif + + "idVendor[0]{" U16_XOR ",8}" + "idVendor[1]{" U16_XOR ",8}" + "idProduct[0]{" U16_XOR ",8}" + "idProduct[1]{" U16_XOR ",8}" + "bcdDevice_lo[0]{" U16_XOR ",8}" + "bcdDevice_lo[1]{" U16_XOR ",8}" + "bcdDevice_hi[0]{" U16_XOR ",8}" + "bcdDevice_hi[1]{" U16_XOR ",8}" + + "bDeviceClass{0,8}" + "bDeviceSubClass{0,8}" + "bDeviceProtocol{0,8}" + "bInterfaceClass{0,8}" + "bInterfaceSubClass{0,8}" + "bInterfaceProtocol{0,8}" + + "mf_vendor{" U8_BITFIELD_XOR ",1}" + "mf_product{" U8_BITFIELD_XOR ",1}" + "mf_dev_lo{" U8_BITFIELD_XOR ",1}" + "mf_dev_hi{" U8_BITFIELD_XOR ",1}" + + "mf_dev_class{" U8_BITFIELD_XOR ",1}" + "mf_dev_subclass{" U8_BITFIELD_XOR ",1}" + "mf_dev_protocol{" U8_BITFIELD_XOR ",1}" + "mf_int_class{" U8_BITFIELD_XOR ",1}" + + "mf_int_subclass{" U8_BITFIELD_XOR ",1}" + "mf_int_protocol{" U8_BITFIELD_XOR ",1}" + "unused{" U8_BITFIELD_XOR ",6}" + + "mfl_vendor{" U16_XOR "," MFL_SIZE "}" + "mfl_product{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_lo{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_hi{" U16_XOR "," MFL_SIZE "}" + + "mfl_dev_class{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_subclass{" U16_XOR "," MFL_SIZE "}" + "mfl_dev_protocol{" U16_XOR "," MFL_SIZE "}" + "mfl_int_class{" U16_XOR "," MFL_SIZE "}" + + "mfl_int_subclass{" U16_XOR "," MFL_SIZE "}" + "mfl_int_protocol{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" + "unused{" U16_XOR "," MFL_SIZE "}" +}; +#endif diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index a2168790139..d832c327db1 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -270,12 +270,15 @@ struct usb_device_id { uint8_t match_flag_product:1; uint8_t match_flag_dev_lo:1; uint8_t match_flag_dev_hi:1; + uint8_t match_flag_dev_class:1; uint8_t match_flag_dev_subclass:1; uint8_t match_flag_dev_protocol:1; uint8_t match_flag_int_class:1; + uint8_t match_flag_int_subclass:1; uint8_t match_flag_int_protocol:1; + uint8_t match_flag_unused:6; #if USB_HAVE_COMPAT_LINUX /* which fields to match against */ @@ -291,7 +294,10 @@ struct usb_device_id { #define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 #endif -}; +} __aligned(32); + +/* check that the size of the structure above is correct */ +extern char usb_device_id_assert[(sizeof(struct usb_device_id) == 32) ? 1 : -1]; #define USB_VENDOR(vend) \ .match_flag_vendor = 1, .idVendor = (vend) From 01ecc0328d66623630a851bfcf6ae20248b32781 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Sat, 25 Jun 2011 16:01:45 +0000 Subject: [PATCH 28/49] As with EFI, OFW and U-Boot etc only compile FDT support on those architectures that actually use it. --- sys/boot/Makefile | 4 ---- sys/boot/Makefile.arm | 4 ++++ sys/boot/Makefile.powerpc | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/boot/Makefile b/sys/boot/Makefile index cfc82b98201..06cffb12c26 100644 --- a/sys/boot/Makefile +++ b/sys/boot/Makefile @@ -8,10 +8,6 @@ SUBDIR+= ficl .endif -.if ${MK_FDT} != "no" -SUBDIR+= fdt -.endif - # Pick the machine-dependent subdir based on the target architecture. ADIR= ${MACHINE:S/amd64/i386/:S/powerpc64/powerpc/} .if exists(${.CURDIR}/${ADIR}/.) diff --git a/sys/boot/Makefile.arm b/sys/boot/Makefile.arm index f96104db47c..46fc5742fbf 100644 --- a/sys/boot/Makefile.arm +++ b/sys/boot/Makefile.arm @@ -1,3 +1,7 @@ # $FreeBSD$ +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif + SUBDIR+= uboot diff --git a/sys/boot/Makefile.powerpc b/sys/boot/Makefile.powerpc index ca8c33139b1..b7660f4600d 100644 --- a/sys/boot/Makefile.powerpc +++ b/sys/boot/Makefile.powerpc @@ -1,4 +1,8 @@ # $FreeBSD$ +.if ${MK_FDT} != "no" +SUBDIR+= fdt +.endif + SUBDIR+= ofw SUBDIR+= uboot From 2d2ad9724a9f2c4391ca0473602b27fdfea6c9db Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Sat, 25 Jun 2011 16:13:56 +0000 Subject: [PATCH 29/49] The kerberos5 tools are only used as build tools but not otherwise and didn't get installed either. MFC after: 1 week --- kerberos5/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kerberos5/Makefile b/kerberos5/Makefile index 366540c6ee7..d87fa1682cb 100644 --- a/kerberos5/Makefile +++ b/kerberos5/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SUBDIR= doc tools lib libexec usr.bin usr.sbin +SUBDIR= doc lib libexec usr.bin usr.sbin # These are the programs which depend on Kerberos. KPROGS= lib/libpam \ From 674e7c4cfdb3d884ea2a83cf235a22044330bd07 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sat, 25 Jun 2011 16:27:49 +0000 Subject: [PATCH 30/49] If there is a read error reading Y/N confirmation from the keyboard, exit immediately with an error. If there is an error opening or reading a file to put into the archive, set the return value for a deferred error exit. PR: bin/154407 --- usr.bin/tar/util.c | 6 +++++- usr.bin/tar/write.c | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/usr.bin/tar/util.c b/usr.bin/tar/util.c index 858d472cba7..4177e9ce644 100644 --- a/usr.bin/tar/util.c +++ b/usr.bin/tar/util.c @@ -226,7 +226,11 @@ yes(const char *fmt, ...) fflush(stderr); l = read(2, buff, sizeof(buff) - 1); - if (l <= 0) + if (l < 0) { + fprintf(stderr, "Keyboard read failed\n"); + exit(1); + } + if (l == 0) return (0); buff[l] = 0; diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c index e59f64704ed..838dffb4576 100644 --- a/usr.bin/tar/write.c +++ b/usr.bin/tar/write.c @@ -919,6 +919,7 @@ write_entry_backend(struct bsdtar *bsdtar, struct archive *a, const char *pathname = archive_entry_sourcepath(entry); fd = open(pathname, O_RDONLY | O_BINARY); if (fd == -1) { + bsdtar->return_value = 1; if (!bsdtar->verbose) bsdtar_warnc(errno, "%s: could not open file", pathname); @@ -1020,6 +1021,12 @@ write_file_data(struct bsdtar *bsdtar, struct archive *a, progress += bytes_written; bytes_read = read(fd, bsdtar->buff, FILEDATABUFLEN); } + if (bytes_read < 0) { + bsdtar_warnc(errno, + "%s: Read error", + archive_entry_pathname(entry)); + bsdtar->return_value = 1; + } return 0; } From 3ebd36e3d049eace05d48f4ae2038c7231e539ee Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 25 Jun 2011 16:35:43 +0000 Subject: [PATCH 31/49] Define the minimum fractional period in terms of hz. We know hz is a magnitude smaller than itc_freq. A minimum period of 10*hz is sufficient precision. As a side-effect, the number of clocks per second, when the machine is idle, dropped by more than 50%. Be anal and define the maximum period to be at least 4G seconds. With a 64-bit counter and an ITC frequency that's expected to be always less than 4Ghz, it takes longer than that to wrap around. --- sys/ia64/ia64/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ia64/ia64/clock.c b/sys/ia64/ia64/clock.c index 881c46f7d13..74b224819c6 100644 --- a/sys/ia64/ia64/clock.c +++ b/sys/ia64/ia64/clock.c @@ -184,8 +184,8 @@ clock_configure(void *dummy) et->et_quality = 1000; et->et_frequency = itc_freq; et->et_min_period.sec = 0; - et->et_min_period.frac = ((1ul << 32) / itc_freq) << 32; - et->et_max_period.sec = 0xfffffff0 / itc_freq; + et->et_min_period.frac = (0x8000000000000000ul / (u_long)(10*hz)) << 1; + et->et_max_period.sec = ~0ul; /* XXX unless itc_freq >= (1<<32) */ et->et_max_period.frac = ((0xfffffffeul << 32) / itc_freq) << 32; et->et_start = ia64_clock_start; et->et_stop = ia64_clock_stop; From 72b92b5ef76b8642d7fd89da72f560b558f937a2 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 25 Jun 2011 17:01:46 +0000 Subject: [PATCH 32/49] - Move bus_auto.conf back into /etc/devd/ - Rename bus_auto.conf into usb.conf Requested by: imp @ MFC after: 14 days --- etc/defaults/Makefile | 2 +- etc/devd/Makefile | 2 +- etc/{defaults/devd.conf => devd/usb.conf} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename etc/{defaults/devd.conf => devd/usb.conf} (100%) diff --git a/etc/defaults/Makefile b/etc/defaults/Makefile index 0d3a81ad964..c6555e6de00 100644 --- a/etc/defaults/Makefile +++ b/etc/defaults/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= bluetooth.device.conf devd.conf devfs.rules periodic.conf rc.conf +FILES= bluetooth.device.conf devfs.rules periodic.conf rc.conf NO_OBJ= FILESDIR= /etc/defaults diff --git a/etc/devd/Makefile b/etc/devd/Makefile index ad434f270e3..8d7246abba3 100644 --- a/etc/devd/Makefile +++ b/etc/devd/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= asus.conf uath.conf +FILES= asus.conf uath.conf usb.conf NO_OBJ= FILESDIR= /etc/devd diff --git a/etc/defaults/devd.conf b/etc/devd/usb.conf similarity index 100% rename from etc/defaults/devd.conf rename to etc/devd/usb.conf From 191eae8259cbeebbc61c5a4bdfb9f0e989d7ce22 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 25 Jun 2011 17:58:35 +0000 Subject: [PATCH 33/49] Oops. The sec field of struct bintime is *not* a 32-bit type. It's time_t, which is 64 bits on ia64. --- sys/ia64/ia64/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/ia64/ia64/clock.c b/sys/ia64/ia64/clock.c index 74b224819c6..96d07c4b677 100644 --- a/sys/ia64/ia64/clock.c +++ b/sys/ia64/ia64/clock.c @@ -185,7 +185,7 @@ clock_configure(void *dummy) et->et_frequency = itc_freq; et->et_min_period.sec = 0; et->et_min_period.frac = (0x8000000000000000ul / (u_long)(10*hz)) << 1; - et->et_max_period.sec = ~0ul; /* XXX unless itc_freq >= (1<<32) */ + et->et_max_period.sec = 0xffffffff; et->et_max_period.frac = ((0xfffffffeul << 32) / itc_freq) << 32; et->et_start = ia64_clock_start; et->et_stop = ia64_clock_stop; From afd03ac8b0c5e3016e0f09a054bedd979905c0cd Mon Sep 17 00:00:00 2001 From: Joel Dahl Date: Sat, 25 Jun 2011 19:21:54 +0000 Subject: [PATCH 34/49] More accurate birthplace. --- usr.bin/calendar/calendars/calendar.freebsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index 957dafd7990..bf15da79f81 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -289,7 +289,7 @@ 10/18 Sheldon Hearn born in Cape Town, Western Cape, South Africa, 1974 10/19 Nicholas Souchu born in Suresnes, Hauts-de-Seine, France, 1972 10/19 Nick Barkas born in Longview, Washington, United States, 1981 -10/20 Joel Dahl born in Lidkoping, Sweden, 1983 +10/20 Joel Dahl born in Bitterna, Skaraborg, Sweden, 1983 10/20 Dmitry Marakasov born in Moscow, Russian Federation, 1984 10/21 Ben Smithurst born in Sheffield, South Yorkshire, United Kingdom, 1981 10/22 Jean-Sebastien Pedron born in Redon, Ille-et-Vilaine, France, 1980 From b5845df38421ec9354adee156d9942cebd86e07d Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sat, 25 Jun 2011 20:37:43 +0000 Subject: [PATCH 35/49] sh: Test that '!' is literal if quoted and first char of bracket expression This also works on stable/8. --- tools/regression/bin/sh/builtins/case10.0 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tools/regression/bin/sh/builtins/case10.0 diff --git a/tools/regression/bin/sh/builtins/case10.0 b/tools/regression/bin/sh/builtins/case10.0 new file mode 100644 index 00000000000..a627b5cd996 --- /dev/null +++ b/tools/regression/bin/sh/builtins/case10.0 @@ -0,0 +1,16 @@ +# $FreeBSD$ + +case ! in +[\!!]) ;; +*) echo Failed at $LINENO ;; +esac + +case ! in +['!'!]) ;; +*) echo Failed at $LINENO ;; +esac + +case ! in +["!"!]) ;; +*) echo Failed at $LINENO ;; +esac From 7e5fa6df325ccf2352cc1024d2411ddbfdba4d54 Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Sun, 26 Jun 2011 00:35:11 +0000 Subject: [PATCH 36/49] Do not attach to the sound device on G5 Xserves, which is actually an LED controller used to run the load graph on the server's front panel. Reported by: Paul Mather MFC after: 3 days --- sys/dev/sound/macio/i2s.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/sound/macio/i2s.c b/sys/dev/sound/macio/i2s.c index d1a54630130..e35a262be88 100644 --- a/sys/dev/sound/macio/i2s.c +++ b/sys/dev/sound/macio/i2s.c @@ -158,6 +158,8 @@ static int i2s_probe(device_t self) { const char *name; + phandle_t subchild; + char subchildname[255]; name = ofw_bus_get_name(self); if (!name) @@ -165,6 +167,16 @@ i2s_probe(device_t self) if (strcmp(name, "i2s") != 0) return (ENXIO); + + /* + * Do not attach to "lightshow" I2S devices on Xserves. This controller + * is used there to control the LEDs on the front panel, and this + * driver can't handle it. + */ + subchild = OF_child(OF_child(ofw_bus_get_node(self))); + if (subchild != 0 && OF_getprop(subchild, "name", subchildname, + sizeof(subchildname)) > 0 && strcmp(subchildname, "lightshow") == 0) + return (ENXIO); device_set_desc(self, "Apple I2S Audio Controller"); From 373506f71d315dd8e9867a6767a05da838a9a44a Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Sun, 26 Jun 2011 00:49:17 +0000 Subject: [PATCH 37/49] Turn the minimum PWM fan speed down to 30 from 40. It turns out the burning smell that caused me to turn this up was due to a failed fan burning, not a CPU (plus a healthy dose of paranoia). Submitted by: Paul Mather --- sys/powerpc/powermac/fcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/powerpc/powermac/fcu.c b/sys/powerpc/powermac/fcu.c index 7ac9b1b08e8..eb43ff23e1b 100644 --- a/sys/powerpc/powermac/fcu.c +++ b/sys/powerpc/powermac/fcu.c @@ -510,7 +510,7 @@ fcu_fill_fan_prop(device_t dev) sc->sc_fans[j].fan.set = (int (*)(struct pmac_fan *, int))(fcu_fan_set_rpm); } else { - sc->sc_fans[j].fan.min_rpm = 40; /* Percent */ + sc->sc_fans[j].fan.min_rpm = 30; /* Percent */ sc->sc_fans[j].fan.max_rpm = 100; sc->sc_fans[j].fan.read = NULL; sc->sc_fans[j].fan.set = From 5245d98d0f8f2329cd817157317aa2f633f06dfa Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Sun, 26 Jun 2011 01:14:54 +0000 Subject: [PATCH 38/49] cam/cam_xpt.c: In camisr_runqueue(), we need to run the sims queue regardless of whether or not the current peripheral has more work to do. This reverts a change mistakenly made in revision 223081. Reported by: ache --- sys/cam/cam_xpt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index f23407652a5..013c415d7c7 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -4894,8 +4894,8 @@ camisr_runqueue(void *V_queue) && (--dev->tag_delay_count == 0)) xpt_start_tags(ccb_h->path); if (!device_is_send_queued(dev)) { - runq = xpt_schedule_dev_sendq(ccb_h->path->bus, - dev); + (void)xpt_schedule_dev_sendq(ccb_h->path->bus, + dev); } } From c41ba4094719942902355407c98a62b12a60560f Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Sun, 26 Jun 2011 01:32:46 +0000 Subject: [PATCH 39/49] cam/scsi/scsi_cd.c: In cdregister(), hold the periph lock semaphore during changer probe/configuration. This removes a window where an open of the cd device may succeed before probe processing has completed. --- sys/cam/scsi/scsi_cd.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index c1951ffeefa..91384b76d38 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -687,6 +687,10 @@ cdregister(struct cam_periph *periph, void *arg) else softc->minimum_command_size = 6; + /* + * Refcount and block open attempts until we are setup + * Can't block + */ (void)cam_periph_hold(periph, PRIBIO); cam_periph_unlock(periph); /* @@ -747,7 +751,6 @@ cdregister(struct cam_periph *periph, void *arg) softc->disk->d_hba_subdevice = cpi.hba_subdevice; disk_create(softc->disk, DISK_VERSION); cam_periph_lock(periph); - cam_periph_unhold(periph); /* * Add an async callback so that we get @@ -972,12 +975,6 @@ cdregister(struct cam_periph *periph, void *arg) cdregisterexit: - /* - * Refcount and block open attempts until we are setup - * Can't block - */ - (void)cam_periph_hold(periph, PRIBIO); - if ((softc->flags & CD_FLAG_CHANGER) == 0) xpt_schedule(periph, CAM_PRIORITY_DEV); else From e43496e5e6fcdbdf9c536aafcb9347567187f93c Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sun, 26 Jun 2011 09:32:46 +0000 Subject: [PATCH 40/49] Replace tab with 8 spaces, bringing it in line with the rest of the file. --- etc/regdomain.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/regdomain.xml b/etc/regdomain.xml index 5e98deab00e..d86df22c426 100644 --- a/etc/regdomain.xml +++ b/etc/regdomain.xml @@ -341,9 +341,9 @@ 0x30 - - 30 - IEEE80211_CHAN_B + + 30 + IEEE80211_CHAN_B From 281f0ca8e71ac46779eb1cfb66342b88f705833f Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Sun, 26 Jun 2011 10:07:48 +0000 Subject: [PATCH 41/49] Remove duplicate header includes --- sys/arm/at91/at91_machdep.c | 1 - sys/arm/sa11x0/assabet_machdep.c | 1 - sys/arm/sa11x0/sa11x0.c | 2 -- sys/mips/atheros/ar71xx_chip.c | 8 +++----- sys/mips/atheros/ar71xx_machdep.c | 8 +++----- sys/mips/atheros/ar71xx_ohci.c | 2 -- sys/mips/atheros/ar71xx_setup.c | 8 +++----- sys/mips/atheros/ar724x_chip.c | 8 +++----- sys/mips/atheros/ar91xx_chip.c | 8 +++----- sys/mips/mips/genassym.c | 1 - sys/mips/mips/trap.c | 4 ---- sys/mips/rmi/dev/xlr/rge.c | 2 -- sys/mips/rmi/fmn.c | 1 - sys/mips/rmi/iodi.c | 1 - sys/mips/sentry5/s5_machdep.c | 7 ++----- sys/mips/sibyte/sb_machdep.c | 2 -- 16 files changed, 17 insertions(+), 47 deletions(-) diff --git a/sys/arm/at91/at91_machdep.c b/sys/arm/at91/at91_machdep.c index 717e7c229c3..a7eb5f6f81e 100644 --- a/sys/arm/at91/at91_machdep.c +++ b/sys/arm/at91/at91_machdep.c @@ -91,7 +91,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ #define KERNEL_PT_KERN 1 diff --git a/sys/arm/sa11x0/assabet_machdep.c b/sys/arm/sa11x0/assabet_machdep.c index 87788f0999e..61c50564bf4 100644 --- a/sys/arm/sa11x0/assabet_machdep.c +++ b/sys/arm/sa11x0/assabet_machdep.c @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include diff --git a/sys/arm/sa11x0/sa11x0.c b/sys/arm/sa11x0/sa11x0.c index bfffe6a6df6..7b83f95c9d4 100644 --- a/sys/arm/sa11x0/sa11x0.c +++ b/sys/arm/sa11x0/sa11x0.c @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -74,7 +73,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include extern void sa11x0_activateirqs(void); diff --git a/sys/mips/atheros/ar71xx_chip.c b/sys/mips/atheros/ar71xx_chip.c index 4a489a1abed..7f9792f51d3 100644 --- a/sys/mips/atheros/ar71xx_chip.c +++ b/sys/mips/atheros/ar71xx_chip.c @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -50,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -61,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include +#include + /* XXX these should replace the current definitions in ar71xxreg.h */ /* XXX perhaps an ar71xx_chip.h header file? */ #define AR71XX_PLL_REG_CPU_CONFIG AR71XX_PLL_CPU_BASE + 0x00 diff --git a/sys/mips/atheros/ar71xx_machdep.c b/sys/mips/atheros/ar71xx_machdep.c index 60e28a43631..17899944acc 100644 --- a/sys/mips/atheros/ar71xx_machdep.c +++ b/sys/mips/atheros/ar71xx_machdep.c @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -50,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -60,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + extern char edata[], end[]; uint32_t ar711_base_mac[ETHER_ADDR_LEN]; diff --git a/sys/mips/atheros/ar71xx_ohci.c b/sys/mips/atheros/ar71xx_ohci.c index acccd850a1c..bee353ea38d 100644 --- a/sys/mips/atheros/ar71xx_ohci.c +++ b/sys/mips/atheros/ar71xx_ohci.c @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static int ar71xx_ohci_attach(device_t dev); static int ar71xx_ohci_detach(device_t dev); static int ar71xx_ohci_probe(device_t dev); diff --git a/sys/mips/atheros/ar71xx_setup.c b/sys/mips/atheros/ar71xx_setup.c index 0720d52ff9d..ce600e48e24 100644 --- a/sys/mips/atheros/ar71xx_setup.c +++ b/sys/mips/atheros/ar71xx_setup.c @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -50,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -64,6 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #define AR71XX_SYS_TYPE_LEN 128 static char ar71xx_sys_type[AR71XX_SYS_TYPE_LEN]; diff --git a/sys/mips/atheros/ar724x_chip.c b/sys/mips/atheros/ar724x_chip.c index 75c5b38bded..edd1a9ad28d 100644 --- a/sys/mips/atheros/ar724x_chip.c +++ b/sys/mips/atheros/ar724x_chip.c @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -50,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -62,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + static void ar724x_chip_detect_mem_size(void) { diff --git a/sys/mips/atheros/ar91xx_chip.c b/sys/mips/atheros/ar91xx_chip.c index 9cf60bc8698..6761e89f057 100644 --- a/sys/mips/atheros/ar91xx_chip.c +++ b/sys/mips/atheros/ar91xx_chip.c @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -50,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -61,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + static void ar91xx_chip_detect_mem_size(void) { diff --git a/sys/mips/mips/genassym.c b/sys/mips/mips/genassym.c index fd168bc32b7..2cb046d2c48 100644 --- a/sys/mips/mips/genassym.c +++ b/sys/mips/mips/genassym.c @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include diff --git a/sys/mips/mips/trap.c b/sys/mips/mips/trap.c index 35b8030aeb7..c800e715254 100644 --- a/sys/mips/mips/trap.c +++ b/sys/mips/mips/trap.c @@ -91,10 +91,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#include -#include - - #ifdef TRAP_DEBUG int trap_debug = 0; SYSCTL_INT(_machdep, OID_AUTO, trap_debug, CTLFLAG_RW, diff --git a/sys/mips/rmi/dev/xlr/rge.c b/sys/mips/rmi/dev/xlr/rge.c index 274a93489f7..1af97c2fbd9 100644 --- a/sys/mips/rmi/dev/xlr/rge.c +++ b/sys/mips/rmi/dev/xlr/rge.c @@ -78,8 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include diff --git a/sys/mips/rmi/fmn.c b/sys/mips/rmi/fmn.c index f7686cba761..9a6c4867078 100644 --- a/sys/mips/rmi/fmn.c +++ b/sys/mips/rmi/fmn.c @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include diff --git a/sys/mips/rmi/iodi.c b/sys/mips/rmi/iodi.c index 3c09984a749..8952fcdaaf3 100644 --- a/sys/mips/rmi/iodi.c +++ b/sys/mips/rmi/iodi.c @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include diff --git a/sys/mips/sentry5/s5_machdep.c b/sys/mips/sentry5/s5_machdep.c index 4491b93aa9d..134f05b9ebe 100644 --- a/sys/mips/sentry5/s5_machdep.c +++ b/sys/mips/sentry5/s5_machdep.c @@ -27,11 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include - -#include - #include "opt_ddb.h" #include @@ -75,6 +70,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #ifdef CFE #include #endif diff --git a/sys/mips/sibyte/sb_machdep.c b/sys/mips/sibyte/sb_machdep.c index ac304517c6e..b6d395fccf7 100644 --- a/sys/mips/sibyte/sb_machdep.c +++ b/sys/mips/sibyte/sb_machdep.c @@ -27,8 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include - #include "opt_ddb.h" #include "opt_kdb.h" From 1b8805b8aa4509248e22ebd407d18893bfc4face Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sun, 26 Jun 2011 10:32:09 +0000 Subject: [PATCH 42/49] Add a couple more frequency ranges to the FCC3 (FCC + DFS) regulatory domain. The frequency range 5490MHz -> 5710MHz was opened up sometime in 2009, but regdomain.xml wasn't updated. FCC reference: (Section 15.407): http://louise.hallikainen.org/FCC/FccRules/2009/15/407/ The hole between 5600-5650MHz is due to a request from Airports using a weather radar system which also utilises this range. The GIT commit explaining this hole in more detail can be found here: http://git.kernel.org/?p=linux/kernel/git/linville/wireless-regdb.git;a=commit;h=fcbf9225d56e82d9a4e506187d42285e76d81523 --- etc/mtree/BSD.include.dist | 2 ++ etc/regdomain.xml | 60 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index f960c5243e2..013551bd7e6 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -229,6 +229,8 @@ .. kadm5 .. + lib80211 + .. libmilter .. lwres diff --git a/etc/regdomain.xml b/etc/regdomain.xml index d86df22c426..677c749d13f 100644 --- a/etc/regdomain.xml +++ b/etc/regdomain.xml @@ -143,6 +143,18 @@ IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS + + + 20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + 23 @@ -195,6 +207,34 @@ IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS + + + 20 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + 23 @@ -1644,6 +1684,16 @@ 40 20 IEEE80211_CHAN_A + + 5500 5580 + 20 20 + IEEE80211_CHAN_A + + + 5500 5580 + 40 20 + IEEE80211_CHAN_A + 5500 5620 20 20 @@ -1664,6 +1714,16 @@ 20 20 IEEE80211_CHAN_A + + 5660 5700 + 20 20 + IEEE80211_CHAN_A + + + 5660 5700 + 40 20 + IEEE80211_CHAN_A + 5725 5825 40 20 From 3cef2d90e36ea0cb5e87c82d24f9aeae9b1a9a88 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sun, 26 Jun 2011 10:34:01 +0000 Subject: [PATCH 43/49] I think 23dBm is the correct value to use here. CRDA uses 20dBm + 3dB max antenna gain; I believe net80211 doesn't take antenna gain into account and leaves it up to the driver to enforce. (ath_hal(4) certainly tries to do this.) --- etc/regdomain.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/etc/regdomain.xml b/etc/regdomain.xml index 677c749d13f..9b406055f5a 100644 --- a/etc/regdomain.xml +++ b/etc/regdomain.xml @@ -139,19 +139,19 @@ - 20 + 23 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS @@ -195,42 +195,42 @@ - 20 + 23 IEEE80211_CHAN_HT20 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_HT40 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_HT20 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_HT40 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_HT20 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS - 20 + 23 IEEE80211_CHAN_HT40 IEEE80211_CHAN_PASSIVE IEEE80211_CHAN_DFS From 16169457f0dffe23b33823a980e038a7196d07e7 Mon Sep 17 00:00:00 2001 From: Gavin Atkinson Date: Sun, 26 Jun 2011 11:37:24 +0000 Subject: [PATCH 44/49] The SMCWUSBG is a zyd(4) device, not an uath(4) device. Remove from the latter. It appears that the addition to uath(4) came in through PR kern/135009, which had tested another device, the SMCWUSBTG2, successfully with uath(4) and included the SMCWUSBG as it "has the same chipset". I can find no other evidence that these two do actually share the same chipset. Moreover, Linux treats the SMCWUSBG as a zyd(4) device also. This reverts r223537. Discussed with: hselasky, kevlo MFC after: 1 week --- etc/devd/uath.conf | 4 ++-- sys/dev/usb/wlan/if_uath.c | 1 - sys/dev/usb/wlan/if_zyd.c | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/devd/uath.conf b/etc/devd/uath.conf index dc4019cefbc..9f0cb939050 100644 --- a/etc/devd/uath.conf +++ b/etc/devd/uath.conf @@ -3,13 +3,13 @@ # Atheros USB wireless network device specific devd events # Accton -# SMCWUSB-G and SMCWUSBT-G2 +# SMCWUSBT-G2 notify 100 { match "system" "USB"; match "subsystem" "DEVICE"; match "type" "ATTACH"; match "vendor" "0x083a"; - match "product" "(0x4505|0x4507)"; + match "product" "0x4507"; action "/usr/sbin/uathload -d /dev/$cdev"; }; diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c index baff5dea5b6..328dc4f282b 100644 --- a/sys/dev/usb/wlan/if_uath.c +++ b/sys/dev/usb/wlan/if_uath.c @@ -169,7 +169,6 @@ enum { /* recognized device vendors/products */ static const STRUCT_USB_HOST_ID uath_devs[] = { #define UATH_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } - UATH_DEV(ACCTON, SMCWUSBG), UATH_DEV(ACCTON, SMCWUSBTG2), UATH_DEV(ATHEROS, AR5523), UATH_DEV(ATHEROS2, AR5523_1), diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c index 4221c3441ea..f8d905ec984 100644 --- a/sys/dev/usb/wlan/if_zyd.c +++ b/sys/dev/usb/wlan/if_zyd.c @@ -229,6 +229,7 @@ static const STRUCT_USB_HOST_ID zyd_devs[] = { ZYD_ZD1211_DEV(ZYXEL, ZYAIRG220), ZYD_ZD1211_DEV(ZYXEL, G200V2), /* ZYD_ZD1211B */ + ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG_NF), ZYD_ZD1211B_DEV(ACCTON, SMCWUSBG), ZYD_ZD1211B_DEV(ACCTON, ZD1211B), ZYD_ZD1211B_DEV(ASUS, A9T_WIFI), From 10dc8de41b4d684154d4ce4a4191575582056d89 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sun, 26 Jun 2011 13:43:15 +0000 Subject: [PATCH 45/49] Add ATH_ENABLE_DFS which enables the DFS flag so the DFS code can be tested. This doesn't at all actually do radar detection! It's just so developers who wish to test the net80211 DFS code can easily do so. Without this flag, the DFS channels are never marked DFS and thus the DFS stuff doesn't run. --- sys/conf/options | 3 ++- sys/dev/ath/if_ath.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/conf/options b/sys/conf/options index ee696a8674d..1ce30b17260 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -773,7 +773,8 @@ ATH_TXBUF opt_ath.h ATH_RXBUF opt_ath.h ATH_DIAGAPI opt_ath.h ATH_TX99_DIAG opt_ath.h -ATH_ENABLE_11N opt_ah.h +ATH_ENABLE_11N opt_ath.h +ATH_ENABLE_DFS opt_ath.h # options for the Atheros hal AH_SUPPORT_AR5416 opt_ah.h diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index f3afc70b201..1bca5e47f52 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -528,6 +528,9 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) | IEEE80211_C_WPA /* capable of WPA1+WPA2 */ | IEEE80211_C_BGSCAN /* capable of bg scanning */ | IEEE80211_C_TXFRAG /* handle tx frags */ +#ifdef ATH_ENABLE_DFS + | IEEE80211_C_DFS /* Enable DFS radar detection */ +#endif ; /* * Query the hal to figure out h/w crypto support. From 2fd9aabb1b4c171b783a700d95f69ab946791178 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sun, 26 Jun 2011 13:53:24 +0000 Subject: [PATCH 46/49] Fix beacon transmission after a channel set. The DFS code was tickling the channel set directly whilst going through the state RUN -> CSA -> RUN. This only changed the channel; it didn't go via ath_reset(). However in this driver, a channel change always causes a chip reset, which resets the beacon timer configuration and interrupt setup. This meant that data would go out but as the beacon timers never fired, beacons would never be queued. The confusing part is that sometimes the state transition was RUN -> SCAN -> CAC -> RUN (with CSA being in there sometimes); going via SCAN would clear sc_beacons and thus the transition to RUN would reprogram beacon transmission. In case someone tries debugging why suspending a device currently beaconing (versus just RX'ing beacons which is what occurs in STA mode), add a silly comment which should hopefully land them at this commit message. The call to ath_hal_reset() will be clearing the beacon config and it may not be always reset. --- sys/dev/ath/if_ath.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 1bca5e47f52..9c534c8e2d4 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -1290,6 +1290,8 @@ ath_resume(struct ath_softc *sc) HAL_GPIO_MUX_MAC_NETWORK_LED); ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); } + + /* XXX beacons ? */ } void @@ -1592,6 +1594,12 @@ ath_init(void *arg) sc->sc_lastani = 0; sc->sc_lastshortcal = 0; sc->sc_doresetcal = AH_FALSE; + /* + * Beacon timers were cleared here; give ath_newstate() + * a hint that the beacon timers should be poked when + * things transition to the RUN state. + */ + sc->sc_beacons = 0; /* * Setup the hardware after reset: the key cache @@ -4467,6 +4475,19 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan) */ ath_chan_change(sc, chan); + /* + * Reset clears the beacon timers; reset them + * here if needed. + */ + if (sc->sc_beacons) { /* restart beacons */ +#ifdef IEEE80211_SUPPORT_TDMA + if (sc->sc_tdma) + ath_tdma_config(sc, NULL); + else +#endif + ath_beacon_config(sc, NULL); + } + /* * Re-enable interrupts. */ From 3b34e0a0971e5dfb6393b25d5b10ca1baa3d55fd Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sun, 26 Jun 2011 14:29:49 +0000 Subject: [PATCH 47/49] .. this wasn't supposed to be committed! sorry. --- etc/mtree/BSD.include.dist | 2 -- 1 file changed, 2 deletions(-) diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index 013551bd7e6..f960c5243e2 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -229,8 +229,6 @@ .. kadm5 .. - lib80211 - .. libmilter .. lwres From 1b17fa33dc3c646e9d3209f621a6b4daf92a1147 Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Sun, 26 Jun 2011 15:08:14 +0000 Subject: [PATCH 48/49] Revert r223479. It is unnecessary and served only to slightly ameliorate some manifestations of the bug actually fixed in r223485. --- sys/powerpc/aim/trap_subr32.S | 2 -- sys/powerpc/aim/trap_subr64.S | 2 -- 2 files changed, 4 deletions(-) diff --git a/sys/powerpc/aim/trap_subr32.S b/sys/powerpc/aim/trap_subr32.S index f00020b2146..172150e58e4 100644 --- a/sys/powerpc/aim/trap_subr32.S +++ b/sys/powerpc/aim/trap_subr32.S @@ -754,8 +754,6 @@ k_trap: /* Call C interrupt dispatcher: */ trapagain: addi %r3,%r1,8 - addi %r4,%r1,-4 /* Clear any existing reservations */ - stwcx. %r3,0,%r4 bl CNAME(powerpc_interrupt) .globl CNAME(trapexit) /* backtrace code sentinel */ CNAME(trapexit): diff --git a/sys/powerpc/aim/trap_subr64.S b/sys/powerpc/aim/trap_subr64.S index 1ec8507aef5..111d5160c76 100644 --- a/sys/powerpc/aim/trap_subr64.S +++ b/sys/powerpc/aim/trap_subr64.S @@ -514,8 +514,6 @@ trapagain: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) addi %r3,%r1,48 - addi %r4,%r1,-8 /* Clear any existing reservations */ - stdcx. %r3,0,%r4 bl CNAME(powerpc_interrupt) nop From 9134df8b6f936328aa7a2daed7af14905c8b69a1 Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Sun, 26 Jun 2011 16:11:36 +0000 Subject: [PATCH 49/49] Add better error handling for RTAS calls. These can potentially cause machine checks (e.g. invalid PCI configuration cycles), but these can be caught and recovered from. This change also the RTAS PCI driver to work without modification as a replacement for the Grackle driver on Grackle-based Powermacs. --- sys/powerpc/ofw/rtas.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/ofw/rtas.c b/sys/powerpc/ofw/rtas.c index 59692c9b953..66ce12fc0d2 100644 --- a/sys/powerpc/ofw/rtas.c +++ b/sys/powerpc/ofw/rtas.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -39,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -60,6 +62,8 @@ int rtascall(vm_offset_t callbuffer, uintptr_t rtas_privdat); extern uintptr_t rtas_entry; extern register_t rtasmsr; +int setfault(faultbuf); /* defined in locore.S */ + /* * After the VM is up, allocate RTAS memory and instantiate it */ @@ -188,6 +192,7 @@ int rtas_call_method(cell_t token, int nargs, int nreturns, ...) { vm_offset_t argsptr; + faultbuf env; va_list ap; struct { cell_t token; @@ -213,7 +218,19 @@ rtas_call_method(cell_t token, int nargs, int nreturns, ...) args.args_n_results[n] = va_arg(ap, cell_t); argsptr = rtas_real_map(&args, sizeof(args)); - result = rtascall(argsptr, rtas_private_data); + + /* Get rid of any stale machine checks that have been waiting. */ + __asm __volatile ("sync; isync"); + if (!setfault(env)) { + __asm __volatile ("sync"); + result = rtascall(argsptr, rtas_private_data); + __asm __volatile ("sync; isync"); + } else { + result = RTAS_HW_ERROR; + } + curthread->td_pcb->pcb_onfault = 0; + __asm __volatile ("sync"); + rtas_real_unmap(argsptr, &args, sizeof(args)); mtx_unlock(&rtas_mtx);