From owner-freebsd-usb@FreeBSD.ORG Sat Dec 7 11:11:02 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E50B838 for ; Sat, 7 Dec 2013 11:11:02 +0000 (UTC) Received: from mail4out.barnet.com.au (mail4out.barnet.com.au [202.83.178.123]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF5441505 for ; Sat, 7 Dec 2013 11:11:01 +0000 (UTC) Received: from localhost (antivirus12.int.barnet.com.au [10.252.48.19]) by mail4out.barnet.com.au (Postfix) with ESMTP id CF58237BBFB; Sat, 7 Dec 2013 22:10:53 +1100 (EST) X-Virus-Scanned: Debian amavisd-new at barnet.com.au Received: from mail4.barnet.com.au ([202.83.178.125]) by localhost (antivirus12.int.barnet.com.au [10.252.48.19]) (amavisd-new, port 10024) with ESMTP id d8-5sCrKMlqz; Sat, 7 Dec 2013 22:10:52 +1100 (EST) Received: from mail4auth.barnet.com.au (mail4.barnet.com.au [202.83.178.125]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "*.barnet.com.au", Issuer "RapidSSL CA" (not verified)) by mail4.barnet.com.au (Postfix) with ESMTPS id A122942217A; Sat, 7 Dec 2013 22:10:52 +1100 (EST) Received: from [10.204.250.100] (ppp121-44-161-141.lns20.syd7.internode.on.net [121.44.161.141]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mail4auth.barnet.com.au (Postfix) with ESMTPSA id 3451237BBEA; Sat, 7 Dec 2013 22:10:52 +1100 (EST) Message-ID: <52A30238.1000308@freebsd.org> Date: Sat, 07 Dec 2013 22:10:48 +1100 From: Edwin Groothuis - FreeBSD Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Hans Petter Selasky , freebsd-usb@freebsd.org Subject: Re: Huawei K4606 issues References: <529DB241.7030203@freebsd.org> <529DBB97.7020304@bitfrost.no> <529EE6A5.9080709@freebsd.org> <529EE734.3030206@bitfrost.no> In-Reply-To: <529EE734.3030206@bitfrost.no> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LLJv5ov5ADjhOdKtvjUnkQxR4Tp6DW1Ek" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2013 11:11:02 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LLJv5ov5ADjhOdKtvjUnkQxR4Tp6DW1Ek Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello Hans, On 4/12/13 19:26 , Hans Petter Selasky wrote: > On 12/04/13 09:24, Edwin Groothuis - FreeBSD wrote: >> >> I found out that the device doesn't act as a serial port but an ethern= et >> card: >> >> bInterfaceClass is 2 (UICLASS_CDC) >> bInterfaceSubClass is 14 (undefined in usb.h) >> >> Reading up on various other forums, they talk about using it as an >> Ethernet device: >> "and shows up as a USB ethernet device after modeswitching" >> >> According to the spec from Vodafone, this is a HiSilicon Balong 520 >> chipset. >> >> I think I'm stuck here... >> Unless somebody has a good idea where to go next? >> I'm open to experiment for the next 25 days :-) >=20 > Have a look at if_cdce.c >=20 > Should support your device, probably the NCM protocol. Thank you, that did the trick: It got recognized by the probe! Now the attach is the problem: Dec 7 21:54:26 t43 sudo: edwin : TTY=3Dpts/7 ; PWD=3D/usr/home/edwin/9.2.0/sys/mod ules/usb/cdce ; USER=3Droot ; COMMAND=3D/sbin/kldload ./if_cdce.ko Dec 7 21:54:26 t43 kernel: >cdce_attach - 1 Dec 7 21:54:26 t43 kernel: cdce0: on usbus4 Dec 7 21:54:26 t43 kernel: >cdce_attach - 1a Dec 7 21:54:26 t43 kernel: >cdce_attach - 4:0 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4a: error:0 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4b: error:12 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4:1 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4a: error:3 Dec 7 21:54:26 t43 kernel: cdce0: No valid alternate setting found Dec 7 21:54:26 t43 kernel: device_attach: cdce0 attach returned 6 Dec 7 21:54:26 t43 kernel: >cdce_attach - 1 Dec 7 21:54:26 t43 kernel: cdce0: on usbus4 Dec 7 21:54:26 t43 kernel: >cdce_attach - 1a Dec 7 21:54:26 t43 kernel: >cdce_attach - 4:0 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4a: error:0 Dec 7 21:54:26 t43 root: Unknown USB device: vendor 0x12d1 product 0x1f19 bus uhub4 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4b: error:12 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4:1 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4a: error:0 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4b: error:0 Dec 7 21:54:26 t43 kernel: cdce0: faking MAC address Dec 7 21:54:26 t43 kernel: >cdce_attach - 1 Dec 7 21:54:26 t43 kernel: cdce1: on usbus4 Dec 7 21:54:26 t43 kernel: >cdce_attach - 1a Dec 7 21:54:26 t43 kernel: >cdce_attach - 4:0 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4a: error:0 Dec 7 21:54:26 t43 kernel: ue0: on cdce0 Dec 7 21:54:26 t43 kernel: ue0: Ethernet address: 2a:d5:fd:08:00:00 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4b: error:12 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4:1 Dec 7 21:54:26 t43 kernel: >cdce_attach - 4a: error:3 Dec 7 21:54:26 t43 kernel: cdce1: No valid alternate setting found Dec 7 21:54:26 t43 kernel: device_attach: cdce1 attach returned 6 The patches were as follows for the cdce_host_devs: + {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_K4606_INIT, CDCE_FLAG_NO_UNION)}, And for the debugging: @@ -506,6 +512,8 @@ uint8_t data_iface_no; char eaddr_str[5 * ETHER_ADDR_LEN]; /* approx */ + printf(">cdce_attach - 1\n"); + sc->sc_flags =3D USB_GET_DRIVER_INFO(uaa); sc->sc_ue.ue_udev =3D uaa->device; @@ -519,6 +527,7 @@ if ((ud =3D=3D NULL) || (ud->bLength < sizeof(*ud)) || (sc->sc_flags & CDCE_FLAG_NO_UNION)) { + printf(">cdce_attach - 1a\n"); DPRINTFN(1, "No union descriptor!\n"); sc->sc_ifaces_index[0] =3D uaa->info.bIfaceIndex; sc->sc_ifaces_index[1] =3D uaa->info.bIfaceIndex; @@ -526,6 +535,7 @@ } data_iface_no =3D ud->bSlaveInterface[0]; + printf(">cdce_attach - 2\n"); for (i =3D 0;; i++) { iface =3D usbd_get_iface(uaa->device, i); @@ -545,6 +555,7 @@ goto detach; } } + printf(">cdce_attach - 3\n"); /* * @@ -575,8 +586,10 @@ for (i =3D 0; i !=3D 32; i++) { + printf(">cdce_attach - 4:%d\n", i); error =3D usbd_set_alt_interface_index(uaa->device, sc->sc_ifaces_index[0], i); + printf(">cdce_attach - 4a: error:%d\n", error); if (error) break; #if CDCE_HAVE_NCM @@ -587,6 +600,7 @@ sc->sc_ifaces_index, sc->sc_xfer, pcfg, CDCE_N_TRANSFER, sc, &sc->sc_mtx); + printf(">cdce_attach - 4b: error:%d\n", error); if (error =3D=3D 0) break; } I tried with both with CDCE_FLAG_ZAURUS in there, no differences. I tried it without CDCE_FLAG_NO_UNION and then I got this: Dec 7 22:01:03 t43 root: Unknown USB device: vendor 0x0483 product 0x2016 bus uhub2 Dec 7 22:01:03 t43 kernel: >cdce_attach - 1 Dec 7 22:01:03 t43 kernel: cdce0: on usbus4 Dec 7 22:01:03 t43 kernel: >cdce_attach - 2 Dec 7 22:01:03 t43 kernel: >cdce_attach - 3 Dec 7 22:01:03 t43 kernel: >cdce_attach - 4:0 Dec 7 22:01:03 t43 kernel: >cdce_attach - 4a: error:0 Dec 7 22:01:03 t43 kernel: >cdce_attach - 4b: error:12 Dec 7 22:01:03 t43 kernel: >cdce_attach - 4:1 Dec 7 22:01:03 t43 kernel: >cdce_attach - 4a: error:0 Dec 7 22:01:03 t43 kernel: >cdce_attach - 4b: error:0 Dec 7 22:01:03 t43 kernel: cdce0: faking MAC address Dec 7 22:01:03 t43 kernel: ue0: on cdce0 Dec 7 22:01:03 t43 kernel: ue0: Ethernet address: 2a:7d:0b:0f:00:00 Is that better? I don't know yet... At least ue0 gets created, but the link light doesn't go on the modem... I will take some traces on Monday on a Windows machine to see what needs to be happening after the attachment of the interface. Edwin --LLJv5ov5ADjhOdKtvjUnkQxR4Tp6DW1Ek Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJSowI6AAoJEBHEgofFk7N6JrwH/0+h2MipRyo5FlpUpXId88jd F4Fmz2iyBypXz1ojit0VLU1rG9eub8ZKkWjxjVlLzcrsBAIGOOShuRWuxI/K0Vdz im9BCb+g8F5pBgS3HLBc7IoOehd/a1trEmSCDvQsKnn8HRVA7Vp6HQRHD4pELD7X mby9mCEKDlNbJuUm/Czqj8kOjeZ6uC7iJBNEWBhShQMOH1n19bMHjpOMHPBsHXtG xx7iM7tUIBPguMj9HnpnAjiqX0OaEdeGA42d1j0rEdCV/XGUh7C8sy5g8MkWvswy rTzr6K1wlVFp4dEMOWC3iWDUuvilxNruI6DVc+9p7+igr9J8X5gXZlxj6KfqAWc= =wL9h -----END PGP SIGNATURE----- --LLJv5ov5ADjhOdKtvjUnkQxR4Tp6DW1Ek--