Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Feb 2009 23:41:12 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r188968 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416
Message-ID:  <200902232341.n1NNfCpr043130@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Mon Feb 23 23:41:12 2009
New Revision: 188968
URL: http://svn.freebsd.org/changeset/base/188968

Log:
  print mac+rf part names; drop the printing 2ghz rf stuff (might come back)

Modified:
  head/sys/dev/ath/ath_hal/ah.c
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/ath_hal/ah.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.c	Mon Feb 23 23:30:17 2009	(r188967)
+++ head/sys/dev/ath/ath_hal/ah.c	Mon Feb 23 23:41:12 2009	(r188968)
@@ -22,6 +22,8 @@
 #include "ah_internal.h"
 #include "ah_devid.h"
 
+#include "ar5416/ar5416reg.h"		/* NB: includes ar5212reg.h */
+
 /* linker set of registered chips */
 OS_SET_DECLARE(ah_chips, struct ath_hal_chip);
 
@@ -78,6 +80,44 @@ ath_hal_attach(uint16_t devid, HAL_SOFTC
 	return AH_NULL;
 }
 
+const char *
+ath_hal_mac_name(struct ath_hal *ah)
+{
+	switch (ah->ah_macVersion) {
+	case AR_SREV_VERSION_CRETE:
+	case AR_SREV_VERSION_MAUI_1:
+		return "5210";
+	case AR_SREV_VERSION_MAUI_2:
+	case AR_SREV_VERSION_OAHU:
+		return "5211";
+	case AR_SREV_VERSION_VENICE:
+		return "5212";
+	case AR_SREV_VERSION_GRIFFIN:
+		return "2413";
+	case AR_SREV_VERSION_CONDOR:
+		return "5424";
+	case AR_SREV_VERSION_EAGLE:
+		return "5413";
+	case AR_SREV_VERSION_COBRA:
+		return "2415";
+	case AR_SREV_2425:
+		return "2425";
+	case AR_SREV_2417:
+		return "2417";
+	case AR_XSREV_VERSION_OWL_PCI:
+		return "5416";
+	case AR_XSREV_VERSION_OWL_PCIE:
+		return "5418";
+	case AR_XSREV_VERSION_SOWL:
+		return "9160";
+	case AR_XSREV_VERSION_MERLIN:
+		return "9280";
+	case AR_XSREV_VERSION_KITE:
+		return "9285";
+	}
+	return "????";
+}
+
 /*
  * Return the mask of available modes based on the hardware capabilities.
  */
@@ -108,6 +148,48 @@ ath_hal_rfprobe(struct ath_hal *ah, HAL_
 	return AH_NULL;
 }
 
+const char *
+ath_hal_rf_name(struct ath_hal *ah)
+{
+	switch (ah->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR) {
+	case 0:			/* 5210 */
+		return "5110";	/* NB: made up */
+	case AR_RAD5111_SREV_MAJOR:
+	case AR_RAD5111_SREV_PROD:
+		return "5111";
+	case AR_RAD2111_SREV_MAJOR:
+		return "2111";
+	case AR_RAD5112_SREV_MAJOR:
+	case AR_RAD5112_SREV_2_0:
+	case AR_RAD5112_SREV_2_1:
+		return "5112";
+	case AR_RAD2112_SREV_MAJOR:
+	case AR_RAD2112_SREV_2_0:
+	case AR_RAD2112_SREV_2_1:
+		return "2112";
+	case AR_RAD2413_SREV_MAJOR:
+		return "2413";
+	case AR_RAD5413_SREV_MAJOR:
+		return "5413";
+	case AR_RAD2316_SREV_MAJOR:
+		return "2316";
+	case AR_RAD2317_SREV_MAJOR:
+		return "2317";
+	case AR_RAD5424_SREV_MAJOR:
+		return "5424";
+
+	case AR_RAD5133_SREV_MAJOR:
+		return "5133";
+	case AR_RAD2133_SREV_MAJOR:
+		return "2133";
+	case AR_RAD5122_SREV_MAJOR:
+		return "5122";
+	case AR_RAD2122_SREV_MAJOR:
+		return "2122";
+	}
+	return "????";
+}
+
 /*
  * Poll the register looking for a specific value.
  */

