/drivers/net/wireless/bcmdhd/include/proto/802.11e.h

https://bitbucket.org/slukk/jb-tsm-kernel-4.2 · C Header · 131 lines · 75 code · 20 blank · 36 comment · 0 complexity · 2ec63a38b6021143178013b8394bb5f2 MD5 · raw file

  1. /*
  2. * 802.11e protocol header file
  3. *
  4. * Copyright (C) 1999-2011, Broadcom Corporation
  5. *
  6. * Unless you and Broadcom execute a separate written software license
  7. * agreement governing use of this software, this software is licensed to you
  8. * under the terms of the GNU General Public License version 2 (the "GPL"),
  9. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  10. * following added to such license:
  11. *
  12. * As a special exception, the copyright holders of this software give you
  13. * permission to link this software with independent modules, and to copy and
  14. * distribute the resulting executable under terms of your choice, provided that
  15. * you also meet, for each linked independent module, the terms and conditions of
  16. * the license of that module. An independent module is a module which is not
  17. * derived from this software. The special exception does not apply to any
  18. * modifications of the software.
  19. *
  20. * Notwithstanding the above, under no circumstances may you combine this
  21. * software in any way with any other Broadcom software provided under a license
  22. * other than the GPL, without Broadcom's express prior written consent.
  23. *
  24. * $Id: 802.11e.h 277737 2011-08-16 17:54:59Z $
  25. */
  26. #ifndef _802_11e_H_
  27. #define _802_11e_H_
  28. #ifndef _TYPEDEFS_H_
  29. #include <typedefs.h>
  30. #endif
  31. /* This marks the start of a packed structure section. */
  32. #include <packed_section_start.h>
  33. /* WME Traffic Specification (TSPEC) element */
  34. #define WME_TSPEC_HDR_LEN 2 /* WME TSPEC header length */
  35. #define WME_TSPEC_BODY_OFF 2 /* WME TSPEC body offset */
  36. #define WME_CATEGORY_CODE_OFFSET 0 /* WME Category code offset */
  37. #define WME_ACTION_CODE_OFFSET 1 /* WME Action code offset */
  38. #define WME_TOKEN_CODE_OFFSET 2 /* WME Token code offset */
  39. #define WME_STATUS_CODE_OFFSET 3 /* WME Status code offset */
  40. BWL_PRE_PACKED_STRUCT struct tsinfo {
  41. uint8 octets[3];
  42. } BWL_POST_PACKED_STRUCT;
  43. typedef struct tsinfo tsinfo_t;
  44. /* 802.11e TSPEC IE */
  45. typedef BWL_PRE_PACKED_STRUCT struct tspec {
  46. uint8 oui[DOT11_OUI_LEN]; /* WME_OUI */
  47. uint8 type; /* WME_TYPE */
  48. uint8 subtype; /* WME_SUBTYPE_TSPEC */
  49. uint8 version; /* WME_VERSION */
  50. tsinfo_t tsinfo; /* TS Info bit field */
  51. uint16 nom_msdu_size; /* (Nominal or fixed) MSDU Size (bytes) */
  52. uint16 max_msdu_size; /* Maximum MSDU Size (bytes) */
  53. uint32 min_srv_interval; /* Minimum Service Interval (us) */
  54. uint32 max_srv_interval; /* Maximum Service Interval (us) */
  55. uint32 inactivity_interval; /* Inactivity Interval (us) */
  56. uint32 suspension_interval; /* Suspension Interval (us) */
  57. uint32 srv_start_time; /* Service Start Time (us) */
  58. uint32 min_data_rate; /* Minimum Data Rate (bps) */
  59. uint32 mean_data_rate; /* Mean Data Rate (bps) */
  60. uint32 peak_data_rate; /* Peak Data Rate (bps) */
  61. uint32 max_burst_size; /* Maximum Burst Size (bytes) */
  62. uint32 delay_bound; /* Delay Bound (us) */
  63. uint32 min_phy_rate; /* Minimum PHY Rate (bps) */
  64. uint16 surplus_bw; /* Surplus Bandwidth Allowance (range 1.0-8.0) */
  65. uint16 medium_time; /* Medium Time (32 us/s periods) */
  66. } BWL_POST_PACKED_STRUCT tspec_t;
  67. #define WME_TSPEC_LEN (sizeof(tspec_t)) /* not including 2-bytes of header */
  68. /* ts_info */
  69. /* 802.1D priority is duplicated - bits 13-11 AND bits 3-1 */
  70. #define TS_INFO_TID_SHIFT 1 /* TS info. TID shift */
  71. #define TS_INFO_TID_MASK (0xf << TS_INFO_TID_SHIFT) /* TS info. TID mask */
  72. #define TS_INFO_CONTENTION_SHIFT 7 /* TS info. contention shift */
  73. #define TS_INFO_CONTENTION_MASK (0x1 << TS_INFO_CONTENTION_SHIFT) /* TS info. contention mask */
  74. #define TS_INFO_DIRECTION_SHIFT 5 /* TS info. direction shift */
  75. #define TS_INFO_DIRECTION_MASK (0x3 << TS_INFO_DIRECTION_SHIFT) /* TS info. direction mask */
  76. #define TS_INFO_PSB_SHIFT 2 /* TS info. PSB bit Shift */
  77. #define TS_INFO_PSB_MASK (1 << TS_INFO_PSB_SHIFT) /* TS info. PSB mask */
  78. #define TS_INFO_UPLINK (0 << TS_INFO_DIRECTION_SHIFT) /* TS info. uplink */
  79. #define TS_INFO_DOWNLINK (1 << TS_INFO_DIRECTION_SHIFT) /* TS info. downlink */
  80. #define TS_INFO_BIDIRECTIONAL (3 << TS_INFO_DIRECTION_SHIFT) /* TS info. bidirectional */
  81. #define TS_INFO_USER_PRIO_SHIFT 3 /* TS info. user priority shift */
  82. /* TS info. user priority mask */
  83. #define TS_INFO_USER_PRIO_MASK (0x7 << TS_INFO_USER_PRIO_SHIFT)
  84. /* Macro to get/set bit(s) field in TSINFO */
  85. #define WLC_CAC_GET_TID(pt) ((((pt).octets[0]) & TS_INFO_TID_MASK) >> TS_INFO_TID_SHIFT)
  86. #define WLC_CAC_GET_DIR(pt) ((((pt).octets[0]) & \
  87. TS_INFO_DIRECTION_MASK) >> TS_INFO_DIRECTION_SHIFT)
  88. #define WLC_CAC_GET_PSB(pt) ((((pt).octets[1]) & TS_INFO_PSB_MASK) >> TS_INFO_PSB_SHIFT)
  89. #define WLC_CAC_GET_USER_PRIO(pt) ((((pt).octets[1]) & \
  90. TS_INFO_USER_PRIO_MASK) >> TS_INFO_USER_PRIO_SHIFT)
  91. #define WLC_CAC_SET_TID(pt, id) ((((pt).octets[0]) & (~TS_INFO_TID_MASK)) | \
  92. ((id) << TS_INFO_TID_SHIFT))
  93. #define WLC_CAC_SET_USER_PRIO(pt, prio) ((((pt).octets[0]) & (~TS_INFO_USER_PRIO_MASK)) | \
  94. ((prio) << TS_INFO_USER_PRIO_SHIFT))
  95. /* 802.11e QBSS Load IE */
  96. #define QBSS_LOAD_IE_LEN 5 /* QBSS Load IE length */
  97. #define QBSS_LOAD_AAC_OFF 3 /* AAC offset in IE */
  98. #define CAC_ADDTS_RESP_TIMEOUT 300 /* default ADDTS response timeout in ms */
  99. /* 802.11e ADDTS status code */
  100. #define DOT11E_STATUS_ADMISSION_ACCEPTED 0 /* TSPEC Admission accepted status */
  101. #define DOT11E_STATUS_ADDTS_INVALID_PARAM 1 /* TSPEC invalid parameter status */
  102. #define DOT11E_STATUS_ADDTS_REFUSED_NSBW 3 /* ADDTS refused (non-sufficient BW) */
  103. #define DOT11E_STATUS_ADDTS_REFUSED_AWHILE 47 /* ADDTS refused but could retry later */
  104. /* 802.11e DELTS status code */
  105. #define DOT11E_STATUS_QSTA_LEAVE_QBSS 36 /* STA leave QBSS */
  106. #define DOT11E_STATUS_END_TS 37 /* END TS */
  107. #define DOT11E_STATUS_UNKNOWN_TS 38 /* UNKNOWN TS */
  108. #define DOT11E_STATUS_QSTA_REQ_TIMEOUT 39 /* STA ADDTS request timeout */
  109. /* This marks the end of a packed structure section. */
  110. #include <packed_section_end.h>
  111. #endif /* _802_11e_CAC_H_ */