Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Apr 1999 19:04:33 -0400
From:      "David E. Cross" <crossd@cs.rpi.edu>
To:        freebsd-hackers@freebsd.org
Subject:   device driver question
Message-ID:  <199904072304.TAA06730@cs.rpi.edu>

next in thread | raw e-mail | index | archive | help
As some of you know I have been writing a KLD SIO as a reference for a class.
I have the driver working fully *except* for one thing I cannot figure out.

The order of my driver initialization is as follows:

probe();  /*mostly a stub, just fills in some hard coded values */
attach(); /*init buffers, enable interupts */
connect_intr(); /*connect to the kernel intr routines */
siodev_intr(NULL); /*handle the race condition between attach()/connect_intr()*/
return 0; /* pass control back to the kernel */

that works OK, as far as I can tell, and it is just background information.

when the write() function of my driver is called, if 1: The old data buffer
had no data in it and 2: the UART is not busy sending any data then "prime"
the driver, so the interrupts will chain and it will send the entire buffer.
I have it print out the IIR (Interrupt Information Register) before it
primes the buffer, no interrupts pending.  at a later point I call write()
again, and again view the IIR.  It shows interupts, yet my handler was never
called!

Finally in desperation I put a "siodev_intr(NULL)" in the close routine, and
it works!  It processes that interrupt, exits.  and then is triggered again
by the kernel for an interrupt condition and sends all of the data (receives
too  since the device is in loopback mode).

Any ideas what I am missing?

--
David Cross


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904072304.TAA06730>