/drivers/net/wireless/sd8797/mlan/mlan_wmm.h

https://bitbucket.org/cyanogenmod/android_kernel_asus_tf300t · C Header · 182 lines · 90 code · 20 blank · 72 comment · 2 complexity · 44adcd1bfbb8aaaa7a8f8b151d6c19fd MD5 · raw file

  1. /** @file mlan_wmm.h
  2. *
  3. * @brief This file contains related macros, enum, and struct
  4. * of wmm functionalities
  5. *
  6. * Copyright (C) 2008-2011, Marvell International Ltd.
  7. *
  8. * This software file (the "File") is distributed by Marvell International
  9. * Ltd. under the terms of the GNU General Public License Version 2, June 1991
  10. * (the "License"). You may use, redistribute and/or modify this File in
  11. * accordance with the terms and conditions of the License, a copy of which
  12. * is available by writing to the Free Software Foundation, Inc.,
  13. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
  14. * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
  15. *
  16. * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
  17. * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
  18. * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
  19. * this warranty disclaimer.
  20. */
  21. /****************************************************
  22. Change log:
  23. 10/24/2008: initial version
  24. ****************************************************/
  25. #ifndef _MLAN_WMM_H_
  26. #define _MLAN_WMM_H_
  27. /**
  28. * @brief This function gets the TID
  29. *
  30. * @param pmadapter A pointer to mlan_adapter structure
  31. * @param ptr A pointer to RA list table
  32. *
  33. * @return TID
  34. */
  35. static INLINE int
  36. wlan_get_tid(pmlan_adapter pmadapter, raListTbl * ptr)
  37. {
  38. pmlan_buffer mbuf;
  39. ENTER();
  40. mbuf =
  41. (pmlan_buffer) util_peek_list(pmadapter->pmoal_handle, &ptr->buf_head,
  42. MNULL, MNULL);
  43. LEAVE();
  44. return mbuf->priority;
  45. }
  46. /**
  47. * @brief This function gets the length of a list
  48. *
  49. * @param pmadapter A pointer to mlan_adapter structure
  50. * @param head A pointer to mlan_list_head
  51. *
  52. * @return Length of list
  53. */
  54. static INLINE int
  55. wlan_wmm_list_len(pmlan_adapter pmadapter, pmlan_list_head head)
  56. {
  57. pmlan_linked_list pos;
  58. int count = 0;
  59. ENTER();
  60. pos = head->pnext;
  61. while (pos != (pmlan_linked_list) head) {
  62. ++count;
  63. pos = pos->pnext;
  64. }
  65. LEAVE();
  66. return count;
  67. }
  68. /** Add buffer to WMM Tx queue */
  69. void wlan_wmm_add_buf_txqueue(pmlan_adapter pmadapter, pmlan_buffer pmbuf);
  70. /** Add to RA list */
  71. void wlan_ralist_add(mlan_private * priv, t_u8 * ra);
  72. /** Update the RA list */
  73. int wlan_ralist_update(mlan_private * priv, t_u8 * old_ra, t_u8 * new_ra);
  74. /** WMM status change command handler */
  75. mlan_status wlan_cmd_wmm_status_change(pmlan_private priv);
  76. /** Check if WMM lists are empty */
  77. int wlan_wmm_lists_empty(pmlan_adapter pmadapter);
  78. /** Process WMM transmission */
  79. t_void wlan_wmm_process_tx(pmlan_adapter pmadapter);
  80. /** Test to see if the ralist ptr is valid */
  81. int wlan_is_ralist_valid(mlan_private * priv, raListTbl * ra_list, int tid);
  82. raListTbl *wlan_wmm_get_ralist_node(pmlan_private priv, t_u8 tid,
  83. t_u8 * ra_addr);
  84. t_u8 wlan_get_random_ba_threshold(pmlan_adapter pmadapter);
  85. /** Compute driver packet delay */
  86. t_u8 wlan_wmm_compute_driver_packet_delay(pmlan_private priv,
  87. const pmlan_buffer pmbuf);
  88. /** Initialize WMM */
  89. t_void wlan_wmm_init(pmlan_adapter pmadapter);
  90. /** Setup WMM queues */
  91. extern void wlan_wmm_setup_queues(pmlan_private priv);
  92. /* Setup default queues */
  93. void wlan_wmm_default_queue_priorities(pmlan_private priv);
  94. #ifdef STA_SUPPORT
  95. /** Process WMM association request */
  96. extern t_u32 wlan_wmm_process_association_req(pmlan_private priv,
  97. t_u8 ** ppAssocBuf,
  98. IEEEtypes_WmmParameter_t * pWmmIE,
  99. IEEEtypes_HTCap_t * pHTCap);
  100. #endif /* STA_SUPPORT */
  101. /** setup wmm queue priorities */
  102. void wlan_wmm_setup_queue_priorities(pmlan_private priv,
  103. IEEEtypes_WmmParameter_t * wmm_ie);
  104. /** Downgrade WMM priority queue */
  105. void wlan_wmm_setup_ac_downgrade(pmlan_private priv);
  106. /** select WMM queue */
  107. t_u8 wlan_wmm_select_queue(mlan_private * pmpriv, t_u8 tid);
  108. #ifdef UAP_SUPPORT
  109. t_void wlan_wmm_delete_peer_ralist(pmlan_private priv, t_u8 * mac);
  110. #endif
  111. #ifdef STA_SUPPORT
  112. /*
  113. * Functions used in the cmd handling routine
  114. */
  115. /** WMM ADDTS request command handler */
  116. extern mlan_status wlan_cmd_wmm_addts_req(IN pmlan_private pmpriv,
  117. OUT HostCmd_DS_COMMAND * cmd,
  118. IN t_void * pdata_buf);
  119. /** WMM DELTS request command handler */
  120. extern mlan_status wlan_cmd_wmm_delts_req(IN pmlan_private pmpriv,
  121. OUT HostCmd_DS_COMMAND * cmd,
  122. IN t_void * pdata_buf);
  123. /** WMM QUEUE_CONFIG command handler */
  124. extern mlan_status wlan_cmd_wmm_queue_config(IN pmlan_private pmpriv,
  125. OUT HostCmd_DS_COMMAND * cmd,
  126. IN t_void * pdata_buf);
  127. /** WMM QUEUE_STATS command handler */
  128. extern mlan_status wlan_cmd_wmm_queue_stats(IN pmlan_private pmpriv,
  129. OUT HostCmd_DS_COMMAND * cmd,
  130. IN t_void * pdata_buf);
  131. /** WMM TS_STATUS command handler */
  132. extern mlan_status wlan_cmd_wmm_ts_status(IN pmlan_private pmpriv,
  133. OUT HostCmd_DS_COMMAND * cmd,
  134. IN t_void * pdata_buf);
  135. /*
  136. * Functions used in the cmdresp handling routine
  137. */
  138. /** WMM get status command response handler */
  139. extern mlan_status wlan_ret_wmm_get_status(IN pmlan_private priv,
  140. IN t_u8 * ptlv, IN int resp_len);
  141. /** WMM ADDTS request command response handler */
  142. extern mlan_status wlan_ret_wmm_addts_req(IN pmlan_private pmpriv,
  143. const IN HostCmd_DS_COMMAND * resp,
  144. OUT mlan_ioctl_req * pioctl_buf);
  145. /** WMM DELTS request command response handler */
  146. extern mlan_status wlan_ret_wmm_delts_req(IN pmlan_private pmpriv,
  147. const IN HostCmd_DS_COMMAND * resp,
  148. OUT mlan_ioctl_req * pioctl_buf);
  149. /** WMM QUEUE_CONFIG command response handler */
  150. extern mlan_status wlan_ret_wmm_queue_config(IN pmlan_private pmpriv,
  151. const IN HostCmd_DS_COMMAND * resp,
  152. OUT mlan_ioctl_req * pioctl_buf);
  153. /** WMM QUEUE_STATS command response handler */
  154. extern mlan_status wlan_ret_wmm_queue_stats(IN pmlan_private pmpriv,
  155. const IN HostCmd_DS_COMMAND * resp,
  156. OUT mlan_ioctl_req * pioctl_buf);
  157. /** WMM TS_STATUS command response handler */
  158. extern mlan_status wlan_ret_wmm_ts_status(IN pmlan_private pmpriv,
  159. IN HostCmd_DS_COMMAND * resp,
  160. OUT mlan_ioctl_req * pioctl_buf);
  161. #endif /* STA_SUPPORT */
  162. #endif /* !_MLAN_WMM_H_ */