ofono.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal
@ 2024-03-22 15:42 Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 02/11] modem: commonize feature string list generation Denis Kenzior
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

If use_mux code path was used, certain commands (like querying of the
SIM status) were not sent, resulting in incomplete modem initialization.
Fix that.
---
 plugins/phonesim.c | 102 +++++++++++++++++++++++++--------------------
 1 file changed, 56 insertions(+), 46 deletions(-)

diff --git a/plugins/phonesim.c b/plugins/phonesim.c
index 07afc14d56bb..29a983611d75 100644
--- a/plugins/phonesim.c
+++ b/plugins/phonesim.c
@@ -512,13 +512,27 @@ static void usimstate_notify(GAtResult *result, gpointer user_data)
 	ofono_sim_inserted_notify(data->sim, inserted);
 }
 
-static void cfun_set_on_cb(gboolean ok, GAtResult *result, gpointer user_data)
+static void emulator_battery_cb(struct ofono_atom *atom, void *data)
 {
-	struct ofono_modem *modem = user_data;
+	struct ofono_emulator *em = __ofono_atom_get_data(atom);
+	int val = 0;
 
-	DBG("");
+	if (GPOINTER_TO_INT(data) > 0)
+		val = (GPOINTER_TO_INT(data) - 1) / 20 + 1;
 
-	ofono_modem_set_powered(modem, ok);
+	ofono_emulator_set_indicator(em, OFONO_EMULATOR_IND_BATTERY, val);
+}
+
+static void emulator_hfp_watch(struct ofono_atom *atom,
+				enum ofono_atom_watch_condition cond,
+				void *user_data)
+{
+	struct phonesim_data *data = user_data;
+
+	if (cond != OFONO_ATOM_WATCH_CONDITION_REGISTERED)
+		return;
+
+	emulator_battery_cb(atom, GUINT_TO_POINTER(data->batt_level));
 }
 
 static gboolean phonesim_reset(void *user_data)
@@ -545,17 +559,6 @@ static void crst_notify(GAtResult *result, gpointer user_data)
 	g_idle_add(phonesim_reset, user_data);
 }
 
-static void emulator_battery_cb(struct ofono_atom *atom, void *data)
-{
-	struct ofono_emulator *em = __ofono_atom_get_data(atom);
-	int val = 0;
-
-	if (GPOINTER_TO_INT(data) > 0)
-		val = (GPOINTER_TO_INT(data) - 1) / 20 + 1;
-
-	ofono_emulator_set_indicator(em, OFONO_EMULATOR_IND_BATTERY, val);
-}
-
 static void cbc_notify(GAtResult *result, gpointer user_data)
 {
 	struct ofono_modem *modem = user_data;
@@ -582,6 +585,43 @@ static void cbc_notify(GAtResult *result, gpointer user_data)
 						GUINT_TO_POINTER(level));
 }
 
+static void finish_powerup(struct ofono_modem *modem)
+{
+	struct phonesim_data *data = ofono_modem_get_data(modem);
+
+	g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix,
+			NULL, NULL, NULL);
+
+	g_at_chat_register(data->chat, "+CRST:",
+				crst_notify, FALSE, modem, NULL);
+
+	g_at_chat_register(data->chat, "+CBC:",
+				cbc_notify, FALSE, modem, NULL);
+
+	g_at_chat_send(data->chat, "AT+CBC", none_prefix, NULL, NULL, NULL);
+
+	g_at_chat_send(data->chat, "AT+SIMSTATE?", simstate_prefix,
+					simstate_query, modem, NULL);
+	g_at_chat_register(data->chat, "+USIMSTATE:", usimstate_notify,
+						FALSE, modem, NULL);
+
+	data->hfp_watch = __ofono_modem_add_atom_watch(modem,
+					OFONO_ATOM_TYPE_EMULATOR_HFP,
+					emulator_hfp_watch, data, NULL);
+}
+
+static void cfun_set_on_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+	struct ofono_modem *modem = user_data;
+
+	DBG("");
+
+	ofono_modem_set_powered(modem, ok);
+
+	if (ok)
+		finish_powerup(modem);
+}
+
 static void phonesim_disconnected(gpointer user_data)
 {
 	struct ofono_modem *modem = user_data;
@@ -644,18 +684,6 @@ static void mux_setup(GAtMux *mux, gpointer user_data)
 					cfun_set_on_cb, modem, NULL);
 }
 
