Author: adrian
Date: Sat May 12 06:24:21 2012
New Revision: 235325
URL: http://svn.freebsd.org/changeset/base/235325

Log:
  * 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 <kel...@ieee.org>

Modified:
  head/sys/dev/etherswitch/arswitch/arswitch_7240.c
  head/sys/dev/etherswitch/arswitch/arswitchreg.h

Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c
==============================================================================
--- head/sys/dev/etherswitch/arswitch/arswitch_7240.c   Sat May 12 05:27:14 
2012        (r235324)
+++ head/sys/dev/etherswitch/arswitch/arswitch_7240.c   Sat May 12 06:24:21 
2012        (r235325)
@@ -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 *s
 {
 
        /* 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

Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h
==============================================================================
--- head/sys/dev/etherswitch/arswitch/arswitchreg.h     Sat May 12 05:27:14 
2012        (r235324)
+++ head/sys/dev/etherswitch/arswitch/arswitchreg.h     Sat May 12 06:24:21 
2012        (r235325)
@@ -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
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to