From owner-freebsd-wireless@FreeBSD.ORG Fri Jul 8 01:25:41 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F05B71065673 for ; Fri, 8 Jul 2011 01:25:41 +0000 (UTC) (envelope-from moonlightakkiy@yahoo.ca) Received: from nm10.bullet.mail.sp2.yahoo.com (nm10.bullet.mail.sp2.yahoo.com [98.139.91.80]) by mx1.freebsd.org (Postfix) with SMTP id C08508FC12 for ; Fri, 8 Jul 2011 01:25:41 +0000 (UTC) Received: from [98.139.91.64] by nm10.bullet.mail.sp2.yahoo.com with NNFMP; 08 Jul 2011 01:25:41 -0000 Received: from [98.136.185.41] by tm4.bullet.mail.sp2.yahoo.com with NNFMP; 08 Jul 2011 01:25:41 -0000 Received: from [127.0.0.1] by smtp102.mail.gq1.yahoo.com with NNFMP; 08 Jul 2011 01:25:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s1024; t=1310088341; bh=TNhuNKdgDCceSVVX8jXb0VQFOeVTmorFtDpYNBz4Oec=; h=X-Yahoo-Newman-Id:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Content-Transfer-Encoding; b=rwl1iyVfFnIaKzxMjpt9V7LfsN4iB62NrM1YyPjLuJv1D3mxmdfuY22NxsB5jQUr7s6qK148Cp26+OF6FYeIBEi5S5cMqwyHmVbAA7+qrrfGB0BBiipWAEG2bPLPtn6ZuVY/BqzCi2vgbXHg0Fy5+fzaF3FOICkIJ/3IqNZ4jC8= X-Yahoo-Newman-Id: 241197.82562.bm@smtp102.mail.gq1.yahoo.com Received: from mail-vx0-f182.google.com (moonlightakkiy@209.85.220.182 with plain) by smtp102.mail.gq1.yahoo.com with SMTP; 07 Jul 2011 18:25:40 -0700 PDT X-Yahoo-SMTP: Xr6qjFWswBAEmd20sAvB4Q3keqXvXsIH9TjJ X-YMail-OSG: uWPVWqwVM1nhy5ASmqxgKL4UTl_AUG0T8N097CjsxA7HWgy l.wzzwBv3eIZ1H00QWYuSj9lz3QH5rLHKOkM7KFRt8PaHfvANjQM8QtZVJ7d 72bUQTojH5jXiQK38vGH.lkf699OvizKRbl_pUrUyiUZCA8rU7LHm8egfC2P 56bjFLmiOk_gMJh3mKl_5vP4zUlgCBU4bs1QbgOoCTzVOYo2PDkFkxOORnIG TO6fZWpHMuREILp1cmJQSROOSO_W2kEKXqrPY5JLy0P4j0_aguQ9pyEEX.Gv tR6FhdSLHsqqu0YuqyrqG1uWmMMiwcdmbT3QRjtNFYjo43A7r4.U5ZIVnSo7 MhrrG.BFxGlZG26kiFnhB6WDSOlpWd5QtdMYYfLR35_R1MFMjI0UUWZVV3Lh 9yTzeolWOi2bZsPPTfG_xB0bhHbuTlN8bmE0U4yaTyqx.Cim6oig0dXRix31 jz09.hMF2HCgzSOhupmpevjZ2PYBHwkA4XwO9tUV4KGYdMD9UYpYozRiu1Zh 7RH3ARstJLJI2mxDg4t1Si2MlEK6xNwcMpfEsOShBqoBM8nyKzQ-- X-Yahoo-Newman-Property: ymail-3 Received: by vxg33 with SMTP id 33so1489179vxg.13 for ; Thu, 07 Jul 2011 18:25:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.179.131 with SMTP id dg3mr2144865vdc.9.1310088339378; Thu, 07 Jul 2011 18:25:39 -0700 (PDT) Received: by 10.52.108.229 with HTTP; Thu, 7 Jul 2011 18:25:39 -0700 (PDT) In-Reply-To: <201107071447.53041.hselasky@c2i.net> References: <1309237117.88943.YahooMailNeo@web39307.mail.mud.yahoo.com> <201107061719.38445.hselasky@c2i.net> <201107071447.53041.hselasky@c2i.net> Date: Thu, 7 Jul 2011 19:25:39 -0600 Message-ID: From: PseudoCylon To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, "freebsd-wireless@freebsd.org" Subject: Re: [CFT] Sierra Wireless HSPA+ USB modem X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 01:25:42 -0000 On Thu, Jul 7, 2011 at 6:47 AM, Hans Petter Selasky wrot= e: > On Thursday 07 July 2011 14:43:22 PseudoCylon wrote: >> On Wed, Jul 6, 2011 at 9:19 AM, Hans Petter Selasky > wrote: >> >> Hi, >> >> >> >> I'm going to review and import your driver. >> >> >> >> --HPS >> > >> > Hi, >> > >> > The intial patch had some bad code and didn't compile on 9-current. I'= ve >> > tried to clean it up. Please test and report back if I didn't break >> > anything. >> > >> > http://hselasky.homeunix.org:8192/usie_for_FreeBSD_9_current.patch >> > >> > --HPS >> >> Hello, >> >> Thanks for the patch. >> >> if_usie.c >> 241 =A0 if (usbd_lookup_id_by_uaa(usie_devs, sizeof(usie_devs), uaa) != =3D 0) >> 242 =A0 =A0 =A0 =A0 =A0 return; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* no de= vice match */ >> >> It should return non-zero on success, but somehow this caused the >> process to exit, and modem stayed being a CD-ROM. > > Hi, > > Is this device changing its USB vendor and product ID ? > Yes, it does. So I added the device id for cd-rom, SIERRA, TRUINSTALL (already in usbdevs). static const STRUCT_USB_HOST_ID usie_devs[] =3D { #define USIE_DEV(v, d) { \ USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##d) } USIE_DEV(SIERRA, MC8700), USIE_DEV(AIRPRIME, USB308), + USIE_DEV(SIERRA, TRUINSTALL), #undef USIE_DEV }; Now it works even if the modem is plugged in before loading the driver. The device id 0x0fff is for cd-rom, but sierra didn't specify the vendor id. So, there might be (AIRPRIME, TRUINSTALL). With your "uint8_t pad" fix, the driver works fine. Thanks AK Here is a patch. diff --git a/sys/dev/usb/net/if_usie.c b/sys/dev/usb/net/if_usie.c index 552765b..f6f6c60 100644 --- a/sys/dev/usb/net/if_usie.c +++ b/sys/dev/usb/net/if_usie.c @@ -88,6 +88,7 @@ static const STRUCT_USB_HOST_ID usie_devs[] =3D { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##d) } USIE_DEV(SIERRA, MC8700), USIE_DEV(AIRPRIME, USB308), + USIE_DEV(SIERRA, TRUINSTALL), #undef USIE_DEV }; @@ -1522,8 +1523,9 @@ usie_hip_rsp(struct usie_softc *sc, uint8_t *rsp, uint32_t len) DPRINTF("hip: len=3D%d msgID=3D%02x, param=3D%02x\n", be16toh(hip->len), hip->id, hip->param); + pad =3D (hip->id & USIE_HIP_PAD) ? 1 : 0; + if ((hip->id & USIE_HIP_MASK) =3D=3D USIE_HIP_CNS2H) { - pad =3D (hip->id & USIE_HIP_PAD) ? 1 : 0; cns =3D (struct usie_cns *)(((uint8_t *)(hip + 1)) + pad); if (j < (sizeof(struct usie_cns) +