]> git.zerfleddert.de Git - usb-driver/blobdiff - usb-driver.c
clarify filename for udev rule
[usb-driver] / usb-driver.c
index 929c1019484581a25a1ae33986583585f936ff39..5d1528e148abfad639963685d3b88b699a17d51d 100644 (file)
@@ -47,9 +47,9 @@ static int windrvrfd = -1;
 static unsigned long ppbase = 0;
 static unsigned long ecpbase = 0;
 static struct parport_config *pport = NULL;
-FILE *modulesfp = NULL;
-FILE *baseaddrfp = NULL;
-int baseaddrnum = 0;
+static FILE *modulesfp = NULL;
+static FILE *baseaddrfp = NULL;
+static int baseaddrnum = 0;
 static int modules_read = 0;
 static struct usb_bus *busses = NULL;
 static struct usb_device *usbdevice;
@@ -72,7 +72,7 @@ void hexdump(unsigned char *buf, int len) {
        fprintf(stderr,"\n");
 }
 
-int usb_deviceinfo(unsigned char *buf) {
+static int usb_deviceinfo(unsigned char *buf) {
        int i,j,k,l;
        int len = 0;
        WDU_CONFIGURATION **pConfigs, **pActiveConfig;
@@ -232,7 +232,7 @@ int usb_deviceinfo(unsigned char *buf) {
        return len;
 }
 
-int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
+static int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
        struct header_struct* wdheader = (struct header_struct*)wdioctl;
        struct version_struct *version;
        int ret = 0;
@@ -534,7 +534,7 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
                                                           (desc->idProduct == e->matchTables[i].ProductId) &&
                                                           (desc->bDeviceClass == e->matchTables[i].bDeviceClass) &&
                                                           (desc->bDeviceSubClass == e->matchTables[i].bDeviceSubClass) &&
-                                                          ((devnum == -1) || (dev->devnum == devnum)) ) {
+                                                          ((devnum == -1) || (strtol(dev->filename, NULL, 10) == devnum)) ) {
                                                                   int ac;
                                                                   for (ac = 0; ac < desc->bNumConfigurations; ac++) {
                                                                           struct usb_interface *interface = dev->config[ac].interface;
Impressum, Datenschutz