wmm.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Marvell Wireless LAN device driver: WMM
  3. *
  4. * Copyright (C) 2011, Marvell International Ltd.
  5. *
  6. * This software file (the "File") is distributed by Marvell International
  7. * Ltd. under the terms of the GNU General Public License Version 2, June 1991
  8. * (the "License"). You may use, redistribute and/or modify this File in
  9. * accordance with the terms and conditions of the License, a copy of which
  10. * is available by writing to the Free Software Foundation, Inc.,
  11. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
  12. * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
  13. *
  14. * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
  16. * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
  17. * this warranty disclaimer.
  18. */
  19. #ifndef _MWIFIEX_WMM_H_
  20. #define _MWIFIEX_WMM_H_
  21. enum ieee_types_wmm_aciaifsn_bitmasks {
  22. MWIFIEX_AIFSN = (BIT(0) | BIT(1) | BIT(2) | BIT(3)),
  23. MWIFIEX_ACM = BIT(4),
  24. MWIFIEX_ACI = (BIT(5) | BIT(6)),
  25. };
  26. enum ieee_types_wmm_ecw_bitmasks {
  27. MWIFIEX_ECW_MIN = (BIT(0) | BIT(1) | BIT(2) | BIT(3)),
  28. MWIFIEX_ECW_MAX = (BIT(4) | BIT(5) | BIT(6) | BIT(7)),
  29. };
  30. static const u16 mwifiex_1d_to_wmm_queue[8] = { 1, 0, 0, 1, 2, 2, 3, 3 };
  31. /*
  32. * This function retrieves the TID of the given RA list.
  33. */
  34. static inline int
  35. mwifiex_get_tid(struct mwifiex_ra_list_tbl *ptr)
  36. {
  37. struct sk_buff *skb;
  38. if (skb_queue_empty(&ptr->skb_head))
  39. return 0;
  40. skb = skb_peek(&ptr->skb_head);
  41. return skb->priority;
  42. }
  43. /*
  44. * This function gets the length of a list.
  45. */
  46. static inline int
  47. mwifiex_wmm_list_len(struct list_head *head)
  48. {
  49. struct list_head *pos;
  50. int count = 0;
  51. list_for_each(pos, head)
  52. ++count;
  53. return count;
  54. }
  55. /*
  56. * This function checks if a RA list is empty or not.
  57. */
  58. static inline u8
  59. mwifiex_wmm_is_ra_list_empty(struct list_head *ra_list_hhead)
  60. {
  61. struct mwifiex_ra_list_tbl *ra_list;
  62. int is_list_empty;
  63. list_for_each_entry(ra_list, ra_list_hhead, list) {
  64. is_list_empty = skb_queue_empty(&ra_list->skb_head);
  65. if (!is_list_empty)
  66. return false;
  67. }
  68. return true;
  69. }
  70. void mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv,
  71. struct sk_buff *skb);
  72. void mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra);
  73. int mwifiex_wmm_lists_empty(struct mwifiex_adapter *adapter);
  74. void mwifiex_wmm_process_tx(struct mwifiex_adapter *adapter);
  75. int mwifiex_is_ralist_valid(struct mwifiex_private *priv,
  76. struct mwifiex_ra_list_tbl *ra_list, int tid);
  77. u8 mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv,
  78. const struct sk_buff *skb);
  79. void mwifiex_wmm_init(struct mwifiex_adapter *adapter);
  80. extern u32 mwifiex_wmm_process_association_req(struct mwifiex_private *priv,
  81. u8 **assoc_buf,
  82. struct ieee_types_wmm_parameter
  83. *wmmie,
  84. struct ieee80211_ht_cap
  85. *htcap);
  86. void mwifiex_wmm_setup_queue_priorities(struct mwifiex_private *priv,
  87. struct ieee_types_wmm_parameter
  88. *wmm_ie);
  89. void mwifiex_wmm_setup_ac_downgrade(struct mwifiex_private *priv);
  90. extern int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
  91. const struct host_cmd_ds_command *resp);
  92. #endif /* !_MWIFIEX_WMM_H_ */