aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick/iforce/iforce.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/joystick/iforce/iforce.h')
-rw-r--r--drivers/input/joystick/iforce/iforce.h26
1 files changed, 5 insertions, 21 deletions
diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h
index e9924d6f01b..947df273984 100644
--- a/drivers/input/joystick/iforce/iforce.h
+++ b/drivers/input/joystick/iforce/iforce.h
@@ -51,10 +51,7 @@
51#define IFORCE_232 1 51#define IFORCE_232 1
52#define IFORCE_USB 2 52#define IFORCE_USB 2
53 53
54#define FALSE 0 54#define IFORCE_EFFECTS_MAX 32
55#define TRUE 1
56
57#define FF_EFFECTS_MAX 32
58 55
59/* Each force feedback effect is made of one core effect, which can be 56/* Each force feedback effect is made of one core effect, which can be
60 * associated to at most to effect modifiers 57 * associated to at most to effect modifiers
@@ -67,24 +64,11 @@
67#define FF_CORE_UPDATE 5 /* Effect is being updated */ 64#define FF_CORE_UPDATE 5 /* Effect is being updated */
68#define FF_MODCORE_MAX 5 65#define FF_MODCORE_MAX 5
69 66
70#define CHECK_OWNERSHIP(i, iforce) \
71 ((i) < FF_EFFECTS_MAX && i >= 0 && \
72 test_bit(FF_CORE_IS_USED, (iforce)->core_effects[(i)].flags) && \
73 (current->pid == 0 || \
74 (iforce)->core_effects[(i)].owner == current->pid))
75
76struct iforce_core_effect { 67struct iforce_core_effect {
77 /* Information about where modifiers are stored in the device's memory */ 68 /* Information about where modifiers are stored in the device's memory */
78 struct resource mod1_chunk; 69 struct resource mod1_chunk;
79 struct resource mod2_chunk; 70 struct resource mod2_chunk;
80 unsigned long flags[NBITS(FF_MODCORE_MAX)]; 71 unsigned long flags[NBITS(FF_MODCORE_MAX)];
81 pid_t owner;
82 /* Used to keep track of parameters of an effect. They are needed
83 * to know what parts of an effect changed in an update operation.
84 * We try to send only parameter packets if possible, as sending
85 * effect parameter requires the effect to be stoped and restarted
86 */
87 struct ff_effect effect;
88}; 72};
89 73
90#define FF_CMD_EFFECT 0x010e 74#define FF_CMD_EFFECT 0x010e
@@ -145,7 +129,7 @@ struct iforce {
145 /* Force Feedback */ 129 /* Force Feedback */
146 wait_queue_head_t wait; 130 wait_queue_head_t wait;
147 struct resource device_memory; 131 struct resource device_memory;
148 struct iforce_core_effect core_effects[FF_EFFECTS_MAX]; 132 struct iforce_core_effect core_effects[IFORCE_EFFECTS_MAX];
149 struct mutex mem_mutex; 133 struct mutex mem_mutex;
150}; 134};
151 135
@@ -182,9 +166,9 @@ void iforce_dump_packet(char *msg, u16 cmd, unsigned char *data) ;
182int iforce_get_id_packet(struct iforce *iforce, char *packet); 166int iforce_get_id_packet(struct iforce *iforce, char *packet);
183 167
184/* iforce-ff.c */ 168/* iforce-ff.c */
185int iforce_upload_periodic(struct iforce*, struct ff_effect*, int is_update); 169int iforce_upload_periodic(struct iforce *, struct ff_effect *, struct ff_effect *);
186int iforce_upload_constant(struct iforce*, struct ff_effect*, int is_update); 170int iforce_upload_constant(struct iforce *, struct ff_effect *, struct ff_effect *);
187int iforce_upload_condition(struct iforce*, struct ff_effect*, int is_update); 171int iforce_upload_condition(struct iforce *, struct ff_effect *, struct ff_effect *);
188 172
189/* Public variables */ 173/* Public variables */
190extern struct serio_driver iforce_serio_drv; 174extern struct serio_driver iforce_serio_drv;