Re: [CFT] Sierra Wireless HSPA+ USB modem

From: PseudoCylon <moonlightakkiy_at_yahoo.ca>
Date: Thu, 7 Jul 2011 19:25:39 -0600
On Thu, Jul 7, 2011 at 6:47 AM, Hans Petter Selasky <hselasky_at_c2i.net> wrote:
> On Thursday 07 July 2011 14:43:22 PseudoCylon wrote:
>> On Wed, Jul 6, 2011 at 9:19 AM, Hans Petter Selasky <hselasky_at_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   if (usbd_lookup_id_by_uaa(usie_devs, sizeof(usie_devs), uaa) != 0)
>> 242           return;                 /* no device 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[] = {
#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
_at__at_ -88,6 +88,7 _at__at_ static const STRUCT_USB_HOST_ID usie_devs[] = {
     USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##d) }
 	USIE_DEV(SIERRA, MC8700),
 	USIE_DEV(AIRPRIME, USB308),
+	USIE_DEV(SIERRA, TRUINSTALL),
 #undef	USIE_DEV
 };

_at__at_ -1522,8 +1523,9 _at__at_ usie_hip_rsp(struct usie_softc *sc, uint8_t
*rsp, uint32_t len)
 		DPRINTF("hip: len=%d msgID=%02x, param=%02x\n",
 		    be16toh(hip->len), hip->id, hip->param);

+		pad = (hip->id & USIE_HIP_PAD) ? 1 : 0;
+
 		if ((hip->id & USIE_HIP_MASK) == USIE_HIP_CNS2H) {
-			pad = (hip->id & USIE_HIP_PAD) ? 1 : 0;
 			cns = (struct usie_cns *)(((uint8_t *)(hip + 1)) + pad);

 			if (j < (sizeof(struct usie_cns) +
Received on Thu Jul 07 2011 - 23:38:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:15 UTC