iowpa.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. * File: iowpa.h
  20. *
  21. * Purpose: Handles wpa supplicant ioctl interface
  22. *
  23. * Author: Lyndon Chen
  24. *
  25. * Date: May 8, 2002
  26. *
  27. */
  28. #ifndef __IOWPA_H__
  29. #define __IOWPA_H__
  30. #define WPA_IE_LEN 64
  31. //WPA related
  32. enum {
  33. VIAWGET_SET_WPA = 1,
  34. VIAWGET_SET_KEY = 2,
  35. VIAWGET_SET_SCAN = 3,
  36. VIAWGET_GET_SCAN = 4,
  37. VIAWGET_GET_SSID = 5,
  38. VIAWGET_GET_BSSID = 6,
  39. VIAWGET_SET_DROP_UNENCRYPT = 7,
  40. VIAWGET_SET_DEAUTHENTICATE = 8,
  41. VIAWGET_SET_ASSOCIATE = 9,
  42. VIAWGET_SET_DISASSOCIATE = 10
  43. };
  44. enum {
  45. VIAWGET_ASSOC_MSG = 1,
  46. VIAWGET_DISASSOC_MSG = 2,
  47. VIAWGET_PTK_MIC_MSG = 3,
  48. VIAWGET_GTK_MIC_MSG = 4,
  49. VIAWGET_CCKM_ROAM_MSG = 5,
  50. VIAWGET_DEVICECLOSE_MSG = 6
  51. };
  52. #pragma pack(1)
  53. typedef struct viawget_wpa_header {
  54. u8 type;
  55. u16 req_ie_len;
  56. u16 resp_ie_len;
  57. } viawget_wpa_header;
  58. struct viawget_wpa_param {
  59. u32 cmd;
  60. u8 addr[6];
  61. union {
  62. struct {
  63. u8 len;
  64. u8 data[0];
  65. } generic_elem;
  66. struct {
  67. u8 bssid[6];
  68. u8 ssid[32];
  69. u8 ssid_len;
  70. u8 __user *wpa_ie;
  71. u16 wpa_ie_len;
  72. int pairwise_suite;
  73. int group_suite;
  74. int key_mgmt_suite;
  75. int auth_alg;
  76. int mode;
  77. } wpa_associate;
  78. struct {
  79. int alg_name;
  80. u16 key_index;
  81. u16 set_tx;
  82. u8 *seq;
  83. u16 seq_len;
  84. u8 *key;
  85. u16 key_len;
  86. } wpa_key;
  87. struct {
  88. u8 ssid_len;
  89. u8 ssid[32];
  90. } scan_req;
  91. struct {
  92. u16 scan_count;
  93. u8 __user *buf;
  94. } scan_results;
  95. } u;
  96. };
  97. #pragma pack(1)
  98. struct viawget_scan_result {
  99. u8 bssid[6];
  100. u8 ssid[32];
  101. u16 ssid_len;
  102. u8 wpa_ie[WPA_IE_LEN];
  103. u16 wpa_ie_len;
  104. u8 rsn_ie[WPA_IE_LEN];
  105. u16 rsn_ie_len;
  106. int freq; // MHz
  107. int caps; // e.g. privacy
  108. int qual; // signal quality
  109. int noise;
  110. int level;
  111. int maxrate;
  112. };
  113. #pragma pack()
  114. #endif //__IOWPA_H__