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>
This commit is contained in:
Nishant Chaprana 2017-04-13 17:39:01 +05:30 committed by Jouni Malinen
parent 2a57b4b821
commit 9f49474669
4 changed files with 50 additions and 0 deletions

View file

@ -464,6 +464,15 @@ fi.w1.wpa_supplicant1.CreateInterface.
<dd>A dictionary with arguments identifying the peer and channel switching behavior.</dd> <dd>A dictionary with arguments identifying the peer and channel switching behavior.</dd>
</dl> </dl>
</li> </li>
<li>
<h3>TDLSCancelChannelSwitch ( s : peer_address ) --> nothing</h3>
<p>Disable channel switching for a TDLS session with a peer.</p>
<h4>Arguments</h4>
<dl>
<dt>s : peer_address</dt>
<dd>MAC address for the peer.</dd>
</dl>
</li>
<li> <li>
<h3>VendorElemAdd ( i: frame_id, ay: ielems ) --> nothing</h3> <h3>VendorElemAdd ( i: frame_id, ay: ielems ) --> nothing</h3>
<p>Add Vendor Elements to corresponding frame ID.</p> <p>Add Vendor Elements to corresponding frame ID.</p>

View file

@ -3093,6 +3093,13 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
END_ARGS 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 */ #endif /* CONFIG_TDLS */
{ "VendorElemAdd", WPAS_DBUS_NEW_IFACE_INTERFACE, { "VendorElemAdd", WPAS_DBUS_NEW_IFACE_INTERFACE,
(WPADBusMethodHandler) wpas_dbus_handler_vendor_elem_add, (WPADBusMethodHandler) wpas_dbus_handler_vendor_elem_add,

View file

@ -2432,6 +2432,37 @@ wpas_dbus_handler_tdls_channel_switch(DBusMessage *message,
return NULL; 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 */ #endif /* CONFIG_TDLS */

View file

@ -219,6 +219,9 @@ DBusMessage * wpas_dbus_handler_tdls_teardown(DBusMessage *message,
DBusMessage * DBusMessage *
wpas_dbus_handler_tdls_channel_switch(DBusMessage *message, wpas_dbus_handler_tdls_channel_switch(DBusMessage *message,
struct wpa_supplicant *wpa_s); 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, DBusMessage * wpas_dbus_handler_vendor_elem_add(DBusMessage *message,
struct wpa_supplicant *wpa_s); struct wpa_supplicant *wpa_s);