包含PCI寄存器的符号名和几个供应商和设备ID值的头文件.
structpci_dev;
表示内核中一个PCI设备的结构.
structpci_driver;
代表一个PCI驱动的结构.所有的PCI驱动必须定义这个.
structpci_device_id;
描述这个驱动支持的PCI设备类型的结构.
intpci_register_driver(structpci_driver*drv);
intpci_module_init(structpci_driver*drv);
voidpci_unregister_driver(structpci_driver*drv);
从内核注册或注销一个PCI驱动的函数.
structpci_dev*pci_find_device(unsignedintvendor,unsignedintdevice,structpci_dev*from);
structpci_dev*pci_find_device_reverse(unsignedintvendor,unsignedintdevice,conststructpci_dev
*from);
structpci_dev*pci_find_subsys(unsignedintvendor,unsignedintdevice,unsignedintss_vendor,unsigned
intss_device,conststructpci_dev*from);
structpci_dev*pci_find_class(unsignedintclass,structpci_dev*from);
在设备列表中搜寻带有一个特定签名的设备,或者属于一个特定类的.返回值是NULL如果
没找到.from用来继续一个搜索;在你第一次调用任一个函数时它必须是NULL,并且它必须
指向刚刚找到的设备如果你寻找更多的设备.这些函数不推荐使用,用pci_get_变体来代替.
structpci_dev*pci_get_device(unsignedintvendor,unsignedintdevice,structpci_dev*from);
structpci_dev*pci_get_subsys(unsignedintvendor,unsignedintdevice,unsignedintss_vendor,unsigned
intss_device,structpci_dev*from);
structpci_dev*pci_get_slot(structpci_bus*bus,unsignedintdevfn);
在设备列表中搜索一个特定签名的设备,或者属于一个特定类.返回值是NULL如果没找到.
from用来继续一个搜索;在你第一次调用任一个函数时它必须是NULL,并且它必须指向刚
刚找到的设备如果你寻找更多的设备.返回的结构使它的引用计数递增,并且在调用者完成
它,函数pci_dev_put必须被调用.
intpci_read_config_byte(structpci_dev*dev,intwhere,u8*val);
intpci_read_config_word(structpci_dev*dev,intwhere,u16*val);
intpci_read_config_dword(structpci_dev*dev,intwhere,u32*val);
intpci_write_config_byte(structpci_dev*dev,intwhere,u8*val);
intpci_write_config_word(structpci_dev*dev,intwhere,u16*val);
intpci_write_config_dword(structpci_dev*dev,intwhere,u32*val);
读或写PCI配置寄存器的函数.尽管Linux内核负责字节序,程序员必须小心字节序当从单
个字节组合多字节值时.PCI总线是小端.
intpci_enable_device(structpci_dev*dev);
使能一个PCI设备.
unsignedlongpci_resource_start(structpci_dev*dev,intbar);
unsignedlongpci_resource_end(structpci_dev*dev,intbar);
unsignedlongpci_resource_flags(structpci_dev*dev,intbar);
处理PCI设备资源的函数.