From patchwork Fri Mar 22 14:09:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600161 Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.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 DEEB346420 for ; Fri, 22 Mar 2024 14:09:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116588; cv=none; b=DgjUUFxeMciTwlRLUNjDxOdRONHsUoNvFZr3kM15dmGnSxUXnxGa2AcuEvOFSqgqmtu/4s3CCHlNf9SJT2s14Ws7cez2TyPUKnswJ7LFvwMhpuhxwL5jdRL7fyZ5ddTgZ0zFU0TBkZZynWD9ZQQQlMruUis3ro74zn/VGQFKLJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116588; c=relaxed/simple; bh=3nQB5yM+yXF4YwHuYBuGxiw8B2qV2ccA7xTB/Zszzfk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qV3U4x2PD9E0SEUvtZDLVkrLb9Hv56pEvqwX3amqXhLPkY+3iv+cFrgrTpJWa3/9IxBbghvQDRRhOVhm37KiqmStRf+UWpX39kMsfc7gyJOW5FCdJ0OAiZ9ktU9yxqb9mrobU2D12i3b4zlS8NFRoT6weesReig0TPwIuVIdK7I= 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=UWX6G/5g; arc=none smtp.client-ip=209.85.161.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="UWX6G/5g" Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-5a14d7f0e66so623289eaf.1 for ; Fri, 22 Mar 2024 07:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116586; x=1711721386; 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=UWX6G/5gheoB1fsoXAP29Je/kGudHzRZD1rm9NCBVco4w95xrtBqfjMbffhBVBPi22 fPXrXCFkbUsNxaJv6V7SQSTBiZjyMy3QsD8v/iIoKH80PTRQO0PYOcq2QgfLZ5omx4sL hazNNWYdi+43G4etBNSxur7l3CycC4YllIi6gJW6sB3OyaScjp0bc+AwxDhll+jdt9Qr 6INcF1qK8i37OLVwNejfyyHzUVc5DVLNqRnNgkF0faJpz741la75OcqGZImunWwr5TMJ kAXYJD8+YZaJtW1rdVEDeiO1oBIUx/3d9W6dXiEuZ4fYWk82L21PtN+s64KY0p4uc6fX pLog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116586; x=1711721386; 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=nlrFWo356N5v1ZWssrkJnN1qOFCm0FutVLp/LVqY11tUAOgDFtFZIWeyHx7e/sKvqf gSLdnsbQ8UAQdCt6VlRIraIjVFTnWRlhbynSLroA1441EmwhkDYsABl9icVz4ZuSVsIi vKR6euQ/57x2Grpu/kfhJ311X8Z+bKzIG8at9D2S5lLgjUDnCtZ++nbvgiUzKSixfP4a cyl1GJylYQU069DsRdcMDMXk7ncgVpTCArfxjDVjBms+x1NrRBoDhzJWqvLCIYYCUKi5 fiZPKsKPXt7mvE9RHHwaLY2/E7S/ByYqRLQdpqo56ZIvnBEzYPDFQ8ax+p9jkZjco/Cg MpEw== X-Gm-Message-State: AOJu0YyUGxxSOqs4rFgjk3ecTE476Y9qMIWiF47f1Mj/QJjzw+Rw2nLJ r6ay8KdUKMksfg1vy+1lz05loD0L+F1J4HhDlCtfuR5Pq4P5L5XbP0bliyWX X-Google-Smtp-Source: AGHT+IHdFUPpHAUQIo2I3WSp74fUYnvgOgLXHYDlgYtJMrZHvzRdCQ/F4fgSiCjhs36RZAGAYaFNfg== X-Received: by 2002:a05:6820:213:b0:5a4:f5b6:4ed4 with SMTP id bw19-20020a056820021300b005a4f5b64ed4mr2768301oob.8.1711116585830; Fri, 22 Mar 2024 07:09:45 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:45 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 01/11] phonesim: Allow phonesim to work with Multiplexer=internal Date: Fri, 22 Mar 2024 09:09:02 -0500 Message-ID: <20240322140942.2703042-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 14:09:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600162 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.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 704604643A for ; Fri, 22 Mar 2024 14:09:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116588; cv=none; b=W1VBN7YjAhXTZgVs2XKINpKJi4R+HhOQvEASAtwSxlK9l/gMNH61Ds86cy4iS7F/4pjxLgaWy0AS6fMxpVyeL70jJ+ew2aaqGXEs3meubbCBX9UWe1XTrEp7XyM8zvmOMNWq8hz8T7LiVYzBOLLmRCXiotJC9AimzsIDz74Jtpg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116588; c=relaxed/simple; bh=F2kBdDkO9/lifi4hnFgrDevAneXJ6Yj0qswNBRN9guo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ezVvwHCwZy9DzOB73RTDGWe+FIrL9ceH2dPREYGxwONp+93kTolIsg6HHL58jlcG/sFMbpblyfc28LTEGTz6bZxL6fpm7xX1XdEWk20DQqv85X47FzBXhcIVNbqneWRbW8Pyf6jhQtgHrdoDRFGoD1itNekIlMn1Yu0G4PhgqKE= 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=bhi8SRDq; arc=none smtp.client-ip=209.85.161.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="bhi8SRDq" Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-5a4859178f1so1147013eaf.0 for ; Fri, 22 Mar 2024 07:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116586; x=1711721386; 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=bhi8SRDqnPtPwNxyU/XIw8tHuq0pkPAePgvCvlXPYEplyOCxGFzrCkGpFsw0wBLQw/ z+hCdTGT5tv+dt7o2ws2vLAQVtnPEYdAlNO8/Md7B8wLWKXRqoMQtEZ73UlawWsLYQZT 17k6QvBJ79zvR96VwwLBXaWxjOod/AE7Cily5Zx/n2QvXrZTV3HJIBMadfaB6XFnaAOk Bb5VtAVr4QkNVNCjwtALIPNJz7/aDQZjIXLO3SQhaIhf8kmAPfKUCbTCQVLkXAruiES9 F5r4B0p805RWknH3Zew/OQEk0E2hzHML8mjEHaUAXuf82Mgb06qryuDIZjXY8RkzE0Ca 3pcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116586; x=1711721386; 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=UTXL8kAGJ95ZPEY3A76SebQII7pnEtFjC3dolIptjlX1pwdq9yNnEfwBE0PuKZEtBc itwm0pVKtAv09JgIwp1KHhyUjXwL7TeOq4XElNUPzIL5qeApck/Aepde4OwO3Amo+j2X ke2eXy4Fm+EAaGi3CeHGBiW9LatXntO5tGbA1AVQwL7mnZEyIieBfNuD9zMl2eoZAQy6 URnWb6YTCbbIykVCwqhdzg3ckOwaTna2mTiMb+fIOkBWkS/FmjOs63wgS+Q/HnSMiFwx Z4iQXsAHbpf0or27Fm9g4eIoQIQII5LiNNkUda+1QAIlMSikBbHgeyrJHdFlSCmHFOtp Renw== X-Gm-Message-State: AOJu0YzWivxjw/9NYHsEmziBE9lRwiLfGdhtFgEIt1zSSEG/XpO0EhQk aFECbxSofwwyu/Pmc7DjgkPm6eTesTZFVBDXFqbLx81wvhXzCtSmIqXxpzul X-Google-Smtp-Source: AGHT+IGvFft12ybqyxdX+d3CWD0jDsXj18qD1gBTkScixNCfZzZptaL35LRTmMX3Hg3gEdt0DLqn2Q== X-Received: by 2002:a05:6820:1e16:b0:5a4:9977:446b with SMTP id dh22-20020a0568201e1600b005a49977446bmr2832662oob.6.1711116586422; Fri, 22 Mar 2024 07:09:46 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:46 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 02/11] modem: commonize feature string list generation Date: Fri, 22 Mar 2024 09:09:03 -0500 Message-ID: <20240322140942.2703042-2-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322140942.2703042-1-denkenz@gmail.com> References: <20240322140942.2703042-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 14:09:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600163 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.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 D293B46525 for ; Fri, 22 Mar 2024 14:09:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116589; cv=none; b=pmIyVt7AirQQnSi6IT9TxNOJRwGssBI0qhEliD8g67kKwLY9qTsB9ACs3skjh5wGfqfQIMPIw7eLhmg6bbKngRVWbpDS/+BqkmckJ26kfjzblEaSiWZaNO+Hv1bBKD8sB/nX9NuZS201FKC4yO54DN5u8cuf6565T8gW5zPhZ/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116589; c=relaxed/simple; bh=yoTX1JwcbFoPDrkJVhYp7Dl090+lkhKN4m4+xU7wKJc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lIQKgIbYJXA1NGPFT9N7tVgijGzaemvIQRfKRtC6S3TbRORoFEBrrPM5kE1kFMut9dni1YG9vcnJSaIhmpMyCuY+613z9PDzLyDGh2yGO0KZd5ydp3ne/XeGNpTZ6PdqjUzMGMCsTTnhb9q1p1iOIgRnO6nl+uPYEP2G+Vkr6lM= 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=BP6DrZrq; arc=none smtp.client-ip=209.85.161.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="BP6DrZrq" Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-5a477c48fdeso1105607eaf.2 for ; Fri, 22 Mar 2024 07:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116587; x=1711721387; 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=uFC3u/HMQvFQPmxOHhjwulDYQ/1ikrg3DDpuFYppu3c=; b=BP6DrZrqPT1CU1IbO7r/l8Ti1O79W9m/p+4vWXgQu9p1OeNbqiik99lhYNxNnEE8Zb 1lxtPswGGFlK1/Wo3lCICGcW7e9wtnp+wKBFyekeTBZqOrQnCtirMYgOiM8SenQYICuY TEPy56wl6y2esnhv31RCNWk4/Dqcwi6N2/HWs+/9xI+mwbYRF/hhvhX8j7GYSwYFRyUt UyPiAHR7lRgDjYh1dMteb/KzZVMa5u7c1M/Ws0yTr7cKwGspaN0VYhVSrWQmTNPSTUm3 /N810/wxoCjzgN9rZMf/+oLnD1X7wJb8va9tJJBP/n9dAIuz29ydvwiyuFe3zdF8NBGH t+Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116587; x=1711721387; 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=uFC3u/HMQvFQPmxOHhjwulDYQ/1ikrg3DDpuFYppu3c=; b=i2g7WZIXKPbJxKlt0oWI7I2qZGwZBfHuhl5J7r4hNlIL32uXMrr7KpsmVtRjWCZ5rM YgGTcqL13xnemK/lWVsAV/nK3EVwi7+qbv1zFe2MKmp6XK7xBKnoxeJYHu4MzrmVcBwO /aKGbs+e4smhMSuHe+p3Ge667pUYHPDmJW5F+Oj5jYqTIy21BRfWzM/wkO2++szz4P2w AOL0/Vaj+EwBTDAS1XvcBI73VO2S3AeNksvQ7rTc+hXlkjy3Ns5krNDou06TPUXHjKjU wiA3BjubxOf3msU2pp9Tx7KJUyITsdLbp+VUEFfuzSBAG+36LQbSEX0CxERGelHlfSln pz4w== X-Gm-Message-State: AOJu0YxWqFUS8ukrhIICVCxsN0m7GwQknYZZQMnbrFTDArTXHd9Mk6Eg /rfvyGJ7SQUyTz9xpzbdCa1WYD5qgwibmXMe8+U/rkpwYoOm53QRK5Ma+B/Z X-Google-Smtp-Source: AGHT+IFCqMtCbdUoo/d92hbCmzB13qT0AMzAWuFhryqhlMKkrDVYE1H6TvjazzlxkMFWw+zAsOl6OA== X-Received: by 2002:a05:6820:1f06:b0:5a5:dc:1875 with SMTP id dl6-20020a0568201f0600b005a500dc1875mr3049524oob.2.1711116586961; Fri, 22 Mar 2024 07:09:46 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:46 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 03/11] modem: commonize interface string list generation Date: Fri, 22 Mar 2024 09:09:04 -0500 Message-ID: <20240322140942.2703042-3-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322140942.2703042-1-denkenz@gmail.com> References: <20240322140942.2703042-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 | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/modem.c b/src/modem.c index 37d9bd57fdd9..7486a56aa183 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,9 +894,7 @@ 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); @@ -1301,12 +1310,8 @@ 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, From patchwork Fri Mar 22 14:09:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600164 Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) (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 95D2846551 for ; Fri, 22 Mar 2024 14:09:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116590; cv=none; b=MV/6OvJZYbnrQ0bDe5abcdDMNrRsGMd0prOyhBAcoVyQs3VhYU0GCW7eDXT3yex9jEKxKDXEm3r+8k87IzSVLv+Oc9hQh+ouBw0xJwJxn9lKZcSsAvuOooMNePYl29MHUUl0mc7/RZ8hsuyBkjGXRiQd17WZgmZxX0aTGnNDoJA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116590; c=relaxed/simple; bh=biO0vb9/BuYWdOKBrZeZO+0e+XU5XceqX5G2CW9jOWo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oj79XDW6HwyUJPVqn7loHOTtibfvAC4nS0TXj/Nt6vU8SHcSicWEsJP6sXCFqwnhzsuglwOEESHpVner9GSvPjPVHX4BF0UuvGZXBqR9sH623sb4pr/ElyV21VSSlBvc8jLq1I3m3mXws0dC1MpcboxjFyYxTGTWIEBcxmGtoc4= 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=BODkllga; arc=none smtp.client-ip=209.85.161.43 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="BODkllga" Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-5a21859a4b8so727183eaf.0 for ; Fri, 22 Mar 2024 07:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116587; x=1711721387; 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=BODkllgaNrSWpp/Xr+0tCevuVWYiBDRPjHyJSe3Ruvmv/Ov/SP338WO1OYIMD3el49 66mQZ8VTNycdygJnd1r5pdoAINW0P0cWvbqDdRMiTLxrgo0uCcEHLkmqJTBffZhQin7G Ehih6oTqWWIVdhmbMdZyougoWODu8CtDFD4+s4mSCZzkzsUvzqyHNc6vYJx5NNexC6xB QuIRLlCACc7j50J3BNvEfgZpdo6Oub407f50pP4w9ywmXwHvE3T/biSkUynoyXlIzZca A/qm/JuOpe005NC445+i+Xd7oL4k3YgIbAmlKd7V/VG6wLj1QJ1fvrr+g+tXh8rzbpjy GVHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116587; x=1711721387; 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=FCDAOaWWzWMP/GjPY6W0j3g/yasBBsN9CIWf/3MWmCJHYH1NGj9xdhL+ga3xE3oDgw k65OfOgr9CT8urWHtHIzS9EQZ3pBvsfZg4O8/L4EFvz1NpDxycwd49VFm0TgixIk4ZtU z1fK4q9OlmLB/Oq71yeBapu7DHEzS1yjMkKXicDVUtdv59uoT0ETFckvQlSngrMa/0yS kY8RQ9KANpjZ670Mj+onPe7sxY9MzJmJRsX0EmDDRm8HgeXVpvQPJdqPrwu76Zt1YLNm R6AWU8Qb/VJKupw6eeorH1fbSh2fVVEwERaJNlU6z+fMppo5G27I5aYw+aEqtuiu1gL/ Zjtg== X-Gm-Message-State: AOJu0YwgAYdiY6BHl08s5hePI6h5gN/jrF3MWgMllhDTgFk4WoePQDZr 5TzJ3RWh4Bpdls18h2Ks3b5nr+SkIaVkJU+i3Hlu2sYeIIiNDaEBceNdXSbA X-Google-Smtp-Source: AGHT+IGRAko03++HBgpdxWvgI8tr1nlAhfwF+gFIdFmOu45oh90jukrMzLSKdSRZxqgNHTH9F9I8Cw== X-Received: by 2002:a05:6820:270c:b0:5a4:75f2:54d0 with SMTP id db12-20020a056820270c00b005a475f254d0mr2202952oob.9.1711116587518; Fri, 22 Mar 2024 07:09:47 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:47 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 04/11] doc: Add new Modem.Capabilities property Date: Fri, 22 Mar 2024 09:09:05 -0500 Message-ID: <20240322140942.2703042-4-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322140942.2703042-1-denkenz@gmail.com> References: <20240322140942.2703042-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 14:09:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600165 Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.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 43C4046B80 for ; Fri, 22 Mar 2024 14:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116590; cv=none; b=PwhcEPbOP512WiUE3sX9y64WxupBvTWpb4DIz1TftFSAj0JVdkIDqVXVjrmuKq7JvyPqonDxZpdQcjs5Fs1woZgrXFKO1tPUg7cnThPjPZOTcxZVIeeumS7llNwAzI6XBp/UGcVInV/3znZLB8UqqJT1+MLfqGVXzfd+k4s7/4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116590; c=relaxed/simple; bh=UGckVs8kvAiNKaZ0ct9e4sOHAz4A5N8SYiUSm8taBRk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cj8bSghwbRQUhSRaBcQLHZ81WTqVf0cc3E6/nEyingquBOVpEaNvjmPQrLH8ypbHbksyzO0BOthr6+8KaBusMN9oTAVhf+BzpCnMlEBd/5e56NjYEArQp/V11X9JbJuH7EqdQJC6/GfuaycgUMdUAQTVCscv9CZn92fF8iDy5EE= 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=NsvFh8Bp; arc=none smtp.client-ip=209.85.161.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="NsvFh8Bp" Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-5a49261093cso1023259eaf.3 for ; Fri, 22 Mar 2024 07:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116588; x=1711721388; 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=cPnakauAsHFa/cxnAnzOPp3cp1QFJU1LAl+CDaN4YZA=; b=NsvFh8BpISBgHn86uPE8L+y0C+dUs6jppMZfcEjixM0qa2VhsE6ovjsWbITq+4bQkk tblAlcwdCSOK5lZ2f+EvoSJMZzjDTJT4w61D90OOXFEKMzqMeAybQ8LwqxBsCHfbT8Iz qx6H3/J3QqNai/3vAfCd/Y23ejP4r9IWsXYkQGr+vYj0lyITKGWMh0hWN07BaCbPvvVi tyRJ9V82JCXdyzAeBvv13yFT3Gu1LX6AUn5rxL0/2vlFT24Mmbl653SDnpHrHjmP3NIt tvqwJtdjZylnFmxL8s4vtKUSKF5eYBqe5HGup8DOwnka3EkTWy3hLR/ob0sJr0lQeoT9 U99w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116588; x=1711721388; 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=cPnakauAsHFa/cxnAnzOPp3cp1QFJU1LAl+CDaN4YZA=; b=KG4OyBd2/fb34YOvaR8fElExQCDHnvA/Qe4XbGREC11G2yHegczep2hJXoSUg3+SK/ JclFNDUZH7L+HZv3fuTBGZfMdw8ti0TDyATAUuzE0p8WJUy+R18S9sHLq2LaNzCjqFkn athxFlCf3gFDp4MG8TD2nFCMiAp2sfx2DMhlXNGzSl2MVaMpiQn3g4s5/M56+rqWyh1z SedCvp6A0IrQNv/GkyQ/r6vRc9yHlJPFKnVmZEujYslNMyjrn1ICVutHFPqPs3GSjBkm iSRmkiLFs0GRzfn0zpY7iWnMOYtIdkXzuCdtECZ20ftEZEq1o64yDptFn0QvDe0m6K+n 3UwQ== X-Gm-Message-State: AOJu0Yy50Vdq5mfq0QkLZhyO706WmP10ihb/2h8+lq8zFIkVulLRv2vQ 1hZyBtbJ2zCpjj/9VZmL1YCAygyu0SK8oMkkiDFt3pfiYSdSMwqLmn+/HNj2 X-Google-Smtp-Source: AGHT+IHVP5gFyFEB0lucueuyPCDsCyZeeoilJ7p5X0pbpwuEgmAA9En2LlTjrokJ/yx/7Qot1yS9Pw== X-Received: by 2002:a4a:ee84:0:b0:5a1:cefd:73d6 with SMTP id dk4-20020a4aee84000000b005a1cefd73d6mr2690380oob.7.1711116588128; Fri, 22 Mar 2024 07:09:48 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:47 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 05/11] modem: add implementation for the Capabilities property Date: Fri, 22 Mar 2024 09:09:06 -0500 Message-ID: <20240322140942.2703042-5-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322140942.2703042-1-denkenz@gmail.com> References: <20240322140942.2703042-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 | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 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 7486a56aa183..3744330a6225 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,22 @@ 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)); + + 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 +866,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 +928,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 +1262,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 +1912,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 14:09:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600166 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.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 B1E8746525 for ; Fri, 22 Mar 2024 14:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116591; cv=none; b=g7g5VxCzSvlFeQ+gjmpB0wuR3Rxix/K4rYZaTrd+bZVvnBoEv8O2hmwg5iHGhycvGG+f5oXp3/x7QjIphGLxF9VlXF4eclhd3wGEL4opY69+9Qz6yTmzs236E8JWFm3RoksJNuk4j0pzn5Y1gePyguDvhCBbYd1TVNeukjxUgGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116591; c=relaxed/simple; bh=53kY7wdjRLDgkkh3NeBR1gqnow7I8TCjdrXhcEgaRP8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R+SjXBN8tmucam119jwLKJgjJywxnQmhQmrJDmwYfW4ScPYoCYuSC2Q8YkaIuRNsXRQRizN+mRBCRUP1mm0VqSeJGGyOKWHzNA/iqV5+jM3OjXax8z+2Z5wdBj2U3IHd/ZAO5Z2VoF6QEDMxLVlEIP3HNPT0/LeV+eO0JhfYPCY= 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=Bb62tW0Q; arc=none smtp.client-ip=209.85.161.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="Bb62tW0Q" Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-5a496fde460so1018789eaf.1 for ; Fri, 22 Mar 2024 07:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116588; x=1711721388; 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=Bb62tW0QLIKTldxrvdYHeOmPNneL9CggvZbIiCZAokSEYxDByDCU4+HPomRw69/0Wi mRR6HLkNpLJSc8pDGoBt1/qKYU9UD7n2vYV2McjTu4lPDXKTgQ9OKe85K38aLnVkdjHf isr1s0CrUtJ/6cP2/AWc5rjJ+stQTNggVl3EjMvVmPSwN6LuAoR/wPqhm4pzTTgMg+Bi sr/hJlH6N2eni921KV/qAOCdfgiK5Yf6/agpPkH+EUTkmMQ0Ar/hcT5CsygFG5Uc3FhD 29kP2H4Gc87vclwu88HtCjVsRiY4mpD5dbnox+gYSsUP72EcpW56Z4Md3oPboyKMRLJZ XW/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116588; x=1711721388; 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=f6259bgzNMU/4b8ZoPypqb0Rz6xlPncWNxkqlmikt9wT272hFTVz+dcP4q5Xot+KLR 7RvExnK1C7ZzZ7GUTC/CZtEZFzgDh59asjcKCj+Sa17OhH1OwoGJ4D6EnVXuhZ6qxi0M 6ee34Sa6QiVl6fPuEkPy4rjWtc+8a/LTbfDUcABV3qjKilSZFtu7001KojO+qTZtiWJw ZWdg4uDNdOuy939xSs9A8DDRPW+Oy255DI2xd+8kjxo9nwAicDnYP5Dq7X9gawPANup8 0hwoBvWkhwZF53iEpAlR9eFz195TRKL/We7T9sjsU/7ivxf8S/3xbexYgQAxS6fhTbvK +tJA== X-Gm-Message-State: AOJu0YzU2CMqq9aDwU8h5CJNT8csHY0/7TfGITLcm76D+lCxhvW3DEJm ujgGFRk+Qq9nHyY5AT3U/ZYu9cPdmedpM71M5nPaZPG24OYl9ADuoOckDtwh X-Google-Smtp-Source: AGHT+IEnK5vgiQ1d+VKFHg4IVWdxrzwnURvEjaWz2I1YdCADjN6uAy0JeRdWpLWNYl9Rb1lgehvJAA== X-Received: by 2002:a05:6820:308a:b0:5a4:f5b6:4eca with SMTP id eu10-20020a056820308a00b005a4f5b64ecamr2608504oob.7.1711116588695; Fri, 22 Mar 2024 07:09:48 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:48 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 06/11] phonesim: Set modem lte capable Date: Fri, 22 Mar 2024 09:09:07 -0500 Message-ID: <20240322140942.2703042-6-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322140942.2703042-1-denkenz@gmail.com> References: <20240322140942.2703042-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 14:09:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600167 Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.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 5A87D44C84 for ; Fri, 22 Mar 2024 14:09:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116591; cv=none; b=CbaZlL8FGXP7x6LEt9x6RaOF8m3PN0H2TP81TC3efERb88lPV8mi3ZW/tKk0j4TFybHZ8PFHxiZuHB4hvHkwyyIYVnJz/c2qSqjj4+ag4eVO+jpd2C7M9V8x09djcQtAb+HdEtcSwXExcL2pLR2Ga11UdFfXUGX8KVjybulQC2E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116591; c=relaxed/simple; bh=j8l3Fp3PW4BOpy63MNEM9SvQN4B+Ywm2uNjjgwlpAoQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jK71MX2XMJz5PLilWaDx9DdqW71ytk+bBvSDCDOH9oiVfiEqPuKa1Pim8tbl3u7OzPFLxepz+PNbTjyP8Njx2XxHYk2UgzlZy+AT6PnpIkyRfzBZUQcxnM0cSI2sj0rLbBvZwLyaP9tLmMEqNmYjZdzHEbhVHVe5XrRdAqVgsvk= 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=dO/ydKol; arc=none smtp.client-ip=209.85.161.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="dO/ydKol" Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-5a496fde460so1018862eaf.1 for ; Fri, 22 Mar 2024 07:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116589; x=1711721389; 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=dO/ydKolByhAMMDp1oF6g9vy30A0jscK0w9Ia7D7op2ZBm7gG8ujxO77Z5aDAyTxjH nI0X1z8zkfY0Pq9jZjmqTXfhCd1KGOlzWTTr/x6OphyDNl2WwJPCJCDqQGiPkTsKkomH z4u0UeVJO+Q8Ja7iN+Cn1jqnIPoidNguI4bV1/CB+3gOAotyoKWyLlWiK3iQjZhfWDti 6iofpWDrxiCd8WbR6oNp+koYAN1YCvm72goFZQuDVMm4MiVxua0BMDHqXqQVqnpAaqX3 0DuIcUossAgWeltmHL1aM487tXVGFXKojKwP8sjG6kkz9C+SxnL3Ae0GQJy3WhDMR6Zi xuZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116589; x=1711721389; 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=QGeViUhXC57pjtEIW4r2DQIS7BDSyKUR6J/an65OslG1+n3p+WN0MitdgPlJg3NhaB gDohsFc1AOxwzYMbiTcExjQlZi4hZtRgORINtBh8N+C56EiyR6Jn4g7OHY5uZkKSIFjZ sRYY6vzH4hnI9DxSl7KzZc864FyPUHovHOYmEUa5zH3IWEn+TE6eoN3uaOovRc5ePxUl lEJOkK+hUe4V/2pqgDcNpRNPWkCI2SorYOOlrmnFFIy0vxqvuCeJwFuGoL6Nu1asO6eF BYxMROPsSPYuRgTmYjhcSkLEG/CSHvVeS/g2wu7ZQpyoVUCnu+m0OIVZxibFoyT8YuYf tKFQ== X-Gm-Message-State: AOJu0YyL3jPWkyX1bfe+7W5QhH6aaQ6IFcjqzwVYxvLrVu981G+3W+OB BN5/ECcC4bYEGlhSaoILVLjId4sAWg2Pv6zc4H760J6HwsN/X6+Aok3NcggH X-Google-Smtp-Source: AGHT+IGB6dIzI/YWV7iBl7PB6UtXWOUXeArb1XJKTsAj2iBBd3E7dSEdUixhmj2A6mg7N2N49jpjmw== X-Received: by 2002:a05:6820:2016:b0:5a5:27ab:189d with SMTP id by22-20020a056820201600b005a527ab189dmr807044oob.6.1711116589371; Fri, 22 Mar 2024 07:09:49 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:49 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 07/11] gemalto: Set modem lte capable Date: Fri, 22 Mar 2024 09:09:08 -0500 Message-ID: <20240322140942.2703042-7-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322140942.2703042-1-denkenz@gmail.com> References: <20240322140942.2703042-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 14:09:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600170 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.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 8970A47A48 for ; Fri, 22 Mar 2024 14:09:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116594; cv=none; b=m/38W1jcHhW6mVqmaqpybfb6+T7GMsyKG5LS9byOqaV4Qj1QQLXQfW7aSjD0azdtKqZHr/PQJgSmrxTiONWNq3TPhnOhhYeSMy8wTl4TOFoXLJukcZHA0CE32ZEf8GDKnwYW5l88o8pz9vLTJtQER34Rnr442Lq4yOcFdzpnxT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116594; c=relaxed/simple; bh=W6uvZisSYNEQjcVezRx7ALmV51KyF8XmVqESwNLMd34=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oPEEz7MBBPyUrtGszCtWaVVH35IldHw6mh5gXVmY/2laXcvkaQYJ/tyLGiYEXd7r5np7FVy7/PE4tKJ3kMY2+cMLgqQKmpRe2FfSrr0HZJaiE98FaLH7tKARvq5ekxey+Vi7tM0APNbrIOrZM89bGUmsSXhJZi2yut9QklXFkWs= 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=Xx0TqUuB; arc=none smtp.client-ip=209.85.161.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="Xx0TqUuB" Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-5a4a14c52fcso1072372eaf.1 for ; Fri, 22 Mar 2024 07:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116591; x=1711721391; 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=Xx0TqUuB4QBMmIGToQoOV7IZLu4uH/JOu+rolR7inbF4+84O9WpH1UW7H5R0Jj0+Dc mCAQyRs8CIMJ6VLO/RIo8gO+n3MMS0Fy4z+iVTj61VDi0ADI4Fq1mKx8pCBsHEITYDYw Y7AZRVbe4L+v/IhZmsFmqV17454e9d9AlhH8Lw1UDHsmeoyg8aruoM0N5dAbS2K3PQID qqf6Xcq4OR2DYDuy6ZXTtMs+ZdudvZjZSBunQ6wz2eMM4a1b00JVrPU7bKtyU4os68sG g1yY7QqS8IaPZ5egMT3jHiku4qm/uYq66TdHkSXgbfLCMce+tORkhWjoPXHbdeUeWoQr +iRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116591; x=1711721391; 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=EAYiBb7d/OpJyTKvoRjRKqnUlLRI/zxIcje4JzARnlybBdehkciwURegkDsDffFizd E7qi+heDm812JkOpdf1vOrN81qIE8Dhcsv/lSOOTElISdQekR3ke7U/bYOgafFjOyaPf QrHF4OctVLYjPIXJrnb8K0NY30C5FCTbb5Pmx+AWCnugbN+qIOgggdAxP8L09099QsCE syQEwiJ+eyPJ7vk/6OlEzoRx4PW+UbzpVECOzG8kRbmLqEMqx6r1si73FLXRPPo1xO0A dbFy/LcNoVK/1Vwh65qkEE6rUTRqu27WIAfvC1BWnRaHyuE8yO9lU8JJfdn3ESiHMt7R JU1w== X-Gm-Message-State: AOJu0YxL8oEgI0QmdS30eAgexaXPq2Inmrg62Cb4KMTv8qz5hT4Hm+so UD8ggq2ZhrNrNNMciZSDOGjvFGcvilXgC2iLNs1GiqwdF4muhJyQGKxr1a1G X-Google-Smtp-Source: AGHT+IH+BZCq9qcufz5LpXKH4nR9EXWYoJpkyXmSCqV3iI1we34/cmorXmvN2nt/hHNC2etRsOEmQA== X-Received: by 2002:a05:6820:210:b0:5a5:21df:7ef1 with SMTP id bw16-20020a056820021000b005a521df7ef1mr1332273oob.6.1711116590060; Fri, 22 Mar 2024 07:09:50 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:49 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 08/11] xmm7xxx: Set modem as lte capable Date: Fri, 22 Mar 2024 09:09:09 -0500 Message-ID: <20240322140942.2703042-8-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322140942.2703042-1-denkenz@gmail.com> References: <20240322140942.2703042-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 14:09:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600168 Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.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 B55E43FB3B for ; Fri, 22 Mar 2024 14:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116593; cv=none; b=ixfSD6nvfpaoLUfe9dMlSO3pGII64D7vyWszf1XUbQYagqlcWG9OIm6N+RpS6MPDX/MYL8FgM7qgR2jAv5F5c6L3hPww6LVj9QZPxqZbQFgI21VAJY82BoEzfpz6YE0JZ+UMZRuXmmNXIyrtru+Myodgtt0wCmpYFVyFOk0IrH0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116593; c=relaxed/simple; bh=mBiLrFdYNYBz0XbHChKsUD1e65jj5aBvVSyWXY4nl48=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BWQJkmmu5T+SoN5WdhygZnDFhVPFe1Iu/smC6ii/Uud1mFq32TXJ31jHWp6VQIFG8RRlEBvT8aGhOi6BQr9IDvHjj6nK8AgDOO0kaSIEvORoOBL5M0kNRaO/8SR0f5HdKC3siD/iVo9VE64yj7OY1cnZZEsevd0KAJnPDzqVZz8= 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=CAvd72Nk; arc=none smtp.client-ip=209.85.161.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="CAvd72Nk" Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-5a4f7a648dbso1121972eaf.3 for ; Fri, 22 Mar 2024 07:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116591; x=1711721391; 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=CAvd72NkKcuoNWDhhRCnRJUQ2HJPobh+NGB3+TPwRKGNkqjBdgxUhv8PRIKZmPRnBB d+br6mPjQktiQY9EEa7w13DIlfIzGli3GeDTIouYvR+jZnCLJ1PSR+2AL8k5y++qQOvZ GqFMsQuSR0rtQktPSDbYjIEbadNoaBXPNMD/4AEFSPTv+zwJqZrlvYwwiTF1M7GprtDo 7G3iyqTL4ADYjVZUdpIJ0D96Z2nRzeLm/LHNk0ubIUL8qdlgG9/knPkD9+x+hc13nskE 4hhZgd/n7c/CU6o1q9GeIO4u+Wu14B0t6kOYeZUMVJRRaXW/dGITXwzMrIHOMGAA3zQX qoEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116591; x=1711721391; 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=Rn3d3U2c3RCfBNSpV65qISPTHPPjya49FeLi5DMbgm5deij9zgsZV3UY9S+e8lSMca tR+Pd8OLPr17pgx1h3fNfhTd0O0n3ThRdQD+DgbRfce0lO5qmiPO7sQ5U56FAG0VQbOY SnOZayXHw5Oh9P/5EWs0Xz+AbX9W3YD8IVXWF1CmGlM3RGbAntGA7kcVgQo0Aq6b/LwP RJZ0kHFVXh5L4WlHD8nU8Ko7E4/fMs3MonO2pspaLQpihnzd6jIkI61acrYOSfhwf2ml cAfjJ6HKU1eRozmZXjP1mvi6LTomwpJ3XwnqxLz8M/WeYFMMR0WrS8AYCajOWVoohUCL cxBQ== X-Gm-Message-State: AOJu0YxEjEUhbLKP/bk421CopoHfyyTsYTQHs0kV4hLOGjny3DBSt+dI ecu8ddCKpAn3yHSEZRucLQvlXGJqwCxdw1yw+Exk7Taf+8hx5WBKHzCZ7WST X-Google-Smtp-Source: AGHT+IFf+jPR4BzE3KP5M0evY1G4nwQHFmSMiS1elzI5kzewLkrK/mbM7hFzjCYBJmC3EPeXj5Kqqw== X-Received: by 2002:a05:6820:210d:b0:5a1:b49b:f5c5 with SMTP id cd13-20020a056820210d00b005a1b49bf5c5mr2404824oob.9.1711116590795; Fri, 22 Mar 2024 07:09:50 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:50 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 09/11] ublox: Set modem lte capable Date: Fri, 22 Mar 2024 09:09:10 -0500 Message-ID: <20240322140942.2703042-9-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322140942.2703042-1-denkenz@gmail.com> References: <20240322140942.2703042-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 14:09:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600169 Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.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 80A6B4779E for ; Fri, 22 Mar 2024 14:09:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116593; cv=none; b=dZcM8GFazCorKUGMuf+QQR6dqVmeIaVgfAt8gOXWy1PLibhqBm/GZ3BbHhXTzcqO1wTXRKf9ByC6je/6vKKQKPZ+6G2jtfc5dGIjQSaZBpgcZgM3rVEG6amoQ3tAXkzvRLAVYcdUOA7CY1IJbYIymz80YQyKGeg0i2NBz8dqmGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116593; c=relaxed/simple; bh=A+yMIvSImCfLwpDFqcE+k8goyjDKsN873ZWb4qI1YnI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gZaWU8lA5xu1XAgh53JKdpMXBWLew+X0KZEIm2sA0SQ78mHQwZi16cPpfg6GzoSpB7E0XIsGu7zy/3SvLdDGZO1NfT3rQws4hZHX9Z0PVsC3mgw0SUOxhIZGrPnkIC7atZlsSHLyNGQ8fUFFHte8Nbna00V1N1CcM4LBsvyFvlI= 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=QVzuPj1a; arc=none smtp.client-ip=209.85.161.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="QVzuPj1a" Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-5a1fa3cf5eeso814387eaf.3 for ; Fri, 22 Mar 2024 07:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116591; x=1711721391; 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=QVzuPj1ao6vjtboESFMiYq83qx+8/wv/w+nUlVh/cI44T8eerhiGfLn5tKEjHZNAiu W6X+7AqlZdCDDtyhyvbJH4ifAYRTRAAwehuCONpVbJFH6w4TpGt2WND11PO93zcIVVxi 735S38DxtOo3uQPsH3SEyPOpFhTZwanBBxk2oNfWtI4naSzXdX/UKdxHCGSq6Ni6hsEU DxEbmuTlSgPL00e9c9k9oaWb4485p5jOC7cXce67HX5uxrSzXn10TUGdMmb5Gld6/1sY 7yzxsddnUgvh4DZqtgZeGkJtOhfm0ZPNaksdH9RgVP9696qqthnNh+keU7soGIRBU1qX L46Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116591; x=1711721391; 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=lxDwbIL2onC1Rzd0dVCQo69w0CPJbnBMITaFJTCYlfLXbTibCUXHqa/BVTgokrHnUh kDULHQq77+A2nGcSq2nhkEFP9qm1CgWUAhLFeVz/c5tua9ZUqPj5jFHHGdaITzQEmE4A kwpXar+Q56iB5nt/Wr1GjcUm2cBRvsOTH4ySI0qP+Q5Y4KP3AsHUy+2UKh5nM87wVHD4 x9Fd7X2evnwceP4GuDWotieVfEJtVawmmRDLzQ67DYWDmV62ozL4ynqZ7DojOoJ3DjHr 5Hfph10yoGQgYCemMxlZsK9/VYDIh7tj0ljk6YuOTj/5ezutWrpjJtAJm0JxwgYcOnND cjVg== X-Gm-Message-State: AOJu0Yymjtp1cVfnbkyuMR+7HjEicvwEj4iAHmboFd5055ortUSre/XS g5i1Bz/bddXIcm7J6Dm/R/AEn5oljT5WlvXdaNe55akMjmMVn6Fp/tvM0H+E X-Google-Smtp-Source: AGHT+IFkmdeCpomwr3Hcemytq4pW0m05tUBcNhuIxnPO4JXouVdHCu5PPU4SuXmYkRkWXUi8ssY64A== X-Received: by 2002:a4a:edc7:0:b0:5a5:27f5:38cb with SMTP id m7-20020a4aedc7000000b005a527f538cbmr701777ooh.4.1711116591504; Fri, 22 Mar 2024 07:09:51 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:51 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 10/11] gobi: Set modem lte capable Date: Fri, 22 Mar 2024 09:09:11 -0500 Message-ID: <20240322140942.2703042-10-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322140942.2703042-1-denkenz@gmail.com> References: <20240322140942.2703042-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 14:09:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13600171 Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) (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 5152C46453 for ; Fri, 22 Mar 2024 14:09:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116594; cv=none; b=X5+qLj7NqASY9zy+2mToGDIG2tZXVKF1GGzw02X2h7zRR+B609shkHv56GNMvRpmDCs3sWzH3UTo2KDBJIXgZi6LRPGgafpAtJ+XnpxvQvlK+ZXSunOA8+Ds3fSkDdYWizgvbaM2P3JB2MsCzFXOQwM/19fsl54/gmWnmhRwLLs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711116594; c=relaxed/simple; bh=svGUzHoaR5yP/BFo4XrE1O4VWjuO5JyLktkaHhJ6wd4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NKB//HGP1FfnqUlcVSmje3W3qDnbb2GJqybQd6yPg0s5DnEcL457fvXG4YlbwoaxbDn1n8cjqC2HxHOoW13PftYlPxWQaHaH/ffTG6gEsXu9z3eG5ig8ZOlhJ3+qqwNF8ZuXnvBEUXlWw26p+m6kpbLJ6DnZ2AQq/ndkcGblmQE= 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=U4/q5+Ov; arc=none smtp.client-ip=209.85.161.43 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="U4/q5+Ov" Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-5a21859a4b8so727224eaf.0 for ; Fri, 22 Mar 2024 07:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711116592; x=1711721392; 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=U4/q5+Ovx+ec4WTHTeCb2BVLdo66kIeC77ys512AaY7yVOs9nrZy4WnM/O2+4shVXE tqT6Fg4jKnkxeld+Z7KDf1WoYlqcVDceU3IHUgJ1xl1KALaj2tzO0blHWOicRRH4iXPO XoL8RpPhE6yQ5rm4Lsy8qgynO577uO1/5b2I9h/uWSLm9lKRqaxByAg93kpBm9w+OqAn q2D987x5C5JE3yrOBS9k4IXsN2SCcKICZve/Y/GcS9ZgFjO6bl3Rd+UeIzDqzC4Tz1l2 qAdGwkrWrtRYR/hLLmG+GIkQTY6Kx7w3NSLcVYTHJlT4KUIiYybJgmOX2hdt+mMzDXe/ qU5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711116592; x=1711721392; 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=U+9nDjXxNOlBIWcu4GQ1ckXelJ6eWGFD0GDgr/pJbvZlTy6pZFcwy8amS7R1AbnVxB aQh/v3cxlxTLTZLUYfQeoI+Ht+8w9hD1JR/In2WSmmyQmUuIzYWuqYEZuKadEarxcC+R 0P8/86i+7AjSMkYx9pFh6dTRw2aTfjjs3zEUTI9bAYOZXXZiA10EtwTcvBZPWLL/92CT hqFvhl9qt/FfBARLvfS6yeW0sHRc26Kt3l3tBf29YYT3/4gsT/iyRy2CBWP+mnAxj7mN TH2wg3kSHwbN0jCd3nzvj01mxgxAeQ77HBAUGSepGjBtya2k5Q9Gb9oPP0L4JNq1ySka X1AA== X-Gm-Message-State: AOJu0YzROEOx4vG0G+wDLky9bz5OmnK/5/Fl5slx7zVPBDh8TY/0wUqK RHoHXTyMYuBPR4R3ryNSsDjUUhA/WAR/tZLhybr7BGz7DBcudXNS9kmpgxQp X-Google-Smtp-Source: AGHT+IGtcJUM6S2FpQWsmWDolCZhu4QcqJHobpJEOjspnx9nEa74FB8kYwsCYYNvsbDQjD8dUstYIg== X-Received: by 2002:a05:6820:1e01:b0:5a4:b8d6:3be7 with SMTP id dh1-20020a0568201e0100b005a4b8d63be7mr3038709oob.8.1711116592195; Fri, 22 Mar 2024 07:09:52 -0700 (PDT) Received: from localhost.localdomain (070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id cs2-20020a056820258200b005a1f748f3edsm303673oob.30.2024.03.22.07.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:09:51 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 11/11] quectel: Set modem lte capable Date: Fri, 22 Mar 2024 09:09:12 -0500 Message-ID: <20240322140942.2703042-11-denkenz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240322140942.2703042-1-denkenz@gmail.com> References: <20240322140942.2703042-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); }