3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-17 17:39:28 +01:00

wiphy: Add enumeration of reason codes

When disconnecting, use a properly documented reason code.  These codes
come from the ieee80211.h file which is part of the Linux Kernel.
This commit is contained in:
Jukka Rissanen 2015-03-12 10:47:22 +02:00 committed by Denis Kenzior
parent 279ed50441
commit 56c4dc1a8c

View File

@ -91,6 +91,66 @@ struct wiphy {
static struct l_queue *wiphy_list = NULL;
/*
* WLAN reason codes from Linux kernel ieee80211.h file.
*/
enum ieee80211_reasoncode {
WLAN_REASON_UNSPECIFIED = 1,
WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
WLAN_REASON_DEAUTH_LEAVING = 3,
WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
WLAN_REASON_DISASSOC_AP_BUSY = 5,
WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
/* 802.11h */
WLAN_REASON_DISASSOC_BAD_POWER = 10,
WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
/* 802.11i */
WLAN_REASON_INVALID_IE = 13,
WLAN_REASON_MIC_FAILURE = 14,
WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
WLAN_REASON_IE_DIFFERENT = 17,
WLAN_REASON_INVALID_GROUP_CIPHER = 18,
WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
WLAN_REASON_INVALID_AKMP = 20,
WLAN_REASON_UNSUPP_RSN_VERSION = 21,
WLAN_REASON_INVALID_RSN_IE_CAP = 22,
WLAN_REASON_IEEE8021X_FAILED = 23,
WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
/* TDLS (802.11z) */
WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE = 25,
WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED = 26,
/* 802.11e */
WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32,
WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33,
WLAN_REASON_DISASSOC_LOW_ACK = 34,
WLAN_REASON_DISASSOC_QAP_EXCEED_TXOP = 35,
WLAN_REASON_QSTA_LEAVE_QBSS = 36,
WLAN_REASON_QSTA_NOT_USE = 37,
WLAN_REASON_QSTA_REQUIRE_SETUP = 38,
WLAN_REASON_QSTA_TIMEOUT = 39,
WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45,
/* 802.11s */
WLAN_REASON_MESH_PEER_CANCELED = 52,
WLAN_REASON_MESH_MAX_PEERS = 53,
WLAN_REASON_MESH_CONFIG = 54,
WLAN_REASON_MESH_CLOSE = 55,
WLAN_REASON_MESH_MAX_RETRIES = 56,
WLAN_REASON_MESH_CONFIRM_TIMEOUT = 57,
WLAN_REASON_MESH_INVALID_GTK = 58,
WLAN_REASON_MESH_INCONSISTENT_PARAM = 59,
WLAN_REASON_MESH_INVALID_SECURITY = 60,
WLAN_REASON_MESH_PATH_ERROR = 61,
WLAN_REASON_MESH_PATH_NOFORWARD = 62,
WLAN_REASON_MESH_PATH_DEST_UNREACHABLE = 63,
WLAN_REASON_MAC_EXISTS_IN_MBSS = 64,
WLAN_REASON_MESH_CHAN_REGULATORY = 65,
WLAN_REASON_MESH_CHAN = 66,
};
static void do_debug(const char *str, void *user_data)
{
const char *prefix = user_data;
@ -562,7 +622,7 @@ static struct l_dbus_message *device_disconnect(struct l_dbus *dbus,
{
struct netdev *netdev = user_data;
struct l_genl_msg *msg;
uint16_t reason_code = 3;
uint16_t reason_code = WLAN_REASON_DEAUTH_LEAVING;
l_debug("");