Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

synclink_gt: add compat_ioctl

Add support for 32 bit ioctl on 64 bit systems for synclink_gt

Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Paul Fulghum and committed by
Linus Torvalds
2acdb169 4c64c30a

+132 -1
+1 -1
include/linux/Kbuild
··· 140 140 header-y += sockios.h 141 141 header-y += som.h 142 142 header-y += sound.h 143 - header-y += synclink.h 144 143 header-y += taskstats.h 145 144 header-y += telephony.h 146 145 header-y += termios.h ··· 319 320 unifdef-y += soundcard.h 320 321 unifdef-y += stat.h 321 322 unifdef-y += stddef.h 323 + unifdef-y += synclink.h 322 324 unifdef-y += sysctl.h 323 325 unifdef-y += tcp.h 324 326 unifdef-y += time.h
+24
include/linux/synclink.h
··· 291 291 #define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc) 292 292 #define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc) 293 293 294 + #ifdef __KERNEL__ 295 + /* provide 32 bit ioctl compatibility on 64 bit systems */ 296 + #ifdef CONFIG_COMPAT 297 + #include <linux/compat.h> 298 + struct MGSL_PARAMS32 { 299 + compat_ulong_t mode; 300 + unsigned char loopback; 301 + unsigned short flags; 302 + unsigned char encoding; 303 + compat_ulong_t clock_speed; 304 + unsigned char addr_filter; 305 + unsigned short crc_type; 306 + unsigned char preamble_length; 307 + unsigned char preamble; 308 + compat_ulong_t data_rate; 309 + unsigned char data_bits; 310 + unsigned char stop_bits; 311 + unsigned char parity; 312 + }; 313 + #define MGSL_IOCSPARAMS32 _IOW(MGSL_MAGIC_IOC,0,struct MGSL_PARAMS32) 314 + #define MGSL_IOCGPARAMS32 _IOR(MGSL_MAGIC_IOC,1,struct MGSL_PARAMS32) 315 + #endif 316 + #endif 317 + 294 318 #endif /* _SYNCLINK_H_ */