Hi!

This patch implements the needed ioctls in evdev - so that applications
can actually get some info about the connected devices. Current version
(test1-ac4-input10) just oopses if you try to use the ioctls.

This patch adds the ioctls to evdev.c, and to all the input USB modules
adds code to fill the needed structures. It also modifies joydev.c to
use the name field as well.

This patch shouldn't alter any other functionality than the ioctls.

This patch is against 2.4.0-test1-ac4-input1.0.

Please apply before 2.4.0-final.

Thanks.

-- 
Vojtech Pavlik
SuSE Labs
diff -urN linux-2.4.0-test1-ac4/drivers/usb/evdev.c linux/drivers/usb/evdev.c
--- linux-2.4.0-test1-ac4/drivers/usb/evdev.c   Sun May 28 19:33:58 2000
+++ linux/drivers/usb/evdev.c   Mon May 29 15:44:01 2000
@@ -1,5 +1,5 @@
 /*
- * $Id: evdev.c,v 1.7 2000/05/28 17:31:36 vojtech Exp $
+ * $Id: evdev.c,v 1.8 2000/05/29 09:01:52 vojtech Exp $
  *
  *  Copyright (c) 1999-2000 Vojtech Pavlik
  *
@@ -207,11 +207,20 @@
        struct evdev_list *list = file->private_data;
        struct evdev *evdev = list->evdev;
        struct input_dev *dev = evdev->handle.dev;
+       int retval;
 
        switch (cmd) {
 
                case EVIOCGVERSION:
-                       return put_user(EV_VERSION, (__u32 *) arg);
+                       return put_user(EV_VERSION, (int *) arg);
+
+               case EVIOCGID:
+                       if ((retval = put_user(dev->idbus,     ((short *) arg) + 0))) 
+return retval;
+                       if ((retval = put_user(dev->idvendor,  ((short *) arg) + 1))) 
+return retval;
+                       if ((retval = put_user(dev->idproduct, ((short *) arg) + 2))) 
+return retval;
+                       if ((retval = put_user(dev->idversion, ((short *) arg) + 3))) 
+return retval;
+                       return 0;
+
                default:
 
                        if (_IOC_TYPE(cmd) != 'E' || _IOC_DIR(cmd) != _IOC_READ)
@@ -219,8 +228,8 @@
 
                        if ((_IOC_NR(cmd) & ~EV_MAX) == _IOC_NR(EVIOCGBIT(0,0))) {
 
-                               long *bits = NULL;
-                               int len = 0;
+                               long *bits;
+                               int len;
 
                                switch (_IOC_NR(cmd) & EV_MAX) {
                                        case      0: bits = dev->evbit;  len = EV_MAX; 
 break;
@@ -232,14 +241,33 @@
                                        default: return -EINVAL;
                                }
                                len = NBITS(len) * sizeof(long);
-                               if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
-                               return copy_to_user((void *) arg, bits, len) ? -EFAULT 
: len;
+                               if (len > _IOC_SIZE(cmd)) {
+                                       printk(KERN_WARNING "evdev.c: Truncating 
+bitfield length from %d to %d\n",
+                                               len, _IOC_SIZE(cmd));
+                                       len = _IOC_SIZE(cmd);
+                               }
+                               return copy_to_user((char *) arg, bits, len) ? -EFAULT 
+: len;
                        }
 
                        if (_IOC_NR(cmd) == _IOC_NR(EVIOCGNAME(0))) {
-                               int len = strlen(dev->name) + 1;
+                               int len;
+                               if (!dev->name) return 0;
+                               len = strlen(dev->name) + 1;
                                if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
                                return copy_to_user((char *) arg, dev->name, len) ? 
-EFAULT : len;
+                       }
+
+                       if ((_IOC_NR(cmd) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0))) {
+
+                               int t = _IOC_NR(cmd) & ABS_MAX;
+
+                               if ((retval = put_user(dev->abs[t],     ((int *) arg) 
++ 0))) return retval;
+                               if ((retval = put_user(dev->absmin[t],  ((int *) arg) 
++ 1))) return retval;
+                               if ((retval = put_user(dev->absmax[t],  ((int *) arg) 
++ 2))) return retval;
+                               if ((retval = put_user(dev->absfuzz[t], ((int *) arg) 
++ 3))) return retval;
+                               if ((retval = put_user(dev->absflat[t], ((int *) arg) 
++ 4))) return retval;
+
+                               return 0;
                        }
        }
        return -EINVAL;
diff -urN linux-2.4.0-test1-ac4/drivers/usb/hid-debug.h linux/drivers/usb/hid-debug.h
--- linux-2.4.0-test1-ac4/drivers/usb/hid-debug.h       Mon Mar 20 03:29:40 2000
+++ linux/drivers/usb/hid-debug.h       Mon May 29 15:44:54 2000
@@ -1,5 +1,5 @@
 /*
- *  driver/usb/hid-debug.h
+ * $Id: hid-debug.h,v 1.2 2000/05/29 10:54:53 vojtech Exp $
  *
  *  (c) 1999 Andreas Gal       <[EMAIL PROTECTED]>
  *  (c) 2000 Vojtech Pavlik    <[EMAIL PROTECTED]>
diff -urN linux-2.4.0-test1-ac4/drivers/usb/hid.c linux/drivers/usb/hid.c
--- linux-2.4.0-test1-ac4/drivers/usb/hid.c     Sun May 28 19:33:58 2000
+++ linux/drivers/usb/hid.c     Mon May 29 15:44:05 2000
@@ -1,5 +1,5 @@
 /*
- * $Id: hid.c,v 1.5 2000/05/28 17:31:36 vojtech Exp $
+ * $Id: hid.c,v 1.6 2000/05/29 09:01:52 vojtech Exp $
  *
  *  Copyright (c) 1999 Andreas Gal
  *  Copyright (c) 2000 Vojtech Pavlik
@@ -80,6 +80,9 @@
        __s32 y;
 }  hid_hat_to_axis[] = {{ 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 
0}, {-1,-1}, { 0, 0}};
 
+static char *hid_types[] = {"Device", "Pointer", "Mouse", "Device", "Joystick",
+                               "Gamepad", "Keyboard", "Keypad", "Multi-Axis 
+Controller"};
+
 /*
  * Register a new report for a device.
  */
