Discussion:
Huawei E1752 under FreeBSD
Milan Obuch
2010-02-10 09:50:08 UTC
Permalink
Hi,

I got this 3G modem, it is not recognised under FreeBSD (tested with fresh
9-CURRENT).

I found no relevant information googling for "huawei e1752 freebsd",
but "huawei e1752 linux" got me

http://www.blogcatalog.com/blog/iwrite-2/dbbfb38ae5ef9ccef8540aad7f9edbd6

and there is part about usb modeswitch, part of config reproduced here:

# Huawei E1752
#
# Contributor:

DefaultVendor= 0x12d1
DefaultProduct= 0x1446

TargetVendor= 0x12d1
TargetProdct= 0x1001

MessageEndpoint= 0x01

MessageContent= "55534243000000000000000000000011060000000000000000000000000000"

It looks like this is the message necessary for switching this device into
modem mode, but I have no idea how to issue such command. Also, for my use I
need to get this working under 8.0-RELEASE/STABLE.

Any hint/help on this one?

Regards,
Milan
Hans Petter Selasky
2010-02-12 08:48:14 UTC
Permalink
Post by Milan Obuch
Hi,
I got this 3G modem, it is not recognised under FreeBSD (tested with fresh
9-CURRENT).
I found no relevant information googling for "huawei e1752 freebsd",
but "huawei e1752 linux" got me
http://www.blogcatalog.com/blog/iwrite-2/dbbfb38ae5ef9ccef8540aad7f9edbd6
# Huawei E1752
#
DefaultVendor= 0x12d1
DefaultProduct= 0x1446
TargetVendor= 0x12d1
TargetProdct= 0x1001
MessageEndpoint= 0x01
MessageContent=
"55534243000000000000000000000011060000000000000000000000000000"
It looks like this is the message necessary for switching this device into
modem mode, but I have no idea how to issue such comm and. Also, for my use
I need to get this working under 8.0-RELEASE/STABLE.
The last 16-hex bytes of the message is a SCSI command. Please make a new one
in:

usb/usb_msctest.c

Then test and make a patch for usb/usbdevs and usb/serial/u3g.c .

--HPS
Milan Obuch
2010-02-12 10:40:56 UTC
Permalink
Post by Hans Petter Selasky
Post by Milan Obuch
Hi,
I got this 3G modem, it is not recognised under FreeBSD (tested with
fresh 9-CURRENT).
I found no relevant information googling for "huawei e1752 freebsd",
but "huawei e1752 linux" got me
http://www.blogcatalog.com/blog/iwrite-2/dbbfb38ae5ef9ccef8540aad7f9edbd6
# Huawei E1752
#
DefaultVendor= 0x12d1
DefaultProduct= 0x1446
TargetVendor= 0x12d1
TargetProdct= 0x1001
MessageEndpoint= 0x01
MessageContent=
"55534243000000000000000000000011060000000000000000000000000000"
It looks like this is the message necessary for switching this device
into modem mode, but I have no idea how to issue such comm and. Also, for
my use I need to get this working under 8.0-RELEASE/STABLE.
The last 16-hex bytes of the message is a SCSI command. Please make a new
usb/usb_msctest.c
Then test and make a patch for usb/usbdevs and usb/serial/u3g.c .
--HPS
Hmm, just to be sure I understand what you mean, I made following patches:

diff -u usb_msctest.h.orig usb_msctest.h.patched
--- usb_msctest.h.orig 2010-01-16 14:17:58.000000000 +0100
+++ usb_msctest.h.patched 2010-02-12 11:30:36.000000000 +0100
@@ -31,7 +31,8 @@
MSC_EJECT_STOPUNIT,
MSC_EJECT_REZERO,
MSC_EJECT_ZTESTOR,
- MSC_EJECT_CMOTECH
+ MSC_EJECT_CMOTECH,
+ MSC_EJECT_E1752
};

int usb_iface_is_cdrom(struct usb_device *udev,

diff -u usb_msctest.c.orig usb_msctest.c.patched
--- usb_msctest.c.orig 2010-02-12 11:15:40.000000000 +0100
+++ usb_msctest.c.patched 2010-02-12 11:30:00.000000000 +0100
@@ -94,6 +94,9 @@
0x01, 0x01, 0x01, 0x01, 0x00,
0x00 };
static uint8_t scsi_cmotech_eject[] = { 0xff, 0x52, 0x44, 0x45, 0x56, 0x43,
0x48, 0x47 };
+static uint8_t scsi_huawei1752_eject[] = { 0x11, 0x06, 0x00, 0x00, 0x00,
0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00 };

