head 1.2; access; symbols netbsd-7-2-RELEASE:1.1.1.3 netbsd-7-1-2-RELEASE:1.1.1.3 netbsd-7-1-1-RELEASE:1.1.1.3 netbsd-7-1:1.1.1.3.0.14 netbsd-7-1-RELEASE:1.1.1.3 netbsd-7-1-RC2:1.1.1.3 netbsd-7-1-RC1:1.1.1.3 netbsd-7-0-2-RELEASE:1.1.1.3 netbsd-7-0-1-RELEASE:1.1.1.3 netbsd-7-0:1.1.1.3.0.12 netbsd-7-0-RELEASE:1.1.1.3 netbsd-7-0-RC3:1.1.1.3 netbsd-7-0-RC2:1.1.1.3 netbsd-7-0-RC1:1.1.1.3 netbsd-5-2-3-RELEASE:1.1.1.1 netbsd-5-1-5-RELEASE:1.1.1.1 netbsd-6-0-6-RELEASE:1.1.1.3 netbsd-6-1-5-RELEASE:1.1.1.3 netbsd-7:1.1.1.3.0.10 netbsd-7-base:1.1.1.3 netbsd-6-1-4-RELEASE:1.1.1.3 netbsd-6-0-5-RELEASE:1.1.1.3 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.3 riastradh-drm2:1.1.1.3.0.8 riastradh-drm2-base:1.1.1.3 netbsd-6-1-3-RELEASE:1.1.1.3 netbsd-6-0-4-RELEASE:1.1.1.3 netbsd-5-2-2-RELEASE:1.1.1.1 netbsd-5-1-4-RELEASE:1.1.1.1 netbsd-6-1-2-RELEASE:1.1.1.3 netbsd-6-0-3-RELEASE:1.1.1.3 netbsd-5-2-1-RELEASE:1.1.1.1 netbsd-5-1-3-RELEASE:1.1.1.1 netbsd-6-1-1-RELEASE:1.1.1.3 xorg-server-1-10-6:1.1.1.3 netbsd-6-1:1.1.1.3.0.6 netbsd-6-0-2-RELEASE:1.1.1.3 netbsd-6-1-RELEASE:1.1.1.3 netbsd-6-1-RC4:1.1.1.3 netbsd-6-1-RC3:1.1.1.3 netbsd-6-1-RC2:1.1.1.3 netbsd-6-1-RC1:1.1.1.3 netbsd-5-2:1.1.1.1.0.8 netbsd-6-0-1-RELEASE:1.1.1.3 netbsd-5-2-RELEASE:1.1.1.1 netbsd-5-2-RC1:1.1.1.1 netbsd-6-0:1.1.1.3.0.4 netbsd-6-0-RELEASE:1.1.1.3 netbsd-6-0-RC2:1.1.1.3 netbsd-6-0-RC1:1.1.1.3 netbsd-6:1.1.1.3.0.2 netbsd-6-base:1.1.1.3 netbsd-5-1-2-RELEASE:1.1.1.1 netbsd-5-1-1-RELEASE:1.1.1.1 xorg-server-1-10-3:1.1.1.3 mrg-xorg-server-1-9-5-pre-1-10-3:1.1.1.2 xorg-server-1-9-5:1.1.1.2 xorg-server-1-9-2:1.1.1.2 netbsd-5-1:1.1.1.1.0.6 netbsd-5-1-RELEASE:1.1.1.1 netbsd-5-1-RC4:1.1.1.1 netbsd-5-1-RC3:1.1.1.1 netbsd-5-1-RC2:1.1.1.1 netbsd-5-1-RC1:1.1.1.1 netbsd-5-0-2-RELEASE:1.1.1.1 xorg-server-1-6-5:1.1.1.1 xorg-server-1-6-3:1.1.1.1 netbsd-5-0-1-RELEASE:1.1.1.1 xorg-server-1-6-2:1.1.1.1 xorg-server-1-6-1-901:1.1.1.1 netbsd-5-0:1.1.1.1.0.4 netbsd-5-0-RELEASE:1.1.1.1 netbsd-5-0-RC4:1.1.1.1 netbsd-5-0-RC3:1.1.1.1 netbsd-5-0-RC2:1.1.1.1 netbsd-5-0-RC1:1.1.1.1 netbsd-5:1.1.1.1.0.2 netbsd-5-base:1.1.1.1 xorg-server-1-4-2:1.1.1.1 xorg:1.1.1; locks; strict; comment @# @; 1.2 date 2016.08.11.00.04.29; author mrg; state dead; branches; next 1.1; commitid FQxwnZNPy5ZgOOhz; 1.1 date 2008.07.31.19.50.32; author mrg; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2008.07.31.19.50.32; author mrg; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2010.11.23.05.21.24; author mrg; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2011.08.02.06.56.52; author mrg; state Exp; branches; next ; desc @@ 1.2 log @first merge of netbsd changes. not tested yet. @ text @ File Index
Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

