From owner-freebsd-usb@freebsd.org Fri Dec 25 04:51:10 2015 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 171ACA50C16 for ; Fri, 25 Dec 2015 04:51:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F17BF198E for ; Fri, 25 Dec 2015 04:51:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id tBP4p971080118 for ; Fri, 25 Dec 2015 04:51:09 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 177897] [u3g][patch] add support for the Huawei E352 modem Date: Fri, 25 Dec 2015 04:51:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: miwi@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cc resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 04:51:10 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D177897 Martin Wilke changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Progress |Closed CC| |miwi@FreeBSD.org Resolution|--- |Feedback Timeout --- Comment #1 from hps@bitfrost.no --- On 04/17/13 08:40, Damjan Jovanovic wrote: > >> Number: 177897 >> Category: usb >> Synopsis: [u3g][patch] add support for the Huawei E352 modem >> Confidential: no >> Severity: non-critical >> Priority: low >> Responsible: freebsd-usb >> State: open >> Quarter: >> Keywords: >> Date-Required: >> Class: change-request >> Submitter-Id: current-users >> Arrival-Date: Wed Apr 17 06:50:00 UTC 2013 >> Closed-Date: >> Last-Modified: >> Originator: Damjan Jovanovic >> Release: PCBSD 9.1 >> Organization: >> Environment: > FreeBSD pcbsd-2516 9.1-RELEASE-p2 FreeBSD 9.1-RELEASE-p2 #9 r249522M: Wed= Apr 17 07:59:19 SAST 2013 root@pcbsd-2516:/usr/obj/usr/src/sys/U3GTEST= amd64 >> Description: > Add support for the Huawei E352 3G modem, and get u3g to reset it from ma= ss-storage device to a 3G modem which can be dialled using /dev/cuaU0.0. > > A new SCSI reset command had to be added for this, as using the old U3GIN= IT_HUAWEISCSI command turns the device into a broken Huawei E173 instead. > >> How-To-Repeat: > >> Fix: > > > > > Index: sys/dev/usb/quirk/usb_quirk.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/usb/quirk/usb_quirk.c (revision 249522) > +++ sys/dev/usb/quirk/usb_quirk.c (working copy) > @@ -532,6 +532,7 @@ > [UQ_BAD_MIDI] =3D "UQ_BAD_MIDI", > [UQ_AU_VENDOR_CLASS] =3D "UQ_AU_VENDOR_CLASS", > [UQ_SINGLE_CMD_MIDI] =3D "UQ_SINGLE_CMD_MIDI", > + [UQ_MSC_EJECT_HUAWEISCSI2] =3D "UQ_MSC_EJECT_HUAWEISCSI2", > }; > > /*---------------------------------------------------------------------= ---* > Index: sys/dev/usb/quirk/usb_quirk.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/usb/quirk/usb_quirk.h (revision 249522) > +++ sys/dev/usb/quirk/usb_quirk.h (working copy) > @@ -104,6 +104,8 @@ > UQ_AU_VENDOR_CLASS, /* audio device uses vendor and not audio class */ > UQ_SINGLE_CMD_MIDI, /* at most one command per USB packet */ > > + UQ_MSC_EJECT_HUAWEISCSI2, /* ejects after another Huawei SCSI command */ > + > USB_QUIRK_MAX > }; > > Index: sys/dev/usb/serial/u3g.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/usb/serial/u3g.c (revision 249522) > +++ sys/dev/usb/serial/u3g.c (working copy) > @@ -95,6 +95,7 @@ > #define U3GINIT_SAEL_M460 8 /* Requires vendor init */ > #define U3GINIT_HUAWEISCSI 9 /* Requires Huawei SCSI init command */ > #define U3GINIT_TCT 10 /* Requires TCT Mobile init command */ > +#define U3GINIT_HUAWEISCSI2 11 /* Requires another Huawei SCSI init comm= and */ > > enum { > U3G_BULK_WR, > @@ -285,6 +286,8 @@ > U3G_DEV(HUAWEI, E180V, U3GINIT_HUAWEI), > U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI), > U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), > + U3G_DEV(HUAWEI, E352, 0), > + U3G_DEV(HUAWEI, E352_INIT, U3GINIT_HUAWEISCSI2), > U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), > U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), > U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), > @@ -683,6 +686,8 @@ > method =3D U3GINIT_WAIT; > else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI)) > method =3D U3GINIT_HUAWEISCSI; > + else if (usb_test_quirk(uaa, UQ_MSC_EJECT_HUAWEISCSI2)) > + method =3D U3GINIT_HUAWEISCSI2; > else if (usb_test_quirk(uaa, UQ_MSC_EJECT_TCT)) > method =3D U3GINIT_TCT; > else if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa) =3D=3D= 0) > @@ -703,6 +708,9 @@ > case U3GINIT_HUAWEISCSI: > error =3D usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI); > break; > + case U3GINIT_HUAWEISCSI2: > + error =3D usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI2); > + break; > case U3GINIT_SCSIEJECT: > error =3D usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT); > break; > Index: sys/dev/usb/usb_msctest.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/usb/usb_msctest.c (revision 249522) > +++ sys/dev/usb/usb_msctest.c (working copy) > @@ -98,6 +98,9 @@ > static uint8_t scsi_huawei_eject[] =3D { 0x11, 0x06, 0x00, 0x00, 0x00, = 0x00, > 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00, 0x00 }; > +static uint8_t scsi_huawei_eject2[] =3D { 0x11, 0x06, 0x20, 0x00, 0x00, = 0x01, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00 }; > static uint8_t scsi_tct_eject[] =3D { 0x06, 0xf5, 0x04, 0x02, 0x52, 0x7= 0 }; > static uint8_t scsi_sync_cache[] =3D { 0x35, 0x00, 0x00, 0x00, 0x00, 0x= 00, > 0x00, 0x00, 0x00, 0x00 }; > @@ -781,6 +784,11 @@ > &scsi_huawei_eject, sizeof(scsi_huawei_eject), > USB_MS_HZ); > break; > + case MSC_EJECT_HUAWEI2: > + err =3D bbb_command_start(sc, DIR_IN, 0, NULL, 0, > + &scsi_huawei_eject2, sizeof(scsi_huawei_eject2), > + USB_MS_HZ); > + break; > case MSC_EJECT_TCT: > /* > * TCTMobile needs DIR_IN flag. To get it, we > Index: sys/dev/usb/usb_msctest.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/usb/usb_msctest.h (revision 249522) > +++ sys/dev/usb/usb_msctest.h (working copy) > @@ -34,6 +34,7 @@ > MSC_EJECT_CMOTECH, > MSC_EJECT_HUAWEI, > MSC_EJECT_TCT, > + MSC_EJECT_HUAWEI2 > }; > > int usb_iface_is_cdrom(struct usb_device *udev, > Index: sys/dev/usb/usbdevs > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/dev/usb/usbdevs (revision 249522) > +++ sys/dev/usb/usbdevs (working copy) > @@ -1885,6 +1885,8 @@ > product HUAWEI E1752 0x1446 3G modem > product HUAWEI K3765 0x1465 3G modem > product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider > +product HUAWEI E352_INIT 0x14fe E352/E353 3G modem initial > +product HUAWEI E352 0x1506 E352/E353 3G modem > product HUAWEI K3765_INIT 0x1520 K3765 Initial > product HUAWEI E173 0x1c05 3G modem > product HUAWEI E173_INIT 0x1c0b 3G modem initial > > >> Release-Note: >> Audit-Trail: >> Unformatted: > _______________________________________________ > freebsd-usb@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > Hi, This device is already exist as: product HUAWEI E3131 0x1506 3G modem Can you update your patch to use this definition instead? Where did you obtain the SCSI command from? I suggest that the existing=20 HUAWEI SCSI quirk issue the new command after the existing one. Update your patch and I'll have a look again. --HPS --- Comment #2 from Martin Wilke --- Feedback timeout 2 years + --=20 You are receiving this mail because: You are the assignee for the bug.=