--- zzzz-none-000/linux-4.1.52/net/bridge/br_sysfs_if.c 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/net/bridge/br_sysfs_if.c 2022-03-02 11:37:13.000000000 +0000 @@ -172,6 +172,7 @@ BRPORT_ATTR_FLAG(unicast_flood, BR_FLOOD); BRPORT_ATTR_FLAG(proxyarp, BR_PROXYARP); BRPORT_ATTR_FLAG(proxyarp_wifi, BR_PROXYARP_WIFI); +BRPORT_ATTR_FLAG(isolated, BR_ISOLATED); #ifdef CONFIG_BRIDGE_IGMP_SNOOPING static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) @@ -190,6 +191,37 @@ BRPORT_ATTR_FLAG(multicast_fast_leave, BR_MULTICAST_FAST_LEAVE); #endif +#if defined(CONFIG_BCM_KF_BRIDGE_MAC_FDB_LIMIT) && defined(CONFIG_BCM_BRIDGE_MAC_FDB_LIMIT) +static ssize_t show_used_num_fdb_entries(struct net_bridge_port *p, char *buf) +{ + return sprintf(buf, "%d\n", p->num_port_fdb_entries); +} +static BRPORT_ATTR(used_fdb_entries, S_IRUGO, show_used_num_fdb_entries, NULL); + +static ssize_t show_max_num_fdb_entries(struct net_bridge_port *p, char *buf) +{ + return sprintf(buf, "%d\n", p->max_port_fdb_entries); +} + +int store_max_num_fdb_entries(struct net_bridge_port *p, unsigned long maxentries) +{ + return br_set_fdb_limit(p->br, p, 1, 0, (int)maxentries); +} +static BRPORT_ATTR(max_fdb_entries, S_IRUGO | S_IWUSR, show_max_num_fdb_entries, store_max_num_fdb_entries); + +static ssize_t show_min_num_fdb_entries(struct net_bridge_port *p, char *buf) +{ + return sprintf(buf, "%d\n", p->min_port_fdb_entries); +} + +int store_min_num_fdb_entries(struct net_bridge_port *p, unsigned long minentries) +{ + return br_set_fdb_limit(p->br, p, 1, 1, (int)minentries); +} +static BRPORT_ATTR(min_fdb_entries, S_IRUGO | S_IWUSR, show_min_num_fdb_entries, store_min_num_fdb_entries); +#endif + + static const struct brport_attribute *brport_attrs[] = { &brport_attr_path_cost, &brport_attr_priority, @@ -217,6 +249,12 @@ #endif &brport_attr_proxyarp, &brport_attr_proxyarp_wifi, +#if defined(CONFIG_BCM_KF_BRIDGE_MAC_FDB_LIMIT) && defined(CONFIG_BCM_BRIDGE_MAC_FDB_LIMIT) + &brport_attr_used_fdb_entries, + &brport_attr_max_fdb_entries, + &brport_attr_min_fdb_entries, +#endif + &brport_attr_isolated, NULL };