mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-01 02:03:31 +00:00
Make umodem more tolerant for devices which modem descriptors are misplaced.
Reported by: Erick Wales Submitted by: Hans Petter Selasky
This commit is contained in:
parent
b60541a9ec
commit
3e889e246c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=203903
@ -312,11 +312,16 @@ umodem_attach(device_t dev)
|
||||
0 - 1, UDESCSUB_CDC_UNION, 0 - 1);
|
||||
|
||||
if ((cud == NULL) || (cud->bLength < sizeof(*cud))) {
|
||||
device_printf(dev, "no CM or union descriptor\n");
|
||||
goto detach;
|
||||
device_printf(dev, "Missing descriptor. "
|
||||
"Assuming data interface is next.\n");
|
||||
if (sc->sc_ctrl_iface_no == 0xFF)
|
||||
goto detach;
|
||||
else
|
||||
sc->sc_data_iface_no =
|
||||
sc->sc_ctrl_iface_no + 1;
|
||||
} else {
|
||||
sc->sc_data_iface_no = cud->bSlaveInterface[0];
|
||||
}
|
||||
|
||||
sc->sc_data_iface_no = cud->bSlaveInterface[0];
|
||||
} else {
|
||||
sc->sc_data_iface_no = cmd->bDataInterface;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user