Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jan 2011 04:57:27 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217618 - in head/sys/dev/ath: . ath_hal
Message-ID:  <201101200457.p0K4vRRq001182@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Thu Jan 20 04:57:26 2011
New Revision: 217618
URL: http://svn.freebsd.org/changeset/base/217618

Log:
  Break out the diagnostic codes from ah_internal.h and place them in ah_diagcodes.h.
  
  Since we now have the source code, there's no reason to hide the diag codes
  from other areas.
  
  They live in the HAL as they form part of the HAL API and should still be treate
  as "potentially flexible; don't publish as a public API." But since they're
  already used as a public API (see follow-up commit), we may as well use
  them in place of magic constants.

Added:
  head/sys/dev/ath/ath_hal/ah_diagcodes.h   (contents, props changed)
Modified:
  head/sys/dev/ath/ath_hal/ah_internal.h
  head/sys/dev/ath/if_ath.c

Added: head/sys/dev/ath/ath_hal/ah_diagcodes.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ath/ath_hal/ah_diagcodes.h	Thu Jan 20 04:57:26 2011	(r217618)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
+ * Copyright (c) 2002-2008 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+#ifndef _ATH_AH_DIAGCODES_H_
+#define _ATH_AH_DIAGCODES_H_
+/*
+ * Atheros Device Hardware Access Layer (HAL).
+ *
+ * Internal diagnostic API definitions.
+ */
+
+/*
+ * Diagnostic interface.  This is an open-ended interface that
+ * is opaque to applications.  Diagnostic programs use this to
+ * retrieve internal data structures, etc.  There is no guarantee
+ * that calling conventions for calls other than HAL_DIAG_REVS
+ * are stable between HAL releases; a diagnostic application must
+ * use the HAL revision information to deal with ABI/API differences.
+ *
+ * NB: do not renumber these, certain codes are publicly used.
+ */
+enum {
+	HAL_DIAG_REVS		= 0,	/* MAC/PHY/Radio revs */
+	HAL_DIAG_EEPROM		= 1,	/* EEPROM contents */
+	HAL_DIAG_EEPROM_EXP_11A	= 2,	/* EEPROM 5112 power exp for 11a */
+	HAL_DIAG_EEPROM_EXP_11B	= 3,	/* EEPROM 5112 power exp for 11b */
+	HAL_DIAG_EEPROM_EXP_11G	= 4,	/* EEPROM 5112 power exp for 11g */
+	HAL_DIAG_ANI_CURRENT	= 5,	/* ANI current channel state */
+	HAL_DIAG_ANI_OFDM	= 6,	/* ANI OFDM timing error stats */
+	HAL_DIAG_ANI_CCK	= 7,	/* ANI CCK timing error stats */
+	HAL_DIAG_ANI_STATS	= 8,	/* ANI statistics */
+	HAL_DIAG_RFGAIN		= 9,	/* RfGain GAIN_VALUES */
+	HAL_DIAG_RFGAIN_CURSTEP	= 10,	/* RfGain GAIN_OPTIMIZATION_STEP */
+	HAL_DIAG_PCDAC		= 11,	/* PCDAC table */
+	HAL_DIAG_TXRATES	= 12,	/* Transmit rate table */
+	HAL_DIAG_REGS		= 13,	/* Registers */
+	HAL_DIAG_ANI_CMD	= 14,	/* ANI issue command (XXX do not change!) */
+	HAL_DIAG_SETKEY		= 15,	/* Set keycache backdoor */
+	HAL_DIAG_RESETKEY	= 16,	/* Reset keycache backdoor */
+	HAL_DIAG_EEREAD		= 17,	/* Read EEPROM word */
+	HAL_DIAG_EEWRITE	= 18,	/* Write EEPROM word */
+	/* 19-26 removed, do not reuse */
+	HAL_DIAG_RDWRITE	= 27,	/* Write regulatory domain */
+	HAL_DIAG_RDREAD		= 28,	/* Get regulatory domain */
+	HAL_DIAG_FATALERR	= 29,	/* Read cached interrupt state */
+	HAL_DIAG_11NCOMPAT	= 30,	/* 11n compatibility tweaks */
+	HAL_DIAG_ANI_PARAMS	= 31,	/* ANI noise immunity parameters */
+	HAL_DIAG_CHECK_HANGS	= 32,	/* check h/w hangs */
+	HAL_DIAG_SETREGS	= 33,	/* write registers */
+};
+
+#endif /* _ATH_AH_DIAGCODES_H_ */

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_internal.h	Thu Jan 20 00:54:12 2011	(r217617)
+++ head/sys/dev/ath/ath_hal/ah_internal.h	Thu Jan 20 04:57:26 2011	(r217618)
@@ -589,45 +589,8 @@ extern	HAL_BOOL ath_hal_setcapability(st
 		HAL_CAPABILITY_TYPE type, uint32_t capability,
 		uint32_t setting, HAL_STATUS *status);
 
