lkml.org 
[lkml]   [2011]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v9 4/7] usb:gadget: Add SuperSpeed support to the Gadget Framework
Date
> > @@ -157,7 +167,31 @@ ep_found:
> > /* commit results */
> > _ep->maxpacket = le16_to_cpu(chosen_desc->wMaxPacketSize);
> > _ep->desc = chosen_desc;
> > -
> > + _ep->comp_desc = NULL;
> > + _ep->maxburst = 0;
> > + _ep->mult = 0;
> > + if (want_comp_desc) {
> > + /*
> > + * Companion descriptor should follow EP descriptor
> > + * USB 3.0 spec, #9.6.7
> > + */
> > + comp_desc = (struct usb_ss_ep_comp_descriptor *)*(++d_spd);
> > + if (!comp_desc ||
> > + (comp_desc->bDescriptorType !=
> USB_DT_SS_ENDPOINT_COMP))
> > + return -EIO;
> > + _ep->comp_desc = comp_desc;
> > + if (g->speed == USB_SPEED_SUPER) {
> > + int xfer_type = _ep->bEndpointAddress &
> > + USB_ENDPOINT_XFERTYPE_MASK ;
>
> how about something liks:
>
> switch (usb_endpoint_type(_ep->desc) {
> case USB_ENDPOINT_XFER_BULK:
> case USB_ENDPOINT_XFER_INT:
> _ep->maxburst = comp_desc->bMaxBurst;
> break;
> case USB_ENDPOINT_XFER_ISOC:
> _ep->mult = comp_desc->bmAttributes & 0x03;
> break;
> default:
> /* nothing to do for control endpoints */
> break;
> }
>
> --
> balbi

You're right. Your way is nicer. Will do.
Are you finished with reviewing the patches or should I wait with another
version?

Best regards,
Tanya Brokhman
Consultant for Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum






\
 
 \ /
  Last update: 2011-05-11 19:33    [W:0.047 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site