2 * Copyright (c) 2014, Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #define ATH_DYN_BUF 64
26 * struct ath_dyn_rxbuf - ACK frame ring buffer
27 * @h_rb: ring buffer head
28 * @t_rb: ring buffer tail
29 * @tstamp: ACK RX timestamp buffer
31 struct ath_dyn_rxbuf
{
33 u32 tstamp
[ATH_DYN_BUF
];
47 * struct ath_dyn_txbuf - tx frame ring buffer
48 * @h_rb: ring buffer head
49 * @t_rb: ring buffer tail
50 * @addr: dest/src address pair for a given TX frame
51 * @ts: TX frame timestamp buffer
53 struct ath_dyn_txbuf
{
55 struct haddr_pair addr
[ATH_DYN_BUF
];
56 struct ts_info ts
[ATH_DYN_BUF
];
60 * struct ath_dynack - dynack processing info
61 * @enabled: enable dyn ack processing
62 * @ackto: current ACK timeout
63 * @lto: last ACK timeout computation
64 * @nodes: ath_node linked list
65 * @qlock: ts queue spinlock
66 * @ack_rbf: ACK ts ring buffer
67 * @st_rbf: status ts ring buffer
74 struct list_head nodes
;
76 /* protect timestamp queue access */
78 struct ath_dyn_rxbuf ack_rbf
;
79 struct ath_dyn_txbuf st_rbf
;
82 #if defined(CONFIG_ATH9K_DYNACK)
83 void ath_dynack_reset(struct ath_hw
*ah
);
84 void ath_dynack_node_init(struct ath_hw
*ah
, struct ath_node
*an
);
85 void ath_dynack_node_deinit(struct ath_hw
*ah
, struct ath_node
*an
);
86 void ath_dynack_init(struct ath_hw
*ah
);
87 void ath_dynack_sample_ack_ts(struct ath_hw
*ah
, struct sk_buff
*skb
, u32 ts
);
88 void ath_dynack_sample_tx_ts(struct ath_hw
*ah
, struct sk_buff
*skb
,
89 struct ath_tx_status
*ts
,
90 struct ieee80211_sta
*sta
);
92 static inline void ath_dynack_init(struct ath_hw
*ah
) {}
93 static inline void ath_dynack_node_init(struct ath_hw
*ah
,
94 struct ath_node
*an
) {}
95 static inline void ath_dynack_node_deinit(struct ath_hw
*ah
,
96 struct ath_node
*an
) {}
97 static inline void ath_dynack_sample_ack_ts(struct ath_hw
*ah
,
98 struct sk_buff
*skb
, u32 ts
) {}
99 static inline void ath_dynack_sample_tx_ts(struct ath_hw
*ah
,
101 struct ath_tx_status
*ts
,
102 struct ieee80211_sta
*sta
) {}
105 #endif /* DYNACK_H */