RE: [PATCH v2] usb: gadget: add SS descriptors to Ethernet gadget

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

 



-----Original Message-----
> From: Tanya Brokhman [mailto:tlinder@xxxxxxxxxxxxxx] 
>
> > -	if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)
> > -		return 13 * 512 * 8 * 1000 * 8;
> > +	if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_SUPER)
> > +		return 13 * 1024 * 8 * 1000 * 8;
>
> I think you meant gadget_is_super_speed(g) && g->speed == USB_SPEED_SUPER...
>
> > +		ss_ecm_in_desc.bEndpointAddress =
> > +				hs_ecm_in_desc.bEndpointAddress;
> > +		ss_ecm_out_desc.bEndpointAddress =
> > +				hs_ecm_out_desc.bEndpointAddress;
> > +		ss_ecm_notify_desc.bEndpointAddress =
> > +				hs_ecm_notify_desc.bEndpointAddress;
> > +
> > +		/* copy descriptors, and track endpoint copies */
> > +		f->ss_descriptors = usb_copy_descriptors(ecm_ss_function);
> > +		if (!f->ss_descriptors)
> > +			goto fail;
> >  	}
>
> If I'm not mistaken in your version the above code is under if
> gadget_is_dual_speed(), which will work since if the gadget is SS it should
> be dual speed as well, but IMO, the above should be under if
> gadget_is_super_speed()
>

Hi Tanya,

OK, I didn't know about gadget_is_super_speed(), I will fix up and resend.

By the way, do you know if this part:

 	.strings	= dev_strings,
 #ifdef CONFIG_USB_GADGET_DUALSPEED
+# ifdef CONFIG_USB_GADGET_SUPERSPEED
+	.max_speed	= USB_SPEED_SUPER,
+# else
 	.max_speed	= USB_SPEED_HIGH,
+# endif
 #else
 	.max_speed	= USB_SPEED_FULL,

is correct? Is the #ifdef CONFIG_USB_GADGET_SUPERSPEED necessary? Or
can I just set it to USB_SPEED_SUPER unconditionally, and the composite
framework will do the right thing?

-- 
Paul

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