您好,登錄后才能下訂單哦!
//0、pci子系統首先注冊pci?bus struct?bus_type?pci_bus_type?=?{ .name =?"pci", .match =?pci_bus_match, .uevent =?pci_uevent, .probe =?pci_device_probe, .remove =?pci_device_remove, .shutdown =?pci_device_shutdown, .dev_groups =?pci_dev_groups, .bus_groups =?pci_bus_groups, .drv_groups =?pci_drv_groups, .pm =?PCI_PM_OPS_PTR, .num_vf =?pci_bus_num_vf, }; EXPORT_SYMBOL(pci_bus_type); static?int?__init?pci_driver_init(void) { return?bus_register(&pci_bus_type); } postcore_initcall(pci_driver_init);/*?將初始化函數放到內核代碼特殊段,內核啟動將會自動調用初始化函數?*/ /*?設備的枚舉流程和設備的驅動的調用過程?*/ //1、pci控制器?設備樹節點將會配轉換成platform?device ???? pcie@3400000?{ compatible?=?"fsl,ls1021a-pcie",?"snps,dw-pcie"; .... ?????} //2、pci控制器匹配platform?driver static?const?struct?of_device_id?ls_pcie_of_match[]?=?{ {?.compatible?=?"fsl,ls1021a-pcie",?.data?=?&ls1021_drvdata?}, .. } static?struct?platform_driver?ls_pcie_driver?=?{ .driver?=?{ .name?=?"layerscape-pcie", .of_match_table?=?ls_pcie_of_match, .suppress_bind_attrs?=?true, }, }; builtin_platform_driver_probe(ls_pcie_driver,?ls_pcie_probe); //3、執行pci控制器驅動函數ls_pcie_probe函數將被調用,直到pci_bus_type.pci_device_probe被調用 ????????ls_add_pcie_port ????????????pci_bus_add_devices ????????????????pci_bus_add_device ????????????????????device_attach ????????????????????????__device_attach ????????????????????????????__device_attach_driver ????????????????????????????????driver_probe_device ????????????????????????????????????really_probe ????????????????????????????????????????dev->bus->probe//將調用pci_bus_type.pci_device_probe //4、枚舉pci設備調用設備驅動 ????pci_device_probe ????????__pci_device_probe ????????????pci_call_probe ???????????????local_pci_probe ???????????????????pci_drv->probe//設備的驅動的probe將被調用。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。