From jin@iss-p1.lbl.gov Sat Oct  2 20:00:40 1999
Return-Path: <jin@iss-p1.lbl.gov>
Received: from iss-p1.lbl.gov (iss-p1.lbl.gov [131.243.2.47])
	by hub.freebsd.org (Postfix) with ESMTP id 7D76914D2C
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  2 Oct 1999 20:00:33 -0700 (PDT)
	(envelope-from jin@iss-p1.lbl.gov)
Received: (from jin@localhost)
	by iss-p1.lbl.gov (8.9.3/8.9.3) id UAA29855;
	Sat, 2 Oct 1999 20:00:31 -0700 (PDT)
	(envelope-from jin)
Message-Id: <199910030300.UAA29855@iss-p1.lbl.gov>
Date: Sat, 2 Oct 1999 20:00:31 -0700 (PDT)
From: Jin Guojun (FTG staff) <jin@iss-p1.lbl.gov>
Reply-To: j_guojun@lbl.gov
To: FreeBSD-gnats-submit@freebsd.org
Subject: parallel port -- ppi -- driver broken after 3.3-RELEASE
X-Send-Pr-Version: 3.2

>Number:         14096
>Category:       kern
>Synopsis:       parallel port -- ppi -- driver broken after 3.3-RELEASE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct  2 20:10:00 PDT 1999
>Closed-Date:    Mon Jul 9 16:58:58 PDT 2001
>Last-Modified:  Mon Jul 09 16:59:51 PDT 2001
>Originator:     Jin Guojun (FTG staff)
>Release:        FreeBSD 3.3-RELEASE i386
>Organization:
>Environment:

	FreeBSD 3.3-RELEASE or later
	All version prior to 3.3-RELEASE are OK

>Description:

	The ppi driver will return error "Error<22> Invalid argument"
	if I/O frequency is higher than 250 Hz. The version prior to
	3.3-RELEASE can do I/O at least 5000Hz without problem.
	This is repeatable problem.

 100 freq = 100.000000 : 0
 125 freq = 125.000000 : 0
 150 freq = 150.015002 : 0
 175 freq = 175.008750 : 0
 200 freq = 200.000000 : 0
 225 freq = 225.022502 : 0
 250 freq = 250.000000 : 0
 249 freq = 249.003984 : 0
 248 freq = 248.015873 : 0
act freq = 158.220191
 249 freq = 249.003984 : 0
 250 freq = 250.000000 : 0
act freq = 247.870888
 251 freq = 251.004016 : 0
 252 freq = 252.016129 : 0
act freq = 249.957130
? [NoVer] : ioc = 255; Error<22> Invalid argument
? [NoVer] : ioc = 0; Error<22> Invalid argument


>How-To-Repeat:

pio(int pp_fd, u_int8_t *c, bool in)	/* real code	*/
{
static int      errs;
u_int8_t        sval;
        ioctl(pp_fd, in ? PPIGDATA : PPISDATA, c);      
        if (errno && errno != EINTR)    {
                prgmerr(0, "ioc = %d", *c);
                if (errs++ > 2)	clean_up(-errs);
        }               
}                

main()		/* semi pesudo code	*/
{
u_int8_t	iob=0;
struct pioargu  tc;
u_thread_t      tid;

	/* create a thread to change the frequence timer	*/
	u_thread_create(&tid, 0, freq_input, &tc);

        Loop    { 
                pio(pd, &iob, 0);
                delay(tc.pio_tm.tv_sec, tc.pio_tm.tv_usec);
                iob = ~iob;
                pio(pd, &iob, 0);
                delay(tc.pio_tm.tv_sec, tc.pio_tm.tv_usec);
                iob = ~iob;
	}
	clean_up(-1);
}

>Fix:
	
	


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: iedowse 
State-Changed-When: Mon Jul 9 16:34:52 PDT 2001 
State-Changed-Why:  

Do you know if this is still a problem in more recent releases? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=14096 
State-Changed-From-To: feedback->closed 
State-Changed-By: iedowse 
State-Changed-When: Mon Jul 9 16:58:58 PDT 2001 
State-Changed-Why:  

Submitter says this has been fixed. Thanks for the quick response! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=14096 
>Unformatted:
