From patchwork Mon Apr 29 15:56:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13647301 Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (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 060308288A for ; Mon, 29 Apr 2024 15:57:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406251; cv=none; b=RvjAAPIcv26PQGAF1n60npsGysmksM+WLt96jqCUeonzzvWtH8fYnzsgzT81kznUJoiPjNNI+zaXPbkQ1jUBDOjWBB8SunpdwS2h7U2OXVkfBh3v2aPbuiwof6hXs3nxfuYVvloh7JogUrG9Qn2cQlpAEktTQQ70NeYL9nO5uUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406251; c=relaxed/simple; bh=/ZPGYhmsxYUgVO1szsDx3qGWmuUlxL7X9b2Au6VtL9c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=V7a5A8YMXPktr+ExKBfROpw70FnwwvWEXqsYJQFfeY7/jUqLlJLG2LA+BLCpuqkEfdOm0yWT8GtcMc3XDcNmxxOB2rrNEVBL1IywiO/a+aUOlty7MHAfiaqFCoy2y4e6oIC3HVuM8CDrPnvwOwp43SyIO/lhGJu4BCT6dImxY6o= 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=A9CRno/K; arc=none smtp.client-ip=209.85.167.174 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="A9CRno/K" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3c868e82bf8so230377b6e.0 for ; Mon, 29 Apr 2024 08:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714406249; x=1715011049; 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=LNp68X6W7cyV7TzCOqVzJRagrhqyQ3Vzubd4zumI8lY=; b=A9CRno/Kr/mKv7FZ3Mk5y3v8V8zKtE/hD7u6+b7+TI1H8BjGGgLK1STMeIvirf7YR+ sGZPq3LzKf8GLk4QTY15C1N9cGSgMGkYhPZBaX09wi6x2qZf/3rIxOtSM6OHnsubm/un F4yHASgUGdpbZcvMto8eMySW0cQfZ7yGgMCtcO/scFGStTscnx6wc5JE/smG2uH4obkm ZxpN6fta6Cd01WEzWVEGCOffRBRxetGJrXyHBRTyBA5Q0lgPxfV+lOtw7YfS3khzN/nb /a4xM+q31FZdldzaI5gCBnI8E0MkfqxmGqVZhVKKgKuJyciwN0v9pOKzupMModHfdNv4 hgqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714406249; x=1715011049; 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=LNp68X6W7cyV7TzCOqVzJRagrhqyQ3Vzubd4zumI8lY=; b=WdAAfFrT5U2dFoeJC5OiHTZtET+E4oEJ5GvrT5oSRY85MkEkaxA4Y6CEVF3QWjrP5n FYmK4NxV8DzJw0ivsVpGKiLRmIcCEj4/zTkrQ75shjpuOQTKnVJ21NMqL9mcjSiFWFtS 7g90XRtw0QWinrzjZnBX8snZ9MeW7Dqx99RQ7LhYv538gSwl1s4b/2J1Pv2oVstUsj8H UfuvvlLvp8Cp3v8pEaRQde4yM25U+8uU1LGo60XP3cWCew7TF4p2CcrvzhHjqBr/mNMX V7VHDSQlYmhSCKQ6DGcfnVPt135xoLl3EJyvkFJhqBEj2jvE/ebIPD2r6OJWIdU3m63p FFmg== X-Gm-Message-State: AOJu0YyX4U4k4cfRIJ1/k22AdNIRPjx13rXNb9Jlm7C4nJGO5ZRpdHkQ ukKMdEr8JjN0yHdLPOqqizdgOfmpl7JxO3XfrUDd2VCUaEbaFzee2zMMdQ== X-Google-Smtp-Source: AGHT+IHmrUgCfexeu0U3R4aM4YKUgAd7L8j2cMEmH+0Pvzlhd3imUnf9pH8WUptoteC/pRCWvqaiGg== X-Received: by 2002:a05:6808:aae:b0:3c8:64d0:c45e with SMTP id r14-20020a0568080aae00b003c864d0c45emr5100825oij.30.1714406248870; Mon, 29 Apr 2024 08:57:28 -0700 (PDT) Received: from localhost.localdomain ([70.114.247.242]) by smtp.gmail.com with ESMTPSA id bf29-20020a056808191d00b003c7443c0efasm3117820oib.1.2024.04.29.08.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:57:28 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 1/6] qmi: lte: Remove magic number use Date: Mon, 29 Apr 2024 10:56:53 -0500 Message-ID: <20240429155726.51479-1-denkenz@gmail.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Several commands were invoked using magic numbers, even though they're defined inside wds.h. Remove magic numbers from enumerations by introducing appropriate enums to wds.h. Similarly, use defined constants for parameter and result ids. --- drivers/qmimodem/lte.c | 29 +++++++++++++++-------------- drivers/qmimodem/wds.h | 14 +++++++++++++- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/drivers/qmimodem/lte.c b/drivers/qmimodem/lte.c index 6c08c312b3cb..7633572b39ef 100644 --- a/drivers/qmimodem/lte.c +++ b/drivers/qmimodem/lte.c @@ -73,24 +73,23 @@ static void qmimodem_lte_set_default_attach_info(const struct ofono_lte *lte, uint8_t type; uint8_t index; } __attribute__((packed)) p = { - .type = 0, /* 3GPP */ + .type = QMI_WDS_PROFILE_TYPE_3GPP, + .index = ldd->default_profile, }; DBG(""); - p.index = ldd->default_profile; - param = qmi_param_new(); /* Profile selector */ - qmi_param_append(param, 0x01, sizeof(p), &p); + qmi_param_append(param, QMI_WDS_PARAM_PROFILE_TYPE, sizeof(p), &p); /* WDS APN Name */ qmi_param_append(param, QMI_WDS_PARAM_APN, strlen(info->apn), info->apn); /* Modify profile */ - if (qmi_service_send(ldd->wds, 0x28, param, + if (qmi_service_send(ldd->wds, QMI_WDS_MODIFY_PROFILE, param, modify_profile_cb, cbd, l_free) > 0) return; @@ -114,6 +113,7 @@ static void reset_profile_cb(struct qmi_result *result, void *user_data) static void get_default_profile_cb(struct qmi_result *result, void *user_data) { + static const uint8_t RESULT_DEFAULT_PROFILE_NUMBER = 0x1; struct ofono_lte *lte = user_data; struct lte_data *ldd = ofono_lte_get_data(lte); uint16_t error; @@ -123,7 +123,7 @@ static void get_default_profile_cb(struct qmi_result *result, void *user_data) uint8_t type; uint8_t index; } __attribute__((packed)) p = { - .type = 0, /* 3GPP */ + .type = QMI_WDS_PROFILE_TYPE_3GPP, }; DBG(""); @@ -134,7 +134,8 @@ static void get_default_profile_cb(struct qmi_result *result, void *user_data) } /* Profile index */ - if (!qmi_result_get_uint8(result, 0x01, &index)) { + if (!qmi_result_get_uint8(result, RESULT_DEFAULT_PROFILE_NUMBER, + &index)) { ofono_error("Failed query default profile"); goto error; } @@ -148,10 +149,10 @@ static void get_default_profile_cb(struct qmi_result *result, void *user_data) param = qmi_param_new(); /* Profile selector */ - qmi_param_append(param, 0x01, sizeof(p), &p); + qmi_param_append(param, QMI_WDS_PARAM_PROFILE_TYPE, sizeof(p), &p); /* Reset profile */ - if (qmi_service_send(ldd->wds, 0x4b, param, + if (qmi_service_send(ldd->wds, QMI_WDS_RESET_PROFILE, param, reset_profile_cb, lte, NULL) > 0) return; @@ -171,8 +172,8 @@ static void create_wds_cb(struct qmi_service *service, void *user_data) uint8_t type; uint8_t family; } __attribute((packed)) p = { - .type = 0, /* 3GPP */ - .family = 0, /* embedded */ + .type = QMI_WDS_PROFILE_TYPE_3GPP, + .family = QMI_WDS_PROFILE_FAMILY_EMBEDDED, }; DBG(""); @@ -189,11 +190,11 @@ static void create_wds_cb(struct qmi_service *service, void *user_data) param = qmi_param_new(); /* Profile type */ - qmi_param_append(param, 0x1, sizeof(p), &p); + qmi_param_append(param, QMI_WDS_PARAM_PROFILE_TYPE, sizeof(p), &p); /* Get default profile */ - if (qmi_service_send(ldd->wds, 0x49, param, - get_default_profile_cb, lte, NULL) > 0) + if (qmi_service_send(ldd->wds, QMI_WDS_GET_DEFAULT_PROFILE_NUMBER, + param, get_default_profile_cb, lte, NULL) > 0) return; qmi_param_free(param); diff --git a/drivers/qmimodem/wds.h b/drivers/qmimodem/wds.h index 3c9b534c1f82..6d7071fe244f 100644 --- a/drivers/qmimodem/wds.h +++ b/drivers/qmimodem/wds.h @@ -20,13 +20,13 @@ */ /* Start WDS network interface */ +#define QMI_WDS_PARAM_PROFILE_TYPE 0x01 #define QMI_WDS_PARAM_APN 0x14 /* string */ #define QMI_WDS_PARAM_IP_FAMILY 0x19 /* uint8 */ #define QMI_WDS_PARAM_USERNAME 0x17 /* string */ #define QMI_WDS_PARAM_PASSWORD 0x18 /* string */ #define QMI_WDS_PARAM_AUTHENTICATION_PREFERENCE 0x16 /* uint8 */ - enum qmi_wds_authentication { QMI_WDS_AUTHENTICATION_PAP = 0x1, QMI_WDS_AUTHENTICATION_CHAP = 0x2, @@ -57,6 +57,17 @@ enum qmi_wds_client_type { QMI_WDS_CLIENT_TYPE_TETHERED = 0x01, }; +enum qmi_wds_profile_type { + QMI_WDS_PROFILE_TYPE_3GPP = 0x00, + QMI_WDS_PROFILE_TYPE_3GPP2 = 0x01, + QMI_WDS_PROFILE_TYPE_EPC = 0x02, +}; + +enum qmi_wds_profile_family { + QMI_WDS_PROFILE_FAMILY_EMBEDDED = 0x00, + QMI_WDS_PROFILE_FAMILY_TETHERED = 0x01, +}; + enum qmi_wds_command { QMI_WDS_RESET = 0x00, QMI_WDS_EVENT_REPORT = 0x01, @@ -83,6 +94,7 @@ enum qmi_wds_command { QMI_WDS_GET_CURRENT_DATA_BEARER_TECHNOLOGY = 0x44, QMI_WDS_GET_DEFAULT_PROFILE_NUMBER = 0x49, QMI_WDS_SET_DEFAULT_PROFILE_NUMBER = 0x4A, + QMI_WDS_RESET_PROFILE = 0x4B, QMI_WDS_SET_IP_FAMILY = 0x4D, QMI_WDS_SET_AUTOCONNECT_SETTINGS = 0x51, QMI_WDS_GET_PDN_THROTTLE_INFO = 0x6C, From patchwork Mon Apr 29 15:56:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13647302 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 6A3F482D7C for ; Mon, 29 Apr 2024 15:57:30 +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=1714406252; cv=none; b=FNYdVBGiPiUnLP3dudZrD5PrXAuJhOQl17CO4pI4A1u0sB1BzRm3BdDyfW/ynI0R6F3e9Z29HWM3+r3y9f2HWXv5ulGZ0TeYpUJnq6XtdTgZUdINrz0+0QlY9wm3r+mJKnj0d01STDspJALfUilfY4jWckkB1r0+MeEH36/tMtY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406252; c=relaxed/simple; bh=XBvVcaHcaKnSZ9Aj1nxMtPV6/0Cv0B6uOGrYS0Qj/us=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nn4nqbEHmyOTuSIeYgSycdHnOXiCgs3my1l/RRNqFMqSvHW8wQf76shMXe5KVuzjRVg1mhC4BiwcelSpgy3Sr8fHNQxXancontTSpeYgo7JiWOW35MApwRPCY6lNjScvamCXilvWifYmzoz/d2Tl8svgc1XN/M+R0aKWR6jsJxY= 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=IZgjoTlx; 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="IZgjoTlx" Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-6ee266e2999so773091a34.2 for ; Mon, 29 Apr 2024 08:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714406249; x=1715011049; 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=IWVpySXbFdAnt6Ba2qRjeMx8UM7/1DCO5OCEFMBZL/w=; b=IZgjoTlxe5n1kOhDba0X371ginjvPtt9svUruNca5jiMfHbvWefqzpCHHIOdIgjNQ+ N8ar2JJpWk47hSoIj9KNSiTaBnfQdWOP9U9iavrJjPkxNQUelqs/x16VfkxdWfbsP4VZ 2EBUTSYN4rkkhJaQAsducEnLwHFpjWFH2N5i1ldsXe2Sk9ViZmy2gC6i5hfaOB0HMwzr jVNMsDaXD/Ya2BXeaNka202ofyPaCBU0yZ+EgH7iuoxuLCkgv2hfDsbD1lIavWwnWhv4 uYevYWk4imrXW+c83ZsWbbRoEeS4lURH9vBKZk1eu6P4ftM5eA2I8Qk4OlX3Bw6V8Iwj FR6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714406249; x=1715011049; 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=IWVpySXbFdAnt6Ba2qRjeMx8UM7/1DCO5OCEFMBZL/w=; b=mfY97sAVYnIrp3mkCJU0LfszQJ/2gk0BQh0yEh8+hUkb8nyr9Dd0pvt2hWW00Igdyv QZ4bliIbLytKfMPyDDjo/vmOmZOu0xuxDk2brLHt1ax9flEY4K3op6bVJAHtMYsnzyEh NPgYDA/G4YsYWzdAR4tsYLfSb+gD28pbnFc4zSBVtFHuy/fNUZlsnXd0PJ8muapGyBfe RaRN+6wBAGLb2SYrDLsNuoSD3ap1f343gcMIivy7ocFYnv3vdbhmP6si2hA3Up52KLxY OztOLh829rwQdcSwg6OzYelQl3j0MQVPps9QzY79EwlJvwqppKZG5LItm9YbUrIQjDqG zVDg== X-Gm-Message-State: AOJu0YwbEXu5C0vQ0pbefP2XFi0oMUDxNLIr3enOGiDOmxnKFO6CxCJj F2++d8ITkIPK3awQNinvMkvL77AVaUa+yfRBIbdTsm4drZDluoP1HuOm+w== X-Google-Smtp-Source: AGHT+IGI9o5epM8b1LLxUrhR2/plVe+BdzauT/J+wmvQaxjt3QScfIrjJxutwjwGqlGwcayXacDksA== X-Received: by 2002:a05:6808:2a8a:b0:3c8:2c20:718c with SMTP id fc10-20020a0568082a8a00b003c82c20718cmr10333896oib.2.1714406249662; Mon, 29 Apr 2024 08:57:29 -0700 (PDT) Received: from localhost.localdomain ([70.114.247.242]) by smtp.gmail.com with ESMTPSA id bf29-20020a056808191d00b003c7443c0efasm3117820oib.1.2024.04.29.08.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:57:29 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 2/6] qmi: wds: Move enum conversion into wds.c Date: Mon, 29 Apr 2024 10:56:54 -0500 Message-ID: <20240429155726.51479-2-denkenz@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429155726.51479-1-denkenz@gmail.com> References: <20240429155726.51479-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Introduce a new wds.c file which will house various utilities, such as enumeration conversion, that could be shared between multiple QMI based atom drivers. Move ofono_gprs_auth_method conversion here. --- Makefile.am | 1 + drivers/qmimodem/gprs-context.c | 17 +---------------- drivers/qmimodem/wds.c | 25 +++++++++++++++++++++++++ drivers/qmimodem/wds.h | 2 ++ 4 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 drivers/qmimodem/wds.c diff --git a/Makefile.am b/Makefile.am index b5a32fac1c89..815d96904943 100644 --- a/Makefile.am +++ b/Makefile.am @@ -362,6 +362,7 @@ qmi_sources = drivers/qmimodem/qmi.h drivers/qmimodem/qmi.c \ drivers/qmimodem/pds.h \ drivers/qmimodem/common.h \ drivers/qmimodem/wda.h \ + drivers/qmimodem/wds.c \ drivers/qmimodem/voice.h builtin_sources += $(qmi_sources) \ diff --git a/drivers/qmimodem/gprs-context.c b/drivers/qmimodem/gprs-context.c index 4004876bab87..9ac57c893725 100644 --- a/drivers/qmimodem/gprs-context.c +++ b/drivers/qmimodem/gprs-context.c @@ -239,21 +239,6 @@ static void qmi_gprs_read_settings(struct ofono_gprs_context* gc, l_free(cbd); } -static uint8_t auth_method_to_qmi_auth(enum ofono_gprs_auth_method method) -{ - /* QMI uses a bitmap */ - switch (method) { - case OFONO_GPRS_AUTH_METHOD_CHAP: - return QMI_WDS_AUTHENTICATION_CHAP; - case OFONO_GPRS_AUTH_METHOD_PAP: - return QMI_WDS_AUTHENTICATION_PAP; - case OFONO_GPRS_AUTH_METHOD_NONE: - return 0; - } - - return 0; -} - static void qmi_activate_primary(struct ofono_gprs_context *gc, const struct ofono_gprs_primary_context *ctx, ofono_gprs_context_cb_t cb, void *user_data) @@ -288,7 +273,7 @@ static void qmi_activate_primary(struct ofono_gprs_context *gc, qmi_param_append_uint8(param, QMI_WDS_PARAM_IP_FAMILY, ip_family); - auth = auth_method_to_qmi_auth(ctx->auth_method); + auth = qmi_wds_auth_from_ofono(ctx->auth_method); qmi_param_append_uint8(param, QMI_WDS_PARAM_AUTHENTICATION_PREFERENCE, auth); diff --git a/drivers/qmimodem/wds.c b/drivers/qmimodem/wds.c new file mode 100644 index 000000000000..748ad867c2cc --- /dev/null +++ b/drivers/qmimodem/wds.c @@ -0,0 +1,25 @@ +/* + * oFono - Open Source Telephony + * Copyright (C) 2024 Cruise, LLC + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "src/common.h" + +#include "wds.h" + +int qmi_wds_auth_from_ofono(enum ofono_gprs_auth_method method) +{ + /* QMI uses a bitmap */ + switch (method) { + case OFONO_GPRS_AUTH_METHOD_CHAP: + return QMI_WDS_AUTHENTICATION_CHAP; + case OFONO_GPRS_AUTH_METHOD_PAP: + return QMI_WDS_AUTHENTICATION_PAP; + case OFONO_GPRS_AUTH_METHOD_NONE: + return 0; + } + + return -ENOENT; +} diff --git a/drivers/qmimodem/wds.h b/drivers/qmimodem/wds.h index 6d7071fe244f..c8aeefe430bb 100644 --- a/drivers/qmimodem/wds.h +++ b/drivers/qmimodem/wds.h @@ -108,3 +108,5 @@ enum qmi_wds_command { QMI_WDS_CONFIGURE_PROFILE_EVENT_LIST = 0xA7, QMI_WDS_PROFILE_CHANGED = 0xA8, }; + +int qmi_wds_auth_from_ofono(enum ofono_gprs_auth_method method); From patchwork Mon Apr 29 15:56:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13647303 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (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 814E58288A for ; Mon, 29 Apr 2024 15:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406253; cv=none; b=KXgNIQi2zhMn2tGJAQYd9XY4PWOGqHRih+YTMcNEZk6Q6nzFAoOPoLaBXYoIqIAVB//6cdNor8cCeTs7uLZStofNGBg4V3myV3sEffHJvsozfwysJJVKH3PSGu8p2aCaSXOugTxAGJOGUqcZIsuHsPy8x8C/vqiC7irsVlMjozI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406253; c=relaxed/simple; bh=4vYB4VjYrMWtB1o2PAUL++oj805s5KvpSpUqEDdGydo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LmWR4GlzSeKBSsVVjaf02au9SngwihokrkIuzHc7gj032lI53ntBqNfBTIKDJZqLhW3W9EgAD6aV4635TuzgYXIhixnV/w3j/opgIhggRBbIF+fuFy5zM+zd/BMVRK/PguoITPMKKR4J76khy89d0oEwTxbvRR0vkaPvHdZ+wwQ= 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=OMKAt96q; arc=none smtp.client-ip=209.85.167.179 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="OMKAt96q" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3c5ed7fdbb1so2751975b6e.0 for ; Mon, 29 Apr 2024 08:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714406250; x=1715011050; 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=ckPB0cVcXgeh3i2Xby9h8HcVJoPWvsuXrLEm7SCkQPE=; b=OMKAt96qwzEXqAVzlb/W+CytYdd8rvbJnHGYmitWD531Jx9WBsK5QC0BTnxZQWDekH 0r4Zo30SmW5AGd/5QmpQCsDmeCMlRSncw5D8BLKCOgUDV2oPlt5aRccTbUwtViDkWuQF fgzP8wokoHkqjG8mpjc7MmKtUMI+JPgY5P+dmHZXG84WUH65dcx2ZE5Own7EZtnP17uj WgqMyrOeX8CIvMIdMqTj4WilJUsHBI17VCr7RTw8oHjQ0kGksaz/TM8ZxixPi0Q9C86I U9uSDoDM4N1crZp0jUvN1P9ODGQR9VmFtZH5E49uuFmAKDAq82iP00vjjSjj6/33bRcH lB1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714406250; x=1715011050; 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=ckPB0cVcXgeh3i2Xby9h8HcVJoPWvsuXrLEm7SCkQPE=; b=QqMnKzBnghXBICNfdYMY8MKOJF2CuMaV3nPVJ/jml14Toy4bMXnNa7VZh5IiHVgL2F LQ2EUZ1ZAJWeowVrzhKe2n0Jr6+7xjWOHPjVxKxScLJrbmsMFeqbaBtVFs5uv//jnl0g TWfQyilFdH0PGpdx7wgbngd8fdsQRoRC1H1bZD87QPnXVWY0Y+C4e3bIGOoksakTKh1u pjk7AtOjkRmM2kQ2nZMY8hJ8MBU9dylVo3gP8LYcQ7rZrLAG37crb31cdLqJc+bWjJP2 3SpmuKvMf+4QzJ/6vDbPzZF7ss5v8q7gLkYgLLZKQHG7h1tyOUbh4LC8rkdyM05a53a1 fIMw== X-Gm-Message-State: AOJu0YzA18JOjg4PYgDKG8IGWVcnawH7Jd8acPbqhw43cFxkav5p/MQy i94rryliX7kJKkErQU58hNdJaU2TgZ2Wi1LNdh38nqFXnG09k+/YTRXzvA== X-Google-Smtp-Source: AGHT+IFMbyBZkpVToQAmlNxvSUTXNI05pfRKKRiZ8IYJHKlIbkb5dkYt1zBuePTAsOsiTJXib72r4g== X-Received: by 2002:a05:6808:2194:b0:3c6:ef2e:98f4 with SMTP id be20-20020a056808219400b003c6ef2e98f4mr31423oib.15.1714406250408; Mon, 29 Apr 2024 08:57:30 -0700 (PDT) Received: from localhost.localdomain ([70.114.247.242]) by smtp.gmail.com with ESMTPSA id bf29-20020a056808191d00b003c7443c0efasm3117820oib.1.2024.04.29.08.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:57:30 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 3/6] qmi: lte: Support additional attributes Date: Mon, 29 Apr 2024 10:56:55 -0500 Message-ID: <20240429155726.51479-3-denkenz@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429155726.51479-1-denkenz@gmail.com> References: <20240429155726.51479-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for setting APN Type (IPV4, IPV6 or Dual), Username and Password attributes of the profile used for the default bearer. --- drivers/qmimodem/lte.c | 21 +++++++++++++++++---- drivers/qmimodem/wds.c | 14 ++++++++++++++ drivers/qmimodem/wds.h | 1 + 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/drivers/qmimodem/lte.c b/drivers/qmimodem/lte.c index 7633572b39ef..70efaf04c8f5 100644 --- a/drivers/qmimodem/lte.c +++ b/drivers/qmimodem/lte.c @@ -66,6 +66,10 @@ static void qmimodem_lte_set_default_attach_info(const struct ofono_lte *lte, const struct ofono_lte_default_attach_info *info, ofono_lte_cb_t cb, void *data) { + static const uint8_t PARAM_PDP_TYPE = 0x11; + static const uint8_t PARAM_USERNAME = 0x1B; + static const uint8_t PARAM_PASSWORD = 0x1C; + static const uint8_t PARAM_AUTHENTICATION_PREFERENCE = 0x1D; struct lte_data *ldd = ofono_lte_get_data(lte); struct cb_data *cbd = cb_data_new(cb, data); struct qmi_param* param; @@ -76,19 +80,28 @@ static void qmimodem_lte_set_default_attach_info(const struct ofono_lte *lte, .type = QMI_WDS_PROFILE_TYPE_3GPP, .index = ldd->default_profile, }; + uint8_t auth = qmi_wds_auth_from_ofono(info->auth_method); DBG(""); param = qmi_param_new(); - /* Profile selector */ qmi_param_append(param, QMI_WDS_PARAM_PROFILE_TYPE, sizeof(p), &p); - - /* WDS APN Name */ + qmi_param_append_uint8(param, PARAM_PDP_TYPE, + qmi_wds_pdp_type_from_ofono(info->proto)); qmi_param_append(param, QMI_WDS_PARAM_APN, strlen(info->apn), info->apn); - /* Modify profile */ + qmi_param_append_uint8(param, PARAM_AUTHENTICATION_PREFERENCE, auth); + + if (auth && info->username[0]) + qmi_param_append(param, PARAM_USERNAME, + strlen(info->username), info->username); + + if (auth && info->password[0]) + qmi_param_append(param, PARAM_PASSWORD, + strlen(info->password), info->password); + if (qmi_service_send(ldd->wds, QMI_WDS_MODIFY_PROFILE, param, modify_profile_cb, cbd, l_free) > 0) return; diff --git a/drivers/qmimodem/wds.c b/drivers/qmimodem/wds.c index 748ad867c2cc..d126f4712921 100644 --- a/drivers/qmimodem/wds.c +++ b/drivers/qmimodem/wds.c @@ -23,3 +23,17 @@ int qmi_wds_auth_from_ofono(enum ofono_gprs_auth_method method) return -ENOENT; } + +int qmi_wds_pdp_type_from_ofono(enum ofono_gprs_proto proto) +{ + switch (proto) { + case OFONO_GPRS_PROTO_IP: + return QMI_WDS_PDP_TYPE_IPV4; + case OFONO_GPRS_PROTO_IPV6: + return QMI_WDS_PDP_TYPE_IPV6; + case OFONO_GPRS_PROTO_IPV4V6: + return QMI_WDS_PDP_TYPE_IPV4V6; + } + + return -ENOENT; +} diff --git a/drivers/qmimodem/wds.h b/drivers/qmimodem/wds.h index c8aeefe430bb..d896fd8cc535 100644 --- a/drivers/qmimodem/wds.h +++ b/drivers/qmimodem/wds.h @@ -110,3 +110,4 @@ enum qmi_wds_command { }; int qmi_wds_auth_from_ofono(enum ofono_gprs_auth_method method); +int qmi_wds_pdp_type_from_ofono(enum ofono_gprs_proto proto); From patchwork Mon Apr 29 15:56:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13647304 Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (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 BBDF5839E2 for ; Mon, 29 Apr 2024 15:57:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406254; cv=none; b=tM47XZoBbWIGbe2x2S2ftfjjV8tZbd/W9xjPddCuQnn98mw145gVPP2TmBpm+u5pGrGkYMBUTE+YAe3fxPgiSUYqzVH/Zk93v+8+L2GmFJQKsrw1P8Ukk5BolRah5Cg5LEg8ZLftyf2iKDodUC3lobIicPaWwYcXDqG0wr44+Gk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406254; c=relaxed/simple; bh=SG7JKdbsgWfF41n8Afado3R7t8hqIbP86hULAkO/L8s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EtztX+YuA+1JNtK78ng5vrWSQx3IP+rDe5y7vsb55HKhquzjv6N78lTnWGP87zUb+pzwu5sfNTWj9HYmP12dAODbslBesBUCxYWnkBWXhhn6AWovKwpH8WGYNMBGzYEfIxB/56ft3Dwb6ju0NDmXEm9z7mZJBrWpp5wAYXpZVUc= 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=A/VszFzQ; arc=none smtp.client-ip=209.85.167.174 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="A/VszFzQ" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3c74ff209f6so3137204b6e.0 for ; Mon, 29 Apr 2024 08:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714406251; x=1715011051; 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=m8sQVwFw++QoqY5xReCkT4O/Wu5yRIv4jm9NSrIBntU=; b=A/VszFzQ44XbiGoxf6xxOerSTi7Rwiyfajof4tIogc9bdfkEm2+2bszf7OStKtmBBF C8OohsvCNrwxNIeVFYspaSFaFG7UQS/0QpshfUW694eHASVDg0VfEEirDXlg5vrpAxrY saLPy/GT86P6o8NqLS4JhcExQGSoaVYEF0cKHFPufiZZTSb6MV62TzvgqJ9Lq+zr0DZn 5hK1YXsNb+bwUj0xObRBNyLiF2AbQF33kZc0/Nh6hdapj3UxIf1kWA62EQYMOPMu0fN9 uF1zyYUDnpTY+gQtYnDlPb4Aq6p89nYPXjHVOmJhBd9ZJGXtRIy5ZthCXGu3f0PRPMtZ E3Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714406251; x=1715011051; 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=m8sQVwFw++QoqY5xReCkT4O/Wu5yRIv4jm9NSrIBntU=; b=EYPASPvTU98jW8vBb3ZpEAHAfQF7CK33CYCjJY0APbYOWAxtXlCLR2YxzaqC1j9G/F Fkk307/8k05KRfQdwoDzfRl1eY3i5rgN/NWJDJDaFab4vzzKlo0rKbth6os54pDV4y9x YlnlfT9QX6yj8u7vx5HWI332SOeC37E0fM6qOsBbZosykXpSE7o6Yhly5VxUdgDZ1tFP 2pebc7cHDigzU3mmfS746pKMd7wTlhWjqJ/JwkWlEni9Kgln+AUvWT1GQ2WylQzNtQlb KDRVWiIIhOwRlnVLLVt/YLj9NkSvWx1mKI8rwl64ZbcphQ2BsGus6LayDR1fiHhvFXNJ R9mQ== X-Gm-Message-State: AOJu0Yxkg5RyDTqeFUZFk/ku4VPdgfso/cq0Q5Ju3v+02oVP7ULgdmoI CruNOZRYh+Wisf4pM2mIKmP57pTMnA1cEUcwU0WC/S/reGQU5XSBOtIYLw== X-Google-Smtp-Source: AGHT+IEV/Htn0VE8Upf0XF52oJJ+vqpA+5Ss7QH/xRzmbwkTDjU1/k48+A9cx4G8QXjuJkgsMyS7BQ== X-Received: by 2002:a05:6808:3d2:b0:3c7:4547:31bf with SMTP id o18-20020a05680803d200b003c7454731bfmr11799771oie.32.1714406251537; Mon, 29 Apr 2024 08:57:31 -0700 (PDT) Received: from localhost.localdomain ([70.114.247.242]) by smtp.gmail.com with ESMTPSA id bf29-20020a056808191d00b003c7443c0efasm3117820oib.1.2024.04.29.08.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:57:30 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 4/6] qmi: gprs: Query default profile number at init Date: Mon, 29 Apr 2024 10:56:56 -0500 Message-ID: <20240429155726.51479-4-denkenz@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429155726.51479-1-denkenz@gmail.com> References: <20240429155726.51479-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The current logic queries the default profile id every time the driver believes the default bearer has been attached. However, oFono does not modify the default profile number during its runtime. Query the default profile id at initialization time instead. While here, remove some magic numbers in favor of defined constants. --- drivers/qmimodem/gprs.c | 136 ++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 75 deletions(-) diff --git a/drivers/qmimodem/gprs.c b/drivers/qmimodem/gprs.c index 72509d433bc6..738271905848 100644 --- a/drivers/qmimodem/gprs.c +++ b/drivers/qmimodem/gprs.c @@ -38,7 +38,7 @@ struct gprs_data { struct qmi_device *dev; struct qmi_service *nas; struct qmi_service *wds; - unsigned int last_auto_context_id; + unsigned int default_profile; uint16_t serving_system_indication_id; }; @@ -116,46 +116,12 @@ static void get_lte_attach_param_cb(struct qmi_result *result, void *user_data) if (qmi_result_get_uint8(result, 0x11, &iptype)) ofono_info("LTE attach IP type: %hhd", iptype); - ofono_gprs_cid_activated(gprs, data->last_auto_context_id, apn); + ofono_gprs_cid_activated(gprs, data->default_profile, apn); l_free(apn); return; noapn: - data->last_auto_context_id = 0; - ofono_error("LTE bearer established but APN not set"); -} - -static void get_default_profile_cb(struct qmi_result *result, void *user_data) -{ - struct ofono_gprs* gprs = user_data; - struct gprs_data *data = ofono_gprs_get_data(gprs); - uint16_t error; - uint8_t index; - - DBG(""); - - if (qmi_result_set_error(result, &error)) { - ofono_error("Get default profile error: %hd", error); - goto error; - } - - /* Profile index */ - if (!qmi_result_get_uint8(result, 0x01, &index)) { - ofono_error("Failed query default profile"); - goto error; - } - - DBG("Default profile index: %hhd", index); - - data->last_auto_context_id = index; - - if (qmi_service_send(data->wds, QMI_WDS_GET_LTE_ATTACH_PARAMETERS, - NULL, get_lte_attach_param_cb, gprs, NULL) > 0) - return; - -error: - data->last_auto_context_id = 0; ofono_error("LTE bearer established but APN not set"); } @@ -167,41 +133,16 @@ error: static void get_lte_attach_params(struct ofono_gprs* gprs) { struct gprs_data *data = ofono_gprs_get_data(gprs); - struct { - uint8_t type; - uint8_t family; - } __attribute((packed)) p = { - .type = 0, /* 3GPP */ - .family = 0, /* embedded */ - }; - struct qmi_param *param; DBG(""); - if (data->last_auto_context_id != 0) - return; /* Established or in progress */ - - /* Set query in progress */ - data->last_auto_context_id = -1; - - /* First we query the default profile in order to find out which - * context the modem has activated. - */ - param = qmi_param_new(); - - /* Profile type */ - qmi_param_append(param, 0x1, sizeof(p), &p); - - if (qmi_service_send(data->wds, QMI_WDS_GET_DEFAULT_PROFILE_NUMBER, - param, get_default_profile_cb, gprs, NULL) > 0) + if (qmi_service_send(data->wds, QMI_WDS_GET_LTE_ATTACH_PARAMETERS, + NULL, get_lte_attach_param_cb, gprs, NULL) > 0) return; - - qmi_param_free(param); } static int handle_ss_info(struct qmi_result *result, struct ofono_gprs *gprs) { - struct gprs_data *data = ofono_gprs_get_data(gprs); int status; int tech; int bearer_tech; @@ -222,8 +163,6 @@ static int handle_ss_info(struct qmi_result *result, struct ofono_gprs *gprs) */ get_lte_attach_params(gprs); } - } else { - data->last_auto_context_id = 0; } /* DC is optional so only notify on successful extraction */ @@ -337,20 +276,29 @@ static void qmi_attached_status(struct ofono_gprs *gprs, l_free(cbd); } -static void create_wds_cb(struct qmi_service *service, void *user_data) +static void get_default_profile_cb(struct qmi_result *result, void *user_data) { + static const uint8_t RESULT_DEFAULT_PROFILE_NUMBER = 0x1; struct ofono_gprs *gprs = user_data; struct gprs_data *data = ofono_gprs_get_data(gprs); + uint16_t error; + uint8_t index; - DBG(""); + if (qmi_result_set_error(result, &error)) { + ofono_error("Get default profile error: %hd", error); + goto error; + } - if (!service) { - ofono_error("Failed to request WDS service"); - ofono_gprs_remove(gprs); - return; + /* Profile index */ + if (!qmi_result_get_uint8(result, RESULT_DEFAULT_PROFILE_NUMBER, + &index)) { + ofono_error("Failed query default profile"); + goto error; } - data->wds = service; + DBG("Default profile index: %hhd", index); + data->default_profile = index; + ofono_gprs_set_cid_range(gprs, index, index); /* * First get the SS info - the modem may already be connected, @@ -358,15 +306,53 @@ static void create_wds_cb(struct qmi_service *service, void *user_data) */ qmi_service_send(data->nas, QMI_NAS_GET_SERVING_SYSTEM, NULL, ss_info_notify, gprs, NULL); - data->serving_system_indication_id = qmi_service_register(data->nas, QMI_NAS_SERVING_SYSTEM_INDICATION, ss_info_notify, gprs, NULL); - ofono_gprs_set_cid_range(gprs, 1, 1); - ofono_gprs_register(gprs); + return; +error: + ofono_gprs_remove(gprs); +} + +static void create_wds_cb(struct qmi_service *service, void *user_data) +{ + struct ofono_gprs *gprs = user_data; + struct gprs_data *data = ofono_gprs_get_data(gprs); + struct { + uint8_t type; + uint8_t family; + } __attribute((packed)) p = { + .type = QMI_WDS_PROFILE_TYPE_3GPP, + .family = QMI_WDS_PROFILE_FAMILY_EMBEDDED, + }; + struct qmi_param *param; + + DBG(""); + + if (!service) { + ofono_error("Failed to request WDS service"); + goto error; + } + + data->wds = service; + + /* + * Query the default profile. We never change the default profile + * number, so querying it once should be sufficient + */ + param = qmi_param_new(); + qmi_param_append(param, QMI_WDS_PARAM_PROFILE_TYPE, sizeof(p), &p); + + if (qmi_service_send(data->wds, QMI_WDS_GET_DEFAULT_PROFILE_NUMBER, + param, get_default_profile_cb, gprs, NULL) > 0) + return; + + qmi_param_free(param); +error: + ofono_gprs_remove(gprs); } static void create_nas_cb(struct qmi_service *service, void *user_data) From patchwork Mon Apr 29 15:56:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13647305 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 59666839FD for ; Mon, 29 Apr 2024 15:57:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406254; cv=none; b=Cvv2l2zd2OX56ukc7zPM5yiguN9M9B3hSqq+KWNPPbuylBrjYONk/XkIdEFA+IkvZD0GEgFE2E2iXNBKNI32Iq4CWJBG7+2e/gI90XSrZ4hLtlxdKZGKEq7dmaVLz6ese11GnAxuraNIvWKLwnJFR7q8AeOevLit90SD38eUKKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406254; c=relaxed/simple; bh=x+romm09j+Aiw2ODWBUeqapMIpgf6YERu/oOJ3UDV40=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FmP543gwIVcR3YTbO6FeTXTZ9wB5P+HAifr6ThvD4xJ87zz/V/9hlIM5ZCHzJqsSqayFMWvEFdBPgpM6WJogWVORlH5MLeQkeY1iYlp8NuNTKEz4JVP8HJ5gFeSEK8X24HNQI4aKvKXdhejmX4q0v5jLKV1gou2jQMQjepx/BCc= 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=nqDriyw+; arc=none smtp.client-ip=209.85.167.173 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="nqDriyw+" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-3c709e5e4f9so2970583b6e.3 for ; Mon, 29 Apr 2024 08:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714406252; x=1715011052; 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=wK1nmFk27qgTx0lKAKUM3BEt8SUtlL2Rlpy0VRvBtIg=; b=nqDriyw+fu9YfpA6gBs9o9k4TZSwpl5WefDTwYJoE+025R28dftJoD2e7qNJ4tLdS5 pyHynXBSIdLvtg8AjXgjb15wKwN4TvzGLgH4EW+GxtwVyHT0T1REO8Z/MJx3g8U1f4iR myizBwk0KKwiFHOPM/YVI/ZTviIrLoorYuXQS3ZlXVVtKpFqzGU0KaSaEgjaIqeSBQZB BuqGPTo6cpCANXawpFcLlzkhONshq6NOXJorbuxkl7AQ9+Yg7ul+FEI9wfTzeKz/VvVw 86bTSoUTOq46lzDdaqF7YmNNe8FVNYTHcXTA5gaxE7vVemVrjU0r0Hh7R74zGnmhKV8A J3YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714406252; x=1715011052; 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=wK1nmFk27qgTx0lKAKUM3BEt8SUtlL2Rlpy0VRvBtIg=; b=A3h+hy4lKUFlZaoQUyUKtMsZDDIYvviHgOlv0PxqqFwi0M4773tE7FGnEfek5wGwlb bfJTlbMNA/6bpK8huYqaSzZrQvUi+s8B0xB83M83JaBWlsxhtEkpQT+NS1+stzcvQXVc Y/sWOx8g1l1DfexhazlKrdOcJYbeG06op2hdnvTtyua+AxY6UYMsL5tfqAxdwX2TovJT uOvl0TdfrtrgdqJmatxwFgJ4cPUlB6fM4COPcr7UM565oHZhaJ59H/1HeBvC88eU6rc+ jCPqXVL1WY00zlmShywuRLLAk7OlPb9fiWby1hNPjWfjbWkVOKmEPtGmz2s/gYUz3qSW 27Nw== X-Gm-Message-State: AOJu0YyovF7GyjM6Vc/31FlC/ja6nMPTytoyjAXHuuHaJ7Za9FvRbsCU NNk8NqVjtr+A2bm2YHyuFFkc3ihI3Jh+Dfr6zfqeCHAE7j7SfLQ5ljnt0A== X-Google-Smtp-Source: AGHT+IHCfBlNKr/hZTajRHaly0e61YMhH5Uvjvc5kTajzZmGMgjAtcNnBaw7C2aA06bU4Fthzp9zrw== X-Received: by 2002:a54:4088:0:b0:3c7:3b1d:bb59 with SMTP id i8-20020a544088000000b003c73b1dbb59mr11782954oii.2.1714406252297; Mon, 29 Apr 2024 08:57:32 -0700 (PDT) Received: from localhost.localdomain ([70.114.247.242]) by smtp.gmail.com with ESMTPSA id bf29-20020a056808191d00b003c7443c0efasm3117820oib.1.2024.04.29.08.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:57:32 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 5/6] udevng: Add "option" module managed ports to gobi driver Date: Mon, 29 Apr 2024 10:56:57 -0500 Message-ID: <20240429155726.51479-5-denkenz@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429155726.51479-1-denkenz@gmail.com> References: <20240429155726.51479-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This makes sure that any tty ports that are managed / created by the "option" module can still be utilized by the gobi driver. --- plugins/udevng.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/udevng.c b/plugins/udevng.c index 14ae2f392da4..1aa9f2e4b4b0 100644 --- a/plugins/udevng.c +++ b/plugins/udevng.c @@ -2014,6 +2014,7 @@ static struct { { "hso", "hso" }, { "gobi", "qmi_wwan" }, { "gobi", "qcserial" }, + { "gobi", "option" }, { "sierra", "qmi_wwan", "1199" }, { "sierra", "qcserial", "1199" }, { "sierra", "sierra" }, From patchwork Mon Apr 29 15:56:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13647306 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (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 1FE178288A for ; Mon, 29 Apr 2024 15:57:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406255; cv=none; b=XQGdF4v9CxEO/BMswWaEAw6rY0cW2to2f8rihGObqD3B/AxHeVosJrXzu9ki/peWf93iI3lsVH1Eti5Bb+DnHinOS4O4C+RbQJe5PF0bdrJb701MnicCOktbebK0Ql4dYtxRK6EcAw/XPrhqO0/IdHrgZGs9ffMboTnbvaRGQd8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406255; c=relaxed/simple; bh=uliAgvjhsAMzYZC0t7Pa1a1e6Md9IR252MVQ77hako0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GRxO/Ok/k1QrtGX8fWuJv1ABD4jA0p+XaaLt0GyTnzPstJmIun97EFrW1F9VaEf5Pq72FLcKLP+0pJUPm76g1i1A974le70yWLh9uWZoO/woZZ1D068xG6B0SnyUqyyQZxBgxGAIV1sAwXwvb7vajzidcdw2+Um8yKDl3Nr7jQQ= 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=OE1Gdapf; arc=none smtp.client-ip=209.85.167.176 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="OE1Gdapf" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3c8641b41e7so850349b6e.3 for ; Mon, 29 Apr 2024 08:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714406253; x=1715011053; 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=0XVJbL8UZouE2EyL/H28wnWIf+TCjgp/mCRYks9znNY=; b=OE1GdapfFzRLxaZntQJRL46QWa8Tbuamc6sfzVAONUEVQrqoc02yHTEINjL5DT0Trb cnO2PhjCfmC+oaK7iJY0vUNndmWSvZHHDreIaVdU7Uxly4Vpx4gN4AdIc4ZIwGpRi7gf rmurRS7D0rIwgOM6X1sLFYrLnA4kZ5e/Off+a6YLXs4MvCP7DJkHcFfwqDhnHI2Oz51v IeSm4kQeH5f9+ZSihpCFlAg+2cXdJdFUDKkbA3by2YCUvKYTeTA42VhCoQRRLIh/rO7v EC7sV2UrwrtVrnT6v+xQ+8uVUytdypoxQzLWDELTxg5rp/4NFcjsqDBofaaIKWHgUnet k4sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714406253; x=1715011053; 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=0XVJbL8UZouE2EyL/H28wnWIf+TCjgp/mCRYks9znNY=; b=sOjRunuRaO9UslYkM3kbX6UtHebLUj5hoITz2va+G8zh7SMDRRNAtDgaz2oI3eNQ0D E1X0f/k6q+KjCiB7Sh8Rhbr1RrbH6QXe5a8KjvRgRC+nidULC2B62mUae/r2AzXi3JDy nl6GFCH69VVj/QhzawOtYsqr82Ybbgnm7EUJAmCpM2bATjdSORhSvkEIQrbd9EG/IUnU 0aXbnRgYUW/oYcrcuLRSyezCRA3ZbWfovMh5GIL50Iez97H9xeSw3rlpGJh38yugKJOf 4keLq2R17NaJM8lEOCAevCvQrOc4uHzy9PK5Xis81a5rEFFUFG+637LzrGpBTLiPJokL DKCw== X-Gm-Message-State: AOJu0YwVSDnjCHVSuGwhkcEyf5nRLWOgorMiY1p95Ew/s/hmq15p/rvS zn+azhxJk5o1LgbjO6gw8YfNco5b2EQJmN/cUaaMlizM60flrXo6zcuB+g== X-Google-Smtp-Source: AGHT+IEgj6AYtzVNjvz187L3jmlCxwGo13xg5o47yG/eUAb3Hzugce83kh2cEFTWp+awMPK3ksGEEg== X-Received: by 2002:a05:6808:1912:b0:3c7:49c2:e364 with SMTP id bf18-20020a056808191200b003c749c2e364mr332310oib.11.1714406253008; Mon, 29 Apr 2024 08:57:33 -0700 (PDT) Received: from localhost.localdomain ([70.114.247.242]) by smtp.gmail.com with ESMTPSA id bf29-20020a056808191d00b003c7443c0efasm3117820oib.1.2024.04.29.08.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:57:32 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 6/6] udevng: Support Quectel RM502Q Date: Mon, 29 Apr 2024 10:56:58 -0500 Message-ID: <20240429155726.51479-6-denkenz@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429155726.51479-1-denkenz@gmail.com> References: <20240429155726.51479-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 [37312.033140] usb 4-1: New USB device found, idVendor=2c7c, idProduct=0800, bcdDevice= 4.14 [37312.033149] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [37312.033151] usb 4-1: Product: RM502Q-AE [37312.033153] usb 4-1: Manufacturer: Quectel --- plugins/udevng.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/udevng.c b/plugins/udevng.c index 1aa9f2e4b4b0..b9d115f16b7d 100644 --- a/plugins/udevng.c +++ b/plugins/udevng.c @@ -2053,6 +2053,9 @@ static struct { { "quectelqmi", "qcserial", "2c7c", "0195" }, { "quectelqmi", "qmi_wwan", "2c7c", "0296" }, { "quectelqmi", "qcserial", "2c7c", "0296" }, + { "quectelqmi", "qmi_wwan", "2c7c", "0800" }, + { "quectelqmi", "qcserial", "2c7c", "0800" }, + { "quectelqmi", "option", "2c7c", "0800" }, { "quectelqmi", "qmi_wwan_q", "2c7c", "0452" }, { "ublox", "cdc_acm", "1546", "1010" }, { "ublox", "cdc_ncm", "1546", "1010" },