[ipxe-devel] [PATCH 4/4] [virtio] Add virtio-net 1.0 support

Michael Brown mcb30 at ipxe.org
Thu Mar 10 16:46:25 UTC 2016


On 10/03/16 14:52, Ladi Prosek wrote:
>>> +static int virtnet_probe ( struct pci_device *pci ) {
>>> +     int rc = virtnet_probe_modern ( pci );
>>> +     if ( rc == -ENODEV ) {
>>> +             /* fall back to the legacy probe */
>>> +             rc = virtnet_probe_legacy ( pci );
>>> +     }
>>> +     return rc;
>>> +}

Please find a way to do this that doesn't involve testing the error 
return status.  (Error values in iPXE vary depending on the file, and so 
checks for specific error values may break if code is refactored into 
multiple files in future.)

If the PCI device ID is sufficient to differentiate between 
legacy/modern, then the easiest change is probably to use the 
id->driver_data field; see e.g. INTEL_PBS_ERRATA in drivers/net/intel.c.

Michael



More information about the ipxe-devel mailing list