diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-03-11 10:43:05 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-03-17 09:39:10 +0100 |
commit | e5305498b7ddbc5e419cf51fc0c30aa6593a40d2 (patch) | |
tree | 0b356745ee60f0effb5c91447d4d8876cecd7414 /src/mm-bearer-mbim.c | |
parent | 0830f9510cd67c25de57a4ffc5086882b59b3d12 (diff) |
bearer-mbim: session id 0 by default in all non-multiplexed connections
The original logic in the MBIM modem would assume that if we had more
than one network interface in the same modem, we could connect
multiple data interfaces, each one with a different session. That
logic is actually wrong, when using the master (non-multiplexed)
network interface we should always use session id 0, which is the one
holding all non-VLAN-tagged traffic.
So, remove the logic that automatically creates new bearers with a
different session id, as that is really wrong.
Diffstat (limited to 'src/mm-bearer-mbim.c')
-rw-r--r-- | src/mm-bearer-mbim.c | 64 |
1 files changed, 2 insertions, 62 deletions
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index 16dcad45..323483ce 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -34,18 +34,9 @@ G_DEFINE_TYPE (MMBearerMbim, mm_bearer_mbim, MM_TYPE_BASE_BEARER) -enum { - PROP_0, - PROP_SESSION_ID, - PROP_LAST -}; - -static GParamSpec *properties[PROP_LAST]; - struct _MMBearerMbimPrivate { /* The session ID for this bearer */ guint32 session_id; - MMPort *data; }; @@ -1320,8 +1311,7 @@ report_connection_status (MMBaseBearer *self, MMBaseBearer * mm_bearer_mbim_new (MMBroadbandModemMbim *modem, - MMBearerProperties *config, - guint32 session_id) + MMBearerProperties *config) { MMBaseBearer *bearer; @@ -1329,9 +1319,8 @@ mm_bearer_mbim_new (MMBroadbandModemMbim *modem, * and that means that the object is not async-initable, so we just use * g_object_new() here */ bearer = g_object_new (MM_TYPE_BEARER_MBIM, - MM_BASE_BEARER_MODEM, modem, + MM_BASE_BEARER_MODEM, modem, MM_BASE_BEARER_CONFIG, config, - MM_BEARER_MBIM_SESSION_ID, (guint)session_id, NULL); /* Only export valid bearers */ @@ -1341,43 +1330,6 @@ mm_bearer_mbim_new (MMBroadbandModemMbim *modem, } static void -set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - MMBearerMbim *self = MM_BEARER_MBIM (object); - - switch (prop_id) { - case PROP_SESSION_ID: - self->priv->session_id = g_value_get_uint (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - MMBearerMbim *self = MM_BEARER_MBIM (object); - - switch (prop_id) { - case PROP_SESSION_ID: - g_value_set_uint (value, self->priv->session_id); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - - -static void mm_bearer_mbim_init (MMBearerMbim *self) { /* Initialize private data */ @@ -1404,8 +1356,6 @@ mm_bearer_mbim_class_init (MMBearerMbimClass *klass) /* Virtual methods */ object_class->dispose = dispose; - object_class->get_property = get_property; - object_class->set_property = set_property; base_bearer_class->connect = _connect; base_bearer_class->connect_finish = connect_finish; @@ -1416,14 +1366,4 @@ mm_bearer_mbim_class_init (MMBearerMbimClass *klass) base_bearer_class->reload_stats_finish = reload_stats_finish; base_bearer_class->load_connection_status = NULL; base_bearer_class->load_connection_status_finish = NULL; - - properties[PROP_SESSION_ID] = - g_param_spec_uint (MM_BEARER_MBIM_SESSION_ID, - "Session ID", - "Session ID to use with this bearer", - 0, - 255, - 0, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); - g_object_class_install_property (object_class, PROP_SESSION_ID, properties[PROP_SESSION_ID]); } |