Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
iforce.h File Reference
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/usb.h>
#include <linux/serio.h>
#include <linux/circ_buf.h>
#include <linux/mutex.h>
#include <linux/ioport.h>

Go to the source code of this file.

Data Structures

struct  iforce_core_effect
 
struct  iforce_device
 
struct  iforce
 

Macros

#define IFORCE_MAX_LENGTH   16
 
#define IFORCE_232   1
 
#define IFORCE_USB   2
 
#define IFORCE_EFFECTS_MAX   32
 
#define FF_MOD1_IS_USED   0
 
#define FF_MOD2_IS_USED   1
 
#define FF_CORE_IS_USED   2
 
#define FF_CORE_IS_PLAYED   3 /* Effect is currently being played */
 
#define FF_CORE_SHOULD_PLAY   4 /* User wants the effect to be played */
 
#define FF_CORE_UPDATE   5 /* Effect is being updated */
 
#define FF_MODCORE_CNT   6
 
#define FF_CMD_EFFECT   0x010e
 
#define FF_CMD_ENVELOPE   0x0208
 
#define FF_CMD_MAGNITUDE   0x0303
 
#define FF_CMD_PERIOD   0x0407
 
#define FF_CMD_CONDITION   0x050a
 
#define FF_CMD_AUTOCENTER   0x4002
 
#define FF_CMD_PLAY   0x4103
 
#define FF_CMD_ENABLE   0x4201
 
#define FF_CMD_GAIN   0x4301
 
#define FF_CMD_QUERY   0xff01
 
#define XMIT_SIZE   256
 
#define XMIT_INC(var, n)   (var)+=n; (var)&= XMIT_SIZE -1
 
#define IFORCE_XMIT_RUNNING   0
 
#define IFORCE_XMIT_AGAIN   1
 
#define HI(a)   ((unsigned char)((a) >> 8))
 
#define LO(a)   ((unsigned char)((a) & 0xff))
 
#define HIFIX80(a)   ((unsigned char)(((a)<0? (a)+255 : (a))>>8))
 
#define TIME_SCALE(a)   (a)
 

Functions

void iforce_serial_xmit (struct iforce *iforce)
 
void iforce_usb_xmit (struct iforce *iforce)
 
int iforce_init_device (struct iforce *iforce)
 
int iforce_control_playback (struct iforce *, u16 id, unsigned int)
 
void iforce_process_packet (struct iforce *iforce, u16 cmd, unsigned char *data)
 
int iforce_send_packet (struct iforce *iforce, u16 cmd, unsigned char *data)
 
void iforce_dump_packet (char *msg, u16 cmd, unsigned char *data)
 
int iforce_get_id_packet (struct iforce *iforce, char *packet)
 
int iforce_upload_periodic (struct iforce *, struct ff_effect *, struct ff_effect *)
 
int iforce_upload_constant (struct iforce *, struct ff_effect *, struct ff_effect *)
 
int iforce_upload_condition (struct iforce *, struct ff_effect *, struct ff_effect *)
 

Variables

struct serio_driver iforce_serio_drv
 
struct usb_driver iforce_usb_driver
 

Macro Definition Documentation

#define FF_CMD_AUTOCENTER   0x4002

Definition at line 78 of file iforce.h.

#define FF_CMD_CONDITION   0x050a

Definition at line 76 of file iforce.h.

#define FF_CMD_EFFECT   0x010e

Definition at line 72 of file iforce.h.

#define FF_CMD_ENABLE   0x4201

Definition at line 80 of file iforce.h.

#define FF_CMD_ENVELOPE   0x0208

Definition at line 73 of file iforce.h.

#define FF_CMD_GAIN   0x4301

Definition at line 81 of file iforce.h.

#define FF_CMD_MAGNITUDE   0x0303

Definition at line 74 of file iforce.h.

#define FF_CMD_PERIOD   0x0407

Definition at line 75 of file iforce.h.

#define FF_CMD_PLAY   0x4103

Definition at line 79 of file iforce.h.

#define FF_CMD_QUERY   0xff01

Definition at line 83 of file iforce.h.

#define FF_CORE_IS_PLAYED   3 /* Effect is currently being played */

Definition at line 60 of file iforce.h.

#define FF_CORE_IS_USED   2

Definition at line 59 of file iforce.h.

#define FF_CORE_SHOULD_PLAY   4 /* User wants the effect to be played */

Definition at line 61 of file iforce.h.

#define FF_CORE_UPDATE   5 /* Effect is being updated */

Definition at line 62 of file iforce.h.

#define FF_MOD1_IS_USED   0

Definition at line 57 of file iforce.h.

#define FF_MOD2_IS_USED   1

Definition at line 58 of file iforce.h.

#define FF_MODCORE_CNT   6

Definition at line 63 of file iforce.h.

#define HI (   a)    ((unsigned char)((a) >> 8))

Definition at line 136 of file iforce.h.

#define HIFIX80 (   a)    ((unsigned char)(((a)<0? (a)+255 : (a))>>8))

Definition at line 142 of file iforce.h.

#define IFORCE_232   1

Definition at line 49 of file iforce.h.

#define IFORCE_EFFECTS_MAX   32

Definition at line 52 of file iforce.h.

#define IFORCE_MAX_LENGTH   16

Definition at line 46 of file iforce.h.

#define IFORCE_USB   2

Definition at line 50 of file iforce.h.

#define IFORCE_XMIT_AGAIN   1

Definition at line 90 of file iforce.h.

#define IFORCE_XMIT_RUNNING   0

Definition at line 89 of file iforce.h.

#define LO (   a)    ((unsigned char)((a) & 0xff))

Definition at line 137 of file iforce.h.

#define TIME_SCALE (   a)    (a)

Definition at line 145 of file iforce.h.

#define XMIT_INC (   var,
  n 
)    (var)+=n; (var)&= XMIT_SIZE -1

Definition at line 87 of file iforce.h.

#define XMIT_SIZE   256

Definition at line 86 of file iforce.h.

Function Documentation

int iforce_control_playback ( struct iforce ,
u16  id,
unsigned  int 
)

Definition at line 125 of file iforce-packets.c.

void iforce_dump_packet ( char msg,
u16  cmd,
unsigned char data 
)

Definition at line 36 of file iforce-packets.c.

int iforce_get_id_packet ( struct iforce iforce,
char packet 
)

Definition at line 247 of file iforce-packets.c.

int iforce_init_device ( struct iforce iforce)

Definition at line 256 of file iforce-main.c.

void iforce_process_packet ( struct iforce iforce,
u16  cmd,
unsigned char data 
)

Definition at line 156 of file iforce-packets.c.

int iforce_send_packet ( struct iforce iforce,
u16  cmd,
unsigned char data 
)

Definition at line 49 of file iforce-packets.c.

void iforce_serial_xmit ( struct iforce iforce)

Definition at line 30 of file iforce-serio.c.

int iforce_upload_condition ( struct iforce ,
struct ff_effect ,
struct ff_effect  
)

Definition at line 484 of file iforce-ff.c.

int iforce_upload_constant ( struct iforce ,
struct ff_effect ,
struct ff_effect  
)

Definition at line 428 of file iforce-ff.c.

int iforce_upload_periodic ( struct iforce ,
struct ff_effect ,
struct ff_effect  
)

Definition at line 357 of file iforce-ff.c.

void iforce_usb_xmit ( struct iforce iforce)

Definition at line 30 of file iforce-usb.c.

Variable Documentation

struct serio_driver iforce_serio_drv

Definition at line 179 of file iforce-serio.c.

struct usb_driver iforce_usb_driver

Definition at line 227 of file iforce-usb.c.