PageRenderTime 81ms CodeModel.GetById 36ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/staging/rtl8723au/include/wlan_bssdef.h

https://bitbucket.org/bendikro/net-next-rdb
C Header | 140 lines | 93 code | 18 blank | 29 comment | 0 complexity | f1683708ff58af469d2ab7ead8b64e3f MD5 | raw file
Possible License(s): LGPL-2.0, AGPL-1.0, GPL-2.0
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. ******************************************************************************/
  15. #ifndef __WLAN_BSSDEF_H__
  16. #define __WLAN_BSSDEF_H__
  17. #define MAX_IE_SZ 768
  18. #define NDIS_802_11_LENGTH_RATES 8
  19. #define NDIS_802_11_LENGTH_RATES_EX 16
  20. /* Length is the 4 bytes multiples of the sum of
  21. * sizeof(6 * sizeof(unsigned char)) + 2 + sizeof(struct ndis_802_11_ssid) +
  22. * sizeof(u32) + sizeof(long) + sizeof(enum ndis_802_11_net_type) +
  23. * sizeof(struct ndis_802_11_config) + sizeof(sizeof(unsigned char) *
  24. * NDIS_802_11_LENGTH_RATES_EX) + IELength
  25. *
  26. * Except the IELength, all other fields are fixed length. Therefore,
  27. * we can define a macro to present the partial sum.
  28. */
  29. enum ndis_802_11_auth_mode {
  30. Ndis802_11AuthModeOpen,
  31. Ndis802_11AuthModeShared,
  32. Ndis802_11AuthModeAutoSwitch,
  33. Ndis802_11AuthModeWPA,
  34. Ndis802_11AuthModeWPAPSK,
  35. Ndis802_11AuthModeWPANone,
  36. dis802_11AuthModeMax /* upper bound */
  37. };
  38. enum {
  39. Ndis802_11WEPEnabled,
  40. Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
  41. Ndis802_11WEPDisabled,
  42. Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
  43. Ndis802_11WEPKeyAbsent,
  44. Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
  45. Ndis802_11WEPNotSupported,
  46. Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
  47. Ndis802_11Encryption2Enabled,
  48. Ndis802_11Encryption2KeyAbsent,
  49. Ndis802_11Encryption3Enabled,
  50. Ndis802_11Encryption3KeyAbsent,
  51. };
  52. /* Key mapping keys require a BSSID */
  53. struct ndis_802_11_key {
  54. u32 Length; /* Length of this structure */
  55. u32 KeyIndex;
  56. u32 KeyLength; /* length of key in bytes */
  57. unsigned char BSSID[6];
  58. unsigned long long KeyRSC;
  59. u8 KeyMaterial[32]; /* variable length depending on above field */
  60. };
  61. struct wlan_phy_info {
  62. u8 SignalStrength;/* in percentage) */
  63. u8 SignalQuality;/* in percentage) */
  64. u8 Optimum_antenna; /* for Antenna diversity */
  65. u8 Reserved_0;
  66. };
  67. struct wlan_bcn_info {
  68. /* these infor get from rtw_get_encrypt_info when
  69. * * translate scan to UI */
  70. u8 encryp_protocol;/* ENCRYP_PROTOCOL_E: OPEN/WEP/WPA/WPA2 */
  71. int group_cipher; /* WPA/WPA2 group cipher */
  72. int pairwise_cipher;/* WPA/WPA2/WEP pairwise cipher */
  73. int is_8021x;
  74. /* bwmode 20/40 and ch_offset UP/LOW */
  75. unsigned short ht_cap_info;
  76. unsigned char ht_info_infos_0;
  77. };
  78. struct wlan_bssid_ex {
  79. u32 Length;
  80. u8 MacAddress[ETH_ALEN];
  81. u16 reserved;
  82. struct cfg80211_ssid Ssid;
  83. u32 Privacy;
  84. long Rssi;/* in dBM, raw data , get from PHY) */
  85. u16 BeaconPeriod; /* units are Kusec */
  86. u32 ATIMWindow; /* units are Kusec */
  87. u32 DSConfig; /* Frequency, units are kHz */
  88. enum nl80211_iftype ifmode;
  89. unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
  90. struct wlan_phy_info PhyInfo;
  91. u32 IELength;
  92. u8 IEs[MAX_IE_SZ]; /* timestamp, beacon interval, and capability info*/
  93. } __packed;
  94. static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
  95. {
  96. return sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->IELength;
  97. }
  98. struct wlan_network {
  99. struct list_head list;
  100. int network_type; /* refer to ieee80211.h for 11A/B/G */
  101. /* set to fixed when not to be removed as site-surveying */
  102. int fixed;
  103. unsigned long last_scanned; /* timestamp for the network */
  104. int aid; /* will only be valid when a BSS is joined. */
  105. int join_res;
  106. struct wlan_bssid_ex network; /* must be the last item */
  107. struct wlan_bcn_info BcnInfo;
  108. };
  109. enum VRTL_CARRIER_SENSE {
  110. DISABLE_VCS,
  111. ENABLE_VCS,
  112. AUTO_VCS
  113. };
  114. enum VCS_TYPE {
  115. NONE_VCS,
  116. RTS_CTS,
  117. CTS_TO_SELF
  118. };
  119. /* john */
  120. #define NUM_PRE_AUTH_KEY 16
  121. #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
  122. #endif /* ifndef WLAN_BSSDEF_H_ */