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 @
#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) |
|
|
Create a private structure for use within this file. |
|
|
Destroy a private structure. |
|
||||||||||||
|
Initialized pDev as a usbMouse, usbKeyboard, or usbOther device. |
|
|
Turn pDev off (i.e., stop taking input from pDev). |
|
||||||||||||||||||||||||
|
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. |
#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) |
Routines that are common between usb-keyboard.c, usb-mouse.c, and usb-other.c
| #define BLOCK DMXBlockType |
| #define CHECKPROC dmxCheckSpecialProcPtr |
| #define ENQUEUEPROC dmxEnqueueProcPtr |
| #define FATAL0 | ( | f | ) | dmxLog(dmxFatal,f) |
| #define FATAL1 | ( | f, | ||
| a | ||||
| ) | dmxLog(dmxFatal,f,a) |
Referenced by usbInit().
d26 15 a40 28| #define FATAL2 | ( | f, | ||
| a, | ||||
| b | ||||
| ) | dmxLog(dmxFatal,f,a,b) | a41 3
| #define GETNAME |
| #define GETPRIV |
myPrivate *priv \ = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
| #define LOG0 | ( | f | ) | dmxLog(dmxDebug,f) | a70 3
| #define LOG1 | ( | f, | |||||
| a | |||||||
| ) | dmxLog(dmxDebug,f,a) |
| #define LOG1INPUT | ( | p, | a98 1a99 5 | f, | |||
| d101 2 a102 2 | a | d106 2 a107 2 | ) | dmxLogInput(p->dmxInput,f,a) | a108 5
Referenced by usbPrint().
a109 29| #define LOG2 | ( | f, | |||||
| a, | |||||||
| b | |||||||
| ) | dmxLog(dmxDebug,f,a,b) |
| #define LOG3 | ( | f, | a137 26||
| a, | ||||
| b, | ||||
| c | ||||
| ) | dmxLog(dmxDebug,f,a,b,c) |
Referenced by usbRead().
| #define LOG3INPUT | ( | p, | |||||
| f, | |||||||
| a, | |||||||
| b, | |||||||
| c | |||||||
| ) | dmxLogInput(p->dmxInput,f,a,b,c) |
| #define LOG5INPUT | ( | p, | |||||
| f, | |||||||
| a, | b, | a165 1a166 5 | c, | ||||
| d168 2 a169 2 | d, | a171 158e | |||||
| ) | dmxLogInput(p->dmxInput,f,a,b,c,d,e) |
Referenced by usbPrint().
| #define MOTIONPROC dmxMotionProcPtr |
| #define PRESS | ( | b | ) |
do { \ enqueue(pDev, ButtonPress, 0, 0, NULL, block); \ } while (0)
| #define RELEASE | ( | b | ) |
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 |
| pointer usbCreatePrivate | ( | DeviceIntPtr | pDevice | ) |
Create a private structure for use within this file.
References _myPrivate::fd, and _myPrivate::pDevice.
| void usbDestroyPrivate | ( | pointer | priv | ) | a172 20
Destroy a private structure.
| void usbInit | ( | DevicePtr | pDev, | ||||
| d174 2 a175 2 | usbType | type | a178 24 | ) |
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().
| void usbOff | ( | DevicePtr | pDev | ) | d180 2 a181 17
Turn pDev off (i.e., stop taking input from pDev).
| static void usbPrint | ( | myPrivate * | priv, | a183 1a184 5 | const char * | filename, |
| d186 2 a187 2 | const char * | devname, | a189 1d191 2 a192 2 | int | fd | a193 10 |
| ) | [static] |
| void usbRead | ( | DevicePtr | pDev, | |
| MOTIONPROC | motion, | |||
| ENQUEUEPROC | enqueue, | |||
| int | minButton, | |||
| BLOCK | block | |||
| ) |