On 19/05/16(Thu) 19:27, Chris Cappuccio wrote: > Here is a patch to support some newer LTE umsm devices > > Yes, the 313U actually has an SD card slot. And yes, it actually > changes vendor ID to Airprime after the umsm_truinstall_changemode > takes place. > > Matching ifaceno == 9 for newer USB_PRODUCT_SIERRA_TRUINSTALL devices > is necessary. They don't show up as 0. (It's possible that Huawei will > will need the same treatment in umsm_attach if they use newer umsm chips)
No. Hardcoding interface number is not the way to go. Interfaces descriptors have a class, subclass and protocol that should be looked at. In 3 months a new device will show up with different interfaces layout and we will have to hardcode something else? > > umsm0 at uhub5 port 3 configuration 1 interface 9 "Sierra Wireless, > Incorporated USB MMC Storage" rev 2.00/0.00 addr 5 > umsm0: truinstall mode. need to reattach > umsm0 detached > umsm0 at uhub5 port 3 configuration 1 interface 0 "Sierra Wireless, > Incorporated AirCard 313U" rev 2.00/0.06 addr 5 > ucom1 at umsm0 > umsm1 at uhub5 port 3 configuration 1 interface 1 "Sierra Wireless, > Incorporated AirCard 313U" rev 2.00/0.06 addr 5 > ucom2 at umsm1 > umsm2 at uhub5 port 3 configuration 1 interface 2 "Sierra Wireless, > Incorporated AirCard 313U" rev 2.00/0.06 addr 5 > ucom3 at umsm2 > umsm3 at uhub5 port 3 configuration 1 interface 3 "Sierra Wireless, > Incorporated AirCard 313U" rev 2.00/0.06 addr 5 > ucom4 at umsm3 > umsm4 at uhub5 port 3 configuration 1 interface 4 "Sierra Wireless, > Incorporated AirCard 313U" rev 2.00/0.06 addr 5 > ucom5 at umsm4 > umass1 at uhub5 port 3 configuration 1 interface 9 "Sierra Wireless, > Incorporated AirCard 313U" rev 2.00/0.06 addr 5 > umass1: using SCSI over Bulk-Only > scsibus3 at umass1: 2 targets, initiator 0 > sd5 at scsibus3 targ 1 lun 0: <SWI, SD Card, 2.31> SCSI2 0/direct removable > serial.0f3d68aa615000291196 > umsm5 at uhub5 port 3 configuration 1 interface 7 "Sierra Wireless, > Incorporated AirCard 313U" rev 2.00/0.06 addr 5 > ucom6 at umsm5 > > Aircard 770S: > > umsm0 at uhub5 port 3 configuration 1 interface 9 "NETGEAR, Inc. AirCard > 770S" rev 2.00/0.06 addr 5 > umsm0: truinstall mode. need to reattach > umsm0 detached > umsm0 at uhub5 port 3 configuration 1 interface 3 "NETGEAR, Inc. AirCard > 770S" rev 2.00/0.06 addr 5 > ucom1 at umsm0 > umsm1 at uhub5 port 3 configuration 1 interface 8 "NETGEAR, Inc. AirCard > 770S" rev 2.00/0.06 addr 5 > ucom2 at umsm1 > umsm2 at uhub5 port 3 configuration 1 interface 0 "NETGEAR, Inc. AirCard > 770S" rev 2.00/0.06 addr 5 > ucom3 at umsm2 > > Index: umsm.c > =================================================================== > RCS file: /cvs/src/sys/dev/usb/umsm.c,v > retrieving revision 1.104 > diff -u -p -u -r1.104 umsm.c > --- umsm.c 29 Sep 2015 08:34:28 -0000 1.104 > +++ umsm.c 20 May 2016 02:05:54 -0000 > @@ -115,6 +115,7 @@ struct umsm_type { > > static const struct umsm_type umsm_devs[] = { > {{ USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220 }, 0}, > + {{ USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_AIRCARD_313U }, 0}, > > {{ USB_VENDOR_ANYDATA, USB_PRODUCT_ANYDATA_A2502 }, 0}, > {{ USB_VENDOR_ANYDATA, USB_PRODUCT_ANYDATA_ADU_500A }, 0}, > @@ -247,6 +248,7 @@ static const struct umsm_type umsm_devs[ > {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_USB305}, 0}, > {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, DEV_TRUINSTALL}, > {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8355}, 0}, > + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD_770S}, 0}, > > {{ USB_VENDOR_TCTMOBILE, USB_PRODUCT_TCTMOBILE_UMASS }, DEV_UMASS3}, > {{ USB_VENDOR_TCTMOBILE, USB_PRODUCT_TCTMOBILE_UMASS_2 }, DEV_UMASS3}, > @@ -359,7 +361,7 @@ umsm_attach(struct device *parent, struc > printf("%s: umass only mode. need to reattach\n", > sc->sc_dev.dv_xname); > } else if ((sc->sc_flag & DEV_TRUINSTALL) && > - uaa->ifaceno == 0) { > + (uaa->ifaceno == 0 || uaa->ifaceno == 9)) { > umsm_truinstall_changemode(uaa->device); > printf("%s: truinstall mode. need to reattach\n", > sc->sc_dev.dv_xname); >