• Michal Nazarewicz's avatar
    USB: gadget: f_mass_storage: per function · 0fb2c2a1
    Michal Nazarewicz authored
    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: default avatarMichal Nazarewicz <m.nazarewicz@samsung.com>
    Cc: Kyungmin Park <kyungmin.park@samsung.com>
    0fb2c2a1
f_mass_storage.c 88.2 KB