[Linuxwacom-devel] [PATCH 2/2] data: Fix naming for bamboo-2fg-4x5
Hi, applying Favux' naming advise to the Name= attribute in the definition, too. Also updates some comments. Sadly, I could neiter get list-wacom.c to compile on a gnome 3.2 nor could I get kvm to hand-through the tablet to a virtual machine where I would dare to install a gnome 3.3.2. As I don't want to try that on my main install, I fear the stylus number has to wait for gnome 3.4 to land in debian. Cheers, Mika --- data/bamboo-2fg-4x5.tablet | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/data/bamboo-2fg-4x5.tablet b/data/bamboo-2fg-4x5.tablet index feea4dd..a372f38 100644 --- a/data/bamboo-2fg-4x5.tablet +++ b/data/bamboo-2fg-4x5.tablet @@ -1,18 +1,16 @@ +# Bamboo Pen & Touch (first generation) [Device] -# Bamboo Pen & Touch (CTH-460-DE), 2nd generation bamboo -Name=Wacom Bamboo Pen & Touch + +Name=Wacom Bamboo 2FG 4x5 DeviceMatch=usb:056a:00d1 Class=Bamboo -# There are two widths and heigths, one for pen input, one for touch. -# The one for pen is bigger, but in linux, only the smaller one works. -# But as the width is advertised as the bigger one for pen input, I put the pen input here. Width=5.8 Height=3.6 -# The other stylusses don't match it, it has two buttons and an eraser. +# Could not yet figure the right stylus id out, so generic one Styli=0xf [Features] -- 1.7.8.3 -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
[Linuxwacom-devel] [PATCH 1/2] data: Rename Bamboo Pen and Touch definition file
Hi, renaming the definition file according to Favux' advise. Cheers, Mika --- data/bamboo-2fg-4x5.tablet | 31 +++ data/bamboo-pen-and-touch.tablet | 31 --- 2 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 data/bamboo-2fg-4x5.tablet delete mode 100644 data/bamboo-pen-and-touch.tablet diff --git a/data/bamboo-2fg-4x5.tablet b/data/bamboo-2fg-4x5.tablet new file mode 100644 index 000..feea4dd --- /dev/null +++ b/data/bamboo-2fg-4x5.tablet @@ -0,0 +1,31 @@ +[Device] +# Bamboo Pen & Touch (CTH-460-DE), 2nd generation bamboo +Name=Wacom Bamboo Pen & Touch + +DeviceMatch=usb:056a:00d1 + +Class=Bamboo + +# There are two widths and heigths, one for pen input, one for touch. +# The one for pen is bigger, but in linux, only the smaller one works. +# But as the width is advertised as the bigger one for pen input, I put the pen input here. +Width=5.8 +Height=3.6 + +# The other stylusses don't match it, it has two buttons and an eraser. +Styli=0xf + +[Features] +Stylus=true + +Reversible=true + +Touch=true + +Ring=false +Ring2=false + +Buttons=4 + +BuiltIn=false + diff --git a/data/bamboo-pen-and-touch.tablet b/data/bamboo-pen-and-touch.tablet deleted file mode 100644 index feea4dd..000 --- a/data/bamboo-pen-and-touch.tablet +++ /dev/null @@ -1,31 +0,0 @@ -[Device] -# Bamboo Pen & Touch (CTH-460-DE), 2nd generation bamboo -Name=Wacom Bamboo Pen & Touch - -DeviceMatch=usb:056a:00d1 - -Class=Bamboo - -# There are two widths and heigths, one for pen input, one for touch. -# The one for pen is bigger, but in linux, only the smaller one works. -# But as the width is advertised as the bigger one for pen input, I put the pen input here. -Width=5.8 -Height=3.6 - -# The other stylusses don't match it, it has two buttons and an eraser. -Styli=0xf - -[Features] -Stylus=true - -Reversible=true - -Touch=true - -Ring=false -Ring2=false - -Buttons=4 - -BuiltIn=false - -- 1.7.8.3 -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
Re: [Linuxwacom-devel] [PATCH] Move some usb-specific keys to wcmUSBData.
And today I'm less dizzy. Thanks! Reviewed-by: Chris Bagwell On Sat, Feb 4, 2012 at 3:23 AM, Peter Hutterer wrote: > nbuttons and npadkeys is only used for USB-specific parsing, move them > there. > > Signed-off-by: Peter Hutterer > --- > No functional change > > src/wcmUSB.c | 29 ++--- > src/xf86WacomDefs.h | 4 > 2 files changed, 18 insertions(+), 15 deletions(-) > > diff --git a/src/wcmUSB.c b/src/wcmUSB.c > index 8451c25..a2d30da 100644 > --- a/src/wcmUSB.c > +++ b/src/wcmUSB.c > @@ -40,6 +40,9 @@ typedef struct { > int wcmPrevChannel; > int wcmEventCnt; > struct input_event wcmEvents[MAX_USB_EVENTS]; > + int nbuttons; /* total number of buttons */ > + int npadkeys; /* number of pad keys in the above array > */ > + int padkey_code[WCM_MAX_BUTTONS];/* hardware codes for buttons */ > } wcmUSBData; > > static Bool usbDetect(InputInfoPtr); > @@ -320,6 +323,7 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, > float *version) > struct input_id sID; > WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; > WacomCommonPtr common = priv->common; > + wcmUSBData *usbdata; > > DBG(1, priv, "initializing USB tablet\n"); > > @@ -331,6 +335,7 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, > float *version) > return !Success; > } > > + usbdata = common->private; > *version = 0.0; > > /* fetch vendor, product, and model name */ > @@ -355,10 +360,10 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, > float *version) > } > > /* Find out supported button codes. */ > - common->npadkeys = 0; > + usbdata->npadkeys = 0; > for (i = 0; i < ARRAY_SIZE(padkey_codes); i++) > if (ISBITSET (common->wcmKeys, padkey_codes [i])) > - common->padkey_code [common->npadkeys++] = > padkey_codes [i]; > + usbdata->padkey_code [usbdata->npadkeys++] = > padkey_codes [i]; > > if (!(ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE))) > { > @@ -372,8 +377,8 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, > float *version) > /* Make sure room for fixed map mouse buttons. This > * means mappings may overlap with padkey_codes[]. > */ > - if (i != 0 && common->npadkeys < WCM_USB_MAX_MOUSE_BUTTONS) > - common->npadkeys = WCM_USB_MAX_MOUSE_BUTTONS; > + if (i != 0 && usbdata->npadkeys < WCM_USB_MAX_MOUSE_BUTTONS) > + usbdata->npadkeys = WCM_USB_MAX_MOUSE_BUTTONS; > } > > /* nbuttons tracks maximum buttons on all tools (stylus/mouse). > @@ -382,9 +387,9 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, > float *version) > * Stylus support tip and 2 stlyus buttons. > */ > if (ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE)) > - common->nbuttons = WCM_USB_MAX_MOUSE_BUTTONS; > + usbdata->nbuttons = WCM_USB_MAX_MOUSE_BUTTONS; > else > - common->nbuttons = WCM_USB_MAX_STYLUS_BUTTONS; > + usbdata->nbuttons = WCM_USB_MAX_STYLUS_BUTTONS; > > return Success; > } > @@ -600,12 +605,13 @@ static int usbDetectConfig(InputInfoPtr pInfo) > { > WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; > WacomCommonPtr common = priv->common; > + wcmUSBData *usbdata = common->private; > > DBG(10, common, "\n"); > if (IsPad (priv)) > - priv->nbuttons = common->npadkeys; > + priv->nbuttons = usbdata->npadkeys; > else > - priv->nbuttons = common->nbuttons; > + priv->nbuttons = usbdata->nbuttons; > > if (!common->wcmCursorProxoutDist) > common->wcmCursorProxoutDist > @@ -1303,6 +1309,7 @@ static int usbParseBTNEvent(WacomCommonPtr common, > { > int nkeys; > int change = 1; > + wcmUSBData *usbdata = common->private; > > switch (event->code) > { > @@ -1329,15 +1336,15 @@ static int usbParseBTNEvent(WacomCommonPtr common, > break; > > default: > - for (nkeys = 0; nkeys < common->npadkeys; nkeys++) > + for (nkeys = 0; nkeys < usbdata->npadkeys; nkeys++) > { > - if (event->code == common->padkey_code[nkeys]) > + if (event->code == > usbdata->padkey_code[nkeys]) > { > ds->buttons = mod_buttons(ds->buttons, > nkeys, event->value); > break; > } > } > - if (nkeys >= common->npadkeys) > + if (nkeys >= usbdata->npadkeys)
Re: [Linuxwacom-devel] [PATCH] HID: wacom: Exclude battery reporting for Intuos4 WL
I've been monitoring battery topics lately (no pun intended :-) ) because I'm adding adding similar logic to wacom_wac for wireless. I know that the function power_supply_powers() that is in stack trace is brand new (not in official kernel) and associates a power supply to a specific device (nice so GUI's don't think our wacom's are powering our machines). So I would suspect that feature first. Can you try deleting the two calls to that function and see if crash goes away? I peeked in jikos's hid tree and the function looks like it registers a sysfs directory called "powers". I suspect its meant to be under the "wacom_battery" directory and thus the call needs to be moved *after* registering the battery device. This looks needed even for graphire's to work. Chris On Sat, Feb 4, 2012 at 6:33 AM, Przemo Firszt wrote: > Some words of explanation: when I was submitting the original patch for > Intuos4 WL (78761ff9bc4e944e0b4e5df1e7eedcfdbb1a9a1a) there were no > problems with connection, battery values were incorrect, but it was a > minor issue. When the patch reached the mainline kernel it became > unusable (crash report below). I tried to bisect the problem, but I > failed. The problem might be related to the attempt > to send a packet to the tablet while the link is not yet established. > I don't feel confident enough with kernel locks to suggest a solution > yet, but I'm working on it. > Currently I just switched off the sysfs code for I4WL in the driver. My > only concern is that I don't have access to Graphire Bluetooth and there > is a chance that the tablet might be affected as well.. > > regards, > Przemo > > Crash report (also here: http://pastebin.com/ZVNZWaPs) : > >> Feb 1 21:47:58 pldmachine kernel: [ 89.535952] Bluetooth: HIDP (Human >> Interface Emulation) ver 1.2 >> Feb 1 21:49:51 pldmachine kernel: [ 202.347235] wacom 0005:056A:00BD.0001: >> unknown main item tag 0x0 >> Feb 1 21:49:51 pldmachine kernel: [ 202.347999] input: PTK-540WL as >> /devices/pci:00/:00:1d.0/usb2/2-2/2-2:1.0/blue >> tooth/hci0/hci0:1/input8 >> Feb 1 21:49:51 pldmachine kernel: [ 202.348201] wacom 0005:056A:00BD.0001: >> input,hidraw0: BLUETOOTH HID v1.06 Mouse [PTK-5 >> 40WL] on 00:11:67:D6:1D:BF >> Feb 1 21:49:51 pldmachine kernel: [ 202.416811] BUG: unable to handle >> kernel NULL pointer dereference at 0020 >> Feb 1 21:49:51 pldmachine kernel: [ 202.416888] IP: [] >> sysfs_do_create_link+0x24/0x1c0 >> Feb 1 21:49:51 pldmachine kernel: [ 202.416945] *pde = >> Feb 1 21:49:51 pldmachine kernel: [ 202.416973] Oops: [#1] >> Feb 1 21:49:51 pldmachine kernel: [ 202.417002] Modules linked in: >> hid_wacom(+) hidp binfmt_misc rfcomm bnep cn i915 drm_k >> ms_helper drm i2c_algo_bit cfbfillrect cfbcopyarea cfbimgblt rtl8192cu >> rtl8192c_common rtlwifi mac80211 ipw2200 libipw cfg80 >> 211 snd_intel8x0 snd_ac97_codec ac97_bus btusb bluetooth pcmcia snd_pcm >> snd_timer snd rfkill intel_agp sdhci_pci intel_gtt v >> ideo yenta_socket tpm_infineon sdhci lib80211 soundcore evdev pcspkr >> snd_page_alloc psmouse pcmcia_rsrc pcmcia_core backligh >> t mmc_core agpgart tg3 sg ohci_hcd uhci_hcd ehci_hcd usbhid usbcore >> usb_common hid ata_piix libata sd_mod crc_t10dif scsi_mod ext4 crc16 mbcache >> jbd2 jbd [last unloaded: scsi_wait_scan] >> Feb 1 21:49:51 pldmachine kernel: [ 202.417660] >> Feb 1 21:49:51 pldmachine kernel: [ 202.417676] Pid: 3759, comm: modprobe >> Not tainted 3.3.0-rc1-2-1-g326ff11 #18 Hewlett-Packard HP Compaq nc4200 >> (PV983AW#ABU) /0938 >> Feb 1 21:49:51 pldmachine kernel: [ 202.417781] EIP: 0060:[] >> EFLAGS: 00010202 CPU: 0 >> Feb 1 21:49:51 pldmachine kernel: [ 202.417826] EIP is at >> sysfs_do_create_link+0x24/0x1c0 >> Feb 1 21:49:51 pldmachine kernel: [ 202.417866] EAX: 0008 EBX: >> 0246 ECX: c1484021 EDX: e7624c68 >> Feb 1 21:49:51 pldmachine kernel: [ 202.417914] ESI: c1484021 EDI: >> ef36bf00 EBP: ef307db8 ESP: ef307d80 >> Feb 1 21:49:51 pldmachine kernel: [ 202.417962] DS: 007b ES: 007b FS: >> GS: 00e0 SS: 0068 >> Feb 1 21:49:51 pldmachine kernel: [ 202.418005] Process modprobe (pid: >> 3759, ti=ef306000 task=e7560380 task.ti=ef306000) >> Feb 1 21:49:51 pldmachine kernel: [ 202.418066] Stack: >> Feb 1 21:49:51 pldmachine kernel: [ 202.418084] 0002 0001 >> ef307d90 c1383f88 ef307dcc f81037fa e7624c68 >> Feb 1 21:49:51 pldmachine kernel: [ 202.418170] e7693aa0 e7560380 >> e7693abc 0246 e7624000 ef36bf00 ef307dc4 c1142d62 >> Feb 1 21:49:51 pldmachine kernel: [ 202.418255] 0001 ef307dcc >> c1289ed6 ef307df8 f812f5c0 0002 ef307df8 f8130028 >> Feb 1 21:49:51 pldmachine kernel: [ 202.418341] Call Trace: >> Feb 1 21:49:51 pldmachine kernel: [ 202.418366] [] ? >> mutex_unlock+0x8/0x10 >> Feb 1 21:49:51 pldmachine kernel: [ 202.418406] [] ? >> hidp_output_raw_report+0x15a/0x1c0 [hidp] >> Feb 1 21:49:51 pldmachine kernel: [ 202.418457] [] >> sysfs_crea
Re: [Linuxwacom-devel] [PATCH] HID: wacom: Exclude battery reporting for Intuos4 WL
Some words of explanation: when I was submitting the original patch for Intuos4 WL (78761ff9bc4e944e0b4e5df1e7eedcfdbb1a9a1a) there were no problems with connection, battery values were incorrect, but it was a minor issue. When the patch reached the mainline kernel it became unusable (crash report below). I tried to bisect the problem, but I failed. The problem might be related to the attempt to send a packet to the tablet while the link is not yet established. I don't feel confident enough with kernel locks to suggest a solution yet, but I'm working on it. Currently I just switched off the sysfs code for I4WL in the driver. My only concern is that I don't have access to Graphire Bluetooth and there is a chance that the tablet might be affected as well.. regards, Przemo Crash report (also here: http://pastebin.com/ZVNZWaPs) : > Feb 1 21:47:58 pldmachine kernel: [ 89.535952] Bluetooth: HIDP (Human > Interface Emulation) ver 1.2 > Feb 1 21:49:51 pldmachine kernel: [ 202.347235] wacom 0005:056A:00BD.0001: > unknown main item tag 0x0 > Feb 1 21:49:51 pldmachine kernel: [ 202.347999] input: PTK-540WL as > /devices/pci:00/:00:1d.0/usb2/2-2/2-2:1.0/blue > tooth/hci0/hci0:1/input8 > Feb 1 21:49:51 pldmachine kernel: [ 202.348201] wacom 0005:056A:00BD.0001: > input,hidraw0: BLUETOOTH HID v1.06 Mouse [PTK-5 > 40WL] on 00:11:67:D6:1D:BF > Feb 1 21:49:51 pldmachine kernel: [ 202.416811] BUG: unable to handle > kernel NULL pointer dereference at 0020 > Feb 1 21:49:51 pldmachine kernel: [ 202.416888] IP: [] > sysfs_do_create_link+0x24/0x1c0 > Feb 1 21:49:51 pldmachine kernel: [ 202.416945] *pde = > Feb 1 21:49:51 pldmachine kernel: [ 202.416973] Oops: [#1] > Feb 1 21:49:51 pldmachine kernel: [ 202.417002] Modules linked in: > hid_wacom(+) hidp binfmt_misc rfcomm bnep cn i915 drm_k > ms_helper drm i2c_algo_bit cfbfillrect cfbcopyarea cfbimgblt rtl8192cu > rtl8192c_common rtlwifi mac80211 ipw2200 libipw cfg80 > 211 snd_intel8x0 snd_ac97_codec ac97_bus btusb bluetooth pcmcia snd_pcm > snd_timer snd rfkill intel_agp sdhci_pci intel_gtt v > ideo yenta_socket tpm_infineon sdhci lib80211 soundcore evdev pcspkr > snd_page_alloc psmouse pcmcia_rsrc pcmcia_core backligh > t mmc_core agpgart tg3 sg ohci_hcd uhci_hcd ehci_hcd usbhid usbcore > usb_common hid ata_piix libata sd_mod crc_t10dif scsi_mod ext4 crc16 mbcache > jbd2 jbd [last unloaded: scsi_wait_scan] > Feb 1 21:49:51 pldmachine kernel: [ 202.417660] > Feb 1 21:49:51 pldmachine kernel: [ 202.417676] Pid: 3759, comm: modprobe > Not tainted 3.3.0-rc1-2-1-g326ff11 #18 Hewlett-Packard HP Compaq nc4200 > (PV983AW#ABU) /0938 > Feb 1 21:49:51 pldmachine kernel: [ 202.417781] EIP: 0060:[] > EFLAGS: 00010202 CPU: 0 > Feb 1 21:49:51 pldmachine kernel: [ 202.417826] EIP is at > sysfs_do_create_link+0x24/0x1c0 > Feb 1 21:49:51 pldmachine kernel: [ 202.417866] EAX: 0008 EBX: 0246 > ECX: c1484021 EDX: e7624c68 > Feb 1 21:49:51 pldmachine kernel: [ 202.417914] ESI: c1484021 EDI: ef36bf00 > EBP: ef307db8 ESP: ef307d80 > Feb 1 21:49:51 pldmachine kernel: [ 202.417962] DS: 007b ES: 007b FS: > GS: 00e0 SS: 0068 > Feb 1 21:49:51 pldmachine kernel: [ 202.418005] Process modprobe (pid: > 3759, ti=ef306000 task=e7560380 task.ti=ef306000) > Feb 1 21:49:51 pldmachine kernel: [ 202.418066] Stack: > Feb 1 21:49:51 pldmachine kernel: [ 202.418084] 0002 0001 ef307d90 > c1383f88 ef307dcc f81037fa e7624c68 > Feb 1 21:49:51 pldmachine kernel: [ 202.418170] e7693aa0 e7560380 e7693abc > 0246 e7624000 ef36bf00 ef307dc4 c1142d62 > Feb 1 21:49:51 pldmachine kernel: [ 202.418255] 0001 ef307dcc c1289ed6 > ef307df8 f812f5c0 0002 ef307df8 f8130028 > Feb 1 21:49:51 pldmachine kernel: [ 202.418341] Call Trace: > Feb 1 21:49:51 pldmachine kernel: [ 202.418366] [] ? > mutex_unlock+0x8/0x10 > Feb 1 21:49:51 pldmachine kernel: [ 202.418406] [] ? > hidp_output_raw_report+0x15a/0x1c0 [hidp] > Feb 1 21:49:51 pldmachine kernel: [ 202.418457] [] > sysfs_create_link+0x12/0x20 > Feb 1 21:49:51 pldmachine kernel: [ 202.418498] [] > power_supply_powers+0x16/0x20 > Feb 1 21:49:51 pldmachine kernel: [ 202.418541] [] > wacom_probe+0x180/0x2c0 [hid_wacom] > Feb 1 21:49:51 pldmachine kernel: [ 202.418592] [] > hid_device_probe+0x8e/0x110 [hid] > Feb 1 21:49:51 pldmachine kernel: [ 202.418639] [] > driver_probe_device+0x61/0x170 > Feb 1 21:49:51 pldmachine kernel: [ 202.418683] [] > __driver_attach+0x89/0x90 > > Feb 1 21:49:51 pldmachine kernel: [ 202.418722] [] ? > driver_probe_device+0x170/0x170 > Feb 1 21:49:51 pldmachine kernel: [ 202.418766] [] > bus_for_each_dev+0x38/0x60 > Feb 1 21:49:51 pldmachine kernel: [ 202.418809] [] > driver_attach+0x1c/0x20 > Feb 1 21:49:51 pldmachine kernel: [ 202.418847] [] ? > driver_probe_device+0x170/0x170 > Feb 1 21:49:51 pldmachine kernel: [ 202.418891] [] > bus_add_driver+0x187/0x260 > Feb
[Linuxwacom-devel] [PATCH] Move some usb-specific keys to wcmUSBData.
nbuttons and npadkeys is only used for USB-specific parsing, move them there. Signed-off-by: Peter Hutterer --- No functional change src/wcmUSB.c| 29 ++--- src/xf86WacomDefs.h |4 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/wcmUSB.c b/src/wcmUSB.c index 8451c25..a2d30da 100644 --- a/src/wcmUSB.c +++ b/src/wcmUSB.c @@ -40,6 +40,9 @@ typedef struct { int wcmPrevChannel; int wcmEventCnt; struct input_event wcmEvents[MAX_USB_EVENTS]; + int nbuttons;/* total number of buttons */ + int npadkeys;/* number of pad keys in the above array */ + int padkey_code[WCM_MAX_BUTTONS];/* hardware codes for buttons */ } wcmUSBData; static Bool usbDetect(InputInfoPtr); @@ -320,6 +323,7 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float *version) struct input_id sID; WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; + wcmUSBData *usbdata; DBG(1, priv, "initializing USB tablet\n"); @@ -331,6 +335,7 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float *version) return !Success; } + usbdata = common->private; *version = 0.0; /* fetch vendor, product, and model name */ @@ -355,10 +360,10 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float *version) } /* Find out supported button codes. */ - common->npadkeys = 0; + usbdata->npadkeys = 0; for (i = 0; i < ARRAY_SIZE(padkey_codes); i++) if (ISBITSET (common->wcmKeys, padkey_codes [i])) - common->padkey_code [common->npadkeys++] = padkey_codes [i]; + usbdata->padkey_code [usbdata->npadkeys++] = padkey_codes [i]; if (!(ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE))) { @@ -372,8 +377,8 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float *version) /* Make sure room for fixed map mouse buttons. This * means mappings may overlap with padkey_codes[]. */ - if (i != 0 && common->npadkeys < WCM_USB_MAX_MOUSE_BUTTONS) - common->npadkeys = WCM_USB_MAX_MOUSE_BUTTONS; + if (i != 0 && usbdata->npadkeys < WCM_USB_MAX_MOUSE_BUTTONS) + usbdata->npadkeys = WCM_USB_MAX_MOUSE_BUTTONS; } /* nbuttons tracks maximum buttons on all tools (stylus/mouse). @@ -382,9 +387,9 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float *version) * Stylus support tip and 2 stlyus buttons. */ if (ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE)) - common->nbuttons = WCM_USB_MAX_MOUSE_BUTTONS; + usbdata->nbuttons = WCM_USB_MAX_MOUSE_BUTTONS; else - common->nbuttons = WCM_USB_MAX_STYLUS_BUTTONS; + usbdata->nbuttons = WCM_USB_MAX_STYLUS_BUTTONS; return Success; } @@ -600,12 +605,13 @@ static int usbDetectConfig(InputInfoPtr pInfo) { WacomDevicePtr priv = (WacomDevicePtr)pInfo->private; WacomCommonPtr common = priv->common; + wcmUSBData *usbdata = common->private; DBG(10, common, "\n"); if (IsPad (priv)) - priv->nbuttons = common->npadkeys; + priv->nbuttons = usbdata->npadkeys; else - priv->nbuttons = common->nbuttons; + priv->nbuttons = usbdata->nbuttons; if (!common->wcmCursorProxoutDist) common->wcmCursorProxoutDist @@ -1303,6 +1309,7 @@ static int usbParseBTNEvent(WacomCommonPtr common, { int nkeys; int change = 1; + wcmUSBData *usbdata = common->private; switch (event->code) { @@ -1329,15 +1336,15 @@ static int usbParseBTNEvent(WacomCommonPtr common, break; default: - for (nkeys = 0; nkeys < common->npadkeys; nkeys++) + for (nkeys = 0; nkeys < usbdata->npadkeys; nkeys++) { - if (event->code == common->padkey_code[nkeys]) + if (event->code == usbdata->padkey_code[nkeys]) { ds->buttons = mod_buttons(ds->buttons, nkeys, event->value); break; } } - if (nkeys >= common->npadkeys) + if (nkeys >= usbdata->npadkeys) change = 0; } return change; diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h index 167866a..ef425f5 100644 --- a/src/xf86WacomDefs.h +++ b/src/xf86WacomDefs.h @@ -443,10 +443,6 @@ struct _WacomCommonRec int wcmMaxStripX;/* Max