Re: [PATCH 0/1] usb gadget: modify the handling of function binding return value

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

 



This 0/1 explanation mail would better
have been part of the patch itself, which
would also help thread discussions better.

--- On Mon, 11/1/10, Li, Jiebing <jiebing.li@xxxxxxxxx> wrote:

>
> The original composite gadget tries
> to bind several functions one by
> one, and the final result is decided by the last function.
> That is,
> if binding of the last function (ecm or eem) is ok, return
> value is 0.

Last function need not be ECM o EEM of course.

In general, if ANY function can't bind to
the composite gadget, then I'd say a hard fail
is the appropriate response.  After all, the
gadget is defined as having a fixed set of
functions, and when any are missing, then
the gadget is malfunctioning.

So there might be a bug lurking here, but if
there is, this patch doesn't seem to fix it.


> Or return value will be non-zero and the whole gadget will
> not be functional.

... which is very appropriate, when it can't
provide its full functionality, and instead acts
like a different (less functional) gadget

> For example, number of endpoints is not enough to support
> all the functions
> on some platform, 

That's a reasonable class of problem to worry
about, and the original way to handle it is
the same as non-composite gadgets:  configure
only gadgets that can work on that hardware.


> This patch is used to handle this more flexibly.

I want to see predictability and consistency,
which this patch doesn't seem to promote.
 As long as
> one of the
> functions is bound succesfully, return value will be 0.

NAK.  When the composite gadget is defined to
require three functions (for example), all of
them should bind successfully for the gadget
to be initialized.

The notion of an "optional" function fights the
notion of a fully defined USB peripheral, for
which a host driver (e.g. Windows INF file) can
be written and supported.  Think how those support
calls will stretch out (and cost).

- Dave

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