3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
7 * Please note that the comments on this file may be out of date
8 * and that they represent what I have figured about the shmiq device
11 * This also contains some streams and idev bits.
13 * They may contain errors, please, refer to the source code of the Linux
14 * kernel for a definitive answer on what we have implemented
22 #define STRIOC ('S' << 8)
23 #define I_STR (STRIOC | 010)
24 #define I_PUSH (STRIOC | 02)
25 #define I_LINK (STRIOC | 014)
26 #define I_UNLINK (STRIOC | 015)
28 /* Data structure passed on I_STR ioctls */
30 int ic_cmd
; /* streams ioctl command */
31 int ic_timout
; /* timeout */
32 int ic_len
; /* lenght of data */
33 void *ic_dp
; /* data */
37 * For mapping the shared memory input queue, you have to:
39 * 1. Map /dev/zero for the number of bytes you want to use
40 * for your shared memory input queue plus the size of the
41 * sharedMemoryInputQueue structure + 4 (I still have not figured
42 * what this one is for
46 * 3. Open /dev/qcntlN N is [0..Nshmiqs]
48 * 4. Fill a shmiqreq structure. user_vaddr should point to the return
49 * address from the /dev/zero mmap. Arg is the number of shmqevents
50 * that fit into the /dev/zero region (remember that at the beginning there
51 * is a sharedMemoryInputQueue header).
53 * 5. Issue the ioctl (qcntlfd, QIOCATTACH, &your_shmiqreq);
61 /* map the shmiq into the process address space */
62 #define QIOCATTACH _IOW('Q',1,struct shmiqreq)
65 #define QIOCDETACH _IO('Q',2)
68 * A shared memory input queue event.
71 unsigned char device
; /* device major */
72 unsigned char which
; /* device minor */
73 unsigned char type
; /* event type */
74 unsigned char flags
; /* little event data */
76 int pos
; /* big event data */
77 short ptraxis
[2]; /* event data for PTR events */
81 /* indetifies the shmiq and the device */
90 struct shmiqlinkid id
;
92 struct shmqdata data
;
96 * sharedMemoryInputQueue: this describes the shared memory input queue.
98 * head is the user index into the events, user can modify this one.
99 * tail is managed by the kernel.
100 * flags is one of SHMIQ_OVERFLOW or SHMIQ_CORRUPTED
101 * if OVERFLOW is set it seems ioctl QUIOCSERVICED should be called
102 * to notify the kernel.
103 * events where the kernel sticks the events.
105 struct sharedMemoryInputQueue
{
106 volatile int head
; /* user's index into events */
107 volatile int tail
; /* kernel's index into events */
108 volatile unsigned int flags
; /* place for out-of-band data */
109 #define SHMIQ_OVERFLOW 1
110 #define SHMIQ_CORRUPTED 2
111 struct shmqevent events
[1]; /* input event buffer */
114 /* have to figure this one out */
115 #define QIOCGETINDX _IOWR('Q', 8, int)
118 /* acknowledge shmiq overflow */
119 #define QIOCSERVICED _IO('Q', 3)
121 /* Double indirect I_STR ioctl, yeah, fun fun fun */
124 int index
; /* lower stream index */
125 int realcmd
; /* the actual command for the subdevice */
127 /* Double indirect ioctl */
128 #define QIOCIISTR _IOW('Q', 7, struct muxioctl)
132 /* set cursor tracking mode */
133 #define QIOCURSTRK _IOW('Q', 4, int)
135 /* set cursor filter box */
136 #define QIOCURSIGN _IOW('Q', 5, int [4])
138 /* set cursor axes */
139 struct shmiqsetcurs
{
144 #define QIOCSETCURS _IOWR('Q', 9, struct shmiqsetcurs)
146 /* set cursor position */
147 struct shmiqsetcpos
{
151 #define QIOCSETCPOS _IOWR('Q', 10, struct shmiqsetcpos)
153 /* get time since last event */
154 #define QIOCGETITIME _IOR('Q', 11, time_t)
156 /* set curent screen */
157 #define QIOCSETSCRN _IOW('Q',6,int)
160 /* -------------------- iDev stuff -------------------- */
162 #define IDEV_MAX_NAME_LEN 15
163 #define IDEV_MAX_TYPE_LEN 15
166 char devName
[IDEV_MAX_NAME_LEN
+1];
167 char devType
[IDEV_MAX_TYPE_LEN
+1];
168 unsigned short nButtons
;
169 unsigned short nValuators
;
170 unsigned short nLEDs
;
171 unsigned short nStrDpys
;
172 unsigned short nIntDpys
;
173 unsigned char nBells
;
175 #define IDEV_HAS_KEYMAP 0x01
176 #define IDEV_HAS_PROXIMITY 0x02
177 #define IDEV_HAS_PCKBD 0x04
181 char *nothing_for_now
;
184 #define IDEV_KEYMAP_NAME_LEN 15
187 char name
[IDEV_KEYMAP_NAME_LEN
+1];
190 /* The valuator definition */
197 unsigned char possibleModes
;
198 #define IDEV_ABSOLUTE 0x0
199 #define IDEV_RELATIVE 0x1
200 #define IDEV_EITHER 0x2
202 unsigned char mode
; /* One of: IDEV_ABSOLUTE, IDEV_RELATIVE */
204 unsigned short resolution
;
209 /* This is used to query a specific valuator with the IDEVGETVALUATORDESC ioctl */
212 unsigned short flags
;
213 idevValuatorDesc desc
;
216 #define IDEVGETDEVICEDESC _IOWR('i', 0, idevDesc)
217 #define IDEVGETVALUATORDESC _IOWR('i', 1, idevGetSetValDesc)
218 #define IDEVGETKEYMAPDESC _IOWR('i', 2, idevKeymapDesc)
219 #define IDEVINITDEVICE _IOW ('i', 51, unsigned int)
224 /* These are only interpreted by SHMIQ-attacheable devices and are internal
227 #define SHMIQ_OFF _IO('Q',1)
228 #define SHMIQ_ON _IO('Q',2)
230 void shmiq_push_event (struct shmqevent
*e
);
231 int get_sioc (struct strioctl
*sioc
, unsigned long arg
);
234 #endif /* _ASM_SHMIQ_H */