-static void emulator_hfp_watch(struct ofono_atom *atom,
-				enum ofono_atom_watch_condition cond,
-				void *user_data)
-{
-	struct phonesim_data *data = user_data;
-
-	if (cond != OFONO_ATOM_WATCH_CONDITION_REGISTERED)
-		return;
-
-	emulator_battery_cb(atom, GUINT_TO_POINTER(data->batt_level));
-}
-
 static int connect_socket(const char *address, int port)
 {
 	struct sockaddr_in addr;
@@ -755,25 +783,7 @@ static int phonesim_enable(struct ofono_modem *modem)
 		return -EINPROGRESS;
 	}
 
-	g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix,
-			NULL, NULL, NULL);
-
-	g_at_chat_register(data->chat, "+CRST:",
-				crst_notify, FALSE, modem, NULL);
-
-	g_at_chat_register(data->chat, "+CBC:",
-				cbc_notify, FALSE, modem, NULL);
-
-	g_at_chat_send(data->chat, "AT+CBC", none_prefix, NULL, NULL, NULL);
-
-	g_at_chat_send(data->chat, "AT+SIMSTATE?", simstate_prefix,
-					simstate_query, modem, NULL);
-	g_at_chat_register(data->chat, "+USIMSTATE:", usimstate_notify,
-						FALSE, modem, NULL);
-
-	data->hfp_watch = __ofono_modem_add_atom_watch(modem,
-					OFONO_ATOM_TYPE_EMULATOR_HFP,
-					emulator_hfp_watch, data, NULL);
+	finish_powerup(modem);
 
 	return 0;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 02/11] modem: commonize feature string list generation
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
@ 2024-03-22 15:42 ` Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 03/11] modem: commonize interface " Denis Kenzior
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

This code was repeated in multiple places, factor it out into a common
function.
---
 src/modem.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/modem.c b/src/modem.c
index 788e86fba0f6..37d9bd57fdd9 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -137,6 +137,18 @@ static const char *modem_type_to_string(enum ofono_modem_type type)
 	return "unknown";
 }
 
+static char **get_features(struct ofono_modem *modem)
+{
+	char **features = l_new(char *, g_slist_length(modem->feature_list) + 1);
+	unsigned int i;
+	GSList *l;
+
+	for (i = 0, l = modem->feature_list; l; l = l->next, i++)
+		features[i] = l->data;
+
+	return features;
+}
+
 unsigned int __ofono_modem_callid_next(struct ofono_modem *modem)
 {
 	unsigned int i;
@@ -878,12 +890,10 @@ void __ofono_modem_append_properties(struct ofono_modem *modem,
 					&interfaces);
 	g_free(interfaces);
 
-	features = g_new0(char *, g_slist_length(modem->feature_list) + 1);
-	for (i = 0, l = modem->feature_list; l; l = l->next, i++)
-		features[i] = l->data;
+	features = get_features(modem);
 	ofono_dbus_dict_append_array(dict, "Features", DBUS_TYPE_STRING,
 					&features);
-	g_free(features);
+	l_free(features);
 
 	if (modem->name)
 		ofono_dbus_dict_append(dict, "Name", DBUS_TYPE_STRING,
@@ -1303,14 +1313,12 @@ static gboolean trigger_interface_update(void *data)
 						&interfaces);
 	g_free(interfaces);
 
-	features = g_new0(char *, g_slist_length(modem->feature_list) + 1);
-	for (i = 0, l = modem->feature_list; l; l = l->next, i++)
-		features[i] = l->data;
+	features = get_features(modem);
 	ofono_dbus_signal_array_property_changed(conn, modem->path,
 						OFONO_MODEM_INTERFACE,
 						"Features", DBUS_TYPE_STRING,
 						&features);
-	g_free(features);
+	l_free(features);
 
 	modem->interface_update = 0;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 03/11] modem: commonize interface string list generation
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 02/11] modem: commonize feature string list generation Denis Kenzior
@ 2024-03-22 15:42 ` Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 04/11] doc: Add new Modem.Capabilities property Denis Kenzior
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

