wmm.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. /*
  31. * This function retrieves the TID of the given RA list.
  32. */
  33. static inline int
  34. mwifiex_get_tid(struct mwifiex_ra_list_tbl *ptr)
  35. {
  36. struct sk_buff *skb;
  37. if (skb_queue_empty(&ptr->skb_head))
  38. return 0;
  39. skb = skb_peek(&ptr->skb_head);
  40. return skb->priority;
  41. }
  42. /*
  43. * This function gets the length of a list.
  44. */
  45. static inline int
  46. mwifiex_wmm_list_len(struct list_head *head)
  47. {
  48. struct list_head *pos;
  49. int count = 0;
  50. list_for_each(pos, head)
  51. ++count;
  52. return count;
  53. }
  54. /*
  55. * This function checks if a RA list is empty or not.
  56. */
  57. static inline u8
  58. mwifiex_wmm_is_ra_list_empty(struct list_head *ra_list_hhead)
  59. {
  60. struct mwifiex_ra_list_tbl *ra_list;
  61. int is_list_empty;
  62. list_for_each_entry(ra_list, ra_list_hhead, list) {
  63. is_list_empty = skb_queue_empty(&ra_list->skb_head);
  64. if (!is_list_empty)
  65. return false;
  66. }
  67. return true;
  68. }
  69. void mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv,
  70. struct sk_buff *skb);
  71. void mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra);
  72. int mwifiex_wmm_lists_empty(struct mwifiex_adapter *adapter);
  73. void mwifiex_wmm_process_tx(struct mwifiex_adapter *adapter);
  74. int mwifiex_is_ralist_valid(struct mwifiex_private *priv,
  75. struct mwifiex_ra_list_tbl *ra_list, int tid);
  76. u8 mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv,
  77. const struct sk_buff *skb);
  78. void mwifiex_wmm_init(struct mwifiex_adapter *adapter);
  79. extern u32 mwifiex_wmm_process_association_req(struct mwifiex_private *priv,
  80. u8 **assoc_buf,
  81. struct ieee_types_wmm_parameter
  82. *wmmie,
  83. struct ieee80211_ht_cap
  84. *htcap);
  85. void mwifiex_wmm_setup_queue_priorities(struct mwifiex_private *priv,
  86. struct ieee_types_wmm_parameter
  87. *wmm_ie);
  88. void mwifiex_wmm_setup_ac_downgrade(struct mwifiex_private *priv);
  89. extern int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv,
  90. const struct host_cmd_ds_command *resp);
  91. #endif /* !_MWIFIEX_WMM_H_ */