Re: [PATCH] rndis_host: support Novatel Verizon USB730L — Linux USB

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

 



Hello Bjorn,

Thanks for your help, the problem is solved and the blame go to the usb_modeswitch executable that failed to change the configuration.
However, changing the configuration was successful when writing directly into the kernel :-)

My Linux system already use the latest usb_modeswitch (2.5.1) and libusb (1.0), so it seem that the blacklist of the HID driver is a local work-around for a problem with my Linux system - and is not relevant to others.

Thanks
GalS


Details:
======
======

1. usb_modeswitch failed to change configuration with "interface 2 claimed by usbhid" error:

$ usb_modeswitch -v 1410 -p 9030 -u 3 -V 1410 -P 9032

usb 1-1.1.3: New USB device found, idVendor=1410, idProduct=9030
usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.1.3: Product: MiFi USB730L
usb 1-1.1.3: Manufacturer: Novatel Wireless
usb 1-1.1.3: SerialNumber: 0123456789ABCDEF
cdc_ether 1-1.1.3:1.0 usb0: register 'cdc_ether' at usb-ci_hdrc.1-1.1.3, CDC Ethernet Device, 8e:3a:62:f5:06:98
hid-generic 0003:1410:9030.0062: device has no listeners, quitting
usb 1-1.1.3: usbfs: interface 0 claimed by cdc_ether while 'usb_modeswitch' sets config #3
cdc_ether 1-1.1.3:1.0 usb0: unregister 'cdc_ether' usb-ci_hdrc.1-1.1.3, CDC Ethernet Device
usb 1-1.1.3: usbfs: interface 2 claimed by usbhid while 'usb_modeswitch' sets config #3
usb 1-1.1.3: usbfs: interface 2 claimed by usbhid while 'usb_modeswitch' sets config #3
usb 1-1.1.3: usbfs: interface 2 claimed by usbhid while 'usb_modeswitch' sets config #3
usb 1-1.1.3: usbfs: interface 2 claimed by usbhid while 'usb_modeswitch' sets config #3


$ usb-devices  | grep -B 3 -A 8 Vendor=1410

T:  Bus=01 Lev=03 Prnt=03 Port=02 Cnt=01 Dev#=112 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  3
P:  Vendor=1410 ProdID=9030 Rev=03.10
S:  Manufacturer=Novatel Wireless
S:  Product=MiFi USB730L
S:  SerialNumber=0123456789ABCDEF
C:  #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
I:  If#= 2 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid


2. However, changing the configuration was successful when writing directly into the kernel:

$ USB_DEVICE=1-1.1.3
$ echo 3 > /sys/bus/usb/devices/$USB_DEVICE/bConfigurationValue

usb 1-1.1.3: new high-speed USB device number 114 using ci_hdrc
usb 1-1.1.3: New USB device found, idVendor=1410, idProduct=9032
usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.1.3: Product: MiFi USB730L
usb 1-1.1.3: Manufacturer: Novatel Wireless
usb 1-1.1.3: SerialNumber: 0123456789ABCDEF
rndis_host 1-1.1.3:1.0 usb0: register 'rndis_host' at usb-ci_hdrc.1-1.1.3, RNDIS device, 06:81:6a:54:a4:2c
hid-generic 0003:1410:9032.006D: device has no listeners, quitting
option 1-1.1.3:1.3: GSM modem (1-port) converter detected
usb 1-1.1.3: GSM modem (1-port) converter now attached to ttyUSB0

$ usb-devices  | grep -B 3 -A 8 Vendor=1410                                            

T:  Bus=01 Lev=03 Prnt=03 Port=02 Cnt=01 Dev#=114 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1410 ProdID=9032 Rev=03.10
S:  Manufacturer=Novatel Wireless
S:  Product=MiFi USB730L
S:  SerialNumber=0123456789ABCDEF
C:  #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
I:  If#= 2 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option


Reference - patches:
================
================

>Subject: Re: [PATCH] rndis_host: support Novatel Verizon USB730L — Linux USB
From: Gal Shalif <gal@xxxxxxxxxx>
To: Bjørn Mork <bjorn@xxxxxxx>
Cc: Gal Shalif <gal@xxxxxxxxxx>, linux-usb@xxxxxxxxxxxxxxx, Gal Shalif Work <gals@xxxxxxxx>, Oliver Neukum <oneukum@xxxxxxxx>, 


