Re: bus_setup_intr() vs. ether_ifattach() race

2003-02-10 Thread Matthew N. Dodd
On Sun, 9 Feb 2003, Nate Lawson wrote:
> Which is the correct order to do these two functions?  If the irq is
> enabled before the device is attached, it seems a response cannot be
> sent if a packet arrives before the attach.  The right way seems to be
> to attach the device before setting up an irq but does this have side
> effects?

The interrupt handler should be checking IFF_UP.

The driver shouldn't enable card interrupts until if_init() has been run
and should disable them in it foo_stop() routine (or when the interface is
brought down, detached etc.)

-- 
| Matthew N. Dodd  | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD  |
| [EMAIL PROTECTED] |   2 x '84 Volvo 245DL| ix86,sparc,pmax |
| http://www.jurai.net/~winter |  For Great Justice!  | ISO8802.5 4ever |

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: bus_setup_intr() vs. ether_ifattach() race

2003-02-09 Thread Terry Lambert
Nate Lawson wrote:
> Which is the correct order to do these two functions?  If the irq is
> enabled before the device is attached, it seems a response cannot be sent
> if a packet arrives before the attach.  The right way seems to be to
> attach the device before setting up an irq but does this have side
> effects?

The main side effect is that probes that require IRQs in order
to determine if the device is there (e.g. AMD Lance, etc.)
will never be able to probe true, unless the interrupt is routed
to an IRQ handler.

On the other hand, it should probably not be the standard IRQ
handler that gets invoked, as a result of the probe, but one that
is specific to probing.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



bus_setup_intr() vs. ether_ifattach() race

2003-02-09 Thread Nate Lawson
Which is the correct order to do these two functions?  If the irq is
enabled before the device is attached, it seems a response cannot be sent
if a packet arrives before the attach.  The right way seems to be to
attach the device before setting up an irq but does this have side
effects?

-Nate


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message