From: Don Zickus <dzic...@redhat.com>

The visorbus driver has three _info structs lying around
(device, bus, channel) that store subsets of info from the
bigger structs.

Having these structs around make resource handling very difficult
and more complicated than it needs to be.  Use the device
infrastructure and instead pass 'struct visor_device' all
over the place.

In order to do that 'struct visor_device' needs to get smarter.
This patch adds the pieces to prep for it.  The new elements
will be used in later patches.

Signed-off-by: Don Zickus <dzic...@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.ro...@unisys.com>
---
 drivers/staging/unisys/include/visorbus.h          | 22 ++++++++++++++++++++++
 drivers/staging/unisys/visorbus/visorbus_private.h |  9 ---------
 drivers/staging/unisys/visorbus/visorchannel.c     |  4 ++++
 3 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index 6c551df..bba4825 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -37,12 +37,23 @@
 
 #include "periodic_work.h"
 #include "channel.h"
+#include "controlvmchannel.h"
+#include "vbuschannel.h"
 
 struct visor_driver;
 struct visor_device;
+extern struct bus_type visorbus_type;
 
 typedef void (*visorbus_state_complete_func) (struct visor_device *dev,
                                              int status);
+struct visorchipset_state {
+       u32 created:1;
+       u32 attached:1;
+       u32 configured:1;
+       u32 running:1;
+       /* Add new fields above. */
+       /* Remaining bits in this 32-bit word are unused. */
+};
 
 /** This struct describes a specific Supervisor channel, by providing its
  *  GUID, name, and sizes.
@@ -141,6 +152,17 @@ struct visor_device {
        bool resuming;
        unsigned long chipset_bus_no;
        unsigned long chipset_dev_no;
+       struct visorchipset_state state;
+       uuid_le type;
+       uuid_le inst;
+       u8 *name;
+       u8 *description;
+       struct controlvm_message_header pending_msg_hdr;
+       struct spar_vbus_headerinfo vbus_hdr_info;
+       u32 switch_no;
+       u32 internal_port_no;
+       uuid_le partition_uuid;
+       struct irq_info intr;
 };
 
 #define to_visor_device(x) container_of(x, struct visor_device, device)
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 8326e4d..bbc64bd 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -27,15 +27,6 @@
 
 struct visorchannel;
 
-struct visorchipset_state {
-       u32 created:1;
-       u32 attached:1;
-       u32 configured:1;
-       u32 running:1;
-       /* Add new fields above. */
-       /* Remaining bits in this 32-bit word are unused. */
-};
-
 enum visorchipset_addresstype {
        /** address is guest physical, but outside of the physical memory
         *  region that is controlled by the running OS (this is the normal
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 2d3e4d6..a9c3ae1 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -23,6 +23,7 @@
 #include "version.h"
 #include "visorbus.h"
 #include <linux/uuid.h>
+#include "controlvmchannel.h"
 
 #define MYDRVNAME "visorchannel"
 
@@ -44,6 +45,9 @@ struct visorchannel {
                struct signal_queue_header event_queue;
                struct signal_queue_header ack_queue;
        } safe_uis_queue;
+       struct irq_info intr;
+       uuid_le type;
+       uuid_le inst;
 };
 
 /* Creates the struct visorchannel abstraction for a data area in memory,
-- 
2.1.4

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to