*** n_tty.c.75	Thu Mar 30 20:41:19 1995
--- n_tty.c	Tue Apr 11 20:57:30 1995
***************
*** 17,24 ****
--- 17,37 ----
   * 
   * This file may be redistributed under the terms of the GNU Public
   * License.
+  *
+  * Added option to allow smart serial cards to handle certain output cooking
+  * in the hardware. We look for TTY_HW_COOK_OUT in tty->flags
+  * to decide which behaviour to adopt. This code is ALPHA.
+  *                        - Simon P Allen 17.6.94
+  *
+  * Added support for input cooking in hardware too.
+  *                        - SPA 31.3.95
+  *
   */
  
+ /* SPA - FIXME - Ted, these two should go in the proper header (tty.h) */
+ #define TTY_HW_COOK_OUT 7
+ #define TTY_HW_COOK_IN  8
+ 
  #include <linux/types.h>
  #include <linux/major.h>
  #include <linux/errno.h>
***************
*** 610,615 ****
--- 623,636 ----
  		return;
  	
  	tty->icanon = (L_ICANON(tty) != 0);
+ 
+ /* Preliminary support for hardware input cooking - SPA */
+    if(tty->flags & (1<<TTY_HW_COOK_IN))
+         {
+                 tty->raw = 1;
+                 tty->real_raw = 1;
+         }
+         else
  	if (I_ISTRIP(tty) || I_IUCLC(tty) || I_IGNCR(tty) ||
  	    I_ICRNL(tty) || I_INLCR(tty) || L_ICANON(tty) ||
  	    I_IXON(tty) || L_ISIG(tty) || L_ECHO(tty) ||
***************
*** 927,932 ****
--- 948,961 ----
  			retval = -EIO;
  			break;
  		}
+ 	        /* Preliminary support for hardware input cooking - SPA */
+         	if(tty->flags & (1<<TTY_HW_COOK_OUT))
+         	{ /* Hardware cooked */
+                 	c = tty->driver.write(tty, 1, b, nr);
+                 	b += c;
+                 	nr -= c;
+         	}
+         	else
  		if (O_OPOST(tty)) {
  			while (nr > 0) {
  				c = get_fs_byte(b);
