USB umass: add quirk to not probe

Some USB WLAN devices have "on-board" storage showing up as umass
and making the root mount wait for a very long time.
The WLAN drivers know how to deal with that an issue an eject
command later when attaching themselves.
Introduce a quirk to not probe these devices as umass and avoid
hangs and confusion altogether.

Reviewed by:	hselasky, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27434
This commit is contained in:
Bjoern A. Zeeb 2020-12-01 18:24:06 +00:00
parent 4d16f94191
commit 9d2d04462d
3 changed files with 9 additions and 0 deletions

View file

@ -539,6 +539,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = {
USB_QUIRK(QUALCOMMINC, ZTE_MF730M, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN,
UQ_MSC_NO_INQUIRY, UQ_CFG_INDEX_0),
USB_QUIRK(SMART2, G2MEMKEY, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY),
USB_QUIRK(RALINK, RT_STOR, 0x0001, 0x0001, UQ_MSC_IGNORE),
/* Non-standard USB MIDI devices */
USB_QUIRK(ROLAND, UM1, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
USB_QUIRK(ROLAND, SC8850, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS),
@ -642,6 +643,7 @@ static const char *usb_quirk_str[USB_QUIRK_MAX] = {
[UQ_MSC_FORCE_PROTO_ATAPI] = "UQ_MSC_FORCE_PROTO_ATAPI",
[UQ_MSC_FORCE_PROTO_UFI] = "UQ_MSC_FORCE_PROTO_UFI",
[UQ_MSC_FORCE_PROTO_RBC] = "UQ_MSC_FORCE_PROTO_RBC",
[UQ_MSC_IGNORE] = "UQ_MSC_IGNORE",
[UQ_MSC_EJECT_HUAWEI] = "UQ_MSC_EJECT_HUAWEI",
[UQ_MSC_EJECT_SIERRA] = "UQ_MSC_EJECT_SIERRA",
[UQ_MSC_EJECT_SCSIEJECT] = "UQ_MSC_EJECT_SCSIEJECT",

View file

@ -93,6 +93,7 @@ enum {
UQ_MSC_FORCE_PROTO_ATAPI, /* force ATAPI command protocol */
UQ_MSC_FORCE_PROTO_UFI, /* force UFI command protocol */
UQ_MSC_FORCE_PROTO_RBC, /* force RBC command protocol */
UQ_MSC_IGNORE, /* device should be ignored by umass */
/* Ejection of mass storage (driver disk) */
UQ_MSC_EJECT_HUAWEI, /* ejects after Huawei USB command */

View file

@ -784,6 +784,12 @@ umass_probe_proto(device_t dev, struct usb_attach_arg *uaa)
memset(&ret, 0, sizeof(ret));
ret.error = BUS_PROBE_GENERIC;
/* Check if we should deny probing. */
if (usb_test_quirk(uaa, UQ_MSC_IGNORE)) {
ret.error = ENXIO;
goto done;
}
/* Search for protocol enforcement */
if (usb_test_quirk(uaa, UQ_MSC_FORCE_WIRE_BBB)) {