pci调制解调器驱动

lPci驱动注册

Pci_register_driver(structpci_driver*drv)

Staticstructpci_driverpci_driver={

.name=DRV_NAME,

.id_table=pci_pci_tbl,

.probe=pci_init_one,

.remove=_devexit_p(pci_remove_one),

};

lPci配置空间

Pci_read_config_byte/word/dword(structpci_dev*pdev,intoffset,int*value)

Pci_write_config_byte/word/dword(structpci_dev*pdev,intoffset,int*value)

lPci的I/O和内存空间

Pci_resource_start(structpci_dev*dev,intbar)bar的范围0-5;功能:从配置区相应寄存器得到I/O区域的基址

Pci_resource_length(structpci_dev*dev,intbar)bar的范围0-5;功能:从配置区相应寄存器得到I/O区域的内存区域长度

Request_mem_fegion(io_base,length,name)申请I/O端口

Request_mem_region(io_base,length,name)释放I/O端口

Pci_enable_device启用设备的I/O

Pci_set_master设定设备工作在总线主设备模式

tags:
Copyright Your xseozz.com Some Rights Reserved.
Powered By Z-BlogPHP.