staging: unisys: remove typedef from CONTROLVM_MESSAGE

Remove the typedef and use struct controlvm_message instead. Update all
references.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Benjamin Romer 2014-10-23 14:30:31 -04:00 committed by Greg Kroah-Hartman
parent f676054dd8
commit 3ab4770129
5 changed files with 68 additions and 65 deletions

View File

@ -337,10 +337,10 @@ struct controlvm_message_packet {
};
/* All messages in any ControlVm queue have this layout. */
typedef struct _CONTROLVM_MESSAGE {
struct controlvm_message {
struct controlvm_message_header hdr;
struct controlvm_message_packet cmd;
} CONTROLVM_MESSAGE;
};
typedef struct _DEVICE_MAP {
GUEST_PHYSICAL_ADDRESS DeviceChannelAddress;
@ -447,19 +447,19 @@ typedef struct _ULTRA_CONTROLVM_CHANNEL_PROTOCOL {
* Control events */
/* Request fixed-size message pool - does not include payload */
CONTROLVM_MESSAGE RequestMsg[CONTROLVM_MESSAGE_MAX];
struct controlvm_message RequestMsg[CONTROLVM_MESSAGE_MAX];
/* Response fixed-size message pool - does not include payload */
CONTROLVM_MESSAGE ResponseMsg[CONTROLVM_MESSAGE_MAX];
struct controlvm_message ResponseMsg[CONTROLVM_MESSAGE_MAX];
/* Event fixed-size message pool - does not include payload */
CONTROLVM_MESSAGE EventMsg[CONTROLVM_MESSAGE_MAX];
struct controlvm_message EventMsg[CONTROLVM_MESSAGE_MAX];
/* Ack fixed-size message pool - does not include payload */
CONTROLVM_MESSAGE EventAckMsg[CONTROLVM_MESSAGE_MAX];
struct controlvm_message EventAckMsg[CONTROLVM_MESSAGE_MAX];
/* Message stored during IOVM creation to be reused after crash */
CONTROLVM_MESSAGE SavedCrashMsg[CONTROLVM_CRASHMSG_MAX];
struct controlvm_message SavedCrashMsg[CONTROLVM_CRASHMSG_MAX];
} ULTRA_CONTROLVM_CHANNEL_PROTOCOL;
/* Offsets for VM channel attributes... */

View File

@ -121,9 +121,9 @@ static const struct file_operations debugfs_info_fops = {
};
static void
init_msg_header(CONTROLVM_MESSAGE *msg, u32 id, uint rsp, uint svr)
init_msg_header(struct controlvm_message *msg, u32 id, uint rsp, uint svr)
{
memset(msg, 0, sizeof(CONTROLVM_MESSAGE));
memset(msg, 0, sizeof(struct controlvm_message));
msg->hdr.id = id;
msg->hdr.flags.response_expected = rsp;
msg->hdr.flags.server = svr;
@ -154,7 +154,7 @@ Away:
}
static int
create_bus(CONTROLVM_MESSAGE *msg, char *buf)
create_bus(struct controlvm_message *msg, char *buf)
{
u32 busNo, deviceCount;
struct bus_info *tmp, *bus;
@ -272,7 +272,7 @@ create_bus(CONTROLVM_MESSAGE *msg, char *buf)
}
static int
destroy_bus(CONTROLVM_MESSAGE *msg, char *buf)
destroy_bus(struct controlvm_message *msg, char *buf)
{
int i;
struct bus_info *bus, *prev = NULL;
@ -345,7 +345,7 @@ remove:
}
static int
create_device(CONTROLVM_MESSAGE *msg, char *buf)
create_device(struct controlvm_message *msg, char *buf)
{
struct device_info *dev;
struct bus_info *bus;
@ -544,7 +544,7 @@ Away:
}
static int
pause_device(CONTROLVM_MESSAGE *msg)
pause_device(struct controlvm_message *msg)
{
u32 busNo, devNo;
struct bus_info *bus;
@ -612,7 +612,7 @@ pause_device(CONTROLVM_MESSAGE *msg)
}
static int
resume_device(CONTROLVM_MESSAGE *msg)
resume_device(struct controlvm_message *msg)
{
u32 busNo, devNo;
struct bus_info *bus;
@ -681,7 +681,7 @@ resume_device(CONTROLVM_MESSAGE *msg)
}
static int
destroy_device(CONTROLVM_MESSAGE *msg, char *buf)
destroy_device(struct controlvm_message *msg, char *buf)
{
u32 busNo, devNo;
struct bus_info *bus;
@ -769,7 +769,7 @@ destroy_device(CONTROLVM_MESSAGE *msg, char *buf)
}
static int
init_chipset(CONTROLVM_MESSAGE *msg, char *buf)
init_chipset(struct controlvm_message *msg, char *buf)
{
POSTCODE_LINUX_2(CHIPSET_INIT_ENTRY_PC, POSTCODE_SEVERITY_INFO);
@ -796,7 +796,7 @@ init_chipset(CONTROLVM_MESSAGE *msg, char *buf)
static int
delete_bus_glue(u32 busNo)
{
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
init_msg_header(&msg, CONTROLVM_BUS_DESTROY, 0, 0);
msg.cmd.destroy_bus.bus_no = busNo;
@ -810,7 +810,7 @@ delete_bus_glue(u32 busNo)
static int
delete_device_glue(u32 busNo, u32 devNo)
{
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
init_msg_header(&msg, CONTROLVM_DEVICE_DESTROY, 0, 0);
msg.cmd.destroy_device.bus_no = busNo;
@ -827,7 +827,7 @@ int
uislib_client_inject_add_bus(u32 bus_no, uuid_le inst_uuid,
u64 channel_addr, ulong n_channel_bytes)
{
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
LOGINF("enter busNo=0x%x\n", bus_no);
/* step 0: init the chipset */
@ -885,7 +885,7 @@ EXPORT_SYMBOL_GPL(uislib_client_inject_del_bus);
int
uislib_client_inject_pause_vhba(u32 bus_no, u32 dev_no)
{
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
int rc;
init_msg_header(&msg, CONTROLVM_DEVICE_CHANGESTATE, 0, 0);
@ -905,7 +905,7 @@ EXPORT_SYMBOL_GPL(uislib_client_inject_pause_vhba);
int
uislib_client_inject_resume_vhba(u32 bus_no, u32 dev_no)
{
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
int rc;
init_msg_header(&msg, CONTROLVM_DEVICE_CHANGESTATE, 0, 0);
@ -929,7 +929,7 @@ uislib_client_inject_add_vhba(u32 bus_no, u32 dev_no,
int is_test_addr, uuid_le inst_uuid,
struct irq_info *intr)
{
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
LOGINF(" enter busNo=0x%x devNo=0x%x\n", bus_no, dev_no);
/* chipset init'ed with bus bus has been previously created -
@ -988,7 +988,7 @@ uislib_client_inject_add_vnic(u32 bus_no, u32 dev_no,
int is_test_addr, uuid_le inst_uuid,
struct irq_info *intr)
{
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
LOGINF(" enter busNo=0x%x devNo=0x%x\n", bus_no, dev_no);
/* chipset init'ed with bus bus has been previously created -
@ -1038,7 +1038,7 @@ EXPORT_SYMBOL_GPL(uislib_client_inject_add_vnic);
int
uislib_client_inject_pause_vnic(u32 bus_no, u32 dev_no)
{
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
int rc;
init_msg_header(&msg, CONTROLVM_DEVICE_CHANGESTATE, 0, 0);
@ -1058,7 +1058,7 @@ EXPORT_SYMBOL_GPL(uislib_client_inject_pause_vnic);
int
uislib_client_inject_resume_vnic(u32 bus_no, u32 dev_no)
{
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
int rc;
init_msg_header(&msg, CONTROLVM_DEVICE_CHANGESTATE, 0, 0);
@ -1089,7 +1089,7 @@ uislib_client_add_vnic(u32 busNo)
BOOL busCreated = FALSE;
int devNo = 0; /* Default to 0, since only one device
* will be created for this bus... */
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
init_msg_header(&msg, CONTROLVM_BUS_CREATE, 0, 0);
msg.hdr.flags.test_message = 1;
@ -1137,7 +1137,7 @@ uislib_client_delete_vnic(u32 busNo)
{
int devNo = 0; /* Default to 0, since only one device
* will be created for this bus... */
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
init_msg_header(&msg, CONTROLVM_DEVICE_DESTROY, 0, 0);
msg.hdr.flags.test_message = 1;
@ -1563,7 +1563,7 @@ uislib_mod_init(void)
LOGINF("sizeof(uiscmdrsp_net):%lu\n",
(ulong) sizeof(struct uiscmdrsp_net));
LOGINF("sizeof(CONTROLVM_MESSAGE):%lu bytes\n",
(ulong) sizeof(CONTROLVM_MESSAGE));
(ulong) sizeof(struct controlvm_message));
LOGINF("sizeof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL):%lu bytes\n",
(ulong) sizeof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL));
LOGINF("sizeof(CHANNEL_HEADER):%lu bytes\n",

View File

@ -23,8 +23,9 @@
#include "globals.h"
#include "controlvmchannel.h"
void test_produce_test_message(CONTROLVM_MESSAGE *msg, int isLocalTestAddr);
BOOL test_consume_test_message(CONTROLVM_MESSAGE *msg);
void test_produce_test_message(struct controlvm_message *msg,
int isLocalTestAddr);
BOOL test_consume_test_message(struct controlvm_message *msg);
void test_manufacture_vnic_client_add(void *p);
void test_manufacture_vnic_client_add_phys(HOSTADDRESS addr);
void test_manufacture_preamble_messages(void);

View File

@ -267,7 +267,7 @@ visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
VISORCHIPSET_BUSDEV_RESPONDERS *responders,
struct ultra_vbus_deviceinfo *driverInfo);
typedef void (*SPARREPORTEVENT_COMPLETE_FUNC) (CONTROLVM_MESSAGE *msg,
typedef void (*SPARREPORTEVENT_COMPLETE_FUNC) (struct controlvm_message *msg,
int status);
void visorchipset_device_pause_response(ulong busNo, ulong devNo, int response);
@ -285,9 +285,10 @@ BOOL visorchipset_set_device_context(ulong busNo, ulong devNo, void *context);
int visorchipset_chipset_ready(void);
int visorchipset_chipset_selftest(void);
int visorchipset_chipset_notready(void);
void visorchipset_controlvm_respond_reportEvent(CONTROLVM_MESSAGE *msg,
void visorchipset_controlvm_respond_reportEvent(struct controlvm_message *msg,
void *payload);
void visorchipset_save_message(CONTROLVM_MESSAGE *msg, CRASH_OBJ_TYPE type);
void visorchipset_save_message(struct controlvm_message *msg,
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,

View File

@ -72,7 +72,7 @@ static struct workqueue_struct *Periodic_controlvm_workqueue;
static DEFINE_SEMAPHORE(NotifierLock);
typedef struct {
CONTROLVM_MESSAGE message;
struct controlvm_message message;
unsigned int crc;
} MESSAGE_ENVELOPE;
@ -136,7 +136,7 @@ static LIVEDUMP_INFO LiveDump_info;
* this scenario, we simply stash the controlvm message, then attempt to
* process it again the next time controlvm_periodic_work() runs.
*/
static CONTROLVM_MESSAGE ControlVm_Pending_Msg;
static struct controlvm_message ControlVm_Pending_Msg;
static BOOL ControlVm_Pending_Msg_Valid = FALSE;
/* Pool of struct putfile_buffer_entry, for keeping track of pending (incoming)
@ -220,7 +220,7 @@ struct parahotplug_request {
struct list_head list;
int id;
unsigned long expiration;
CONTROLVM_MESSAGE msg;
struct controlvm_message msg;
};
static LIST_HEAD(Parahotplug_request_list);
@ -654,7 +654,7 @@ cleanup_controlvm_structures(void)
}
static void
chipset_init(CONTROLVM_MESSAGE *inmsg)
chipset_init(struct controlvm_message *inmsg)
{
static int chipset_inited;
enum ultra_chipset_feature features = 0;
@ -687,10 +687,10 @@ Away:
}
static void
controlvm_init_response(CONTROLVM_MESSAGE *msg,
controlvm_init_response(struct controlvm_message *msg,
struct controlvm_message_header *msgHdr, int response)
{
memset(msg, 0, sizeof(CONTROLVM_MESSAGE));
memset(msg, 0, sizeof(struct controlvm_message));
memcpy(&msg->hdr, msgHdr, sizeof(struct controlvm_message_header));
msg->hdr.payload_bytes = 0;
msg->hdr.payload_vm_offset = 0;
@ -704,7 +704,7 @@ controlvm_init_response(CONTROLVM_MESSAGE *msg,
static void
controlvm_respond(struct controlvm_message_header *msgHdr, int response)
{
CONTROLVM_MESSAGE outmsg;
struct controlvm_message outmsg;
controlvm_init_response(&outmsg, msgHdr, response);
/* For DiagPool channel DEVICE_CHANGESTATE, we need to send
@ -732,7 +732,7 @@ controlvm_respond_chipset_init(struct controlvm_message_header *msgHdr,
int response,
enum ultra_chipset_feature features)
{
CONTROLVM_MESSAGE outmsg;
struct controlvm_message outmsg;
controlvm_init_response(&outmsg, msgHdr, response);
outmsg.cmd.init_chipset.features = features;
@ -747,7 +747,7 @@ static void controlvm_respond_physdev_changestate(
struct controlvm_message_header *msgHdr, int response,
struct spar_segment_state state)
{
CONTROLVM_MESSAGE outmsg;
struct controlvm_message outmsg;
controlvm_init_response(&outmsg, msgHdr, response);
outmsg.cmd.device_change_state.state = state;
@ -760,7 +760,7 @@ static void controlvm_respond_physdev_changestate(
}
void
visorchipset_save_message(CONTROLVM_MESSAGE *msg, CRASH_OBJ_TYPE type)
visorchipset_save_message(struct controlvm_message *msg, CRASH_OBJ_TYPE type)
{
u32 localSavedCrashMsgOffset;
u16 localSavedCrashMsgCount;
@ -799,7 +799,8 @@ visorchipset_save_message(CONTROLVM_MESSAGE *msg, CRASH_OBJ_TYPE type)
if (type == CRASH_bus) {
if (visorchannel_write(ControlVm_channel,
localSavedCrashMsgOffset,
msg, sizeof(CONTROLVM_MESSAGE)) < 0) {
msg,
sizeof(struct controlvm_message)) < 0) {
LOGERR("SAVE_MSG_BUS_FAILURE: Failed to write CrashCreateBusMsg!");
POSTCODE_LINUX_2(SAVE_MSG_BUS_FAILURE_PC,
POSTCODE_SEVERITY_ERR);
@ -808,8 +809,8 @@ visorchipset_save_message(CONTROLVM_MESSAGE *msg, CRASH_OBJ_TYPE type)
} else {
if (visorchannel_write(ControlVm_channel,
localSavedCrashMsgOffset +
sizeof(CONTROLVM_MESSAGE), msg,
sizeof(CONTROLVM_MESSAGE)) < 0) {
sizeof(struct controlvm_message), msg,
sizeof(struct controlvm_message)) < 0) {
LOGERR("SAVE_MSG_DEV_FAILURE: Failed to write CrashCreateDevMsg!");
POSTCODE_LINUX_2(SAVE_MSG_DEV_FAILURE_PC,
POSTCODE_SEVERITY_ERR);
@ -864,7 +865,7 @@ device_changestate_responder(enum controlvm_id cmdId,
struct spar_segment_state responseState)
{
VISORCHIPSET_DEVICE_INFO *p = NULL;
CONTROLVM_MESSAGE outmsg;
struct controlvm_message outmsg;
p = finddevice(&DevInfoList, busNo, devNo);
if (!p) {
@ -1095,7 +1096,7 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
}
static void
bus_create(CONTROLVM_MESSAGE *inmsg)
bus_create(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
ulong busNo = cmd->create_bus.bus_no;
@ -1149,7 +1150,7 @@ Away:
}
static void
bus_destroy(CONTROLVM_MESSAGE *inmsg)
bus_destroy(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
ulong busNo = cmd->destroy_bus.bus_no;
@ -1175,7 +1176,7 @@ Away:
}
static void
bus_configure(CONTROLVM_MESSAGE *inmsg, PARSER_CONTEXT *parser_ctx)
bus_configure(struct controlvm_message *inmsg, PARSER_CONTEXT *parser_ctx)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
ulong busNo = cmd->configure_bus.bus_no;
@ -1226,7 +1227,7 @@ Away:
}
static void
my_device_create(CONTROLVM_MESSAGE *inmsg)
my_device_create(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
ulong busNo = cmd->create_device.bus_no;
@ -1304,7 +1305,7 @@ Away:
}
static void
my_device_changestate(CONTROLVM_MESSAGE *inmsg)
my_device_changestate(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
ulong busNo = cmd->device_change_state.bus_no;
@ -1338,7 +1339,7 @@ Away:
}
static void
my_device_destroy(CONTROLVM_MESSAGE *inmsg)
my_device_destroy(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
ulong busNo = cmd->destroy_device.bus_no;
@ -1536,7 +1537,7 @@ chipset_notready(struct controlvm_message_header *msgHdr)
* CONTROLVM_QUEUE_EVENT queue in the controlvm channel.
*/
static BOOL
read_controlvm_event(CONTROLVM_MESSAGE *msg)
read_controlvm_event(struct controlvm_message *msg)
{
if (visorchannel_signalremove(ControlVm_channel,
CONTROLVM_QUEUE_EVENT, msg)) {
@ -1593,7 +1594,7 @@ parahotplug_next_expiration(void)
* CONTROLVM_MESSAGE that we can stick on a list
*/
static struct parahotplug_request *
parahotplug_request_create(CONTROLVM_MESSAGE *msg)
parahotplug_request_create(struct controlvm_message *msg)
{
struct parahotplug_request *req =
kmalloc(sizeof(struct parahotplug_request),
@ -1723,7 +1724,7 @@ parahotplug_request_complete(int id, u16 active)
* Enables or disables a PCI device by kicking off a udev script
*/
static void
parahotplug_process_message(CONTROLVM_MESSAGE *inmsg)
parahotplug_process_message(struct controlvm_message *inmsg)
{
struct parahotplug_request *req;
@ -1775,14 +1776,14 @@ parahotplug_process_message(CONTROLVM_MESSAGE *inmsg)
* either successfully or with an error.
*/
static BOOL
handle_command(CONTROLVM_MESSAGE inmsg, HOSTADDRESS channel_addr)
handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
{
struct controlvm_message_packet *cmd = &inmsg.cmd;
u64 parametersAddr = 0;
u32 parametersBytes = 0;
PARSER_CONTEXT *parser_ctx = NULL;
BOOL isLocalAddr = FALSE;
CONTROLVM_MESSAGE ackmsg;
struct controlvm_message ackmsg;
/* create parsing context if necessary */
isLocalAddr = (inmsg.hdr.flags.test_message == 1);
@ -1931,7 +1932,7 @@ static void
controlvm_periodic_work(struct work_struct *work)
{
VISORCHIPSET_CHANNEL_INFO chanInfo;
CONTROLVM_MESSAGE inmsg;
struct controlvm_message inmsg;
BOOL gotACommand = FALSE;
BOOL handle_command_failed = FALSE;
static u64 Poll_Count;
@ -2040,9 +2041,9 @@ static void
setup_crash_devices_work_queue(struct work_struct *work)
{
CONTROLVM_MESSAGE localCrashCreateBusMsg;
CONTROLVM_MESSAGE localCrashCreateDevMsg;
CONTROLVM_MESSAGE msg;
struct controlvm_message localCrashCreateBusMsg;
struct controlvm_message localCrashCreateDevMsg;
struct controlvm_message msg;
u32 localSavedCrashMsgOffset;
u16 localSavedCrashMsgCount;
@ -2100,7 +2101,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
if (visorchannel_read(ControlVm_channel,
localSavedCrashMsgOffset,
&localCrashCreateBusMsg,
sizeof(CONTROLVM_MESSAGE)) < 0) {
sizeof(struct controlvm_message)) < 0) {
LOGERR("CRASH_DEV_RD_BUS_FAIULRE: Failed to read CrashCreateBusMsg!");
POSTCODE_LINUX_2(CRASH_DEV_RD_BUS_FAIULRE_PC,
POSTCODE_SEVERITY_ERR);
@ -2110,9 +2111,9 @@ setup_crash_devices_work_queue(struct work_struct *work)
/* read create device message for storage device */
if (visorchannel_read(ControlVm_channel,
localSavedCrashMsgOffset +
sizeof(CONTROLVM_MESSAGE),
sizeof(struct controlvm_message),
&localCrashCreateDevMsg,
sizeof(CONTROLVM_MESSAGE)) < 0) {
sizeof(struct controlvm_message)) < 0) {
LOGERR("CRASH_DEV_RD_DEV_FAIULRE: Failed to read CrashCreateDevMsg!");
POSTCODE_LINUX_2(CRASH_DEV_RD_DEV_FAIULRE_PC,
POSTCODE_SEVERITY_ERR);