summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2016-03-21 03:16:56 +0000
committerloos <loos@FreeBSD.org>2016-03-21 03:16:56 +0000
commit9b9af6bda46f5b65184ff0fb62d93dbad9640a0c (patch)
treecfd8570efef6c5fe440d0bfab878aa7384a05a63
parente0eb163b4d4a25d59deb1c57e8ece579d0e37a88 (diff)
downloadFreeBSD-src-9b9af6bda46f5b65184ff0fb62d93dbad9640a0c.zip
FreeBSD-src-9b9af6bda46f5b65184ff0fb62d93dbad9640a0c.tar.gz
Enable multicast addresses on vlan ports. Fixes the reception of broadcast
packets on vlan aware mode. Sponsored by: Rubicon Communications (Netgate)
-rw-r--r--sys/arm/ti/cpsw/if_cpsw.c14
-rw-r--r--sys/arm/ti/cpsw/if_cpswreg.h4
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c
index d3cdd22..4486e0f 100644
--- a/sys/arm/ti/cpsw/if_cpsw.c
+++ b/sys/arm/ti/cpsw/if_cpsw.c
@@ -140,7 +140,8 @@ static void cpsw_ale_read_entry(struct cpsw_softc *, uint16_t, uint32_t *);
static void cpsw_ale_write_entry(struct cpsw_softc *, uint16_t, uint32_t *);
static int cpsw_ale_mc_entry_set(struct cpsw_softc *, uint8_t, int, uint8_t *);
static void cpsw_ale_dump_table(struct cpsw_softc *);
-static int cpsw_ale_update_vlan_table(struct cpsw_softc *, int, int, int);
+static int cpsw_ale_update_vlan_table(struct cpsw_softc *, int, int, int, int,
+ int);
static int cpswp_ale_update_addresses(struct cpswp_softc *, int);
/* Statistics and sysctls. */
@@ -1148,8 +1149,9 @@ cpswp_init_locked(void *arg)
cpsw_write_4(sc->swsc, CPSW_PORT_P_VLAN(sc->unit + 1),
sc->vlan & 0xfff);
cpsw_ale_update_vlan_table(sc->swsc, sc->vlan,
- (1 << (sc->unit + 1)) | (1 << 0),
- (1 << (sc->unit + 1)) | (1 << 0));
+ (1 << (sc->unit + 1)) | (1 << 0), /* Member list */
+ (1 << (sc->unit + 1)) | (1 << 0), /* Untagged egress */
+ (1 << (sc->unit + 1)) | (1 << 0), 0); /* mcast reg flood */
}
mii_mediachg(sc->mii);
@@ -2368,7 +2370,8 @@ cpswp_ale_update_addresses(struct cpswp_softc *sc, int purge)
}
static int
-cpsw_ale_update_vlan_table(struct cpsw_softc *sc, int vlan, int ports, int untag)
+cpsw_ale_update_vlan_table(struct cpsw_softc *sc, int vlan, int ports,
+ int untag, int mcregflood, int mcunregflood)
{
int free_index, i, matching_index;
uint32_t ale_entry[3];
@@ -2394,7 +2397,8 @@ cpsw_ale_update_vlan_table(struct cpsw_softc *sc, int vlan, int ports, int untag
i = free_index;
}
- ale_entry[0] = (untag & 7) << 24 | (ports & 7);
+ ale_entry[0] = (untag & 7) << 24 | (mcregflood & 7) << 16 |
+ (mcunregflood & 7) << 8 | (ports & 7);
ale_entry[1] = ALE_TYPE_VLAN << 28 | vlan << 16;
ale_entry[2] = 0;
cpsw_ale_write_entry(sc, i, ale_entry);
diff --git a/sys/arm/ti/cpsw/if_cpswreg.h b/sys/arm/ti/cpsw/if_cpswreg.h
index 030373a..bea6f19 100644
--- a/sys/arm/ti/cpsw/if_cpswreg.h
+++ b/sys/arm/ti/cpsw/if_cpswreg.h
@@ -98,8 +98,8 @@
#define ALE_TYPE_VLAN 2
#define ALE_TYPE_VLAN_ADDR 3
#define ALE_VLAN(_a) ((_a[1] >> 16) & 0xfff)
-#define ALE_VLAN_REGFLOOD(_a) ((_a[0] >> 8) & 7)
-#define ALE_VLAN_UNREGFLOOD(_a) ((_a[0] >> 16) & 7)
+#define ALE_VLAN_UNREGFLOOD(_a) ((_a[0] >> 8) & 7)
+#define ALE_VLAN_REGFLOOD(_a) ((_a[0] >> 16) & 7)
#define ALE_VLAN_UNTAG(_a) ((_a[0] >> 24) & 7)
#define ALE_VLAN_MEMBERS(_a) (_a[0] & 7)
#define CPSW_ALE_PORTCTL(p) (CPSW_ALE_OFFSET + 0x40 + ((p) * 0x04))
OpenPOWER on IntegriCloud