Loading include/linux/if_bridge.h +12 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,11 @@ struct br_ip_list { #define BR_DEFAULT_AGEING_TIME (300 * HZ) //Handle HYFI_BRIDGING hooks related stuffs, only if HYFI_BRIDGE_HOOKS is defined #ifdef CONFIG_HYFI_BRIDGE_HOOKS struct net_bridge_port; #endif extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); #ifdef CONFIG_ENABLE_SFE Loading Loading @@ -151,4 +156,11 @@ br_port_flag_is_set(const struct net_device *dev, unsigned long flag) } #endif #ifdef CONFIG_HYFI_BRIDGE_HOOKS typedef void (br_notify_hook_t)(int group, int event, const void *ptr); extern br_notify_hook_t __rcu *br_notify_hook; typedef int (br_multicast_handle_hook_t)(const struct net_bridge_port *src, struct sk_buff *skb); extern br_multicast_handle_hook_t __rcu *br_multicast_handle_hook; #endif #endif net/bridge/Kconfig +12 −0 Original line number Diff line number Diff line Loading @@ -61,3 +61,15 @@ config BRIDGE_VLAN_FILTERING Say N to exclude this support and reduce the binary size. If unsure, say Y. config HYFI_BRIDGE_HOOKS bool "Port Hy-Fi Bridging Hooks" depends on BRIDGE depends on QGKI default y help If you say Y here, then the Port Hy-Fi Bridging Hooks will be enabled. Say N to exclude this support. If unsure, say Y. net/bridge/br.c +6 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,12 @@ static void __exit br_deinit(void) br_fdb_fini(); } #ifdef CONFIG_HYFI_BRIDGE_HOOKS /* Hook for bridge event notifications */ br_notify_hook_t __rcu *br_notify_hook __read_mostly; EXPORT_SYMBOL(br_notify_hook); #endif module_init(br_init) module_exit(br_deinit) MODULE_LICENSE("GPL"); Loading net/bridge/br_device.c +6 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,12 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev) if (is_broadcast_ether_addr(dest)) { br_flood(br, skb, BR_PKT_BROADCAST, false, true); } else if (is_multicast_ether_addr(dest)) { #ifdef CONFIG_HYFI_BRIDGE_HOOKS br_multicast_handle_hook_t *multicast_handle_hook = rcu_dereference(br_multicast_handle_hook); if (!__br_get(multicast_handle_hook, true, NULL, skb)) goto out; #endif if (unlikely(netpoll_tx_running(dev))) { br_flood(br, skb, BR_PKT_MULTICAST, false, true); goto out; Loading net/bridge/br_fdb.c +7 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,10 @@ struct net_bridge_fdb_entry *br_fdb_find_rcu(struct net_bridge *br, return fdb_find_rcu(&br->fdb_hash_tbl, addr, vid); } #ifdef CONFIG_HYFI_BRIDGE_HOOKS EXPORT_SYMBOL(br_fdb_find_rcu); #endif /* When a static FDB entry is added, the mac address from the entry is * added to the bridge private HW address list and all required ports * are then updated with the new information. Loading Loading @@ -709,6 +713,9 @@ static void fdb_notify(struct net_bridge *br, kfree_skb(skb); goto errout; } #ifdef CONFIG_HYFI_BRIDGE_HOOKS __br_notify(RTNLGRP_NEIGH, type, fdb); #endif rtnl_notify(skb, net, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC); return; errout: Loading Loading
include/linux/if_bridge.h +12 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,11 @@ struct br_ip_list { #define BR_DEFAULT_AGEING_TIME (300 * HZ) //Handle HYFI_BRIDGING hooks related stuffs, only if HYFI_BRIDGE_HOOKS is defined #ifdef CONFIG_HYFI_BRIDGE_HOOKS struct net_bridge_port; #endif extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); #ifdef CONFIG_ENABLE_SFE Loading Loading @@ -151,4 +156,11 @@ br_port_flag_is_set(const struct net_device *dev, unsigned long flag) } #endif #ifdef CONFIG_HYFI_BRIDGE_HOOKS typedef void (br_notify_hook_t)(int group, int event, const void *ptr); extern br_notify_hook_t __rcu *br_notify_hook; typedef int (br_multicast_handle_hook_t)(const struct net_bridge_port *src, struct sk_buff *skb); extern br_multicast_handle_hook_t __rcu *br_multicast_handle_hook; #endif #endif
net/bridge/Kconfig +12 −0 Original line number Diff line number Diff line Loading @@ -61,3 +61,15 @@ config BRIDGE_VLAN_FILTERING Say N to exclude this support and reduce the binary size. If unsure, say Y. config HYFI_BRIDGE_HOOKS bool "Port Hy-Fi Bridging Hooks" depends on BRIDGE depends on QGKI default y help If you say Y here, then the Port Hy-Fi Bridging Hooks will be enabled. Say N to exclude this support. If unsure, say Y.
net/bridge/br.c +6 −0 Original line number Diff line number Diff line Loading @@ -394,6 +394,12 @@ static void __exit br_deinit(void) br_fdb_fini(); } #ifdef CONFIG_HYFI_BRIDGE_HOOKS /* Hook for bridge event notifications */ br_notify_hook_t __rcu *br_notify_hook __read_mostly; EXPORT_SYMBOL(br_notify_hook); #endif module_init(br_init) module_exit(br_deinit) MODULE_LICENSE("GPL"); Loading
net/bridge/br_device.c +6 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,12 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev) if (is_broadcast_ether_addr(dest)) { br_flood(br, skb, BR_PKT_BROADCAST, false, true); } else if (is_multicast_ether_addr(dest)) { #ifdef CONFIG_HYFI_BRIDGE_HOOKS br_multicast_handle_hook_t *multicast_handle_hook = rcu_dereference(br_multicast_handle_hook); if (!__br_get(multicast_handle_hook, true, NULL, skb)) goto out; #endif if (unlikely(netpoll_tx_running(dev))) { br_flood(br, skb, BR_PKT_MULTICAST, false, true); goto out; Loading
net/bridge/br_fdb.c +7 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,10 @@ struct net_bridge_fdb_entry *br_fdb_find_rcu(struct net_bridge *br, return fdb_find_rcu(&br->fdb_hash_tbl, addr, vid); } #ifdef CONFIG_HYFI_BRIDGE_HOOKS EXPORT_SYMBOL(br_fdb_find_rcu); #endif /* When a static FDB entry is added, the mac address from the entry is * added to the bridge private HW address list and all required ports * are then updated with the new information. Loading Loading @@ -709,6 +713,9 @@ static void fdb_notify(struct net_bridge *br, kfree_skb(skb); goto errout; } #ifdef CONFIG_HYFI_BRIDGE_HOOKS __br_notify(RTNLGRP_NEIGH, type, fdb); #endif rtnl_notify(skb, net, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC); return; errout: Loading