X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/176570cee9db5f34422746cfb8b786c5e7243697..699212b7b42faa56e6ecbeaf36079f9ed2fe4640:/package/switch/src/switch-robo.c diff --git a/package/switch/src/switch-robo.c b/package/switch/src/switch-robo.c index 21343edf0..206359d07 100644 --- a/package/switch/src/switch-robo.c +++ b/package/switch/src/switch-robo.c @@ -68,9 +68,13 @@ #define bool int #endif - +/* Only available on brcm-2.4/brcm47xx */ +#ifdef BROADCOM extern char *nvram_get(const char *name); #define getvar(str) (nvram_get(str)?:"") +#else +#define getvar(str) "" +#endif /* Data structure for a Roboswitch device. */ struct robo_switch { @@ -97,7 +101,11 @@ static int do_ioctl(int cmd, void *buf) robo.ifr.ifr_data = (caddr_t) buf; set_fs(KERNEL_DS); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) + ret = robo.dev->netdev_ops->ndo_do_ioctl(robo.dev, &robo.ifr, cmd); +#else ret = robo.dev->do_ioctl(robo.dev, &robo.ifr, cmd); +#endif set_fs(old_fs); return ret;