diff options
Diffstat (limited to 'include/net/bonding.h')
| -rw-r--r-- | include/net/bonding.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/bonding.h b/include/net/bonding.h index 29f53eacac0a..4e17095ad46a 100644 --- a/include/net/bonding.h +++ b/include/net/bonding.h | |||
| @@ -150,6 +150,12 @@ struct bond_parm_tbl { | |||
| 150 | int mode; | 150 | int mode; |
| 151 | }; | 151 | }; |
| 152 | 152 | ||
| 153 | struct netdev_notify_work { | ||
| 154 | struct delayed_work work; | ||
| 155 | struct slave *slave; | ||
| 156 | struct net_device *dev; | ||
| 157 | }; | ||
| 158 | |||
| 153 | struct slave { | 159 | struct slave { |
| 154 | struct net_device *dev; /* first - useful for panic debug */ | 160 | struct net_device *dev; /* first - useful for panic debug */ |
| 155 | struct bonding *bond; /* our master */ | 161 | struct bonding *bond; /* our master */ |
| @@ -243,6 +249,8 @@ struct bonding { | |||
| 243 | #define bond_slave_get_rtnl(dev) \ | 249 | #define bond_slave_get_rtnl(dev) \ |
| 244 | ((struct slave *) rtnl_dereference(dev->rx_handler_data)) | 250 | ((struct slave *) rtnl_dereference(dev->rx_handler_data)) |
| 245 | 251 | ||
| 252 | void bond_queue_slave_event(struct slave *slave); | ||
| 253 | |||
| 246 | struct bond_vlan_tag { | 254 | struct bond_vlan_tag { |
| 247 | __be16 vlan_proto; | 255 | __be16 vlan_proto; |
| 248 | unsigned short vlan_id; | 256 | unsigned short vlan_id; |
| @@ -315,6 +323,7 @@ static inline void bond_set_active_slave(struct slave *slave) | |||
| 315 | { | 323 | { |
| 316 | if (slave->backup) { | 324 | if (slave->backup) { |
| 317 | slave->backup = 0; | 325 | slave->backup = 0; |
| 326 | bond_queue_slave_event(slave); | ||
| 318 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); | 327 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); |
| 319 | } | 328 | } |
| 320 | } | 329 | } |
| @@ -323,6 +332,7 @@ static inline void bond_set_backup_slave(struct slave *slave) | |||
| 323 | { | 332 | { |
| 324 | if (!slave->backup) { | 333 | if (!slave->backup) { |
| 325 | slave->backup = 1; | 334 | slave->backup = 1; |
| 335 | bond_queue_slave_event(slave); | ||
| 326 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); | 336 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); |
| 327 | } | 337 | } |
| 328 | } | 338 | } |
| @@ -336,6 +346,7 @@ static inline void bond_set_slave_state(struct slave *slave, | |||
| 336 | slave->backup = slave_state; | 346 | slave->backup = slave_state; |
| 337 | if (notify) { | 347 | if (notify) { |
| 338 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); | 348 | rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); |
| 349 | bond_queue_slave_event(slave); | ||
| 339 | slave->should_notify = 0; | 350 | slave->should_notify = 0; |
| 340 | } else { | 351 | } else { |
| 341 | if (slave->should_notify) | 352 | if (slave->should_notify) |
| @@ -490,6 +501,12 @@ static inline bool bond_is_slave_inactive(struct slave *slave) | |||
| 490 | return slave->inactive; | 501 | return slave->inactive; |
| 491 | } | 502 | } |
| 492 | 503 | ||
| 504 | static inline void bond_set_slave_link_state(struct slave *slave, int state) | ||
| 505 | { | ||
| 506 | slave->link = state; | ||
| 507 | bond_queue_slave_event(slave); | ||
| 508 | } | ||
| 509 | |||
| 493 | static inline __be32 bond_confirm_addr(struct net_device *dev, __be32 dst, __be32 local) | 510 | static inline __be32 bond_confirm_addr(struct net_device *dev, __be32 dst, __be32 local) |
| 494 | { | 511 | { |
| 495 | struct in_device *in_dev; | 512 | struct in_device *in_dev; |
