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>
This commit is contained in:
Dan Nicholson
2010-06-10 06:15:41 -07:00
committed by Peter Hutterer
parent 645679c152
commit 87a1507da7
10 changed files with 88 additions and 0 deletions

View File

@@ -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)