@@ -132,6 +132,16 @@ static ssize_t show_carrier(struct device *dev,
return -EINVAL;
}
+static ssize_t show_stopped(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct net_device *netdev = to_net_dev(dev);
+ if (netif_running(netdev)) {
+ return sprintf(buf, fmt_dec, !!netif_queue_stopped(netdev));
+ }
+ return -EINVAL;
+}
+
static ssize_t show_speed(struct device *dev,
struct device_attribute *attr, char *buf)
{@@ -303,6 +313,7 @@ static struct device_attribute net_class_attributes[] = {
__ATTR(address, S_IRUGO, show_address, NULL),
__ATTR(broadcast, S_IRUGO, show_broadcast, NULL),
__ATTR(carrier, S_IRUGO, show_carrier, NULL),
+ __ATTR(carrier, S_IRUGO, show_stopped, NULL),
__ATTR(speed, S_IRUGO, show_speed, NULL),
__ATTR(duplex, S_IRUGO, show_duplex, NULL),
__ATTR(dormant, S_IRUGO, show_dormant, NULL),