Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/usb_device.c
Show First 20 Lines • Show All 2,025 Lines • ▼ Show 20 Lines | repeat_set_config: | ||||
if (!config_quirk && config_index + 1 < udev->ddesc.bNumConfigurations) { | if (!config_quirk && config_index + 1 < udev->ddesc.bNumConfigurations) { | ||||
if ((udev->cdesc->bNumInterface < 2) && | if ((udev->cdesc->bNumInterface < 2) && | ||||
usbd_get_no_descriptors(udev->cdesc, UDESC_ENDPOINT) == 0) { | usbd_get_no_descriptors(udev->cdesc, UDESC_ENDPOINT) == 0) { | ||||
DPRINTFN(0, "Found no endpoints, trying next config\n"); | DPRINTFN(0, "Found no endpoints, trying next config\n"); | ||||
config_index++; | config_index++; | ||||
goto repeat_set_config; | goto repeat_set_config; | ||||
} | } | ||||
#if USB_HAVE_MSCTEST | #if USB_HAVE_MSCTEST | ||||
if (config_index == 0) { | if (config_index == 0 && | ||||
usb_test_quirk(&uaa, UQ_MSC_NO_INQUIRY) == 0) { | |||||
/* | /* | ||||
* Try to figure out if we have an | * Try to figure out if we have an | ||||
* auto-install disk there: | * auto-install disk there: | ||||
*/ | */ | ||||
if (usb_iface_is_cdrom(udev, 0)) { | if (usb_iface_is_cdrom(udev, 0)) { | ||||
DPRINTFN(0, "Found possible auto-install " | DPRINTFN(0, "Found possible auto-install " | ||||
"disk (trying next config)\n"); | "disk (trying next config)\n"); | ||||
config_index++; | config_index++; | ||||
goto repeat_set_config; | goto repeat_set_config; | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
} | } | ||||
#if USB_HAVE_MSCTEST | #if USB_HAVE_MSCTEST | ||||
if (set_config_failed == 0 && config_index == 0 && | 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_START_STOP) == 0 && | ||||
usb_test_quirk(&uaa, UQ_MSC_NO_PREVENT_ALLOW) == 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_SYNC_CACHE) == 0 && | ||||
usb_test_quirk(&uaa, UQ_MSC_NO_TEST_UNIT_READY) == 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_GETMAXLUN) == 0 && | ||||
usb_test_quirk(&uaa, UQ_MSC_NO_INQUIRY) == 0) { | |||||
/* | /* | ||||
* Try to figure out if there are any MSC quirks we | * Try to figure out if there are any MSC quirks we | ||||
* should apply automatically: | * should apply automatically: | ||||
*/ | */ | ||||
err = usb_msc_auto_quirk(udev, 0, &uaa); | err = usb_msc_auto_quirk(udev, 0, &uaa); | ||||
if (err != 0) { | if (err != 0) { | ||||
set_config_failed = 1; | set_config_failed = 1; | ||||
▲ Show 20 Lines • Show All 1,033 Lines • Show Last 20 Lines |