summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2010-12-04 22:32:00 +0100
committerMichael Brown2010-12-09 14:09:49 +0100
commit0620429785750c0ad8742adb3df527df77354b12 (patch)
tree4fe0e5df4ee277f9de7112cfb9a6ca88fb7cf17b
parent[cmdline] Add "reboot" command (diff)
downloadipxe-0620429785750c0ad8742adb3df527df77354b12.tar.gz
ipxe-0620429785750c0ad8742adb3df527df77354b12.tar.xz
ipxe-0620429785750c0ad8742adb3df527df77354b12.zip
[pxe] Avoid touching fields that may not exist in PXENV_UNDI_GET_NIC_TYPE
Earlier versions of the PXE specification do not have the SubVendor_ID and SubDevice_ID fields, and some NBPs may not provide space for them. Avoid overwriting the contents of these fields, just in case. This is similar to the problem with the BufferLimit field in PXENV_GET_CACHED_INFO. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/arch/i386/interface/pxe/pxe_undi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/arch/i386/interface/pxe/pxe_undi.c b/src/arch/i386/interface/pxe/pxe_undi.c
index fdc6f3e2..687f5e8f 100644
--- a/src/arch/i386/interface/pxe/pxe_undi.c
+++ b/src/arch/i386/interface/pxe/pxe_undi.c
@@ -561,12 +561,12 @@ PXENV_EXIT_t pxenv_undi_get_nic_type ( struct s_PXENV_UNDI_GET_NIC_TYPE
info->Sub_Class = PCI_SUB_CLASS ( dev->desc.class );
info->Prog_Intf = PCI_PROG_INTF ( dev->desc.class );
info->BusDevFunc = dev->desc.location;
- /* Cheat: remaining fields are probably unnecessary,
- * and would require adding extra code to pci.c.
+ /* Earlier versions of the PXE specification do not
+ * have the SubVendor_ID and SubDevice_ID fields. It
+ * is possible that some NBPs will not provide space
+ * for them, and so we must not fill them in.
*/
- undi_get_nic_type->info.pci.SubVendor_ID = 0xffff;
- undi_get_nic_type->info.pci.SubDevice_ID = 0xffff;
- DBG ( " PCI %02x:%02x.%x %04x:%04x (%04x:%04x) %02x%02x%02x "
+ DBG ( " PCI %02x:%02x.%x %04x:%04x ('%04x:%04x') %02x%02x%02x "
"rev %02x\n", PCI_BUS ( info->BusDevFunc ),
PCI_SLOT ( info->BusDevFunc ),
PCI_FUNC ( info->BusDevFunc ), info->Vendor_ID,