intpci_read_config_word(structpci_dev*pdev,intwhere, u8*val); intpci_read_config_dword(structpci_dev*pdev,intwhere, u8*val); 通过8位、16位或32位的数据传输访问配置空间。 从由pdev标识的设备空间读入一个、两个或四个字节的数据。 参数where是从配置空间起始位置计算的字节偏移量。 从配置空间获得...
pci_read_config_byte(dev, PCI_REVISION_ID, &revision); return revision; } 写配置空间 int pci_write_config_byte(struct pci_dev *dev, int where, u8 val); int pci_write_config_word(struct pci_dev *dev, int where, u16 val); int pci_write_config_dword(struct pci_dev *dev, int where...
pci_read_config_word(bridge, PCI_IO_BASE, &io); if (!io) { pci_write_config_word(bridge, PCI_IO_BASE, 0xf0f0); pci_read_config_word(bridge, PCI_IO_BASE, &io); pci_write_config_word(bridge, PCI_IO_BASE, 0x0); } if (io) b_res[0].flags |= IORESOURCE_IO; /* DECchip ...
pci_read_config_word(dev, PCI_COMMAND, &orig); toggle = orig ^ PCI_COMMAND_INTX_DISABLE; pci_write_config_word(dev, PCI_COMMAND, toggle); pci_read_config_word(dev, PCI_COMMAND, &new); pci_write_config_word(dev, PCI_COMMAND, orig); //PCI_COMMAND_INTX_DISABLE是预留位并在PCIr2.3版...
对于驱动程序而言,可通过8位,16位,32位的数据传输访问配置空间。相关函数定义在<linux/pci.h>中: int pci_read_config_byte(conststruct pci_dev *dev,intwhere, u8 *val);/*8位,读入一个字节*/ int pci_read_config_word(conststruct pci_dev *dev,intwhere, u16 *val);/*16位,读入两个字节*/ ...
pci_read_config_word(dev, PCI_COMMAND, &command); for (idx = 0; idx < PCI_ROM_RESOURCE; idx++) { r = &dev->resource[idx]; if (r->parent) /* Already allocated */ continue; if (!r->start) /* Address not assigned at all */ ...
对驱动而言,可通过8、16、32位数据传输访问配置空间。相关的函数定义在<linux/ pci.h>:中: int pci_read_config_byte(struct pci_dev*dev, int where, u8 *val); int pci_read_config_word(struct pci_dev *dev, int where, u16 *val);
intpci_read_config_dword(struct pci_dev *dev,intwhere, u32 *val); intpci_write_config_byte(struct pci_dev *dev,intwhere, u8 val); intpci_write_config_word(struct pci_dev *dev,intwhere, u16 val); intpci_write_config_dword(struct pci_dev *dev,intwhere, u32 val); ...
③read_config_byte,read_config_word,read_config_dword ④write_config_byte,write_config_word,write_config_dword 函数①的功能是:返回一个布尔值表明所运行的计算机是否具有支持PCI设备的能力;函数②的功能是:返回设备在总线上的位置及函数指针bus_number、device_function;函数③、④的功能是:通过调用该类函数,...
pci_read_config_dword(dev, dev->rom_base_reg, ®); pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE); } } } } 该函数遍历整个pci设备。如果该设备的相应空间已经启用了(I/O或者内存)。那在以0为参数调用的时候就让它分配好资源。对于没有被启用的资源。要等到...