xref: /freebsd/sys/dev/ath/ath_hal/ah_diagcodes.h (revision 4928135658a9d0eaee37003df6137ab363fcb0b4)
1 /*-
2  * SPDX-License-Identifier: ISC
3  *
4  * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
5  * Copyright (c) 2002-2008 Atheros Communications, Inc.
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  *
19  * $FreeBSD$
20  */
21 #ifndef _ATH_AH_DIAGCODES_H_
22 #define _ATH_AH_DIAGCODES_H_
23 /*
24  * Atheros Device Hardware Access Layer (HAL).
25  *
26  * Internal diagnostic API definitions.
27  */
28 
29 /*
30  * Diagnostic interface.  This is an open-ended interface that
31  * is opaque to applications.  Diagnostic programs use this to
32  * retrieve internal data structures, etc.  There is no guarantee
33  * that calling conventions for calls other than HAL_DIAG_REVS
34  * are stable between HAL releases; a diagnostic application must
35  * use the HAL revision information to deal with ABI/API differences.
36  *
37  * NB: do not renumber these, certain codes are publicly used.
38  */
39 enum {
40 	HAL_DIAG_REVS		= 0,	/* MAC/PHY/Radio revs */
41 	HAL_DIAG_EEPROM		= 1,	/* EEPROM contents */
42 	HAL_DIAG_EEPROM_EXP_11A	= 2,	/* EEPROM 5112 power exp for 11a */
43 	HAL_DIAG_EEPROM_EXP_11B	= 3,	/* EEPROM 5112 power exp for 11b */
44 	HAL_DIAG_EEPROM_EXP_11G	= 4,	/* EEPROM 5112 power exp for 11g */
45 	HAL_DIAG_ANI_CURRENT	= 5,	/* ANI current channel state */
46 	HAL_DIAG_ANI_OFDM	= 6,	/* ANI OFDM timing error stats */
47 	HAL_DIAG_ANI_CCK	= 7,	/* ANI CCK timing error stats */
48 	HAL_DIAG_ANI_STATS	= 8,	/* ANI statistics */
49 	HAL_DIAG_RFGAIN		= 9,	/* RfGain GAIN_VALUES */
50 	HAL_DIAG_RFGAIN_CURSTEP	= 10,	/* RfGain GAIN_OPTIMIZATION_STEP */
51 	HAL_DIAG_PCDAC		= 11,	/* PCDAC table */
52 	HAL_DIAG_TXRATES	= 12,	/* Transmit rate table */
53 	HAL_DIAG_REGS		= 13,	/* Registers */
54 	HAL_DIAG_ANI_CMD	= 14,	/* ANI issue command (XXX do not change!) */
55 	HAL_DIAG_SETKEY		= 15,	/* Set keycache backdoor */
56 	HAL_DIAG_RESETKEY	= 16,	/* Reset keycache backdoor */
57 	HAL_DIAG_EEREAD		= 17,	/* Read EEPROM word */
58 	HAL_DIAG_EEWRITE	= 18,	/* Write EEPROM word */
59 	/* 19-26 removed, do not reuse */
60 	HAL_DIAG_RDWRITE	= 27,	/* Write regulatory domain */
61 	HAL_DIAG_RDREAD		= 28,	/* Get regulatory domain */
62 	HAL_DIAG_FATALERR	= 29,	/* Read cached interrupt state */
63 	HAL_DIAG_11NCOMPAT	= 30,	/* 11n compatibility tweaks */
64 	HAL_DIAG_ANI_PARAMS	= 31,	/* ANI noise immunity parameters */
65 	HAL_DIAG_CHECK_HANGS	= 32,	/* check h/w hangs */
66 	HAL_DIAG_SETREGS	= 33,	/* write registers */
67 	HAL_DIAG_CHANSURVEY	= 34,	/* channel survey */
68 	HAL_DIAG_PRINT_REG	= 35,
69 	HAL_DIAG_PRINT_REG_ALL	= 36,
70 	HAL_DIAG_CHANNELS	= 37,
71 	HAL_DIAG_PRINT_REG_COUNTER	= 38,
72 };
73 
74 #endif /* _ATH_AH_DIAGCODES_H_ */
75