Notes:
* Tested with Linux kernel 3.14.15 on a 32bit ARM machine (kernel is compiled without IPV6) and with static HID driver
* Novatel Linux integration guide - https://www.verizonwireless.com/dam/support/pdf/verizon-usb730l-integration-guide.pdf

The following was used to switch the Novatel USB730L from user mode
(product ID 0x9030) to enterprise mode (product ID 0x9032):


* Kernel patche: add Novatel USB730L enterprise mode serial interface

    $ git show 9bacb30
    commit 9bacb3082a90fc39047721a0887d5414f5e7008d
    Author: Gal Shalif <gals@xxx>
    Date:   Thu Oct 19 17:18:48 2017 +0300

        USB: serial: option: add support for Novatel USB730L enterprise mode

          Add device ID for Novatel USB730L enterprise mode
          See details at: https://www.verizonwireless.com/dam/support/pdf/verizon-usb730l-integration-guide.pdf

    diff --git drivers/usb/serial/option.c drivers/usb/serial/option.c
    index 54bfef1..bf5f637 100644
    --- drivers/usb/serial/option.c
    +++ drivers/usb/serial/option.c
    @@ -162,6 +162,7 @@ static void option_instat_callback(struct urb *urb);
     #define NOVATELWIRELESS_PRODUCT_E362           0x9010
     #define NOVATELWIRELESS_PRODUCT_E371           0x9011
     #define NOVATELWIRELESS_PRODUCT_U620L          0x9022
    +#define NOVATELWIRELESS_PRODUCT_ENTERPRISE_U730L 0x9032 /* Novtel USB730L enterprize mode (from https://www.verizonwireless.com/dam/support/pdf/verizon-usb730l-integration-guide.pdf) */
     #define NOVATELWIRELESS_PRODUCT_G2             0xA010
     #define NOVATELWIRELESS_PRODUCT_MC551          0xB001

    @@ -1120,6 +1121,7 @@ static const struct usb_device_id option_ids[] = {
            { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E362, 0xff, 0xff, 0xff) },
            { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E371, 0xff, 0xff, 0xff) },
            { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U620L, 0xff, 0x00, 0x00) },
    +       { USB_DEVICE_AND_INTERFACE_INFO(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ENTERPRISE_U730L, 0xff, 0x00, 0x00) }, /* Novtel USB730L enterprize mode (from https://www.verizonwireless.com/dam/support/pdf/verizon-usb730l-integration-guide.pdf) */

            { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
            { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },

* USB mode switch file:
    $ cat 1410:9030
    # Novatel Wireless MiFi USB730L
    DefaultVendor=0x1410
    DefaultProduct=0x9030
    TargetVendor=0x1410
    TargetProduct=0x9032
    NeedResponse=0
    Configuration=0x03




USB info:
=======
=======

$ insert modem ...

usb 1-1.1.2: new high-speed USB device number 67 using ci_hdrc
usb 1-1.1.2: New USB device found, idVendor=1410, idProduct=9030
usb 1-1.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.1.2: Product: MiFi USB730L
usb 1-1.1.2: Manufacturer: Novatel Wireless
usb 1-1.1.2: SerialNumber: 0123456789ABCDEF
cdc_ether 1-1.1.2:1.0 usb0: register 'cdc_ether' at usb-ci_hdrc.1-1.1.2, CDC Ethernet Device, a6:2f:3c:5c:b9:9a


$ lsusb -d 1410:9030 -v
Bus 001 Device 067: ID 1410:9030  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x1410 
  idProduct          0x9030 
  bcdDevice            3.10
  iManufacturer           1 Novatel Wireless
  iProduct                2 MiFi USB730L
  iSerial                 3 0123456789ABCDEF
  bNumConfigurations      3
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          105
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 
      bInterfaceSubClass      6 
      bInterfaceProtocol      0 
      iInterface              4 CDC Ethernet Control Model (ECM)
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      CDC Ethernet:
        iMacAddress                      6 A62F3C5CB99A
        bmEthernetStatistics    0x00000000
        wMaxSegmentSize               1514
        wNumberMCFilters            0x0000
        bNumberPowerFilters              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 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 
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass        10 
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              5 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     0x01  EP 1 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        2
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              7 HID Interface
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.01
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      34
          Report Descriptor: (length is 34)
            Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440
                            (null)
            Item(Local ): Usage, data= [ 0xa5 ] 165
                            (null)
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage, data= [ 0xa6 ] 166
                            (null)
            Item(Local ): Usage, data= [ 0xa7 ] 167
                            (null)
            Item(Global): Logical Minimum, data= [ 0x80 ] 128
            Item(Global): Logical Maximum, data= [ 0x7f ] 127
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x04 ] 4
            Item(Main  ): Input, data= [ 0x04 ] 4
                            Data Array Relative No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage, data= [ 0xa9 ] 169
                            (null)
            Item(Global): Logical Minimum, data= [ 0x80 ] 128
            Item(Global): Logical Maximum, data= [ 0x7f ] 127
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x04 ] 4
            Item(Main  ): Output, data= [ 0x04 ] 4
                            Data Array Relative No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
      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               4
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           75
    bNumInterfaces          2
    bConfigurationValue     2
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 
      bFunctionSubClass       2 
      bFunctionProtocol       1 
      iFunction              10 CDC Serial
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 
      bInterfaceSubClass      2 
      bInterfaceProtocol      1 
      iInterface              8 CDC Abstract Control Model (ACM)
      CDC Header:
        bcdCDC               1.10
      CDC Call Management:
        bmCapabilities       0x00
        bDataInterface          1
      CDC ACM:
        bmCapabilities       0x02
          line coding and serial state
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 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        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              9 CDC ACM 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     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     3
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 
      bInterfaceSubClass      6 
      bInterfaceProtocol     80 
      iInterface             12 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     0x01  EP 1 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.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      3
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)


