summaryrefslogtreecommitdiffstats
path: root/sys/arm/ti
diff options
context:
space:
mode:
authorLuiz Souza <luiz@netgate.com>2017-11-16 19:53:21 -0200
committerLuiz Souza <luiz@netgate.com>2017-11-16 19:54:50 -0200
commit79c92265a31b47b28913d2f976de5cbe91291cc1 (patch)
tree36108af11cd52695d86db6e2b68eb20be8e03e3f /sys/arm/ti
parentd60057b60233b8248a61bc2b11ec2f4cef9c82b5 (diff)
downloadFreeBSD-src-79c92265a31b47b28913d2f976de5cbe91291cc1.zip
FreeBSD-src-79c92265a31b47b28913d2f976de5cbe91291cc1.tar.gz
Add support to IF_ALLMULTI which enable the reception of all the multicast frames in a interface.
Ticket #7710 (cherry picked from commit d292b5ce7adecee7f57cee347735bc336ec225ee)
Diffstat (limited to 'sys/arm/ti')
-rw-r--r--sys/arm/ti/cpsw/if_cpsw.c19
-rw-r--r--sys/arm/ti/cpsw/if_cpswvar.h3
2 files changed, 13 insertions, 9 deletions
diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c
index 2aa2ac6..a887561 100644
--- a/sys/arm/ti/cpsw/if_cpsw.c
+++ b/sys/arm/ti/cpsw/if_cpsw.c
@@ -1140,7 +1140,7 @@ cpswp_init_locked(void *arg)
#endif
struct cpswp_softc *sc = arg;
struct ifnet *ifp;
- uint32_t reg;
+ uint32_t ports, reg;
CPSW_DEBUGF(sc->swsc, (""));
CPSW_PORT_LOCK_ASSERT(sc);
@@ -1177,10 +1177,13 @@ cpswp_init_locked(void *arg)
/* Set Port VID. */
cpsw_write_4(sc->swsc, CPSW_PORT_P_VLAN(sc->unit + 1),
sc->vlan & 0xfff);
+ /* Default to port + CPU port. */
+ ports = (1 << (sc->unit + 1)) | (1 << 0);
cpsw_ale_update_vlan_table(sc->swsc, sc->vlan,
- (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 */
+ ports, /* Member list */
+ ports, /* Untagged egress */
+ ports, /* Mcast reg flood */
+ (sc->swsc->allmulti ? ports : 0)); /* Mcast unreg flood */
#ifdef CPSW_ETHERSWITCH
for (i = 0; i < CPSW_VLANS; i++) {
if (cpsw_vgroups[i].vid != -1)
@@ -1371,9 +1374,8 @@ cpsw_set_promisc(struct cpswp_softc *sc, int set)
static void
cpsw_set_allmulti(struct cpswp_softc *sc, int set)
{
- if (set) {
- printf("All-multicast mode unimplemented\n");
- }
+ sc->swsc->allmulti = (set) ? true : false;
+ cpswp_ale_update_addresses(sc, 1);
}
static int
@@ -2954,7 +2956,8 @@ cpsw_setvgroup(device_t dev, etherswitch_vlangroup_t *vg)
cpsw_vgroups[vg->es_vlangroup].vid = vg->es_vid;
cpsw_ale_update_vlan_table(sc, vg->es_vid, vg->es_member_ports,
- vg->es_untagged_ports, vg->es_member_ports, 0);
+ vg->es_untagged_ports, vg->es_member_ports,
+ (sc->allmulti ? vg->es_member_ports : 0));
return (0);
}
diff --git a/sys/arm/ti/cpsw/if_cpswvar.h b/sys/arm/ti/cpsw/if_cpswvar.h
index 003af22..1333565 100644
--- a/sys/arm/ti/cpsw/if_cpswvar.h
+++ b/sys/arm/ti/cpsw/if_cpswvar.h
@@ -88,7 +88,8 @@ struct cpsw_softc {
device_t dev;
int active_slave;
int debug;
- int dualemac;
+ bool dualemac;
+ bool allmulti;
phandle_t node;
struct bintime attach_uptime; /* system uptime when attach happened. */
struct cpsw_port port[2];
OpenPOWER on IntegriCloud