Re: [MM master] Re: [MM06] [PATCH] sierra: use +CFUN=4 for powering down



On Mon, 2012-09-10 at 11:36 +0200, Marius Kotsbak wrote:
> Den 10. sep. 2012 10:41, skrev Aleksander Morgado:
> >>>>> See patch attached.
> >>>>>
> >>>>> sierra: use +CFUN=4 for powering down
> >>>>>
> >>>>>    plugins/mm-modem-sierra-gsm.c |   32 ++++++++++++++++++++++++++++++++
> >>>>>    1 file changed, 32 insertions(+)
> >>>> This also needs to be intregrated in the master branch version. Attached
> >>>> is my attempt to do it, but it seems not to work. I see no effect of
> >>>> disabling the modem with "mmcli -m X -d".
> >>> See review below.
> >>>
> >>>> Also, it seems like the power down is not done before the modem enters
> >>>> disabled state at startup of MM or after modem is inserted, so I filed a
> >>>> bug about that:
> >>>>
> >>>> https://bugzilla.gnome.org/show_bug.cgi?id=683681
> >>>>
> >>> Yes, that's a known issue, see TODO in the source tree.
> 
> The text there is slightly incorrect. It does not help if the modem is 
> in low power mode when started (some might also be configured to be), 
> because at least in the Sierra plugin, it is waked up to CFUN=1 in the 
> init anyway. This could be avoided by accepting CFUN mode 4 and 7 as 
> well. But then it must be changed to mode 1 when connecting.
> 
> I am not sure if all the init steps are possible in low power mode.
> 
> >>>
> >>> Dan, what do you think of this, should we run the whole disabling
> >>> sequence, including the power-down command, just after the modem gets
> >>> initialized? I would do it, but now sure if that would have any
> >>> unexpected complication.
> >>>
> >>> The only problem I could think of is when you want to connect your modem
> >>> as soon as it appears in DBus, running the Simple.Connect() command. In
> >>> this case you don't really want to go to the low-power mode as you're
> >>> going to connect it right away.
> >> When would this happen? This power down/disabling should only happen if
> >> the mobile broadband is disabled (the default now, although it could be
> >> discussed if it should be if there are any auto connections available).
> >> If mobile broadband is enabled and a new modem appears, it should move
> >> directly from init to start connection.
> >>
> > MM doesn't know anything about "broadband disabled"; that's a NM setting
> > and NM is the one required to honour it. Just assume MM doesn't work
> > only with NM.
> 
> Ah, so then MM api could be extended to either expose the power up/down 
> functions or the init gets a parameter saying if the modem should be 
> enabled after init.

Power Up = enabled
Power Down = disabled

So we already have those states in ModemManager via the Enable() method
and the modem states.  It's just that not all devices actually implement
the low-power mode when disabling, partially because we're not always
sure of the side-effects.

It's already expected that the device needs to be Enabled to do anything
related to the network or SMS.

With a lot of phones you don't want to change power state at all,
because CFUN=0 actually shuts the phone off, and I assume CFUN=4 would
put it in airplane mode.  When connected to phones, MM probably
shouldn't touch the power state at all.  Obviously for Sierra that's
not a problem, but for the Nokia driver and the generic driver, we
simply can't do any power control because of this problem.

> > But I do agree that we need to handle this properly. We do need to run
> > the whole disabling sequence at the end of the initialization sequence,
> > either if we're in LOCKED or DISABLED state. The problem doesn't only
> > come with power consumption (e.g. the modem has radio powered on, even
> > if we say it's disabled); also, the modem will be registered in the
> > network and may receive SMS, which we wouldn't process as all the
> > feature-specific interfaces are not enabled yet. I'll look at how to do
> > this and suggest a fix for this.
> 
> Japp, beside that the computer might be positioned and it should be 
> turned off to use it in an airplane.

Airplane mode = Disabled

On the NM side we've got some stuff to do here.  I've been thinking
about this for a while, and in conjunction with the patches you've done
for auto-connect here, I'd like to rework the NM modem enable/disable
handling WRT WWAN on/off to be clearer.

Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]