Commit d19642f6 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: refactor SPAR_CONTROLVM_CHANNEL_PROTOCOL

Get rid of the typedef for SPAR_CONTROLVM_CHANNEL_PROTOCOL and replace it with
struct spar_controlvm_channel_protocol. Fix CamelCase members of the structure
and update all references to changed names.

Header => header
gpControlVm => gp_control_vm
gpPartitionTables => gp_partition_tables
gpDiagGuest => gp_diag_guest
gpBootRomDisk => gp_boot_romdisk
gpBootRamDisk => gp_boot_ramdisk
gpAcpiTable => gp_acpi_table
gpControlChannel => gp_control_channel
gpdiagRomDisk => gp_diag_romdisk
gpNvram => gp_nvram
RequestPayloadOffset => request_payload_offset
EventPayloadOffset => event_payload_offset
RequestPayloadBytes => request_payload_bytes
EventPayloadBytes => event_payload_bytes
ControlChannelBytes => control_channel_bytes
NvramChannelBytes => nvram_channel_bytes
MessageBytes => message_bytes
MessageCount => message_count
gpSmbiosTable => gp_smbios_table
gpPhysicalSmbiosTable => gp_physical_smbios_table
gpobsoleteGuestDevices => gp_obsolete_guest_devices
VirtualGuestFirmwareImageBase => virtual_guest_firmware_image_base
VirtualGuestFirmwareEntryPoint => virtual_guest_firmware_entry_point
VirtualGuestFirmwareImageSize => virtual_guest_firmware_image_size
VirtualGuestFirmwareBootBase => virtual_guest_firmware_boot_base
VirtualGuestImageBase => virtual_guest_image_base
VirtualGuestImageSize => virtual_guest_image_size
PrototypeControlChannelOffset => prototype_control_channel_offset
VirtualGuestPartitionHandle => virtual_guest_partition_handle
RestoreAction => restore_action
DumpAction => dump_action
NvramFailCount => nvram_fail_count
SavedCrashMsgCount => saved_crash_message_count
SavedCrashMsgOffset => saved_crash_message_offset
InstallationError => installation_error
InstallationTextId => installation_text_id
InstallationRemainingSteps => installation_remaining_steps
ToolAction => tool_action
Reserved => reserved
EfiSparIndication => efi_spar_ind
EfiSparIndicationSupported => efi_spar_ind_supported
SPReserved => sp_reserved
Reserved2 => reserved2
RequestQueue => request_queue
ResponseQueue => response_queue
EventQueue => event_queue
EventAckQueue => event_ack_queue
RequestMsg => request_msg
ResponseMsg => response_msg
EventMsg => event_msg
EventAckMsg => event_ack_msg
SavedCrashMsg => saved_crash_msg
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6f5a5b7b
......@@ -1564,8 +1564,8 @@ uislib_mod_init(void)
(ulong) sizeof(struct uiscmdrsp_net));
LOGINF("sizeof(CONTROLVM_MESSAGE):%lu bytes\n",
(ulong) sizeof(struct controlvm_message));
LOGINF("sizeof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL):%lu bytes\n",
(ulong) sizeof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL));
LOGINF("sizeof(struct spar_controlvm_channel_protocol):%lu bytes\n",
(ulong) sizeof(struct spar_controlvm_channel_protocol));
LOGINF("sizeof(CHANNEL_HEADER):%lu bytes\n",
(ulong) sizeof(struct channel_header));
LOGINF("sizeof(ULTRA_IO_CHANNEL_PROTOCOL):%lu bytes\n",
......
......@@ -155,9 +155,9 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma)
return -ENXIO;
}
visorchannel_read(*PControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
gpControlChannel), &addr,
sizeof(addr));
offsetof(struct spar_controlvm_channel_protocol,
gp_control_channel),
&addr, sizeof(addr));
if (addr == 0) {
ERRDRV("%s control channel address is 0", __func__);
return -ENXIO;
......
......@@ -360,8 +360,8 @@ static ssize_t toolaction_show(struct device *dev,
u8 toolAction;
visorchannel_read(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
ToolAction), &toolAction, sizeof(u8));
offsetof(struct spar_controlvm_channel_protocol,
tool_action), &toolAction, sizeof(u8));
return scnprintf(buf, PAGE_SIZE, "%u\n", toolAction);
}
......@@ -376,7 +376,7 @@ static ssize_t toolaction_store(struct device *dev,
return -EINVAL;
ret = visorchannel_write(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, ToolAction),
offsetof(struct spar_controlvm_channel_protocol, tool_action),
&toolAction, sizeof(u8));
if (ret)
......@@ -391,8 +391,8 @@ static ssize_t boottotool_show(struct device *dev,
struct efi_spar_indication efiSparIndication;
visorchannel_read(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
EfiSparIndication), &efiSparIndication,
offsetof(struct spar_controlvm_channel_protocol,
efi_spar_ind), &efiSparIndication,
sizeof(struct efi_spar_indication));
return scnprintf(buf, PAGE_SIZE, "%u\n",
efiSparIndication.boot_to_tool);
......@@ -410,8 +410,8 @@ static ssize_t boottotool_store(struct device *dev,
efiSparIndication.boot_to_tool = val;
ret = visorchannel_write(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
EfiSparIndication),
offsetof(struct spar_controlvm_channel_protocol,
efi_spar_ind),
&(efiSparIndication),
sizeof(struct efi_spar_indication));
......@@ -426,7 +426,7 @@ static ssize_t error_show(struct device *dev, struct device_attribute *attr,
u32 error;
visorchannel_read(ControlVm_channel, offsetof(
ULTRA_CONTROLVM_CHANNEL_PROTOCOL, InstallationError),
struct spar_controlvm_channel_protocol, installation_error),
&error, sizeof(u32));
return scnprintf(buf, PAGE_SIZE, "%i\n", error);
}
......@@ -441,8 +441,8 @@ static ssize_t error_store(struct device *dev, struct device_attribute *attr,
return -EINVAL;
ret = visorchannel_write(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
InstallationError),
offsetof(struct spar_controlvm_channel_protocol,
installation_error),
&error, sizeof(u32));
if (ret)
return ret;
......@@ -455,7 +455,7 @@ static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
u32 textId;
visorchannel_read(ControlVm_channel, offsetof(
ULTRA_CONTROLVM_CHANNEL_PROTOCOL, InstallationTextId),
struct spar_controlvm_channel_protocol, installation_text_id),
&textId, sizeof(u32));
return scnprintf(buf, PAGE_SIZE, "%i\n", textId);
}
......@@ -470,8 +470,8 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
return -EINVAL;
ret = visorchannel_write(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
InstallationTextId),
offsetof(struct spar_controlvm_channel_protocol,
installation_text_id),
&textId, sizeof(u32));
if (ret)
return ret;
......@@ -485,8 +485,8 @@ static ssize_t remaining_steps_show(struct device *dev,
u16 remainingSteps;
visorchannel_read(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
InstallationRemainingSteps),
offsetof(struct spar_controlvm_channel_protocol,
installation_remaining_steps),
&remainingSteps,
sizeof(u16));
return scnprintf(buf, PAGE_SIZE, "%hu\n", remainingSteps);
......@@ -502,8 +502,8 @@ static ssize_t remaining_steps_store(struct device *dev,
return -EINVAL;
ret = visorchannel_write(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
InstallationRemainingSteps),
offsetof(struct spar_controlvm_channel_protocol,
installation_remaining_steps),
&remainingSteps, sizeof(u16));
if (ret)
return ret;
......@@ -767,8 +767,8 @@ visorchipset_save_message(struct controlvm_message *msg, CRASH_OBJ_TYPE type)
/* get saved message count */
if (visorchannel_read(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
SavedCrashMsgCount),
offsetof(struct spar_controlvm_channel_protocol,
saved_crash_message_count),
&localSavedCrashMsgCount, sizeof(u16)) < 0) {
LOGERR("failed to get Saved Message Count");
POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
......@@ -787,8 +787,8 @@ visorchipset_save_message(struct controlvm_message *msg, CRASH_OBJ_TYPE type)
/* get saved crash message offset */
if (visorchannel_read(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
SavedCrashMsgOffset),
offsetof(struct spar_controlvm_channel_protocol,
saved_crash_message_offset),
&localSavedCrashMsgOffset, sizeof(u32)) < 0) {
LOGERR("failed to get Saved Message Offset");
POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
......@@ -1389,7 +1389,7 @@ initialize_controlvm_payload_info(HOSTADDRESS phys_addr, u64 offset, u32 bytes,
}
memset(info, 0, sizeof(CONTROLVM_PAYLOAD_INFO));
if ((offset == 0) || (bytes == 0)) {
LOGERR("CONTROLVM_PAYLOAD_INIT Failed: RequestPayloadOffset=%llu RequestPayloadBytes=%llu!",
LOGERR("CONTROLVM_PAYLOAD_INIT Failed: request_payload_offset=%llu request_payload_bytes=%llu!",
(u64) offset, (u64) bytes);
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
goto Away;
......@@ -1436,8 +1436,8 @@ initialize_controlvm_payload(void)
u32 payloadBytes = 0;
if (visorchannel_read(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
RequestPayloadOffset),
offsetof(struct spar_controlvm_channel_protocol,
request_payload_offset),
&payloadOffset, sizeof(payloadOffset)) < 0) {
LOGERR("CONTROLVM_PAYLOAD_INIT Failed to read controlvm channel!");
POSTCODE_LINUX_2(CONTROLVM_INIT_FAILURE_PC,
......@@ -1445,8 +1445,8 @@ initialize_controlvm_payload(void)
return;
}
if (visorchannel_read(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
RequestPayloadBytes),
offsetof(struct spar_controlvm_channel_protocol,
request_payload_bytes),
&payloadBytes, sizeof(payloadBytes)) < 0) {
LOGERR("CONTROLVM_PAYLOAD_INIT Failed to read controlvm channel!");
POSTCODE_LINUX_2(CONTROLVM_INIT_FAILURE_PC,
......@@ -2068,8 +2068,8 @@ setup_crash_devices_work_queue(struct work_struct *work)
/* get saved message count */
if (visorchannel_read(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
SavedCrashMsgCount),
offsetof(struct spar_controlvm_channel_protocol,
saved_crash_message_count),
&localSavedCrashMsgCount, sizeof(u16)) < 0) {
LOGERR("failed to get Saved Message Count");
POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
......@@ -2088,8 +2088,8 @@ setup_crash_devices_work_queue(struct work_struct *work)
/* get saved crash message offset */
if (visorchannel_read(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
SavedCrashMsgOffset),
offsetof(struct spar_controlvm_channel_protocol,
saved_crash_message_offset),
&localSavedCrashMsgOffset, sizeof(u32)) < 0) {
LOGERR("failed to get Saved Message Offset");
POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
......@@ -2385,7 +2385,7 @@ visorchipset_init(void)
ControlVm_channel =
visorchannel_create_with_lock
(addr,
sizeof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL),
sizeof(struct spar_controlvm_channel_protocol),
spar_controlvm_channel_protocol_uuid);
if (SPAR_CONTROLVM_CHANNEL_OK_CLIENT(
visorchannel_get_header(ControlVm_channel))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment