Deleted Added
full compact
ieee80211_amrr.h (178354) ieee80211_amrr.h (206358)
1/* $FreeBSD: head/sys/net80211/ieee80211_amrr.h 178354 2008-04-20 20:35:46Z sam $ */
1/* $FreeBSD: head/sys/net80211/ieee80211_amrr.h 206358 2010-04-07 15:29:13Z rpaulo $ */
2/* $OpenBSD: ieee80211_amrr.h,v 1.3 2006/06/17 19:34:31 damien Exp $ */
3
4/*-
5 * Copyright (c) 2006
6 * Damien Bergamini <damien.bergamini@free.fr>
7 *
8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above

--- 43 unchanged lines hidden (view full) ---

53 /* statistics */
54 u_int amn_txcnt;
55 u_int amn_success;
56 u_int amn_success_threshold;
57 u_int amn_recovery;
58 u_int amn_retrycnt;
59};
60
2/* $OpenBSD: ieee80211_amrr.h,v 1.3 2006/06/17 19:34:31 damien Exp $ */
3
4/*-
5 * Copyright (c) 2006
6 * Damien Bergamini <damien.bergamini@free.fr>
7 *
8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above

--- 43 unchanged lines hidden (view full) ---

53 /* statistics */
54 u_int amn_txcnt;
55 u_int amn_success;
56 u_int amn_success_threshold;
57 u_int amn_recovery;
58 u_int amn_retrycnt;
59};
60
61void ieee80211_amrr_init(struct ieee80211_amrr *, struct ieee80211vap *,
62 int, int, int);
63void ieee80211_amrr_cleanup(struct ieee80211_amrr *);
64void ieee80211_amrr_setinterval(struct ieee80211_amrr *, int);
65void ieee80211_amrr_node_init(struct ieee80211_amrr *,
66 struct ieee80211_amrr_node *, struct ieee80211_node *);
67int ieee80211_amrr_choose(struct ieee80211_node *,
68 struct ieee80211_amrr_node *);
69
70#define IEEE80211_AMRR_SUCCESS 1
71#define IEEE80211_AMRR_FAILURE 0
72
73/*
74 * Update statistics with tx complete status. Ok is non-zero
75 * if the packet is known to be ACK'd. Retries has the number
76 * retransmissions (i.e. xmit attempts - 1).
77 */
78static __inline void
79ieee80211_amrr_tx_complete(struct ieee80211_amrr_node *amn,
80 int ok, int retries)
81{
82 amn->amn_txcnt++;
83 if (ok)
84 amn->amn_success++;
85 amn->amn_retrycnt += retries;
86}
87
88/*
89 * Set tx count/retry statistics explicitly. Intended for
90 * drivers that poll the device for statistics maintained
91 * in the device.
92 */
93static __inline void
94ieee80211_amrr_tx_update(struct ieee80211_amrr_node *amn,
95 int txcnt, int success, int retrycnt)
96{
97 amn->amn_txcnt = txcnt;
98 amn->amn_success = success;
99 amn->amn_retrycnt = retrycnt;
100}
101#endif /* _NET80211_IEEE80211_AMRR_H_ */
61#endif /* _NET80211_IEEE80211_AMRR_H_ */