Hi,

The patch at the end should add support for USB wifi dongle
DWA-121 from D-Link [1].

The USB id of such device is 2001:331b.

lykke$ usbdevs
Controller /dev/usb0:
addr 01: 0000:0000 Generic, EHCI root hub
Controller /dev/usb1:
addr 01: 0000:0000 Generic, EHCI root hub
addr 02: 05e3:0608 Genesys Logic, USB2.0 Hub
addr 03: 0c45:6321 Sonix Technology Co., Ltd., USB Camera
Controller /dev/usb2:
addr 01: 0000:0000 Generic, xHCI root hub
Controller /dev/usb3:
addr 01: 0000:0000 Generic, xHCI root hub
addr 02: 2001:331b Realtek\r,
Controller /dev/usb4:
addr 01: 0000:0000 Generic, OHCI root hub
addr 02: 258a:001e HAILUCK CO.,LTD, USB KEYBOARD
Controller /dev/usb5:
addr 01: 0000:0000 Generic, OHCI root hub

Relevant dmesg message (full dmesg is attached):

urtwn0 at uhub3 port 1 configuration 1 interface 0 "Realtek " rev 2.00/0.00 
addr 2
urtwn0: MAC/BB RTL8188EU, RF 6052 1T1R, address 60:63:4c:xx:xx:xx

Thanks,
Miguel.

1. https://eu.dlink.com/uk/en/products/dwa-121-wireless-n-150-pico-usb-adapter


Index: sys/dev/usb/if_urtwn.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/if_urtwn.c,v
retrieving revision 1.90
diff -u -p -r1.90 if_urtwn.c
--- sys/dev/usb/if_urtwn.c      11 Jun 2020 00:56:12 -0000      1.90
+++ sys/dev/usb/if_urtwn.c      6 Jul 2020 08:26:30 -0000
@@ -328,6 +328,7 @@ static const struct urtwn_type {
        URTWN_DEV_8188EU(REALTEK,       RTL8188ETV),
        URTWN_DEV_8188EU(REALTEK,       RTL8188EU),
        URTWN_DEV_8188EU(TPLINK,        RTL8188EUS),
+       URTWN_DEV_8188EU(DLINK,         DWA121B1),
        /* URTWN_RTL8192EU */
        URTWN_DEV_8192EU(DLINK,         DWA131E1),
        URTWN_DEV_8192EU(REALTEK,       RTL8192EU),
Index: sys/dev/usb/usbdevs
===================================================================
RCS file: /cvs/src/sys/dev/usb/usbdevs,v
retrieving revision 1.717
diff -u -p -r1.717 usbdevs
--- sys/dev/usb/usbdevs 22 Jun 2020 15:49:37 -0000      1.717
+++ sys/dev/usb/usbdevs 6 Jul 2020 08:26:30 -0000
@@ -1565,6 +1565,7 @@ product DLINK DWA125D1            0x330f  DWA-125 r
 product DLINK DWA123D1         0x3310  DWA-123 rev D1
 product DLINK DWA137A1         0x3317  DWA-137 rev A1
 product DLINK DWA131E1         0x3319  DWA-131 rev E1
+product DLINK DWA121B1         0x331b  DWA-121 rev B1
 product DLINK DWA182D1         0x331c  DWA-182 rev D1
 product DLINK DWA171C1         0x331d  DWA-171 rev C1
 product DLINK DWL122           0x3700  DWL-122
Index: sys/dev/usb/usbdevs.h
===================================================================
RCS file: /cvs/src/sys/dev/usb/usbdevs.h,v
retrieving revision 1.729
diff -u -p -r1.729 usbdevs.h
--- sys/dev/usb/usbdevs.h       22 Jun 2020 15:52:39 -0000      1.729
+++ sys/dev/usb/usbdevs.h       6 Jul 2020 08:26:30 -0000
@@ -1570,6 +1570,7 @@
 #define        USB_PRODUCT_DLINK_DWA131B       0x330d          /* DWA-131 rev 
B */
 #define        USB_PRODUCT_DLINK_DWA125D1      0x330f          /* DWA-125 rev 
D1 */
 #define        USB_PRODUCT_DLINK_DWA123D1      0x3310          /* DWA-123 rev 
D1 */
+#define        USB_PRODUCT_DLINK_DWA121B1      0x331b          /* DWA-121 rev 
B1 */
 #define        USB_PRODUCT_DLINK_DWA137A1      0x3317          /* DWA-137 rev 
A1 */
 #define        USB_PRODUCT_DLINK_DWA131E1      0x3319          /* DWA-131 rev 
E1 */
 #define        USB_PRODUCT_DLINK_DWA182D1      0x331c          /* DWA-182 rev 
D1 */
Index: sys/dev/usb/usbdevs_data.h
===================================================================
RCS file: /cvs/src/sys/dev/usb/usbdevs_data.h,v
retrieving revision 1.723
diff -u -p -r1.723 usbdevs_data.h
--- sys/dev/usb/usbdevs_data.h  22 Jun 2020 15:52:39 -0000      1.723
+++ sys/dev/usb/usbdevs_data.h  6 Jul 2020 08:26:31 -0000
@@ -2618,6 +2618,10 @@ const struct usb_known_product usb_known
            "DWA-123 rev D1",
        },
        {
+           USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DWA121B1,
+           "DWA-121 rev B1",
+       },
+       {
            USB_VENDOR_DLINK, USB_PRODUCT_DLINK_DWA137A1,
            "DWA-137 rev A1",
        },


-- 
Miguel Landaeta, nomadium at debian.org
secure email with PGP 0x6E608B637D8967E9 available at http://miguel.cc/key.
"Faith means not wanting to know what is true." -- Nietzsche
OpenBSD 6.7-current (CUSTOM) #0: Fri Jul  3 14:18:45 IST 2020
    mig...@lykke.nomadium.net:/sys/arch/arm64/compile/CUSTOM
real mem  = 4092612608 (3903MB)
avail mem = 3891392512 (3711MB)
random: good seed from bootblocks
mainbus0 at root: Pine64 Pinebook Pro
psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
cpu1 at mainbus0 mpidr 1: ARM Cortex-A53 r0p4
cpu1: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu1: 512KB 64b/line 16-way L2 cache
cpu2 at mainbus0 mpidr 2: ARM Cortex-A53 r0p4
cpu2: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu2: 512KB 64b/line 16-way L2 cache
cpu3 at mainbus0 mpidr 3: ARM Cortex-A53 r0p4
cpu3: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu3: 512KB 64b/line 16-way L2 cache
cpu4 at mainbus0 mpidr 100: ARM Cortex-A72 r0p2
cpu4: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
cpu4: 1024KB 64b/line 16-way L2 cache
cpu5 at mainbus0 mpidr 101: ARM Cortex-A72 r0p2
cpu5: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
cpu5: 1024KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.8
efi0: Das U-Boot rev 0x20200100
apm0 at mainbus0
agintc0 at mainbus0 sec shift 3:3 nirq 288 nredist 6 ipi: 0, 1: 
"interrupt-controller"
agintcmsi0 at agintc0
syscon0 at mainbus0: "qos"
syscon1 at mainbus0: "qos"
syscon2 at mainbus0: "qos"
syscon3 at mainbus0: "qos"
syscon4 at mainbus0: "qos"
syscon5 at mainbus0: "qos"
syscon6 at mainbus0: "qos"
syscon7 at mainbus0: "qos"
syscon8 at mainbus0: "qos"
syscon9 at mainbus0: "qos"
syscon10 at mainbus0: "qos"
syscon11 at mainbus0: "qos"
syscon12 at mainbus0: "qos"
syscon13 at mainbus0: "qos"
syscon14 at mainbus0: "qos"
syscon15 at mainbus0: "qos"
syscon16 at mainbus0: "qos"
syscon17 at mainbus0: "qos"
syscon18 at mainbus0: "qos"
syscon19 at mainbus0: "qos"
syscon20 at mainbus0: "qos"
syscon21 at mainbus0: "qos"
syscon22 at mainbus0: "qos"
syscon23 at mainbus0: "qos"
syscon24 at mainbus0: "qos"
syscon25 at mainbus0: "power-management"
"power-controller" at syscon25 not configured
syscon26 at mainbus0: "syscon"
"io-domains" at syscon26 not configured
rkclock0 at mainbus0
rkclock1 at mainbus0
syscon27 at mainbus0: "syscon"
"io-domains" at syscon27 not configured
"usb2-phy" at syscon27 not configured
"usb2-phy" at syscon27 not configured
rkemmcphy0 at syscon27
"pcie-phy" at syscon27 not configured
rkpinctrl0 at mainbus0: "pinctrl"
rkgpio0 at rkpinctrl0
rkgpio1 at rkpinctrl0
rkgpio2 at rkpinctrl0
rkgpio3 at rkpinctrl0
rkgpio4 at rkpinctrl0
pwmreg0 at mainbus0
rkdrm0 at mainbus0
drm0 at rkdrm0
"pmu_a53" at mainbus0 not configured
"pmu_a72" at mainbus0 not configured
agtimer0 at mainbus0: tick rate 24000 KHz
"xin24m" at mainbus0 not configured
simplebus0 at mainbus0: "amba"
"dma-controller" at simplebus0 not configured
"dma-controller" at simplebus0 not configured
rkpcie0 at mainbus0
rkpcie0: link training timeout
dwmmc0 at mainbus0: 50 MHz base clock
sdmmc0 at dwmmc0: 4-bit, sd high-speed, dma
dwmmc1 at mainbus0: 50 MHz base clock
sdmmc1 at dwmmc1: 4-bit, sd high-speed, mmc high-speed, dma
sdhc0 at mainbus0
sdhc0: SDHC 3.0, 200 MHz base clock
sdmmc2 at sdhc0: 8-bit, sd high-speed, mmc high-speed, dma
ehci0 at mainbus0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 
addr 1
ohci0 at mainbus0: version 1.0
ehci1 at mainbus0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 
addr 1
ohci1 at mainbus0: version 1.0
rkdwusb0 at mainbus0: "usb"
xhci0 at rkdwusb0, xHCI 1.10
usb2 at xhci0: USB revision 3.0
uhub2 at usb2 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 
addr 1
rkdwusb1 at mainbus0: "usb"
xhci1 at rkdwusb1, xHCI 1.10
usb3 at xhci1: USB revision 3.0
uhub3 at usb3 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 
addr 1
"dp" at mainbus0 not configured
"saradc" at mainbus0 not configured
rkiic0 at mainbus0
iic0 at rkiic0
escodec0 at iic0 addr 0x11
rkiic1 at mainbus0
iic1 at rkiic1
com0 at mainbus0: ns16550, no working fifo
com1 at mainbus0: ns16550, no working fifo
com1: console
"spi" at mainbus0 not configured
rktemp0 at mainbus0
rkiic2 at mainbus0
iic2 at rkiic2
rkpmic0 at iic2 addr 0x1b: RK808
fanpwr0 at iic2 addr 0x40: SYR827, 1.00 VDC
fanpwr1 at iic2 addr 0x41: SYR828, 1.00 VDC
rkiic3 at mainbus0
iic3 at rkiic3
fusbtc0 at iic3 addr 0x22
cwfg0 at iic3 addr 0x62
rkpwm0 at mainbus0
rkpwm1 at mainbus0
"video-codec" at mainbus0 not configured
"iommu" at mainbus0 not configured
"rga" at mainbus0 not configured
"efuse" at mainbus0 not configured
"phy" at mainbus0 not configured
"phy" at mainbus0 not configured
"watchdog" at mainbus0 not configured
"rktimer" at mainbus0 not configured
rkiis0 at mainbus0
rkvop0 at mainbus0: RK3399 VOPL
"iommu" at mainbus0 not configured
rkvop1 at mainbus0: RK3399 VOPB
"iommu" at mainbus0 not configured
"iommu" at mainbus0 not configured
"iommu" at mainbus0 not configured
simpleaudio0 at mainbus0
rkanxdp0 at mainbus0: eDP TX
"gpu" at mainbus0 not configured
"opp-table0" at mainbus0 not configured
"opp-table1" at mainbus0 not configured
"opp-table2" at mainbus0 not configured
simplepanel0 at mainbus0
"leds" at mainbus0 not configured
"gpio-keys" at mainbus0 not configured
pwmbl0 at mainbus0
"sdio-pwrseq" at mainbus0 not configured
"wireless-wlan" at mainbus0 not configured
simpleaudio1 at mainbus0
simpleamp0 at mainbus0
"vcc-sysin" at mainbus0 not configured
"vcc-12v" at mainbus0 not configured
"vcc3v3-sys" at mainbus0 not configured
"vcc5v0-usb-regulator" at mainbus0 not configured
"vcc-0v9" at mainbus0 not configured
"vcc1v8-s3" at mainbus0 not configured
"vcc3v0-sd" at mainbus0 not configured
"vcc3v3-panel" at mainbus0 not configured
"vcc3v3-ssd" at mainbus0 not configured
"vcc5v0-otg" at mainbus0 not configured
"vbus-5vout" at mainbus0 not configured
"dc-charger" at mainbus0 not configured
"usb-charger" at mainbus0 not configured
usb4 at ohci0: USB revision 1.0
uhub4 at usb4 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 
addr 1
usb5 at ohci1: USB revision 1.0
uhub5 at usb5 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 
addr 1
audio0 at simpleaudio1
bwfm0 at sdmmc0 function 1
manufacturer 0x02d0, product 0xa9bf at sdmmc0 function 2 not configured
manufacturer 0x02d0, product 0xa9bf at sdmmc0 function 3 not configured
scsibus0 at sdmmc2: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <Sandisk, DA4064, 0000> removable
sd0: 59640MB, 512 bytes/sector, 122142720 sectors
uhub6 at uhub1 port 1 configuration 1 interface 0 "Genesys Logic USB2.0 Hub" 
rev 2.00/85.36 addr 2
uvideo0 at uhub6 port 2 configuration 1 interface 0 "Sonix Technology Co., Ltd. 
USB Camera" rev 2.00/0.00 addr 3
video0 at uvideo0
urtwn0 at uhub3 port 1 configuration 1 interface 0 "Realtek " rev 2.00/0.00 
addr 2
urtwn0: MAC/BB RTL8188EU, RF 6052 1T1R, address 60:63:4c:xx:xx:xx
uhidev0 at uhub4 port 1 configuration 1 interface 0 "HAILUCK CO.,LTD USB 
KEYBOARD" rev 1.10/1.00 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd0 at ukbd0 mux 1
uhidev1 at uhub4 port 1 configuration 1 interface 1 "HAILUCK CO.,LTD USB 
KEYBOARD" rev 1.10/1.00 addr 2
uhidev1: iclass 3/0, 35 report ids
umt0 at uhidev1: clickpad, 4 contacts
wsmouse0 at umt0 mux 0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: sd0
root on sd0a (e38911d56ab955ae.a) swap on sd0b dump on sd0b
rkvop0: using CRTC 0 for RK3399 VOPL
rkvop1: using CRTC 1 for RK3399 VOPB
rkdrm0: 1920x1080, 32bpp
wsdisplay0 at rkdrm0 mux 1
wskbd0: connecting to wsdisplay0
wsdisplay0: screen 0-5 added (std, vt100 emulation)
bwfm0: failed loadfirmware of file brcmfmac43456-sdio.bin

Reply via email to