diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2010-06-10 06:15:41 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-06-11 09:30:33 +1000 |
commit | 87a1507da7e7788232d74285ef377b67b70e0fa4 (patch) | |
tree | 5fe21b2ea4299acfad7603259abfd7330781abee /dix/inpututils.c | |
parent | 645679c1523eee7028f3244cee57936b93326a2a (diff) |
xfree86: Match devices based on USB ID
Sometimes the vendor and product names aren't specific enough to target
a USB device, so expose the numeric codes in the ID. A MatchUSBID entry
has been added that supports shell pattern matching when fnmatch(3) is
available. For example:
MatchUSBID "046d:*"
The IDs are stored in lowercase hex separated by a ':' like "lsusb" or
"lspci -n".
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix/inpututils.c')
-rw-r--r-- | dix/inpututils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/dix/inpututils.c b/dix/inpututils.c index aa240dd74..8ec80b5e8 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -359,6 +359,8 @@ DuplicateInputAttributes(InputAttributes *attrs) goto unwind; if (attrs->pnp_id && !(new_attr->pnp_id = strdup(attrs->pnp_id))) goto unwind; + if (attrs->usb_id && !(new_attr->usb_id = strdup(attrs->usb_id))) + goto unwind; new_attr->flags = attrs->flags; @@ -404,6 +406,7 @@ FreeInputAttributes(InputAttributes *attrs) free(attrs->vendor); free(attrs->device); free(attrs->pnp_id); + free(attrs->usb_id); if ((tags = attrs->tags)) while(*tags) |