Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Marvell Wireless LAN device driver: 802.11n RX Re-ordering |
| 3 | * |
Xinming Hu | 65da33f | 2014-06-19 21:38:57 -0700 | [diff] [blame] | 4 | * Copyright (C) 2011-2014, Marvell International Ltd. |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 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_11N_RXREORDER_H_ |
| 21 | #define _MWIFIEX_11N_RXREORDER_H_ |
| 22 | |
| 23 | #define MIN_FLUSH_TIMER_MS 50 |
| 24 | |
| 25 | #define PKT_TYPE_BAR 0xE7 |
| 26 | #define MAX_TID_VALUE (2 << 11) |
| 27 | #define TWOPOW11 (2 << 10) |
| 28 | |
| 29 | #define BLOCKACKPARAM_TID_POS 2 |
| 30 | #define BLOCKACKPARAM_AMSDU_SUPP_MASK 0x1 |
| 31 | #define BLOCKACKPARAM_WINSIZE_POS 6 |
| 32 | #define DELBA_TID_POS 12 |
| 33 | #define DELBA_INITIATOR_POS 11 |
| 34 | #define TYPE_DELBA_SENT 1 |
| 35 | #define TYPE_DELBA_RECEIVE 2 |
| 36 | #define IMMEDIATE_BLOCK_ACK 0x2 |
| 37 | |
| 38 | #define ADDBA_RSP_STATUS_ACCEPT 0 |
| 39 | |
Stone Piao | 9258392 | 2012-06-20 20:21:10 -0700 | [diff] [blame] | 40 | #define MWIFIEX_DEF_11N_RX_SEQ_NUM 0xffff |
Avinash Patil | 5a009ad | 2012-08-03 18:06:10 -0700 | [diff] [blame] | 41 | #define BA_SETUP_MAX_PACKET_THRESHOLD 16 |
| 42 | #define BA_SETUP_PACKET_OFFSET 16 |
Stone Piao | 9258392 | 2012-06-20 20:21:10 -0700 | [diff] [blame] | 43 | |
Avinash Patil | 2db96c3 | 2012-09-27 19:00:10 -0700 | [diff] [blame] | 44 | enum mwifiex_rxreor_flags { |
Paul Stewart | 8acbea6 | 2014-02-25 16:31:37 -0800 | [diff] [blame] | 45 | RXREOR_FORCE_NO_DROP = 1<<0, |
| 46 | RXREOR_INIT_WINDOW_SHIFT = 1<<1, |
Avinash Patil | 2db96c3 | 2012-09-27 19:00:10 -0700 | [diff] [blame] | 47 | }; |
| 48 | |
Stone Piao | 9258392 | 2012-06-20 20:21:10 -0700 | [diff] [blame] | 49 | static inline void mwifiex_reset_11n_rx_seq_num(struct mwifiex_private *priv) |
| 50 | { |
| 51 | memset(priv->rx_seq, 0xff, sizeof(priv->rx_seq)); |
| 52 | } |
| 53 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 54 | int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *, |
| 55 | u16 seqNum, |
| 56 | u16 tid, u8 *ta, |
| 57 | u8 pkttype, void *payload); |
Yogesh Ashok Powar | 3e82263 | 2012-03-12 19:35:08 -0700 | [diff] [blame] | 58 | void mwifiex_del_ba_tbl(struct mwifiex_private *priv, int Tid, |
| 59 | u8 *PeerMACAddr, u8 type, int initiator); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 60 | void mwifiex_11n_ba_stream_timeout(struct mwifiex_private *priv, |
| 61 | struct host_cmd_ds_11n_batimeout *event); |
| 62 | int mwifiex_ret_11n_addba_resp(struct mwifiex_private *priv, |
| 63 | struct host_cmd_ds_command |
| 64 | *resp); |
Amitkumar Karwar | 572e8f3 | 2011-04-13 17:27:08 -0700 | [diff] [blame] | 65 | int mwifiex_cmd_11n_delba(struct host_cmd_ds_command *cmd, |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 66 | void *data_buf); |
| 67 | int mwifiex_cmd_11n_addba_rsp_gen(struct mwifiex_private *priv, |
Amitkumar Karwar | a5ffddb | 2011-06-20 15:21:48 -0700 | [diff] [blame] | 68 | struct host_cmd_ds_command *cmd, |
| 69 | struct host_cmd_ds_11n_addba_req |
| 70 | *cmd_addba_req); |
Amitkumar Karwar | 572e8f3 | 2011-04-13 17:27:08 -0700 | [diff] [blame] | 71 | int mwifiex_cmd_11n_addba_req(struct host_cmd_ds_command *cmd, |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 72 | void *data_buf); |
| 73 | void mwifiex_11n_cleanup_reorder_tbl(struct mwifiex_private *priv); |
| 74 | struct mwifiex_rx_reorder_tbl *mwifiex_11n_get_rxreorder_tbl(struct |
| 75 | mwifiex_private |
| 76 | *priv, int tid, |
| 77 | u8 *ta); |
Avinash Patil | d1cf3b9 | 2012-08-03 18:06:09 -0700 | [diff] [blame] | 78 | struct mwifiex_rx_reorder_tbl * |
| 79 | mwifiex_11n_get_rx_reorder_tbl(struct mwifiex_private *priv, int tid, u8 *ta); |
Avinash Patil | 3e238a1 | 2012-08-03 18:06:11 -0700 | [diff] [blame] | 80 | void mwifiex_11n_del_rx_reorder_tbl_by_ta(struct mwifiex_private *priv, u8 *ta); |
Avinash Patil | 2db96c3 | 2012-09-27 19:00:10 -0700 | [diff] [blame] | 81 | void mwifiex_update_rxreor_flags(struct mwifiex_adapter *adapter, u8 flags); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 82 | |
| 83 | #endif /* _MWIFIEX_11N_RXREORDER_H_ */ |