diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/wcmUSB.c | 17 | ||||
-rw-r--r-- | src/wcmValidateDevice.c | 31 | ||||
-rw-r--r-- | src/xf86Wacom.c | 9 | ||||
-rw-r--r-- | src/xf86Wacom.h | 4 | ||||
-rw-r--r-- | src/xf86WacomDefs.h | 9 |
6 files changed, 65 insertions, 7 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 461089f..39bf392 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,7 +24,7 @@ # -avoid-version prevents gratuitous .0.0.0 version numbers on the end # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(XORG_CFLAGS) $(XDRV_CFLAGS) @DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la @DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version diff --git a/src/wcmUSB.c b/src/wcmUSB.c index 954af06..570d7a3 100644 --- a/src/wcmUSB.c +++ b/src/wcmUSB.c @@ -1,6 +1,8 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <pingc@wacom.com> + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -375,6 +377,19 @@ static Bool usbDetect(LocalDevicePtr local) DBG(1, priv, "\n"); #endif +#ifdef sun + /* On Solaris, usbwcm STREAMS module is required */ + err = ioctl(local->fd, I_FIND, "usbwcm"); + if (err == 0) + err = ioctl(local->fd, I_PUSH, "usbwcm"); + if (err < 0) + { + xf86Msg(X_ERROR, "%s: usbDetect: failed to push STREAMS module\n", + local->name); + return err; + } +#endif /* sun */ + SYSCALL(err = ioctl(local->fd, EVIOCGVERSION, &version)); if (err < 0) @@ -513,7 +528,9 @@ Bool usbWcmInit(LocalDevicePtr local, char* id, float *version) /* fetch vendor, product, and model name */ ioctl(local->fd, EVIOCGID, &sID); +#ifdef EVIOCGNAME /* this ioctl is not supported on Solairs */ ioctl(local->fd, EVIOCGNAME(sizeof(id)), id); +#endif /* retrieve tool type, device type and buttons from the kernel */ if (ioctl(local->fd, EVIOCGBIT(EV_KEY,sizeof(keys)),keys) < 0) diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index e8f4c2b..1eac0d3 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -1,5 +1,7 @@ /* * Copyright 2009 by Ping Cheng, Wacom. <pingc@wacom.com> + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -24,10 +26,9 @@ #include "wcmFilter.h" #include <sys/stat.h> #include <fcntl.h> +#ifndef sun #include <linux/serial.h> - -#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) - +#endif Bool wcmIsAValidType(const char *type, unsigned long* keys); int wcmNeedAutoHotplug(LocalDevicePtr local, const char **type, @@ -147,7 +148,7 @@ ret: static struct { const char* type; - __u16 tool; + uint16_t tool; } wcmType [] = { { "stylus", BTN_TOOL_PEN }, @@ -185,7 +186,9 @@ int wcmDeviceTypeKeys(LocalDevicePtr local, unsigned long* keys) int fd = -1, id = 0; char* device, *stopstring; char* str = strstr(local->name, "WACf"); +#ifndef sun struct serial_struct tmp; +#endif device = xf86SetStrOption(local->options, "Device", NULL); @@ -201,7 +204,8 @@ int wcmDeviceTypeKeys(LocalDevicePtr local, unsigned long* keys) for (i=0; i<NBITS(KEY_MAX); i++) keys[i] = 0; - /* serial ISDV4 devices */ +#ifdef TIOCGSERIAL + /* serial ISDV4 devices: not supported on Solaris */ if (ioctl(fd, TIOCGSERIAL, &tmp) == 0) { if (str) /* id in name */ @@ -250,8 +254,23 @@ int wcmDeviceTypeKeys(LocalDevicePtr local, unsigned long* keys) keys[LONG(BTN_TOOL_RUBBER)] &= ~BIT(BTN_TOOL_RUBBER); } } - else /* USB devices */ + else +#endif /* TIOCGSERIAL */ + /* USB devices */ { +#ifdef sun + /* push usbwcm STREAMS module: required on Solaris */ + ret = ioctl(fd, I_FIND, "usbwcm"); + if (ret == 0) + ret = ioctl(fd, I_PUSH, "usbwcm"); + if (ret < 0) + { + xf86Msg(X_ERROR, "%s: failed to push STREAMS module on %s in " + "wcmDeviceTypeKeys.\n", local->name, device); + return ret; + } +#endif /* sun */ + /* test if the tool is defined in the kernel */ if (ioctl(fd, EVIOCGBIT(EV_KEY, (sizeof(unsigned long) * NBITS(KEY_MAX))), keys) < 0) diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c index 231325d..47f313a 100644 --- a/src/xf86Wacom.c +++ b/src/xf86Wacom.c @@ -1,6 +1,8 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <pingc@wacom.com> + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -41,7 +43,9 @@ #include <sys/stat.h> #include <fcntl.h> +#ifndef sun #include <linux/serial.h> +#endif #include "xf86Wacom.h" @@ -961,7 +965,9 @@ static Bool xf86WcmOpen(LocalDevicePtr local) char id[BUFFER_SIZE]; float version; int rc; +#ifndef sun struct serial_struct ser; +#endif DBG(1, priv, "opening device file\n"); @@ -973,6 +979,8 @@ static Bool xf86WcmOpen(LocalDevicePtr local) return !Success; } +#ifdef TIOCGSERIAL + /* this ioctl is not supported on Solaris */ rc = ioctl(local->fd, TIOCGSERIAL, &ser); /* we initialized wcmDeviceClasses to USB @@ -987,6 +995,7 @@ static Bool xf86WcmOpen(LocalDevicePtr local) common->wcmTPCButtonDefault = 1; } else +#endif /* TIOCGSERIAL */ { /* Detect USB device class */ if ((&gWacomUSBDevice)->Detect(local)) diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h index 351abb1..92aeb5f 100644 --- a/src/xf86Wacom.h +++ b/src/xf86Wacom.h @@ -1,6 +1,8 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <pingc@wacom.com> + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -29,8 +31,10 @@ * Linux Input Support ****************************************************************************/ +#ifndef sun #include <asm/types.h> #include <linux/input.h> +#endif #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h index 34a9375..a3b4bb2 100644 --- a/src/xf86WacomDefs.h +++ b/src/xf86WacomDefs.h @@ -1,6 +1,8 @@ /* * Copyright 1995-2002 by Frederic Lepied, France. <Lepied@XFree86.org> * Copyright 2002-2009 by Ping Cheng, Wacom Technology. <pingc@wacom.com> + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,8 +25,15 @@ /***************************************************************************** * General Defines ****************************************************************************/ +#ifdef sun /* Solaris */ +#include <sys/stropts.h> +#include <sys/usb/clients/usbinput/usbwcm/usbwcm.h> +#include "../include/solaris-usbwcm.h" +#else #include <asm/types.h> #include <linux/input.h> +#endif + #define MAX_USB_EVENTS 32 #define WACOM_VENDOR_ID 0x056a /* vendor ID on the kernel device */ |