diff --git a/sys/dev/etherswitch/arswitch/arswitch_7240.c b/sys/dev/etherswitch/arswitch/arswitch_7240.c index c4b6ba87c09b..32769f69bcc9 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 37175738d3cf..ad0b4d5a5d8d 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