1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* Copyright (C) 2018-2021, Intel Corporation. */ 3 4 #ifndef _ICE_LAG_H_ 5 #define _ICE_LAG_H_ 6 7 #include <linux/netdevice.h> 8 9 /* LAG roles for netdev */ 10 enum ice_lag_role { 11 ICE_LAG_NONE, 12 ICE_LAG_PRIMARY, 13 ICE_LAG_BACKUP, 14 ICE_LAG_UNSET 15 }; 16 17 struct ice_pf; 18 19 /* LAG info struct */ 20 struct ice_lag { 21 struct ice_pf *pf; /* backlink to PF struct */ 22 struct net_device *netdev; /* this PF's netdev */ 23 struct net_device *peer_netdev; 24 struct net_device *upper_netdev; /* upper bonding netdev */ 25 struct notifier_block notif_block; 26 u8 bonded:1; /* currently bonded */ 27 u8 primary:1; /* this is primary */ 28 u8 role; 29 }; 30 31 int ice_init_lag(struct ice_pf *pf); 32 void ice_deinit_lag(struct ice_pf *pf); 33 #endif /* _ICE_LAG_H_ */ 34