Merge remote-tracking branch 'staging/staging-next'
[deliverable/linux.git] / drivers / staging / unisys / visorbus / visorbus_private.h
index 39edd20184531f89b4174f3abaaa12807e6dbb35..2f4e1e6071f50c9d491bd900b6c3205fab97a12f 100644 (file)
@@ -1,4 +1,4 @@
-/* visorchipset.h
+/* visorbus_private.h
  *
  * Copyright (C) 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
  * details.
  */
 
-#ifndef __VISORCHIPSET_H__
-#define __VISORCHIPSET_H__
+#ifndef __VISORBUS_PRIVATE_H__
+#define __VISORBUS_PRIVATE_H__
 
 #include <linux/uuid.h>
 
 #include "controlvmchannel.h"
-#include "vbusdeviceinfo.h"
-#include "vbushelper.h"
+#include "vbuschannel.h"
 
-/*  These functions will be called from within visorchipset when certain
- *  events happen.  (The implementation of these functions is outside of
- *  visorchipset.)
+/* TARGET_HOSTNAME specified as -DTARGET_HOSTNAME=\"thename\" on the
+ * command line
  */
-struct visorchipset_busdev_notifiers {
-       void (*bus_create)(struct visor_device *bus_info);
-       void (*bus_destroy)(struct visor_device *bus_info);
-       void (*device_create)(struct visor_device *bus_info);
-       void (*device_destroy)(struct visor_device *bus_info);
-       void (*device_pause)(struct visor_device *bus_info);
-       void (*device_resume)(struct visor_device *bus_info);
-};
 
-/*  These functions live inside visorchipset, and will be called to indicate
- *  responses to specific events (by code outside of visorchipset).
- *  For now, the value for each response is simply either:
- *       0 = it worked
- *      -1 = it failed
- */
-struct visorchipset_busdev_responders {
-       void (*bus_create)(struct visor_device *p, int response);
-       void (*bus_destroy)(struct visor_device *p, int response);
-       void (*device_create)(struct visor_device *p, int response);
-       void (*device_destroy)(struct visor_device *p, int response);
-       void (*device_pause)(struct visor_device *p, int response);
-       void (*device_resume)(struct visor_device *p, int response);
-};
+#define TARGET_HOSTNAME "linuxguest"
 
-/** Register functions (in the bus driver) to get called by visorchipset
- *  whenever a bus or device appears for which this guest is to be the
- *  client for.  visorchipset will fill in <responders>, to indicate
- *  functions the bus driver should call to indicate message responses.
- */
-void
-visorchipset_register_busdev(
-                       struct visorchipset_busdev_notifiers *notifiers,
-                       struct visorchipset_busdev_responders *responders,
-                       struct ultra_vbus_deviceinfo *driver_info);
+static inline void bus_device_info_init(
+               struct ultra_vbus_deviceinfo *bus_device_info_ptr,
+               const char *dev_type, const char *drv_name,
+               const char *ver, const char *ver_tag)
+{
+       memset(bus_device_info_ptr, 0, sizeof(struct ultra_vbus_deviceinfo));
+       snprintf(bus_device_info_ptr->devtype,
+                sizeof(bus_device_info_ptr->devtype),
+                "%s", (dev_type) ? dev_type : "unknownType");
+       snprintf(bus_device_info_ptr->drvname,
+                sizeof(bus_device_info_ptr->drvname),
+                "%s", (drv_name) ? drv_name : "unknownDriver");
+       snprintf(bus_device_info_ptr->infostrs,
+                sizeof(bus_device_info_ptr->infostrs), "%s\t%s\t%s",
+                (ver) ? ver : "unknownVer",
+                (ver_tag) ? ver_tag : "unknownVerTag",
+                TARGET_HOSTNAME);
+}
+
+void chipset_bus_create(struct visor_device *bus_info);
+void chipset_bus_destroy(struct visor_device *bus_info);
+void chipset_device_create(struct visor_device *dev_info);
+void chipset_device_destroy(struct visor_device *dev_info);
+void chipset_device_pause(struct visor_device *dev_info);
+void chipset_device_resume(struct visor_device *dev_info);
+
+void bus_create_response(struct visor_device *p, int response);
+void bus_destroy_response(struct visor_device *p, int response);
+void device_create_response(struct visor_device *p, int response);
+void device_destroy_response(struct visor_device *p, int response);
+void device_resume_response(struct visor_device *p, int response);
+void device_pause_response(struct visor_device *p, int response);
 
-/* visorbus init and exit functions */
 int visorbus_init(void);
 void visorbus_exit(void);
+
+/* visorchannel access functions */
+
+struct visorchannel *visorchannel_create(u64 physaddr,
+                                        unsigned long channel_bytes,
+                                        gfp_t gfp, uuid_le guid);
+struct visorchannel *visorchannel_create_with_lock(u64 physaddr,
+                                                  unsigned long channel_bytes,
+                                                  gfp_t gfp, uuid_le guid);
+void visorchannel_destroy(struct visorchannel *channel);
+int visorchannel_read(struct visorchannel *channel, ulong offset,
+                     void *local, ulong nbytes);
+int visorchannel_write(struct visorchannel *channel, ulong offset,
+                      void *local, ulong nbytes);
+u64 visorchannel_get_physaddr(struct visorchannel *channel);
+ulong visorchannel_get_nbytes(struct visorchannel *channel);
+char *visorchannel_id(struct visorchannel *channel, char *s);
+char *visorchannel_zoneid(struct visorchannel *channel, char *s);
+u64 visorchannel_get_clientpartition(struct visorchannel *channel);
+int visorchannel_set_clientpartition(struct visorchannel *channel,
+                                    u64 partition_handle);
+char *visorchannel_uuid_id(uuid_le *guid, char *s);
+void __iomem *visorchannel_get_header(struct visorchannel *channel);
 #endif
This page took 0.036138 seconds and 5 git commands to generate.