patch-2.3.99-pre1 linux/drivers/char/ppdev.c

Next file: linux/drivers/char/pty.c
Previous file: linux/drivers/char/n_tty.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.51/linux/drivers/char/ppdev.c linux/drivers/char/ppdev.c
@@ -537,6 +537,17 @@
 	unsigned int minor = MINOR (inode->i_rdev);
 	struct pp_struct *pp = file->private_data;
 
+	if (pp->pdev->port->ieee1284.mode != IEEE1284_MODE_COMPAT) {
+		if (!(pp->flags & PP_CLAIMED)) {
+			parport_claim_or_block (pp->pdev);
+			pp->flags |= PP_CLAIMED;
+		}
+		parport_negotiate (pp->pdev->port, IEEE1284_MODE_COMPAT);
+		printk (KERN_DEBUG CHRDEV
+			"%x: negotiated back to compatibility mode because "
+			"user-space forgot\n", minor);
+	}
+
 	if (pp->flags & PP_CLAIMED) {
 		parport_release (pp->pdev);
 		printk (KERN_DEBUG CHRDEV "%x: released pardevice because "

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