summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2015-05-05 18:36:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-08 15:26:01 +0200
commit2ee0deec49bd1aded66bc7b017af35f8723ff9ef (patch)
treeb92bcd4f166b6bfa46acbf4757b3b7f555378031 /drivers
parentc79b28f7332e54903f6c81ff1157cbd3bf761a17 (diff)
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')
-rw-r--r--drivers/staging/unisys/visorbus/visorbus_private.h57
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c35
2 files changed, 33 insertions, 59 deletions
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h
index 68d770f29115..a3d78f619d64 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -26,32 +26,7 @@
#include "vbusdeviceinfo.h"
#include "vbushelper.h"
-#define VISORCHIPSET_MMAP_CONTROLCHANOFFSET 0x00000000
-
-/** 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,
-};
-
struct visorchannel;
-struct parser_context *parser_init(u64 addr, u32 bytes, bool isLocal,
- bool *tryAgain);
-struct parser_context *parser_init_byte_stream(u64 addr, u32 bytes, bool local,
- bool *retry);
-void parser_param_start(struct parser_context *ctx,
- PARSER_WHICH_STRING which_string);
-void *parser_param_get(struct parser_context *ctx, char *nam, int namesize);
-void *parser_string_get(struct parser_context *ctx);
-uuid_le parser_id_get(struct parser_context *ctx);
-char *parser_simpleString_get(struct parser_context *ctx);
-void *parser_byte_stream_get(struct parser_context *ctx, unsigned long *nbytes);
-void parser_done(struct parser_context *ctx);
struct visorchipset_state {
u32 created:1;
@@ -75,11 +50,6 @@ enum visorchipset_addresstype {
ADDRTYPE_LOCALTEST,
};
-enum crash_obj_type {
- CRASH_DEV,
- CRASH_BUS,
-};
-
/** Attributes for a particular Supervisor channel.
*/
struct visorchipset_channel_info {
@@ -169,18 +139,6 @@ struct visorchipset_busdev_responders {
/** 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,
- struct visorchipset_busdev_responders *responders,
- struct ultra_vbus_deviceinfo *driver_info);
-
-/** 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 client for. visorchipset will fill in <responders>, to
* indicate functions the bus driver should call to indicate message
* responses.
@@ -191,26 +149,11 @@ visorchipset_register_busdev_server(
struct visorchipset_busdev_responders *responders,
struct ultra_vbus_deviceinfo *driver_info);
-void visorchipset_device_pause_response(u32 bus_no, u32 dev_no, int response);
-
bool visorchipset_get_bus_info(u32 bus_no,
struct visorchipset_bus_info *bus_info);
bool visorchipset_get_device_info(u32 bus_no, u32 dev_no,
struct visorchipset_device_info *dev_info);
bool visorchipset_set_bus_context(u32 bus_no, void *context);
-bool visorchipset_set_device_context(u32 bus_no, u32 dev_no, void *context);
-int visorchipset_chipset_ready(void);
-int visorchipset_chipset_selftest(void);
-int visorchipset_chipset_notready(void);
-void visorchipset_save_message(struct controlvm_message *msg,
- enum crash_obj_type type);
-void *visorchipset_cache_alloc(struct kmem_cache *pool,
- bool ok_to_block, char *fn, int ln);
-void visorchipset_cache_free(struct kmem_cache *pool, void *p,
- char *fn, int ln);
-int visorchipset_file_init(dev_t majorDev,
- struct visorchannel **pControlVm_channel);
-void visorchipset_file_cleanup(dev_t major_dev);
/* visorbus init and exit functions */
int __init visorbus_init(void);
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,