31 Oct, 2012

4 commits

  • HS and SS descriptors are staticaly created. They are updated during the
    bind process with the endpoint address, string id or interface numbers.

    After that, the descriptor chain is linked to struct usb_function which
    is used by composite in order to serve the GET_DESCRIPTOR requests,
    number of available configs and so on.

    There is no need to assign the HS descriptor only if the UDC supports
    HS speed because composite won't report those to the host if HS support
    has not been reached. The same reasoning is valid for SS.

    This patch makes sure each function updates HS/SS descriptors
    unconditionally and uses the newly introduced helper function to create a
    copy the descriptors for the speed which is supported by the UDC.

    While at that, also rename f->descriptors to f->fs_descriptors in order
    to make it more explicit what that means.

    Cc: Laurent Pinchart
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • This function works only on FS or HS. If the gadget is HS capable only
    HS descriptors are assigned. If we plug it to an 1.1 host it won't work
    because we have only 2.0 descriptors. This patch changes the behavior to
    provide both sets.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • The HS descriptors are only created if HS is supported by the UDC but we
    never free them.

    Cc: stable
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     
  • Whether highspeed configuration is valid or not is something that
    composite decides and not the gadget. That gadget can only provide the
    required descriptors for it.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     

10 Sep, 2012

1 commit

  • Some gadgets provide custom entry here. Some may override it with an
    etntry that is also created by composite if there was no value sumbitted
    at all.
    This patch removes all "custom manufacturer" strings which are the same
    as these which are created by composite. Then it moves the creation of
    the default manufacturer string to usb_composite_overwrite_options() in
    case no command line argument has been used and the entry is still an
    empty string.
    By doing this we get rid of the global variable "composite_manufacturer"
    in composite.

    Acked-by: Michal Nazarewicz
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Felipe Balbi

    Sebastian Andrzej Siewior
     

03 Mar, 2012

1 commit

  • As the coverity checker puts it:

    "Passing argument "sizeof (midi_function) /*8*/" to function "kcalloc"
    and then casting the return value to "struct usb_descriptor_header **"
    is suspicious. ... In this particular case sizeof(struct
    usb_descriptor_header **) happens to be equal to sizeof(struct
    usb_descriptor_header *), but this is not a portable assumption."

    I believe we really do intend to use 'sizeof(*midi_function)' here, so
    this patch makes that change.

    Signed-off-by: Jesper Juhl
    Signed-off-by: Greg Kroah-Hartman

    Jesper Juhl
     

15 Nov, 2011

1 commit

  • The dynamic jack allocation of the MIDI gadget currently links all
    external jacks to one single instance of an embedded jack. According to
    the spec, this is only valid if these streams always carry the same data
    stream, as described in the USB MIDI 1.0 spec, chapter 3.3.1.

    Also, genius Windows 7(tm) terminates it's life cycle instantly with a
    blue screen of death once a device with more than one input and output
    port with the current implementation is connected.

    While at it, and because it grew again by this change, allocate the
    temporary function pointer list on the heap, not on the stack.

    Signed-off-by: Daniel Mack
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Daniel Mack
     

19 Oct, 2011

2 commits


14 Oct, 2011

3 commits

  • The code in the MIDI gadget was already sort of prepared for multi-port
    configuration, so the streaming logic itself didn't need much tweaking.
    However, the descriptors change when the number of ports do, and so some
    rework of the the preparation algorithms were necessary.

    Successfully tested on Linux and Max OS X hosts for both input and
    output streams.

    Signed-off-by: Daniel Mack
    Cc: Greg Kroah-Hartman
    Signed-off-by: Felipe Balbi

    Daniel Mack
     
  • Make use of the newly added MIDI function in f_midi.c and strip down
    the MIDI gadget code radically. Also use the generic framework function
    to avoid code duplication and rename some symbols to bring them in sync
    with other code in the gadget framework.

    [ balbi@ti.com : fix Section mismatch warnings.
    rebased on top of usb_speed_string() patch to
    avoid conflicts. ]

    Signed-off-by: Daniel Mack
    Cc: Greg Kroah-Hartman
    Signed-off-by: Felipe Balbi

    Daniel Mack
     
  • This patch adds f_midi.c to implement a USB gadget function that works
    with the composite framework, so it can be combined with other USB
    functions.

    The code for the ALSA/MIDI logic was taken from the midi device gadget,
    other parts have been rewritten to benefit from the dynamic descriptor
    allocation features.

    This was successfully tested on an OMAP3 board.

    Signed-off-by: Daniel Mack
    Cc: Greg Kroah-Hartman
    Signed-off-by: Felipe Balbi

    Daniel Mack