Re: [PATCH] starfire reads irq before pci_enable_device.

Jeff Garzik
2001-02-08T04:02:01Z

Manfred Spraul wrote:
>
> Jeff Garzik wrote:
> >
> > + SET_MODULE_OWNER(dev);
> >
> > irq = pdev->irq;
> >
>
> One question:
> The code copies 'pdev->irq' into 'dev->irq'.
>
> Is that required, who need 'dev->irq'?
>
> > retval = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev);
>
> Can't the driver use?
> retval = request_irq(np->pci_dev->irq)

Sure it can. A PCI driver can completely ignore dev->irq, if it so
desires. However...

Setting dev->irq is really a courtesy, because while the net core code
doesn't use it at all, it is reported to userspace such as ifconfig.
And because the netdev setup code could potentially assign a value to
dev->irq on its own, if the driver does -not- set dev->irq, the value
reported to userspace might incorrect instead of just being zero.

[side note - ifconfig only obtains the lower 16 bits of the
dev->base_addr value, grump grump]

Jeff

--
Jeff Garzik | "You see, in this world there's two kinds of
Building 1024 | people, my friend: Those with loaded guns
MandrakeSoft | and those who dig. You dig." --Blondie