Author: adrian
Date: Sun Feb  4 08:22:11 2018
New Revision: 328838
URL: https://svnweb.freebsd.org/changeset/base/328838

Log:
  [arswitch] fix up issues on the AR8327.
  
  This correctly dumps the ethernet bridge contents on an AR8327 switch.
  
  Tested:
  
  * AP135 - QCA9550 + AR8327 ethernet switch:
  
  # etherswitchcfg atu dump
   [0] c0:3f:d5:7e:6f:45: portmask 0x00000004
   [1] f6:b6:03:96:1e:ba: portmask 0x00000004
   [2] 00:03:7f:11:38:4f: portmask 0x00000040
  # arp -na
  ? (192.168.3.170) at 00:03:7f:11:38:4f on arge0 permanent [ethernet]
  ? (192.168.3.12) at c0:3f:d5:7e:6f:45 on arge0 expires in 1188 seconds 
[ethernet]
  ? (192.168.3.1) at f6:b6:03:96:1e:ba on arge0 expires in 1186 seconds 
[ethernet]

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

Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c
==============================================================================
--- head/sys/dev/etherswitch/arswitch/arswitch_8327.c   Sun Feb  4 03:15:06 
2018        (r328837)
+++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c   Sun Feb  4 08:22:11 
2018        (r328838)
@@ -1151,12 +1151,12 @@ ar8327_atu_fetch_table(struct arswitch_softc *sc, ethe
                        return (-1);
 
                /* MAC address */
-               e->es_macaddr[5] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR5);
-               e->es_macaddr[4] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR4);
-               e->es_macaddr[3] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR3);
-               e->es_macaddr[2] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR2);
-               e->es_macaddr[1] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR1);
-               e->es_macaddr[0] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR0);
+               e->es_macaddr[5] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR3);
+               e->es_macaddr[4] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR2);
+               e->es_macaddr[3] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR1);
+               e->es_macaddr[2] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR0);
+               e->es_macaddr[0] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR5);
+               e->es_macaddr[1] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR4);
 
                /* Bitmask of ports this entry is for */
                e->es_portmask = MS(ret1, AR8327_ATU_DATA1_DEST_PORT);

Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h
==============================================================================
--- head/sys/dev/etherswitch/arswitch/arswitchreg.h     Sun Feb  4 03:15:06 
2018        (r328837)
+++ head/sys/dev/etherswitch/arswitch/arswitchreg.h     Sun Feb  4 08:22:11 
2018        (r328838)
@@ -498,7 +498,7 @@
 #define                AR8327_ATU_DATA1_MAC_ADDR4              BITS(0, 8)
 #define                AR8327_ATU_DATA1_MAC_ADDR4_S            0
 #define                AR8327_ATU_DATA1_MAC_ADDR5              BITS(8, 8)
-#define                AR8327_ATU_DATA1_MAC_ADDR5_S            0
+#define                AR8327_ATU_DATA1_MAC_ADDR5_S            8
 #define                AR8327_ATU_DATA1_DEST_PORT              BITS(16, 7)
 #define                AR8327_ATU_DATA1_DEST_PORT_S            16
 #define                AR8327_ATU_DATA1_CROSS_PORT_STATE_EN    BIT(23)
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to