Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 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 | |
| 20 | #ifndef _MWIFIEX_WMM_H_ |
| 21 | #define _MWIFIEX_WMM_H_ |
| 22 | |
| 23 | enum ieee_types_wmm_aciaifsn_bitmasks { |
| 24 | MWIFIEX_AIFSN = (BIT(0) | BIT(1) | BIT(2) | BIT(3)), |
| 25 | MWIFIEX_ACM = BIT(4), |
| 26 | MWIFIEX_ACI = (BIT(5) | BIT(6)), |
| 27 | }; |
| 28 | |
| 29 | enum ieee_types_wmm_ecw_bitmasks { |
| 30 | MWIFIEX_ECW_MIN = (BIT(0) | BIT(1) | BIT(2) | BIT(3)), |
| 31 | MWIFIEX_ECW_MAX = (BIT(4) | BIT(5) | BIT(6) | BIT(7)), |
| 32 | }; |
| 33 | |
Avinash Patil | 47411a0 | 2012-11-01 18:44:16 -0700 | [diff] [blame] | 34 | static const u16 mwifiex_1d_to_wmm_queue[8] = { 1, 0, 0, 1, 2, 2, 3, 3 }; |
| 35 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 36 | /* |
| 37 | * This function retrieves the TID of the given RA list. |
| 38 | */ |
| 39 | static inline int |
Amitkumar Karwar | 572e8f3 | 2011-04-13 17:27:08 -0700 | [diff] [blame] | 40 | mwifiex_get_tid(struct mwifiex_ra_list_tbl *ptr) |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 41 | { |
| 42 | struct sk_buff *skb; |
| 43 | |
| 44 | if (skb_queue_empty(&ptr->skb_head)) |
| 45 | return 0; |
| 46 | |
| 47 | skb = skb_peek(&ptr->skb_head); |
| 48 | |
| 49 | return skb->priority; |
| 50 | } |
| 51 | |
| 52 | /* |
| 53 | * This function gets the length of a list. |
| 54 | */ |
| 55 | static inline int |
Amitkumar Karwar | 572e8f3 | 2011-04-13 17:27:08 -0700 | [diff] [blame] | 56 | mwifiex_wmm_list_len(struct list_head *head) |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 57 | { |
| 58 | struct list_head *pos; |
| 59 | int count = 0; |
| 60 | |
| 61 | list_for_each(pos, head) |
| 62 | ++count; |
| 63 | |
| 64 | return count; |
| 65 | } |
| 66 | |
| 67 | /* |
| 68 | * This function checks if a RA list is empty or not. |
| 69 | */ |
| 70 | static inline u8 |
Amitkumar Karwar | 572e8f3 | 2011-04-13 17:27:08 -0700 | [diff] [blame] | 71 | mwifiex_wmm_is_ra_list_empty(struct list_head *ra_list_hhead) |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 72 | { |
| 73 | struct mwifiex_ra_list_tbl *ra_list; |
| 74 | int is_list_empty; |
| 75 | |
| 76 | list_for_each_entry(ra_list, ra_list_hhead, list) { |
| 77 | is_list_empty = skb_queue_empty(&ra_list->skb_head); |
| 78 | if (!is_list_empty) |
| 79 | return false; |
| 80 | } |
| 81 | |
| 82 | return true; |
| 83 | } |
| 84 | |
Avinash Patil | 2690e1b | 2012-01-24 20:50:24 -0800 | [diff] [blame] | 85 | void mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv, |
| 86 | struct sk_buff *skb); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 87 | void mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra); |
Andreas Fenkart | 2e23731 | 2013-04-18 16:33:45 -0700 | [diff] [blame] | 88 | void mwifiex_rotate_priolists(struct mwifiex_private *priv, |
| 89 | struct mwifiex_ra_list_tbl *ra, |
| 90 | int tid); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 91 | |
| 92 | int mwifiex_wmm_lists_empty(struct mwifiex_adapter *adapter); |
| 93 | void mwifiex_wmm_process_tx(struct mwifiex_adapter *adapter); |
| 94 | int mwifiex_is_ralist_valid(struct mwifiex_private *priv, |
| 95 | struct mwifiex_ra_list_tbl *ra_list, int tid); |
| 96 | |
| 97 | u8 mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv, |
| 98 | const struct sk_buff *skb); |
| 99 | void mwifiex_wmm_init(struct mwifiex_adapter *adapter); |
| 100 | |
| 101 | extern u32 mwifiex_wmm_process_association_req(struct mwifiex_private *priv, |
| 102 | u8 **assoc_buf, |
| 103 | struct ieee_types_wmm_parameter |
| 104 | *wmmie, |
| 105 | struct ieee80211_ht_cap |
| 106 | *htcap); |
| 107 | |
| 108 | void mwifiex_wmm_setup_queue_priorities(struct mwifiex_private *priv, |
| 109 | struct ieee_types_wmm_parameter |
| 110 | *wmm_ie); |
| 111 | void mwifiex_wmm_setup_ac_downgrade(struct mwifiex_private *priv); |
| 112 | extern int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv, |
| 113 | const struct host_cmd_ds_command *resp); |
| 114 | |
| 115 | #endif /* !_MWIFIEX_WMM_H_ */ |