Chinaunix首页 | 论坛 | 博客
  • 博客访问: 386377
  • 博文数量: 39
  • 博客积分: 1771
  • 博客等级: 上尉
  • 技术积分: 1231
  • 用 户 组: 普通用户
  • 注册时间: 2005-05-01 14:21
文章分类

全部博文(39)

文章存档

2013年(1)

2012年(4)

2011年(16)

2010年(6)

2009年(12)

分类: LINUX

2011-03-02 08:59:32

See "Understanding Linux Network Internals" 6.5 and "Documentation/driver-model/binding.txt" for the big picture.


Code path for device and driver binding(based on 2.6.38-rc6 source code).
pci_register_driver()/__pci_register_driver() => driver_register() => bus_add_driver() => driver_attach() => bus_for_each_dev() => __driver_attach() => driver_probe_device() => really_probe() => driver_bound()

In __driver_attach(), the match() function registered to pci bus will be invoked to check whether the driver matches the device. If so, driver_probe_device() will be invoked, which in turn invokes probe() function registered in bus or device driver. If probe() returns no error, driver_bound() will be invoked to bind the driver to the device.

TODO: How and when pci_register_driver() is called when a new pci device is hotplugged in?


References:
[KERNELSRC]/Documentation/driver-model/
阅读(1357) | 评论(0) | 转发(0) |
0

上一篇:milestone刷机笔记

下一篇:ubuntu tips

给主人留下些什么吧!~~