From owner-freebsd-hackers Wed Apr 7 16: 6:47 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from cs.rpi.edu (mumble.cs.rpi.edu [128.213.8.16]) by hub.freebsd.org (Postfix) with ESMTP id 5CAD8158AD for ; Wed, 7 Apr 1999 16:06:39 -0700 (PDT) (envelope-from crossd@cs.rpi.edu) Received: from cs.rpi.edu (monica.cs.rpi.edu [128.213.7.2]) by cs.rpi.edu (8.9.1/8.9.1) with ESMTP id TAA06730 for ; Wed, 7 Apr 1999 19:04:34 -0400 (EDT) Message-Id: <199904072304.TAA06730@cs.rpi.edu> To: freebsd-hackers@freebsd.org Subject: device driver question Date: Wed, 07 Apr 1999 19:04:33 -0400 From: "David E. Cross" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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