Re: Huawei mobile/wifi gadgets: HOWTO

2019-08-16 Thread Hans Petter Selasky

On 2019-08-16 11:07, Poul-Henning Kamp wrote:

The remaining issue is: How to get FreeBSD do send the magic string?


FreeBSD USB has several quirks for these devices:

See for example:


/sys/dev/usb/usb_msctest.c:usb_msc_auto_quirk(struct usb_device *udev, uint8_t 
iface_index)
/sys/dev/usb/usb_msctest.h:usb_error_t usb_msc_auto_quirk(struct usb_device 
*udev,
/sys/dev/usb/usb_device.c:  err = usb_msc_auto_quirk(udev, 0);


And:

usbconfig dump_quirk_names | grep -i UQ_MSC

--HPS
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Huawei mobile/wifi gadgets: HOWTO

2019-08-16 Thread Poul-Henning Kamp
This seems to be sort of a FAQ, and I had a chance to spend a couple of
quality minutes with one of these devices.

The fundamental problem is that they come up as a CD device, with Windows
software to do whatever it takes.

Sending them a magic USB command enables other interfaces, including
serial/modem, USB ethernet etc.

The remaining issue is: How to get FreeBSD do send the magic string?

A file in /etc/devd along these lines will do it:

notify 1000 {
match "system"  "GEOM";
match "type""CREATE";
match "cdev""iso9660/MOBILEWIFI";
action "/usr/local/sbin/usb_modeswitch -v 0x12d1 -p 0x15ca -J";
};

It works by reacting to the CD device appearing, which seems to be a
sure-fire indication that the device is in wrong mode.

You may have to adjust the precise "cdev" name (ls /dev/iso9660) and
vendor/product numbers (usbconfig dump_device_desc), and obviously
you have to install the usb_modeswitch port.

The -J argument seems to be what all newer Huawei devices want.

Add ifconfig_ue0=DHCP in /etc/rc.conf, and you should be set.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@freebsd.org | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"