[bus] Rename device member to Dev
authorShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sun, 19 Dec 2010 07:36:39 +0000 (02:36 -0500)
committerShao Miller <Shao.Miller@yrdsb.edu.on.ca>
Sun, 19 Dec 2010 07:36:39 +0000 (02:36 -0500)
src/aoe/bus.c
src/include/bus.h
src/winvblock/bus/bus.c
src/winvblock/disk/pnp.c
src/winvblock/driver.c

index f4a88d0..aee0551 100644 (file)
@@ -100,7 +100,7 @@ winvblock__bool aoe_bus__create(void) {
         goto err_new_bus;
       }
     /* When the PDO is created, we need to handle PnP ID queries. */
-    new_bus->device->ops.pnp_id = aoe_bus__pnp_id_;
+    new_bus->Dev->ops.pnp_id = aoe_bus__pnp_id_;
     /* Name the bus when the PDO is created. */
     RtlInitUnicodeString(
         &new_bus->dev_name,
@@ -112,7 +112,7 @@ winvblock__bool aoe_bus__create(void) {
       );
     new_bus->named = TRUE;
     /* Add it as a sub-bus to WinVBlock. */
-    if (!WvBusAddChild(driver__bus(), new_bus->device)) {
+    if (!WvBusAddChild(driver__bus(), new_bus->Dev)) {
         DBG("Couldn't add AoE bus to WinVBlock bus!\n");
         goto err_add_child;
       }
@@ -122,7 +122,7 @@ winvblock__bool aoe_bus__create(void) {
 
     err_add_child:
 
-    device__free(new_bus->device);
+    device__free(new_bus->Dev);
     err_new_bus:
 
     return FALSE;
@@ -136,11 +136,11 @@ void aoe_bus__free(void) {
 
     IoDeleteSymbolicLink(&aoe_bus->dos_dev_name);
     IoDeleteSymbolicLink(&aoe_bus->dev_name);
-    IoDeleteDevice(aoe_bus->device->Self);
+    IoDeleteDevice(aoe_bus->Dev->Self);
     #if 0
-    bus__remove_child(driver__bus(), aoe_bus->device);
+    bus__remove_child(driver__bus(), aoe_bus->Dev);
     #endif
-    device__free(aoe_bus->device);
+    device__free(aoe_bus->Dev);
     return;
   }
 
index 123b6da..6311127 100644 (file)
@@ -40,7 +40,7 @@ typedef WV_F_BUS_THREAD * WV_FP_BUS_THREAD;
 
 /* The bus type. */
 typedef struct WV_BUS_T {
-    struct device__type * device;
+    struct device__type * Dev;
     PDEVICE_OBJECT LowerDeviceObject;
     PDEVICE_OBJECT PhysicalDeviceObject;
     winvblock__uint32 Children;
index 9922a07..722b865 100644 (file)
@@ -107,7 +107,7 @@ winvblock__lib_func winvblock__bool STDCALL WvBusAddChild(
         return FALSE;
       }
 
-    dev_ptr->Parent = bus_ptr->device->Self;
+    dev_ptr->Parent = bus_ptr->Dev->Self;
     /*
      * Initialize the device.  For disks, this routine is responsible for
      * determining the disk's geometry appropriately for AoE/RAM/file disks.
@@ -252,11 +252,11 @@ static winvblock__bool STDCALL bus__init_(IN struct device__type * dev) {
  * @v bus               Points to the bus to initialize with defaults.
  */
 winvblock__lib_func void WvBusInit(WV_SP_BUS_T bus) {
-    struct device__type * dev = bus->device;
+    struct device__type * dev = bus->Dev;
 
     RtlZeroMemory(bus, sizeof *bus);
     /* Populate non-zero bus device defaults. */
-    bus->device = dev;
+    bus->Dev = dev;
     bus->prev_free = dev->ops.free;
     bus->thread = bus__default_thread_;
     KeInitializeSpinLock(&bus->SpinLock);
@@ -297,7 +297,7 @@ winvblock__lib_func WV_SP_BUS_T WvBusCreate(void) {
     if (bus == NULL)
       goto err_no_bus;
 
-    bus->device = dev;
+    bus->Dev = dev;
     WvBusInit(bus);
     return bus;
 
@@ -529,7 +529,7 @@ static void STDCALL bus__default_thread_(IN WV_SP_BUS_T bus) {
     timeout.QuadPart = -300000000LL;
 
     /* Hook device__type::ops.free() */
-    bus->device->ops.free = bus__thread_free_;
+    bus->Dev->ops.free = bus__thread_free_;
 
     /* When bus::thread is cleared, we shut down. */
     while (bus->thread) {
@@ -549,7 +549,7 @@ static void STDCALL bus__default_thread_(IN WV_SP_BUS_T bus) {
         WvBusProcessWorkItems(bus);
       } /* while bus->alive */
 
-    bus__free_(bus->device);
+    bus__free_(bus->Dev);
     return;
   }
 
@@ -631,7 +631,7 @@ winvblock__lib_func NTSTATUS STDCALL WvBusAddNode(
     if (
         !Bus ||
         !Node ||
-        Bus->device->Self->DriverObject != Node->BusPrivate_.Pdo->DriverObject
+        Bus->Dev->Self->DriverObject != Node->BusPrivate_.Pdo->DriverObject
       )
       return STATUS_INVALID_PARAMETER;
 
index 0777819..73bf3e6 100644 (file)
@@ -224,7 +224,7 @@ static NTSTATUS STDCALL disk_pnp__query_capabilities_(
           );
       } else {
         status = WvBusGetDevCapabilities(
-            bus->device->Self,
+            bus->Dev->Self,
             &ParentDeviceCapabilities
           );
       }      
index e45915e..84bf0b4 100644 (file)
@@ -179,8 +179,8 @@ static NTSTATUS STDCALL driver__attach_fdo_(
         goto err_dos_symlink;
       }
     /* Set associations for the bus, device, FDO, PDO. */
-    device__set(fdo, bus->device);
-    bus->device->Self = fdo;
+    device__set(fdo, bus->Dev);
+    bus->Dev->Self = fdo;
     bus->PhysicalDeviceObject = PhysicalDeviceObject;
     fdo->Flags |= DO_DIRECT_IO;         /* FIXME? */
     fdo->Flags |= DO_POWER_INRUSH;      /* FIXME? */
@@ -228,7 +228,7 @@ static NTSTATUS STDCALL driver__attach_fdo_(
     IoDeleteDevice(fdo);
     err_fdo:
 
-    device__free(bus->device);
+    device__free(bus->Dev);
     err_bus:
 
     err_already_established: