Am Mittwoch, 21. Oktober 2009 14:21:22 schrieb Wolfgang Grandegger: > Heinz-Jürgen Oertel wrote: > > Am Mittwoch, 21. Oktober 2009 12:38:01 schrieb Kurt Van Dijck: > >> .......... > >> > >> Signed-of-by: Kurt Van Dijck <[email protected]> > >> > >> --- drivers/net/can/sja1000/sja1000_platform.c 2009-10-16 > >> 09:30:14.000000000 +0200 +++ > >> /srv/squamata/linux/trunk/drivers/net/can/sja1000/sja1000_platform.c > >> 2009-10-15 10:16:14.000000000 +0200 @@ -35,7 +35,8 @@ > >> #define DRV_NAME "sja1000_platform" > >> > >> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) > >> -#error This driver does not support Kernel versions < 2.6.27 > >> +#define resource_size(res) ((res)->end + 1 - (res->start)) > >> +/* #error This driver does not support Kernel versions < 2.6.27 */ > >> #endif > >> > >> MODULE_AUTHOR("Sascha Hauer <[email protected]>"); > > Thanks for pointing that out. > > > Hello Kurt > > This patch works for me, at least the makefile finishes now with the > > following result. > > > > > > -rw-rw-rw- 1 oe users 17397 21. Okt 13:01 net/can/can-bcm.ko > > -rw-rw-rw- 1 oe users 13026 21. Okt 13:01 net/can/can-isotp.ko > > -rw-rw-rw- 1 oe users 20927 21. Okt 13:01 net/can/can.ko > > -rw-rw-rw- 1 oe users 10425 21. Okt 13:01 net/can/can-raw.ko > > > > I now have to adopt to my hardware addresses , addressing mechanism etc. > > I will report later if all is working that not only the driver compiles > > but also does what it should do. > > Could you please use and test the patch below. I will apply if it > works. > > Wolfgang.
Wolfgang, I'm far from testing as I wrote. I'm still not able to run the driver on my hardware. Unfortunately I can spent only a fraction of my time on the project an will be tomorrow out of office. I'll test as soon as possible. Heinz > > > [PATCH] Wrapper for resource_size() for kernel versions < 2.6.27 > > This fix makes the sja1000 platform driver compatible with 2.6.25. > > Signed-off-by: Wolfgang Grandegger <[email protected]> > --- > kernel/2.6/drivers/net/can/sja1000/sja1000_platform.c | 4 ++-- > kernel/2.6/include/socketcan/can/dev.h | 7 +++++++ > 2 files changed, 9 insertions(+), 2 deletions(-) > > Index: trunk/kernel/2.6/drivers/net/can/sja1000/sja1000_platform.c > =================================================================== > --- trunk.orig/kernel/2.6/drivers/net/can/sja1000/sja1000_platform.c > +++ trunk/kernel/2.6/drivers/net/can/sja1000/sja1000_platform.c > @@ -34,8 +34,8 @@ > > #define DRV_NAME "sja1000_platform" > > -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) > -#error This driver does not support Kernel versions < 2.6.27 > +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) > +#error This driver does not support Kernel versions < 2.6.25 > #endif > > MODULE_AUTHOR("Sascha Hauer <[email protected]>"); > Index: trunk/kernel/2.6/include/socketcan/can/dev.h > =================================================================== > --- trunk.orig/kernel/2.6/include/socketcan/can/dev.h > +++ trunk/kernel/2.6/include/socketcan/can/dev.h > @@ -71,6 +71,13 @@ struct can_priv { > struct net_device_stats *can_get_stats(struct net_device *dev); > #endif > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) > +static inline resource_size_t resource_size(struct resource *res) > +{ > + return res->end - res->start + 1; > +} > +#endif > + > struct net_device *alloc_candev(int sizeof_priv, unsigned int > echo_skb_max); void free_candev(struct net_device *dev); _______________________________________________ Socketcan-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-users
