Subject: bin/2725: Adding driver-specific termios flags
To: None <gnats-bugs@NetBSD.ORG, wrstuden@loki.Stanford.EDU>
From: None <wrstuden@loki.Stanford.EDU>
List: netbsd-bugs
Date: 08/31/1996 12:00:26
>Number:         2725
>Category:       bin
>Synopsis:       mac68k tty driver needs extra state info, this send-pr adds it (resend)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 31 15:35:01 1996
>Last-Modified:
>Originator:     Bill Studenmund
>Organization:
Bill Studenmund
	
>Release:        1.1B (current as of May, I think)
>Environment:
	
System: NetBSD pokey 1.1B NetBSD 1.1B (POKEY) #83: Sun Aug 25 17:32:33 PDT 1996 croot@pokey:/y1/src11/sys/arch/mac68k/compile/POKEY mac68k


>Description:
(Note: I tried to send this send-pr on the evening of th 28th, but
I think it failed. I did not receive an automatic reply. If it went
in, please just delete this one & go with the other one.)

The mac serial port has only one non-data output line. Depending on
the cable connected to the mac, this pin might be treated as either
DTR or RTS. The driver needs some way to be told which way to
behave. In response to my question on tech-kern about doing something
w/ sysctl to control this decision, Charles suggested just adding
another bit to the CFLAGs. I like this idea, so here are patches which
add such a bit.

>How-To-Repeat:
(Not really a bug)
>Fix:
Here are patches to stty's modes.c and print.c, and to sys/sys/termios.h which
define this bit, make its value printed, and changeable in stty.

I chose machdep1 as the name for the bit to indicate the bit's definition
is machine dependant (1 since we might have more at some point - we have
3 link layer bits for net interfaces). Looking back, it's long and ugly.
Maybe cdd1 (CFLAG Driver-Dep. #1) or cdev1? I'm sure there are better
names available.

*** print.c.orig	Thu Aug 29 20:59:30 1996
--- print.c	Thu Aug 29 20:59:58 1996
***************
*** 175,180 ****
--- 175,181 ----
  	put("-cstopb", CSTOPB, 0);
  	put("-crtscts", CRTSCTS, 0);
  	put("-mdmbuf", MDMBUF, 0);
+ 	put("-cmachdep1", CMACHDEP1, 0);
  
  	/* special control characters */
  	cc = tp->c_cc;
*** modes.c.orig	Thu Aug 29 20:41:57 1996
--- modes.c	Thu Aug 29 20:48:25 1996
***************
*** 87,92 ****
--- 87,94 ----
  	{ "-crtscts",	0, CRTSCTS },
  	{ "mdmbuf",	MDMBUF, 0 },
  	{ "-mdmbuf",	0, MDMBUF },
+ 	{ "cmachdep1",	CMACHDEP1, 0},
+ 	{ "-cmachdep1",	0, CMACHDEP1},
  	{ NULL },
  };
  
*** termios.h.orig	Thu Aug 29 20:42:44 1996
--- termios.h	Thu Aug 29 20:45:15 1996
***************
*** 137,142 ****
--- 137,143 ----
  #define	CCTS_OFLOW	CRTSCTS		/* XXX compat */
  #define	MDMBUF		0x00100000	/* DTR/DCD hardware flow control */
  #define	CHWFLOW		(MDMBUF|CRTSCTS) /* all types of hw flow control */
+ #define	CMACHDEP1	0x00200000	/* driver-dependant flag */
  #endif
  
  
>Audit-Trail:
>Unformatted: