Date: Thu, 7 Jul 2011 19:25:39 -0600 From: PseudoCylon <moonlightakkiy@yahoo.ca> To: Hans Petter Selasky <hselasky@c2i.net> Cc: freebsd-current@freebsd.org, "freebsd-wireless@freebsd.org" <freebsd-wireless@freebsd.org> Subject: Re: [CFT] Sierra Wireless HSPA+ USB modem Message-ID: <CAFZ_MYKjUGcOD0KqZY6BZCSdfFJhjVivSW1w2Tuu=GCDB-J75Q@mail.gmail.com> In-Reply-To: <201107071447.53041.hselasky@c2i.net> References: <1309237117.88943.YahooMailNeo@web39307.mail.mud.yahoo.com> <201107061719.38445.hselasky@c2i.net> <CAFZ_MYKcHPJxA266ECUD1nvsy0NBEgGYaRFxg5jC9Fi4qSpGSw@mail.gmail.com> <201107071447.53041.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 7, 2011 at 6:47 AM, Hans Petter Selasky <hselasky@c2i.net> wrot= e: > On Thursday 07 July 2011 14:43:22 PseudoCylon wrote: >> On Wed, Jul 6, 2011 at 9:19 AM, Hans Petter Selasky <hselasky@c2i.net> > 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) +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFZ_MYKjUGcOD0KqZY6BZCSdfFJhjVivSW1w2Tuu=GCDB-J75Q>