]> git.baikalelectronics.ru Git - kernel.git/commit
USB: gadget: f_mass_storage: per function
authorMichal Nazarewicz <m.nazarewicz@samsung.com>
Mon, 29 Mar 2010 12:01:32 +0000 (14:01 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 May 2010 20:21:36 +0000 (13:21 -0700)
commit4c9dcb75afd739001eac1f712a3e6edf31932652
treea9fee9add6aef38f6ddc2d70e1c94750366d7864
parent7e6db05b1da69d6dee8086d417bc614d58fa83cb
USB: gadget: f_mass_storage: per function

Mass Storage Function (MSF) used the same descriptors for each
usb_function instance (meaning usb_function::descriptors of different
functions pointed to the same static area (the same was true for
usb_function::hs_descriptors)).

This would leads to problems if MSF were used in several USB
configurations with different interface and/or endpoint numbers.
Descriptors for all configurations would have interface/endpoint
numbers overwritten by the values valid for the last configuration.

This patch adds code that copies the descriptors each time MSF is
added to USB configuration (that is for each usb_function).

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
drivers/usb/gadget/f_mass_storage.c