summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-02-17 19:37:23 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-02-17 19:37:23 +0100
commit9d816b46e6f2b707b6f91f1363f9c890c1ebf659 (patch)
tree1ff3836536cd27a9dde51ed8f6d09836a1f8bbd6
parent1be9ca91ee992982ac2b48b08d4a6f872c28a7bd (diff)
implement the start network command
-rw-r--r--commands-wds.c20
-rw-r--r--commands-wds.h14
2 files changed, 28 insertions, 6 deletions
diff --git a/commands-wds.c b/commands-wds.c
index 7774114..3b27bfd 100644
--- a/commands-wds.c
+++ b/commands-wds.c
@@ -1,3 +1,5 @@
+#include "qmi-message.h"
+
static struct qmi_wds_start_network_request wds_sn_req = {
QMI_INIT(authentication_preference,
QMI_WDS_AUTHENTICATION_PAP | QMI_WDS_AUTHENTICATION_CHAP),
@@ -45,3 +47,21 @@ cmd_wds_set_password_prepare(struct qmi_dev *qmi, struct qmi_request *req, struc
qmi_set_ptr(&wds_sn_req, password, arg);
return QMI_CMD_DONE;
}
+
+static void
+cmd_wds_start_network_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
+{
+ struct qmi_wds_start_network_response res;
+
+ qmi_parse_wds_start_network_response(msg, &res);
+ if (res.set.packet_data_handle)
+ blobmsg_add_u32(&status, "handle", res.data.packet_data_handle);
+}
+
+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 2374f85..b6198c2 100644
--- a/commands-wds.h
+++ b/commands-wds.h
@@ -1,10 +1,12 @@
#define __uqmi_wds_commands \
- __uqmi_command(wds_set_auth, set-auth, required, QMI_SERVICE_WDS), \
- __uqmi_command(wds_set_username, set-username, required, QMI_SERVICE_WDS), \
- __uqmi_command(wds_set_password, set-password, required, QMI_SERVICE_WDS)
+ __uqmi_command(wds_start_network, start-network, required, QMI_SERVICE_WDS), \
+ __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)
#define wds_helptext \
- " --set-auth pap|chap|both|none: Set network authentication type\n" \
- " --set-username: Set network username\n" \
- " --set-password: Set network password\n" \
+ " --start-network <apn>: Start network connection (use with options below)\n" \
+ " --auth-type pap|chap|both|none: Use network authentication type\n" \
+ " --username <name>: Use network username\n" \
+ " --password <password>: Use network password\n" \