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
_______________________________________________
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel

Reply via email to