[PATCH v2] mbim-proxy: Don't enable all the CID's in global device service subscribe list.
Aleksander Morgado
aleksander at aleksander.es
Sat Feb 7 03:31:29 PST 2015
Hey,
On Fri, Feb 6, 2015 at 11:33 PM, Roshan Pius <rpius at chromium.org> wrote:
> Since we're enabling all the CID's in the global device service
> subscribe list during init, any new clients connecting to the proxy and
> requesting a change in the device subscribe list doesn't take effect
> since all the CID's are always enabled. This results in mbim-proxy
> never sending the device-service-subscribe set command to the device
> after bootup.
>
> Change-Id: I028ba5f8d6801374022a5c93d985e59fbc3ad93a
The MBIM spec says, in the MBIM_CID_DEVICE_SERVICE_SUBSCRIBE_LIST description:
"Upon OPEN_DONE completion, notifications for CIDs defined in this
specification are enabled (aka
subscribed to) by default, and vendor extension notifications are off
by default"
Isn't this what we already had in the proxy?
When a new client connects to the proxy, and they request only a
specific subset of the default services, there will be no messages
sent to the device because all the requested items in the subset were
already enabled by default. The proxy should just take care of only
forwarding to each client the specific subset each client asked for.
> ---
> src/libmbim-glib/mbim-proxy.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/src/libmbim-glib/mbim-proxy.c b/src/libmbim-glib/mbim-proxy.c
> index fdbc7d9..892e980 100644
> --- a/src/libmbim-glib/mbim-proxy.c
> +++ b/src/libmbim-glib/mbim-proxy.c
> @@ -853,16 +853,11 @@ merge_client_service_subscribe_lists (MbimProxy *self,
> gsize *out_size)
> {
> GList *l;
> - MbimEventEntry **updated;
> + MbimEventEntry **updated = NULL;
> gsize updated_size = 0;
>
> g_assert (out_size != NULL);
>
> - /* Add previous global list */
> - updated = _mbim_proxy_helper_service_subscribe_list_merge (NULL, 0,
> - self->priv->mbim_event_entry_array, self->priv->mbim_event_entry_array_size,
> - &updated_size);
> -
> for (l = self->priv->clients; l; l = g_list_next (l)) {
> Client *client;
>
> @@ -1362,8 +1357,9 @@ mbim_proxy_init (MbimProxy *self)
> MBIM_TYPE_PROXY,
> MbimProxyPrivate);
>
> - /* By default, we assume we have all default services enabled */
> - self->priv->mbim_event_entry_array = _mbim_proxy_helper_service_subscribe_standard_list_new (&self->priv->mbim_event_entry_array_size);
> + /* By default, all services are disabled untill a client makes a service-subscribe request */
> + self->priv->mbim_event_entry_array = NULL;
> + self->priv->mbim_event_entry_array_size = 0;
> }
>
> static void
> --
> 2.2.0.rc0.207.ga3a616c
>
--
Aleksander
https://aleksander.es
More information about the libmbim-devel
mailing list