aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus
diff options
context:
space:
mode:
authorNishant Chaprana <n.chaprana@samsung.com>2017-04-13 12:09:01 (GMT)
committerJouni Malinen <j@w1.fi>2017-05-07 19:08:43 (GMT)
commit9f49474669e17cddcce9cfd7d962c950008872bc (patch)
tree666c0c1e69be4d0ab591fe5959f03d923939c052 /wpa_supplicant/dbus
parent2a57b4b821227b66d2c304010aefb31a0e7eb609 (diff)
downloadhostap-9f49474669e17cddcce9cfd7d962c950008872bc.zip
hostap-9f49474669e17cddcce9cfd7d962c950008872bc.tar.gz
hostap-9f49474669e17cddcce9cfd7d962c950008872bc.tar.bz2
dbus: Add method to disable channel switching with a TDLS peer
This patch adds "TDLSCancelChannelSwitch" dbus method on "fi.w1.wpa_supplicant1.Interface" interface to disable channel switching with a TDLS peer. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
Diffstat (limited to 'wpa_supplicant/dbus')
-rw-r--r--wpa_supplicant/dbus/dbus_new.c7
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c31
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.h3
3 files changed, 41 insertions, 0 deletions
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index 2420984..393cdd4 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -3093,6 +3093,13 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
END_ARGS
}
},
+ { "TDLSCancelChannelSwitch", WPAS_DBUS_NEW_IFACE_INTERFACE,
+ (WPADBusMethodHandler) wpas_dbus_handler_tdls_cancel_channel_switch,
+ {
+ { "peer_address", "s", ARG_IN },
+ END_ARGS
+ }
+ },
#endif /* CONFIG_TDLS */
{ "VendorElemAdd", WPAS_DBUS_NEW_IFACE_INTERFACE,
(WPADBusMethodHandler) wpas_dbus_handler_vendor_elem_add,
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 65a6a0f..63f787a 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -2432,6 +2432,37 @@ wpas_dbus_handler_tdls_channel_switch(DBusMessage *message,
return NULL;
}
+/*
+ * wpas_dbus_handler_tdls_cancel_channel_switch - Disable channel switching with TDLS peer
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: wpa_supplicant structure for a network interface
+ * Returns: NULL indicating success or DBus error message on failure
+ *
+ * Handler function for "TDLSCancelChannelSwitch" method call of network
+ * interface.
+ */
+DBusMessage *
+wpas_dbus_handler_tdls_cancel_channel_switch(DBusMessage *message,
+ struct wpa_supplicant *wpa_s)
+{
+ u8 peer[ETH_ALEN];
+ DBusMessage *error_reply;
+ int ret;
+
+ if (get_peer_hwaddr_helper(message, __func__, peer, &error_reply) < 0)
+ return error_reply;
+
+ wpa_printf(MSG_DEBUG, "dbus: TDLS_CANCEL_CHAN_SWITCH " MACSTR,
+ MAC2STR(peer));
+
+ ret = wpa_tdls_disable_chan_switch(wpa_s->wpa, peer);
+ if (ret)
+ return wpas_dbus_error_unknown_error(
+ message, "error canceling TDLS channel switch");
+
+ return NULL;
+}
+
#endif /* CONFIG_TDLS */
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h b/wpa_supplicant/dbus/dbus_new_handlers.h
index 8ce289f..7d3c3b1 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.h
+++ b/wpa_supplicant/dbus/dbus_new_handlers.h
@@ -219,6 +219,9 @@ DBusMessage * wpas_dbus_handler_tdls_teardown(DBusMessage *message,
DBusMessage *
wpas_dbus_handler_tdls_channel_switch(DBusMessage *message,
struct wpa_supplicant *wpa_s);
+DBusMessage *
+wpas_dbus_handler_tdls_cancel_channel_switch(DBusMessage *message,
+ struct wpa_supplicant *wpa_s);
DBusMessage * wpas_dbus_handler_vendor_elem_add(DBusMessage *message,
struct wpa_supplicant *wpa_s);