Martin Pieuchot [m...@openbsd.org] wrote: > 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? >
I agree in principle, however in practice, the goal is to run umsm_truinstall_changemode to get the device to present itself in a useful manner. Before umsm_truinstall_changemode, the class is UICLASS_MASS, subclass UISUBCLASS_SCSI, and protocol UIPROTO_MASS_BBB. That's a USB disk. FreeBSD's u3g driver is similar. We could match FreeBSD behavior by simply removing the ifnaceno check. Then we are just matching on USB_PRODUCT_SIERRA_TRUINSTALL and UICLASS_MASS. Chris