summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/visorchipset.c
diff options
context:
space:
mode:
authorPrarit Bhargava2015-05-06 00:36:16 +0200
committerGreg Kroah-Hartman2015-05-08 15:26:01 +0200
commit2ee0deec49bd1aded66bc7b017af35f8723ff9ef (patch)
treeb92bcd4f166b6bfa46acbf4757b3b7f555378031 /drivers/staging/unisys/visorbus/visorchipset.c
parentstaging: unisys: move visorchipset files to visorbus (diff)
downloadkernel-qcow2-linux-2ee0deec49bd1aded66bc7b017af35f8723ff9ef.tar.gz
kernel-qcow2-linux-2ee0deec49bd1aded66bc7b017af35f8723ff9ef.tar.xz
kernel-qcow2-linux-2ee0deec49bd1aded66bc7b017af35f8723ff9ef.zip
staging: unisys: cleanup visorbus_private.h
visorbus_private.h contains code that is called from visorbus into the visorchipset code. Now that the visorchipset code has been brought into the visorbus directory, many of the declarations are not necessary and can be cleaned up. TODO: PARSER_WHICH_STRING enum only has one member used (PARSERSTRING_NAME). TODO: crash_obj_type appears to be unnecessary in the overall scheme of code. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorbus/visorchipset.c')
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index f3a2145ac3ce..5bf8266f0663 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -49,6 +49,9 @@
#define POLLJIFFIES_CONTROLVMCHANNEL_SLOW 100
#define MAX_CONTROLVM_PAYLOAD_BYTES (1024*128)
+
+#define VISORCHIPSET_MMAP_CONTROLCHANOFFSET 0x00000000
+
/*
* Module parameters
*/
@@ -261,6 +264,9 @@ static void device_create_response(u32 bus_no, u32 dev_no, int response);
static void device_destroy_response(u32 bus_no, u32 dev_no, int response);
static void device_resume_response(u32 bus_no, u32 dev_no, int response);
+static void visorchipset_device_pause_response(u32 bus_no, u32 dev_no,
+ int response);
+
static struct visorchipset_busdev_responders busdev_responders = {
.bus_create = bus_create_response,
.bus_destroy = bus_destroy_response,
@@ -382,6 +388,8 @@ static void controlvm_respond_physdev_changestate(
struct spar_segment_state state);
+static void parser_done(struct parser_context *ctx);
+
static struct parser_context *
parser_init_guts(u64 addr, u32 bytes, bool local,
bool standard_payload_header, bool *retry)
@@ -527,8 +535,20 @@ parser_id_get(struct parser_context *ctx)
return phdr->id;
}
+/** Describes the state from the perspective of which controlvm messages have
+ * been received for a bus or device.
+ */
+
+enum PARSER_WHICH_STRING {
+ PARSERSTRING_INITIATOR,
+ PARSERSTRING_TARGET,
+ PARSERSTRING_CONNECTION,
+ PARSERSTRING_NAME, /* TODO: only PARSERSTRING_NAME is used ? */
+};
+
void
-parser_param_start(struct parser_context *ctx, PARSER_WHICH_STRING which_string)
+parser_param_start(struct parser_context *ctx,
+ enum PARSER_WHICH_STRING which_string)
{
struct spar_controlvm_parameters_header *phdr = NULL;
@@ -1032,6 +1052,12 @@ visorchipset_register_busdev_server(
}
EXPORT_SYMBOL_GPL(visorchipset_register_busdev_server);
+/** Register functions (in the bus driver) to get called by visorchipset
+ * whenever a bus or device appears for which this service partition is
+ * to be the server for. visorchipset will fill in <responders>, to
+ * indicate functions the bus driver should call to indicate message
+ * responses.
+ */
void
visorchipset_register_busdev_client(
struct visorchipset_busdev_notifiers *notifiers,
@@ -1175,6 +1201,11 @@ static void controlvm_respond_physdev_changestate(
}
}
+enum crash_obj_type {
+ CRASH_DEV,
+ CRASH_BUS,
+};
+
void
visorchipset_save_message(struct controlvm_message *msg,
enum crash_obj_type type)
@@ -1218,7 +1249,7 @@ visorchipset_save_message(struct controlvm_message *msg,
POSTCODE_SEVERITY_ERR);
return;
}
- } else {
+ } else { /* CRASH_DEV */
if (visorchannel_write(controlvm_channel,
crash_msg_offset +
sizeof(struct controlvm_message), msg,