Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Dec 2015 04:51:10 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-usb@FreeBSD.org
Subject:   [Bug 177897] [u3g][patch] add support for the Huawei E352 modem
Message-ID:  <bug-177897-17-Hpon2ebGhI@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-177897-17@https.bugs.freebsd.org/bugzilla/>
References:  <bug-177897-17@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D177897

Martin Wilke <miwi@FreeBSD.org> 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 <miwi@FreeBSD.org> ---
Feedback timeout 2 years +

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-177897-17-Hpon2ebGhI>