#define BULK_SIZE 64 /* dummy */
#define ERR_CSW_FAILED -1
@@ -611,6 +614,11 @@
&scsi_cmotech_eject, sizeof(scsi_cmotech_eject),
USB_MS_HZ);
break;
+ case MSC_EJECT_E1752:
+ err = bbb_command_start(sc, DIR_IN, 0, NULL, 0,
+ &scsi_huawei1752_eject, sizeof(scsi_huawei1752_eject),
+ USB_MS_HZ);
+ break;
default:
printf("usb_msc_eject: unknown eject method (%d)\n", method);
break;

diff -u usbdevs.orig usbdevs.patched
--- usbdevs.orig 2010-02-05 02:47:43.000000000 +0100
+++ usbdevs.patched 2010-02-09 23:27:38.000000000 +0100
@@ -1724,6 +1724,7 @@
product HUAWEI E143E 0x143e 3G modem
product HUAWEI E143F 0x143f 3G modem
product HUAWEI E14AC 0x14ac 3G modem
+product HUAWEI E1752 0x1446 3G modem

/* HUAWEI 3com products */
product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g

diff -u u3g.c.orig u3g.c.patched
--- u3g.c.orig 2010-02-09 22:10:21.000000000 +0100
+++ u3g.c 2010-02-12 11:39:28.000000000 +0100
@@ -92,6 +92,7 @@
#define U3GINIT_CMOTECH 6 /* Requires CMOTECH SCSI
command */
#define U3GINIT_WAIT 7 /* Device reappears after a
delay */
#define U3GINIT_SAEL_M460 8 /* Requires vendor init */
+#define U3GINIT_HUAWEI_E1752 9 /* Requires Huawei E1752 init
command */

enum {
U3G_BULK_WR,
@@ -281,6 +282,7 @@
U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI),
U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI),
U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI),
+ U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEI_E1752),
U3G_DEV(KYOCERA2, CDMA_MSM_K, 0),
U3G_DEV(KYOCERA2, KPC680, 0),
U3G_DEV(MERLIN, V620, 0),
@@ -668,6 +670,9 @@
/* Just pretend we ejected, the card will timeout */
error = 0;
break;
+ case U3GINIT_HUAWEI_E1752:
+ error = usb_msc_eject(udev, 0, MSC_EJECT_E1752);
+ break;
default:
/* no 3G eject quirks */
error = EOPNOTSUPP;

I am going to compile it and test, just sent now if you see something wrong
(well, as said, I am not 100 % I understood exactly what you mean).

Regards,
Milan
Milan Obuch
2010-02-13 09:21:28 UTC
Permalink
Post by Milan Obuch
Post by Hans Petter Selasky
Post by Milan Obuch
Hi,
I got this 3G modem, it is not recognised under FreeBSD (tested with
fresh 9-CURRENT).
I found no relevant information googling for "huawei e1752 freebsd",
but "huawei e1752 linux" got me
http://www.blogcatalog.com/blog/iwrite-2/dbbfb38ae5ef9ccef8540aad7f9edb
d6
# Huawei E1752
#
DefaultVendor= 0x12d1
DefaultProduct= 0x1446
TargetVendor= 0x12d1
TargetProdct= 0x1001
MessageEndpoint= 0x01
MessageContent=
"55534243000000000000000000000011060000000000000000000000000000"
It looks like this is the message necessary for switching this device
into modem mode, but I have no idea how to issue such comm and. Also,
for my use I need to get this working under 8.0-RELEASE/STABLE.
The last 16-hex bytes of the message is a SCSI command. Please make a new
usb/usb_msctest.c
Then test and make a patch for usb/usbdevs and usb/serial/u3g.c .
--HPS
I finally managed to compile and test new kernel/modules and it works. Could
you please check my patches, review and eventually commit?

Thanks for hint, it did my day a bit better now... I am going to test
net/e169-stats port, it looks like there is status interface available for
it.