usb-common.c File Reference

#include "usb-private.h"
#include "usb-mouse.h"

Functions

void usbRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, int minButton, BLOCK block)
void usbInit (DevicePtr pDev, usbType type)
void usbOff (DevicePtr pDev)
pointer usbCreatePrivate (DeviceIntPtr pDevice)
void usbDestroyPrivate (pointer priv)

Detailed Description

Routines that are common between #usb-keyboard.c, #usb-mouse.c, and #usb-other.c

Function Documentation

pointer usbCreatePrivate DeviceIntPtr  pDevice  ) 
 

Create a private structure for use within this file.

void usbDestroyPrivate pointer  priv  ) 
 

Destroy a private structure.

void usbInit DevicePtr  pDev,
usbType  type
 

Initialized pDev as a usbMouse, usbKeyboard, or usbOther device.

void usbOff DevicePtr  pDev  ) 
 

Turn pDev off (i.e., stop taking input from pDev).

void usbRead DevicePtr  pDev,
MOTIONPROC  motion,
ENQUEUEPROC  enqueue,
int  minButton,
BLOCK  block
 

Read an event from the pDev device. If the event is a motion event, enqueue it with the motion function. Otherwise, enqueue the event with the enqueue function. The block type is passed to the functions so that they may block SIGIO handling as appropriate to the caller of this function.

Since USB devices return EV_KEY events for buttons and keys, minButton is used to decide if a Button or Key event should be queued.


Generated June 29, 2004 for Distributed Multihead X by doxygen 1.3.4. @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @initial import of xorg-server-1.4.2 @ text @@ 1.1.1.2 log @import xorg-server 1.9.2. important changes since 1.6.5 include: - built-in symbol visibility, default not export - fixes for various crashes - many fixes for XI2, EXA, dix, render, glx, xkb, EDID, randr, Xv, resource handling, Xext, vfb, xfree86 / vga and composite support. - fixes several memory leaks - many many documentation updates - record extension enabled - no longer looks for XF86Config files @ text @d9 8 a16 85

usb-common.c File Reference

#include "usb-private.h"
#include "usb-mouse.h"

Defines

#define USB_COMMON_DEBUG   1
#define GETPRIV
#define GETNAME
#define LOG0(f)   dmxLog(dmxDebug,f)
#define LOG1(f, a)   dmxLog(dmxDebug,f,a)
#define LOG2(f, a, b)   dmxLog(dmxDebug,f,a,b)
#define LOG3(f, a, b, c)   dmxLog(dmxDebug,f,a,b,c)
#define LOG1INPUT(p, f, a)   dmxLogInput(p->dmxInput,f,a)
#define LOG3INPUT(p, f, a, b, c)   dmxLogInput(p->dmxInput,f,a,b,c)
#define LOG5INPUT(p, f, a, b, c, d, e)   dmxLogInput(p->dmxInput,f,a,b,c,d,e)
#define FATAL0(f)   dmxLog(dmxFatal,f)
#define FATAL1(f, a)   dmxLog(dmxFatal,f,a)
#define FATAL2(f, a, b)   dmxLog(dmxFatal,f,a,b)
#define MOTIONPROC   dmxMotionProcPtr
#define ENQUEUEPROC   dmxEnqueueProcPtr
#define CHECKPROC   dmxCheckSpecialProcPtr
#define BLOCK   DMXBlockType
#define PRESS(b)
#define RELEASE(b)
#define test_bit(bit)   (priv->mask[(bit)/8] & (1 << ((bit)%8)))
#define test_bits(bit)   (bits[(bit)/8] & (1 << ((bit)%8)))

