summaryrefslogtreecommitdiffstats
path: root/src/core/device.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-10 05:22:09 +0100
committerMichael Brown2007-01-10 05:22:09 +0100
commitdad52745227fd06090e73ea535e0b0fe0f667c60 (patch)
tree6be296bedc785a5aab0d055ae148c6ffb1fe285f /src/core/device.c
parentRemove uIP; we haven't used it for quite some time now. (diff)
downloadipxe-dad52745227fd06090e73ea535e0b0fe0f667c60.tar.gz
ipxe-dad52745227fd06090e73ea535e0b0fe0f667c60.tar.xz
ipxe-dad52745227fd06090e73ea535e0b0fe0f667c60.zip
Add "name" field to struct device to allow human-readable hardware device
names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
Diffstat (limited to 'src/core/device.c')
-rw-r--r--src/core/device.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 567d9015..b1b148e8 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -28,8 +28,10 @@
*
*/
-static struct root_device root_devices[0] __table_start ( root_devices );
-static struct root_device root_devices_end[0] __table_end ( root_devices );
+static struct root_device root_devices[0]
+ __table_start ( struct root_device, root_devices );
+static struct root_device root_devices_end[0]
+ __table_end ( struct root_device, root_devices );
/** Registered root devices */
static LIST_HEAD ( devices );
@@ -43,10 +45,10 @@ static LIST_HEAD ( devices );
static int rootdev_probe ( struct root_device *rootdev ) {
int rc;
- DBG ( "Adding %s root bus\n", rootdev->name );
+ DBG ( "Adding %s root bus\n", rootdev->dev.name );
if ( ( rc = rootdev->driver->probe ( rootdev ) ) != 0 ) {
DBG ( "Failed to add %s root bus: %s\n",
- rootdev->name, strerror ( rc ) );
+ rootdev->dev.name, strerror ( rc ) );
return rc;
}
@@ -60,7 +62,7 @@ static int rootdev_probe ( struct root_device *rootdev ) {
*/
static void rootdev_remove ( struct root_device *rootdev ) {
rootdev->driver->remove ( rootdev );
- DBG ( "Removed %s root bus\n", rootdev->name );
+ DBG ( "Removed %s root bus\n", rootdev->dev.name );
}
/**