summaryrefslogtreecommitdiff
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r--drivers/net/bonding/bonding.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 105c552f96d8..1a27c18be21c 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -54,12 +54,6 @@
((slave)->link == BOND_LINK_UP) && \
bond_is_active_slave(slave))
-
-#define USES_PRIMARY(mode) \
- (((mode) == BOND_MODE_ACTIVEBACKUP) || \
- ((mode) == BOND_MODE_TLB) || \
- ((mode) == BOND_MODE_ALB))
-
#define IS_IP_TARGET_UNUSABLE_ADDRESS(a) \
((htonl(INADDR_BROADCAST) == a) || \
ipv4_is_zeronet(a))
@@ -293,6 +287,17 @@ static inline bool bond_mode_uses_arp(int mode)
mode != BOND_MODE_ALB;
}
+static inline bool bond_mode_uses_primary(int mode)
+{
+ return mode == BOND_MODE_ACTIVEBACKUP || mode == BOND_MODE_TLB ||
+ mode == BOND_MODE_ALB;
+}
+
+static inline bool bond_uses_primary(struct bonding *bond)
+{
+ return bond_mode_uses_primary(bond->params.mode);
+}
+
static inline void bond_set_active_slave(struct slave *slave)
{
if (slave->backup) {