I got the answers to most of my questions except one thing. Would be glad if anyone can give some hint.
Here is what I understood (very briefly), please feel free to point out if I am wrong:
When system initializes, firmware scans for all the devices, assigns address regions and soon, then comes the driver registration phase where driver matching takes place, which finally calls the probe function (which can reassign the address regions, if wants to), I think IRQ configuration takes place here only. Once matched, we are done. Since it creates the id table in registration phase, these entries are stored in /lib/modules/KERNEL_NAME/modules.pcimap for user space hot plugging. When ever system detects the new device, kobject_hotplug invokes call_usermodehelper which invokes /sbin/hotplug with a input parameter PCI and environment variable describing the device. This /sbin/hotplug program then do the matching and we are done.
My question is, I looked at the probe.c whose functions (scan slot and scan bus) are used by the hotplug directory. I think what is happening here is, each of the core files define enable slot function which configures the device and use the functions in probe file. Then there is top file, pci_hotplug_core which calls this enable slot in power_write_file function. Can anyone please explain what is happening here ? and if hot-plugging is there via /sbin/hotplug ? why this ?
PS: Potentially, there is no device initialization phase for PCI (unlike net_dev_init defined in net/core/dev.c), since firmware BIOS already did that stuff. Am I right ?
Thanks in advance,
Best Regards
Kamal Kant Gupta