summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/drivers/net/undionly.c
diff options
context:
space:
mode:
authorMichael Brown2011-10-28 23:51:38 +0200
committerMichael Brown2011-10-28 23:52:55 +0200
commita1f618c6257b86db7e623b1263b3e95040e78697 (patch)
treeebb6419c3335318cd413a3c75d0e3d0008a589c3 /src/arch/i386/drivers/net/undionly.c
parent[undi] Use current (rather than permanent) link-layer address (diff)
downloadipxe-a1f618c6257b86db7e623b1263b3e95040e78697.tar.gz
ipxe-a1f618c6257b86db7e623b1263b3e95040e78697.tar.xz
ipxe-a1f618c6257b86db7e623b1263b3e95040e78697.zip
[undi] Use meaningful driver and device names
Specify a driver name of "undionly" and a device name based on the UNDI-reported underlying hardware device. For example: net0: 52:54:00:12:34:56 using undionly on UNDI-PCI00:03.0 (open) Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386/drivers/net/undionly.c')
-rw-r--r--src/arch/i386/drivers/net/undionly.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/arch/i386/drivers/net/undionly.c b/src/arch/i386/drivers/net/undionly.c
index c38b574d..a0012c88 100644
--- a/src/arch/i386/drivers/net/undionly.c
+++ b/src/arch/i386/drivers/net/undionly.c
@@ -20,9 +20,11 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <stdint.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include <ipxe/device.h>
#include <ipxe/init.h>
+#include <ipxe/pci.h>
#include <undi.h>
#include <undinet.h>
#include <undipreload.h>
@@ -62,15 +64,21 @@ static int undibus_probe ( struct root_device *rootdev ) {
}
/* Add to device hierarchy */
- strncpy ( undi->dev.name, "UNDI",
- ( sizeof ( undi->dev.name ) - 1 ) );
+ undi->dev.driver_name = "undionly";
if ( undi->pci_busdevfn != UNDI_NO_PCI_BUSDEVFN ) {
undi->dev.desc.bus_type = BUS_TYPE_PCI;
undi->dev.desc.location = undi->pci_busdevfn;
undi->dev.desc.vendor = undi->pci_vendor;
undi->dev.desc.device = undi->pci_device;
+ snprintf ( undi->dev.name, sizeof ( undi->dev.name ),
+ "UNDI-PCI%02x:%02x.%x",
+ PCI_BUS ( undi->pci_busdevfn ),
+ PCI_SLOT ( undi->pci_busdevfn ),
+ PCI_FUNC ( undi->pci_busdevfn ) );
} else if ( undi->isapnp_csn != UNDI_NO_ISAPNP_CSN ) {
undi->dev.desc.bus_type = BUS_TYPE_ISAPNP;
+ snprintf ( undi->dev.name, sizeof ( undi->dev.name ),
+ "UNDI-ISAPNP" );
}
undi->dev.parent = &rootdev->dev;
list_add ( &undi->dev.siblings, &rootdev->dev.children);