> Subject: Re: [PATCH] rndis_host: support Novatel Verizon USB730L — Linux USB
> From: Gal Shalif <gal@xxxxxxxxxx>
> To: Bjørn Mork <bjorn@xxxxxxx>
> Cc: Oliver Neukum <oneukum@xxxxxxxx>, linux-usb@xxxxxxxxxxxxxxx, Gal Shalif <gal@xxxxxxxxxx>
> 
> 
> Hello Bjorn,
> 
> Thanks for your input.
> I will send the requested information on Monday (I'm on a vacation till Monday).
> 
> GalS
> On 25 Oct. 2017 23:34, "Bjørn Mork" <bjorn@xxxxxxx> wrote:
> Gal Shalif <gal@xxxxxxxxxx> writes:
> 
> > Bjoren> You can always unbind the driver, right?  And usb_modeswitch will
> > even do it for you.
> > I'm not a USB mode switch expert, so please explain what is the mode switch
> > file that you suggest.
> >
> > As I already said before - my kernel configuration will not allow a USB
> > mode switch (to enterprise mode) without blacklisting the HID interface -
> > it may be because the HID driver is statically compile into my kernel.
> >
> > To summaries:
> > Without blacklisting - I cannot USB mode switch to USB730L enterprise mode
> > (product ID 9032).
> > With blacklisting - it is O.K.
> >
> > My kernel configuration:
> > iMX6 hardware
> > version 3.14.15
> > ARM 32 bit
> > No IPV6
> > Static compile if HID driver
> 
> It doesn't matter if the driver is a module or built-in.  You can still
> unbind it using the 'unbind' sysfs driver attribute.  But I don't think
> a driver can prevent switching configurations.  Please show us what
> happens when you write 3 to the bConfigurationValue attribute:
> 
>  echo 3 >/sys/bus/usb/devices/x-y/bConfigurationValue
> 
> where x-y is the usb+port numbers.  You can get them from e.g dmesg.
> 
> And while you are at it:  Please show the relevant parts of the dmesg
> output.  lsusb -v output would also be nice to understand what part the
> HID driver plays here.
> 
> If driver unbinding is really necessary, then I think you should test if
> a manual unbind will do.
> 
> You may be right that some extra magic is needed. But I think it would
> be good to have a precise description of how that magic works, and not
> just "With blacklisting - it is O.K.". The hid blacklist connection does
> not make sense.  Or at least it doesn't to me.
> 
> 
> Bjørn
--
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