From: Matti Laakso Date: Sun, 20 Nov 2016 21:27:32 +0000 (+0200) Subject: wds: make APN optional X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=423a7e9c9448a247e121a9e79f9ac1a1e8bb5e56;p=oweals%2Fuqmi.git wds: make APN optional 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 --- 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 : Start network connection (use with options below)\n" \ + " --start-network: Start network connection (use with options below)\n" \ + " --apn : Use APN\n" \ " --auth-type pap|chap|both|none: Use network authentication type\n" \ " --username : Use network username\n" \ " --password : Use network password\n" \