[device] Remove unused next_sibling_ptr
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Thu, 30 Dec 2010 13:54:45 +0000 (08:54 -0500)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Thu, 30 Dec 2010 13:54:45 +0000 (08:54 -0500)
At long last.  Now WV_S_DEV_T contains a bus node so it
can be directly used to attach a device to a bus, as well
as getting the device from a node using CONTAINING_RECORD().

17 files changed:
src/aoe/bus.c
src/aoe/driver.c
src/aoe/protocol.c
src/include/device.h
src/winvblock/debug.c
src/winvblock/device.c
src/winvblock/disk/dev_ctl.c
src/winvblock/disk/disk.c
src/winvblock/disk/pnp.c
src/winvblock/disk/scsi.c
src/winvblock/driver.c
src/winvblock/filedisk/filedisk.c
src/winvblock/filedisk/grub4dos.c
src/winvblock/probe.c
src/winvblock/ramdisk/grub4dos.c
src/winvblock/ramdisk/memdisk.c
src/winvblock/ramdisk/ramdisk.c

index 830eb20..0445b20 100644 (file)
@@ -29,8 +29,8 @@
 #include "winvblock.h"
 #include "portable.h"
 #include "driver.h"
-#include "device.h"
 #include "bus.h"
+#include "device.h"
 #include "aoe.h"
 #include "mount.h"
 #include "debug.h"
@@ -136,7 +136,7 @@ winvblock__bool AoeBusCreate(void) {
 void AoeBusFree(void) {
     IoDeleteSymbolicLink(&AoeBusDosname_);
     IoDeleteDevice(AoeBusMain.Fdo);
-    WvBusRemoveNode(AoeBusMainDev_.BusNode);
+    WvBusRemoveNode(&AoeBusMainDev_.BusNode);
     return;
   }
 
index 758ae62..fd152c7 100644 (file)
 #include "wv_string.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
 #include "mount.h"
-#include "bus.h"
 #include "aoe.h"
 #include "registry.h"
 #include "protocol.h"
index 024f337..b2de863 100644 (file)
@@ -34,6 +34,7 @@
 #include "wv_string.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
 #include "mount.h"
index bf2b53e..db8f28e 100644 (file)
@@ -178,9 +178,7 @@ struct WV_DEV_T {
     /* Previous state of the device. */
     WV_E_DEV_STATE OldState;
     /* Support being a node on a bus. */
-    struct WV_BUS_NODE * BusNode;
-    /* The next device in the parent bus' devices.  TODO: Don't do this. */
-    WV_SP_DEV_T next_sibling_ptr;
+    WV_S_BUS_NODE BusNode;
     /* The device operations. */
     WV_S_DEV_OPS Ops;
     /* Points to further extensions. */
index 77bbb2e..974f606 100644 (file)
@@ -37,6 +37,7 @@
 #include "wv_stdlib.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
 #include "mount.h"
index 9f5b973..bb8baf9 100644 (file)
@@ -31,6 +31,7 @@
 #include "wv_stdlib.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "debug.h"
 
index 3f7791a..b0baddf 100644 (file)
@@ -37,6 +37,7 @@
 #include "winvblock.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
 #include "debug.h"
index 33ba58b..a47e017 100644 (file)
@@ -31,6 +31,7 @@
 #include "wv_stdlib.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
 #include "debug.h"
index c2b2170..f25dcc4 100644 (file)
@@ -33,9 +33,9 @@
 #include "wv_stdlib.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
-#include "bus.h"
 #include "debug.h"
 
 /* Forward declarations. */
index 4d11dda..f754cbf 100644 (file)
@@ -33,6 +33,7 @@
 #include "winvblock.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
 #include "debug.h"
index 298e962..17bc48d 100644 (file)
 #include "wv_string.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
 #include "registry.h"
 #include "mount.h"
-#include "bus.h"
 #include "filedisk.h"
 #include "ramdisk.h"
 #include "debug.h"
@@ -615,14 +615,7 @@ winvblock__lib_func winvblock__bool STDCALL WvDriverBusAddDev(
         DBG("PDO creation failed!\n");
         return FALSE;
       }
-    /* Create a node.  TODO: Put the node somewhere better. */
-    Dev->BusNode = wv_malloc(sizeof *(Dev->BusNode));
-    if (!Dev->BusNode) {
-        DBG("Couldn't allocate node storage!\n");
-        IoDeleteDevice(dev_obj);
-        return FALSE;
-      }
-    WvBusInitNode(Dev->BusNode, dev_obj);
+    WvBusInitNode(&Dev->BusNode, dev_obj);
     /* Associate the parent bus. */
     Dev->Parent = WvDriverBus_.Fdo;
     /*
@@ -632,8 +625,8 @@ winvblock__lib_func winvblock__bool STDCALL WvDriverBusAddDev(
     Dev->Ops.Init(Dev);
     dev_obj->Flags &= ~DO_DEVICE_INITIALIZING;
     /* Add the new PDO device to the bus' list of children. */
-    WvBusAddNode(&WvDriverBus_, Dev->BusNode);
-    Dev->DevNum = WvBusGetNodeNum(Dev->BusNode);
+    WvBusAddNode(&WvDriverBus_, &Dev->BusNode);
+    Dev->DevNum = WvBusGetNodeNum(&Dev->BusNode);
 
     DBG("Exit\n");
     return TRUE;
index be83860..1b6e5f7 100644 (file)
 #include "wv_stdlib.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
 #include "mount.h"
-#include "bus.h"
 #include "filedisk.h"
 #include "debug.h"
 
index e0dd3ac..db515eb 100644 (file)
@@ -32,9 +32,9 @@
 #include "wv_string.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
-#include "bus.h"
 #include "filedisk.h"
 #include "debug.h"
 #include "probe.h"
index 8182da0..6ddba1d 100644 (file)
 #include "wv_string.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
 #include "mount.h"
-#include "bus.h"
 #include "debug.h"
 #include "bus.h"
 #include "ramdisk.h"
index 53fbe0f..bf52c32 100644 (file)
@@ -30,9 +30,9 @@
 #include "wv_string.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
-#include "bus.h"
 #include "ramdisk.h"
 #include "debug.h"
 #include "probe.h"
index 4a55e76..f8d5344 100644 (file)
@@ -30,9 +30,9 @@
 #include "wv_string.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
-#include "bus.h"
 #include "ramdisk.h"
 #include "debug.h"
 #include "mdi.h"
index 21fb440..4a8e535 100644 (file)
@@ -30,6 +30,7 @@
 #include "wv_stdlib.h"
 #include "portable.h"
 #include "driver.h"
+#include "bus.h"
 #include "device.h"
 #include "disk.h"
 #include "ramdisk.h"