patch-2.4.0-test3 linux/drivers/usb/devio.c

Next file: linux/drivers/usb/ibmcam.c
Previous file: linux/drivers/usb/bluetooth.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/drivers/usb/devio.c linux/drivers/usb/devio.c
@@ -514,6 +514,7 @@
 
 extern struct list_head usb_driver_list;
 
+#if 0
 static int finddriver(struct usb_driver **driver, char *name)
 {
 	struct list_head *tmp;
@@ -533,6 +534,7 @@
 
 	return -EINVAL;
 }
+#endif
 
 /*
  * file operations
@@ -715,6 +717,27 @@
 	return 0;
 }
 
+static int proc_clearhalt(struct dev_state *ps, void *arg)
+{
+	unsigned int ep;
+	int pipe;
+	int ret;
+
+	get_user_ret(ep, (unsigned int *)arg, -EFAULT);
+	if ((ret = findintfep(ps->dev, ep)) < 0)
+		return ret;
+	if ((ret = checkintf(ps, ret)))
+		return ret;
+	if (ep & USB_DIR_IN)
+                pipe = usb_rcvbulkpipe(ps->dev, ep & 0x7f);
+        else
+                pipe = usb_sndbulkpipe(ps->dev, ep & 0x7f);
+
+	usb_clear_halt(ps->dev, pipe);
+	return 0;
+}
+		
+
 static int proc_getdriver(struct dev_state *ps, void *arg)
 {
 	struct usbdevfs_getdriver gd;
@@ -1119,6 +1142,12 @@
 
 	case USBDEVFS_RESET:
 		ret = proc_resetdevice(ps);
+		break;
+	
+	case USBDEVFS_CLEAR_HALT:
+		ret = proc_clearhalt(ps, (void *)arg);
+		if (ret >= 0)
+			inode->i_mtime = CURRENT_TIME;
 		break;
 
 	case USBDEVFS_GETDRIVER:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)