--- zzzz-none-000/linux-4.1.38/net/bridge/br_sysfs_if.c 2017-01-18 18:48:06.000000000 +0000 +++ bcm63-7582-715/linux-4.1.38/net/bridge/br_sysfs_if.c 2020-11-25 10:06:48.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,62 @@ 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 + +#if defined(CONFIG_BCM_KF_STP_LOOP) && (defined(CONFIG_BCM_FBOND) || defined(CONFIG_BCM_FBOND_MODULE)) +static ssize_t show_bpdu_block(struct net_bridge_port *p, char *buf) +{ + return sprintf(buf, "%d\n", p->is_bpdu_blocked); +} + +int store_bpdu_block(struct net_bridge_port *p, unsigned long val) +{ + p->is_bpdu_blocked = !!val; + return 0; +} +static BRPORT_ATTR(stp_bpdu_blocked, S_IRUGO | S_IWUSR, show_bpdu_block, store_bpdu_block); + +static ssize_t show_dedicated_stp_port(struct net_bridge_port *p, char *buf) +{ + return sprintf(buf, "%d\n", p->is_dedicated_stp_port); +} + +int store_dedicated_stp_port(struct net_bridge_port *p, unsigned long val) +{ + p->is_dedicated_stp_port = !!val; + return 0; +} +static BRPORT_ATTR(stp_dedicated, S_IRUGO | S_IWUSR, show_dedicated_stp_port, store_dedicated_stp_port); +#endif + static const struct brport_attribute *brport_attrs[] = { &brport_attr_path_cost, &brport_attr_priority, @@ -217,6 +274,16 @@ #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 +#if defined(CONFIG_BCM_KF_STP_LOOP) && (defined(CONFIG_BCM_FBOND) || defined(CONFIG_BCM_FBOND_MODULE)) + &brport_attr_stp_bpdu_blocked, + &brport_attr_stp_dedicated, +#endif + &brport_attr_isolated, NULL };