1251881Speter/*
2251881Speter * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3251881Speter * Copyright (c) 2002-2008 Atheros Communications, Inc.
4251881Speter *
5251881Speter * Permission to use, copy, modify, and/or distribute this software for any
6251881Speter * purpose with or without fee is hereby granted, provided that the above
7251881Speter * copyright notice and this permission notice appear in all copies.
8251881Speter *
9251881Speter * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10251881Speter * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11251881Speter * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12251881Speter * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13251881Speter * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14251881Speter * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15251881Speter * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16251881Speter *
17251881Speter * $FreeBSD: releng/11.0/sys/dev/ath/ath_hal/ah_decode.h 269749 2014-08-09 09:13:10Z adrian $
18251881Speter */
19251881Speter#ifndef _ATH_AH_DECODE_H_
20251881Speter#define _ATH_AH_DECODE_H_
21251881Speter/*
22251881Speter * Register tracing support.
23251881Speter *
24251881Speter * Setting hw.ath.hal.alq=1 enables tracing of all register reads and
25251881Speter * writes to the file /tmp/ath_hal.log.  The file format is a simple
26251881Speter * fixed-size array of records.  When done logging set hw.ath.hal.alq=0
27251881Speter * and then decode the file with the arcode program (that is part of the
28251881Speter * HAL).  If you start+stop tracing the data will be appended to an
29251881Speter * existing file.
30251881Speter */
31251881Speterstruct athregrec {
32251881Speter	uint32_t	threadid;
33251881Speter	uint32_t	op	: 8,
34251881Speter			reg	: 24;
35251881Speter	uint32_t	val;
36251881Speter};
37251881Speter
38251881Speterenum {
39251881Speter	OP_READ		= 0,		/* register read */
40251881Speter	OP_WRITE	= 1,		/* register write */
41251881Speter	OP_DEVICE	= 2,		/* device identification */
42251881Speter	OP_MARK		= 3,		/* application marker */
43251881Speter};
44251881Speter
45251881Speterenum {
46251881Speter	AH_MARK_RESET,			/* ar*Reset entry, bChannelChange */
47251881Speter	AH_MARK_RESET_LINE,		/* ar*_reset.c, line %d */
48251881Speter	AH_MARK_RESET_DONE,		/* ar*Reset exit, error code */
49251881Speter	AH_MARK_CHIPRESET,		/* ar*ChipReset, channel num */
50251881Speter	AH_MARK_PERCAL,			/* ar*PerCalibration, channel num */
51251881Speter	AH_MARK_SETCHANNEL,		/* ar*SetChannel, channel num */
52251881Speter	AH_MARK_ANI_RESET,		/* ar*AniReset, opmode */
53251881Speter	AH_MARK_ANI_POLL,		/* ar*AniReset, listen time */
54251881Speter	AH_MARK_ANI_CONTROL,		/* ar*AniReset, cmd */
55251881Speter	AH_MARK_RX_CTL,			/* RX DMA control */
56251881Speter	AH_MARK_CHIP_POWER,		/* chip power control, mode */
57251881Speter	AH_MARK_CHIP_POWER_DONE,	/* chip power control done, status */
58251881Speter};
59251881Speter
60251881Speterenum {
61251881Speter	AH_MARK_RX_CTL_PCU_START,
62251881Speter	AH_MARK_RX_CTL_PCU_STOP,
63251881Speter	AH_MARK_RX_CTL_DMA_START,
64251881Speter	AH_MARK_RX_CTL_DMA_STOP,
65251881Speter	AH_MARK_RX_CTL_DMA_STOP_ERR,
66251881Speter	AH_MARK_RX_CTL_DMA_STOP_OK,
67251881Speter};
68251881Speter
69251881Speter#endif /* _ATH_AH_DECODE_H_ */
70251881Speter