Modem creation/startup order

Colin Helliwell colin.helliwell at ln-systems.com
Thu Feb 16 12:31:11 UTC 2017


> On 14 February 2017 at 12:59 Aleksander Morgado <aleksander at aleksander.es> wrote:
> 
> On Tue, Feb 14, 2017 at 12:54 PM, Colin Helliwell
> 
> > iter = g_object_ref (child);
> >  while (iter && i++ < 8) {
> > 
> > diff -Nur a/plugins/cinterion/mm-plugin-cinterion.c b/plugins/cinterion/mm-plugin-cinterion.c
> > --- a/plugins/cinterion/mm-plugin-cinterion.c 2016-11-15 10:07:40.000000000 +0000
> > +++ b/plugins/cinterion/mm-plugin-cinterion.c 2017-01-18 10:00:30.000000000 +0000
> > @@ -203,6 +203,7 @@
> >  static const gchar *subsystems[] = { "tty", "net", "usb", NULL };
> >  static const gchar *vendor_strings[] = { "cinterion", "siemens", NULL };
> >  static const guint16 vendor_ids[] = { 0x1e2d, 0x0681, 0 };
> > 
> > *   static const gchar *drivers[] = { "linmux", NULL };
> > static const MMAsyncMethod custom_init = {
> >  .async = G_CALLBACK (cinterion_custom_init),
> >  .finish = G_CALLBACK (cinterion_custom_init_finish),
> > @@ -214,6 +215,7 @@
> >  MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
> >  MM_PLUGIN_ALLOWED_VENDOR_STRINGS, vendor_strings,
> >  MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
> > *   MM_PLUGIN_ALLOWED_DRIVERS, drivers,
> > MM_PLUGIN_ALLOWED_AT, TRUE,
> > MM_PLUGIN_ALLOWED_QMI, TRUE,
> > MM_PLUGIN_CUSTOM_INIT, &custom_init,
> > diff -Nur a/src/mm-plugin.c b/src/mm-plugin.c
> > --- a/src/mm-plugin.c 2016-11-15 10:07:40.000000000 +0000
> > +++ b/src/mm-plugin.c 2017-01-18 11:05:16.553578652 +0000
> > @@ -200,6 +200,7 @@
> > gboolean product_filtered = FALSE;
> > gboolean vendor_filtered = FALSE;
> > guint i;
> > *   gboolean force_cinterion = FALSE;
> > 
> >     *need_vendor_probing = FALSE;
> > *need_product_probing = FALSE;
> > @@ -230,12 +231,19 @@
> >  !self->priv->mbim) {
> >  static const gchar *virtual_drivers [] = { "virtual", NULL };
> >  const gchar **drivers;
> > 
> > *   static const gchar *linmux_drivers [] = { "linmux", NULL };
> > 
> >     /* Detect any modems accessible through the list of virtual ports */
> > drivers = (is_virtual_port (g_udev_device_get_name (port)) ?
> >  virtual_drivers :
> >  mm_device_get_drivers (device));
> > 
> > *   force_cinterion = g_udev_device_get_property_as_boolean (port, "ID_MM_FORCE_CINT"); // my own custom var for udev rule
> > 
> > *   if (force_cinterion)
> > *   {
> > *   drivers = linmux_drivers;
> > *   }
> 
> I'm not totally sure why you would do this. What is the benefit of
> hardcoding some driver string based on a udev tag in the generic code,
> just to match then the driver in the Cinterion plugin? If you want a
> given plugin to use a given modem, just tag the device as you did and
> enable the "udev tag filter" in the plugin
> (MM_PLUGIN_ALLOWED_UDEV_TAGS). See the 'mbm' plugin for example.
> 

I'm back on this, trying to do it properly. I've removed by mod to mm-plugin.c, and added a udev tag 

G_MODULE_EXPORT MMPlugin *
mm_plugin_create (void)
{
    static const gchar *subsystems[] = { "tty", "net", "usb", NULL };
    static const gchar *vendor_strings[] = { "cinterion", "siemens", NULL };
    static const guint16 vendor_ids[] = { 0x1e2d, 0x0681, 0 };
    static const gchar *drivers[] = { "linmux", NULL };
    static const MMAsyncMethod custom_init = {
        .async  = G_CALLBACK (cinterion_custom_init),
        .finish = G_CALLBACK (cinterion_custom_init_finish),
    };
    static const gchar *udev_tags[] = {
        "ID_MM_CINT_LINMUX",
        NULL
    };

    return MM_PLUGIN (
        g_object_new (MM_TYPE_PLUGIN_CINTERION,
                      MM_PLUGIN_NAME,                   "Cinterion",
                      MM_PLUGIN_ALLOWED_SUBSYSTEMS,     subsystems,
                  MM_PLUGIN_ALLOWED_UDEV_TAGS,  udev_tags,
                      MM_PLUGIN_ALLOWED_VENDOR_STRINGS, vendor_strings,
                      MM_PLUGIN_ALLOWED_VENDOR_IDS,     vendor_ids,
                      MM_PLUGIN_ALLOWED_DRIVERS,        drivers,
                      MM_PLUGIN_ALLOWED_AT,             TRUE,
                      MM_PLUGIN_ALLOWED_QMI,            TRUE,
                      MM_PLUGIN_CUSTOM_INIT,            &custom_init,
                      NULL));
}

i.e. I've left in, for now, the MM_PLUGIN_ALLOWED_DRIVERS/drivers additions.
ENV{ID_MM_CINT_LINMUX}="1" is added to the udev rules, and everything reloaded.
Which puts me back to getting
[src/mm-plugin.c:251] apply_pre_probing_filters(): (Cinterion) [ttyMux1] filtered as couldn't retrieve drivers
What would be the neatest way to address this?


More information about the ModemManager-devel mailing list