Discussion:
[Linuxwacom-devel] [PATCH libwacom] tools: Add udev rules quirk for Wireless Accessory Kit
Jason Gerecke
2016-06-08 17:10:23 UTC
Permalink
Although the kernel modifies the PID of devices connected to the system
through Wacom's Wireless Accessory Kit to match that of the actual
tablet, it does not look like udev is aware of this change and instead
matches on the VID/PID of the kit's dongle. To ensure devices connected
this way are properly tagged, add general-purpose matches for the kit.

Signed-off-by: Jason Gerecke <***@wacom.com>
---
tools/generate-udev-rules.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/tools/generate-udev-rules.c b/tools/generate-udev-rules.c
index 87d43fe..8a73c9f 100644
--- a/tools/generate-udev-rules.c
+++ b/tools/generate-udev-rules.c
@@ -63,6 +63,22 @@ static void print_huion_quirk (void)
printf ("\n");
}

+static void print_wireless_kit_quirk (void)
+{
+ /* Bamboo and Intuos devices connected to the system via Wacom's
+ * Wireless Accessory Kit appear to udev as having the PID of the
+ * dongle rather than the actual tablet. Make sure we properly tag
+ * such devices.
+ */
+ char *match = "ENV{ID_BUS}==\"usb\", ENV{ID_VENDOR_ID}==\"056a\", ENV{ID_MODEL_ID}==\"0084\"";
+
+ printf("# Wacom Wireless Accessory Kit\n");
+ printf("%s, ENV{ID_INPUT}=\"1\", ENV{ID_INPUT_JOYSTICK}=\"\", ENV{ID_INPUT_TABLET}=\"1\"\n", match);
+ printf("ATTRS{name}==\"* Finger\", %s, ENV{ID_INPUT_TOUCHPAD}=\"1\"\n", match);
+ printf("ATTRS{name}==\"* Pad\", %s, ENV{ID_INPUT_TABLET_PAD}=\"1\"\n", match);
+ printf("\n");
+}
+
static char * generate_device_match(WacomDevice *device, const WacomMatch *match)
{
WacomBusType type = libwacom_match_get_bustype (match);
@@ -220,6 +236,7 @@ int main(int argc, char **argv)

print_udev_header ();
print_huion_quirk ();
+ print_wireless_kit_quirk ();
for (p = list; *p; p++)
print_udev_entry ((WacomDevice *) *p, WBUSTYPE_USB);
--
2.8.3
Jason Gerecke
2016-06-08 17:10:22 UTC
Permalink
Signed-off-by: Jason Gerecke <***@wacom.com>
---
data/layouts/intuos-m-p.svg | 34 ++++++++++++++++------------------
data/layouts/intuos-m-pt.svg | 34 ++++++++++++++++------------------
data/layouts/intuos-s-p.svg | 36 +++++++++++++++++-------------------
data/layouts/intuos-s-pt.svg | 36 +++++++++++++++++-------------------
4 files changed, 66 insertions(+), 74 deletions(-)

diff --git a/data/layouts/intuos-m-p.svg b/data/layouts/intuos-m-p.svg
index eaf4177..6e9f61f 100644
--- a/data/layouts/intuos-m-p.svg
+++ b/data/layouts/intuos-m-p.svg
@@ -5,32 +5,30 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" style="color:#000000;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" id="intuos-m-p" width="275" height="222">
<title id="title">Wacom Intuos Pen Medium (CTL-680)</title>
<g>
- <path id="ButtonA" class="A Button" d="M 35 35 a 8 8 0 0 1 9 -9 l 14 0 l 0 20 l -23 0 z"/>
- <circle id="DotA" cx="47" cy="36" r=".5"/>
- <path id="LeaderA" class="A Leader" d="M 65 35 l 20 0"/>
- <text id="LabelA" class="A Label" x="87" y="40" style="text-anchor:start;">A</text>
+ <path id="ButtonA" class="A Button" d="M 2,10.5 a 12.75,8.5 0 0 1 12.75,-8.5 l 23.75,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotA" cx="20.25" cy="11.5" r=".5"/>
+ <path id="LeaderA" class="A Leader" d="M 40,11.5 l 20,0"/>
+ <text id="LabelA" class="A Label" x="62" y="11.5" style="text-anchor:start;">A</text>
</g>

<g>
- <path id="ButtonB" class="B Button" d="M 35 47.5 l 23 0 l 0 20 l -23 0 z"/>
- <circle id="DotB" cx="47" cy="57.5" r=".5"/>
- <path id="LeaderB" class="B Leader" d="M 65 59 l 20 0"/>
- <text id="LabelB" class="B Label" x="87" y="64" style="text-anchor:start;">B</text>
+ <path id="ButtonB" class="B Button" d="M 2,22 l 36.5,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotB" cx="20.25" cy="31.5" r=".5"/>
+ <path id="LeaderB" class="B Leader" d="M 40,31.5 l 20,0"/>
+ <text id="LabelB" class="B Label" x="62" y="31.5" style="text-anchor:start;">B</text>
</g>

<g>
- <path id="ButtonC" class="C Button" d="M 185 26 l 14 0 a 8 -8 0 0 1 9 9 l 0 11 l -23 0 z"/>
- <circle id="DotC" cx="197" cy="36" r=".5"/>
- <path id="LeaderC" class="C Leader" d="M 160 35 l 20 0"/>
- <text id="LabelC" class="C Label" x="157" y="40" style="text-anchor:end;">C</text>
+ <path id="ButtonC" class="C Button" d="M 236.5,2 l 23.75,0 a 12.75,8.5 0 0 1 12.75,8.5 l 0,10.5 l -36.5,0 z"/>
+ <circle id="DotC" cx="254.5" cy="11.5" r=".5"/>
+ <path id="LeaderC" class="C Leader" d="M 233,11.5 l -20,0"/>
+ <text id="LabelC" class="C Label" x="211" y="11.5" style="text-anchor:end;">C</text>
</g>

-
<g>
- <path id="ButtonD" class="D Button" d="M 185 47.5 l 23 0 l 0 20 l -23 0 z"/>
- <circle id="DotD" cx="197" cy="57.5" r=".5"/>
- <path id="LeaderD" class="D Leader" d="M 160 59 l 20 0"/>
- <text id="LabelD" class="D Label" x="157" y="64" style="text-anchor:end;">D</text>
+ <path id="ButtonD" class="D Button" d="M 236.5,22 l 36.5,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotD" cx="254.5" cy="31.5" r=".5"/>
+ <path id="LeaderD" class="D Leader" d="M 233,31.5 l -20,0"/>
+ <text id="LabelD" class="D Label" x="211" y="31.5" style="text-anchor:end;">D</text>
</g>
-
</svg>
diff --git a/data/layouts/intuos-m-pt.svg b/data/layouts/intuos-m-pt.svg
index c952993..003fa8e 100644
--- a/data/layouts/intuos-m-pt.svg
+++ b/data/layouts/intuos-m-pt.svg
@@ -5,32 +5,30 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" style="color:#000000;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" id="intuos-m-pt" width="275" height="222">
<title id="title">Wacom Intuos PT Medium (CTH-680)</title>
<g>
- <path id="ButtonA" class="A Button" d="M 35 35 a 8 8 0 0 1 9 -9 l 14 0 l 0 20 l -23 0 z"/>
- <circle id="DotA" cx="47" cy="36" r=".5"/>
- <path id="LeaderA" class="A Leader" d="M 65 35 l 20 0"/>
- <text id="LabelA" class="A Label" x="87" y="40" style="text-anchor:start;">A</text>
+ <path id="ButtonA" class="A Button" d="M 2,10.5 a 12.75,8.5 0 0 1 12.75,-8.5 l 23.75,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotA" cx="20.25" cy="11.5" r=".5"/>
+ <path id="LeaderA" class="A Leader" d="M 40,11.5 l 20,0"/>
+ <text id="LabelA" class="A Label" x="62" y="11.5" style="text-anchor:start;">A</text>
</g>

<g>
- <path id="ButtonB" class="B Button" d="M 35 47.5 l 23 0 l 0 20 l -23 0 z"/>
- <circle id="DotB" cx="47" cy="57.5" r=".5"/>
- <path id="LeaderB" class="B Leader" d="M 65 59 l 20 0"/>
- <text id="LabelB" class="B Label" x="87" y="64" style="text-anchor:start;">B</text>
+ <path id="ButtonB" class="B Button" d="M 2,22 l 36.5,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotB" cx="20.25" cy="31.5" r=".5"/>
+ <path id="LeaderB" class="B Leader" d="M 40,31.5 l 20,0"/>
+ <text id="LabelB" class="B Label" x="62" y="31.5" style="text-anchor:start;">B</text>
</g>

<g>
- <path id="ButtonC" class="C Button" d="M 185 26 l 14 0 a 8 -8 0 0 1 9 9 l 0 11 l -23 0 z"/>
- <circle id="DotC" cx="197" cy="36" r=".5"/>
- <path id="LeaderC" class="C Leader" d="M 160 35 l 20 0"/>
- <text id="LabelC" class="C Label" x="158" y="40" style="text-anchor:end;">C</text>
+ <path id="ButtonC" class="C Button" d="M 236.5,2 l 23.75,0 a 12.75,8.5 0 0 1 12.75,8.5 l 0,10.5 l -36.5,0 z"/>
+ <circle id="DotC" cx="254.5" cy="11.5" r=".5"/>
+ <path id="LeaderC" class="C Leader" d="M 233,11.5 l -20,0"/>
+ <text id="LabelC" class="C Label" x="211" y="11.5" style="text-anchor:end;">C</text>
</g>

-
<g>
- <path id="ButtonD" class="D Button" d="M 185 47.5 l 23 0 l 0 20 l -23 0 z"/>
- <circle id="DotD" cx="197" cy="57.5" r=".5"/>
- <path id="LeaderD" class="D Leader" d="M 160 59 l 20 0"/>
- <text id="LabelD" class="D Label" x="158" y="64" style="text-anchor:end;">D</text>
+ <path id="ButtonD" class="D Button" d="M 236.5,22 l 36.5,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotD" cx="254.5" cy="31.5" r=".5"/>
+ <path id="LeaderD" class="D Leader" d="M 233,31.5 l -20,0"/>
+ <text id="LabelD" class="D Label" x="211" y="31.5" style="text-anchor:end;">D</text>
</g>
-
</svg>
diff --git a/data/layouts/intuos-s-p.svg b/data/layouts/intuos-s-p.svg
index c833ce0..dfa5b23 100644
--- a/data/layouts/intuos-s-p.svg
+++ b/data/layouts/intuos-s-p.svg
@@ -2,35 +2,33 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!--
-->
-<svg xmlns="http://www.w3.org/2000/svg" version="1.1" style="color:#000000;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" id="intuos-s-p" width="275" height="222">
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" style="color:#000000;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" id="intuos-s-p" width="209" height="175">
<title id="title">Wacom Intuos Pen Small (CTL-480)</title>
<g>
- <path id="ButtonA" class="A Button" d="M 35 35 a 8 8 0 0 1 9 -9 l 14 0 l 0 20 l -23 0 z"/>
- <circle id="DotA" cx="47" cy="36" r=".5"/>
- <path id="LeaderA" class="A Leader" d="M 65 35 l 20 0"/>
- <text id="LabelA" class="A Label" x="87" y="40" style="text-anchor:start;">A</text>
+ <path id="ButtonA" class="A Button" d="M 2,10.5 a 12.75,8.5 0 0 1 12.75,-8.5 l 23.75,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotA" cx="20.25" cy="11.5" r=".5"/>
+ <path id="LeaderA" class="A Leader" d="M 40,11.5 l 20,0"/>
+ <text id="LabelA" class="A Label" x="62" y="11.5" style="text-anchor:start;">A</text>
</g>

<g>
- <path id="ButtonB" class="B Button" d="M 35 47.5 l 23 0 l 0 20 l -23 0 z"/>
- <circle id="DotB" cx="47" cy="57.5" r=".5"/>
- <path id="LeaderB" class="B Leader" d="M 65 59 l 20 0"/>
- <text id="LabelB" class="B Label" x="87" y="64" style="text-anchor:start;">B</text>
+ <path id="ButtonB" class="B Button" d="M 2,22 l 36.5,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotB" cx="20.25" cy="31.5" r=".5"/>
+ <path id="LeaderB" class="B Leader" d="M 40,31.5 l 20,0"/>
+ <text id="LabelB" class="B Label" x="62" y="31.5" style="text-anchor:start;">B</text>
</g>

<g>
- <path id="ButtonC" class="C Button" d="M 185 26 l 14 0 a 8 -8 0 0 1 9 9 l 0 11 l -23 0 z"/>
- <circle id="DotC" cx="197" cy="36" r=".5"/>
- <path id="LeaderC" class="C Leader" d="M 160 35 l 20 0"/>
- <text id="LabelC" class="C Label" x="158" y="40" style="text-anchor:end;">C</text>
+ <path id="ButtonC" class="C Button" d="M 170.5,2 l 23.75,0 a 12.75,8.5 0 0 1 12.75,8.5 l 0,10.5 l -36.5,0 z"/>
+ <circle id="DotC" cx="188.75" cy="11.5" r=".5"/>
+ <path id="LeaderC" class="C Leader" d="M 168,11.5 l -20,0"/>
+ <text id="LabelC" class="C Label" x="146" y="11.5" style="text-anchor:end;">C</text>
</g>

-
<g>
- <path id="ButtonD" class="D Button" d="M 185 47.5 l 23 0 l 0 20 l -23 0 z"/>
- <circle id="DotD" cx="197" cy="57.5" r=".5"/>
- <path id="LeaderD" class="D Leader" d="M 160 59 l 20 0"/>
- <text id="LabelD" class="D Label" x="158" y="64" style="text-anchor:end;">D</text>
+ <path id="ButtonD" class="D Button" d="M 170.5,22 l 36.5,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotD" cx="188.75" cy="31.5" r=".5"/>
+ <path id="LeaderD" class="D Leader" d="M 168,31.5 l -20,0"/>
+ <text id="LabelD" class="D Label" x="146" y="31.5" style="text-anchor:end;">D</text>
</g>
-
</svg>
diff --git a/data/layouts/intuos-s-pt.svg b/data/layouts/intuos-s-pt.svg
index 82667f6..bf21efd 100644
--- a/data/layouts/intuos-s-pt.svg
+++ b/data/layouts/intuos-s-pt.svg
@@ -2,35 +2,33 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!--
-->
-<svg xmlns="http://www.w3.org/2000/svg" version="1.1" style="color:#000000;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" id="intuos-s-pt" width="275" height="222">
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" style="color:#000000;stroke:#7f7f7f;fill:none;stroke-width:.25;font-size:8" id="intuos-s-pt" width="209" height="175">
<title id="title">Wacom Intuos PT Small (CTH-480)</title>
<g>
- <path id="ButtonA" class="A Button" d="M 35 35 a 8 8 0 0 1 9 -9 l 14 0 l 0 20 l -23 0 z"/>
- <circle id="DotA" cx="47" cy="36" r=".5"/>
- <path id="LeaderA" class="A Leader" d="M 65 35 l 20 0"/>
- <text id="LabelA" class="A Label" x="87" y="40" style="text-anchor:start;">A</text>
+ <path id="ButtonA" class="A Button" d="M 2,10.5 a 12.75,8.5 0 0 1 12.75,-8.5 l 23.75,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotA" cx="20.25" cy="11.5" r=".5"/>
+ <path id="LeaderA" class="A Leader" d="M 40,11.5 l 20,0"/>
+ <text id="LabelA" class="A Label" x="62" y="11.5" style="text-anchor:start;">A</text>
</g>

<g>
- <path id="ButtonB" class="B Button" d="M 35 47.5 l 23 0 l 0 20 l -23 0 z"/>
- <circle id="DotB" cx="47" cy="57.5" r=".5"/>
- <path id="LeaderB" class="B Leader" d="M 65 59 l 20 0"/>
- <text id="LabelB" class="B Label" x="87" y="64" style="text-anchor:start;">B</text>
+ <path id="ButtonB" class="B Button" d="M 2,22 l 36.5,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotB" cx="20.25" cy="31.5" r=".5"/>
+ <path id="LeaderB" class="B Leader" d="M 40,31.5 l 20,0"/>
+ <text id="LabelB" class="B Label" x="62" y="31.5" style="text-anchor:start;">B</text>
</g>

<g>
- <path id="ButtonC" class="C Button" d="M 185 26 l 14 0 a 8 -8 0 0 1 9 9 l 0 11 l -23 0 z"/>
- <circle id="DotC" cx="197" cy="36" r=".5"/>
- <path id="LeaderC" class="C Leader" d="M 160 35 l 20 0"/>
- <text id="LabelC" class="C Label" x="158" y="40" style="text-anchor:end;">C</text>
+ <path id="ButtonC" class="C Button" d="M 170.5,2 l 23.75,0 a 12.75,8.5 0 0 1 12.75,8.5 l 0,10.5 l -36.5,0 z"/>
+ <circle id="DotC" cx="188.75" cy="11.5" r=".5"/>
+ <path id="LeaderC" class="C Leader" d="M 168,11.5 l -20,0"/>
+ <text id="LabelC" class="C Label" x="146" y="11.5" style="text-anchor:end;">C</text>
</g>

-
<g>
- <path id="ButtonD" class="D Button" d="M 185 47.5 l 23 0 l 0 20 l -23 0 z"/>
- <circle id="DotD" cx="197" cy="57.5" r=".5"/>
- <path id="LeaderD" class="D Leader" d="M 160 59 l 20 0"/>
- <text id="LabelD" class="D Label" x="158" y="64" style="text-anchor:end;">D</text>
+ <path id="ButtonD" class="D Button" d="M 170.5,22 l 36.5,0 l 0,19 l -36.5,0 z"/>
+ <circle id="DotD" cx="188.75" cy="31.5" r=".5"/>
+ <path id="LeaderD" class="D Leader" d="M 168,31.5 l -20,0"/>
+ <text id="LabelD" class="D Label" x="146" y="31.5" style="text-anchor:end;">D</text>
</g>
-
</svg>
--
2.8.3
Peter Hutterer
2016-06-08 23:46:56 UTC
Permalink
Post by Jason Gerecke
Although the kernel modifies the PID of devices connected to the system
through Wacom's Wireless Accessory Kit to match that of the actual
tablet, it does not look like udev is aware of this change and instead
matches on the VID/PID of the kit's dongle. To ensure devices connected
this way are properly tagged, add general-purpose matches for the kit.
all three pushed, thanks.

34b4bc4..243f902 master -> master

Cheers,
Peter
Post by Jason Gerecke
---
tools/generate-udev-rules.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tools/generate-udev-rules.c b/tools/generate-udev-rules.c
index 87d43fe..8a73c9f 100644
--- a/tools/generate-udev-rules.c
+++ b/tools/generate-udev-rules.c
@@ -63,6 +63,22 @@ static void print_huion_quirk (void)
printf ("\n");
}
+static void print_wireless_kit_quirk (void)
+{
+ /* Bamboo and Intuos devices connected to the system via Wacom's
+ * Wireless Accessory Kit appear to udev as having the PID of the
+ * dongle rather than the actual tablet. Make sure we properly tag
+ * such devices.
+ */
+ char *match = "ENV{ID_BUS}==\"usb\", ENV{ID_VENDOR_ID}==\"056a\", ENV{ID_MODEL_ID}==\"0084\"";
+
+ printf("# Wacom Wireless Accessory Kit\n");
+ printf("%s, ENV{ID_INPUT}=\"1\", ENV{ID_INPUT_JOYSTICK}=\"\", ENV{ID_INPUT_TABLET}=\"1\"\n", match);
+ printf("ATTRS{name}==\"* Finger\", %s, ENV{ID_INPUT_TOUCHPAD}=\"1\"\n", match);
+ printf("ATTRS{name}==\"* Pad\", %s, ENV{ID_INPUT_TABLET_PAD}=\"1\"\n", match);
+ printf("\n");
+}
+
static char * generate_device_match(WacomDevice *device, const WacomMatch *match)
{
WacomBusType type = libwacom_match_get_bustype (match);
@@ -220,6 +236,7 @@ int main(int argc, char **argv)
print_udev_header ();
print_huion_quirk ();
+ print_wireless_kit_quirk ();
for (p = list; *p; p++)
print_udev_entry ((WacomDevice *) *p, WBUSTYPE_USB);
--
2.8.3
Loading...