Bug 220879 - Add support for Huawai E398 4G modem
Summary: Add support for Huawai E398 4G modem
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-usb mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-07-20 10:02 UTC by Jakob Alvermark
Modified: 2017-07-21 15:35 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 Jakob Alvermark 2017-07-20 10:02:39 UTC
Index: sys/dev/usb/serial/u3g.c
===================================================================
--- sys/dev/usb/serial/u3g.c	(revision 321286)
+++ sys/dev/usb/serial/u3g.c	(working copy)
@@ -241,6 +241,7 @@
 	U3G_DEV(HP, HS2300, 0),
 	U3G_DEV(HP, UN2420_QDL, 0),
 	U3G_DEV(HP, UN2420, 0),
+	U3G_DEV(HUAWEI, E398, U3GINIT_HUAWEI),
 	U3G_DEV(HUAWEI, E1401, U3GINIT_HUAWEI),
 	U3G_DEV(HUAWEI, E1402, U3GINIT_HUAWEI),
 	U3G_DEV(HUAWEI, E1403, U3GINIT_HUAWEI),
Index: sys/dev/usb/usbdevs
===================================================================
--- sys/dev/usb/usbdevs	(revision 321286)
+++ sys/dev/usb/usbdevs	(working copy)
@@ -2368,6 +2368,7 @@
 product HUAWEI MOBILE		0x1001	Huawei Mobile
 product HUAWEI E220		0x1003	HSDPA modem
 product HUAWEI E220BIS		0x1004	HSDPA modem
+product HUAWEI E398		0x12d1	4G modem
 product HUAWEI E1401		0x1401	3G modem
 product HUAWEI E1402		0x1402	3G modem
 product HUAWEI E1403		0x1403	3G modem
Comment 1 Ed Maste freebsd_committer 2017-07-20 18:34:06 UTC
Something seems odd here: 0x12d1 is Huawei's Vendor ID, and I haven't found any  reference to 12d1:12d1. I can find references to E398 with a USB ID of 12d1:1505, which is the same as E392 already in usbdevs.
Comment 2 Hans Petter Selasky freebsd_committer 2017-07-21 05:42:42 UTC
What is the origin of this ID? Can you show the dump from usbconfig for device and configuration descriptors?

Thank you!

--HPS
Comment 3 Jakob Alvermark 2017-07-21 08:23:11 UTC
Ed: You are right. I mixed up the vendor and product ID. Product ID is 0x1505, so it is already supported. In sys/dev/usb/usbdevs it is labeled as E392, but my device is an E398, which probably made me confused...
I am sorry, disregard this patch.

If I 'kldload u3g' it works. But I wonder why devd does not pick it up?

/etc/devd/usb.conf has this section:
nomatch 32 {
        match "bus" "uhub[0-9]+";
        match "mode" "host";
        match "vendor" "0x12d1";
        match "product" "(0x1001|0x1003|0x1004|0x1401|0x1402|0x1403|0x1404|0x1405|0x1406|0x1407|0x1408|0x1409|0x140a|0x140b|0x140c|0x140d|0x140e|0x140f|0x1410|0x1411|0x1412|0x1413|0x1414|0x1415|0x1416|0x1417|0x1418|0x1419|0x141a|0x141b|0x141c|0x141d|0x141e|0x141f|0x1420|0x1421|0x1422|0x1423|0x1424|0x1425|0x1426|0x1427|0x1428|0x1429|0x142a|0x142b|0x142c|0x142d|0x142e|0x142f|0x1430|0x1431|0x1432|0x1433|0x1434|0x1435|0x1436|0x1437|0x1438|0x1439|0x143a|0x143b|0x143c|0x143d|0x143e|0x143f|0x1446|0x1464|0x1465|0x14ac|0x14c9|0x14cf|0x14d1|0x14fe|0x1505|0x1506|0x1520|0x1521|0x1526)";
        action "kldload -n u3g";
};
Comment 4 Hans Petter Selasky freebsd_committer 2017-07-21 15:30:42 UTC
Hi,

/etc/devd/usb.conf must be re-generated after you edit the list in u3g.ko compile and install this module. Make sure to set KMODDIR=/boot/kernel if building separately. See the comment in the top how to do this. The script is in /usr/src 

--HPS
Comment 5 Ed Maste freebsd_committer 2017-07-21 15:35:16 UTC
hps: this VID:PID pair already exists in u3g with a different name:

sys/dev/usb/serial/u3g.c
313:    U3G_DEV(HUAWEI, E392, U3GINIT_HUAWEISCSI),

sys/dev/usb/usbdevs
2444:product HUAWEI E392                0x1505  LTE modem