patch-2.3.10 linux/drivers/usb/printer.c

Next file: linux/drivers/usb/uhci.c
Previous file: linux/drivers/usb/ohci.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.9/linux/drivers/usb/printer.c linux/drivers/usb/printer.c
@@ -124,6 +124,7 @@
 		return -EBUSY;
 	}
 	if (!(p->obuf = (char *)__get_free_page(GFP_KERNEL))) {
+		p->isopen = 0;
 		return -ENOMEM;
 	}
 
@@ -166,7 +167,6 @@
 	do {
 		char *obuf = p->obuf;
 		unsigned long thistime;
-		partial = 0;
 
 		thistime = copy_size = (count > p->maxout) ? p->maxout : count;
 		if (copy_from_user(p->obuf, buffer, copy_size))
@@ -303,7 +303,11 @@
 	minor_data[i] = PPDATA(dev->private);
 	minor_data[i]->minor = i;
 	minor_data[i]->pusb_dev = dev;
-	minor_data[i]->maxout = interface->endpoint[0].wMaxPacketSize * 16;
+	/* The max packet size can't be more than 64 (& will be 64 for
+	 * any decent bulk device); this calculation was silly.  -greg
+	 * minor_data[i]->maxout = interface->endpoint[0].wMaxPacketSize * 16;
+	 */
+	minor_data[i]->maxout = 8192;
 	if (minor_data[i]->maxout > PAGE_SIZE) {
                 minor_data[i]->maxout = PAGE_SIZE;
 	}

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