xref: /freebsd/sys/dev/ath/ath_rate/onoe/onoe.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
105f1e03fSSam Leffler /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3718cf2ccSPedro F. Giffuni  *
4515d617eSSam Leffler  * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting
505f1e03fSSam Leffler  * All rights reserved.
605f1e03fSSam Leffler  *
705f1e03fSSam Leffler  * Redistribution and use in source and binary forms, with or without
805f1e03fSSam Leffler  * modification, are permitted provided that the following conditions
905f1e03fSSam Leffler  * are met:
1005f1e03fSSam Leffler  * 1. Redistributions of source code must retain the above copyright
1105f1e03fSSam Leffler  *    notice, this list of conditions and the following disclaimer,
12515d617eSSam Leffler  *    without modification.
1305f1e03fSSam Leffler  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1405f1e03fSSam Leffler  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
1505f1e03fSSam Leffler  *    redistribution must be conditioned upon including a substantially
1605f1e03fSSam Leffler  *    similar Disclaimer requirement for further binary redistribution.
1705f1e03fSSam Leffler  *
1805f1e03fSSam Leffler  * NO WARRANTY
1905f1e03fSSam Leffler  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2005f1e03fSSam Leffler  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2105f1e03fSSam Leffler  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
2205f1e03fSSam Leffler  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
2305f1e03fSSam Leffler  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
2405f1e03fSSam Leffler  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2505f1e03fSSam Leffler  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2605f1e03fSSam Leffler  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
2705f1e03fSSam Leffler  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2805f1e03fSSam Leffler  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
2905f1e03fSSam Leffler  * THE POSSIBILITY OF SUCH DAMAGES.
3005f1e03fSSam Leffler  */
3105f1e03fSSam Leffler 
3205f1e03fSSam Leffler /*
3305f1e03fSSam Leffler  * Defintions for the Atheros Wireless LAN controller driver.
3405f1e03fSSam Leffler  */
3505f1e03fSSam Leffler #ifndef _DEV_ATH_RATE_ONOE_H
3605f1e03fSSam Leffler #define _DEV_ATH_RATE_ONOE_H
3705f1e03fSSam Leffler 
3805f1e03fSSam Leffler /* per-device state */
3905f1e03fSSam Leffler struct onoe_softc {
4005f1e03fSSam Leffler 	struct ath_ratectrl arc;	/* base state */
4105f1e03fSSam Leffler };
4205f1e03fSSam Leffler 
4305f1e03fSSam Leffler /* per-node state */
4405f1e03fSSam Leffler struct onoe_node {
45b032f27cSSam Leffler 	int		on_rix;		/* current rate index */
46b032f27cSSam Leffler 	int		on_ticks;	/* time of last update */
47b032f27cSSam Leffler 	int		on_interval;	/* update interval (ticks) */
48b032f27cSSam Leffler 
4905f1e03fSSam Leffler 	u_int		on_tx_ok;	/* tx ok pkt */
5005f1e03fSSam Leffler 	u_int		on_tx_err;	/* tx !ok pkt */
5105f1e03fSSam Leffler 	u_int		on_tx_retr;	/* tx retry count */
5205f1e03fSSam Leffler 	int		on_tx_upper;	/* tx upper rate req cnt */
5305f1e03fSSam Leffler 	u_int8_t	on_tx_rix0;	/* series 0 rate index */
5405f1e03fSSam Leffler 	u_int8_t	on_tx_try0;	/* series 0 try count */
5505f1e03fSSam Leffler 	u_int8_t	on_tx_rate0;	/* series 0 h/w rate */
5605f1e03fSSam Leffler 	u_int8_t	on_tx_rate1;	/* series 1 h/w rate */
5705f1e03fSSam Leffler 	u_int8_t	on_tx_rate2;	/* series 2 h/w rate */
5805f1e03fSSam Leffler 	u_int8_t	on_tx_rate3;	/* series 3 h/w rate */
5905f1e03fSSam Leffler 	u_int8_t	on_tx_rate0sp;	/* series 0 short preamble h/w rate */
6005f1e03fSSam Leffler 	u_int8_t	on_tx_rate1sp;	/* series 1 short preamble h/w rate */
6105f1e03fSSam Leffler 	u_int8_t	on_tx_rate2sp;	/* series 2 short preamble h/w rate */
6205f1e03fSSam Leffler 	u_int8_t	on_tx_rate3sp;	/* series 3 short preamble h/w rate */
6305f1e03fSSam Leffler };
6405f1e03fSSam Leffler #define	ATH_NODE_ONOE(an)	((struct onoe_node *)&an[1])
6505f1e03fSSam Leffler #endif /* _DEV_ATH_RATE_ONOE_H */
66