wds: add option for specifying profile index
authorMatti Laakso <malaakso@elisanet.fi>
Sun, 20 Nov 2016 21:27:33 +0000 (23:27 +0200)
committerJohn Crispin <john@phrozen.org>
Mon, 21 Nov 2016 10:01:58 +0000 (11:01 +0100)
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 <malaakso@elisanet.fi>
commands-wds.c
commands-wds.h

index 26c9f594963879d9eace3e5dc5dd029b7a6eafa0..34b1c9f78bfd49cfec2a3041778a749696f66935 100644 (file)
@@ -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)
 {
index 3076bae2d94b55bcc245c1e045ca7716be8c6b12..de025d78669e5ccc9e214dffa2d7bf2b2d47ab78 100644 (file)
@@ -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 <password>:          Use network password\n" \
                "    --ip-family <family>:           Use ip-family for the connection (ipv4, ipv6, unspecified)\n" \
                "    --autoconnect:                  Enable automatic connect/reconnect\n" \
+               "    --profile <index>:              Use connection profile\n" \
                "  --stop-network <pdh>:             Stop network connection (use with option below)\n" \
                "    --autoconnect:                  Disable automatic connect/reconnect\n" \
                "  --get-data-status:                Get current data access status\n" \