From: James S. <jsi...@us...> - 2002-03-22 20:14:07
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/usb In directory usw-pr-cvs1:/tmp/cvs-serv1749/linux/drivers/usb Modified Files: Config.help Config.in Makefile hid.h hiddev.c Log Message: Synced to 2.5.7 Index: Config.help =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/Config.help,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Config.help 6 Mar 2002 23:02:58 -0000 1.2 +++ Config.help 22 Mar 2002 20:13:58 -0000 1.3 @@ -196,6 +196,18 @@ The module will be called audio.o. If you want to compile it as a module, say M here and read <file:Documentation/modules.txt>. +CONFIG_USB_EMI26 + This driver loads firmware to Emagic EMI 2|6 low latency USB + Audio interface. + + After firmware load the device is handled with standard linux + USB Audio driver. + + This code is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called audio.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. + CONFIG_USB_ACM This driver supports USB modems and ISDN adapters which support the Communication Device Class Abstract Control Model interface. @@ -342,12 +354,12 @@ module, say M here and read <file:Documentation/modules.txt>. CONFIG_USB_PEGASUS - Say Y here if you know you have Pegasus or Pegasus II based adapter. + Say Y here if you know you have Pegasus or Pegasus-II based adapter. If in doubt then look at linux/drivers/usb/pegasus.h for the complete list of supported devices. If your particular adapter is not in the list and you are _sure_ it - is Pegasus or Pegasus II based then send me (pma...@ln...) vendor - and device IDs. + is Pegasus or Pegasus II based then send me (pma...@us...) + vendor and device IDs. This code is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -396,6 +408,7 @@ CONFIG_USB_CATC Say Y if you want to use one of the following 10Mbps USB Ethernet device based on the EL1210A chip. Supported devices are: + Belkin F5U011 Belkin F5U111 CATC NetMate CATC NetMate II Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/Config.in,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Config.in 18 Mar 2002 19:29:10 -0000 1.21 +++ Config.in 22 Mar 2002 20:13:58 -0000 1.22 @@ -31,6 +31,7 @@ comment 'USB Device Class drivers' dep_tristate ' USB Audio support' CONFIG_USB_AUDIO $CONFIG_USB $CONFIG_SOUND + dep_tristate ' EMI 2|6 USB Audio interface support' CONFIG_USB_EMI26 $CONFIG_USB_AUDIO dep_tristate ' USB Bluetooth support (EXPERIMENTAL)' CONFIG_USB_BLUETOOTH $CONFIG_USB $CONFIG_EXPERIMENTAL if [ "$CONFIG_SCSI" = "n" ]; then comment ' SCSI support is needed for USB Storage' @@ -89,7 +90,7 @@ if [ "$CONFIG_NET" = "n" ]; then comment ' Networking support is needed for USB Networking device support' else - dep_tristate ' USB ADMtek Pegasus-based ethernet device support (EXPERIMENTAL)' CONFIG_USB_PEGASUS $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL + dep_tristate ' USB Pegasus/Pegasus-II based ethernet device support (EXPERIMENTAL)' CONFIG_USB_PEGASUS $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL dep_tristate ' USB KLSI KL5USB101-based ethernet device support (EXPERIMENTAL)' CONFIG_USB_KAWETH $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL dep_tristate ' USB CATC NetMate-based Ethernet device support (EXPERIMENTAL)' CONFIG_USB_CATC $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL dep_tristate ' USB Communication Class Ethernet device support (EXPERIMENTAL)' CONFIG_USB_CDCETHER $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/Makefile,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Makefile 3 Mar 2002 16:28:06 -0000 1.16 +++ Makefile 22 Mar 2002 20:13:58 -0000 1.17 @@ -68,6 +68,7 @@ obj-$(CONFIG_USB_ACM) += acm.o obj-$(CONFIG_USB_PRINTER) += printer.o obj-$(CONFIG_USB_AUDIO) += audio.o +obj-$(CONFIG_USB_EMI26) += emi26.o obj-$(CONFIG_USB_IBMCAM) += ibmcam.o usbvideo.o ultracam.o obj-$(CONFIG_USB_KONICAWC) += konicawc.o usbvideo.o obj-$(CONFIG_USB_PWC) += pwc.o Index: hid.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hid.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- hid.h 10 Mar 2002 12:26:40 -0000 1.29 +++ hid.h 22 Mar 2002 20:13:58 -0000 1.30 @@ -203,6 +203,8 @@ #define HID_QUIRK_INVERT 0x01 #define HID_QUIRK_NOTOUCH 0x02 +#define HID_QUIRK_IGNORE 0x04 +#define HID_QUIRK_NOGET 0x08 /* * This is the global enviroment of the parser. This information is @@ -276,6 +278,7 @@ __s32 unit_exponent; unsigned unit; struct hid_report *report; /* associated report */ + unsigned index; /* index into report->field[] */ }; #define HID_MAX_FIELDS 64 Index: hiddev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/usb/hiddev.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- hiddev.c 22 Jan 2002 20:58:58 -0000 1.1 +++ hiddev.c 22 Mar 2002 20:13:58 -0000 1.2 @@ -50,9 +50,10 @@ }; struct hiddev_list { - struct hiddev_event buffer[HIDDEV_BUFFER_SIZE]; + struct hiddev_usage_ref buffer[HIDDEV_BUFFER_SIZE]; int head; int tail; + unsigned flags; struct fasync_struct *fasync; struct hiddev *hiddev; struct hiddev_list *next; @@ -146,17 +147,19 @@ * This is where hid.c calls into hiddev to pass an event that occurred over * the interrupt pipe */ -void hiddev_hid_event(struct hid_device *hid, unsigned int usage, int value) +void hiddev_hid_event(struct hid_device *hid, struct hiddev_usage_ref *uref) { struct hiddev *hiddev = hid->hiddev; struct hiddev_list *list = hiddev->list; while (list) { - list->buffer[list->head].hid = usage; - list->buffer[list->head].value = value; - list->head = (list->head + 1) & (HIDDEV_BUFFER_SIZE - 1); - - kill_fasync(&list->fasync, SIGIO, POLL_IN); + if (uref->field_index != HID_FIELD_INDEX_NONE || + (list->flags & HIDDEV_FLAG_REPORT) != 0) { + list->buffer[list->head] = *uref; + list->head = (list->head + 1) & + (HIDDEV_BUFFER_SIZE - 1); + kill_fasync(&list->fasync, SIGIO, POLL_IN); + } list = list->next; } @@ -257,43 +260,67 @@ { DECLARE_WAITQUEUE(wait, current); struct hiddev_list *list = file->private_data; + int event_size; int retval = 0; - if (list->head == list->tail) { - - add_wait_queue(&list->hiddev->wait, &wait); - set_current_state(TASK_INTERRUPTIBLE); + event_size = ((list->flags & HIDDEV_FLAG_UREF) != 0) ? + sizeof(struct hiddev_usage_ref) : sizeof(struct hiddev_event); - while (list->head == list->tail) { + if (count < event_size) return 0; - if (file->f_flags & O_NONBLOCK) { - retval = -EAGAIN; - break; - } - if (signal_pending(current)) { - retval = -ERESTARTSYS; - break; - } - if (!list->hiddev->exist) { - retval = -EIO; - break; + while (retval == 0) { + if (list->head == list->tail) { + add_wait_queue(&list->hiddev->wait, &wait); + set_current_state(TASK_INTERRUPTIBLE); + + while (list->head == list->tail) { + if (file->f_flags & O_NONBLOCK) { + retval = -EAGAIN; + break; + } + if (signal_pending(current)) { + retval = -ERESTARTSYS; + break; + } + if (!list->hiddev->exist) { + retval = -EIO; + break; + } + + schedule(); } - schedule(); + set_current_state(TASK_RUNNING); + remove_wait_queue(&list->hiddev->wait, &wait); } - set_current_state(TASK_RUNNING); - remove_wait_queue(&list->hiddev->wait, &wait); - } + if (retval) + return retval; - if (retval) - return retval; - while (list->head != list->tail && retval + sizeof(struct hiddev_event) <= count) { - if (copy_to_user(buffer + retval, list->buffer + list->tail, - sizeof(struct hiddev_event))) return -EFAULT; - list->tail = (list->tail + 1) & (HIDDEV_BUFFER_SIZE - 1); - retval += sizeof(struct hiddev_event); + while (list->head != list->tail && + retval + event_size <= count) { + if ((list->flags & HIDDEV_FLAG_UREF) == 0) { + if (list->buffer[list->tail].field_index != + HID_FIELD_INDEX_NONE) { + struct hiddev_event event; + event.hid = list->buffer[list->tail].usage_code; + event.value = list->buffer[list->tail].value; + if (copy_to_user(buffer + retval, &event, sizeof(struct hiddev_event))) + return -EFAULT; + retval += sizeof(struct hiddev_event); + } + } else { + if (list->buffer[list->tail].field_index != HID_FIELD_INDEX_NONE || + (list->flags & HIDDEV_FLAG_REPORT) != 0) { + if (copy_to_user(buffer + retval, list->buffer + list->tail, sizeof(struct hiddev_usage_ref))) + return -EFAULT; + retval += sizeof(struct hiddev_usage_ref); + } + } + list->tail = (list->tail + 1) & (HIDDEV_BUFFER_SIZE - 1); + } + } return retval; @@ -357,6 +384,25 @@ dinfo.num_applications = hid->maxapplication; return copy_to_user((void *) arg, &dinfo, sizeof(dinfo)); } + + case HIDIOCGFLAG: + return put_user(list->flags, (int *) arg); + + case HIDIOCSFLAG: + { + int newflags; + if (get_user(newflags, (int *) arg)) + return -EFAULT; + + if ((newflags & ~HIDDEV_FLAGS) != 0 || + ((newflags & HIDDEV_FLAG_REPORT) != 0 && + (newflags & HIDDEV_FLAG_UREF) == 0)) + return -EINVAL; + + list->flags = newflags; + + return 0; + } case HIDIOCGSTRING: { |