summaryrefslogtreecommitdiffstats
path: root/sys/dev/etherswitch
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-05-12 06:24:21 +0000
committeradrian <adrian@FreeBSD.org>2012-05-12 06:24:21 +0000
commit5f43a79b472f819337fddc00406f01aa3b842fc8 (patch)
tree0bc4a9e7a1ccb92fa0b0b9ebdfc44b26b2d3cb6c /sys/dev/etherswitch
parent59f5193bc5d9a16761d0e536bbe5ab5e6dd7dee4 (diff)
downloadFreeBSD-src-5f43a79b472f819337fddc00406f01aa3b842fc8.zip
FreeBSD-src-5f43a79b472f819337fddc00406f01aa3b842fc8.tar.gz
* Remove the AR7240 register defines and reuse the AR8x16 defines.
* Include a new register define to represent "disable port mirroring to CPU port". Obtained from: Patrick Kelsey <kelsey@ieee.org>
Diffstat (limited to 'sys/dev/etherswitch')
-rw-r--r--sys/dev/etherswitch/arswitch/arswitch_7240.c10
-rw-r--r--sys/dev/etherswitch/arswitch/arswitchreg.h3
2 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/etherswitch/arswitch/arswitch_7240.c b/sys/dev/etherswitch/arswitch/arswitch_7240.c
index c4b6ba8..32769f6 100644
--- a/sys/dev/etherswitch/arswitch/arswitch_7240.c
+++ b/sys/dev/etherswitch/arswitch/arswitch_7240.c
@@ -66,11 +66,6 @@
/* XXX belongs in arswitch_7240_reg.h */
-#define AR7240_REG_CPU_PORT 0x78
-#define AR7240_MIRROR_PORT_MASK 0x000000f0
-#define AR7240_MIRROR_PORT_S 4
-#define AR7240_CPU_PORT_EN 0x00000100
-
#define AR7240_REG_TAG_PRIORITY 0x70
/*
@@ -81,9 +76,8 @@ ar7240_hw_setup(struct arswitch_softc *sc)
{
/* Enable CPU port; disable mirror port */
- arswitch_writereg(sc->sc_dev, AR7240_REG_CPU_PORT,
- AR7240_CPU_PORT_EN |
- (15 << AR7240_MIRROR_PORT_S));
+ arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT,
+ AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS);
/*
* Let things settle; probing PHY4 doesn't seem reliable
diff --git a/sys/dev/etherswitch/arswitch/arswitchreg.h b/sys/dev/etherswitch/arswitch/arswitchreg.h
index 3717573..ad0b4d5 100644
--- a/sys/dev/etherswitch/arswitch/arswitchreg.h
+++ b/sys/dev/etherswitch/arswitch/arswitchreg.h
@@ -122,6 +122,9 @@
#define AR8X16_REG_CPU_PORT 0x0078
#define AR8X16_MIRROR_PORT_SHIFT 4
+#define AR8X16_MIRROR_PORT_MASK (0xf << AR8X16_MIRROR_PORT_SHIFT)
+#define AR8X16_CPU_MIRROR_PORT(_p) ((_p) << AR8X16_MIRROR_PORT_SHIFT)
+#define AR8X16_CPU_MIRROR_DIS AR8X16_CPU_MIRROR_PORT(0xf)
#define AR8X16_CPU_PORT_EN (1 << 8)
#define AR8X16_REG_MIB_FUNC0 0x0080
OpenPOWER on IntegriCloud