Modified: head/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.h	Mon Feb 23 23:30:17 2009	(r188967)
+++ head/sys/dev/ath/ath_hal/ah.h	Mon Feb 23 23:41:12 2009	(r188968)
@@ -789,6 +789,9 @@ extern	const char *__ahdecl ath_hal_prob
 extern	struct ath_hal * __ahdecl ath_hal_attach(uint16_t devid, HAL_SOFTC,
 		HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS* status);
 
+extern	const char *ath_hal_mac_name(struct ath_hal *);
+extern	const char *ath_hal_rf_name(struct ath_hal *);
+
 /*
  * Regulatory interfaces.  Drivers should use ath_hal_init_channels to
  * request a set of channels for a particular country code and/or

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h	Mon Feb 23 23:30:17 2009	(r188967)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h	Mon Feb 23 23:41:12 2009	(r188968)
@@ -14,12 +14,12 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ar5416reg.h,v 1.10 2008/11/11 00:11:30 sam Exp $
+ * $FreeBSD$
  */
 #ifndef _DEV_ATH_AR5416REG_H
 #define	_DEV_ATH_AR5416REG_H
 
-#include "ar5212/ar5212reg.h"
+#include <dev/ath/ath_hal/ar5212/ar5212reg.h>
 
 /*
  * Register added starting with the AR5416

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Mon Feb 23 23:30:17 2009	(r188967)
+++ head/sys/dev/ath/if_ath.c	Mon Feb 23 23:41:12 2009	(r188968)
@@ -7267,34 +7267,12 @@ bad:
 static void
 ath_announce(struct ath_softc *sc)
 {
-#define	HAL_MODE_DUALBAND	(HAL_MODE_11A|HAL_MODE_11B)
 	struct ifnet *ifp = sc->sc_ifp;
 	struct ath_hal *ah = sc->sc_ah;
-	u_int modes;
 
-	if_printf(ifp, "mac %d.%d phy %d.%d",
-		ah->ah_macVersion, ah->ah_macRev,
-		ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf);
-	/*
-	 * Print radio revision(s).  We check the wireless modes
-	 * to avoid falsely printing revs for inoperable parts.
-	 * Dual-band radio revs are returned in the 5Ghz rev number.
-	 */
-	modes = ath_hal_getwirelessmodes(ah);
-	if ((modes & HAL_MODE_DUALBAND) == HAL_MODE_DUALBAND) {
-		if (ah->ah_analog5GhzRev && ah->ah_analog2GhzRev)
-			printf(" 5ghz radio %d.%d 2ghz radio %d.%d",
-				ah->ah_analog5GhzRev >> 4,
-				ah->ah_analog5GhzRev & 0xf,
-				ah->ah_analog2GhzRev >> 4,
-				ah->ah_analog2GhzRev & 0xf);
-		else
-			printf(" radio %d.%d", ah->ah_analog5GhzRev >> 4,
-				ah->ah_analog5GhzRev & 0xf);
-	} else
-		printf(" radio %d.%d", ah->ah_analog5GhzRev >> 4,
-			ah->ah_analog5GhzRev & 0xf);
-	printf("\n");
+	if_printf(ifp, "AR%s mac %d.%d RF%s phy %d.%d\n",
+		ath_hal_mac_name(ah), ah->ah_macVersion, ah->ah_macRev,
+		ath_hal_rf_name(ah), ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf);
 	if (bootverbose) {
 		int i;
 		for (i = 0; i <= WME_AC_VO; i++) {
@@ -7310,7 +7288,6 @@ ath_announce(struct ath_softc *sc)
 		if_printf(ifp, "using %u rx buffers\n", ath_rxbuf);
 	if (ath_txbuf != ATH_TXBUF)
 		if_printf(ifp, "using %u tx buffers\n", ath_txbuf);
-#undef HAL_MODE_DUALBAND
 }
 
 #ifdef ATH_SUPPORT_TDMA



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