/drivers/net/wireless/sd8797/mlan/mlan_wmm.h
C Header | 182 lines | 90 code | 20 blank | 72 comment | 2 complexity | 44adcd1bfbb8aaaa7a8f8b151d6c19fd MD5 | raw file
Possible License(s): LGPL-2.0, AGPL-1.0, GPL-2.0
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/**************************************************** 23Change log: 24 10/24/2008: initial version 25****************************************************/ 26 27#ifndef _MLAN_WMM_H_ 28#define _MLAN_WMM_H_ 29 30/** 31 * @brief This function gets the TID 32 * 33 * @param pmadapter A pointer to mlan_adapter structure 34 * @param ptr A pointer to RA list table 35 * 36 * @return TID 37 */ 38static INLINE int 39wlan_get_tid(pmlan_adapter pmadapter, raListTbl * ptr) 40{ 41 pmlan_buffer mbuf; 42 43 ENTER(); 44 mbuf = 45 (pmlan_buffer) util_peek_list(pmadapter->pmoal_handle, &ptr->buf_head, 46 MNULL, MNULL); 47 LEAVE(); 48 49 return mbuf->priority; 50} 51 52/** 53 * @brief This function gets the length of a list 54 * 55 * @param pmadapter A pointer to mlan_adapter structure 56 * @param head A pointer to mlan_list_head 57 * 58 * @return Length of list 59 */ 60static INLINE int 61wlan_wmm_list_len(pmlan_adapter pmadapter, pmlan_list_head head) 62{ 63 pmlan_linked_list pos; 64 int count = 0; 65 66 ENTER(); 67 68 pos = head->pnext; 69 70 while (pos != (pmlan_linked_list) head) { 71 ++count; 72 pos = pos->pnext; 73 } 74 75 LEAVE(); 76 return count; 77} 78 79/** Add buffer to WMM Tx queue */ 80void wlan_wmm_add_buf_txqueue(pmlan_adapter pmadapter, pmlan_buffer pmbuf); 81/** Add to RA list */ 82void wlan_ralist_add(mlan_private * priv, t_u8 * ra); 83/** Update the RA list */ 84int wlan_ralist_update(mlan_private * priv, t_u8 * old_ra, t_u8 * new_ra); 85 86/** WMM status change command handler */ 87mlan_status wlan_cmd_wmm_status_change(pmlan_private priv); 88/** Check if WMM lists are empty */ 89int wlan_wmm_lists_empty(pmlan_adapter pmadapter); 90/** Process WMM transmission */ 91t_void wlan_wmm_process_tx(pmlan_adapter pmadapter); 92/** Test to see if the ralist ptr is valid */ 93int wlan_is_ralist_valid(mlan_private * priv, raListTbl * ra_list, int tid); 94 95raListTbl *wlan_wmm_get_ralist_node(pmlan_private priv, t_u8 tid, 96 t_u8 * ra_addr); 97t_u8 wlan_get_random_ba_threshold(pmlan_adapter pmadapter); 98 99/** Compute driver packet delay */ 100t_u8 wlan_wmm_compute_driver_packet_delay(pmlan_private priv, 101 const pmlan_buffer pmbuf); 102/** Initialize WMM */ 103t_void wlan_wmm_init(pmlan_adapter pmadapter); 104/** Setup WMM queues */ 105extern void wlan_wmm_setup_queues(pmlan_private priv); 106/* Setup default queues */ 107void wlan_wmm_default_queue_priorities(pmlan_private priv); 108 109#ifdef STA_SUPPORT 110/** Process WMM association request */ 111extern t_u32 wlan_wmm_process_association_req(pmlan_private priv, 112 t_u8 ** ppAssocBuf, 113 IEEEtypes_WmmParameter_t * pWmmIE, 114 IEEEtypes_HTCap_t * pHTCap); 115#endif /* STA_SUPPORT */ 116 117/** setup wmm queue priorities */ 118void wlan_wmm_setup_queue_priorities(pmlan_private priv, 119 IEEEtypes_WmmParameter_t * wmm_ie); 120 121/** Downgrade WMM priority queue */ 122void wlan_wmm_setup_ac_downgrade(pmlan_private priv); 123/** select WMM queue */ 124t_u8 wlan_wmm_select_queue(mlan_private * pmpriv, t_u8 tid); 125#ifdef UAP_SUPPORT 126t_void wlan_wmm_delete_peer_ralist(pmlan_private priv, t_u8 * mac); 127#endif 128 129#ifdef STA_SUPPORT 130/* 131 * Functions used in the cmd handling routine 132 */ 133/** WMM ADDTS request command handler */ 134extern mlan_status wlan_cmd_wmm_addts_req(IN pmlan_private pmpriv, 135 OUT HostCmd_DS_COMMAND * cmd, 136 IN t_void * pdata_buf); 137/** WMM DELTS request command handler */ 138extern mlan_status wlan_cmd_wmm_delts_req(IN pmlan_private pmpriv, 139 OUT HostCmd_DS_COMMAND * cmd, 140 IN t_void * pdata_buf); 141/** WMM QUEUE_CONFIG command handler */ 142extern mlan_status wlan_cmd_wmm_queue_config(IN pmlan_private pmpriv, 143 OUT HostCmd_DS_COMMAND * cmd, 144 IN t_void * pdata_buf); 145/** WMM QUEUE_STATS command handler */ 146extern mlan_status wlan_cmd_wmm_queue_stats(IN pmlan_private pmpriv, 147 OUT HostCmd_DS_COMMAND * cmd, 148 IN t_void * pdata_buf); 149/** WMM TS_STATUS command handler */ 150extern mlan_status wlan_cmd_wmm_ts_status(IN pmlan_private pmpriv, 151 OUT HostCmd_DS_COMMAND * cmd, 152 IN t_void * pdata_buf); 153 154/* 155 * Functions used in the cmdresp handling routine 156 */ 157/** WMM get status command response handler */ 158extern mlan_status wlan_ret_wmm_get_status(IN pmlan_private priv, 159 IN t_u8 * ptlv, IN int resp_len); 160/** WMM ADDTS request command response handler */ 161extern mlan_status wlan_ret_wmm_addts_req(IN pmlan_private pmpriv, 162 const IN HostCmd_DS_COMMAND * resp, 163 OUT mlan_ioctl_req * pioctl_buf); 164/** WMM DELTS request command response handler */ 165extern mlan_status wlan_ret_wmm_delts_req(IN pmlan_private pmpriv, 166 const IN HostCmd_DS_COMMAND * resp, 167 OUT mlan_ioctl_req * pioctl_buf); 168/** WMM QUEUE_CONFIG command response handler */ 169extern mlan_status wlan_ret_wmm_queue_config(IN pmlan_private pmpriv, 170 const IN HostCmd_DS_COMMAND * resp, 171 OUT mlan_ioctl_req * pioctl_buf); 172/** WMM QUEUE_STATS command response handler */ 173extern mlan_status wlan_ret_wmm_queue_stats(IN pmlan_private pmpriv, 174 const IN HostCmd_DS_COMMAND * resp, 175 OUT mlan_ioctl_req * pioctl_buf); 176/** WMM TS_STATUS command response handler */ 177extern mlan_status wlan_ret_wmm_ts_status(IN pmlan_private pmpriv, 178 IN HostCmd_DS_COMMAND * resp, 179 OUT mlan_ioctl_req * pioctl_buf); 180#endif /* STA_SUPPORT */ 181 182#endif /* !_MLAN_WMM_H_ */