[LEDE-DEV] [PATCH][uqmi 3/5] wds: make APN optional

Matti Laakso malaakso at elisanet.fi
Sun Nov 20 13:27:32 PST 2016


Some modem firmwares do not use the APN selected in the Start
Network command. Moreover, it is marked optional in the QMI
specification.

Signed-off-by: Matti Laakso <malaakso at elisanet.fi>
---
 commands-wds.c | 9 ++++++++-
 commands-wds.h | 6 ++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/commands-wds.c b/commands-wds.c
index 7bb75da..26c9f59 100644
--- a/commands-wds.c
+++ b/commands-wds.c
@@ -30,6 +30,14 @@ static struct qmi_wds_start_network_request wds_sn_req = {
 };
 static struct qmi_wds_stop_network_request wds_stn_req;
 
+#define cmd_wds_set_apn_cb no_cb
+static enum qmi_cmd_result
+cmd_wds_set_apn_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+	qmi_set_ptr(&wds_sn_req, apn, arg);
+	return QMI_CMD_DONE;
+}
+
 #define cmd_wds_set_auth_cb no_cb
 static enum qmi_cmd_result
 cmd_wds_set_auth_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
@@ -121,7 +129,6 @@ cmd_wds_start_network_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qm
 static enum qmi_cmd_result
 cmd_wds_start_network_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
 {
-	qmi_set_ptr(&wds_sn_req, apn, arg);
 	qmi_set_wds_start_network_request(msg, &wds_sn_req);
 	return QMI_CMD_REQUEST;
 }
diff --git a/commands-wds.h b/commands-wds.h
index c603f79..3076bae 100644
--- a/commands-wds.h
+++ b/commands-wds.h
@@ -20,7 +20,8 @@
  */
 
 #define __uqmi_wds_commands \
-	__uqmi_command(wds_start_network, start-network, required, QMI_SERVICE_WDS), \
+	__uqmi_command(wds_start_network, start-network, no, QMI_SERVICE_WDS), \
+	__uqmi_command(wds_set_apn, apn, required, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_set_auth, auth-type, required, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_set_username, username, required, CMD_TYPE_OPTION), \
 	__uqmi_command(wds_set_password, password, required, CMD_TYPE_OPTION), \
@@ -35,7 +36,8 @@
 
 
 #define wds_helptext \
-		"  --start-network <apn>:            Start network connection (use with options below)\n" \
+		"  --start-network:                  Start network connection (use with options below)\n" \
+		"    --apn <apn>:                    Use APN\n" \
 		"    --auth-type pap|chap|both|none: Use network authentication type\n" \
 		"    --username <name>:              Use network username\n" \
 		"    --password <password>:          Use network password\n" \
-- 
2.7.4




More information about the Lede-dev mailing list