Re: [PATCH] usb/uas: only bind if the hcd supports SG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Alan Stern | 2012-01-11 12:11:57 [-0500]:

>On Wed, 11 Jan 2012, Sebastian Andrzej Siewior wrote:
>> Well no. Even if you override it in kernel the user still could switch
>> it if he wants to.
>
>How?  If usb-storage refuses to bind to devices that support UAS, the 
>user has no way to force it to bind.

I meant if UAS does not work _or_ he prefers BOT, he can still switch
back to BOT.

>> Felipe, what is Nokia and the other people that have the multi-
>> functional gadgets use to switch from one function to the other?
>
>Do those gadgets use separate _altsettings_ for BOT vs. UAS, or do they 
>use separate _configs_?

They have both. Both configs provide the same functions, if you look at
lsusb of the g_multi gadget:

|Bus 001 Device 002: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget
|Device Descriptor:
|  bLength                18
|  bDescriptorType         1
|  bcdUSB               2.10
|  bDeviceClass          239 Miscellaneous Device
|  bDeviceSubClass         2 ?
|  bDeviceProtocol         1 Interface Association
|  bMaxPacketSize0        64
|  idVendor           0x1d6b Linux Foundation
|  idProduct          0x0104 Multifunction Composite Gadget
|  bcdDevice            3.02
|  iManufacturer          13 Linux 3.2.0+ with dummy_udc
|  iProduct               14 Multifunction Composite Gadget
|  iSerial                 0 
|  bNumConfigurations      2
|  Configuration Descriptor:
|    bLength                 9
|    bDescriptorType         2
|    wTotalLength          164
|    bNumInterfaces          5
|    bConfigurationValue     1
|    iConfiguration          2 Multifunction with RNDIS
|    bmAttributes         0xc0
|      Self Powered
|    MaxPower                2mA
|    Interface Association:
|      bLength                 8
|      bDescriptorType        11
|      bFirstInterface         0
|      bInterfaceCount         2
|      bFunctionClass          2 Communications
|      bFunctionSubClass       6 Ethernet Networking
|      bFunctionProtocol       0 
|      iFunction               6 RNDIS
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        0
|      bAlternateSetting       0
|      bNumEndpoints           1
|      bInterfaceClass         2 Communications
|      bInterfaceSubClass      2 Abstract (modem)
|      bInterfaceProtocol    255 Vendor Specific (MSFT RNDIS?)
|      iInterface              4 RNDIS Communications Control
|      CDC Header:
|        bcdCDC               1.10
|      CDC Call Management:
|        bmCapabilities       0x00
|        bDataInterface          1
|      CDC ACM:
|        bmCapabilities       0x00
|      CDC Union:
|        bMasterInterface        0
|        bSlaveInterface         1 
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x83  EP 3 IN
|        bmAttributes            3
|          Transfer Type            Interrupt
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0008  1x 8 bytes
|        bInterval               9
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        1
|      bAlternateSetting       0
|      bNumEndpoints           2
|      bInterfaceClass        10 CDC Data
|      bInterfaceSubClass      0 Unused
|      bInterfaceProtocol      0 
|      iInterface              5 RNDIS Ethernet Data
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x81  EP 1 IN
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               0
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x02  EP 2 OUT
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               0
|    Interface Association:
|      bLength                 8
|      bDescriptorType        11
|      bFirstInterface         2
|      bInterfaceCount         2
|      bFunctionClass          2 Communications
|      bFunctionSubClass       2 Abstract (modem)
|      bFunctionProtocol       1 AT-commands (v.25ter)
|      iFunction               9 CDC Serial
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        2
|      bAlternateSetting       0
|      bNumEndpoints           1
|      bInterfaceClass         2 Communications
|      bInterfaceSubClass      2 Abstract (modem)
|      bInterfaceProtocol      1 AT-commands (v.25ter)
|      iInterface              7 CDC Abstract Control Model (ACM)
|      CDC Header:
|        bcdCDC               1.10
|      CDC Call Management:
|        bmCapabilities       0x00
|        bDataInterface          3
|      CDC ACM:
|        bmCapabilities       0x02
|          line coding and serial state
|      CDC Union:
|        bMasterInterface        2
|        bSlaveInterface         3 
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x86  EP 6 IN
|        bmAttributes            3
|          Transfer Type            Interrupt
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x000a  1x 10 bytes
|        bInterval               9
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        3
|      bAlternateSetting       0
|      bNumEndpoints           2
|      bInterfaceClass        10 CDC Data
|      bInterfaceSubClass      0 Unused
|      bInterfaceProtocol      0 
|      iInterface              8 CDC ACM Data
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x84  EP 4 IN
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               0
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x05  EP 5 OUT
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               0
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        4
|      bAlternateSetting       0
|      bNumEndpoints           2
|      bInterfaceClass         8 Mass Storage
|      bInterfaceSubClass      6 SCSI
|      bInterfaceProtocol     80 Bulk (Zip)
|      iInterface              1 Mass Storage
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x81  EP 1 IN
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               0
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x02  EP 2 OUT
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               1
|  Configuration Descriptor:
|    bLength                 9
|    bDescriptorType         2
|    wTotalLength          169
|    bNumInterfaces          5
|    bConfigurationValue     2
|    iConfiguration          3 Multifunction with CDC ECM
|    bmAttributes         0xc0
|      Self Powered
|    MaxPower                2mA
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        0
|      bAlternateSetting       0
|      bNumEndpoints           1
|      bInterfaceClass         2 Communications
|      bInterfaceSubClass      6 Ethernet Networking
|      bInterfaceProtocol      0 
|      iInterface             10 CDC Ethernet Control Model (ECM)
|      CDC Header:
|        bcdCDC               1.10
|      CDC Union:
|        bMasterInterface        0
|        bSlaveInterface         1 
|      CDC Ethernet:
|        iMacAddress                     12 EE57D9FF7F36
|        bmEthernetStatistics    0x00000000
|        wMaxSegmentSize               1514
|        wNumberMCFilters            0x0000
|        bNumberPowerFilters              0
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x83  EP 3 IN
|        bmAttributes            3
|          Transfer Type            Interrupt
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0010  1x 16 bytes
|        bInterval               9
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        1
|      bAlternateSetting       0
|      bNumEndpoints           0
|      bInterfaceClass        10 CDC Data
|      bInterfaceSubClass      0 Unused
|      bInterfaceProtocol      0 
|      iInterface              0 
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        1
|      bAlternateSetting       1
|      bNumEndpoints           2
|      bInterfaceClass        10 CDC Data
|      bInterfaceSubClass      0 Unused
|      bInterfaceProtocol      0 
|      iInterface             11 CDC Ethernet Data
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x81  EP 1 IN
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               0
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x02  EP 2 OUT
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               0
|    Interface Association:
|      bLength                 8
|      bDescriptorType        11
|      bFirstInterface         2
|      bInterfaceCount         2
|      bFunctionClass          2 Communications
|      bFunctionSubClass       2 Abstract (modem)
|      bFunctionProtocol       1 AT-commands (v.25ter)
|      iFunction               9 CDC Serial
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        2
|      bAlternateSetting       0
|      bNumEndpoints           1
|      bInterfaceClass         2 Communications
|      bInterfaceSubClass      2 Abstract (modem)
|      bInterfaceProtocol      1 AT-commands (v.25ter)
|      iInterface              7 CDC Abstract Control Model (ACM)
|      CDC Header:
|        bcdCDC               1.10
|      CDC Call Management:
|        bmCapabilities       0x00
|        bDataInterface          3
|      CDC ACM:
|        bmCapabilities       0x02
|          line coding and serial state
|      CDC Union:
|        bMasterInterface        2
|        bSlaveInterface         3 
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x86  EP 6 IN
|        bmAttributes            3
|          Transfer Type            Interrupt
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x000a  1x 10 bytes
|        bInterval               9
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        3
|      bAlternateSetting       0
|      bNumEndpoints           2
|      bInterfaceClass        10 CDC Data
|      bInterfaceSubClass      0 Unused
|      bInterfaceProtocol      0 
|      iInterface              8 CDC ACM Data
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x84  EP 4 IN
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               0
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x05  EP 5 OUT
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               0
|    Interface Descriptor:
|      bLength                 9
|      bDescriptorType         4
|      bInterfaceNumber        4
|      bAlternateSetting       0
|      bNumEndpoints           2
|      bInterfaceClass         8 Mass Storage
|      bInterfaceSubClass      6 SCSI
|      bInterfaceProtocol     80 Bulk (Zip)
|      iInterface              1 Mass Storage
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x81  EP 1 IN
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               0
|      Endpoint Descriptor:
|        bLength                 7
|        bDescriptorType         5
|        bEndpointAddress     0x02  EP 2 OUT
|        bmAttributes            2
|          Transfer Type            Bulk
|          Synch Type               None
|          Usage Type               Data
|        wMaxPacketSize     0x0200  1x 512 bytes
|        bInterval               1
|Device Qualifier (for other device speed):
|  bLength                10
|  bDescriptorType         6
|  bcdUSB               2.10
|  bDeviceClass          239 Miscellaneous Device
|  bDeviceSubClass         2 ?
|  bDeviceProtocol         1 Interface Association
|  bMaxPacketSize0        64
|  bNumConfigurations      2
|Device Status:     0x0000
|  (Bus Powered)

So you need a tool to switch between storage, CDC ....

>Alan Stern

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux