Bug 14096

Summary: parallel port -- ppi -- driver broken after 3.3-RELEASE
Product: Base System Reporter: Jin Guojun <jin>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-RELEASE   
Hardware: Any   
OS: Any   

Description Jin Guojun 1999-10-03 04:10:00 UTC
	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);
}
Comment 1 iedowse freebsd_committer freebsd_triage 2001-07-10 00:34:52 UTC
State Changed
From-To: open->feedback


Do you know if this is still a problem in more recent releases?
Comment 2 iedowse freebsd_committer freebsd_triage 2001-07-10 00:58:58 UTC
State Changed
From-To: feedback->closed


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