This code was repeated in multiple places, factor it out into a common
function.
---
 src/modem.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/src/modem.c b/src/modem.c
index 37d9bd57fdd9..24ab61761325 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -149,6 +149,19 @@ static char **get_features(struct ofono_modem *modem)
 	return features;
 }
 
+static char **get_interfaces(struct ofono_modem *modem)
+{
+	char **interfaces = l_new(char *,
+				g_slist_length(modem->interface_list) + 1);
+	unsigned int i;
+	GSList *l;
+
+	for (i = 0, l = modem->interface_list; l; l = l->next, i++)
+		interfaces[i] = l->data;
+
+	return interfaces;
+}
+
 unsigned int __ofono_modem_callid_next(struct ofono_modem *modem)
 {
 	unsigned int i;
@@ -832,8 +845,6 @@ void __ofono_modem_append_properties(struct ofono_modem *modem,
 {
 	char **interfaces;
 	char **features;
-	int i;
-	GSList *l;
 	struct ofono_devinfo *info;
 	dbus_bool_t emergency = ofono_modem_get_emergency_mode(modem);
 	const char *strtype;
@@ -883,12 +894,10 @@ void __ofono_modem_append_properties(struct ofono_modem *modem,
 		ofono_dbus_dict_append(dict, "SystemPath", DBUS_TYPE_STRING,
 					&system_path);
 
-	interfaces = g_new0(char *, g_slist_length(modem->interface_list) + 1);
-	for (i = 0, l = modem->interface_list; l; l = l->next, i++)
-		interfaces[i] = l->data;
+	interfaces = get_interfaces(modem);
 	ofono_dbus_dict_append_array(dict, "Interfaces", DBUS_TYPE_STRING,
 					&interfaces);
-	g_free(interfaces);
+	l_free(interfaces);
 
 	features = get_features(modem);
 	ofono_dbus_dict_append_array(dict, "Features", DBUS_TYPE_STRING,
@@ -1301,17 +1310,13 @@ static gboolean trigger_interface_update(void *data)
 	DBusConnection *conn = ofono_dbus_get_connection();
 	char **interfaces;
 	char **features;
-	GSList *l;
-	int i;
 
-	interfaces = g_new0(char *, g_slist_length(modem->interface_list) + 1);
-	for (i = 0, l = modem->interface_list; l; l = l->next, i++)
-		interfaces[i] = l->data;
+	interfaces = get_interfaces(modem);
 	ofono_dbus_signal_array_property_changed(conn, modem->path,
 						OFONO_MODEM_INTERFACE,
 						"Interfaces", DBUS_TYPE_STRING,
 						&interfaces);
-	g_free(interfaces);
+	l_free(interfaces);
 
 	features = get_features(modem);
 	ofono_dbus_signal_array_property_changed(conn, modem->path,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 04/11] doc: Add new Modem.Capabilities property
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 02/11] modem: commonize feature string list generation Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 03/11] modem: commonize interface " Denis Kenzior
@ 2024-03-22 15:42 ` Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 05/11] modem: add implementation for the Capabilities property Denis Kenzior
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

The intent of this property is to give an early hint to external
clients, such as ConnMan, about this modem's capabilities such that the
clients can modify their behavior accordingly.  For example, ConnMan
might choose to drive the modem slightly differently if it knows that a
modem is LTE capable.
---
 doc/modem-api.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/doc/modem-api.txt b/doc/modem-api.txt
index ff9facdce422..69108ab0057d 100644
--- a/doc/modem-api.txt
+++ b/doc/modem-api.txt
@@ -182,3 +182,9 @@ Properties	boolean Powered [readwrite]
 			supported by this modem.
 
 			Possible values are "test", "hfp", "sap" and "hardware".
+
+		array{string} Capabilities [readonly, optional]
+
+			Contains the capabilities of this modem.
+
+			Possible values are "lte".
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 05/11] modem: add implementation for the Capabilities property
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
                   ` (2 preceding siblings ...)
  2024-03-22 15:42 ` [PATCH v2 04/11] doc: Add new Modem.Capabilities property Denis Kenzior
@ 2024-03-22 15:42 ` Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 06/11] phonesim: Set modem lte capable Denis Kenzior
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

The Capabilities property is made available via GetProperties() D-Bus
method.  It is also emitted prior to emitting the PropertyChanged signal
for the Powered property.  This ensures that any clients that might use
the capability information, will obtain it prior to the modem being
enabled / powered up.
---
 include/modem.h | 14 ++++++++++++++
 src/modem.c     | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)

diff --git a/include/modem.h b/include/modem.h
index 1fa3df33544d..a70723a229a8 100644
--- a/include/modem.h
+++ b/include/modem.h
@@ -40,6 +40,10 @@ enum ofono_modem_type {
 	OFONO_MODEM_TYPE_TEST,
 };
 
+enum ofono_modem_capability {
+	OFONO_MODEM_CAPABILITY_LTE = 0x1,
+};
+
 typedef void (*ofono_modem_online_cb_t)(const struct ofono_error *error,
 					void *data);
 
@@ -134,6 +138,16 @@ ofono_bool_t ofono_modem_get_emergency_mode(struct ofono_modem *modem);
 void ofono_modem_set_name(struct ofono_modem *modem, const char *name);
 void ofono_modem_set_driver(struct ofono_modem *modem, const char *type);
 
+/*
+ * Set the capabilities of the modem.  This method should be called in
+ * the driver probe() method if the capability information can be obtained
+ * early, for example using the model information, or vid/pid of the device.
+ *
+ * Otherwise, it should be called prior to setting the device powered.
+ */
+void ofono_modem_set_capabilities(struct ofono_modem *modem,
+						unsigned int capabilities);
+
 int ofono_modem_set_string(struct ofono_modem *modem,
 				const char *key, const char *value);
 const char *ofono_modem_get_string(struct ofono_modem *modem, const char *key);
diff --git a/src/modem.c b/src/modem.c
index 24ab61761325..bfd5d7a81c45 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -88,6 +88,7 @@ struct ofono_modem {
 	void			*driver_data;
 	char			*driver_type;
 	char			*name;
+	unsigned int		capabilities;
 };
 
 struct ofono_devinfo {
@@ -162,6 +163,23 @@ static char **get_interfaces(struct ofono_modem *modem)
 	return interfaces;
 }
 
+static char **get_capabilities(struct ofono_modem *modem)
+{
+	char **capabilities;
+	unsigned int i = 0;
+
+	if (!modem->capabilities)
+		return NULL;
+
+	capabilities = l_new(char *,
+			__builtin_popcount(modem->capabilities) + 1);
+
+	if (modem->capabilities & OFONO_MODEM_CAPABILITY_LTE)
+		capabilities[i++] = "lte";
+
+	return capabilities;
+}
+
 unsigned int __ofono_modem_callid_next(struct ofono_modem *modem)
 {
 	unsigned int i;
@@ -849,6 +867,7 @@ void __ofono_modem_append_properties(struct ofono_modem *modem,
 	dbus_bool_t emergency = ofono_modem_get_emergency_mode(modem);
 	const char *strtype;
 	const char *system_path;
+	char **capabilities;
 
 	ofono_dbus_dict_append(dict, "Online", DBUS_TYPE_BOOLEAN,
 				&modem->online);
@@ -910,6 +929,13 @@ void __ofono_modem_append_properties(struct ofono_modem *modem,
 
 	strtype = modem_type_to_string(modem->driver->modem_type);
 	ofono_dbus_dict_append(dict, "Type", DBUS_TYPE_STRING, &strtype);
+
+	capabilities = get_capabilities(modem);
+	if (capabilities) {
+		ofono_dbus_dict_append_array(dict, "Capabilities",
+						DBUS_TYPE_STRING, &capabilities);
+		l_free(capabilities);
+	}
 }
 
 static DBusMessage *modem_get_properties(DBusConnection *conn,
@@ -1237,6 +1263,19 @@ void ofono_modem_set_powered(struct ofono_modem *modem, ofono_bool_t powered)
 		modem->timeout = 0;
 	}
 
+	if (powered && powered != modem->powered) {
+		char **capabilities = get_capabilities(modem);
+
+		if (capabilities) {
+			ofono_dbus_signal_array_property_changed(conn,
+						modem->path,
+						OFONO_MODEM_INTERFACE,
+						"Capabilities", DBUS_TYPE_STRING,
+						&capabilities);
+			l_free(capabilities);
+		}
+	}
+
 	if (modem->powered_pending != modem->powered &&
 						modem->pending != NULL) {
 		DBusMessage *reply;
@@ -1874,6 +1913,17 @@ void ofono_modem_set_driver(struct ofono_modem *modem, const char *type)
 	modem->driver_type = l_strdup(type);
 }
 
+void ofono_modem_set_capabilities(struct ofono_modem *modem,
+						unsigned int capabilities)
+{
+	if (!modem)
+		return;
+
+	DBG("%u", capabilities);
+
+	modem->capabilities = capabilities;
+}
+
 struct ofono_modem *ofono_modem_create(const char *name, const char *type)
 {
 	struct ofono_modem *modem;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 06/11] phonesim: Set modem lte capable
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
                   ` (3 preceding siblings ...)
  2024-03-22 15:42 ` [PATCH v2 05/11] modem: add implementation for the Capabilities property Denis Kenzior
@ 2024-03-22 15:42 ` Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 07/11] gemalto: " Denis Kenzior
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

---
 plugins/phonesim.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/phonesim.c b/plugins/phonesim.c
index 29a983611d75..ac83e88fa3d4 100644
--- a/plugins/phonesim.c
+++ b/plugins/phonesim.c
@@ -447,6 +447,7 @@ static int phonesim_probe(struct ofono_modem *modem)
 		return -ENOMEM;
 
 	ofono_modem_set_data(modem, data);
+	ofono_modem_set_capabilities(modem, OFONO_MODEM_CAPABILITY_LTE);
 
 	return 0;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 07/11] gemalto: Set modem lte capable
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
                   ` (4 preceding siblings ...)
  2024-03-22 15:42 ` [PATCH v2 06/11] phonesim: Set modem lte capable Denis Kenzior
@ 2024-03-22 15:42 ` Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 08/11] xmm7xxx: Set modem as " Denis Kenzior
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

---
 plugins/gemalto.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/plugins/gemalto.c b/plugins/gemalto.c
index 358d56a7aaf1..219354f7300e 100644
--- a/plugins/gemalto.c
+++ b/plugins/gemalto.c
@@ -217,11 +217,17 @@ static void sim_state_cb(gboolean present, gpointer user_data)
 {
 	struct ofono_modem *modem = user_data;
 	struct gemalto_data *data = ofono_modem_get_data(modem);
+	const char *model = ofono_modem_get_string(modem, "Model");
 
 	at_util_sim_state_query_free(data->sim_state_query);
 	data->sim_state_query = NULL;
 
 	data->have_sim = present;
+
+	if (!g_strcmp0(model, GEMALTO_MODEL_ALS3_PLS8x) ||
+			!g_strcmp0(model, GEMALTO_MODEL_ELS81x))
+		ofono_modem_set_capabilities(modem, OFONO_MODEM_CAPABILITY_LTE);
+
 	ofono_modem_set_powered(modem, TRUE);
 
 	/* Register for specific sim status reports */
@@ -609,7 +615,7 @@ static void gemalto_post_sim(struct ofono_modem *modem)
 		ofono_gprs_add_context(gprs, gc);
 
 	if (!g_strcmp0(model, GEMALTO_MODEL_ALS3_PLS8x) ||
-	    !g_strcmp0(model, GEMALTO_MODEL_ELS81x))
+			!g_strcmp0(model, GEMALTO_MODEL_ELS81x))
 		ofono_lte_create(modem, OFONO_VENDOR_GEMALTO,
 						"atmodem", data->app);
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 08/11] xmm7xxx: Set modem as lte capable
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
                   ` (5 preceding siblings ...)
  2024-03-22 15:42 ` [PATCH v2 07/11] gemalto: " Denis Kenzior
@ 2024-03-22 15:42 ` Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 09/11] ublox: Set modem " Denis Kenzior
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

---
 plugins/xmm7xxx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/xmm7xxx.c b/plugins/xmm7xxx.c
index 871c964c03b8..a02f1f5aa027 100644
--- a/plugins/xmm7xxx.c
+++ b/plugins/xmm7xxx.c
@@ -1682,6 +1682,7 @@ static int xmm7xxx_probe(struct ofono_modem *modem)
 		return -ENOMEM;
 
 	ofono_modem_set_data(modem, data);
+	ofono_modem_set_capabilities(modem, OFONO_MODEM_CAPABILITY_LTE);
 
 	return 0;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 09/11] ublox: Set modem lte capable
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
                   ` (6 preceding siblings ...)
  2024-03-22 15:42 ` [PATCH v2 08/11] xmm7xxx: Set modem as " Denis Kenzior
@ 2024-03-22 15:42 ` Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 10/11] gobi: " Denis Kenzior
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

