mbim-proxy vs mbimcli --no-open/--no-close

Aleksander Morgado aleksander at aleksander.es
Fri Jul 11 06:51:39 PDT 2014

On Fri, Jul 11, 2014 at 1:42 PM, Bjørn Mork <bjorn at mork.no> wrote:
>> One thing we didn't think about is how the mbim-proxy should handle
>> --no-open or --no-close actions performed by the mbimcli command line
>> interface.
>>  * When the --no-close option is used by mbimcli, it won't send a last
>> MBIM Close request to the modem before exiting.
>>  * When the --no-open is used by mbimcli, it won't send an initial
>> MBIM Open request to the modem when starting (e.g. if --no-close was
>> used in the previous action).
>> Now, when using the proxy, it will send an explicit MBIM Close request
>> to the device when all clients have been disconnected from the proxy,
>> which prevents the usage of --no-close. How can we best handle this
>> situation?
>> One option would be to let the proxy keep an 'open count' value,
>> depending on the open/close requests coming from the clients, and only
>> if the open count drops to zero it will send the MBIM close. One
>> problem with this approach is that if e.g. we get ModemManager
>> segfault unexpectedly it won't send the MBIM close, so an
>> open-reference will be lost. Not sure if this is a big issue, though.
>> What do people think?
> I don't think there is any way you can make CLOSE work with the proxy,
> so you might as well just do an OPEN when the proxy starts and a CLOSE
> when it exits.
> The only reason a client has to close a session is to ensure that the
> modem is reset to some default initial state.  This is impossible to
> gurarantee with the proxy, because other clients may depend on the
> current state.  IMHO it is better to make the behaviour predictable by
> never honouring a CLOSE request than to implement some scheme to allow
> the last client to issue a real CLOSE.
> And it is easier as well :-) No reference counter and no problems with
> crashing clients.

That is indeed a good approach... and much easier. Greg, what do you think?


More information about the libmbim-devel mailing list