2 * Copyright (c) 2001 Edouard TISSERANT <tissered@esstin.u-nancy.fr>
3 * Parts inspired from Shane Watts <shane@bofh.asn.au> XFree86 3 Acecad Driver
4 * Thanks to Emily, from AceCad, For giving me documents.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
21 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 /* $XFree86: xc/programs/Xserver/hw/xfree86/input/acecad/acecad.c,v 1.4 2003/10/30 00:40:45 dawes Exp $ */
31 /*****************************************************************************
33 ****************************************************************************/
36 #include <asm/types.h>
37 #include <linux/input.h>
52 #ifndef NEED_XF86_TYPES
53 #define NEED_XF86_TYPES
55 #include <xf86_OSproc.h>
57 #include <xf86Xinput.h>
59 #include <xf86Module.h>
69 /*****************************************************************************
71 ****************************************************************************/
74 /*****************************************************************************
75 * Variables without includable headers
76 ****************************************************************************/
78 /*****************************************************************************
80 ****************************************************************************/
83 #define read(a,b,c) xf86ReadSerial((a),(b),(c))
85 /* max number of input events to read in one read call */
88 _X_EXPORT InputDriverRec ACECAD =
100 static XF86ModuleVersionInfo VersionRec =
106 XORG_VERSION_CURRENT,
107 PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
115 _X_EXPORT XF86ModuleData acecadModuleData = {
121 /*****************************************************************************
122 * Function Definitions
123 ****************************************************************************/
126 SetupProc( pointer module,
131 xf86AddInputDriver(&ACECAD, module, 0);
136 TearDownProc( pointer p )
139 LocalDevicePtr local = (LocalDevicePtr) p;
140 AceCadPrivatePtr priv = (AceCadPrivatePtr) local->private;
142 DeviceOff (local->dev);
144 xf86CloseSerial (local->fd);
145 XisbFree (priv->buffer);
153 static const char *default_options[] =
161 "FlowControl", "Xoff",
172 SYSCALL(err = ioctl(fd, EVIOCGVERSION, &version));
175 xf86MsgVerb(X_PROBED, 4, "Kernel Input driver version is %d.%d.%d\n",
176 version >> 16, (version >> 8) & 0xff, version & 0xff);
179 xf86MsgVerb(X_PROBED, 4, "No Kernel Input driver found\n");
184 /* Heavyly inspired by synpatics/eventcomm.c
185 * TODO use sysfs if possible */
186 #define DEV_INPUT_EVENT "/dev/input"
187 #define EVENT_DEV_NAME "event"
188 #define EV_DEV_NAME_MAXLEN 64
191 fd_query_acecad(int fd) {
192 char name[256] = "Unknown";
193 char ace_name[7] = "acecad";
194 ioctl(fd, EVIOCGNAME(sizeof(name)), name);
196 if (xf86NameCmp(name, ace_name) == 0)
202 AceCadAutoDevProbe(LocalDevicePtr local)
204 /* We are trying to find the right eventX device */
206 Bool have_evdev = FALSE;
208 const int max_skip = 10;
210 xf86Msg(X_INFO, "%s: probing event devices for Acecad tablets\n", local->name);
216 int np = snprintf(fname, EV_DEV_NAME_MAXLEN, "%s/%s%d", DEV_INPUT_EVENT, EVENT_DEV_NAME, i);
217 if (np < 0 || np >= EV_DEV_NAME_MAXLEN) {
218 xf86Msg(X_WARNING, "too many devices, giving up");
221 SYSCALL(fd = open(fname, O_RDONLY));
223 if (errno == ENOENT) {
224 if (++noent_cnt >= max_skip)
234 is_acecad = fd_query_acecad(fd);
237 xf86Msg(X_PROBED, "%s auto-dev sets device to %s\n",
239 xf86ReplaceStrOption(local->options, "Device", fname);
243 xf86Msg(X_ERROR, "%s: no Acecad event device found (checked %d nodes)\n",
246 xf86Msg(X_ERROR, "%s: The /dev/input/event* device nodes seem to be missing\n",
248 if (i > max_skip && !have_evdev)
249 xf86Msg(X_ERROR, "%s: The evdev kernel module seems to be missing\n", local->name);
256 AceCadPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
258 LocalDevicePtr local = xf86AllocateInput(drv, 0);
259 AceCadPrivatePtr priv = xcalloc (1, sizeof (AceCadPrivateRec));
264 if ((!local) || (!priv))
267 memset(priv,0,sizeof (AceCadPrivateRec));
269 local->name = dev->identifier;
270 local->type_name = "ACECAD Tablet";
271 local->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS;
272 local->motion_history_proc = xf86GetMotionEvents;
273 local->control_proc = NULL;
274 local->close_proc = CloseProc;
275 local->switch_mode = NULL;
276 local->conversion_proc = ConvertProc;
277 local->reverse_conversion_proc = ReverseConvertProc;
279 local->private = priv;
280 local->private_flags = 0;
281 local->conf_idev = dev;
282 local->device_control = DeviceControl;
283 /*local->always_core_feedback = 0;*/
285 xf86CollectInputOptions(local, default_options, NULL);
287 xf86OptionListReport(local->options);
289 priv->acecadInc = xf86SetIntOption(local->options, "Increment", 0 );
291 s = xf86FindOptionValue(local->options, "Device");
292 if (!s || (s && (xf86NameCmp(s, "auto-dev") == 0))) {
294 if (!AceCadAutoDevProbe(local))
296 xf86Msg(X_ERROR, "%s: unable to find device\n", local->name);
300 xf86Msg(X_NOT_IMPLEMENTED, "%s: device autodetection not implemented, sorry\n", local->name);
305 local->fd = xf86OpenSerial (local->options);
308 xf86Msg(X_ERROR, "%s: unable to open device\n", local->name);
311 xf86ErrorFVerb( 6, "tty port opened successfully\n" );
314 if(IsUSBLine(local->fd)){
317 local->read_input = USBReadInput;
319 if (USBQueryHardware(local) != Success)
321 xf86Msg(X_ERROR, "%s: unable to query/initialize hardware (not an %s?).\n", local->name, local->type_name);
329 local->read_input = ReadInput;
332 if (xf86FindOptionValue(local->options, "ReportSpeed")) {
334 speed = xf86SetIntOption(local->options, "ReportSpeed", 85 );
342 priv->acecadReportSpeed = 'Q';
345 priv->acecadReportSpeed = 'R';
348 priv->acecadReportSpeed = 'S';
351 priv->acecadReportSpeed = 'T';
354 priv->acecadReportSpeed = 'R';
356 xf86Msg(X_ERROR, "%s: ReportSpeed value %d invalid. Possible values: 120, 85, 10, 2. Defaulting to 85\n", local->name, speed);
360 xf86Msg(msgtype, "%s report %d points/s\n", local->name, speed);
362 priv->buffer = XisbNew (local->fd, 200);
365 * Verify that hardware is attached and fuctional
367 if (QueryHardware(priv) != Success)
369 xf86Msg(X_ERROR, "%s: unable to query/initialize hardware (not an %s?).\n", local->name, local->type_name);
374 s = xf86FindOptionValue(local->options, "Mode");
375 msgtype = s ? X_CONFIG : X_DEFAULT;
376 if (s && (xf86NameCmp(s, "Relative") == 0))
378 priv->flags = priv->flags & ~ABSOLUTE_FLAG;
382 priv->flags = priv->flags | ABSOLUTE_FLAG;
385 xf86Msg(msgtype, "%s is in %s mode\n", local->name, (priv->flags & ABSOLUTE_FLAG) ? "absolute" : "relative");
386 DBG (9, XisbTrace (priv->buffer, 1));
388 local->history_size = xf86SetIntOption(local->options , "HistorySize", 0);
390 xf86ProcessCommonOptions(local, local->options);
392 local->flags |= XI86_CONFIGURED;
396 RemoveEnabledDevice (local->fd);
399 XisbFree(priv->buffer);
402 xf86CloseSerial(local->fd);
404 RemoveEnabledDevice (local->fd);
409 * If something went wrong, cleanup and return NULL
412 if ((local) && (local->fd))
413 xf86CloseSerial (local->fd);
414 if ((priv) && (priv->buffer))
415 XisbFree (priv->buffer);
422 DeviceControl (DeviceIntPtr dev, int mode)
433 RetValue = DeviceOn( dev );
436 RetValue = DeviceOff( dev );
439 RetValue = DeviceClose( dev );
449 DeviceOn (DeviceIntPtr dev)
452 LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
453 AceCadPrivatePtr priv = (AceCadPrivatePtr) (local->private);
455 xf86MsgVerb(X_INFO, 4, "%s Device On\n", local->name);
457 local->fd = xf86OpenSerial(local->options);
460 xf86Msg(X_WARNING, "%s: cannot open input device\n", local->name);
461 /* TODO rescan if auto-dev */
466 if (priv->acecadUSB==0){
467 priv->buffer = XisbNew(local->fd, 200);
470 xf86CloseSerial(local->fd);
475 /*Rets qu'a l'envoyer a la tablette */
476 sprintf(buffer, "%s%c%c%c%c", acecad_initstr, priv->acecadReportSpeed, ACECAD_INCREMENT, 32 + priv->acecadInc, (priv->flags & ABSOLUTE_FLAG)? ACECAD_ABSOLUTE: ACECAD_RELATIVE);
477 XisbWrite (priv->buffer, (unsigned char *)buffer, strlen(buffer));
480 xf86FlushInput(local->fd);
481 xf86AddEnabledDevice (local);
482 dev->public.on = TRUE;
487 DeviceOff (DeviceIntPtr dev)
489 LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
490 AceCadPrivatePtr priv = (AceCadPrivatePtr) (local->private);
492 xf86MsgVerb(X_INFO, 4, "%s Device Off\n", local->name);
496 RemoveEnabledDevice (local->fd);
499 XisbFree(priv->buffer);
502 xf86CloseSerial(local->fd);
506 xf86RemoveEnabledDevice (local);
507 dev->public.on = FALSE;
512 DeviceClose (DeviceIntPtr dev)
514 LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
516 xf86MsgVerb(X_INFO, 4, "%s Device Close\n", local->name);
522 ControlProc(DeviceIntPtr dev, PtrCtrl *ctrl)
524 LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
526 xf86MsgVerb(X_INFO, 4, "%s Control Proc\n", local->name);
530 DeviceInit (DeviceIntPtr dev)
533 LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
534 AceCadPrivatePtr priv = (AceCadPrivatePtr) (local->private);
535 unsigned char map[] =
538 xf86MsgVerb(X_INFO, 4, "%s Init\n", local->name);
541 if (InitButtonClassDeviceStruct (dev, 3, map) == FALSE)
543 xf86Msg(X_ERROR, "%s: unable to allocate ButtonClassDeviceStruct\n", local->name);
547 if (InitFocusClassDeviceStruct (dev) == FALSE)
549 xf86Msg(X_ERROR, "%s: unable to allocate FocusClassDeviceStruct\n", local->name);
553 if (InitPtrFeedbackClassDeviceStruct(dev, ControlProc) == FALSE) {
554 xf86Msg(X_ERROR, "%s: unable to init ptr feedback\n", local->name);
560 if (InitValuatorClassDeviceStruct (dev, 3, xf86GetMotionEvents,
562 ((priv->flags & ABSOLUTE_FLAG)? Absolute: Relative)|OutOfProximity)
565 xf86Msg(X_ERROR, "%s: unable to allocate ValuatorClassDeviceStruct\n", local->name);
571 InitValuatorAxisStruct(dev,
574 priv->acecadMaxX, /* max val */
575 1000, /* resolution */
578 InitValuatorAxisStruct(dev,
581 priv->acecadMaxY, /* max val */
582 1000, /* resolution */
585 InitValuatorAxisStruct(dev,
588 priv->acecadMaxZ, /* max val */
589 1000, /* resolution */
595 if (InitProximityClassDeviceStruct (dev) == FALSE)
597 xf86Msg(X_ERROR, "%s: unable to allocate ProximityClassDeviceStruct\n", local->name);
601 xf86MotionHistoryAllocate (local);
604 /* On ne peut pas calculer l'increment avant, faute d'ecran pour
605 connaitre la taille... */
607 if (priv->acecadInc > 95)
608 priv->acecadInc = 95;
609 if (priv->acecadInc < 1)
611 /* guess the best increment value given video mode */
612 rx=priv->acecadMaxX / screenInfo.screens[0]->width;
613 ry=priv->acecadMaxY / screenInfo.screens[0]->height;
615 priv->acecadInc = rx;
617 priv->acecadInc = ry;
618 if (priv->acecadInc < 1)
622 xf86Msg(X_INFO, "%s Increment: %d\n", local->name, priv->acecadInc);
628 ReadInput (LocalDevicePtr local)
632 int is_core_pointer, is_absolute;
633 AceCadPrivatePtr priv = (AceCadPrivatePtr) (local->private);
635 /*xf86Msg(X_INFO, "ACECAD Tablet Read Input\n");*/
637 is_absolute = (priv->flags & ABSOLUTE_FLAG);
638 is_core_pointer = xf86IsCorePointer(local->dev);
641 * set blocking to -1 on the first call because we know there is data to
642 * read. Xisb automatically clears it after one successful read so that
643 * succeeding reads are preceeded buy a select with a 0 timeout to prevent
644 * read from blocking indefinately.
646 XisbBlockDuration (priv->buffer, -1);
648 while (AceCadGetPacket (priv) == Success)
650 x = (int)priv->packet[1] | ((int)priv->packet[2] << 7);
651 y = (int)priv->packet[3] | ((int)priv->packet[4] << 7);
653 if (!(priv->flags & ABSOLUTE_FLAG))
655 x = priv->packet[0] & XSIGN_BIT? x:-x;
656 y = priv->packet[0] & YSIGN_BIT? y:-y;
660 y = priv->acecadMaxY - y ;
664 z = ((int)priv->packet[5] << 2) |
665 (((int)priv->packet[6] & 0x01) << 1) |
666 (((int)priv->packet[6] & 0x10) >> 4);
668 buttons = ((int)priv->packet[0] & 0x07) |
669 ((int)priv->packet[6] & 0x02 << 2);
671 prox = (priv->packet[0] & PROXIMITY_BIT)? 0: 1;
675 if (!(priv->acecadOldProximity))
676 if (!is_core_pointer)
678 /*xf86Msg(X_INFO, "ACECAD Tablet ProxIN %d %d %d\n",x, y, z);*/
679 xf86PostProximityEvent(local->dev, 1, 0, 3 , x, y, z);
682 if ((is_absolute && ((priv->acecadOldX != x) || (priv->acecadOldY != y) || (priv->acecadOldZ != z)))
683 || (!is_absolute && (x || y)))
685 if (is_absolute || priv->acecadOldProximity)
687 /*xf86Msg(X_INFO, "ACECAD Tablet Motion %d %d %d\n", x, y, z);*/
688 xf86PostMotionEvent(local->dev, is_absolute, 0, 3, x, y, z);
692 if (priv->acecadOldButtons != buttons)
696 delta = buttons ^ priv->acecadOldButtons;
702 delta &= ~(1 << (id-1));
704 /*xf86Msg(X_INFO, "ACECAD Tablet Button %d 0x%x\n",id,(buttons&(1<<(id-1))));*/
705 xf86PostButtonEvent(local->dev, is_absolute, id, (buttons&(1<<(id-1))), 0, 3, x, y,z);
709 priv->acecadOldButtons = buttons;
710 priv->acecadOldX = x;
711 priv->acecadOldY = y;
712 priv->acecadOldZ = z;
713 priv->acecadOldProximity = prox;
717 if (!is_core_pointer)
718 if (priv->acecadOldProximity)
720 /*xf86Msg(X_INFO, "ACECAD Tablet ProxOUT %d %d %d\n",x, y, z);*/
721 xf86PostProximityEvent(local->dev, 0, 0, 3, x,y,z);
723 priv->acecadOldProximity = 0;
726 /*xf86Msg(X_INFO, "ACECAD Tablet Sortie Read Input\n");*/
730 #define set_bit(byte,nb,bit) (bit ? byte | (1<<nb) : byte & (~(1<<nb)))
732 USBReadInput (LocalDevicePtr local)
735 struct input_event * event;
736 char eventbuf[sizeof(struct input_event) * MAX_EVENTS];
737 AceCadPrivatePtr priv = (AceCadPrivatePtr) (local->private);
738 int x = priv->acecadOldX;
739 int y = priv->acecadOldY;
740 int z = priv->acecadOldZ;
741 int prox = priv->acecadOldProximity;
742 int buttons = priv->acecadOldButtons;
745 is_core_pointer = xf86IsCorePointer(local->dev);
747 SYSCALL(len = read(local->fd, eventbuf, sizeof(eventbuf)));
750 xf86Msg(X_ERROR, "%s: error reading device: %s\n", local->name, strerror(errno));
754 for (event=(struct input_event *)eventbuf;
755 event<(struct input_event *)(eventbuf+len); event++) {
757 switch (event->type) {
758 case EV_SYN: /* 2.6.x */
759 if (event->code != SYN_REPORT)
760 xf86Msg(X_ERROR, "%s: unknown EV_SYN code %d\n", local->name, event->code);
763 switch (event->code) {
783 switch (event->code) {
789 buttons=set_bit(buttons,0,event->value);
793 buttons=set_bit(buttons,1,event->value);
797 buttons=set_bit(buttons,2,event->value);
802 xf86Msg(X_ERROR, "%s: unknown event type/code %d/%d\n", local->name, event->type, event->code);
803 } /* switch event->type */
805 /* Linux Kernel 2.6.x sends EV_SYN/SYN_REPORT as an event terminator,
806 * whereas 2.4.x sends EV_ABS/ABS_MISC. We have to support both.
808 if (!( (event->type == EV_SYN && event->code == SYN_REPORT) ||
809 (event->type == EV_ABS && event->code == ABS_MISC)
816 if (!(priv->acecadOldProximity))
817 if (!is_core_pointer)
819 xf86PostProximityEvent(local->dev, 1, 0, 3 , x, y, z);
823 xf86PostMotionEvent(local->dev, 1, 0, 3, x, y, z);
825 if (priv->acecadOldButtons != buttons)
829 delta = buttons ^ priv->acecadOldButtons;
835 delta &= ~(1 << (id-1));
837 xf86PostButtonEvent(local->dev, 1, id, (buttons&(1<<(id-1))), 0, 3, x, y,z);
843 if (!is_core_pointer)
844 if (priv->acecadOldProximity)
846 xf86PostProximityEvent(local->dev, 0, 0, 3, x,y,z);
848 priv->acecadOldProximity = 0;
851 priv->acecadOldButtons = buttons;
852 priv->acecadOldX = x;
853 priv->acecadOldY = y;
854 priv->acecadOldZ = z;
855 priv->acecadOldProximity = prox;
857 /*xf86Msg(X_INFO, "ACECAD Tablet Sortie Read Input\n");*/
862 CloseProc (LocalDevicePtr local)
867 * The ConvertProc function may need to be tailored for your device.
868 * This function converts the device's valuator outputs to x and y coordinates
869 * to simulate mouse events.
872 ConvertProc (LocalDevicePtr local,
884 AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private);
886 *x = v0 * screenInfo.screens[0]->width / priv->acecadMaxX;
887 *y = v1 * screenInfo.screens[0]->height / priv->acecadMaxY;
893 ReverseConvertProc( LocalDevicePtr local,
898 AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private);
900 valuators[0] = x * priv->acecadMaxX / screenInfo.screens[0]->width;
901 valuators[1] = y * priv->acecadMaxY / screenInfo.screens[0]->height;
907 #define WriteString(str)\
908 XisbWrite (priv->buffer, (unsigned char *)(str), strlen(str))
912 QueryHardware (AceCadPrivatePtr priv)
921 /* Prompt Mode in order to not be disturbed */
922 WriteString(ACECAD_PROMPT_MODE);
925 while(XisbRead(priv->buffer)>=0);
927 /* Ask for Config packet*/
928 WriteString(ACECAD_CONFIG);
930 /* Read the packet */
931 XisbBlockDuration (priv->buffer, 1000000);
934 /*xf86Msg(X_CONFIG, "ACECAD Tablet init envoyé \n");*/
936 if ((AceCadGetPacket (priv) == Success))
938 priv->acecadMaxX = (int)priv->packet[1] + ((int)priv->packet[2] << 7);
939 priv->acecadMaxY = (int)priv->packet[3] + ((int)priv->packet[4] << 7);
940 priv->acecadMaxZ = 512;
941 xf86Msg(X_PROBED, "ACECAD Tablet MaxX:%d MaxY:%d\n", priv->acecadMaxX, priv->acecadMaxY);
946 /*xf86Msg(X_INFO, "ACECAD Tablet query hardware fini \n");*/
950 #define BITS_PER_LONG (sizeof(long) * 8)
951 #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
952 #define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
953 #define OFF(x) ((x)%BITS_PER_LONG)
954 #define LONG(x) ((x)/BITS_PER_LONG)
958 USBQueryHardware (LocalDevicePtr local)
960 AceCadPrivatePtr priv = (AceCadPrivatePtr) local->private;
961 unsigned long bit[EV_MAX][NBITS(KEY_MAX)];
964 char name[256] = "Unknown";
966 ioctl(local->fd, EVIOCGNAME(sizeof(name)), name);
967 xf86MsgVerb(X_PROBED, 4, "Kernel Input device name: \"%s\"\n", name);
969 memset(bit, 0, sizeof(bit));
970 ioctl(local->fd, EVIOCGBIT(0, EV_MAX), bit[0]);
972 for (i = 0; i < EV_MAX; i++)
973 if (test_bit(i, bit[0])) {
974 ioctl(local->fd, EVIOCGBIT(i, KEY_MAX), bit[i]);
975 for (j = 0; j < KEY_MAX; j++)
976 if (test_bit(j, bit[i])) {
978 ioctl(local->fd, EVIOCGABS(j), abs);
981 priv->acecadMaxX = abs[2];
985 priv->acecadMaxY = abs[2];
989 priv->acecadMaxZ = abs[2];
996 xf86Msg(X_PROBED, "ACECAD Tablet MaxX:%d MaxY:%d MaxZ:%d\n", priv->acecadMaxX, priv->acecadMaxY,priv->acecadMaxZ);
1002 NewPacket (AceCadPrivatePtr priv)
1008 AceCadGetPacket (AceCadPrivatePtr priv)
1013 while((c = XisbRead(priv->buffer))>=0 )
1017 * fail after 500 bytes so the server doesn't hang forever if a
1018 * device sends bad data.
1026 if (c & PHASING_BIT)
1030 /*xf86Msg(X_CONFIG, "Push %2.2x\n",(char) c);*/
1031 XisbBlockDuration (priv->buffer, 10000);
1032 priv->packet[priv->packeti++] = c;
1033 count=ACECAD_PACKET_SIZE-1;
1034 while(count-- && (c = XisbRead(priv->buffer))>=0)
1036 /*xf86Msg(X_INFO, "Push %2.2x\n",(char) c);*/
1037 priv->packet[priv->packeti++] = c;
1039 XisbBlockDuration (priv->buffer, 0);