-/*
- * Diagnostic interface.  This is an open-ended interface that
- * is opaque to applications.  Diagnostic programs use this to
- * retrieve internal data structures, etc.  There is no guarantee
- * that calling conventions for calls other than HAL_DIAG_REVS
- * are stable between HAL releases; a diagnostic application must
- * use the HAL revision information to deal with ABI/API differences.
- *
- * NB: do not renumber these, certain codes are publicly used.
- */
-enum {
-	HAL_DIAG_REVS		= 0,	/* MAC/PHY/Radio revs */
-	HAL_DIAG_EEPROM		= 1,	/* EEPROM contents */
-	HAL_DIAG_EEPROM_EXP_11A	= 2,	/* EEPROM 5112 power exp for 11a */
-	HAL_DIAG_EEPROM_EXP_11B	= 3,	/* EEPROM 5112 power exp for 11b */
-	HAL_DIAG_EEPROM_EXP_11G	= 4,	/* EEPROM 5112 power exp for 11g */
-	HAL_DIAG_ANI_CURRENT	= 5,	/* ANI current channel state */
-	HAL_DIAG_ANI_OFDM	= 6,	/* ANI OFDM timing error stats */
-	HAL_DIAG_ANI_CCK	= 7,	/* ANI CCK timing error stats */
-	HAL_DIAG_ANI_STATS	= 8,	/* ANI statistics */
-	HAL_DIAG_RFGAIN		= 9,	/* RfGain GAIN_VALUES */
-	HAL_DIAG_RFGAIN_CURSTEP	= 10,	/* RfGain GAIN_OPTIMIZATION_STEP */
-	HAL_DIAG_PCDAC		= 11,	/* PCDAC table */
-	HAL_DIAG_TXRATES	= 12,	/* Transmit rate table */
-	HAL_DIAG_REGS		= 13,	/* Registers */
-	HAL_DIAG_ANI_CMD	= 14,	/* ANI issue command (XXX do not change!) */
-	HAL_DIAG_SETKEY		= 15,	/* Set keycache backdoor */
-	HAL_DIAG_RESETKEY	= 16,	/* Reset keycache backdoor */
-	HAL_DIAG_EEREAD		= 17,	/* Read EEPROM word */
-	HAL_DIAG_EEWRITE	= 18,	/* Write EEPROM word */
-	/* 19-26 removed, do not reuse */
-	HAL_DIAG_RDWRITE	= 27,	/* Write regulatory domain */
-	HAL_DIAG_RDREAD		= 28,	/* Get regulatory domain */
-	HAL_DIAG_FATALERR	= 29,	/* Read cached interrupt state */
-	HAL_DIAG_11NCOMPAT	= 30,	/* 11n compatibility tweaks */
-	HAL_DIAG_ANI_PARAMS	= 31,	/* ANI noise immunity parameters */
-	HAL_DIAG_CHECK_HANGS	= 32,	/* check h/w hangs */
-	HAL_DIAG_SETREGS	= 33,	/* write registers */
-};
+/* The diagnostic codes used to be internally defined here -adrian */
+#include "ah_diagcodes.h"
 
 enum {
     HAL_BB_HANG_DFS		= 0x0001,

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Thu Jan 20 00:54:12 2011	(r217617)
+++ head/sys/dev/ath/if_ath.c	Thu Jan 20 04:57:26 2011	(r217618)
@@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$");
 
 #include <dev/ath/if_athvar.h>
 #include <dev/ath/ath_hal/ah_devid.h>		/* XXX for softled */
+#include <dev/ath/ath_hal/ah_diagcodes.h>
 
 #ifdef ATH_TX99_DIAG
 #include <dev/ath/ath_tx99/ath_tx99.h>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101200457.p0K4vRRq001182>