Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Feb 2014 04:30:53 +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: r262201 - head/sys/dev/etherswitch/arswitch
Message-ID:  <201402190430.s1J4Ur2d025346@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Wed Feb 19 04:30:53 2014
New Revision: 262201
URL: http://svnweb.freebsd.org/changeset/base/262201

Log:
  Store away the chip version and revision; some AR8327 code depends upon
  the chip revision.

Modified:
  head/sys/dev/etherswitch/arswitch/arswitch.c
  head/sys/dev/etherswitch/arswitch/arswitchvar.h

Modified: head/sys/dev/etherswitch/arswitch/arswitch.c
==============================================================================
--- head/sys/dev/etherswitch/arswitch/arswitch.c	Wed Feb 19 04:23:01 2014	(r262200)
+++ head/sys/dev/etherswitch/arswitch/arswitch.c	Wed Feb 19 04:30:53 2014	(r262201)
@@ -112,6 +112,8 @@ arswitch_probe(device_t dev)
 
 	/* AR8xxx probe */
 	id = arswitch_readreg(dev, AR8X16_REG_MASK_CTRL);
+	sc->chip_rev = (id & AR8X16_MASK_CTRL_REV_MASK);
+	sc->chip_ver = (id & AR8X16_MASK_CTRL_VER_MASK) > AR8X16_MASK_CTRL_VER_SHIFT;
 	switch (id & (AR8X16_MASK_CTRL_VER_MASK | AR8X16_MASK_CTRL_REV_MASK)) {
 	case 0x0101:
 		chipname = "AR8216";

Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h
==============================================================================
--- head/sys/dev/etherswitch/arswitch/arswitchvar.h	Wed Feb 19 04:23:01 2014	(r262200)
+++ head/sys/dev/etherswitch/arswitch/arswitchvar.h	Wed Feb 19 04:30:53 2014	(r262201)
@@ -53,6 +53,8 @@ struct arswitch_softc {
 	int		is_mii;		/* PHY mode is MII (XXX which PHY?) */
 	int		page;
 	int		is_internal_switch;
+	int		chip_ver;
+	int		chip_rev;
 	int		mii_lo_first;
 	ar8x16_switch_type	sc_switchtype;
 	char		*ifname[AR8X16_NUM_PHYS];



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