These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / net / bonding / bond_sysfs_slave.c
index 23618a8..7d16c51 100644 (file)
@@ -80,6 +80,36 @@ static ssize_t ad_aggregator_id_show(struct slave *slave, char *buf)
 }
 static SLAVE_ATTR_RO(ad_aggregator_id);
 
+static ssize_t ad_actor_oper_port_state_show(struct slave *slave, char *buf)
+{
+       const struct port *ad_port;
+
+       if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) {
+               ad_port = &SLAVE_AD_INFO(slave)->port;
+               if (ad_port->aggregator)
+                       return sprintf(buf, "%u\n",
+                                      ad_port->actor_oper_port_state);
+       }
+
+       return sprintf(buf, "N/A\n");
+}
+static SLAVE_ATTR_RO(ad_actor_oper_port_state);
+
+static ssize_t ad_partner_oper_port_state_show(struct slave *slave, char *buf)
+{
+       const struct port *ad_port;
+
+       if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) {
+               ad_port = &SLAVE_AD_INFO(slave)->port;
+               if (ad_port->aggregator)
+                       return sprintf(buf, "%u\n",
+                                      ad_port->partner_oper.port_state);
+       }
+
+       return sprintf(buf, "N/A\n");
+}
+static SLAVE_ATTR_RO(ad_partner_oper_port_state);
+
 static const struct slave_attribute *slave_attrs[] = {
        &slave_attr_state,
        &slave_attr_mii_status,
@@ -87,6 +117,8 @@ static const struct slave_attribute *slave_attrs[] = {
        &slave_attr_perm_hwaddr,
        &slave_attr_queue_id,
        &slave_attr_ad_aggregator_id,
+       &slave_attr_ad_actor_oper_port_state,
+       &slave_attr_ad_partner_oper_port_state,
        NULL
 };