Add a UQ_OPEN_CLEARSTALL quirk for devices that need a clear-stall

operation when a pipe is opened, and add an entry for the ST Micro
biometric CPU.

Submitted by:	Fredrik Lindberg
MFC after:	1 week
This commit is contained in:
Ian Dowse 2006-02-19 14:48:02 +00:00
parent 9789208431
commit 199a2380fe
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=155840
4 changed files with 16 additions and 0 deletions

View File

@ -79,6 +79,8 @@ Static const struct usbd_quirk_entry {
{ USB_VENDOR_TELEX, USB_PRODUCT_TELEX_MIC1, 0x009, { UQ_AU_NO_FRAC }},
{ USB_VENDOR_SILICONPORTALS, USB_PRODUCT_SILICONPORTALS_YAPPHONE,
0x100, { UQ_AU_INP_ASYNC }},
{ USB_VENDOR_STMICRO, USB_PRODUCT_STMICRO_BIOCPU,
ANY, { UQ_OPEN_CLEARSTALL }},
/* XXX These should have a revision number, but I don't know what they are. */
{ USB_VENDOR_HP, USB_PRODUCT_HP_895C, ANY, { UQ_BROKEN_BIDIR }},
{ USB_VENDOR_HP, USB_PRODUCT_HP_880C, ANY, { UQ_BROKEN_BIDIR }},

View File

@ -54,6 +54,7 @@ struct usbd_quirks {
#define UQ_AU_INP_ASYNC 0x0800 /* input is async despite claim of adaptive */
#define UQ_ASSUME_CM_OVER_DATA 0x1000 /* modem device breaks on cm over data */
#define UQ_BROKEN_BIDIR 0x2000 /* printer has broken bidir mode */
#define UQ_OPEN_CLEARSTALL 0x4000 /* device needs clear endpoint stall */
#define UQ_HID_IGNORE 0x8000 /* device should be ignored by hid class */
};

View File

@ -780,6 +780,18 @@ usbd_setup_pipe(usbd_device_handle dev, usbd_interface_handle iface,
return (err);
}
if (dev->quirks->uq_flags & UQ_OPEN_CLEARSTALL) {
/* Clear any stall and make sure DATA0 toggle will be used next. */
if (UE_GET_ADDR(ep->edesc->bEndpointAddress) != USB_CONTROL_ENDPOINT) {
err = usbd_clear_endpoint_stall(p);
if (err && err != USBD_STALLED && err != USBD_TIMEOUT) {
printf("usbd_setup_pipe: failed to start "
"endpoint, %s\n", usbd_errstr(err));
return (err);
}
}
}
*pipe = p;
return (USBD_NORMAL_COMPLETION);
}

View File

@ -1529,6 +1529,7 @@ product SOURCENEXT KEIKAI8 0x039f KeikaiDenwa 8
product SOURCENEXT KEIKAI8_CHG 0x012e KeikaiDenwa 8 with charger
/* STMicroelectronics products */
product STMICRO BIOCPU 0x2016 Biometric Coprocessor
product STMICRO COMMUNICATOR 0x7554 USB Communicator
/* STSN products */