Hi, typo on $SUBJECT. s/infracture/infrastructure On Wed, Nov 07, 2012 at 07:23:52PM +0100, Sebastian Andrzej Siewior wrote: > This patch provides an infrastructure to register & unregister an USB I guess it should 'a USB', not 'an USB'. Can some native speaker confirm, please ? IIRC it had something to do with U sounding like YOO where Y is a consonant and, thus, should be 'a', not 'an'. Am I right ? > function. This allows to turn a function into a module and avoid the > '#include "f_.*.c"' magic and we get a clear API / cut between the bare > gadget and its functions. > The concept is simple: > Each functions defines the DECLARE_USB_FUNCTION macro whith an unique 'Each function', not 'functions'. > name of the function and an allocation function. The name is used for > automaticaly loading the module if it is not yet present and request the > function from the gadget because we don't include the functions anymore. > The allocate function is mostly the "old" bind-callback which was passed > to usb_add_config() with some minor changes: > - a generic configuration struct is attached > This struct describes all argumens which can be passed to the > function. It includes basically two entries: The name of the argument > and its value. With this piece we will have a "generic" query of all > arguments which can be set from the outside. This should be also handy > for configfs because it can query each function for its options and > expose to the user, that needs to do the thinking. This can be used > the set the MAC address for one of the network gadgets (which is a > string) or the number of current serial ports for the ACM function > (which is an interger). > - a generic function to configure the function > This passes the struct and sets the arguments. The "old" gadgets would > most likely set all values at once but the "new configfs" interface > would prefer to set one value at a time that once the use did > "echo value > option" > kind of thing. > - a function de-allocate function > This is mostly the same thing that is done by the unbind function. > > composite gains usb_add_config_only() which a subset of > usb_add_config(). The bind/attaching can be deferred to a later point in > time. > > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> looks like patch below needs some more work. It looks like a step backwards. The goal is clear, and valid, but implementation looks a bit weird to me. The whole usbf_*(), usb_d_function, usbf_option, look scary. -- balbi
Attachment:
signature.asc
Description: Digital signature