130c8bd5aSSridhar Samudrala /* SPDX-License-Identifier: GPL-2.0 */ 230c8bd5aSSridhar Samudrala /* Copyright (c) 2018, Intel Corporation. */ 330c8bd5aSSridhar Samudrala 430c8bd5aSSridhar Samudrala #ifndef _FAILOVER_H 530c8bd5aSSridhar Samudrala #define _FAILOVER_H 630c8bd5aSSridhar Samudrala 730c8bd5aSSridhar Samudrala #include <linux/netdevice.h> 830c8bd5aSSridhar Samudrala 930c8bd5aSSridhar Samudrala struct failover_ops { 1030c8bd5aSSridhar Samudrala int (*slave_pre_register)(struct net_device *slave_dev, 1130c8bd5aSSridhar Samudrala struct net_device *failover_dev); 1230c8bd5aSSridhar Samudrala int (*slave_register)(struct net_device *slave_dev, 1330c8bd5aSSridhar Samudrala struct net_device *failover_dev); 1430c8bd5aSSridhar Samudrala int (*slave_pre_unregister)(struct net_device *slave_dev, 1530c8bd5aSSridhar Samudrala struct net_device *failover_dev); 1630c8bd5aSSridhar Samudrala int (*slave_unregister)(struct net_device *slave_dev, 1730c8bd5aSSridhar Samudrala struct net_device *failover_dev); 1830c8bd5aSSridhar Samudrala int (*slave_link_change)(struct net_device *slave_dev, 1930c8bd5aSSridhar Samudrala struct net_device *failover_dev); 2030c8bd5aSSridhar Samudrala int (*slave_name_change)(struct net_device *slave_dev, 2130c8bd5aSSridhar Samudrala struct net_device *failover_dev); 2230c8bd5aSSridhar Samudrala rx_handler_result_t (*slave_handle_frame)(struct sk_buff **pskb); 2330c8bd5aSSridhar Samudrala }; 2430c8bd5aSSridhar Samudrala 2530c8bd5aSSridhar Samudrala struct failover { 2630c8bd5aSSridhar Samudrala struct list_head list; 2730c8bd5aSSridhar Samudrala struct net_device __rcu *failover_dev; 28*095e200fSEric Dumazet netdevice_tracker dev_tracker; 2930c8bd5aSSridhar Samudrala struct failover_ops __rcu *ops; 3030c8bd5aSSridhar Samudrala }; 3130c8bd5aSSridhar Samudrala 3230c8bd5aSSridhar Samudrala struct failover *failover_register(struct net_device *dev, 3330c8bd5aSSridhar Samudrala struct failover_ops *ops); 3430c8bd5aSSridhar Samudrala void failover_unregister(struct failover *failover); 3530c8bd5aSSridhar Samudrala int failover_slave_unregister(struct net_device *slave_dev); 3630c8bd5aSSridhar Samudrala 3730c8bd5aSSridhar Samudrala #endif /* _FAILOVER_H */ 38