Milan
Post by Milan Obuch
diff -u usb_msctest.h.orig usb_msctest.h.patched
--- usb_msctest.h.orig 2010-01-16 14:17:58.000000000 +0100
+++ usb_msctest.h.patched 2010-02-12 11:30:36.000000000 +0100
@@ -31,7 +31,8 @@
MSC_EJECT_STOPUNIT,
MSC_EJECT_REZERO,
MSC_EJECT_ZTESTOR,
- MSC_EJECT_CMOTECH
+ MSC_EJECT_CMOTECH,
+ MSC_EJECT_E1752
};
int usb_iface_is_cdrom(struct usb_device *udev,
diff -u usb_msctest.c.orig usb_msctest.c.patched
--- usb_msctest.c.orig 2010-02-12 11:15:40.000000000 +0100
+++ usb_msctest.c.patched 2010-02-12 11:30:00.000000000 +0100
@@ -94,6 +94,9 @@
0x01, 0x01, 0x01, 0x01, 0x00,
0x00 };
static uint8_t scsi_cmotech_eject[] = { 0xff, 0x52, 0x44, 0x45, 0x56,
0x43, 0x48, 0x47 };
+static uint8_t scsi_huawei1752_eject[] = { 0x11, 0x06, 0x00, 0x00, 0x00,
0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, + 0x00, 0x00, 0x00, 0x00 };
#define BULK_SIZE 64 /* dummy */
#define ERR_CSW_FAILED -1
@@ -611,6 +614,11 @@
&scsi_cmotech_eject, sizeof(scsi_cmotech_eject),
USB_MS_HZ);
break;
+ err = bbb_command_start(sc, DIR_IN, 0, NULL, 0,
+ &scsi_huawei1752_eject, sizeof(scsi_huawei1752_eject),
+ USB_MS_HZ);
+ break;
printf("usb_msc_eject: unknown eject method (%d)\n",
method); break;
diff -u usbdevs.orig usbdevs.patched
--- usbdevs.orig 2010-02-05 02:47:43.000000000 +0100
+++ usbdevs.patched 2010-02-09 23:27:38.000000000 +0100
@@ -1724,6 +1724,7 @@
product HUAWEI E143E 0x143e 3G modem
product HUAWEI E143F 0x143f 3G modem
product HUAWEI E14AC 0x14ac 3G modem
+product HUAWEI E1752 0x1446 3G modem
/* HUAWEI 3com products */
product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g
diff -u u3g.c.orig u3g.c.patched
--- u3g.c.orig 2010-02-09 22:10:21.000000000 +0100
+++ u3g.c 2010-02-12 11:39:28.000000000 +0100
@@ -92,6 +92,7 @@
#define U3GINIT_CMOTECH 6 /* Requires CMOTECH SCSI
command */
#define U3GINIT_WAIT 7 /* Device reappears after a
delay */
#define U3GINIT_SAEL_M460 8 /* Requires vendor init */
+#define U3GINIT_HUAWEI_E1752 9 /* Requires Huawei E1752
init command */
enum {
U3G_BULK_WR,
@@ -281,6 +282,7 @@
U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI),
U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI),
U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI),
+ U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEI_E1752),
U3G_DEV(KYOCERA2, CDMA_MSM_K, 0),
U3G_DEV(KYOCERA2, KPC680, 0),
U3G_DEV(MERLIN, V620, 0),
@@ -668,6 +670,9 @@
/* Just pretend we ejected, the card will timeout
*/ error = 0;
break;
+ error = usb_msc_eject(udev, 0, MSC_EJECT_E1752);
+ break;
/* no 3G eject quirks */
error = EOPNOTSUPP;
I am going to compile it and test, just sent now if you see something wrong
(well, as said, I am not 100 % I understood exactly what you mean).
Regards,
Milan
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
Hans Petter Selasky
2010-02-13 16:13:02 UTC
Permalink
Milan Obuch
Hi,

Committed to USB P4:

http://p4web.freebsd.org/chv.cgi?CH=174658
http://perforce.freebsd.org/chv.cgi?CH=174658

Please verify the commit. Thanks for your patch!

--HPS
Milan Obuch
2010-02-13 16:47:47 UTC
Permalink
Post by Hans Petter Selasky
Milan Obuch
Hi,
http://p4web.freebsd.org/chv.cgi?CH=174658
http://perforce.freebsd.org/chv.cgi?CH=174658
Please verify the commit. Thanks for your patch!
--HPS
Everything looks OK, I just think there should not be a comma after last
enumerated value in usb_msctest.h:

enum {
MSC_EJECT_STOPUNIT,
MSC_EJECT_REZERO,
MSC_EJECT_ZTESTOR,
MSC_EJECT_CMOTECH,
MSC_EJECT_E1752,
};

(At least version before this change had not it there...)

Milan
Stefan Bethke
2010-08-18 21:17:07 UTC
Permalink
Post by Hans Petter Selasky
http://p4web.freebsd.org/chv.cgi?CH=174658
http://perforce.freebsd.org/chv.cgi?CH=174658
This this support for the Huawei E1752 ever get committed to stable? I've got a E1550, which shows up with the same USB dev id as the E1752, according to the latest usb_modeswitch device_reference.txt, and takes the same command to enable the serial ports.

Is there some additional action needed?


Thanks,
Stefan
--
Stefan Bethke <***@lassitu.de> Fon +49 151 14070811
Hans Petter Selasky
2010-08-19 06:51:48 UTC
Permalink
Post by Stefan Bethke
Post by Hans Petter Selasky
http://p4web.freebsd.org/chv.cgi?CH=174658
http://perforce.freebsd.org/chv.cgi?CH=174658
This this support for the Huawei E1752 ever get committed to stable? I've
got a E1550, which shows up with the same USB dev id as the E1752,
according to the latest usb_modeswitch device_reference.txt, and takes the
same command to enable the serial ports.
Is there some additional action needed?
Gavin, any comments?

--HPS

Loading...