В чем разница между PCI_VDEVICE и PCI_DEVICE?

В чем разница между макросами PCI_VDEVICE и PCI_DEVICE?


person Itay Avraham    schedule 22.08.2019    source источник


Ответы (1)


При работе внутри ядра код фактически является документацией. Здесь вам повезло, так как оба макроса задокументированы (не всегда так). Похоже, что они эквивалентны, за исключением того, что 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.
 */
person Justin Iurman    schedule 22.08.2019