]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
Added channel information in sysfs.
authorhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Fri, 6 Nov 2009 15:46:21 +0000 (15:46 +0000)
committerhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Fri, 6 Nov 2009 15:46:21 +0000 (15:46 +0000)
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1076 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.6/drivers/net/can/softing/softing_sysfs.c

index 8df59c034db51fdda96bc83526f91aed1c785d16..99561c240c3847715f6d9676ac6f5f6297d8da9e 100644 (file)
@@ -138,6 +138,14 @@ void softing_card_sysfs_remove(struct softing *card)
        kfree(card->attr);
 }
 
+static ssize_t show_channel(struct device *dev
+               , struct device_attribute *attr, char *buf)
+{
+       struct net_device *ndev = to_net_dev(dev);
+       struct softing_priv *priv = netdev2softing(ndev);
+       return sprintf(buf, "%i\n", priv->index);
+}
+
 static ssize_t show_chip(struct device *dev
                , struct device_attribute *attr, char *buf)
 {
@@ -184,10 +192,12 @@ static ssize_t store_output(struct device *dev
  * the latest softing cards support sleep mode too
  */
 
+static const DEVICE_ATTR(channel, S_IRUGO, show_channel, 0);
 static const DEVICE_ATTR(chip, S_IRUGO, show_chip, 0);
 static const DEVICE_ATTR(output, S_IRUGO | S_IWUSR, show_output, store_output);
 
 static const struct attribute *const netdev_sysfs_entries[] = {
+       &dev_attr_channel       .attr,
        &dev_attr_chip          .attr,
        &dev_attr_output        .attr,
        0,