Force 2G/3G/4G modes (when they are not reported as supported)

Dan Williams dcbw at redhat.com
Wed Oct 28 14:45:38 PDT 2015


On Wed, 2015-10-28 at 20:06 +0100, Aleksander Morgado wrote:
> On Wed, Oct 28, 2015 at 6:59 PM, Dan Williams <dcbw at redhat.com> wrote:
> >> > As you can see, there is only one supported mode (allowed: 2g, 3g, 4g;
> >> > preferred: none) which (as far as I know) offers me no contl about
> >> > which network technology is being used. When using this modem with
> >> > other SIM cards or other protocols (this modem also supports QMI,
> >> > direct IP and serial) the supported modes varies.
> >> >
> >> > My understanding is that the supported modes are provided by the modem
> >> > to ModemManager. Which variables affect the supported modes reported?
> >> >
> >> > Is there a way to force ModemManager to use only 2g/3g/4g despite of
> >> > the supported modes reported by the modem?
> >>
> >> I don't recall why it was hardcoded in MM specifically to disallow mode
> >> switching on LTE-capable devices.  Aleksander would probably know more.
> 
> ModemManager has 2 settings controlling this behavior: capabilities
> and modes. When 4G is enabled in the MC7710 (capabilities
> gsm-umts+lte) the only allowed setting is 2G+3G+4G (auto). If you want
> to set it as 2G+3G (i.e. no 4G) you'll need to switch capabilities to
> just gsm-umts (no lte). Once that is done, the modem will get rebooted
> and you'll now see a new list of mode combinations, including "2G
> only", "3G only", "2G+3G, 3G preferred" and "2G+3G, 2G preferred".
> This behavior is actually very specific to how the MC7710 responds to
> our commands (i..e how we compute the list of supported modes and
> capabilities). Other modems like the MC7304 may not require the power
> cycle to switch capabilities just to get in 2G+3G mode.
> 
> This may also give more info:
> https://sigquit.wordpress.com/2013/06/03/changing-modes-and-capabilities-in-modemmanager/
> 
> As for why we hardcode the values. Well, those are the modes that QMI
> supports. The only confusion here is why you didn't get the 2G+3G
> modes when 4G was also enabled, which I said I believe is very
> specific to the MC7710 if I'm not mistaken.

My read of the code indicates that we get the same behavior with USB
devices like the UML290 and such too though, right?  Which don't have
the same restriction as the MC77xx devices.  eg this code block in
modem_load_supported_modes():

    /* LTE and others, only allow to have all, no further preference */
    else if (mm_iface_modem_is_3gpp_lte (_self)) {
        /* 2G, 3G and 4G */
        mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G |
MM_MODEM_MODE_4G);
        mode.preferred = MM_MODEM_MODE_NONE;
        g_array_append_val (combinations, mode);
    }

obviously gets run for an LTE-capable modem, even ones that can change
modes around unlike the 77xx devices.

Dan



More information about the ModemManager-devel mailing list