USB host composite: Using wrong interface number from interface descriptor.

This commit is contained in:
Gregory Nutt 2016-08-31 13:29:38 -06:00
parent ebe829c4b9
commit e958c32e4d
1 changed files with 5 additions and 5 deletions

View File

@ -313,7 +313,7 @@ static int usbhost_copyinterface(uint8_t ifno, FAR const uint8_t *configdesc,
/* Is this an interface descriptor? Is it the one we are looking for? */ /* Is this an interface descriptor? Is it the one we are looking for? */
if (ifdesc->type == USB_DESC_TYPE_INTERFACE && ifdesc->iif == ifno) if (ifdesc->type == USB_DESC_TYPE_INTERFACE && ifdesc->ifno == ifno)
{ {
/* Yes.. return the interface descriptor */ /* Yes.. return the interface descriptor */
@ -570,7 +570,7 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport,
FAR struct usb_ifdesc_s *ifdesc = FAR struct usb_ifdesc_s *ifdesc =
(FAR struct usb_ifdesc_s *)desc; (FAR struct usb_ifdesc_s *)desc;
DEBUGASSERT(ifdesc->iif < 32); DEBUGASSERT(ifdesc->ifno < 32);
#endif #endif
/* Increment the count of interfaces */ /* Increment the count of interfaces */
@ -684,8 +684,8 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport,
/* Was the interface merged via an IAD descriptor? */ /* Was the interface merged via an IAD descriptor? */
DEBUGASSERT(ifdesc->iif < 32); DEBUGASSERT(ifdesc->ifno < 32);
if ((mergeset & (1 << ifdesc->iif)) == 0) if ((mergeset & (1 << ifdesc->ifno)) == 0)
{ {
/* No, this interface was not merged. Save the registry /* No, this interface was not merged. Save the registry
* lookup information from the interface descriptor. * lookup information from the interface descriptor.
@ -698,7 +698,7 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport,
member->id.vid = id->vid; member->id.vid = id->vid;
member->id.pid = id->pid; member->id.pid = id->pid;
member->firstif = ifdesc->iif; member->firstif = ifdesc->ifno;
member->nifs = 1; member->nifs = 1;
/* Increment the member index */ /* Increment the member index */