/* This module provides arbitrary resource management routines. * I use it to manage the device's memory. * Despite the name of this module, I am *not* going to access the ioports.
*/ #include <linux/ioport.h>
#define IFORCE_MAX_LENGTH 16
#define IFORCE_EFFECTS_MAX 32
/* Each force feedback effect is made of one core effect, which can be * associated to at most to effect modifiers
*/ #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
struct iforce_core_effect { /* Information about where modifiers are stored in the device's memory */ struct resource mod1_chunk; struct resource mod2_chunk; unsignedlong flags[BITS_TO_LONGS(FF_MODCORE_CNT)];
};
spinlock_t xmit_lock; /* Buffer used for asynchronous sending of bytes to the device */ struct circ_buf xmit; unsignedchar xmit_data[XMIT_SIZE]; unsignedlong xmit_flags[1];
/* Get hi and low bytes of a 16-bits int */ #define HI(a) ((unsignedchar)((a) >> 8)) #define LO(a) ((unsignedchar)((a) & 0xff))
/* For many parameters, it seems that 0x80 is a special value that should * be avoided. Instead, we replace this value by 0x7f
*/ #define HIFIX80(a) ((unsignedchar)(((a)<0? (a)+255 : (a))>>8))
/* Encode a time value */ #define TIME_SCALE(a) (a)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.