---
 plugins/ublox.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/ublox.c b/plugins/ublox.c
index c5661ab6b1ad..c2fab0e7184e 100644
--- a/plugins/ublox.c
+++ b/plugins/ublox.c
@@ -91,6 +91,7 @@ static int ublox_probe(struct ofono_modem *modem)
 		return -ENOMEM;
 
 	ofono_modem_set_data(modem, data);
+	ofono_modem_set_capabilities(modem, OFONO_MODEM_CAPABILITY_LTE);
 
 	return 0;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 10/11] gobi: Set modem lte capable
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
                   ` (7 preceding siblings ...)
  2024-03-22 15:42 ` [PATCH v2 09/11] ublox: Set modem " Denis Kenzior
@ 2024-03-22 15:42 ` Denis Kenzior
  2024-03-22 15:42 ` [PATCH v2 11/11] quectel: " Denis Kenzior
  2024-03-22 16:20 ` [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal patchwork-bot+ofono
  10 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

---
 plugins/gobi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/gobi.c b/plugins/gobi.c
index 8d3b7ef4cdfc..7a07b080d895 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -117,6 +117,7 @@ static int gobi_probe(struct ofono_modem *modem)
 	DBG("net: %s (%d)", data->main_net_name, data->main_net_ifindex);
 
 	ofono_modem_set_data(modem, data);
+	ofono_modem_set_capabilities(modem, OFONO_MODEM_CAPABILITY_LTE);
 
 	return 0;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 11/11] quectel: Set modem lte capable
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
                   ` (8 preceding siblings ...)
  2024-03-22 15:42 ` [PATCH v2 10/11] gobi: " Denis Kenzior
@ 2024-03-22 15:42 ` Denis Kenzior
  2024-03-22 16:20 ` [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal patchwork-bot+ofono
  10 siblings, 0 replies; 12+ messages in thread
From: Denis Kenzior @ 2024-03-22 15:42 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

---
 plugins/quectel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/plugins/quectel.c b/plugins/quectel.c
index 69e1ff48729d..18cc33123759 100644
--- a/plugins/quectel.c
+++ b/plugins/quectel.c
@@ -648,6 +648,10 @@ static void qinistat_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	}
 
 	data->sim_ready = true;
+
+	if (quectel_model_supports_lte(data->model))
+		ofono_modem_set_capabilities(modem, OFONO_MODEM_CAPABILITY_LTE);
+
 	ofono_modem_set_powered(modem, TRUE);
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal
  2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
                   ` (9 preceding siblings ...)
  2024-03-22 15:42 ` [PATCH v2 11/11] quectel: " Denis Kenzior
@ 2024-03-22 16:20 ` patchwork-bot+ofono
  10 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+ofono @ 2024-03-22 16:20 UTC (permalink / raw)
  To: Denis Kenzior; +Cc: ofono

