Bug 244798 - Please add D-link dwm-157 rev c to usbdevs
Summary: Please add D-link dwm-157 rev c to usbdevs
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 11.2-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-usb (Nobody)
URL: https://forum.netgate.com/topic/15116...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-13 22:13 UTC by super_gromit
Modified: 2020-03-23 18:53 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description super_gromit 2020-03-13 22:13:58 UTC
i have rev-c of this device but its not listed in usbdevs as a result the serial ports do not show up and it is unable to be used with u3g

 idVendor = 0x2001
 idProduct = 0x7d0e 

the older rev-b is in usbdevs

vendor DLINK		0x2001	D-Link
product DLINK DWM157	0x7d02  DWM-157

i made an edit to the product in /usr/src/sys/dev/usb/usbdevs and recompiled the kernel and it was then detected by u3g could this be added please
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2020-03-14 09:55:16 UTC
Can you check these ID's in Linux and see if more ID's should be added?
Comment 2 super_gromit 2020-03-14 13:43:16 UTC
(In reply to Hans Petter Selasky from comment #1)

sure

[48377.001381] usb 1-1.3.4: new high-speed USB device number 8 using dwc_otg
[48377.132609] usb 1-1.3.4: New USB device found, idVendor=2001, idProduct=a407, bcdDevice= 3.00
[48377.132621] usb 1-1.3.4: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[48377.132625] usb 1-1.3.4: Product: D-Link DWM-157
[48377.132629] usb 1-1.3.4: Manufacturer: D-Link,Inc
[48377.132633] usb 1-1.3.4: SerialNumber: 536512504976220
[48377.133397] usb-storage 1-1.3.4:1.0: USB Mass Storage device detected
[48377.133930] scsi host0: usb-storage 1-1.3.4:1.0
[48377.496752] usbcore: registered new interface driver uas
[48378.291519] usb 1-1.3.4: USB disconnect, device number 8
[48379.051335] usb 1-1.3.4: new high-speed USB device number 9 using dwc_otg
[48379.184464] usb 1-1.3.4: New USB device found, idVendor=2001, idProduct=7d0e, bcdDevice= 3.00
[48379.184510] usb 1-1.3.4: New USB device strings: Mfr=9, Product=10, SerialNumber=0
[48379.184520] usb 1-1.3.4: Product: D-Link DWM-157
[48379.184529] usb 1-1.3.4: Manufacturer: D-Link,Inc
[48379.195142] usb-storage 1-1.3.4:1.6: USB Mass Storage device detected
[48379.196887] scsi host0: usb-storage 1-1.3.4:1.6
[48379.230586] usbcore: registered new interface driver cdc_ncm
[48379.250277] usbcore: registered new interface driver option
[48379.250296] usbcore: registered new interface driver cdc_wdm
[48379.250360] usbserial: USB Serial support registered for GSM modem (1-port)
[48379.251885] option 1-1.3.4:1.2: GSM modem (1-port) converter detected
[48379.259778] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB1
[48379.261708] option 1-1.3.4:1.3: GSM modem (1-port) converter detected
[48379.262813] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB2
[48379.264328] option 1-1.3.4:1.4: GSM modem (1-port) converter detected
[48379.265197] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB3
[48379.266689] option 1-1.3.4:1.5: GSM modem (1-port) converter detected
[48379.267670] usb 1-1.3.4: GSM modem (1-port) converter now attached to ttyUSB4
[48379.292819] cdc_mbim 1-1.3.4:1.0: cdc-wdm0: USB WDM device
[48379.294836] cdc_mbim 1-1.3.4:1.0 wwan0: register 'cdc_mbim' at usb-3f980000.usb-1.3.4, CDC MBIM, 3e:75:db:26:6f:d8
[48379.295087] usbcore: registered new interface driver cdc_mbim
[48380.212937] scsi 0:0:0:0: Direct-Access     HSPA USB SCSI CD-ROM      6225 PQ: 0 ANSI: 0 CCS
[48380.232134] sd 0:0:0:0: [sda] 0 512-byte logical blocks: (0 B/0 B)
[48380.232151] sd 0:0:0:0: [sda] 0-byte physical blocks
[48380.232717] sd 0:0:0:0: [sda] Test WP failed, assume Write Enabled


so i believe there are 2 modes:

idVendor=2001, idProduct=a407   cd mode
idVendor=2001, idProduct=7d0e  modem mode where u3g could access the 4 serial ports
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2020-03-14 15:36:39 UTC
Can you also check the Linux source code for those idVendor and idProduct values. Usually they are part of an USB ID table, and there might be more devices we could easily add in FreeBSD!

--HPS
Comment 4 Hans Petter Selasky freebsd_committer freebsd_triage 2020-03-14 15:51:01 UTC
Have a look here:

https://github.com/torvalds/linux/blob/master/drivers/usb/serial/option.c#L575

It would be really helpful if you could compare the ID list there and the one we have in FreeBSD!

--HPS
Comment 5 super_gromit 2020-03-14 16:38:03 UTC
(In reply to Hans Petter Selasky from comment #4)
i only have the c1 variant but in your link they look correct for my device not sure about others 

https://draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=3&t=2496 has a bit of info on the device

if there is anything you need you may need to give me an idiots guide to do it
Comment 6 Hans Petter Selasky freebsd_committer freebsd_triage 2020-03-14 17:46:17 UTC
If you are not familiar with C-programming, I'll handle it.

Is this issue urgent?

The information you've provided is enough to add your device.

The patch should look like this, newbie guide:

https://svnweb.freebsd.org/base?view=revision&revision=324607

--HPS
Comment 7 super_gromit 2020-03-15 00:23:35 UTC
(In reply to Hans Petter Selasky from comment #6)
i think its best you handle it as i'm not sure i'm capable of doing it correctly.
Comment 8 Hans Petter Selasky freebsd_committer freebsd_triage 2020-03-15 11:08:03 UTC
I'll have a look next week.

--HPS
Comment 9 commit-hook freebsd_committer freebsd_triage 2020-03-17 09:13:16 UTC
A commit references this bug:

Author: hselasky
Date: Tue Mar 17 09:12:48 UTC 2020
New revision: 359031
URL: https://svnweb.freebsd.org/changeset/base/359031

Log:
  Add new USB device ID to u3g driver.

  Submitted by:	super_gromit@hotmail.com
  PR:		244798
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Changes:
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usbdevs
Comment 10 Hans Petter Selasky freebsd_committer freebsd_triage 2020-03-17 09:13:42 UTC
Please try this patch and post dmesg from FreeBSD.

Thank you!

--HPS
Comment 11 commit-hook freebsd_committer freebsd_triage 2020-03-23 18:32:13 UTC
A commit references this bug:

Author: hselasky
Date: Mon Mar 23 18:31:14 UTC 2020
New revision: 359256
URL: https://svnweb.freebsd.org/changeset/base/359256

Log:
  MFC r359031:
  Add new USB device ID to u3g driver.

  Submitted by:	super_gromit@hotmail.com
  PR:		244798
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/12/
  stable/12/sys/dev/usb/serial/u3g.c
  stable/12/sys/dev/usb/usbdevs
Comment 12 commit-hook freebsd_committer freebsd_triage 2020-03-23 18:53:15 UTC
A commit references this bug:

Author: hselasky
Date: Mon Mar 23 18:52:57 UTC 2020
New revision: 359259
URL: https://svnweb.freebsd.org/changeset/base/359259

Log:
  MFC r359031:
  Add new USB device ID to u3g driver.

  Submitted by:	super_gromit@hotmail.com
  PR:		244798
  Sponsored by:	Mellanox Technologies

Changes:
_U  stable/11/
  stable/11/sys/dev/usb/serial/u3g.c
  stable/11/sys/dev/usb/usbdevs