Functions

void usbRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, int minButton, BLOCK block)
static void usbPrint (myPrivate *priv, const char *filename, const char *devname, int fd)
void usbInit (DevicePtr pDev, usbType type)
void usbOff (DevicePtr pDev)
pointer usbCreatePrivate (DeviceIntPtr pDevice)
void usbDestroyPrivate (pointer priv)

Detailed Description

Routines that are common between usb-keyboard.c, usb-mouse.c, and usb-other.c


Define Documentation

#define BLOCK   DMXBlockType
#define CHECKPROC   dmxCheckSpecialProcPtr
d18 1 a18 12
#define ENQUEUEPROC   dmxEnqueueProcPtr
d20 1 a20 17
#define FATAL0 (   f  )     dmxLog(dmxFatal,f)
d22 1 a22 26
#define FATAL1 (   f,
  a 
)    dmxLog(dmxFatal,f,a)
d24 1 a24 1

Referenced by usbInit().

d26 15 a40 28
a41 3
#define FATAL2 (   f,
  a,
  b 
)    dmxLog(dmxFatal,f,a,b)
a42 9
d44 26 a69 35
Value:
((DMXLocalInputInfoPtr)(pDevice->public.devicePrivate)) \
                      ->name

Referenced by usbPrint().

#define GETNAME
#define GETPRIV
Value:
myPrivate *priv                                         \
                      = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
a70 3
#define LOG0 (   f  )     dmxLog(dmxDebug,f)
a71 23
d73 19 a91 9
#define LOG1 (   f,
  a 
)    dmxLog(dmxDebug,f,a)
d93 4 a96 4 a98 1 a99 5 d101 2 a102 2 d106 2 a107 2 a108 5
#define LOG1INPUT (   p,   f,
  a )    dmxLogInput(p->dmxInput,f,a)

Referenced by usbPrint().

a109 29
d111 26 a136 14
#define LOG2 (   f,
  a,
  b 
)    dmxLog(dmxDebug,f,a,b)
a137 26
#define LOG3 (   f,
  a,
  b,
  c 
)    dmxLog(dmxDebug,f,a,b,c)
a138 43

Referenced by usbRead().

d140 19 a158 29

Referenced by usbPrint().

#define LOG3INPUT (   p,
  f,
  a,
  b,
  c 
)    dmxLogInput(p->dmxInput,f,a,b,c)
d160 4 a163 4 a165 1 a166 5 d168 2 a169 2 a171 158
#define LOG5INPUT (   p,
  f,
  a,
  b,   c,
  d,   e 
)    dmxLogInput(p->dmxInput,f,a,b,c,d,e)

Referenced by usbPrint().

#define MOTIONPROC   dmxMotionProcPtr
#define PRESS (   b  ) 
Value:
do {                                                 \
        enqueue(pDev, ButtonPress, 0, 0, NULL, block);   \
    } while (0)
#define RELEASE (   b  ) 
Value:
do {                                                 \
        enqueue(pDev, ButtonRelease, 0, 0, NULL, block); \
    } while (0)
#define test_bit (   bit  )     (priv->mask[(bit)/8] & (1 << ((bit)%8)))

Referenced by othUSBGetInfo(), usbInit(), and usbPrint().

#define test_bits (   bit  )     (bits[(bit)/8] & (1 << ((bit)%8)))

Referenced by usbInit(), and usbPrint().

#define USB_COMMON_DEBUG   1

Function Documentation

pointer usbCreatePrivate ( DeviceIntPtr  pDevice  ) 

Create a private structure for use within this file.

References _myPrivate::fd, and _myPrivate::pDevice.

