From patchwork Fri Mar 22 15:42:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600263 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C67D481B3 for ; Fri, 22 Mar 2024 15:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122159; cv=none; b=QA9n4KPbWuRo7m9kja8Wjd5x6xJbKYLZJGNT/NTx3YDMMa34JO+KjXuEm71EnTDCyc57KeJ/WwHm4Dw3JLgrYvOA2vqolpaiPfIgGw9gS50bWGmPTQ1Zlb7MYJh8ZQqFaLeA307IzTLZhNAj+JWLdHwHv5avkzqryZ+6kCh6MU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122159; c=relaxed/simple; bh=3nQB5yM+yXF4YwHuYBuGxiw8B2qV2ccA7xTB/Zszzfk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QHZqNyZcGwlgtcygzkkwX7xVa3Y2ZlXqE7GBlQ4ZcWk/USpVj8dW1t1HqLo1rH2Gy+UFBRndZNUIX9P5I4BXeE/tXkFDH3pGiReagYSA1WD2bUI8vP7oWeVO/bSWXt1vo7PbnHKO/6f/zs+fazGVH6tz41Ifc942IIAQvMYfbpc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MFpfN70y; arc=none smtp.client-ip=209.85.210.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MFpfN70y" Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6e6775fd386so1351892a34.3 for ; Fri, 22 Mar 2024 08:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122157; x=1711726957; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zVvZoQp+AQIDlOlnYC6APkftVteuztwRLNYdmRzkiHw=; b=MFpfN70yeW5exY8CtRvgLlgG8VYamL2zNhDhZwBgAukA0n6o/+wTzRgG6Ka6q2TYo2 VGVQKXIahiMzvwLUHBvYkkBeW96V62WcV/fZuicBS4yizWj1IwUtEIWnoRT4CqsnHN5X PCaB8F/ZeaJD9EsHjYokPchaH/QrNcDaSE9kcrVHpCowhH58lOkaW03x0hZJFMpgwqZy 0mWpLHdMnd698cKM7yBDHNEvr0C3N5Z/7RYGApwL5TaFwaEqrAlXro/NJQvRXGhTxFhT 2eJcQHT5OVf6anvn35BbT9mcuyikwH4FTa7aMBJmCQS0rvw1xpaSogmGRZLRBCSVIZgd 80Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122157; x=1711726957; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zVvZoQp+AQIDlOlnYC6APkftVteuztwRLNYdmRzkiHw=; b=qkho9YZUEzjNivt2bxiRlI11dOiKZXR5LUHI4MH7kNkMLRTA6+K5vGG8r7RsY4Bycg UqhOaeQBU1qM4Eu4yHLUbO+pjFkDDqloEtGXsMpGBJ/r4zNsKI0a/LKVpbSwv+155dkv Jurn20sxcbrqY5mFgyM0dBp2bSKszplqP3CuBcidWrAziD8iHukpf9Ip4/gusS+CU9cy XXCiE5/2RJ0Ph92YaCPTa23c/L6F4x5MybALC5BkigPnk6wJ1R9u1R5assA/hZr9ru/x 1hOUQgXf1dvQvCA9JDplKQrFHcKI4BolfiDy8fOcJhhiJoflhcnQil86Gr9Q0PPvEzrk Djjg== X-Gm-Message-State: AOJu0YyGUZSo9NbR2kHRzRJ3IArOt7Y+bJScXLAaGzrjRP7CckeexdZR v0DgN1tyXPeB8qlMfbEsoOKJUzsQ1YfpxY8/oQ6WccXYFjJDSDp6IBBc3QjI X-Google-Smtp-Source: AGHT+IElbD4kdwjaTUDrfeUpNgZvXj5HVb5GUbYsNQaqhPk6Z+TinmQUkqtbDoK8r24QP6koEJynDQ== X-Received: by 2002:a9d:6e13:0:b0:6e6:9528:6136 with SMTP id e19-20020a9d6e13000000b006e695286136mr22768otr.12.1711122156749; Fri, 22 Mar 2024 08:42:36 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:36 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Date: Fri, 22 Mar 2024 10:42:14 -0500 Message-ID: <20240322154234.2720542-1-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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; } From patchwork Fri Mar 22 15:42:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600264 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 941764CE13 for ; Fri, 22 Mar 2024 15:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122160; cv=none; b=GR8TYSU/41WDXCaAhCUlJplNiTpn2gxzi/CJ/0vy7F6TwIb96/ggoG/b0h/+NyNn1lriS1TgQbSvDCRK2vIwGGJe1wAnm54ZGHuPOilExJY/whhZ/jspyqUESEzb3EVUbw74A2tq+mhLtYEa1dOGI5BjqgByGfZL0+lQcEUiO9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122160; c=relaxed/simple; bh=F2kBdDkO9/lifi4hnFgrDevAneXJ6Yj0qswNBRN9guo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JhnPRSECz7XCriuuieoVBeo65ujnavmYKRe0LqAikvI7sHiBuJ5oNLLYl8g4SJNdkvdppoigPOhPgBRjEDJLeHGzxQOJ+R/6T1ZzXUE9NQvI49fWtuVXTL95XxWu2SLwBqnmPUUomxd8a3Iacp4cKqVYJbZdgOrXBnB+Ux+qRF8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=V1kCDUGz; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V1kCDUGz" Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6e519d73850so1414619a34.2 for ; Fri, 22 Mar 2024 08:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122157; x=1711726957; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UvG8VkNelblegkAJJcYsuUfUkmU7fhzLdvQgv2CLO2g=; b=V1kCDUGz2IQFlYOvpsg6Qy8scwUBo67wSDCz/uYv5Xgz55yGsrrTlLgrXlIoB7i7Wq Qgcc996kW5gUzUd5JhGJWB7s9LGp7eEov5cjFJiOZNNKasH6bWKdyWzXsTuqwszovfc/ wiJ62lStTMzI+R35ySYf1rFdnKiNJ5al8tm3CcuwlI+KwDdgn0UAJT/NxbFxO+T3r/on 0IkWKTNkji5JBNtNHMeva3Lvh5S2INacZa4Y0REwU6jDujrZc9JKYh1pFUxgn9NdiPk0 XYUuHvZh53hOH/jxCpW6LT1qDQ6VuoUAOe7Njs0adUyQilyqZ3S8u1eMohuN7/FgVENe 5KIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122157; x=1711726957; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UvG8VkNelblegkAJJcYsuUfUkmU7fhzLdvQgv2CLO2g=; b=Q4Qq3C3NuctHKrkFn6S7wUYUURAjePCYynrO1DyKRMzFPQc9b0ffwir1kEKGFnQZcj 1/021ofu+i0JdKhyxbdqpuaai8hBVHSXHQVvOn7oivWRo1HXudI2TRBbskbpiWoE9Gsg p63HYPYieC3HZMS2U+HAs6lCDkv4SDtz1K4QydiF9DEXTmPLESvpWfUwPFeNpP+xV5Y8 5J2cEyIZgfxiw4yQ4gSQDOgYh11BYCmNg0xl/GJMuQQYcOsKGk+kji7J+o+958+mf+iZ xBxpOMc7MgFt9pCMnji7NLHkWa7fB3yojZZB2ob663TKHAUXG9XkdeqdjfwfuCOwFn6i elAg== X-Gm-Message-State: AOJu0YzLKZbPxz3qRSYurUnPYbijfM04mSQ50ARNw2iCjFNowtPITq04 awZ19ItylCo7gQivdW+0XEIlrATvhNx0VgIxqU0vi/rn9j7QJN6AVg0xF0Cy X-Google-Smtp-Source: AGHT+IFgf/osuEfu1mjnkKeC91HoyEv4lf2LmixHmvbG/ADyvsUyGsnZMLY1wsvZIBBKtLrz7IQ8nw== X-Received: by 2002:a05:6830:1d67:b0:6e6:7adc:e4ed with SMTP id l7-20020a0568301d6700b006e67adce4edmr2629008oti.29.1711122157455; Fri, 22 Mar 2024 08:42:37 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:37 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 02/11] modem: commonize feature string list generation Date: Fri, 22 Mar 2024 10:42:15 -0500 Message-ID: <20240322154234.2720542-2-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322154234.2720542-1-denkenz@gmail.com> References: <20240322154234.2720542-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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; From patchwork Fri Mar 22 15:42:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600265 Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B80D50A88 for ; Fri, 22 Mar 2024 15:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122160; cv=none; b=H0cBUC2HNpmc47GCmmOV1o2sPtHsyIZLNgRiR7BOEuBTstsSBUfvmgbgHOdRSxENfOVdSgzIDrEHGGwIYyobLI9kL6znb6Xkaz5GPaMa+oAyQL4I+acCpPHKCSw0ibPzj+2ni2qzbsi6/F9r0TP6YrBIm3a4vceI/vrHgYzy05M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122160; c=relaxed/simple; bh=leNypGPphppVvT22hna5vh0O5jb2CwfyLqdlocK+p08=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rmG4hlzz7ZlVfo08ydOvUquRajBnW3wUFOlvtpED00r1BrRmRaU8wplIzKX7SvhurcmGspKzlBrcNzRxUKKO+MnyFrsYSB5S8xgivi/DlGC3m+j4VLMmcWmU0TUiOUopX2yxi8yiDNa/1AYRB9XQcZawnJWaJ5Mou9uS4+J/U7Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GN1UBuAh; arc=none smtp.client-ip=209.85.210.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GN1UBuAh" Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-6e6b582d266so747228a34.3 for ; Fri, 22 Mar 2024 08:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122158; x=1711726958; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=abiA7JPT86Q2mYUz0MSoC4cJmAibaQeXB6pHarWLsfg=; b=GN1UBuAhyQZIG+yndvY/o+b3TjE9jg+mwFpnxMyNJLym3t0+qvYQ+nhzsumDo0rigf erbJHfY9f3J9UTMhU3Msxd45g1Cam6cITRDHY12Gn3OTucB7wqE8gvJUMztaklXFSUtd G2dCRl6sLh8oVuKZgGT3gwS4HsLnN7sEqGHTquvKvFUTt/pxWKWE7z1EmoqdrVFTZt5N 7qxcSFHn6czTGzq11/m7mMtPOEWDJRXK8fOSyQNvH9rnBz65WKbzVj+j52EChnBuPgTm pHwAio0azsxZjMOLp+ynTUQokAaeU53zUS59O2XsxQ0uEPXvb84bWIss9oW4pcInjyLh u1Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122158; x=1711726958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=abiA7JPT86Q2mYUz0MSoC4cJmAibaQeXB6pHarWLsfg=; b=Eqc6gnz6FlxbunWdpndNj3afhQkBxpz/5uxax3yTe389Nph80JVft97VcENuQknFWQ K5Il/z52WpKHZxF6DterlW46eb6sjNypO1igsgKWZ6HSPI9TOQaSy3gALFGeE6ahh17d DtAs+o4wr0ClVaJQ+cousxLbL+7QWv6k831m7x+FdoZlPbVbKkOWBj11AHMGj2QxyF4r xFAfnPtVSurdlMEXp7PbZNKGBhGiulmN7jzCv34oIQuAxYR2QmQ6bA3F3gQjs/4HIp+0 D1qw0EavfjxwIc+zZ5vgmwjc0okjdsP2bEwWbCdBn/gsK6HI5L/oVMQK2+AR3SWz5DCE 4VUQ== X-Gm-Message-State: AOJu0YyJjnsLhWawg1QqUVGe/omES+iLURhQtv+RTPBbGzz4/paw/FWw d3awx0f55hgzwCyUcmjywTQXD9sEhXCD21bB7CPP568DXJ7xjppUSmsNyrgB X-Google-Smtp-Source: AGHT+IENcvVHf2EKks133VESTzITvGrk1jNDdS3GN3aYaAaTNpcpGHCRALxcJVEhbESwDuVk7pmzow== X-Received: by 2002:a05:6830:22d9:b0:6e6:9a77:62b5 with SMTP id q25-20020a05683022d900b006e69a7762b5mr17621otc.9.1711122158326; Fri, 22 Mar 2024 08:42:38 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:37 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 03/11] modem: commonize interface string list generation Date: Fri, 22 Mar 2024 10:42:16 -0500 Message-ID: <20240322154234.2720542-3-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322154234.2720542-1-denkenz@gmail.com> References: <20240322154234.2720542-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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, From patchwork Fri Mar 22 15:42:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600266 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CBD651C4F for ; Fri, 22 Mar 2024 15:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122161; cv=none; b=cx70wRcxGU2fk6HU2FMYZIn/eIkPCGJqXZ76p3OCs14+Qy7/DC+fON/cd5jD8a8xAv4ErWFYfB3VA+A6L0G7Z4pVRemgIikGTvai1/ejiSWqB5VJiwtTq7BneZRy4mm98thl3vbdi/d3SWEMyLkq4IXifCa7CnqyxKYZb24BhRA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122161; c=relaxed/simple; bh=biO0vb9/BuYWdOKBrZeZO+0e+XU5XceqX5G2CW9jOWo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jkc4dI7dwSq1UgegCL/R1ttoGobTL7Bv0OFTjJI3wKuHmT3AbcpaHJ6M8TDJHHyGcc1mjbqd5PIBPyqEZ5eP7b1iRbRau3vo+p6LBMmySp9INaxMv0bz8LDwgN+adM9iwsDfLItcDAIiCnQK9BcE8EighKRdcg/rIxhHPJJuHW8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=acYDg9Td; arc=none smtp.client-ip=209.85.210.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="acYDg9Td" Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-6e6ad82cf17so1232211a34.3 for ; Fri, 22 Mar 2024 08:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122159; x=1711726959; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2TfHiSW3eeJJvsnn2GJBhNZPGTm7drQ43Cvv3SrTLm0=; b=acYDg9TdPuesEjnLCPD2mKn3tcypvFWvKCWaT6A9XEwuoLPZfm1CkLTXsN2SArRbj9 ckdQeyAujdRSceZUwTwkmZf+I2czB2ZQ6OTWuft/LLGxO7XfiQFOFC/9bgVsbA/G2TiZ AGiXs9aEohNQ9MPeoUsEV8+T3h9lQRXehA1kX8VI7WXwAWy12MciYonJqC6dSx1cwkDA fyDnKGi58vs5sA2ylqZqS8gxiYmPmIUmKIf5F2hMdVSLhsc+8+tYWpkF+0SlxGtA0iLs ht2dazUo10xuOuBQEnVdmWt3IK6CHDh1XqAh+a6T4i5xr1qxcBmqE713e5L7RCEQA5cv Xixw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122159; x=1711726959; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2TfHiSW3eeJJvsnn2GJBhNZPGTm7drQ43Cvv3SrTLm0=; b=PO8wH6iDuToEEKFT+gT/7OXs7/fZ7wQcIA8vVH6y+N0wz6L2jaD2VtgRzaqtJqJH7E Qu9bbTIk8Li+06vc9dc4vRpucGeW1K0Rkif0VGE/S2rKOxtmOY8MH3PXaEwFxXenOl1V Gf/AjwTZzrfk4Y9ie7I9B8JuSZBRSa3Y7BzaOeSygbTS19WEnpWfW/isF8w8Amd5cUxS 2w44vLB8j0V469i0PRZSqTjvmL8V8ndD/fl3QWOP5ZlU4WwBbDJlKh/0P9AwQ+OFfN3h 6nJ0v54PcJmnAjAlV8Nru7CcdMvh31ekzxKjWnTbLdSGxBOsxynBQthMlsx8IcqiTG26 Rwig== X-Gm-Message-State: AOJu0YwcpOi5w1uKp5pWLn6xaJ6Spv9KNMVkPnlc0sTOfr2m3Izt7DuA pQPa6ZLruaavfH94bmv6l7sucS6MDktcW+ZD5RT8/UOcu6/7QnDrN2gXF23T X-Google-Smtp-Source: AGHT+IFeNHrowD+gP0Swk1rfAKz46IPcRDwQscJAGnWgx+3CvtGoHQcBzjUvjGj6DjJ6Kjm0UnQIgA== X-Received: by 2002:a05:6830:45:b0:6e6:8ec7:85d6 with SMTP id d5-20020a056830004500b006e68ec785d6mr3116410otp.31.1711122159060; Fri, 22 Mar 2024 08:42:39 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:38 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 04/11] doc: Add new Modem.Capabilities property Date: Fri, 22 Mar 2024 10:42:17 -0500 Message-ID: <20240322154234.2720542-4-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322154234.2720542-1-denkenz@gmail.com> References: <20240322154234.2720542-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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". From patchwork Fri Mar 22 15:42:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600267 Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9BAC481B3 for ; Fri, 22 Mar 2024 15:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122162; cv=none; b=hJue5wRWjs3Q1N4sxB2YXD2Dx/ebDssG77L8BQ+tNZBV7a0gpoLPdfCrwryarhlvQWWgQSIGxmNvkjEvIlAwrfhBsVtivD618hQskN5lZoXsDPbpeA2Uh9UBn+el4k5sMBLKg2TNTXpluXc62nMGWlbltpOmColFreh0+f7b+/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122162; c=relaxed/simple; bh=4brL2qU0kuwi1SJQmYUJ4q/6oVcrD12DdqMEQtGOEwk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sg0PRaOFeSw3/ENBLiwmeFd4760e9RkZjpzFlOvnMcnkKeOWRbhwFQCCrMiCyv+By2zDv4fmhX+Grn4a5kk8VSoEIN18naRJQASGOusKa24QTv/o1x7s98A97EFwSDRAsJ75ZLfzSRwSB4Ii2go/U4buwukjL+4kJY4vXJpqn94= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OfQo4TYv; arc=none smtp.client-ip=209.85.210.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OfQo4TYv" Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-6e6adb43e39so1458849a34.0 for ; Fri, 22 Mar 2024 08:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122159; x=1711726959; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zTCa7ZZZZ+zjMIO42Z8wRCgssRlS5QYaWaU3HvvcqzM=; b=OfQo4TYv4ssit0GEMX5R4l0op+eArEpLixGPFQAZjbTbQ2PcVnKT6M/FN7GHAF5iMS Tatp2pokhXMkyKCy6k6VqzNzJ9L9zjb5zxEGfCT7owM64vebZxHNBZAKQaZwBhgRQqVB fsFQG9DRrbIG8AxTuPZZv8O+Cy7Pj+BHKwfVpV2LLbFHyTAdEKzdFhrdZ21upadI3t9L 1ybsEUizkr3tycsOI+dVKJqlLibD4E0VaafY8f/8y4aRb7i7U01PzgdBJs5VNxGSNY6v TUGTRIjW2rxL7rf7T0+6lYHaM+elv8J+DVMp3/I1+MEeYaqAQKASsOvANipQvfcsGBf4 nL1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122159; x=1711726959; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zTCa7ZZZZ+zjMIO42Z8wRCgssRlS5QYaWaU3HvvcqzM=; b=juZzfPMfRrq8N4s38i0rBGLnbdU/0ree/wsKhEdh66WrG2KUJRqHvuP7p02RRrpeYJ gQHk26ue85uefD1K6wKtxDejjhpY7FenaNcAjTrkgA+vGZgZbm5CL51A60ctAxQM8/qi LJq9W3Ww6k8HC1aGbmWs0GKY1HKcTccQBxdoHQeQEo5O5fdrTR0qXdhYFH/LmLIeVvE6 BPlUxTyTMPFAWoXZ3xCEzD5n+MP75uno+qSV4BCz1AHnwjOuvBbLMYBe4Mut68zcYI61 S0ejc4UXX6LBeEVwJdp+8rsfts2xLnRJBc/UoQXPBHqGBsgm+KRsnp6IQCZjAuBhTd7w vZXA== X-Gm-Message-State: AOJu0YzWFoREE0X0VNqegufizyGjmN56mwZTSYBGZDUCqdN5LJ6G0ZZ8 pTgf1WUjm+SMVhaOWs/GgozgKJA56v8gkZQOpZacAs6PMm1CuwdxShhU9IRK X-Google-Smtp-Source: AGHT+IECCw0B+2qJtNGJPWVIjY8wTG6yH5zOjPLL07p8RxeXiQowP135S9uc+N1gQlS+5h9kye3vPA== X-Received: by 2002:a05:6830:1106:b0:6e5:a89:2ddd with SMTP id w6-20020a056830110600b006e50a892dddmr2404716otq.27.1711122159704; Fri, 22 Mar 2024 08:42:39 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:39 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 05/11] modem: add implementation for the Capabilities property Date: Fri, 22 Mar 2024 10:42:18 -0500 Message-ID: <20240322154234.2720542-5-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322154234.2720542-1-denkenz@gmail.com> References: <20240322154234.2720542-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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; From patchwork Fri Mar 22 15:42:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600269 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEE6D481B3 for ; Fri, 22 Mar 2024 15:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122164; cv=none; b=TDYi8LdiprGMnRB0vHuYKGuYZHYdhEpi7I95vDIXVE1UDGQflWEl53d7RDGD4jr1vAQsvL8FoKOr2iCBH1agODQifJuqBGnRpirMTqaO8BO6fWocizRb/f3OmVKvTsKIJLV7ae6+oubyJ0u/AAK1uM2JQEjJCs9igqYvHuhCRuI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122164; c=relaxed/simple; bh=53kY7wdjRLDgkkh3NeBR1gqnow7I8TCjdrXhcEgaRP8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q/CNNXTbAj2OZ/K9L/feBgKEtLbU5EVMODyLaAtlpLqMKCj5QvsUfhnJGDnbnUvqRz2mtKQXt1f6Ob5fuEovBMcQq+fftuc+YKj0N8Ol+PLfeiC+pR9tVWAsWDUJNXMgxRPZmOutiF2OO2SQO2T2VLNEvD0qTerfOa3K0ZMPkVw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m53gWNy0; arc=none smtp.client-ip=209.85.210.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m53gWNy0" Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6ddca59e336so1196346a34.0 for ; Fri, 22 Mar 2024 08:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122161; x=1711726961; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aH5XvMBIRwrrwpxXvpflVrN0+YlJj02C1YSdGvWXRU8=; b=m53gWNy0XpFwu9Y+SMA4na+xaeILKG6QgmrgzT9R7wSUssMzkbbSOjR4QfZpds2BGV Ml0gpJnq2OID81w0kw1JdHDw7BUu21CQXYP9XrE1/8tIUqMcLpXmmk6ZoMECHs+Yg4ej M7PCoCYM3vVV7oUumcGMKmtXBoASQBT20hhlzOX0OMcenzRV6V9DeJT0KOt1VjmbXhFX ddYzKxCbDAifkbYEY2gXsjkZ53FwH95CUpz7weKDeDotJj5r+XbfU/XZNYrChVOAzwFE K+HtEihqECLiBfVUJfZUJZGEp8Tr+N4bSjfyQrPQIiRzHMnhPEhm2EQivEIzacYxN2uC 3aHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122161; x=1711726961; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aH5XvMBIRwrrwpxXvpflVrN0+YlJj02C1YSdGvWXRU8=; b=AYjTdMa14KpWQimBOcpH6Hmsgko0GwyvAtELHH1xTMoSDK8NwWICTHF/J4zB3+B21h S3hxYOYpS5dISA5JHhVC/PnlWwfM77L4HQG/+5kET8ECytDmGXLuLhFtc37awZM1hAxS kROTxCUuUuWC6y9Lf8lhOnjYCVyhlHHn+I4VK/WuKdAUkmy7ZmezfOwees9XCdusEkC9 J9GosUzwnErpOVTQ3WHRWmap9wETmLiy+LzokZDAJGL8dqBB1FhzhIWfgFchrkjA/Ubn 2S2UiCjyQ9M+l0sZ+X0JiyOiIAtX/eTRKoup8O98dOqHQYKNMuq2EBQNKmjc9xFscppw KyYg== X-Gm-Message-State: AOJu0YySZLS2xGDRFEKRL1m5g2ReO2pGgHgD/c5Q2vL0Gxa2e+pm5vT2 VTiEuG1UYiXCMclt9HLe6+9qUSWMmZr4d+IzTpNfqzuDO2NNHCwvwzLfUT3z X-Google-Smtp-Source: AGHT+IGeQFc2kJFK2uCDR9mPRwjsMVdA1Sa7ilqn23EtURuDQ72xP52wkEELxk/2HkB1pyXWt9pqug== X-Received: by 2002:a05:6830:4785:b0:6e6:b121:90ee with SMTP id df5-20020a056830478500b006e6b12190eemr988701otb.13.1711122160808; Fri, 22 Mar 2024 08:42:40 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:40 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 06/11] phonesim: Set modem lte capable Date: Fri, 22 Mar 2024 10:42:19 -0500 Message-ID: <20240322154234.2720542-6-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322154234.2720542-1-denkenz@gmail.com> References: <20240322154234.2720542-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- 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; } From patchwork Fri Mar 22 15:42:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600268 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78BD25337F for ; Fri, 22 Mar 2024 15:42:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122163; cv=none; b=s8toStJ/yctVT1wt9M6oOObju/2BYgLvII6D7vDOnQtynod3pzels51MY4t9Ke4Wz86O5lX/8f0CUaDurS9oyiCd7N5u+ptBorFGNSGJWv2vpGln6RbLAnYtcBgvcpTZcPW/RCVYyY0duO/LSn208DvDhYLDP30fjMzaszeqFyo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122163; c=relaxed/simple; bh=j8l3Fp3PW4BOpy63MNEM9SvQN4B+Ywm2uNjjgwlpAoQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sn8JPFEQJMsE2vW8Y1kKoXMgGHsdc53/GgmoWQMDWfapk6YpQLJ5RdHHED5UBmlr695OmINScOK3tdKOntkWgkKMWZVeBvFd12oxK7bABk0Ts+HZObjvE1WYYw7njPUrYHN2kxe2v0+S+ctG0v8pEM5pR6ekcZGAjaH8DTqKkjg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D4bmgqVL; arc=none smtp.client-ip=209.85.210.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D4bmgqVL" Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-6e519d73850so1414649a34.2 for ; Fri, 22 Mar 2024 08:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122161; x=1711726961; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5eMyaSEp4kL4adxi1Q9+/pXvSoD/evuGdShsvZRKch8=; b=D4bmgqVLeTj8eUK0e8DUEo/hWGA+9IeXqXSFHERJtYmIDkIaaPP9RU9ldtcadjRGEF YmNhc6ZR1gb6hxJ5LtMwlV+VxMGIG/UW9JIxNr5J+a2Dw+1ZMc+0JsYFu3CT/hwhv5iu c7d7a9FYUuC8tBog/vUraSGbzXQyIHDYFBv9DTomVrjOaapgz7CQ/Dg/6MqXhEvSZLns B786PhopuVkcnety0J/lReZOdgX99+FDYDiD9lT0eHuMjTTwCGhJOmaRXyaziOEIY1II mA3CoUSnwjqCqm/Tketp095+ubEY1BNhs2GkwPwEbvpcZO6cfYek/I/WADKOk30rvEhl IOSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122161; x=1711726961; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5eMyaSEp4kL4adxi1Q9+/pXvSoD/evuGdShsvZRKch8=; b=fpF0ts5QtLUIQQv54+9nlvVBAArtMWdtStN5dC/oZ9rMuuud6Ri/1QnEYojShm8Ufo yPrlmDPTS3G0U9CQFVTBIvDKyrAq6aRWxTeIH1F1/KCiyy+7ItAMVrlZqFkZecXzYthF f2CA5M3H7F9jXw5RYyXJCAduY5blz15t5q9rponCJmdBrsR4cBbd6TKhSGcun+c4HuXb pkFsKU8MpaSZRh92+xZrQIcE5oA9QZqTOfMSaBVCa39Ydzzf50ayZ/9zfR3aWwTM91Z0 cQnBLJxpehmRJvB1aJx9ugL4k+xWBj6aoV3nMUQYw5R6heosDHwvRxEqDbPSzX0aViyu Dxkw== X-Gm-Message-State: AOJu0YxVsSQJfMvbnOZwVYjejhKbQdJqLVRPkZRpK3p6hDjBaEkDICNA Z+VyEwMHRZO7q642cc0OxFveDSqXXIbjQ4xyM8GNi7N+HfCrQfGqtv8jMPzA X-Google-Smtp-Source: AGHT+IH1vWf2VAGEYENlub3hHANyZR95V6YrLp4DPt53tgI2iLmiBRRZBdL2hklkNTSUZmsJ4CTjSQ== X-Received: by 2002:a05:6830:204d:b0:6e6:775f:c217 with SMTP id f13-20020a056830204d00b006e6775fc217mr2672479otp.35.1711122161458; Fri, 22 Mar 2024 08:42:41 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:41 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 07/11] gemalto: Set modem lte capable Date: Fri, 22 Mar 2024 10:42:20 -0500 Message-ID: <20240322154234.2720542-7-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322154234.2720542-1-denkenz@gmail.com> References: <20240322154234.2720542-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- 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); } From patchwork Fri Mar 22 15:42:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600270 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AB17524C4 for ; Fri, 22 Mar 2024 15:42:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122164; cv=none; b=kYQALGXlIQRI2ZxqUdkgnmuw7Z8yFjKE79CEFLJPkTpEJWThaPPAM1RjhKOlk8U8/rWiTv+L+qwom/kFTpPlY5JgbiN9zbxIfsd1DVLoTOVq/4WSY3u65AvOUY0LIsPHF0A6KpprvEvZCBbR5IZw0/FqD7SQ2n5s4Db8zJRBvNs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122164; c=relaxed/simple; bh=W6uvZisSYNEQjcVezRx7ALmV51KyF8XmVqESwNLMd34=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rAoT0KIW+H6QHk0Ezx2dbd+75x1jDzCNmd3DS9EoPnqXOA93UN6FFV+wksFmOg1IZevCDh+Q/lUtmrIwIbg6fDcLLZI5kurAiPcMRQUdbvEH3TqjNmOYTY9sgtyuK0Jq2j3aRdTMJNzzkgexkiFf+CWooGB/2lvGs0H5BcM/lug= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PzlCYTNQ; arc=none smtp.client-ip=209.85.210.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PzlCYTNQ" Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6e2c45b81d8so980015a34.0 for ; Fri, 22 Mar 2024 08:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122162; x=1711726962; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UOhvItY3Y0qLd518mZq72HRT5QF9xoAQYfLZ9ScWJTE=; b=PzlCYTNQV5VcmWm95Pd8nJ+JJG4ZosvqOxeJOkEchHBs6qWuAevrQHxRsaHtGrbpmM ud8xjuYlPSF7uCS19Lyzi+/cbDmioJMWM3DQxYlHspQhkDrzt4NM3cU9bxLEClZNPz9/ 28+315vZAmADwXc5mptWJkxGJjdXoq1Lsr06BBKiMZ1AFw52qhAPurKBZDkSqudARfyR BBedtbg/Gnm6pVNLu4LAXziRHAtTY6oZAwNletTH023Y7J+yyHRAiXkCwRuOenhcVJm8 +zKr3hzqg1RDl2bsDv7clL6s8u8okiCl3XK458vqbUxNFhulvkJfowY3U8/ompK8yVuN mY5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122162; x=1711726962; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UOhvItY3Y0qLd518mZq72HRT5QF9xoAQYfLZ9ScWJTE=; b=lH3pESklQAfZh6xURBYXpp6CxD/S6m8litNJBYe4FX1NFjt5PkxBGTuDwTbrGNLUSq 3NK1C934k6vochoigy0xy+GRIZEGuwsXRTDV9Fhjn9SMMcuXVvAkqK3cGp3JEtKR+mWC Ktg/UmrHaL0PVSujrxbLZpi2vYvjjCB11C1tCMB+PzWviwaLfb0DEY8tbB5bEvlmda8J NoMy3QopqNz7lmTKLWXs4Ex6l1kU05Mon4k11axCR/hAOCYrGBnyoh3FDU4jyHBdpLuU U0xirajD3i2NkyTiulk5lGre6z5Mrz9dI2Y5Gp31ZOENhMiLboqjOIwmwn6k35AYgh02 /QfQ== X-Gm-Message-State: AOJu0YykVGY+gZqdXEJyRzlER2VPgxCzEvjLN8ZXDSih1xH0mZuWLRYQ l78/gkMcm3qZMl13eNbMZmk4X68PArevltKFiMJNN5E8paHOJi3V4SN1FEvv X-Google-Smtp-Source: AGHT+IHu7KO4AEREejUKn2RkjHJ6bxBnLjwEuN+2hooaG9HSVQofATP/8lgri6sixa1huAJY+4qx0Q== X-Received: by 2002:a05:6830:4bc:b0:6e6:8d4d:3735 with SMTP id l28-20020a05683004bc00b006e68d4d3735mr895494otd.6.1711122162194; Fri, 22 Mar 2024 08:42:42 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:41 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 08/11] xmm7xxx: Set modem as lte capable Date: Fri, 22 Mar 2024 10:42:21 -0500 Message-ID: <20240322154234.2720542-8-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322154234.2720542-1-denkenz@gmail.com> References: <20240322154234.2720542-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- 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; } From patchwork Fri Mar 22 15:42:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600271 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DF69535A8 for ; Fri, 22 Mar 2024 15:42:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122165; cv=none; b=Wzv5s7zp7MLIPpKawCbbYYz8NCGX/deEupNRqWMDp7XTuKq1FRITfZH/jG5HggCvSVuX71owdro2pLHczRj0WnAQpTBHSv4RC1qJby7O/ZGSG3ErTTKaRAdntGQF3aG8Q3aUlduuPsp7l1bAXkcoLq9aOFdJuKDa23Ue1V3reQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122165; c=relaxed/simple; bh=mBiLrFdYNYBz0XbHChKsUD1e65jj5aBvVSyWXY4nl48=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d0I1ToVaT63w+tXTicsFbexqKDmS6/6OUds/R8Zn22TjIpyvtue/Cw6D6Fksv5B23L1zEwHpGyILB8FcsJx8v5vjHT208wLqFmw5SjWpbpuF7zI0hbH6QjrHK2bxD7lkc5pBNl3RoJuEPWkzNJueOI4yXLczx5FD1YuM5iXxqok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=I9CUolE3; arc=none smtp.client-ip=209.85.210.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I9CUolE3" Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6e6738f7535so1392601a34.2 for ; Fri, 22 Mar 2024 08:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122163; x=1711726963; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H2vBrJVLFqka9GoaqiUx2639LIKDpdupWHga3nbQOHo=; b=I9CUolE3eRTbgF3Yn6VJhq/vXFjsTut+NLuKerg70uzxUyBhexFtK9sP6YixhpqFal QQI+qSj5HalmJCnf14ZGVkYD9ay1KOpcKFjI7yp5MaTt4UTj43HczQpF/wryVSfK/OOE EtkCBc3CHXx9VWHMuW4B8hx8+wyNpIjLMrbyOIZ/9zTqhHrt6TX3FJWtcWjWLQh6eNH0 Xq6CFZQGWxeiKou1uJ3RSdidxLjdf5/5QRBJpsUY1J/eWm6JPIHXbaIq3FbQLQGheRQF E4B/6A8lSRdPXujr4upffgJwtnC6Wk0K3whZts8UvgOU/T5pWTEktNp6txHZWMabXaV4 cwfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122163; x=1711726963; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H2vBrJVLFqka9GoaqiUx2639LIKDpdupWHga3nbQOHo=; b=Ua3fXF2wmuTCz8lxqoqPK3lovuygm998rh3KHprMMhuaNgBD54VsNbARgkRJlKjqWq 4tEwLEYDjABWkggU1p6xEhtgcLilEIE/M4XcRIaH8HHZFtcrx+79VF8zf4V6PFUZGvAW yGdeAstP2l40ApUhJFN+HZN3+RxELkXF098957HNMRsuEAXYmKfZv+dobrQFDfoqzTab 6wFyJG4C3OVLnCNyOMkZThL7WkNo5ToCqVrzkStsKpSMgG+BkDdawjdgNA/lq9gzmYPJ t+ThFiwJz6l9aPAn513dYxJjOSnnziRITznQb3o0rLXeaYXZp52ELRpmIYCL+opFRzoI unmg== X-Gm-Message-State: AOJu0Yy0PMkOpdtZkhGnRElXly2t1rWhoJeWgmkLcuDM7GmLBSwdDVBE ZUe0/nPtXcZf1+PQEx+Gjt7q1ggW/zeju6d5Euw183DDefqYMLiAu/gwqT9l X-Google-Smtp-Source: AGHT+IE7ELbmcYRp8CVTbMa7FY29yJE3K1Dek9TK4E2gwdnxrbe963rniIJ8fHY3e/ZeY7/Fi1NsZw== X-Received: by 2002:a05:6830:117:b0:6e6:6ea1:9820 with SMTP id i23-20020a056830011700b006e66ea19820mr5620otp.14.1711122162895; Fri, 22 Mar 2024 08:42:42 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:42 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 09/11] ublox: Set modem lte capable Date: Fri, 22 Mar 2024 10:42:22 -0500 Message-ID: <20240322154234.2720542-9-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322154234.2720542-1-denkenz@gmail.com> References: <20240322154234.2720542-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- 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; } From patchwork Fri Mar 22 15:42:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600272 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD253481B3 for ; Fri, 22 Mar 2024 15:42:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122166; cv=none; b=jGDmGlj+5cRGj/OgbaEnC6olm7g5OgaFlL3GXTORXW6Ayd2DjaWMY82Cm0sG9AnUWEAGP2+x6WLj8tgHoh+1Q2XIEROtCXsThAgDMgKPVTfUv+IMfTrIpZlh5C244iZfW7PHuZf9LATmL94kCSk3pcHGtE6BCTsjLj76ZPj+SsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122166; c=relaxed/simple; bh=A+yMIvSImCfLwpDFqcE+k8goyjDKsN873ZWb4qI1YnI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TXfojd1RoyiZYHU7ZE0Ss3Ppmmq0VRtpQmICNpz8z3XR+UDIYg/PsNoOEJYnImol+LO+GSZ78nQi0Vby5sH5ov2FRRVxJKjUMbd8+wV5Wp9GNcLgEX/KAx6CYnnm8AkqdQYp7Zh+hxWYbmjQWcouo2XfO4m1qc+QBFUXMs/0CdE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZjaoI3d9; arc=none smtp.client-ip=209.85.210.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZjaoI3d9" Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-6e519d73850so1414665a34.2 for ; Fri, 22 Mar 2024 08:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122163; x=1711726963; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0j0wn23XXDaf1iyM+ZHhbWPkDlv/JUY0HjF7OwJctII=; b=ZjaoI3d9no+vfUrqfl2cyD+U5RnbcudC55peJ6kn4wTO9n8j8tkUPv7vMoDJbQJPGM Vh+UclDt+jRpn2JEvLUQGR1Y/ITNHtSPWvvhB7RwLgKyGuEXAZU9aOrlcUDosnOM+OP8 ABtSmz3VUOuY0XEVyi/uA2jQO8e8ujAdKi9aT3/GCiAT7zfNmpkKjEqQkTX4UPKObnj8 F5yB3IKJ92A6GedgoSBWPpdMLtrF/lMS8LysGE0UV6A95wAn2ixf6eXNn3u4+q9HvdHy Vab59+yrL4nNTwPTV6jcvF7Z8gGYQ9kmUcnHW5yk9rvzOrMknxlokeVIEnIBC3pJLxIm k6zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122163; x=1711726963; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0j0wn23XXDaf1iyM+ZHhbWPkDlv/JUY0HjF7OwJctII=; b=rDVL4EEoZMyEmLdhNILb1uibjj1bM8vubp4iXF1DfRZi2tcluczwiQjiw3JQ8tEdd3 fzdUJNSH0JSmkW2SsZDjDnWr0fme50h4X4evNevcPk6GAPvgqtBp9pNl8dIZMeUFafZ3 2xqIRnZkV4tohfb13q03ER60LdPMqQIFq2k2bsGAsqiW+hGEMYlWZe1LwUtwutdaPfNU ioZ2rdGMkED6ABWbR4uqtTJARHObdb0Q7CzhCIfV6cuTp7HjUSDKvui401FpJR/q8Mbb +zaEoiSN+aLBCBuLZCkIjCgv6bQk4jrd8QBKAehRYTxgRIDQ1ccmfazAmQ1sLmwBSBHa 3Egw== X-Gm-Message-State: AOJu0YzCsgn25IyhyvR/ANwlgo+iRRg/6U84KDS17NZmP+nFkWj0UPOu /56a6XIVefokImbz44hBAh2n7G8w7a7qorNl6zIe8HRaElrDofVRU00lqzfO X-Google-Smtp-Source: AGHT+IH1iaryRdHNPJBghqMw3+RI/upGUlXyY6ajNon+yQ1YkF2AcbVdQeg/M2KsZ1SMvIqw7MP3QQ== X-Received: by 2002:a05:6830:10c8:b0:6e6:99da:8944 with SMTP id z8-20020a05683010c800b006e699da8944mr2689640oto.26.1711122163480; Fri, 22 Mar 2024 08:42:43 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:43 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 10/11] gobi: Set modem lte capable Date: Fri, 22 Mar 2024 10:42:23 -0500 Message-ID: <20240322154234.2720542-10-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322154234.2720542-1-denkenz@gmail.com> References: <20240322154234.2720542-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- 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; } From patchwork Fri Mar 22 15:42:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600273 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDCF0524C4 for ; Fri, 22 Mar 2024 15:42:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122166; cv=none; b=Kt147Spv8QR0WKtJN0tg4Euqvay7kircSnEhyVuFwfaPcOsDwDxeIBXCdBzvk9XoTnMurpO5Id5BIRsFfd46nFRASj2uAiRkD6E3OW9QF69gnfbOfo1DXqD3lwdc+mv5CyscMZsai45fPhDiEEfh/vIVyeP3tUmdOOzkTge7yoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122166; c=relaxed/simple; bh=svGUzHoaR5yP/BFo4XrE1O4VWjuO5JyLktkaHhJ6wd4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q4o/6Ol25G4cQuNPtvEzBriKPnhKB4wqAWf+JQvWGxrtAlR7aytzK0eHe/P9ip2mCQqbaAfqIeofOVW7CBR/GGrskvTT1nq47EbzmUgn66ZcS1QF8HRrWhXumSYTEGT5Q955KULFuLO6XaY5/vU4m5eRvEIGPKJ/tL74bEDL44s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D21z+goN; arc=none smtp.client-ip=209.85.210.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D21z+goN" Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-6e69543fc1eso1315244a34.3 for ; Fri, 22 Mar 2024 08:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711122164; x=1711726964; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JVsPuW/g7+EBBvGGprHEy4VCYnfPu3lslt5Y7BuTzaA=; b=D21z+goNwZ2IFXdho8uT1z3BTYXX8Xm3qzUEUyd/glXDFz+p7TXlD4qDzB27sCa9rY KMbp8K60x1sM4fxBYnD9W7woZONJqsEJcxvOuFRnxvffUIcWFwTWBiXTuyw++ZAfer6h dnVE67Sck1paEEtowxso07EVsrN/O2Aejvxrjvy9vg0jbuu2e1SP6IS0cWIw+vQeG80G hrzZ59msEntvm0omqkkAl1iEyW3pYEWulCj2vZO78+FCw5wB/Z6ouZNCiS+RfXhh4T42 bk4KaFAVjeiORWQsM+yAAk84xS1gWYkfUccXddF0SwsRkZGWOeoqfTdcNPH++at/EUwt dbWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711122164; x=1711726964; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JVsPuW/g7+EBBvGGprHEy4VCYnfPu3lslt5Y7BuTzaA=; b=oWE2UdrJW24nIiIljth3/UN9Y8Cwfo3D4N6148gqqZsw1U9aPUfD4+ybs7WlXICVZQ yeUAgRElpY741SD8CUFnf1JhoGpX+5MqeCGkdS0EikF4D/8zgOeHqAUGfh0oeyf+qi4c cKPJvfoETZ4PCwtPd8uI3QqBU8P9LwujJawdQ52FnDCcd6JqpBZTsSP5T/iOiK5e4Y3D LruwNDFmAU0TL30aqh0WYLMmWFu+iVtubKdx/VuhrF6TGM0sZAxZnCnJQTArEIWtSRvM 97b8RfHhinoaQBkDYyyIFEm56azgryyISdiEOHKNU5JGdQNXrnZfDK2ZmWZU7eTzNBxf 9CFA== X-Gm-Message-State: AOJu0YyEDHuwDpVhjMheg8W972hUzGHAfmQ4caemPmqmlEmLpG8o1kYQ ioBPl6O1CjY6J8yoZJ9CxvbidvGjtIuEit3FH2u2FiS1psQYqmHQgi6haziw X-Google-Smtp-Source: AGHT+IGY8DtD7FoRvmY+dHVqQX2vyWaymt6iyVk6ISxH6xpQU5q1BL9NM6gqU0iT6oSlWyqSwx2o/A== X-Received: by 2002:a9d:6519:0:b0:6e6:a3ca:2736 with SMTP id i25-20020a9d6519000000b006e6a3ca2736mr17675otl.12.1711122164051; Fri, 22 Mar 2024 08:42:44 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id u12-20020a9d4d8c000000b006e6763530e1sm386538otk.61.2024.03.22.08.42.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:42:43 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH v2 11/11] quectel: Set modem lte capable Date: Fri, 22 Mar 2024 10:42:24 -0500 Message-ID: <20240322154234.2720542-11-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322154234.2720542-1-denkenz@gmail.com> References: <20240322154234.2720542-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- 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); }