Automatic Activation, Hotplug and UDEV, Configuration
chedxb
Posts: 21
Joined: 14 Apr 2019, 14:51

Re: Need help in supporting DWM 157 D1 donle.

Post by chedxb » 17 Apr 2019, 09:52

usb_modeswitch -v 2001 -p a407 -m 1 -M 555342431234567800000000000003f0010100000000000000000000000000 -R 1

Look for default devices ...
No devices in default mode found. Nothing to do. Bye!


usb_modeswitch -v 2001 -p a407 -m 1 -M 555342431234567800000000000003f0010200000000000000000000000000 -R 1

Look for default devices ...
No devices in default mode found. Nothing to do. Bye!

nothing interesting with different options :(

LOM
Posts: 1380
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Need help in supporting DWM 157 D1 donle.

Post by LOM » 17 Apr 2019, 10:36

chedxb wrote: Look for default devices ...
No devices in default mode found. Nothing to do. Bye!

nothing interesting with different options :(
There is a hint there..
usb_modeswitch can not find 2001:a407 because the dongle had already been switched to 2001:7d0e.

chedxb
Posts: 21
Joined: 14 Apr 2019, 14:51

Re: Need help in supporting DWM 157 D1 donle.

Post by chedxb » 17 Apr 2019, 10:46

good catch :)

usb_modeswitch -v 2001 -p a407 -m 1 -M 555342431234567800000000000003f0010100000000000000000000000000 -R 1

Look for default devices ...
Found devices in default mode (1)
Access device 002 on bus 004
Get the current device configuration ...
Current configuration number is 2
Use interface number 0
with class 8
Use endpoints 0x01 (out) and 0x81 (in)
Looking for active drivers ...
OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Read the response to message 1 (CSW) ...
Response successfully read (13 bytes), status 0
Reset response endpoint 0x81
Reset message endpoint 0x01
Reset USB device ...........
Device reset failed.
-> Run lsusb to note any changes. Bye!

Apr 17 12:40:43 kernel da0: quirks=0x2<NO_6_BYTE>
Apr 17 12:40:43 kernel da0: Attempt to query device size failed: ILLEGAL REQUEST, Invalid field in CDB
Apr 17 12:40:43 kernel da0: 40.000MB/s transfers
Apr 17 12:40:43 kernel da0: <HSPA USB SCSI CD-ROM 6225> Removable Direct Access SCSI device
Apr 17 12:40:43 kernel da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
Apr 17 12:40:43 kernel umass0: <Mass Storage > on usbus4
Apr 17 12:40:43 kernel umass0 on uhub2
Apr 17 12:40:43 kernel ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4
Apr 17 12:40:42 kernel ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4 (disconnected)
Apr 17 12:40:42 kernel umass0: detached
Apr 17 12:40:42 kernel (cd0:umass-sim0:0:0:0): Periph destroyed
Apr 17 12:40:42 kernel cd0: <HSPA USB SCSI CD-ROM 6225> s/n 531399703502680 detached
Apr 17 12:40:42 kernel cd0 at umass-sim0 bus 0 scbus2 target 0 lun 0
Apr 17 12:40:42 kernel umass0: at uhub2, port 1, addr 2 (disconnected)


usb_modeswitch -v 2001 -p a407 -m 1 -M 555342431234567800000000000003f0010200000000000000000000000000 -R 1

Look for default devices ...
Found devices in default mode (1)
Access device 002 on bus 004
Get the current device configuration ...
Current configuration number is 2
Use interface number 0
with class 8
Use endpoints 0x01 (out) and 0x81 (in)
Looking for active drivers ...
OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Read the response to message 1 (CSW) ...
Response successfully read (13 bytes), status 0
Reset response endpoint 0x81
Reset message endpoint 0x01
Reset USB device ...........
Device reset failed.
-> Run lsusb to note any changes. Bye!

Apr 17 12:43:32 kernel da0: quirks=0x2<NO_6_BYTE>
Apr 17 12:43:32 kernel da0: Attempt to query device size failed: ILLEGAL REQUEST, Invalid field in CDB
Apr 17 12:43:32 kernel da0: 40.000MB/s transfers
Apr 17 12:43:32 kernel da0: <HSPA USB SCSI CD-ROM 6225> Removable Direct Access SCSI device
Apr 17 12:43:32 kernel da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
Apr 17 12:43:32 kernel umass0: <Mass Storage > on usbus4
Apr 17 12:43:32 kernel umass0 on uhub2
Apr 17 12:43:32 kernel ue0: Ethernet address: 02:00:ff:aa:aa:aa
Apr 17 12:43:32 kernel ue0: <USB Ethernet> on cdce0
Apr 17 12:43:32 kernel cdce0: <COMcommif> on usbus4
Apr 17 12:43:32 kernel cdce0 on uhub2
Apr 17 12:43:32 kernel ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4
Apr 17 12:43:30 kernel ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4 (disconnected)

with option 2, it gave again ue0, however I don't know what the difference is between option 3 and 2.

Any idea?

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: Need help in supporting DWM 157 D1 donle.

Post by Josh » 17 Apr 2019, 16:16

The details of the layout for each option are only visible when you call the "usbconfig dump_all_desc" after each mode switch.

If you post these layouts here, be so kind and delete the parts for the "Intel Hub" devices. We need only the part that starts with "ugen4.2: <D-Link,Inc D-Link DWM-157>"
Also, the formatting will kept intact if you post the dump output inside of a "Code" tag.

See your previous post for an example. I have edited it with the changes that I've just suggested:
http://draisberghof.de/usb_modeswitch/b ... 149#p19149

You can re-edit it yourself to see how the "Code" tag is used.

chedxb
Posts: 21
Joined: 14 Apr 2019, 14:51

Re: Need help in supporting DWM 157 D1 donle.

Post by chedxb » 17 Apr 2019, 18:24

thanks, here they are

usb_modeswitch -v 2001 -p a407 -m 1 -M 555342431234567800000000000003f0010100000000000000000000000000 -R 1

Code: Select all

ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x00ef  <Miscellaneous device>
  bDeviceSubClass = 0x0002
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x2001
  idProduct = 0x7d0e
  bcdDevice = 0x0300
  iManufacturer = 0x0009  <D-Link,Inc  >
  iProduct = 0x000a  <D-Link DWM-157>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x00e4
    bNumInterfaces = 0x0007
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x00a0
    bMaxPower = 0x00fa

    Additional Descriptor

    bLength = 0x08
    bDescriptorType = 0x0b
    bDescriptorSubType = 0x00
     RAW dump:
     0x00 | 0x08, 0x0b, 0x00, 0x02, 0x02, 0x0e, 0x00, 0x01


    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0002  <Communication device>
      bInterfaceSubClass = 0x000e
      bInterfaceProtocol = 0x0000
      iInterface = 0x0001  <COM(comm_if)>

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x00
       RAW dump:
       0x00 | 0x05, 0x24, 0x00, 0x10, 0x01


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x06
       RAW dump:
       0x00 | 0x05, 0x24, 0x06, 0x00, 0x01


      Additional Descriptor

      bLength = 0x0c
      bDescriptorType = 0x24
      bDescriptorSubType = 0x1b
       RAW dump:
       0x00 | 0x0c, 0x24, 0x1b, 0x00, 0x01, 0x00, 0x02, 0x10,
       0x08 | 0x40, 0xdc, 0x05, 0x20


     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0088  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0040
        bInterval = 0x0001
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 1
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0001
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0000
      bInterfaceClass = 0x000a  <CDC-data>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0002
      iInterface = 0x0002  <COM(data_if)>


    Interface 1 Alt 1
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0001
      bAlternateSetting = 0x0001
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x000a  <CDC-data>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0002
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0001  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 2
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0002
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0003
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0002
      bInterfaceProtocol = 0x0001
      iInterface = 0x0003  <COM(comm_if)>

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x00
       RAW dump:
       0x00 | 0x05, 0x24, 0x00, 0x10, 0x01


      Additional Descriptor

      bLength = 0x04
      bDescriptorType = 0x24
      bDescriptorSubType = 0x02
       RAW dump:
       0x00 | 0x04, 0x24, 0x02, 0x0f


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x06
       RAW dump:
       0x00 | 0x05, 0x24, 0x06, 0x02, 0x03


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x01
       RAW dump:
       0x00 | 0x05, 0x24, 0x01, 0x03, 0x03


     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0087  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0040
        bInterval = 0x0003
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0082  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 2
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0002  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 3
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0003
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0005  <COM(data_if)>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0083  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0003  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 4
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0004
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0006  <COM(data_if)>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0084  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0004  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 5
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0005
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0007  <COM(data_if)>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0085  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0005  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 6
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0006
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x0008  <Mass storage>
      bInterfaceSubClass = 0x0006
      bInterfaceProtocol = 0x0050
      iInterface = 0x0008  <Mass Storage >

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0086  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0006  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

usb_modeswitch -v 2001 -p a407 -m 1 -M 555342431234567800000000000003f0010200000000000000000000000000 -R 1

Code: Select all

ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0002  <Communication device>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x2001
  idProduct = 0x7d0e
  bcdDevice = 0x0300
  iManufacturer = 0x000a  <D-Link,Inc  >
  iProduct = 0x000b  <D-Link DWM-157>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x00e5
    bNumInterfaces = 0x0007
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x00a0
    bMaxPower = 0x00fa

    Additional Descriptor

    bLength = 0x08
    bDescriptorType = 0x0b
    bDescriptorSubType = 0x00
     RAW dump:
     0x00 | 0x08, 0x0b, 0x00, 0x02, 0x02, 0x06, 0x00, 0x02


    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0002  <Communication device>
      bInterfaceSubClass = 0x0006
      bInterfaceProtocol = 0x0000
      iInterface = 0x0002  <COM(comm_if)>

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x00
       RAW dump:
       0x00 | 0x05, 0x24, 0x00, 0x10, 0x01


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x06
       RAW dump:
       0x00 | 0x05, 0x24, 0x06, 0x00, 0x01


      Additional Descriptor

      bLength = 0x0d
      bDescriptorType = 0x24
      bDescriptorSubType = 0x0f
       RAW dump:
       0x00 | 0x0d, 0x24, 0x0f, 0x01, 0x00, 0x00, 0x18, 0x7f,
       0x08 | 0xea, 0x05, 0x00, 0x00, 0x10


     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0088  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0040
        bInterval = 0x0001
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 1
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0001
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0000
      bInterfaceClass = 0x000a  <CDC-data>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0003  <COM(data_if)>


    Interface 1 Alt 1
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0001
      bAlternateSetting = 0x0001
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x000a  <CDC-data>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0001  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 2
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0002
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0003
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0002
      bInterfaceProtocol = 0x0001
      iInterface = 0x0004  <COM(comm_if)>

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x00
       RAW dump:
       0x00 | 0x05, 0x24, 0x00, 0x10, 0x01


      Additional Descriptor

      bLength = 0x04
      bDescriptorType = 0x24
      bDescriptorSubType = 0x02
       RAW dump:
       0x00 | 0x04, 0x24, 0x02, 0x0f


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x06
       RAW dump:
       0x00 | 0x05, 0x24, 0x06, 0x02, 0x03


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x01
       RAW dump:
       0x00 | 0x05, 0x24, 0x01, 0x03, 0x03


     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0087  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0040
        bInterval = 0x0003
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0082  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 2
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0002  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 3
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0003
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0006  <COM(data_if)>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0083  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0003  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 4
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0004
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0007  <COM(data_if)>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0084  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0004  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 5
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0005
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0008  <COM(data_if)>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0085  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0005  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 6
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0006
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x0008  <Mass storage>
      bInterfaceSubClass = 0x0006
      bInterfaceProtocol = 0x0050
      iInterface = 0x0009  <Mass Storage >

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0086  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0006  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: Need help in supporting DWM 157 D1 donle.

Post by Josh » 18 Apr 2019, 07:29

Thanks, that's excellent!

To complete the research, is there a difference to these layouts when you use "option 3"?
If it does not exactly match any of the previous layouts, please post it too.

chedxb
Posts: 21
Joined: 14 Apr 2019, 14:51

Re: Need help in supporting DWM 157 D1 donle.

Post by chedxb » 18 Apr 2019, 07:42

this is with option 3

usb_modeswitch -v 2001 -p a407 -m 1 -M 555342431234567800000000000003f0010300000000000000000000000000 -R 1

Code: Select all

ugen4.2: <D-Link,Inc D-Link DWM-157> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0002  <Communication device>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x2001
  idProduct = 0x7d0e
  bcdDevice = 0x0300
  iManufacturer = 0x000a  <D-Link,Inc  >
  iProduct = 0x000b  <D-Link DWM-157>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x00e5
    bNumInterfaces = 0x0007
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x00a0
    bMaxPower = 0x00fa

    Additional Descriptor

    bLength = 0x08
    bDescriptorType = 0x0b
    bDescriptorSubType = 0x00
     RAW dump:
     0x00 | 0x08, 0x0b, 0x00, 0x02, 0x02, 0x06, 0x00, 0x02


    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0002  <Communication device>
      bInterfaceSubClass = 0x0006
      bInterfaceProtocol = 0x0000
      iInterface = 0x0002  <COM(comm_if)>

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x00
       RAW dump:
       0x00 | 0x05, 0x24, 0x00, 0x10, 0x01


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x06
       RAW dump:
       0x00 | 0x05, 0x24, 0x06, 0x00, 0x01


      Additional Descriptor

      bLength = 0x0d
      bDescriptorType = 0x24
      bDescriptorSubType = 0x0f
       RAW dump:
       0x00 | 0x0d, 0x24, 0x0f, 0x01, 0x00, 0x00, 0x18, 0x7f,
       0x08 | 0xea, 0x05, 0x00, 0x00, 0x10


     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0088  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0040
        bInterval = 0x0001
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 1
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0001
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0000
      bInterfaceClass = 0x000a  <CDC-data>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0003  <COM(data_if)>


    Interface 1 Alt 1
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0001
      bAlternateSetting = 0x0001
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x000a  <CDC-data>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0001  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 2
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0002
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0003
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0002
      bInterfaceProtocol = 0x0001
      iInterface = 0x0004  <COM(comm_if)>

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x00
       RAW dump:
       0x00 | 0x05, 0x24, 0x00, 0x10, 0x01


      Additional Descriptor

      bLength = 0x04
      bDescriptorType = 0x24
      bDescriptorSubType = 0x02
       RAW dump:
       0x00 | 0x04, 0x24, 0x02, 0x0f


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x06
       RAW dump:
       0x00 | 0x05, 0x24, 0x06, 0x02, 0x03


      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x01
       RAW dump:
       0x00 | 0x05, 0x24, 0x01, 0x03, 0x03


     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0087  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0040
        bInterval = 0x0001
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0082  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 2
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0002  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 3
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0003
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0006  <COM(data_if)>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0083  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0003  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 4
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0004
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0007  <COM(data_if)>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0084  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0004  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 5
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0005
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0008  <COM(data_if)>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0085  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0005  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000


    Interface 6
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0006
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x0008  <Mass storage>
      bInterfaceSubClass = 0x0006
      bInterfaceProtocol = 0x0050
      iInterface = 0x0009  <Mass Storage >

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0086  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0006  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

chedxb
Posts: 21
Joined: 14 Apr 2019, 14:51

Re: Need help in supporting DWM 157 D1 donle.

Post by chedxb » 18 Apr 2019, 07:52

between option 3 and 2, only one line is different;

line 185

bInterval = 0x0001 vs. bInterval = 0x0003

between option 3 and 1, there are many

LOM
Posts: 1380
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: Need help in supporting DWM 157 D1 donle.

Post by LOM » 18 Apr 2019, 11:46

chedxb wrote:between option 3 and 2, only one line is different;

line 185

bInterval = 0x0001 vs. bInterval = 0x0003

between option 3 and 1, there are many
That is for the interrupt endpoint of the serial modem interface and affects the endpoint polling time, 0001 is a faster polling time than 0003.

The main difference is between option 1 and option 2/3 where option 1 has mbim as network protocol and is intended mainly for MS Windows. Option 2/3 has cdc_ether and is for Apple, they have no other network protocols than ethernet. Linux has both of these protocols but mbim is preferred.
Option 1 is the same as cd-rom eject.

What we've learned from all this is that there is an alternative mode for Mediatek based devices or at least those manufactured by BroadMobi.

chedxb
Posts: 21
Joined: 14 Apr 2019, 14:51

Re: Need help in supporting DWM 157 D1 donle.

Post by chedxb » 18 Apr 2019, 12:12

Thanks, it was a good learning experience for me.

Best,

Savas

Post Reply