a172 20
void usbDestroyPrivate ( pointer  priv  ) 

Destroy a private structure.

d174 2 a175 2 a178 24
void usbInit ( DevicePtr  pDev,
usbType  type )

Initialized pDev as a usbMouse, usbKeyboard, or usbOther device.

References FATAL1, O_NONBLOCK, test_bit, test_bits, usbKeyboard, usbMouse, usbOther, and usbPrint().

Referenced by kbdUSBInit(), mouUSBInit(), and othUSBInit().

d180 2 a181 17
void usbOff ( DevicePtr  pDev  ) 

Turn pDev off (i.e., stop taking input from pDev).

a183 1 a184 5 d186 2 a187 2 a189 1 d191 2 a192 2 a193 10
static void usbPrint ( myPrivate priv, const char *  filename,
const char *  devname, int  fd 
) [static]
d196 15 a210 12

Read an event from the pDev device. If the event is a motion event, enqueue it with the motion function. Otherwise, enqueue the event with the enqueue function. The block type is passed to the functions so that they may block SIGIO handling as appropriate to the caller of this function.

Since USB devices return EV_KEY events for buttons and keys, minButton is used to decide if a Button or Key event should be queued.

References DMX_ABSOLUTE, DMX_RELATIVE, LOG3, PRESS, and RELEASE.

Referenced by mouUSBRead(), and othUSBRead().

@ 1.1.1.3 log @initial import of xorg-server 1.10.3. highlights include: - fixes xorg bugs 29969, 30367, 30527, 30267, 30260, 29046, 30260, 31548, 28672, 24887, 32115, 21457, 32436, 21827, 28414, 24703, 32803, 16318, 33449, 33324, 33929, 35082, 35209, 36146, 36119 - many additional NULL checks - adjustments related to input ABI 12 - *lots* of dead code removal - vga arbitrator fixes - GL fixes - EDID fixes - conversion to using asprintf() in many places - many fixes from valgrind, compiler warnings see these for more details: http://lists.freedesktop.org/archives/xorg-announce/2011-February/001612.html http://lists.freedesktop.org/archives/xorg-announce/2011-April/001646.html http://lists.freedesktop.org/archives/xorg-announce/2011-May/001675.html http://lists.freedesktop.org/archives/xorg-announce/2011-July/001710.html @ text @d9 3 a11 2
void usbRead ( DevicePtr  pDev,
MOTIONPROC  motion,
ENQUEUEPROC  enqueue,
int  minButton,
BLOCK  block 
)
d38 21 a58 21 d61 6 a66 6 d68 3 a70 3

Detailed Description

Routines that are common between usb-keyboard.c, usb-mouse.c, and usb-other.c


Define Documentation

d76 1 a76 1 d89 1 a89 1 d102 1 a102 1 d117 4 a120 3 d135 1 a135 1 d141 2 a142 2 d147 1 a147 1 d164 1 a164 1 d170 1 a170 1 d176 2 a177 2 d182 1 a182 1 d200 1 a200 1 Value:
((DMXLocalInputInfoPtr)(pDevice->public.devicePrivate)) \
d218 1
a218 1
                      = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
a219 2

Referenced by usbInit(), usbOff(), and usbRead().

d229 4 a232 3
d247 1 a247 1 d253 2 a254 2 d259 1 a259 1 d274 1 a274 1 d280 1 a280 1 d286 2 a287 2 d292 1 a292 1 d309 1 a309 1 d315 1 a315 1 d321 2 a322 2 d327 1 a327 1 d342 1 a342 1 d348 1 a348 1 d354 1 a354 1 d360 2 a361 2 d366 1 a366 1 d383 1 a383 1 d389 1 a389 1 d395 1 a395 1 d401 1 a401 1 d407 2 a408 2 d413 1 a413 1 d430 1 a430 1 d436 1 a436 1 d442 1 a442 1 d448 1 a448 1 d454 1 a454 1 d460 1 a460 1 d466 2 a467 2 d472 1 a472 1 d487 1 a487 1 d502 3 a504 2 d523 3 a525 2 d544 4 a547 3 d564 4 a567 3 d582 1 a582 1 d598 3 a600 2 d619 3 a621 2 d638 2 a639 2 d644 2 a645 2 d650 1 a650 1 d657 1 a657 1

