iforce.h (05668381140309088443bf5dc53add4104610fbb) | iforce.h (f6a01c85965c9e6fa8fb893c1fa5db16130d0ccb) |
---|---|
1/* 2 * $Id: iforce.h,v 1.13 2002/07/07 10:22:50 jdeneux Exp $ 3 * 4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz> 5 * Copyright (c) 2001-2002 Johann Deneux <deneux@ifrance.com> 6 * 7 * USB/RS232 I-Force joysticks and wheels. 8 */ --- 37 unchanged lines hidden (view full) --- 46 47 48#define IFORCE_MAX_LENGTH 16 49 50/* iforce::bus */ 51#define IFORCE_232 1 52#define IFORCE_USB 2 53 | 1/* 2 * $Id: iforce.h,v 1.13 2002/07/07 10:22:50 jdeneux Exp $ 3 * 4 * Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz> 5 * Copyright (c) 2001-2002 Johann Deneux <deneux@ifrance.com> 6 * 7 * USB/RS232 I-Force joysticks and wheels. 8 */ --- 37 unchanged lines hidden (view full) --- 46 47 48#define IFORCE_MAX_LENGTH 16 49 50/* iforce::bus */ 51#define IFORCE_232 1 52#define IFORCE_USB 2 53 |
54#define FALSE 0 55#define TRUE 1 | 54#define IFORCE_EFFECTS_MAX 32 |
56 | 55 |
57#define FF_EFFECTS_MAX 32 58 | |
59/* Each force feedback effect is made of one core effect, which can be 60 * associated to at most to effect modifiers 61 */ 62#define FF_MOD1_IS_USED 0 63#define FF_MOD2_IS_USED 1 64#define FF_CORE_IS_USED 2 65#define FF_CORE_IS_PLAYED 3 /* Effect is currently being played */ 66#define FF_CORE_SHOULD_PLAY 4 /* User wants the effect to be played */ 67#define FF_CORE_UPDATE 5 /* Effect is being updated */ 68#define FF_MODCORE_MAX 5 69 | 56/* Each force feedback effect is made of one core effect, which can be 57 * associated to at most to effect modifiers 58 */ 59#define FF_MOD1_IS_USED 0 60#define FF_MOD2_IS_USED 1 61#define FF_CORE_IS_USED 2 62#define FF_CORE_IS_PLAYED 3 /* Effect is currently being played */ 63#define FF_CORE_SHOULD_PLAY 4 /* User wants the effect to be played */ 64#define FF_CORE_UPDATE 5 /* Effect is being updated */ 65#define FF_MODCORE_MAX 5 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 { 77 /* Information about where modifiers are stored in the device's memory */ 78 struct resource mod1_chunk; 79 struct resource mod2_chunk; 80 unsigned long flags[NBITS(FF_MODCORE_MAX)]; | 67struct iforce_core_effect { 68 /* Information about where modifiers are stored in the device's memory */ 69 struct resource mod1_chunk; 70 struct resource mod2_chunk; 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}; 89 90#define FF_CMD_EFFECT 0x010e 91#define FF_CMD_ENVELOPE 0x0208 92#define FF_CMD_MAGNITUDE 0x0303 93#define FF_CMD_PERIOD 0x0407 94#define FF_CMD_CONDITION 0x050a 95 --- 44 unchanged lines hidden (view full) --- 140 /* Buffer used for asynchronous sending of bytes to the device */ 141 struct circ_buf xmit; 142 unsigned char xmit_data[XMIT_SIZE]; 143 long xmit_flags[1]; 144 145 /* Force Feedback */ 146 wait_queue_head_t wait; 147 struct resource device_memory; | 72}; 73 74#define FF_CMD_EFFECT 0x010e 75#define FF_CMD_ENVELOPE 0x0208 76#define FF_CMD_MAGNITUDE 0x0303 77#define FF_CMD_PERIOD 0x0407 78#define FF_CMD_CONDITION 0x050a 79 --- 44 unchanged lines hidden (view full) --- 124 /* Buffer used for asynchronous sending of bytes to the device */ 125 struct circ_buf xmit; 126 unsigned char xmit_data[XMIT_SIZE]; 127 long xmit_flags[1]; 128 129 /* Force Feedback */ 130 wait_queue_head_t wait; 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; 150}; 151 152/* Get hi and low bytes of a 16-bits int */ 153#define HI(a) ((unsigned char)((a) >> 8)) 154#define LO(a) ((unsigned char)((a) & 0xff)) 155 156/* For many parameters, it seems that 0x80 is a special value that should --- 20 unchanged lines hidden (view full) --- 177/* iforce-packets.c */ 178int iforce_control_playback(struct iforce*, u16 id, unsigned int); 179void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data, struct pt_regs *regs); 180int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data); 181void iforce_dump_packet(char *msg, u16 cmd, unsigned char *data) ; 182int iforce_get_id_packet(struct iforce *iforce, char *packet); 183 184/* iforce-ff.c */ | 133 struct mutex mem_mutex; 134}; 135 136/* Get hi and low bytes of a 16-bits int */ 137#define HI(a) ((unsigned char)((a) >> 8)) 138#define LO(a) ((unsigned char)((a) & 0xff)) 139 140/* For many parameters, it seems that 0x80 is a special value that should --- 20 unchanged lines hidden (view full) --- 161/* iforce-packets.c */ 162int iforce_control_playback(struct iforce*, u16 id, unsigned int); 163void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data, struct pt_regs *regs); 164int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data); 165void iforce_dump_packet(char *msg, u16 cmd, unsigned char *data) ; 166int iforce_get_id_packet(struct iforce *iforce, char *packet); 167 168/* iforce-ff.c */ |
185int iforce_upload_periodic(struct iforce*, struct ff_effect*, int is_update); 186int iforce_upload_constant(struct iforce*, struct ff_effect*, int is_update); 187int iforce_upload_condition(struct iforce*, struct ff_effect*, int is_update); | 169int iforce_upload_periodic(struct iforce *, struct ff_effect *, struct ff_effect *); 170int iforce_upload_constant(struct iforce *, struct ff_effect *, struct ff_effect *); 171int iforce_upload_condition(struct iforce *, struct ff_effect *, struct ff_effect *); |
188 189/* Public variables */ 190extern struct serio_driver iforce_serio_drv; 191extern struct usb_driver iforce_usb_driver; | 172 173/* Public variables */ 174extern struct serio_driver iforce_serio_drv; 175extern struct usb_driver iforce_usb_driver; |