From owner-freebsd-usb@FreeBSD.ORG Fri Feb 12 10:42:12 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD2A7106568D for ; Fri, 12 Feb 2010 10:42:12 +0000 (UTC) (envelope-from freebsd-usb@dino.sk) Received: from loki.netlab.sk (loki.netlab.sk [84.245.65.11]) by mx1.freebsd.org (Postfix) with ESMTP id 3365A8FC16 for ; Fri, 12 Feb 2010 10:42:11 +0000 (UTC) Received: from via.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: PLAIN milan, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by loki.netlab.sk with esmtp; Fri, 12 Feb 2010 11:41:47 +0100 id 0002E0DE.4B75306B.0000C4FE From: Milan Obuch To: Hans Petter Selasky Date: Fri, 12 Feb 2010 11:40:56 +0100 User-Agent: KMail/1.9.10 References: <201002101050.08302.freebsd-usb@dino.sk> <201002120948.14930.hselasky@c2i.net> In-Reply-To: <201002120948.14930.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201002121140.58046.freebsd-usb@dino.sk> Cc: freebsd-usb@freebsd.org Subject: Re: Huawei E1752 under FreeBSD X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2010 10:42:12 -0000 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/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 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 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