References FATAL1, GETPRIV, O_NONBLOCK, test_bit, test_bits, usbKeyboard, usbMouse, usbOther, and usbPrint().

d670 3 a672 2 a679 2

References GETPRIV.

d689 2 a690 2 d695 2 a696 2 d701 2 a702 2 d707 2 a708 2 d713 1 a713 1 d732 2 a733 2 d738 2 a739 2 d744 2 a745 2 d750 2 a751 2 d756 2 a757 2 d762 1 a762 1 d770 1 a770 1

References DMX_ABSOLUTE, DMX_MAX_AXES, DMX_RELATIVE, GETPRIV, LOG3, PRESS, and RELEASE.

a776 4
#define USB_COMMON_DEBUG   1
#define GETPRIV
#define GETNAME
#define LOG0(f)   dmxLog(dmxDebug,f)
#define LOG1(f, a)   dmxLog(dmxDebug,f,a)
#define LOG2(f, a, b)   dmxLog(dmxDebug,f,a,b)
#define LOG3(f, a, b, c)   dmxLog(dmxDebug,f,a,b,c)
#define LOG1INPUT(p, f, a)   dmxLogInput(p->dmxInput,f,a)
#define LOG3INPUT(p, f, a, b, c)   dmxLogInput(p->dmxInput,f,a,b,c)
#define LOG5INPUT(p, f, a, b, c, d, e)   dmxLogInput(p->dmxInput,f,a,b,c,d,e)
#define FATAL0(f)   dmxLog(dmxFatal,f)
#define FATAL1(f, a)   dmxLog(dmxFatal,f,a)
#define FATAL2(f, a, b)   dmxLog(dmxFatal,f,a,b)
#define MOTIONPROC   dmxMotionProcPtr
#define ENQUEUEPROC   dmxEnqueueProcPtr
#define CHECKPROC   dmxCheckSpecialProcPtr
#define BLOCK   DMXBlockType
#define PRESS(b)
#define RELEASE(b)
#define test_bit(bit)   (priv->mask[(bit)/8] & (1 << ((bit)%8)))
#define test_bits(bit)   (bits[(bit)/8] & (1 << ((bit)%8)))
void usbRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, int minButton, BLOCK block)
static void usbPrint (myPrivate *priv, const char *filename, const char *devname, int fd)
void usbInit (DevicePtr pDev, usbType type)
void usbOff (DevicePtr pDev)
pointer usbCreatePrivate (DeviceIntPtr pDevice)
void usbDestroyPrivate (pointer priv)
#define BLOCK   DMXBlockType#define CHECKPROC   dmxCheckSpecialProcPtr#define ENQUEUEPROC   dmxEnqueueProcPtr  f)    dmxLog(dmxFatal,f)      dmxLog(dmxFatal,f,a)       dmxLog(dmxFatal,f,a,b)  f)    dmxLog(dmxDebug,f)      dmxLog(dmxDebug,f,a)       dmxLogInput(p->dmxInput,f,a)       dmxLog(dmxDebug,f,a,b)        dmxLog(dmxDebug,f,a,b,c)         dmxLogInput(p->dmxInput,f,a,b,c)           dmxLogInput(p->dmxInput,f,a,b,c,d,e)#define MOTIONPROC   dmxMotionProcPtr  b)  b)  bit)    (priv->mask[(bit)/8] & (1 << ((bit)%8)))  bit)    (bits[(bit)/8] & (1 << ((bit)%8)))#define USB_COMMON_DEBUG   1DeviceIntPtr  pDevice)pointer  priv)DevicePtr  pDev, usbType  type DevicePtr  pDev)myPrivate priv, const char *  filename, const char *  devname, int  fd  [static]DevicePtr  pDev, MOTIONPROC  motion, ENQUEUEPROC  enqueue, int  minButton, BLOCK  block