Huawei E1752 under FreeBSD
Milan Obuch
freebsd-usb at dino.sk
Sat Feb 13 09:21:41 UTC 2010
On Friday 12 February 2010 11:40:56 Milan Obuch wrote:
> On Friday 12 February 2010 09:48:14 Hans Petter Selasky wrote:
> > On Wednesday 10 February 2010 10:50:08 Milan Obuch wrote:
> > > 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
> > >
> > > 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 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
>
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
> 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
> _______________________________________________
> freebsd-usb at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-usb
> To unsubscribe, send any mail to "freebsd-usb-unsubscribe at freebsd.org"
More information about the freebsd-usb
mailing list