Re: [RFC/PATCH] USB:gadget:introduce isochronous source sink function driver(V1)

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

 



Hi,

tom.leiming@xxxxxxxxx wrote:
> From: Ming Lei <tom.leiming@xxxxxxxxx>
>
> This patch introduces isochronous source sink function driver
> into zero composite driver. The driver is based on David Brownell's
> f_sourcesink.c
>   

> +/*-------------------------------------------------------------------------*/
> +static int __init
> +iso_sourcesink_bind(struct usb_configuration *c, struct usb_function *f)
> +	if (gadget_is_dualspeed(c->cdev->gadget))
> +		hs = 1;
> +	else
> +		hs = 0;
> +
> +	/*use the ep desc with the strongest capability to configure hw ep*/
> +	if (hs) {
> +		ialt = ss->hs_alt;
> +		max_in = ialt[(int)ss->hs_in_maxp_alt].source_ep_desc;
> +		max_out = ialt[(int)ss->hs_out_maxp_alt].sink_ep_desc;
> +	} else {
> +		ialt = ss->fs_alt;
> +		max_in = ialt[(int)ss->fs_in_maxp_alt].source_ep_desc;
> +		max_out = ialt[(int)ss->fs_out_maxp_alt].sink_ep_desc;
> +	}
> +
>   
Have you tested this on dual speed gadget hardware connected to a full
speed only host?
To get that configuration to work for me I had to force hs=0 in the
above code.

Otherwise using a configuration like
    fs:alt0:alt1,in/512/1,out/512/1:hs:alt0:alt1,in/1024*3/1:alt2,in/1024/1
(note fs has in and out whereas hs has in only)
causes an oops in enable_iso_source_sink() because one of the endpoints
is null.

The problem seems to be that iso_sourcesink_bind() sets up ss->in_ep and
ss->out_ep based
on the configuration for the gadget hardware regardless of the host
capabilities.


> +static int iso_source_sink_start_ep(struct f_iso_sourcesink *ss, bool is_in)
> +{
> +	struct usb_ep		*ep;
> +	struct usb_request	*req;
> +	int			status;
> +
> +	ep = is_in ? ss->in_ep : ss->out_ep;
> +	if (ep)
> +		return 0;
>
>   
Shouldn"t this be
    if (!ep)
        return 0;
??

Otherwise no requests are actually submitted.
As usbtest #16 doesn't actually check the length
of data transfered the test is still OK but nothing
is transferred...


I also have another "strange" behaviour but that may be due to my
misunderstanding:
When I configure different max packet sizes for IN transfers and observe
the data size
on the bus (with a bus analyser) I see:

config                  bus
256               256
512                     512
248                     256
1020                   1024
1023                   1024


IE there seems to be a round up to next power of two behaviour
(including to 1024
even though the limit for full speed is 1023...)

Regards,

Martin

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