PCI_VDEVICE 和 PCI_DEVICE 有什么区别?

What is the difference between PCI_VDEVICE and PCI_DEVICE?

PCI_VDEVICE 和 PCI_DEVICE 宏有什么区别?

在内核内部工作时,代码实际上是文档。在这里,你是一个幸运的人,因为这两个宏都有记录(并非总是如此)。看起来它们是等价的,除了 PCI_VDEVICE 不那么冗长。

证明:

PCI_DEVICE

/**
 * PCI_DEVICE - macro used to describe a specific PCI device
 * @vend: the 16 bit PCI Vendor ID
 * @dev: the 16 bit PCI Device ID
 *
 * This macro is used to create a struct pci_device_id that matches a
 * specific device.  The subvendor and subdevice fields will be set to
 * PCI_ANY_ID.
 */

PCI_VDEVICE:

/**
 * PCI_VDEVICE - macro used to describe a specific PCI device in short form
 * @vend: the vendor name
 * @dev: the 16 bit PCI Device ID
 *
 * This macro is used to create a struct pci_device_id that matches a
 * specific PCI device.  The subvendor, and subdevice fields will be set
 * to PCI_ANY_ID. The macro allows the next field to follow as the device
 * private data.
 */