"Fossies" - the Fresh Open Source Software Archive

Member "PPSkit-2.1.7/hardpps" (11 Oct 1996, 3761 Bytes) of package /linux/misc/old/PPSkit-2.1.7.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 Date sent:        Wed, 9 Oct 1996 19:21:27 -0400
    2 From:             "Theodore Y. Ts'o" <tytso@MIT.EDU>
    3 To:               "Ulrich Windl" <ulrich.windl@rz.uni-regensburg.de>
    4 Copies to:        "Theodore Y. Ts'o" <tytso@MIT.EDU>
    5 Subject:          Re: (Fwd) Re:  xntp3-5.8x and Linux
    6 
    7    From: "Ulrich Windl" <ulrich.windl@rz.uni-regensburg.de>
    8    Date: Fri, 4 Oct 1996 08:14:44 +0200
    9 
   10    If you'd send me a patch for 2.0.21, I'll try it on my one and only 
   11    machine.
   12 
   13 Here you go.... Note that HARDPPS is #ifdef'ed, mostly because hardpps()
   14 doesn't appear to be defined in the kernel anywhere --- at least, it's
   15 not in any header file.  Let me know what I need to include for
   16 hardpps(), and I'll modify my patches accordingly.  
   17 
   18 (Also, you'll need to set ASYNC_HARDPPS_CD; for right now, manually
   19 setting it in the serial structure is the fastest way to do that; I'll
   20 update setserial soon so you can use setserial to set that flag.)
   21 
   22 						- Ted
   23 
   24 
   25 ===================================================================
   26 RCS file: drivers/char/RCS/serial.c,v
   27 retrieving revision 1.1
   28 diff -u -r1.1 drivers/char/serial.c
   29 --- drivers/char/serial.c	1996/10/07 00:13:28	1.1
   30 +++ drivers/char/serial.c	1996/10/08 03:17:06
   31 @@ -252,7 +252,7 @@
   32   */
   33  static int baud_table[] = {
   34  	0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
   35 -	9600, 19200, 38400, 57600, 115200, 0 };
   36 +	9600, 19200, 38400, 57600, 115200, 230400, 460800, 0 };
   37  
   38  static inline unsigned int serial_in(struct async_struct *info, int offset)
   39  {
   40 @@ -486,8 +486,14 @@
   41  			info->icount.rng++;
   42  		if (status & UART_MSR_DDSR)
   43  			info->icount.dsr++;
   44 -		if (status & UART_MSR_DDCD)
   45 +		if (status & UART_MSR_DDCD) {
   46  			info->icount.dcd++;
   47 +#ifdef HARDPPS
   48 +			if ((info->flags & ASYNC_HARDPPS_CD) &&
   49 +			    (status & UART_MSR_DCD))
   50 +				hardpps();
   51 +#endif
   52 +		}
   53  		if (status & UART_MSR_DCTS)
   54  			info->icount.cts++;
   55  		wake_up_interruptible(&info->delta_msr_wait);
   56 @@ -1179,7 +1185,7 @@
   57  	i = cflag & CBAUD;
   58  	if (i & CBAUDEX) {
   59  		i &= ~CBAUDEX;
   60 -		if (i < 1 || i > 2) 
   61 +		if (i < 1 || i > 4) 
   62  			info->tty->termios->c_cflag &= ~CBAUDEX;
   63  		else
   64  			i += 15;
   65 @@ -1205,13 +1211,7 @@
   66  		quot = 0;
   67  		info->timeout = 0;
   68  	}
   69 -	if (quot) {
   70 -		info->MCR |= UART_MCR_DTR;
   71 -		info->MCR_noint |= UART_MCR_DTR;
   72 -		cli();
   73 -		serial_out(info, UART_MCR, info->MCR);
   74 -		sti();
   75 -	} else {
   76 +	if (!quot) {
   77  		info->MCR &= ~UART_MCR_DTR;
   78  		info->MCR_noint &= ~UART_MCR_DTR;
   79  		cli();
   80 @@ -1256,6 +1256,8 @@
   81  	
   82  	/* CTS flow control flag and modem status interrupts */
   83  	info->IER &= ~UART_IER_MSI;
   84 +	if (info->flags & ASYNC_HARDPPS_CD)
   85 +		info->IER |= UART_IER_MSI;
   86  	if (cflag & CRTSCTS) {
   87  		info->flags |= ASYNC_CTS_FLOW;
   88  		info->IER |= UART_IER_MSI;
   89 @@ -2097,7 +2099,15 @@
   90  	  return;
   91  
   92  	change_speed(info);
   93 -
   94 +	
   95 +	if (!(old_termios->c_cflag & CBAUD) &&
   96 +	    (tty->termios->c_cflag & CBAUD)) {
   97 +		info->MCR |= UART_MCR_DTR;
   98 +		info->MCR_noint |= UART_MCR_DTR;
   99 +		cli();
  100 +		serial_out(info, UART_MCR, info->MCR);
  101 +		sti();
  102 +	}
  103  	if ((old_termios->c_cflag & CRTSCTS) &&
  104  	    !(tty->termios->c_cflag & CRTSCTS)) {
  105  		tty->hw_stopped = 0;
  106 ===================================================================
  107 RCS file: include/linux/RCS/serial.h,v
  108 retrieving revision 1.1
  109 diff -u -r1.1 include/linux/serial.h
  110 --- include/linux/serial.h	1996/10/08 03:11:33	1.1
  111 +++ include/linux/serial.h	1996/10/08 03:12:55
  112 @@ -67,6 +67,8 @@
  113  #define ASYNC_PGRP_LOCKOUT    0x0200 /* Lock out cua opens based on pgrp */
  114  #define ASYNC_CALLOUT_NOHUP   0x0400 /* Don't do hangups for cua device */
  115  
  116 +#defnie ASYNC_HARDPPS_CD	0x0800	/* Call hardpps when CD goes high  */
  117 +
  118  #define ASYNC_FLAGS	0x0FFF	/* Possible legal async flags */
  119  #define ASYNC_USR_MASK 0x0430	/* Legal flags that non-privileged
  120  				 * users can set or reset */