On Thu, Apr 06, 2023 at 09:13:27AM +0000, Gerhard Roth wrote:
> On Thu, 2023-04-06 at 18:49 +1000, David Gwynne wrote:
> > On Wed, Apr 05, 2023 at 11:22:34PM +0000, Mikolaj Kucharski wrote:
> >
> > this is almost certainly a qualcomm msm interface (qmi) device.
> > making umsm(4) attach to it is a good first start.
> >
> > hopefully you'll be able to talk AT commands to one of the interfaces.
> >
> > qmi devices are notoriously inconsistent and complicated, so what to do
> > next isnt clear. i would be trying to tell the modem to switch to mbim
> > mode and then figure out how to get umb(4) to attach. this is similar to
> > the changes i made to umsm and umb for quectel devices, but they
> > actually provided a decent manual.
>
> The Sierra Wireless documentation is available. Alas, switching the
> mode seems far too complex and error prone to perform this inside
> a driver.
agreed. i just want the kernel to attach the right things to what is
presented.
> When the AT (modem) interface is available, you would have to:
>
> 1) enter password protected command mode with "AT!ENTERCND=passwd"
>
> 2) query the list of modes with "AT!UDUSBCOMP=?". Example result:
>
> 0 - reserved NOT SUPPORTED
> 1 - DM AT SUPPORTED
> 2 - reserved NOT SUPPORTED
> 3 - reserved NOT SUPPORTED
> 4 - reserved NOT SUPPORTED
> 5 - reserved NOT SUPPORTED
> 6 - DM NMEA AT QMI SUPPORTED
> 7 - DM NMEA AT RMNET1 RMNET2 RMNET3 SUPPORTED
> 8 - DM NMEA AT MBIM SUPPORTED
> 9 - MBIM SUPPORTED
> 10 - NMEA MBIM SUPPORTED
> 11 - DM MBIM SUPPORTED
> 12 - DM NMEA MBIM SUPPORTED
> 13 - Config1: comp6 Config2: comp8 NOT SUPPORTED
> 14 - Config1: comp6 Config2: comp9 SUPPORTED
> 15 - Config1: comp6 Config2: comp10 NOT SUPPORTED
> 16 - Config1: comp6 Config2: comp11 NOT SUPPORTED
> 17 - Config1: comp6 Config2: comp12 NOT SUPPORTED
> 18 - Config1: comp7 Config2: comp8 NOT SUPPORTED
> 19 - Config1: comp7 Config2: comp9 SUPPORTED
> 20 - Config1: comp7 Config2: comp10 NOT SUPPORTED
> 21 - Config1: comp7 Config2: comp11 NOT SUPPORTED
> 22 - Config1: comp7 Config2: comp12 NOT SUPPORTED
>
> There is no guarantee that the table doesn't change. And every
> device has a differnt set of supported modes.
>
> 3) select the desired mode with "AT!UDUSBCOMP=X"
> 4) wait for the device to reset itself
yep.
the linux driver has some clues, so the following should let umb attach
once you've reconfigured the modem.
Index: umsm.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/umsm.c,v
retrieving revision 1.125
diff -u -p -r1.125 umsm.c
--- umsm.c 2 Apr 2023 23:57:57 -0000 1.125
+++ umsm.c 6 Apr 2023 09:21:35 -0000
@@ -101,6 +101,7 @@ struct umsm_type {
#define DEV_NORMAL 0x0000
#define DEV_HUAWEI 0x0001
#define DEV_TRUINSTALL 0x0002
+#define DEV_SIERRA 0x0004
#define DEV_UMASS1 0x0010
#define DEV_UMASS2 0x0020
#define DEV_UMASS3 0x0040
@@ -271,6 +272,7 @@ static const struct umsm_type umsm_devs[
{{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD_340U}, 0},
{{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD_770S}, 0},
{{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC7455}, 0},
+ {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC7700}, DEV_SIERRA},
{{ USB_VENDOR_SIMCOM, USB_PRODUCT_SIMCOM_SIM5320}, 0},
{{ USB_VENDOR_SIMCOM, USB_PRODUCT_SIMCOM_SIM7600E}, 0},
@@ -363,6 +365,17 @@ umsm_match(struct device *parent, void *
/* Interface 4 can be used as a network device */
if (uaa->ifaceno >= 4)
return UMATCH_NONE;
+ } else if (flag & DEV_SIERRA) {
+ /* Sierra Wireless layout */
+ switch (uaa->ifaceno) {
+ case 0:
+ case 2:
+ case 3:
+ /* Only umsm on specific interfaces */
+ break;
+ default:
+ return UMATCH_NONE;
+ }
}
return UMATCH_VENDOR_IFACESUBCLASS;