diff options
Diffstat (limited to 'sys/dev/usb/usb_device.c')
-rw-r--r-- | sys/dev/usb/usb_device.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index c4fe3b4a6ab6..60c2d6745b3f 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -855,6 +855,7 @@ usb_config_parse(struct usb_device *udev, uint8_t iface_index, uint8_t cmd) if (ep->refcount_alloc != 0) return (USB_ERR_IN_USE); } + ep++; } } @@ -1359,7 +1360,7 @@ usb_probe_and_attach_sub(struct usb_device *udev, } if (uaa->temp_dev == NULL) { /* create a new child */ - uaa->temp_dev = device_add_child(udev->parent_dev, NULL, -1); + uaa->temp_dev = device_add_child(udev->parent_dev, NULL, DEVICE_UNIT_ANY); if (uaa->temp_dev == NULL) { device_printf(udev->parent_dev, "Device creation failed\n"); @@ -1880,7 +1881,7 @@ usb_alloc_device(device_t parent_dev, struct usb_bus *bus, snprintf(udev->ugen_name, sizeof(udev->ugen_name), USB_GENERIC_NAME "%u.%u", device_get_unit(bus->bdev), device_index); - LIST_INIT(&udev->pd_list); + SLIST_INIT(&udev->pd_list); /* Create the control endpoint device */ udev->ctrl_dev = usb_make_dev(udev, NULL, 0, 0, @@ -2060,14 +2061,15 @@ repeat_set_config: } #endif } -#if USB_HAVE_MSCTEST +#if USB_HAVE_MSCTEST_AUTOQUIRK if (set_config_failed == 0 && config_index == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_START_STOP) == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_PREVENT_ALLOW) == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_TEST_UNIT_READY) == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_GETMAXLUN) == 0 && - usb_test_quirk(&uaa, UQ_MSC_NO_INQUIRY) == 0) { + usb_test_quirk(&uaa, UQ_MSC_NO_INQUIRY) == 0 && + usb_test_quirk(&uaa, UQ_MSC_IGNORE) == 0) { /* * Try to figure out if there are any MSC quirks we * should apply automatically: @@ -2190,7 +2192,7 @@ usb_destroy_dev(struct usb_fs_privdata *pd) delist_dev(pd->cdev); USB_BUS_LOCK(bus); - LIST_INSERT_HEAD(&bus->pd_cleanup_list, pd, pd_next); + SLIST_INSERT_HEAD(&bus->pd_cleanup_list, pd, pd_next); /* get cleanup going */ usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), &bus->cleanup_msg[0], &bus->cleanup_msg[1]); @@ -2207,7 +2209,7 @@ usb_cdev_create(struct usb_device *udev) int inmode, outmode, inmask, outmask, mode; uint8_t ep; - KASSERT(LIST_FIRST(&udev->pd_list) == NULL, ("stale cdev entries")); + KASSERT(SLIST_FIRST(&udev->pd_list) == NULL, ("stale cdev entries")); DPRINTFN(2, "Creating device nodes\n"); @@ -2254,7 +2256,7 @@ usb_cdev_create(struct usb_device *udev) mode, UID_ROOT, GID_OPERATOR, 0600); if (pd != NULL) - LIST_INSERT_HEAD(&udev->pd_list, pd, pd_next); + SLIST_INSERT_HEAD(&udev->pd_list, pd, pd_next); } } @@ -2265,10 +2267,10 @@ usb_cdev_free(struct usb_device *udev) DPRINTFN(2, "Freeing device nodes\n"); - while ((pd = LIST_FIRST(&udev->pd_list)) != NULL) { + while ((pd = SLIST_FIRST(&udev->pd_list)) != NULL) { KASSERT(pd->cdev->si_drv1 == pd, ("privdata corrupt")); - LIST_REMOVE(pd, pd_next); + SLIST_REMOVE(&udev->pd_list, pd, usb_fs_privdata, pd_next); usb_destroy_dev(pd); } @@ -2358,7 +2360,7 @@ usb_free_device(struct usb_device *udev, uint8_t flag) mtx_destroy(&udev->device_mtx); #if USB_HAVE_UGEN - KASSERT(LIST_FIRST(&udev->pd_list) == NULL, ("leaked cdev entries")); + KASSERT(SLIST_FIRST(&udev->pd_list) == NULL, ("leaked cdev entries")); #endif /* Uninitialise device */ |