RE: [PATCH v9 4/7] usb:gadget: Add SuperSpeed support to the Gadget Framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > @@ -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




--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux