# Is usb_modeswitch work with 0bda:1a2b ?



## Logicien (Jul 2, 2022)

Hello friends,
 I have this lightweight wifi/bluetooth device

Bus /dev/usb Device /dev/ugen0.2: ID 0bda:1a2b Realtek Semiconductor Corp. RTL8188GU 802.11n WLAN Adapter (Driver CDROM Mode)

The problem is that this command

usb_modeswitch -KW -v 0bda -p 1a2b

work on Linux to make the device switch mode but not on FreeBSD. I have search and try many commands and configurations for usb_modeswitch.conf but ... no luck. Is someone know the solution or more than me in the universe? In plus is this Realtek usb wifi supported by FreeBSD?


----------



## tingo (Jul 2, 2022)

One way to look for supported hardware on FreeBSD is to check if there are man pages. As an example, let's look for man pages with "RealTek" in them:

```
tingo@kg-core1:~ $ apropos realtek
re, if_re(4) - RealTek 8139C+/8169/816xS/811xS/8168/810xE/8111 PCI/PCIe Ethernet adapter driver
rgephy(4) - RealTek RTL8168/8169/8110/8211 series 10/100/1000 Gigabit Ethernet PHY driver
rl, if_rl(4) - RealTek 8129/8139 Fast Ethernet device driver
rsu, if_rsu(4) - Realtek RTL8188SU/RTL8192SU USB IEEE 802.11b/g/n wireless network device
rsufw(4) - Firmware Module for Realtek driver
rtsx(4) - Realtek SD card reader
rtwn(4) - Realtek IEEE 802.11 wireless network driver
rtwn_pci, if_rtwn_pci(4) - Realtek PCI device glue
rtwn_usb, if_rtwn_usb(4) - Realtek USB device glue
rtwnfw(4) - Firmware Module for Realtek Wireless driver
rue, if_rue(4) - RealTek RTL8150 USB to Fast Ethernet controller driver
ure, if_ure(4) - RealTek RTL8152/RTL8153 USB to Ethernet controller driver
urtw, if_urtw(4) - Realtek RTL8187B/L USB IEEE 802.11b/g wireless network device
```
this was done on a 13.1 machine

```
tingo@kg-core1:~ $ freebsd-version -ku
13.1-RELEASE
13.1-RELEASE
```


----------



## Phishfry (Jul 2, 2022)

Have you looked in the source file /usr/src/sys/dev/usb/usbdevs to see it the VID and PID are supported?


----------



## Phishfry (Jul 2, 2022)

I think it helps to understand what mode you are switching from/to.

For example on USB cellular modems there is sometimes a disk drive present for the Windows drivers.
Mass Storage Device it is called. It contains files and interferes with modem being recognized.
So you have to 'modeswitch' to disable the mass storage device.
This is a message that gets sent to the device by devd. Messages can be quite a long string.

So ask yourself. First, Is it supported in usbdevs and what mode am I trying to switch to/from?
Perhaps bluetooth on the device interferes and you must modeswitch it off.
Some reason Linux needs to use modeswitch on the device. You need to figure out what it is.
What modes (messages) it offers.

Also make sure the -KW flags are valid for FreeBSD modeswitch. There may be different syntax.


----------



## Logicien (Jul 4, 2022)

Hello,

thank's for the replies. About the syntax difference between Linux and FreeBSD on usb_modeswitch I have to compare in details. No mode switch for me so far on FreeBSD.

I have  not use /usr/src/sys/dev/usb/usbdevs the sources are not installed. I checked /usr/share/misc/usbdevs and of course IDVendor Realtek is in the list

*grep -i 0bda /usr/share/misc/usbdevs*
vendor REALTEK        0x0bda    Realtek

but my wifi/bluetooth IDProduct is not in the list

*grep -i 1a2b /usr/share/misc/usbdevs*

but some others Realtek wifi I have are in

*grep -i b812 /usr/share/misc/usbdevs*
product FTDI USINT_RS232    0xb812    FTDI compatible adapter

*grep a811 /usr/share/misc/usbdevs*
product EDIMAX EW7811UTC_1    0xa811    EW-7811UTC
product REALTEK RTL8821AU_1    0xa811    RTL8821AU

Still searching a way to use this dongle. Anyway even if the mode switch and I can have Bluetooth and wifi available from this card, Bluetooth and this Realtek wifi are not supported by FreeBSD for the moment.

https://bsd-hardware.info/?id=usb:0bda-1a2b


----------



## Logicien (Jul 19, 2022)

Some news, since some boots usb_modeswitch do the switch from cdrom to bluetooth and wifi. I can see bluetooth devices and connect but nothing happen with my Logitech H800, I have no sound. The bluetooth keyboard I have connect but no charecter appear to the command line. My Realtek usb3 wifi do not have the firmware file for 8821cu chip. Maybe if I can find it for FreeBSD it would be drive. Any help is welcome.


----------