@@ -1336,7 +1339,7 @@
        { 0, 0 }
 };
 
-static struct hid_device *usb_hid_configure(struct usb_device *dev, int ifnum)
+static struct hid_device *usb_hid_configure(struct usb_device *dev, int ifnum, char 
+*name)
 {
        struct usb_interface_descriptor *interface = 
dev->actconfig->interface[ifnum].altsetting + 0;
        struct hid_descriptor *hdesc;
@@ -1423,6 +1426,20 @@
        hid->dr.index = hid->ifnum;
        hid->dr.length = 1;
 
+       hid->input.name = hid->name;
+       hid->input.idbus = BUS_USB;
+       hid->input.idvendor = dev->descriptor.idVendor;
+       hid->input.idproduct = dev->descriptor.idProduct;
+       hid->input.idversion = dev->descriptor.bcdDevice;
+
+       if (strlen(name)) 
+               strcpy(hid->name, name);
+       else
+               sprintf(hid->name, "USB HID %s %04x:%04x",
+                       ((hid->application >= 0x00010000) && (hid->application <= 
+0x00010008)) ?
+                       hid_types[hid->application & 0xffff] : "Device",
+                       hid->input.idvendor, hid->input.idproduct);
+
        FILL_CONTROL_URB(&hid->urbout, dev, usb_sndctrlpipe(dev, 0),
                (void*) &hid->dr, hid->bufout, 1, hid_ctrl, hid);
 
@@ -1434,13 +1451,27 @@
 
 static void* hid_probe(struct usb_device *dev, unsigned int ifnum)
 {
-       char *hid_name[] = {"Device", "Pointer", "Mouse", "Device", "Joystick",
-                               "Gamepad", "Keyboard", "Keypad", "Multi-Axis 
Controller"};
        struct hid_device *hid;
+       char name[128];
+       char *buf;
 
        dbg("HID probe called for ifnum %d", ifnum);
 
-       if (!(hid = usb_hid_configure(dev, ifnum)))
+       name[0] = 0;
+
+       if (!(buf = kmalloc(63, GFP_KERNEL)))
+               return NULL;
+
+       if (dev->descriptor.iManufacturer &&
+               usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0)
+                       strcat(name, buf);
+       if (dev->descriptor.iProduct &&
+               usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0)
+                       sprintf(name, "%s %s", name, buf);
+
+       kfree(buf);
+
+       if (!(hid = usb_hid_configure(dev, ifnum, name)))
                return NULL;
 
        hid_dump_device(hid);
@@ -1448,10 +1479,18 @@
        hid_init_input(hid);
        input_register_device(&hid->input);
 
-       printk(KERN_INFO "input%d: USB HID v%x.%02x %s\n",
-               hid->input.number, hid->version >> 8, hid->version & 0xff,
+       printk(KERN_INFO "input%d: USB HID v%x.%02x %s",
+               hid->input.number,
+               hid->version >> 8, hid->version & 0xff,
                ((hid->application >= 0x00010000) && (hid->application <= 0x00010008)) 
?
-                       hid_name[hid->application & 0xffff] : "device");
+               hid_types[hid->application & 0xffff] : "Device");
+
+       if (strlen(name))
+               printk(" [%s]", name);
+       else
+               printk(" [%04x:%04x]", hid->input.idvendor, hid->input.idproduct);
+       
+       printk(" on usb%d:%d.%d\n", dev->bus->busnum, dev->devnum, ifnum);
 
        return hid;
 }
diff -urN linux-2.4.0-test1-ac4/drivers/usb/hid.h linux/drivers/usb/hid.h
--- linux-2.4.0-test1-ac4/drivers/usb/hid.h     Sun May 28 19:33:58 2000
+++ linux/drivers/usb/hid.h     Mon May 29 15:44:05 2000
@@ -2,7 +2,7 @@
 #define __HID_H
 
 /*
- * $Id: hid.h,v 1.3 2000/05/28 17:31:36 vojtech Exp $
+ * $Id: hid.h,v 1.4 2000/05/29 09:01:52 vojtech Exp $
  *
  *  Copyright (c) 1999 Andreas Gal
  *  Copyright (c) 2000 Vojtech Pavlik
@@ -294,6 +294,7 @@
        struct input_dev input;                                         /* input 
device structure */
        int open;                                                       /* is the 
device open by input? */
        int quirks;                                                     /* Various 
nasty tricks the device can pull on us */
+       char name[128];                                                 /* Device name 
+*/
 };
 
 #define HID_GLOBAL_STACK_SIZE 4
diff -urN linux-2.4.0-test1-ac4/drivers/usb/joydev.c linux/drivers/usb/joydev.c
--- linux-2.4.0-test1-ac4/drivers/usb/joydev.c  Sun May 28 19:33:58 2000
+++ linux/drivers/usb/joydev.c  Mon May 29 15:44:01 2000
@@ -1,5 +1,5 @@
 /*
- * $Id: joydev.c,v 1.6 2000/05/28 17:31:36 vojtech Exp $
+ * $Id: joydev.c,v 1.7 2000/05/29 09:01:52 vojtech Exp $
  *
  *  Copyright (c) 1999-2000 Vojtech Pavlik                                       
  *  Copyright (c) 1999 Colin Van Dyke 
@@ -53,7 +53,6 @@
        int used;
        int open;
        int minor;
-       char name[32];
        struct input_handle handle;
        wait_queue_head_t wait;
        devfs_handle_t devfs;
@@ -322,6 +321,8 @@
 {
        struct joydev_list *list = file->private_data;
        struct joydev *joydev = list->joydev;
+       struct input_dev *dev = joydev->handle.dev;
+
 
        switch (cmd) {
 
@@ -360,9 +361,11 @@
                                                sizeof(struct js_corr) * joydev->nabs) 
? -EFAULT : 0;
                default:
                        if ((cmd & ~(_IOC_SIZEMASK << _IOC_SIZESHIFT)) == 
JSIOCGNAME(0)) {
-                               int len = strlen(joydev->name) + 1;
+                               int len;
+                               if (!dev->name) return 0;
+                               len = strlen(dev->name) + 1;
                                if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
-                               if (copy_to_user((char *) arg, joydev->name, len)) 
return -EFAULT;
+                               if (copy_to_user((char *) arg, dev->name, len)) return 
+-EFAULT;
                                return len;
                        }
        }
@@ -400,8 +403,6 @@
        memset(joydev, 0, sizeof(struct joydev));
 
        init_waitqueue_head(&joydev->wait);
-
-       sprintf(joydev->name, "joydev%d", joydev->minor);
 
        joydev->minor = minor;
        joydev_table[minor] = joydev;
diff -urN linux-2.4.0-test1-ac4/drivers/usb/usbkbd.c linux/drivers/usb/usbkbd.c
--- linux-2.4.0-test1-ac4/drivers/usb/usbkbd.c  Sun May 28 19:33:58 2000
+++ linux/drivers/usb/usbkbd.c  Mon May 29 15:44:09 2000
@@ -1,5 +1,5 @@
 /*
- * $Id: usbkbd.c,v 1.10 2000/05/28 17:31:36 vojtech Exp $
+ * $Id: usbkbd.c,v 1.11 2000/05/29 09:01:52 vojtech Exp $
  *
  *  Copyright (c) 1999-2000 Vojtech Pavlik
  *
@@ -63,6 +63,7 @@
        struct urb irq, led;
        devrequest dr;
        unsigned char leds;
+       char name[128];
        int open;
 };
 
@@ -153,6 +154,7 @@
        struct usb_endpoint_descriptor *endpoint;
        struct usb_kbd *kbd;
        int i, pipe, maxp;
+       char *buf;
 
        if (dev->descriptor.bNumConfigurations != 1) return NULL;
        interface = dev->config[0].interface[ifnum].altsetting + 0;
@@ -196,12 +198,37 @@
        kbd->dr.index = interface->bInterfaceNumber;
        kbd->dr.length = 1;
 
+       kbd->dev.name = kbd->name;
+       kbd->dev.idbus = BUS_USB;
+       kbd->dev.idvendor = dev->descriptor.idVendor;
+       kbd->dev.idproduct = dev->descriptor.idProduct;
+       kbd->dev.idversion = dev->descriptor.bcdDevice;
+
+       if (!(buf = kmalloc(63, GFP_KERNEL))) {
+               kfree(kbd);
+               return NULL;
+       }
+
+       if (dev->descriptor.iManufacturer &&
+               usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0)
+                       strcat(kbd->name, buf);
+       if (dev->descriptor.iProduct &&
+               usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0)
+                       sprintf(kbd->name, "%s %s", kbd->name, buf);
+
+       if (!strlen(kbd->name))
+               sprintf(kbd->name, "USB HIDBP Keyboard %04x:%04x",
+                       kbd->dev.idvendor, kbd->dev.idproduct);
+
+       kfree(buf);
+
        FILL_CONTROL_URB(&kbd->led, dev, usb_sndctrlpipe(dev, 0),
                (void*) &kbd->dr, &kbd->leds, 1, usb_kbd_led, kbd);
                        
        input_register_device(&kbd->dev);
 
-       printk(KERN_INFO "input%d: USB HIDBP keyboard\n", kbd->dev.number);
+       printk(KERN_INFO "input%d: %s on on usb%d:%d.%d\n",
+                kbd->dev.number, kbd->name, dev->bus->busnum, dev->devnum, ifnum);
 
        return kbd;
 }
diff -urN linux-2.4.0-test1-ac4/drivers/usb/usbmouse.c linux/drivers/usb/usbmouse.c
--- linux-2.4.0-test1-ac4/drivers/usb/usbmouse.c        Sun May 28 19:33:58 2000
+++ linux/drivers/usb/usbmouse.c        Mon May 29 15:44:09 2000
@@ -1,5 +1,5 @@
 /*
- * $Id: usbmouse.c,v 1.4 2000/05/28 17:31:36 vojtech Exp $
+ * $Id: usbmouse.c,v 1.5 2000/05/29 09:01:52 vojtech Exp $
  *
  *  Copyright (c) 1999-2000 Vojtech Pavlik
  *
@@ -39,6 +39,7 @@
 
 struct usb_mouse {
        signed char data[8];
+       char name[128];
        struct input_dev dev;
        struct urb irq;
        int open;
@@ -90,6 +91,7 @@
        struct usb_endpoint_descriptor *endpoint;
        struct usb_mouse *mouse;
        int pipe, maxp;
+       char *buf;
 
        if (dev->descriptor.bNumConfigurations != 1) return NULL;
        interface = dev->config[0].interface[ifnum].altsetting + 0;
@@ -121,12 +123,37 @@
        mouse->dev.open = usb_mouse_open;
        mouse->dev.close = usb_mouse_close;
 
+       mouse->dev.name = mouse->name;
+       mouse->dev.idbus = BUS_USB;
+       mouse->dev.idvendor = dev->descriptor.idVendor;
+       mouse->dev.idproduct = dev->descriptor.idProduct;
+       mouse->dev.idversion = dev->descriptor.bcdDevice;
+
+       if (!(buf = kmalloc(63, GFP_KERNEL))) {
+               kfree(mouse);
+               return NULL;
+       }
+
+       if (dev->descriptor.iManufacturer &&
+               usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0)
+                       strcat(mouse->name, buf);
+       if (dev->descriptor.iProduct &&
+               usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0)
+                       sprintf(mouse->name, "%s %s", mouse->name, buf);
+
+       if (!strlen(mouse->name))
+               sprintf(mouse->name, "USB HIDBP Mouse %04x:%04x",
+                       mouse->dev.idvendor, mouse->dev.idproduct);
+
+       kfree(buf);
+
        FILL_INT_URB(&mouse->irq, dev, pipe, mouse->data, maxp > 8 ? 8 : maxp,
                usb_mouse_irq, mouse, endpoint->bInterval);
 
        input_register_device(&mouse->dev);
 
-       printk(KERN_INFO "input%d: USB HIDBP mouse\n", mouse->dev.number);
+       printk(KERN_INFO "input%d: %s on usb%d:%d.%d\n",
+                mouse->dev.number, mouse->name, dev->bus->busnum, dev->devnum, ifnum);
 
        return mouse;
 }
diff -urN linux-2.4.0-test1-ac4/drivers/usb/wacom.c linux/drivers/usb/wacom.c
--- linux-2.4.0-test1-ac4/drivers/usb/wacom.c   Sun May 28 19:33:58 2000
+++ linux/drivers/usb/wacom.c   Mon May 29 15:44:12 2000
@@ -1,5 +1,5 @@
 /*
- * $Id: wacom.c,v 1.8 2000/05/28 17:33:38 vojtech Exp $
+ * $Id: wacom.c,v 1.9 2000/05/29 09:01:52 vojtech Exp $
  *
  *  Copyright (c) 2000 Vojtech Pavlik          <[EMAIL PROTECTED]>
  *  Copyright (c) 2000 Andreas Bach Aaen       <[EMAIL PROTECTED]>
@@ -216,17 +216,17 @@
 #define WACOM_INTUOS_TOOLS     (BIT(BTN_TOOL_BRUSH) | BIT(BTN_TOOL_PENCIL) | 
BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS))
 
 struct wacom_features wacom_features[] = {
-       { "Graphire",     0x10,  8, 10206,  7422,  511, 32, wacom_graphire_irq,
+       { "Wacom Graphire",     0x10,  8, 10206,  7422,  511, 32, wacom_graphire_irq,
                BIT(EV_REL), 0, BIT(REL_WHEEL), BIT(BTN_LEFT) | BIT(BTN_RIGHT) | 
BIT(BTN_MIDDLE), 0 },
-       { "Intuos 4x5",   0x20, 10, 12700, 10360, 1023, 15, wacom_intuos_irq,
+       { "Wacom Intuos 4x5",   0x20, 10, 12700, 10360, 1023, 15, wacom_intuos_irq,
                0, BIT(ABS_TILT_X) | BIT(ABS_TILT_Y), 0, 0, WACOM_INTUOS_TOOLS },
-       { "Intuos 6x8",   0x21, 10, 20320, 15040, 1023, 15, wacom_intuos_irq,
+       { "Wacom Intuos 6x8",   0x21, 10, 20320, 15040, 1023, 15, wacom_intuos_irq,
                0, BIT(ABS_TILT_X) | BIT(ABS_TILT_Y), 0, 0, WACOM_INTUOS_TOOLS },
-       { "Intuos 9x12",  0x22, 10, 30480, 23060, 1023, 15, wacom_intuos_irq,
+       { "Wacom Intuos 9x12",  0x22, 10, 30480, 23060, 1023, 15, wacom_intuos_irq,
                0, BIT(ABS_TILT_X) | BIT(ABS_TILT_Y), 0, 0, WACOM_INTUOS_TOOLS },
-       { "Intuos 12x12", 0x23, 10, 30480, 30480, 1023, 15, wacom_intuos_irq,
+       { "Wacom Intuos 12x12", 0x23, 10, 30480, 30480, 1023, 15, wacom_intuos_irq,
                0, BIT(ABS_TILT_X) | BIT(ABS_TILT_Y), 0, 0, WACOM_INTUOS_TOOLS },
-       { "Intuos 12x18", 0x24, 10, 47720, 30480, 1023, 15, wacom_intuos_irq,
+       { "Wacom Intuos 12x18", 0x24, 10, 47720, 30480, 1023, 15, wacom_intuos_irq,
                0, BIT(ABS_TILT_X) | BIT(ABS_TILT_Y), 0, 0, WACOM_INTUOS_TOOLS },
        { NULL , 0 }
 };
@@ -287,12 +287,19 @@
        wacom->dev.open = wacom_open;
        wacom->dev.close = wacom_close;
 
+       wacom->dev.name = wacom->features->name;
+       wacom->dev.idbus = BUS_USB;
+       wacom->dev.idvendor = dev->descriptor.idVendor;
+       wacom->dev.idproduct = dev->descriptor.idProduct;
+       wacom->dev.idversion = dev->descriptor.bcdDevice;
+
        FILL_INT_URB(&wacom->irq, dev, usb_rcvintpipe(dev, endpoint->bEndpointAddress),
                     wacom->data, wacom->features->pktlen, wacom->features->irq, 
wacom, endpoint->bInterval);
 
        input_register_device(&wacom->dev);
 
-       printk(KERN_INFO "input%d: Wacom %s on usb%d\n", wacom->dev.number, 
wacom->features->name, dev->devnum);
+       printk(KERN_INFO "input%d: %s on usb%d:%d.%d\n",
+                wacom->dev.number, wacom->features->name, dev->bus->busnum, 
+dev->devnum, ifnum);
 
        return wacom;
 }
diff -urN linux-2.4.0-test1-ac4/drivers/usb/wmforce.c linux/drivers/usb/wmforce.c
--- linux-2.4.0-test1-ac4/drivers/usb/wmforce.c Sun May 28 19:33:58 2000
+++ linux/drivers/usb/wmforce.c Mon May 29 15:44:15 2000
@@ -1,5 +1,5 @@
 /*
- * $Id: wmforce.c,v 1.5 2000/05/28 17:31:36 vojtech Exp $
+ * $Id: wmforce.c,v 1.6 2000/05/29 09:01:52 vojtech Exp $
  *
  *  Copyright (c) 2000 Vojtech Pavlik
  *
@@ -52,6 +52,8 @@
         __s32 y;
 } wmforce_hat_to_axis[16] = {{ 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, 
{-1, 0}, {-1,-1}};
 
+static char *wmforce_name = "Logitech WingMan Force";
+
 static void wmforce_irq(struct urb *urb)
 {
        struct wmforce *wmforce = urb->context;
@@ -142,12 +144,19 @@
        wmforce->dev.open = wmforce_open;
        wmforce->dev.close = wmforce_close;
 
+       wmforce->dev.name = wmforce_name;
+       wmforce->dev.idbus = BUS_USB;
+       wmforce->dev.idvendor = dev->descriptor.idVendor;
+       wmforce->dev.idproduct = dev->descriptor.idProduct;
+       wmforce->dev.idversion = dev->descriptor.bcdDevice;
+
        FILL_INT_URB(&wmforce->irq, dev, usb_rcvintpipe(dev, 
endpoint->bEndpointAddress),
                        wmforce->data, 8, wmforce_irq, wmforce, endpoint->bInterval);
 
        input_register_device(&wmforce->dev);
 
-       printk(KERN_INFO "input%d: Logitech WingMan Force USB\n", wmforce->dev.number);
+       printk(KERN_INFO "input%d: %s on usb%d:%d.%d\n",
+                wmforce->dev.number, wmforce_name, dev->bus->busnum, dev->devnum, 
+ifnum);
 
        return wmforce;
 }
diff -urN linux-2.4.0-test1-ac4/include/linux/input.h linux/include/linux/input.h
--- linux-2.4.0-test1-ac4/include/linux/input.h Sun May 28 19:36:55 2000
+++ linux/include/linux/input.h Mon May 29 15:45:12 2000
@@ -2,7 +2,7 @@
 #define _INPUT_H
 
 /*
- * $Id: input.h,v 1.11 2000/05/28 17:36:22 vojtech Exp $
+ * $Id: input.h,v 1.13 2000/05/29 10:54:53 vojtech Exp $
  *
  *  Copyright (c) 1999-2000 Vojtech Pavlik
  *
@@ -33,6 +33,7 @@
 #include <linux/time.h>
 #else
 #include <sys/time.h>
+#include <sys/ioctl.h>
 #endif
 
 /*
@@ -56,17 +57,17 @@
  * IOCTLs (0x00 - 0x7f)
  */
 
-#define EVIOCGVERSION          _IOR('E', 0x01, __u32)                  /* get driver 
version */
+#define EVIOCGVERSION          _IOR('E', 0x01, int)                    /* get driver 
+version */
 #define EVIOCGID               _IOR('E', 0x02, short[4])               /* get device 
ID */
 #define EVIOCGREP              _IOR('E', 0x03, int[2])                 /* get repeat 
settings */
 #define EVIOCSREP              _IOW('E', 0x03, int[2])                 /* get repeat 
settings */
 #define EVIOCGKEYCODE          _IOR('E', 0x04, int[2])                 /* get keycode 
*/
 #define EVIOCSKEYCODE          _IOW('E', 0x04, int[2])                 /* set keycode 
*/
 #define EVIOCGKEY              _IOR('E', 0x05, int[2])                 /* get key 
value */
-#define EVIOCGABSLIM(num)      _IOR('E', 0x10, int[5])                 /* get abs 
event limits */ 
-#define EVIOCGABS(num)         _IOR('E', 0x11, int[2])                 /* get abs 
value */
-#define EVIOCGNAME(len)                _IOC(_IOC_READ, 'E', 0x18, len)         /* get 
device name */
+#define EVIOCGNAME(len)                _IOC(_IOC_READ, 'E', 0x06, len)         /* get 
+device name */
+
 #define EVIOCGBIT(ev,len)      _IOC(_IOC_READ, 'E', 0x20 + ev, len)    /* get event 
bits */
+#define EVIOCGABS(abs)         _IOR('E', 0x40 + abs, int[5])           /* get abs 
+value/limits */ 
 
 /*
  * Event types
@@ -403,9 +404,14 @@
 #define SND_MAX                        0x07
 
 /*
- * Bus IDs.
+ * IDs.
  */
 
+#define ID_BUS                 0
+#define ID_VENDOR              1
+#define ID_PRODUCT             2
+#define ID_VERSION             3
+
 #define BUS_PCI                        0x01
 #define BUS_ISAPNP             0x02
 #define BUS_USB                        0x03
@@ -413,8 +419,10 @@
 #define BUS_ISA                        0x10
 #define BUS_I8042              0x11
 #define BUS_XTKBD              0x12
-#define BUS_SERIAL             0x13
+#define BUS_RS232              0x13
 #define BUS_GAMEPORT           0x14
+#define BUS_PARPORT            0x15
+#define BUS_AMIGA              0x16
 
 #ifdef __KERNEL__
 
@@ -438,7 +446,7 @@
        unsigned short idbus;
        unsigned short idvendor;
        unsigned short idproduct;
-       unsigned short idtype;
+       unsigned short idversion;
 
        unsigned long evbit[NBITS(EV_MAX)];
        unsigned long keybit[NBITS(KEY_MAX)];

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to