The goal of this patch series is to add an external hook function into
the CAN netdevice's open/close functions.
I think this is much simpler than using netdev notifactions. These new
hook functions carry the original device in its argument list.
A hook function for platform_device can be as simple as:
static const int can_drv_gpio[NUM] = { ... };
static int can_drv_enable(struct platform_device *pdev, int enable)
{
gpio_set_value(can_drv_gpio[pdev->id], enable);
return 0;
}
This kind of 'glue functions' is what make board run, and should not
be too complex IMO.
I (EIA Electronics) use this to activate/deactivate a GPIO that powers
the CAN transceiver (PCA82...).
My original idea was to limit this functionality to the sja1000
platform_device, but the sja1000 'object-oriented' approach forced me to
dig some deeper, int the generic sja1000 code.
Currently, my tests have been limited to activation/deactivation, since
only these operations are affected.
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core