Thanks to this idea, I added 1 feature to the current softing driver: the channel number. after this, I think any matching is possible on such devices using udev.
Wolfgang, I think this patch is ready to go into svn. Signed-off-by: Kurt Van Dijck <[email protected]> --- kernel/2.6/drivers/net/can/softing/softing_sysfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) Index: trunk/kernel/2.6/drivers/net/can/softing/softing_sysfs.c =================================================================== --- trunk.orig/kernel/2.6/drivers/net/can/softing/softing_sysfs.c 2009-11-06 10:19:13.000000000 +0100 +++ trunk/kernel/2.6/drivers/net/can/softing/softing_sysfs.c 2009-11-06 10:47:40.000000000 +0100 @@ -138,6 +138,14 @@ 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 @@ * 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, _______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
