From: Denis Kenzior <denkenz@gmail.com>
To: ofono@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH 08/13] gobi: Remove support for qmi_wwan_q
Date: Thu, 31 Oct 2024 17:06:15 -0500 [thread overview]
Message-ID: <20241031220638.1582166-8-denkenz@gmail.com> (raw)
In-Reply-To: <20241031220638.1582166-1-denkenz@gmail.com>
Focus this driver purely on qmi_wwan and its quirks. This simplifies
the logic considerably.
---
plugins/gobi.c | 60 +++++++++++---------------------------------------
1 file changed, 13 insertions(+), 47 deletions(-)
diff --git a/plugins/gobi.c b/plugins/gobi.c
index b2c9c3d50ea4..5c3ae0737a15 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -88,8 +88,6 @@ struct gobi_data {
uint32_t max_aggregation_size;
uint32_t set_powered_id;
bool using_mux : 1;
- bool using_qmi_wwan : 1;
- bool using_qmi_wwan_q : 1;
};
static void gobi_debug(const char *str, void *user_data)
@@ -111,15 +109,15 @@ static void gobi_io_debug(const char *str, void *user_data)
* in order to initialize the driver properly:
*
* NetworkInterface
- * The string that contains the 'main' network device. This can be
- * "rmnet_ipa" on SoC systems, or "wwan0" for upstream linux systems.
+ * The string that contains the 'main' network device. This is typically
+ * 'wwanX' on upstream linux systems.
*
* NetworkInterfaceIndex
* The index of the main interface given by NetworkInterface
*
* NetworkInterfaceKernelDriver
- * The kernel driver that is being used by the main network device. Certain
- * drivers such as 'qmi_wwan' or 'qmi_wwan_q' are treated specifically.
+ * The kernel driver that is being used by the main network device. Only
+ * 'qmi_wwan' is supported.
*
* Bus
* The bus of the modem. Values can be "usb", "embedded", or "pci"
@@ -131,7 +129,6 @@ static int gobi_probe(struct ofono_modem *modem)
const char *ifname;
int ifindex;
const char *bus;
- int n_premux;
DBG("%p", modem);
@@ -140,32 +137,22 @@ static int gobi_probe(struct ofono_modem *modem)
ifname = ofono_modem_get_string(modem, "NetworkInterface");
ifindex = ofono_modem_get_integer(modem, "NetworkInterfaceIndex");
bus = ofono_modem_get_string(modem, "Bus");
- n_premux = ofono_modem_get_integer(modem, "NumPremuxInterfaces");
DBG("net: %s[%s](%d) %s", ifname, if_driver, ifindex, bus);
- if (!if_driver || !ifname || !ifindex || !bus || n_premux < 0)
+ if (!if_driver || !ifname || !ifindex || !bus)
return -EPROTO;
- data = l_new(struct gobi_data, 1);
-
- if (!strcmp(if_driver, "qmi_wwan_q"))
- data->using_qmi_wwan_q = true;
- else if (!strcmp(if_driver, "qmi_wwan"))
- data->using_qmi_wwan = true;
-
- if (n_premux > MAX_CONTEXTS) {
- l_warn("NumPremuxInterfaces > %d, limiting to %d",
- MAX_CONTEXTS, MAX_CONTEXTS);
- n_premux = MAX_CONTEXTS;
- }
+ if (!L_IN_STRSET(if_driver, "qmi_wwan"))
+ return -ENOTSUP;
- data->n_premux = n_premux;
+ data = l_new(struct gobi_data, 1);
data->main_net_ifindex =
ofono_modem_get_integer(modem, "NetworkInterfaceIndex");
l_strlcpy(data->main_net_name,
ofono_modem_get_string(modem, "NetworkInterface"),
sizeof(data->main_net_name));
+
ofono_modem_set_data(modem, data);
ofono_modem_set_capabilities(modem, OFONO_MODEM_CAPABILITY_LTE);
@@ -423,12 +410,7 @@ static void get_data_format_cb(struct qmi_result *result, void *user_data)
if (!qmi_result_get_uint32(result, QMI_WDA_LL_PROTOCOL, &llproto))
goto done;
- if (data->using_qmi_wwan) {
- const char *interface =
- ofono_modem_get_string(modem, "NetworkInterface");
-
- setup_qmi_wwan(interface, llproto);
- }
+ setup_qmi_wwan(data->main_net_name, llproto);
done:
if (qmi_service_send(data->dms, QMI_DMS_GET_CAPS, NULL,
@@ -674,10 +656,6 @@ static void powered_up_cb(int error, uint16_t type,
if (!param)
goto error;
- if (data->using_qmi_wwan_q)
- l_sysctl_set_u32(1, "/sys/class/net/%s/link_state",
- data->main_net_name);
-
cb_data_ref(cbd);
if (qmi_service_send(data->dms, QMI_DMS_SET_OPER_MODE, param,
@@ -711,10 +689,6 @@ static void powered_down_cb(int error, uint16_t type,
if (!param)
goto error;
- if (data->using_qmi_wwan_q)
- l_sysctl_set_u32(0, "/sys/class/net/%s/link_state",
- data->main_net_name);
-
cb_data_ref(cbd);
if (qmi_service_send(data->dms, QMI_DMS_SET_OPER_MODE, param,
@@ -792,8 +766,6 @@ static void gobi_setup_gprs(struct ofono_modem *modem)
struct gobi_data *data = ofono_modem_get_data(modem);
struct ofono_gprs *gprs;
struct ofono_gprs_context *gc;
- const char *interface;
- char buf[256];
int i;
gprs = ofono_gprs_create(modem, 0, "qmimodem",
@@ -810,8 +782,6 @@ static void gobi_setup_gprs(struct ofono_modem *modem)
struct qmi_service *ipv4 = data->context_services[0].wds_ipv4;
struct qmi_service *ipv6 = data->context_services[0].wds_ipv6;
- interface = ofono_modem_get_string(modem, "NetworkInterface");
-
gc = ofono_gprs_context_create(modem, 0, "qmimodem", -1,
qmi_service_clone(ipv4),
qmi_service_clone(ipv6));
@@ -822,20 +792,16 @@ static void gobi_setup_gprs(struct ofono_modem *modem)
}
ofono_gprs_add_context(gprs, gc);
- ofono_gprs_context_set_interface(gc, interface);
+ ofono_gprs_context_set_interface(gc, data->main_net_name);
return;
}
- data->using_mux = true;
-
- data->max_aggregation_size =
- ofono_modem_get_integer(modem, "MaxAggregationSize");
- DBG("max_aggregation_size: %u", data->max_aggregation_size);
-
for (i = 0; i < data->n_premux; i++) {
struct qmi_service *ipv4 = data->context_services[i].wds_ipv4;
struct qmi_service *ipv6 = data->context_services[i].wds_ipv6;
+ const char *interface;
+ char buf[256];
int mux_id;
sprintf(buf, "PremuxInterface%dMuxId", i + 1);
--
2.45.2
next prev parent reply other threads:[~2024-10-31 22:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 22:06 [PATCH 01/13] qmi: validate TLV length Denis Kenzior
2024-10-31 22:06 ` [PATCH 02/13] gobi: Clear out service request queue on shutdown Denis Kenzior
2024-10-31 22:06 ` [PATCH 03/13] simutil: Return early if file is not found Denis Kenzior
2024-10-31 22:06 ` [PATCH 04/13] simfs: Quiet sanitizer runtime error Denis Kenzior
2024-10-31 22:06 ` [PATCH 05/13] radio-settings: quiet " Denis Kenzior
2024-10-31 22:06 ` [PATCH 06/13] gprs: Default CID range to 1..NUM_CONTEXTS -1 Denis Kenzior
2024-10-31 22:06 ` [PATCH 07/13] qmimodem: Drop call to ofono_gprs_set_cid_range Denis Kenzior
2024-10-31 22:06 ` Denis Kenzior [this message]
2024-10-31 22:06 ` [PATCH 09/13] udevng: Remove non-upstream qmi_wwan_q support Denis Kenzior
2024-10-31 22:06 ` [PATCH 10/13] gobi: Bring down the main interface at startup Denis Kenzior
2024-10-31 22:06 ` [PATCH 11/13] gobi: Support only "usb" Bus values Denis Kenzior
2024-10-31 22:06 ` [PATCH 12/13] gobi: document and validate "interfaceNumber" Denis Kenzior
2024-10-31 22:06 ` [PATCH 13/13] qmi: wda: Convert #defines to an enum Denis Kenzior
2024-11-04 22:20 ` [PATCH 01/13] qmi: validate TLV length patchwork-bot+ofono
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241031220638.1582166-8-denkenz@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.