From b9703ad62627caa8a1aa780334eaa3af1d807751 Mon Sep 17 00:00:00 2001 From: Matti Laakso Date: Sun, 20 Nov 2016 23:27:33 +0200 Subject: [PATCH] wds: add option for specifying profile index Some modems require the specification of a profile index which determines the APN and the IP family used for the connection. Signed-off-by: Matti Laakso --- commands-wds.c | 10 ++++++++++ commands-wds.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/commands-wds.c b/commands-wds.c index 26c9f59..34b1c9f 100644 --- a/commands-wds.c +++ b/commands-wds.c @@ -116,6 +116,16 @@ cmd_wds_set_ip_family_pref_prepare(struct qmi_dev *qmi, struct qmi_request *req, return QMI_CMD_EXIT; } +#define cmd_wds_set_profile_cb no_cb +static enum qmi_cmd_result +cmd_wds_set_profile_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg) +{ + uint32_t idx = strtoul(arg, NULL, 10); + + qmi_set(&wds_sn_req, profile_index_3gpp, idx); + return QMI_CMD_DONE; +} + static void cmd_wds_start_network_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg) { diff --git a/commands-wds.h b/commands-wds.h index 3076bae..de025d7 100644 --- a/commands-wds.h +++ b/commands-wds.h @@ -27,6 +27,7 @@ __uqmi_command(wds_set_password, password, required, CMD_TYPE_OPTION), \ __uqmi_command(wds_set_ip_family_pref, ip-family, required, CMD_TYPE_OPTION), \ __uqmi_command(wds_set_autoconnect, autoconnect, no, CMD_TYPE_OPTION), \ + __uqmi_command(wds_set_profile, profile, required, CMD_TYPE_OPTION), \ __uqmi_command(wds_stop_network, stop-network, required, QMI_SERVICE_WDS), \ __uqmi_command(wds_get_packet_service_status, get-data-status, no, QMI_SERVICE_WDS), \ __uqmi_command(wds_set_ip_family, set-ip-family, required, QMI_SERVICE_WDS), \ @@ -43,6 +44,7 @@ " --password : Use network password\n" \ " --ip-family : Use ip-family for the connection (ipv4, ipv6, unspecified)\n" \ " --autoconnect: Enable automatic connect/reconnect\n" \ + " --profile : Use connection profile\n" \ " --stop-network : Stop network connection (use with option below)\n" \ " --autoconnect: Disable automatic connect/reconnect\n" \ " --get-data-status: Get current data access status\n" \ -- 2.25.1