Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 214700
Collapse All | Expand All

(-)2.6.24-gentoo-r3/drivers/input/evdev.c (-1 / +21 lines)
Lines 577-582 static long evdev_do_ioctl(struct file * Link Here
577
	struct input_dev *dev = evdev->handle.dev;
577
	struct input_dev *dev = evdev->handle.dev;
578
	struct input_absinfo abs;
578
	struct input_absinfo abs;
579
	struct ff_effect effect;
579
	struct ff_effect effect;
580
#ifdef CONFIG_COMPAT
581
	struct ff_effect32 *effect32;
582
#endif
580
	int __user *ip = (int __user *)p;
583
	int __user *ip = (int __user *)p;
581
	int i, t, u, v;
584
	int i, t, u, v;
582
	int error;
585
	int error;
Lines 632-641 static long evdev_do_ioctl(struct file * Link Here
632
635
633
		return dev->setkeycode(dev, t, v);
636
		return dev->setkeycode(dev, t, v);
634
637
638
#ifdef CONFIG_COMPAT
639
	case EVIOCSFF32:
640
#endif
635
	case EVIOCSFF:
641
	case EVIOCSFF:
636
		if (copy_from_user(&effect, p, sizeof(effect)))
642
		if (copy_from_user(&effect, p, _IOC_SIZE(cmd)))
637
			return -EFAULT;
643
			return -EFAULT;
638
644
645
#ifdef CONFIG_COMPAT
646
		/*
647
		 * It so happens that the pointer which needs to be changed
648
		 * is the last field in the structure, so we can copy the
649
		 * whole thing and replace just the pointer.
650
		 */
651
		if (cmd == EVIOCSFF32) {
652
			effect32 = (struct ff_effect32 *)&effect;
653
			if (effect32->type == FF_PERIODIC)
654
				effect.u.periodic.custom_data = compat_ptr(
655
					effect32->u.periodic.custom_data);
656
		}
657
#endif
658
639
		error = input_ff_upload(dev, &effect, file);
659
		error = input_ff_upload(dev, &effect, file);
640
660
641
		if (put_user(effect.id, &(((struct ff_effect __user *)p)->id)))
661
		if (put_user(effect.id, &(((struct ff_effect __user *)p)->id)))
(-)2.6.24-gentoo-r3/include/linux/input.h (-1 / +41 lines)
Lines 12-17 Link Here
12
#ifdef __KERNEL__
12
#ifdef __KERNEL__
13
#include <linux/time.h>
13
#include <linux/time.h>
14
#include <linux/list.h>
14
#include <linux/list.h>
15
#include <linux/compat.h>
15
#else
16
#else
16
#include <sys/time.h>
17
#include <sys/time.h>
17
#include <sys/ioctl.h>
18
#include <sys/ioctl.h>
Lines 75-81 struct input_absinfo { Link Here
75
#define EVIOCGABS(abs)		_IOR('E', 0x40 + abs, struct input_absinfo)		/* get abs value/limits */
76
#define EVIOCGABS(abs)		_IOR('E', 0x40 + abs, struct input_absinfo)		/* get abs value/limits */
76
#define EVIOCSABS(abs)		_IOW('E', 0xc0 + abs, struct input_absinfo)		/* set abs value/limits */
77
#define EVIOCSABS(abs)		_IOW('E', 0xc0 + abs, struct input_absinfo)		/* set abs value/limits */
77
78
78
#define EVIOCSFF		_IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))	/* send a force effect to a force feedback device */
79
#define EVIOCSFF		_IOW('E', 0x80, struct ff_effect)	/* send a force effect to a force feedback device */
80
#ifdef CONFIG_COMPAT
81
#define EVIOCSFF32		_IOW('E', 0x80, struct ff_effect32)	/* send a force effect to a force feedback device */
82
#endif
79
#define EVIOCRMFF		_IOW('E', 0x81, int)			/* Erase a force effect */
83
#define EVIOCRMFF		_IOW('E', 0x81, int)			/* Erase a force effect */
80
#define EVIOCGEFFECTS		_IOR('E', 0x84, int)			/* Report number of effects playable at the same time */
84
#define EVIOCGEFFECTS		_IOR('E', 0x84, int)			/* Report number of effects playable at the same time */
81
85
Lines 846-851 struct ff_periodic_effect { Link Here
846
	__s16 *custom_data;
850
	__s16 *custom_data;
847
};
851
};
848
852
853
#ifdef CONFIG_COMPAT
854
struct ff_periodic_effect32 {
855
	__u16 waveform;
856
	__u16 period;
857
	__s16 magnitude;
858
	__s16 offset;
859
	__u16 phase;
860
861
	struct ff_envelope envelope;
862
863
	__u32 custom_len;
864
	compat_uptr_t custom_data;
865
};
866
#endif
867
849
/**
868
/**
850
 * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect
869
 * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect
851
 * @strong_magnitude: magnitude of the heavy motor
870
 * @strong_magnitude: magnitude of the heavy motor
Lines 898-903 struct ff_effect { Link Here
898
	} u;
917
	} u;
899
};
918
};
900
919
920
#ifdef CONFIG_COMPAT
921
struct ff_effect32 {
922
	__u16 type;
923
	__s16 id;
924
	__u16 direction;
925
	struct ff_trigger trigger;
926
	struct ff_replay replay;
927
928
	union {
929
		struct ff_constant_effect constant;
930
		struct ff_ramp_effect ramp;
931
		struct ff_periodic_effect32 periodic;
932
		struct ff_condition_effect condition[2]; /* One for each axis */
933
		struct ff_rumble_effect rumble;
934
	} u;
935
};
936
#endif
937
901
/*
938
/*
902
 * Force feedback effect types
939
 * Force feedback effect types
903
 */
940
 */
Lines 1362-1367 void input_ff_destroy(struct input_dev * Link Here
1362
int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
1399
int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
1363
1400
1364
int input_ff_upload(struct input_dev *dev, struct ff_effect *effect, struct file *file);
1401
int input_ff_upload(struct input_dev *dev, struct ff_effect *effect, struct file *file);
1402
#ifdef CONFIG_COMPAT
1403
int input_ff_upload32(struct input_dev *dev, struct ff_effect32 *effect32, struct file *file);
1404
#endif
1365
int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file);
1405
int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file);
1366
1406
1367
int input_ff_create_memless(struct input_dev *dev, void *data,
1407
int input_ff_create_memless(struct input_dev *dev, void *data,

Return to bug 214700