[usb] Add USB_ROM() and USB_ID() macros

Add USB_ROM() and USB_ID() macros following the pattern for PCI_ROM()
and PCI_ID(), to allow for the possibility of including USB network
devices within the "all-drivers" build of iPXE.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-02-11 15:19:13 +00:00
parent 481e043116
commit 4d6c8ab443
14 changed files with 66 additions and 266 deletions
+12
View File
@@ -1369,6 +1369,18 @@ struct usb_device_id {
unsigned long driver_data;
};
/* Define a USB device ID */
#define USB_ID( _vendor, _product, _name, _description, _data ) { \
.vendor = _vendor, \
.product = _product, \
.name = _name, \
.driver_data = _data \
}
/* Define a USB device ID with a corresponding build rule */
#define USB_ROM( _vendor, _product, _name, _description, _data ) \
USB_ID ( _vendor, _product, _name, _description, _data )
/** Match-anything ID */
#define USB_ANY_ID 0xffff