Subject: Re: PPS diffs, round #4
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 04/22/1998 08:09:22
At 02:09 AM 4/22/98 , Jonathan Stone wrote:
>
>This does the timespec thing, tho' using the dreaded a local temp
>rather than a kludgy pointer cast. Since the API is more general
>than just PPS,  i changed the softc names too.
>
>Getting close to something we can commit?

Closer.  You only want to set the timestamp state if the switch
was successful.

>+ 
>+ 	case TIOCSTSTAMP:
>+ 		/* 
>+ 		* Compute msr masks from user-specified timestamp state.

>+ 		*/
>+ 		switch (sc->sc_timestamp_state) {
>+ 		case PPS_NONE:
>+ 			sc->sc_ppsmask = 0;
>+ 			sc->sc_ppsedge = 0;
>+ 			break;
>+ 	
>+ 		case PPS_DCD_LEADING_EDGE:
>+ 			sc->sc_ppsedge = MSR_DCD;
>+ 			sc->sc_ppsmask = MSR_DCD;
>+ 			break;
>+ 	
>+ 		case PPS_DCD_TRAILING_EDGE:
>+ 			sc->sc_ppsedge = 0;
>+ 			sc->sc_ppsmask = MSR_DCD;
>+ 			break;
>+ 	
>+ 		default:
>+ 			error = EINVAL;
>+ 			break;
>+ 		}

         if (error == 0)

>+ 		sc->sc_timestamp_state = *(int*) data;
>+ 		break;
>+ 
>+ 	
-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Nashua, NH                Disclaimer: I disavow all knowledge of this message