• A
    usb: gadget: OS String support · 19824d5e
    Andrzej Pietrasiewicz 提交于
    There is a custom (non-USB IF) extension to the USB standard:
    
    http://msdn.microsoft.com/library/windows/hardware/gg463182
    
    They grant permission to use the specification - there is
    "Microsoft OS Descriptor Specification License Agreement"
    under the link mentioned above, and its Section 2 "Grant
    of License", letter (b) reads:
    
    "Patent license. Microsoft hereby grants to You a nonexclusive,
    royalty-free, nontransferable, worldwide license under Microsoft’s
    patents embodied solely within the Specification and that are owned
    or licensable by Microsoft to make, use, import, offer to sell,
    sell and distribute directly or indirectly to Your Licensees Your
    Implementation. You may sublicense this patent license to Your
    Licensees under the same terms and conditions."
    
    The said extension is maintained by Microsoft for Microsoft.
    
    Yet it is fairly common for various devices to use it, and a
    popular proprietary operating system expects devices to provide
    "OS descriptors", so Linux-based USB gadgets whishing to be able
    to talk to a variety of operating systems should be able to provide
    the "OS descriptors".
    
    This patch adds optional support for gadgets whishing to expose
    the so called "OS String" under index 0xEE of language 0.
    The contents of the string is generated based on the qw_sign
    array and b_vendor_code.
    
    Interested gadgets need to set the cdev->use_os_string flag,
    fill cdev->qw_sign with appropriate values and fill cdev->b_vendor_code
    with a value of their choice.
    
    This patch does not however implement responding to any vendor-specific
    USB requests.
    Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
    Acked-by: NMichal Nazarewicz <mina86@mina86.com>
    Signed-off-by: NFelipe Balbi <balbi@ti.com>
    19824d5e
composite.c 52.1 KB