diff options
Diffstat (limited to 'drivers/net/bonding/bond_sysfs_slave.c')
| -rw-r--r-- | drivers/net/bonding/bond_sysfs_slave.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c index 23618a831612..7d16c51e6913 100644 --- a/drivers/net/bonding/bond_sysfs_slave.c +++ b/drivers/net/bonding/bond_sysfs_slave.c | |||
| @@ -80,6 +80,36 @@ static ssize_t ad_aggregator_id_show(struct slave *slave, char *buf) | |||
| 80 | } | 80 | } |
| 81 | static SLAVE_ATTR_RO(ad_aggregator_id); | 81 | static SLAVE_ATTR_RO(ad_aggregator_id); |
| 82 | 82 | ||
| 83 | static ssize_t ad_actor_oper_port_state_show(struct slave *slave, char *buf) | ||
| 84 | { | ||
| 85 | const struct port *ad_port; | ||
| 86 | |||
| 87 | if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) { | ||
| 88 | ad_port = &SLAVE_AD_INFO(slave)->port; | ||
| 89 | if (ad_port->aggregator) | ||
| 90 | return sprintf(buf, "%u\n", | ||
| 91 | ad_port->actor_oper_port_state); | ||
| 92 | } | ||
| 93 | |||
| 94 | return sprintf(buf, "N/A\n"); | ||
| 95 | } | ||
| 96 | static SLAVE_ATTR_RO(ad_actor_oper_port_state); | ||
| 97 | |||
| 98 | static ssize_t ad_partner_oper_port_state_show(struct slave *slave, char *buf) | ||
| 99 | { | ||
| 100 | const struct port *ad_port; | ||
| 101 | |||
| 102 | if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) { | ||
| 103 | ad_port = &SLAVE_AD_INFO(slave)->port; | ||
| 104 | if (ad_port->aggregator) | ||
| 105 | return sprintf(buf, "%u\n", | ||
| 106 | ad_port->partner_oper.port_state); | ||
| 107 | } | ||
| 108 | |||
| 109 | return sprintf(buf, "N/A\n"); | ||
| 110 | } | ||
| 111 | static SLAVE_ATTR_RO(ad_partner_oper_port_state); | ||
| 112 | |||
| 83 | static const struct slave_attribute *slave_attrs[] = { | 113 | static const struct slave_attribute *slave_attrs[] = { |
| 84 | &slave_attr_state, | 114 | &slave_attr_state, |
| 85 | &slave_attr_mii_status, | 115 | &slave_attr_mii_status, |
| @@ -87,6 +117,8 @@ static const struct slave_attribute *slave_attrs[] = { | |||
| 87 | &slave_attr_perm_hwaddr, | 117 | &slave_attr_perm_hwaddr, |
| 88 | &slave_attr_queue_id, | 118 | &slave_attr_queue_id, |
| 89 | &slave_attr_ad_aggregator_id, | 119 | &slave_attr_ad_aggregator_id, |
| 120 | &slave_attr_ad_actor_oper_port_state, | ||
| 121 | &slave_attr_ad_partner_oper_port_state, | ||
| 90 | NULL | 122 | NULL |
| 91 | }; | 123 | }; |
| 92 | 124 | ||