Hello:

This series was applied to ofono.git (master)
by Denis Kenzior <denkenz@gmail.com>:

On Fri, 22 Mar 2024 10:42:14 -0500 you wrote:
> If use_mux code path was used, certain commands (like querying of the
> SIM status) were not sent, resulting in incomplete modem initialization.
> Fix that.
> ---
>  plugins/phonesim.c | 102 +++++++++++++++++++++++++--------------------
>  1 file changed, 56 insertions(+), 46 deletions(-)

Here is the summary with links:
  - [v2,01/11] phonesim: Allow phonesim to work with Multiplexer=internal
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=7670bc2b6bdb
  - [v2,02/11] modem: commonize feature string list generation
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=1f65007294ac
  - [v2,03/11] modem: commonize interface string list generation
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=864466ac2d9e
  - [v2,04/11] doc: Add new Modem.Capabilities property
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=3dbaed76ff2d
  - [v2,05/11] modem: add implementation for the Capabilities property
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=811b646ed723
  - [v2,06/11] phonesim: Set modem lte capable
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=35ae347f6eeb
  - [v2,07/11] gemalto: Set modem lte capable
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=54765d17ea79
  - [v2,08/11] xmm7xxx: Set modem as lte capable
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=1da1169537fc
  - [v2,09/11] ublox: Set modem lte capable
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=9c45043f652b
  - [v2,10/11] gobi: Set modem lte capable
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=765a32ea0da2
  - [v2,11/11] quectel: Set modem lte capable
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=eea2814c492c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-03-22 16:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22 15:42 [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Denis Kenzior
2024-03-22 15:42 ` [PATCH v2 02/11] modem: commonize feature string list generation Denis Kenzior
2024-03-22 15:42 ` [PATCH v2 03/11] modem: commonize interface " Denis Kenzior
2024-03-22 15:42 ` [PATCH v2 04/11] doc: Add new Modem.Capabilities property Denis Kenzior
2024-03-22 15:42 ` [PATCH v2 05/11] modem: add implementation for the Capabilities property Denis Kenzior
2024-03-22 15:42 ` [PATCH v2 06/11] phonesim: Set modem lte capable Denis Kenzior
2024-03-22 15:42 ` [PATCH v2 07/11] gemalto: " Denis Kenzior
2024-03-22 15:42 ` [PATCH v2 08/11] xmm7xxx: Set modem as " Denis Kenzior
2024-03-22 15:42 ` [PATCH v2 09/11] ublox: Set modem " Denis Kenzior
2024-03-22 15:42 ` [PATCH v2 10/11] gobi: " Denis Kenzior
2024-03-22 15:42 ` [PATCH v2 11/11] quectel: " Denis Kenzior
2024-03-22 16:20 ` [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal patchwork-bot+ofono

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).