diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-26 17:52:06 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-26 17:52:06 +0000 |
commit | 87f624cb9d7f647560fa4249a8d22d04846c0748 (patch) | |
tree | c9cbdd3d57c383e3aa2d73af2e8708cba59e0ed9 /nuttx/drivers/usbhost | |
parent | bb7c3ee83d66d1f9cc5d2dc984b824d4db18e56c (diff) | |
download | nuttx-87f624cb9d7f647560fa4249a8d22d04846c0748.tar.gz nuttx-87f624cb9d7f647560fa4249a8d22d04846c0748.tar.bz2 nuttx-87f624cb9d7f647560fa4249a8d22d04846c0748.zip |
RTL bug fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3421 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/usbhost')
-rwxr-xr-x | nuttx/drivers/usbhost/usbhost_enumerate.c | 14 | ||||
-rw-r--r-- | nuttx/drivers/usbhost/usbhost_findclass.c | 9 |
2 files changed, 12 insertions, 11 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_enumerate.c b/nuttx/drivers/usbhost/usbhost_enumerate.c index 4c8c9c8c3..1c3a827bf 100755 --- a/nuttx/drivers/usbhost/usbhost_enumerate.c +++ b/nuttx/drivers/usbhost/usbhost_enumerate.c @@ -129,18 +129,19 @@ static inline int usbhost_devdesc(const struct usb_devdesc_s *devdesc, memset(id, 0, sizeof(struct usbhost_id_s)); - /* Pick off the ID info */ + /* Pick off the class ID info */ id->base = devdesc->class; id->subclass = devdesc->subclass; id->proto = devdesc->protocol; - uvdbg("class:%d subclass:%d protocol:%d\n", id->base, id->subclass, id->proto); - /* Yes, then pick off the VID and PID as well */ + /* Pick off the VID and PID as well (for vendor specfic devices) */ id->vid = usbhost_getle16(devdesc->vendor); id->pid = usbhost_getle16(devdesc->product); - uvdbg("vid:%d pid:%d\n", id->vid, id->pid); + + uvdbg("class:%d subclass:%04x protocol:%04x vid:%d pid:%d\n", + id->base, id->subclass, id->proto, id->vid, id->pid); return OK; } @@ -188,9 +189,8 @@ static inline int usbhost_configdesc(const uint8_t *configdesc, int cfglen, if (ifdesc->type == USB_DESC_TYPE_INTERFACE) { /* Yes, extract the class information from the interface descriptor. - * (We are going to need to do more than this here in the future: - * ID information might lie elsewhere and we will need the VID and - * PID as well). + * Typically these values are zero meaning that the "real" ID + * information resides in the device descriptor. */ DEBUGASSERT(remaining >= sizeof(struct usb_ifdesc_s)); diff --git a/nuttx/drivers/usbhost/usbhost_findclass.c b/nuttx/drivers/usbhost/usbhost_findclass.c index d4438d814..f08aff580 100644 --- a/nuttx/drivers/usbhost/usbhost_findclass.c +++ b/nuttx/drivers/usbhost/usbhost_findclass.c @@ -87,8 +87,9 @@ static bool usbhost_idmatch(const struct usbhost_id_s *classid, const struct usbhost_id_s *devid) { - uvdbg("Compare to class:%d subclass:%d protocol:%d\n", - classid->base, classid->subclass, classid->proto); + uvdbg("Compare to class:%d subclass:%d protocol:%d vid:%04x pid:%04x\n", + classid->base, classid->subclass, classid->proto, + classid->vid, classid->pid); /* The base class ID, subclass and protocol have to match up in any event */ @@ -156,8 +157,8 @@ const struct usbhost_registry_s *usbhost_findclass(const struct usbhost_id_s *id int ndx; DEBUGASSERT(id); - uvdbg("Looking for class:%d subclass:%d protocol:%d\n", - id->base, id->subclass, id->proto); + uvdbg("Looking for class:%d subclass:%d protocol:%d vid:%04x pid:%04x\n", + id->base, id->subclass, id->proto, id->vid, id->pid); /* g_classregistry is a singly-linkedlist of class ID information added by * calls to usbhost_registerclass(). Since this list is accessed from USB |