Hello,
I was researching material of the book "Linux device drivers, 3rd ed." and
got few questions.
1) the authors recommend to fill in 'dev->dev_addr' (where 'struct
net_device *dev') with proper MAC address in a interface open routine
(dev->open). Why can't we do this, say, in PCI probing function (as it's
done in rtl8139 driver)? Are there any limitations to do that?
2) why does 'struct net_device' contain hardware related fields, such as
irq, MMIO start/end address? We basically need this information only at
PCI/ISA device probing time, as far as I understand.
3) following from the 2) -- why do we have to request resources in interface
opening method (dev->open), if
irq etc. have been already assigned to structure members earlier, when code
initialized 'net_device' (for example, rtle8139 does it PCI probing
routine).
I'm confused with a way linux makes initializations and registrations, those
seem to be scattered throughout the code.
I would appreciate someone gives me more clear explanation. Thank you.
---
Best regards, Roman Mashak
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/