summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--udev-acl/70-acl.rules2
-rw-r--r--udev-acl/Makefile.am5
-rw-r--r--udev-acl/usbdev_id.c88
3 files changed, 1 insertions, 94 deletions
diff --git a/udev-acl/70-acl.rules b/udev-acl/70-acl.rules
index 8a4a5b7..6771b0e 100644
--- a/udev-acl/70-acl.rules
+++ b/udev-acl/70-acl.rules
@@ -14,7 +14,7 @@ ACTION!="add|change", GOTO="acl_end"
SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", WAIT_FOR_SYSFS="descriptors"
# PTP/MTP protocol devices, cameras, portable media players
-SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usbdev_id %p"
+SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="", ENV{DEVTYPE}=="usb_device", IMPORT{program}="usb_id --export %p"
SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:060101:*", ENV{ACL_MEDIA}="1"
# SCSI scanners
diff --git a/udev-acl/Makefile.am b/udev-acl/Makefile.am
index 2211abc..e4dabcb 100644
--- a/udev-acl/Makefile.am
+++ b/udev-acl/Makefile.am
@@ -1,9 +1,4 @@
include $(top_srcdir)/Makefile.am.inc
-udevhomedir = $(udev_prefix)/lib/udev
-udevhome_PROGRAMS = usbdev_id
-
-usbdev_id_SOURCES = usbdev_id.c
-
udevrulesdir = $(udev_prefix)/lib/udev/rules.d
dist_udevrules_DATA = 70-acl.rules
diff --git a/udev-acl/usbdev_id.c b/udev-acl/usbdev_id.c
deleted file mode 100644
index 4bf5b9e..0000000
--- a/udev-acl/usbdev_id.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * find all usb-device interfaces, and make them available in a single string
- *
- * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdint.h>
-
-#define USB_DT_DEVICE 0x01
-#define USB_DT_INTERFACE 0x04
-
-static int devinfo(const char *syspath)
-{
- char filename[1024];
- int fd;
- ssize_t size;
- unsigned char buf[18 + 65535];
- unsigned int pos;
- struct usb_interface_descriptor {
- u_int8_t bLength;
- u_int8_t bDescriptorType;
- u_int8_t bInterfaceNumber;
- u_int8_t bAlternateSetting;
- u_int8_t bNumEndpoints;
- u_int8_t bInterfaceClass;
- u_int8_t bInterfaceSubClass;
- u_int8_t bInterfaceProtocol;
- u_int8_t iInterface;
- };
-
- strcpy(filename, "/sys");
- strcat(filename, syspath);
- strcat(filename, "/descriptors");
- fd = open(filename, O_RDONLY);
- if (fd < 0) {
- fprintf(stderr, "error opening USB device 'descriptors' file\n");
- return -1;
- }
- size = read(fd, buf, sizeof(buf));
- close(fd);
- if (size < 18 || size == sizeof(buf))
- return -1;
-
- printf("ID_USB_INTERFACES=:");
- pos = 0;
- while (pos < sizeof(buf)) {
- struct usb_interface_descriptor *desc;
-
- desc = (struct usb_interface_descriptor *) &buf[pos];
- if (desc->bLength < 3)
- break;
-
- if (desc->bDescriptorType == USB_DT_INTERFACE)
- printf("%02x%02x%02x:", desc->bInterfaceClass, desc->bInterfaceSubClass, desc->bInterfaceProtocol);
- pos += desc->bLength;
- }
- printf("\n");
- return 0;
-}
-
-int main(int argc, char *argv[])
-{
- const char *devpath = argv[1];
-
- if (devpath == NULL) {
- fprintf(stderr, "Usage: usbdev_id <devpath>\n");
- return 1;
- }
- devinfo(devpath);
- return 0;
-}