aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/unisys')
-rw-r--r--drivers/staging/unisys/Documentation/overview.txt14
-rw-r--r--drivers/staging/unisys/include/channel.h60
-rw-r--r--drivers/staging/unisys/include/iochannel.h39
-rw-r--r--drivers/staging/unisys/visorbus/controlvmchannel.h56
-rw-r--r--drivers/staging/unisys/visorbus/vbuschannel.h25
-rw-r--r--drivers/staging/unisys/visorbus/visorbus_main.c125
-rw-r--r--drivers/staging/unisys/visorbus/visorbus_private.h24
-rw-r--r--drivers/staging/unisys/visorbus/visorchannel.c8
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c226
-rw-r--r--drivers/staging/unisys/visorhba/visorhba_main.c19
-rw-r--r--drivers/staging/unisys/visorinput/ultrainputreport.h49
-rw-r--r--drivers/staging/unisys/visorinput/visorinput.c51
-rw-r--r--drivers/staging/unisys/visornic/visornic_main.c23
13 files changed, 348 insertions, 371 deletions
diff --git a/drivers/staging/unisys/Documentation/overview.txt b/drivers/staging/unisys/Documentation/overview.txt
index 1146c1cf5c2a..e0466bfada2f 100644
--- a/drivers/staging/unisys/Documentation/overview.txt
+++ b/drivers/staging/unisys/Documentation/overview.txt
@@ -221,7 +221,7 @@ The following files exist under /sys/devices/visorbus<x>/vbus<x>:dev<y>:
The visorhba driver registers with visorbus as the function driver to
handle virtual scsi disk devices, specified using the
-SPAR_VHBA_CHANNEL_PROTOCOL_UUID type in the visorbus_register_visor_driver()
+VISOR_VHBA_CHANNEL_UUID type in the visorbus_register_visor_driver()
call. visorhba uses scsi_add_host() to expose a Linux block device
(e.g., /sys/block/) in the guest environment for each s-Par virtual device.
@@ -240,7 +240,7 @@ When compiled as a module, visorhba can be autoloaded by visorbus in
standard udev/systemd environments, as it includes the modules.alias
definition:
- "visorbus:"+SPAR_VHBA_CHANNEL_PROTOCOL_UUID_STR
+ "visorbus:"+VISOR_VHBA_CHANNEL_UUID_STR
i.e.:
@@ -252,7 +252,7 @@ i.e.:
The visornic driver registers with visorbus as the function driver to
handle virtual network devices, specified using the
-SPAR_VNIC_CHANNEL_PROTOCOL_UUID type in the visorbus_register_visor_driver()
+VISOR_VNIC_CHANNEL_UUID type in the visorbus_register_visor_driver()
call. visornic uses register_netdev() to expose a Linux device of class net
(e.g., /sys/class/net/) in the guest environment for each s-Par virtual
device.
@@ -270,7 +270,7 @@ When compiled as a module, visornic can be autoloaded by visorbus in
standard udev/systemd environments, as it includes the modules.alias
definition:
- "visorbus:"+SPAR_VNIC_CHANNEL_PROTOCOL_UUID_STR
+ "visorbus:"+VISOR_VNIC_CHANNEL_UUID_STR
i.e.:
@@ -282,7 +282,7 @@ i.e.:
The visorinput driver registers with visorbus as the function driver to
handle human input devices, specified using the
-SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID and SPAR_MOUSE_CHANNEL_PROTOCOL_UUID
+VISOR_KEYBOARD_CHANNEL_UUID and VISOR_MOUSE_CHANNEL_UUID
types in the visorbus_register_visor_driver() call. visorinput uses
input_register_device() to expose devices of class input
(e.g., /sys/class/input/) for virtual keyboard and virtual mouse devices.
@@ -307,8 +307,8 @@ When compiled as a module, visorinput can be autoloaded by visorbus in
standard udev/systemd environments, as it includes the modules.alias
definition:
- "visorbus:"+SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR
- "visorbus:"+SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR
+ "visorbus:"+VISOR_MOUSE_CHANNEL_UUID_STR
+ "visorbus:"+VISOR_KEYBOARD_CHANNEL_UUID_STR
i.e.:
diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h
index 057421eeb1ae..692efcb38245 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -32,7 +32,7 @@
#define COVER(v, d) ((d) * DIV_ROUND_UP(v, d))
#endif
-#define ULTRA_CHANNEL_PROTOCOL_SIGNATURE SIGNATURE_32('E', 'C', 'N', 'L')
+#define VISOR_CHANNEL_SIGNATURE SIGNATURE_32('E', 'C', 'N', 'L')
enum channel_serverstate {
CHANNELSRV_UNINITIALIZED = 0, /* channel is in an undefined state */
@@ -59,10 +59,10 @@ enum channel_clientstate {
/* access channel anytime */
};
-#define SPAR_CHANNEL_SERVER_READY(ch) \
+#define VISOR_CHANNEL_SERVER_READY(ch) \
(readl(&(ch)->srv_state) == CHANNELSRV_READY)
-#define ULTRA_VALID_CHANNELCLI_TRANSITION(o, n) \
+#define VISOR_VALID_CHANNELCLI_TRANSITION(o, n) \
(((((o) == CHANNELCLI_DETACHED) && ((n) == CHANNELCLI_DISABLED)) || \
(((o) == CHANNELCLI_ATTACHING) && ((n) == CHANNELCLI_DISABLED)) || \
(((o) == CHANNELCLI_ATTACHED) && ((n) == CHANNELCLI_DISABLED)) || \
@@ -80,33 +80,33 @@ enum channel_clientstate {
(((o) == CHANNELCLI_BUSY) && ((n) == CHANNELCLI_OWNED)) || (0)) \
? (1) : (0))
-/* Values for ULTRA_CHANNEL_PROTOCOL.CliErrorBoot: */
+/* Values for VISORA_CHANNEL_PROTOCOL.CliErrorBoot: */
/* throttling invalid boot channel statetransition error due to client
* disabled
*/
-#define ULTRA_CLIERRORBOOT_THROTTLEMSG_DISABLED 0x01
+#define VISOR_CLIERRORBOOT_THROTTLEMSG_DISABLED 0x01
/* throttling invalid boot channel statetransition error due to client
* not attached
*/
-#define ULTRA_CLIERRORBOOT_THROTTLEMSG_NOTATTACHED 0x02
+#define VISOR_CLIERRORBOOT_THROTTLEMSG_NOTATTACHED 0x02
/* throttling invalid boot channel statetransition error due to busy channel */
-#define ULTRA_CLIERRORBOOT_THROTTLEMSG_BUSY 0x04
+#define VISOR_CLIERRORBOOT_THROTTLEMSG_BUSY 0x04
-/* Values for ULTRA_CHANNEL_PROTOCOL.Features: This define exists so
+/* Values for VISOR_CHANNEL_PROTOCOL.Features: This define exists so
* that windows guest can look at the FeatureFlags in the io channel,
* and configure the windows driver to use interrupts or not based on
* this setting. This flag is set in uislib after the
- * ULTRA_VHBA_init_channel is called. All feature bits for all
+ * VISOR_VHBA_init_channel is called. All feature bits for all
* channels should be defined here. The io channel feature bits are
* defined right here
*/
-#define ULTRA_IO_DRIVER_ENABLES_INTS (0x1ULL << 1)
-#define ULTRA_IO_CHANNEL_IS_POLLING (0x1ULL << 3)
-#define ULTRA_IO_IOVM_IS_OK_WITH_DRIVER_DISABLING_INTS (0x1ULL << 4)
-#define ULTRA_IO_DRIVER_DISABLES_INTS (0x1ULL << 5)
-#define ULTRA_IO_DRIVER_SUPPORTS_ENHANCED_RCVBUF_CHECKING (0x1ULL << 6)
+#define VISOR_DRIVER_ENABLES_INTS (0x1ULL << 1)
+#define VISOR_CHANNEL_IS_POLLING (0x1ULL << 3)
+#define VISOR_IOVM_OK_DRIVER_DISABLING_INTS (0x1ULL << 4)
+#define VISOR_DRIVER_DISABLES_INTS (0x1ULL << 5)
+#define VISOR_DRIVER_ENHANCED_RCVBUF_CHECKING (0x1ULL << 6)
/* Common Channel Header */
struct channel_header {
@@ -156,7 +156,7 @@ struct channel_header {
u8 recover_channel;
} __packed;
-#define ULTRA_CHANNEL_ENABLE_INTS (0x1ULL << 0)
+#define VISOR_CHANNEL_ENABLE_INTS (0x1ULL << 0)
/* Subheader for the Signal Type variation of the Common Channel */
struct signal_queue_header {
@@ -204,12 +204,12 @@ struct signal_queue_header {
* is used to pass the EFI_DIAG_CAPTURE_PROTOCOL needed to log messages.
*/
static inline int
-spar_check_channel(struct channel_header *ch,
- uuid_le expected_uuid,
- char *chname,
- u64 expected_min_bytes,
- u32 expected_version,
- u64 expected_signature)
+visor_check_channel(struct channel_header *ch,
+ uuid_le expected_uuid,
+ char *chname,
+ u64 expected_min_bytes,
+ u32 expected_version,
+ u64 expected_signature)
{
if (uuid_le_cmp(expected_uuid, NULL_UUID_LE) != 0) {
/* caller wants us to verify type GUID */
@@ -254,27 +254,25 @@ spar_check_channel(struct channel_header *ch,
*/
/* {414815ed-c58c-11da-95a9-00e08161165f} */
-#define SPAR_VHBA_CHANNEL_PROTOCOL_UUID \
+#define VISOR_VHBA_CHANNEL_UUID \
UUID_LE(0x414815ed, 0xc58c, 0x11da, \
0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)
-static const uuid_le spar_vhba_channel_protocol_uuid =
- SPAR_VHBA_CHANNEL_PROTOCOL_UUID;
-#define SPAR_VHBA_CHANNEL_PROTOCOL_UUID_STR \
+static const uuid_le visor_vhba_channel_uuid = VISOR_VHBA_CHANNEL_UUID;
+#define VISOR_VHBA_CHANNEL_UUID_STR \
"414815ed-c58c-11da-95a9-00e08161165f"
/* {8cd5994d-c58e-11da-95a9-00e08161165f} */
-#define SPAR_VNIC_CHANNEL_PROTOCOL_UUID \
+#define VISOR_VNIC_CHANNEL_UUID \
UUID_LE(0x8cd5994d, 0xc58e, 0x11da, \
0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)
-static const uuid_le spar_vnic_channel_protocol_uuid =
- SPAR_VNIC_CHANNEL_PROTOCOL_UUID;
-#define SPAR_VNIC_CHANNEL_PROTOCOL_UUID_STR \
+static const uuid_le visor_vnic_channel_uuid = VISOR_VNIC_CHANNEL_UUID;
+#define VISOR_VNIC_CHANNEL_UUID_STR \
"8cd5994d-c58e-11da-95a9-00e08161165f"
/* {72120008-4AAB-11DC-8530-444553544200} */
-#define SPAR_SIOVM_UUID \
+#define VISOR_SIOVM_UUID \
UUID_LE(0x72120008, 0x4AAB, 0x11DC, \
0x85, 0x30, 0x44, 0x45, 0x53, 0x54, 0x42, 0x00)
-static const uuid_le spar_siovm_uuid = SPAR_SIOVM_UUID;
+static const uuid_le visor_siovm_uuid = VISOR_SIOVM_UUID;
#endif
diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h
index 9bde848a321c..c7cb3fbde7b2 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -34,10 +34,9 @@
#include <linux/dma-direction.h>
#include "channel.h"
-#define ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE ULTRA_CHANNEL_PROTOCOL_SIGNATURE
-#define ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE ULTRA_CHANNEL_PROTOCOL_SIGNATURE
-#define ULTRA_VSWITCH_CHANNEL_PROTOCOL_SIGNATURE \
- ULTRA_CHANNEL_PROTOCOL_SIGNATURE
+#define VISOR_VHBA_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
+#define VISOR_VNIC_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
+#define VISOR_VSWITCH_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
/*
* Must increment these whenever you insert or delete fields within this channel
@@ -46,21 +45,21 @@
* usually add fields to the END of the channel struct without needing to
* increment this.
*/
-#define ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID 2
-#define ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID 2
-#define ULTRA_VSWITCH_CHANNEL_PROTOCOL_VERSIONID 1
-
-#define SPAR_VHBA_CHANNEL_OK_CLIENT(ch) \
- (spar_check_channel(ch, spar_vhba_channel_protocol_uuid, \
- "vhba", MIN_IO_CHANNEL_SIZE, \
- ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID, \
- ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE))
-
-#define SPAR_VNIC_CHANNEL_OK_CLIENT(ch) \
- (spar_check_channel(ch, spar_vnic_channel_protocol_uuid, \
- "vnic", MIN_IO_CHANNEL_SIZE, \
- ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID, \
- ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE))
+#define VISOR_VHBA_CHANNEL_VERSIONID 2
+#define VISOR_VNIC_CHANNEL_VERSIONID 2
+#define VISOR_VSWITCH_CHANNEL_VERSIONID 1
+
+#define VISOR_VHBA_CHANNEL_OK_CLIENT(ch) \
+ (visor_check_channel(ch, visor_vhba_channel_uuid, \
+ "vhba", MIN_IO_CHANNEL_SIZE, \
+ VISOR_VHBA_CHANNEL_VERSIONID, \
+ VISOR_VHBA_CHANNEL_SIGNATURE))
+
+#define VISOR_VNIC_CHANNEL_OK_CLIENT(ch) \
+ (visor_check_channel(ch, visor_vnic_channel_uuid, \
+ "vnic", MIN_IO_CHANNEL_SIZE, \
+ VISOR_VNIC_CHANNEL_VERSIONID, \
+ VISOR_VNIC_CHANNEL_SIGNATURE))
/*
* Everything necessary to handle SCSI & NIC traffic between Guest Partition and
@@ -530,7 +529,7 @@ struct iochannel_vnic {
* this header there is a large region of memory which contains the command and
* response queues as specified in cmd_q and rsp_q SIGNAL_QUEUE_HEADERS.
*/
-struct spar_io_channel_protocol {
+struct visor_io_channel {
struct channel_header channel_header;
struct signal_queue_header cmd_q;
struct signal_queue_header rsp_q;
diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h b/drivers/staging/unisys/visorbus/controlvmchannel.h
index 274f72422166..ed045eff0e33 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -19,12 +19,11 @@
#include "channel.h"
/* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
-#define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID \
+#define VISOR_CONTROLVM_CHANNEL_UUID \
UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \
0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
-#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \
- ULTRA_CHANNEL_PROTOCOL_SIGNATURE
+#define VISOR_CONTROLVM_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
#define CONTROLVM_MESSAGE_MAX 64
/* Must increment this whenever you insert or delete fields within
@@ -33,15 +32,15 @@
* software. Note that you can usually add fields to the END of the
* channel struct withOUT needing to increment this.
*/
-#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1
+#define VISOR_CONTROLVM_CHANNEL_VERSIONID 1
-#define SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
- (spar_check_channel(ch, \
- SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID, \
- "controlvm", \
- sizeof(struct spar_controlvm_channel_protocol), \
- ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \
- ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE))
+#define VISOR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
+ (visor_check_channel(ch, \
+ VISOR_CONTROLVM_CHANNEL_UUID, \
+ "controlvm", \
+ sizeof(struct visor_controlvm_channel), \
+ VISOR_CONTROLVM_CHANNEL_VERSIONID, \
+ VISOR_CONTROLVM_CHANNEL_SIGNATURE))
/* Defines for various channel queues */
#define CONTROLVM_QUEUE_REQUEST 0
@@ -52,7 +51,7 @@
/* Max num of messages stored during IOVM creation to be reused after crash */
#define CONTROLVM_CRASHMSG_MAX 2
-struct spar_segment_state {
+struct visor_segment_state {
/* Bit 0: May enter other states */
u16 enabled:1;
/* Bit 1: Assigned to active partition */
@@ -76,15 +75,15 @@ struct spar_segment_state {
*/
} __packed;
-static const struct spar_segment_state segment_state_running = {
+static const struct visor_segment_state segment_state_running = {
1, 1, 1, 0, 1, 1, 1, 1
};
-static const struct spar_segment_state segment_state_paused = {
+static const struct visor_segment_state segment_state_paused = {
1, 1, 1, 0, 1, 1, 1, 0
};
-static const struct spar_segment_state segment_state_standby = {
+static const struct visor_segment_state segment_state_standby = {
1, 1, 0, 0, 1, 1, 1, 0
};
@@ -149,7 +148,7 @@ struct irq_info {
u8 reserved[3]; /* Natural alignment purposes */
} __packed;
-struct efi_spar_indication {
+struct efi_visor_indication {
u64 boot_to_fw_ui:1; /* Bit 0: Stop in uefi ui */
u64 clear_nvram:1; /* Bit 1: Clear NVRAM */
u64 clear_cmos:1; /* Bit 2: Clear CMOS */
@@ -158,9 +157,9 @@ struct efi_spar_indication {
u64 reserved:60; /* Natural alignment */
} __packed;
-enum ultra_chipset_feature {
- ULTRA_CHIPSET_FEATURE_REPLY = 0x00000001,
- ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG = 0x00000002,
+enum visor_chipset_feature {
+ VISOR_CHIPSET_FEATURE_REPLY = 0x00000001,
+ VISOR_CHIPSET_FEATURE_PARA_HOTPLUG = 0x00000002,
};
/* This is the common structure that is at the beginning of every
@@ -298,13 +297,13 @@ struct controlvm_message_packet {
/* for CONTROLVM_DEVICE_RECONFIGURE */
struct {
u32 bus_no;
- struct spar_segment_state state;
+ struct visor_segment_state state;
u8 reserved[2]; /* Natural alignment purposes */
} __packed bus_change_state; /* for CONTROLVM_BUS_CHANGESTATE */
struct {
u32 bus_no;
u32 dev_no;
- struct spar_segment_state state;
+ struct visor_segment_state state;
struct {
/* =1 if message is for a physical device */
u32 phys_device:1;
@@ -317,7 +316,7 @@ struct controlvm_message_packet {
struct {
u32 bus_no;
u32 dev_no;
- struct spar_segment_state state;
+ struct visor_segment_state state;
u8 reserved[6]; /* Natural alignment purposes */
} __packed device_change_state_event;
/* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
@@ -326,7 +325,7 @@ struct controlvm_message_packet {
u32 bus_count;
/* indicates the max number of switches */
u32 switch_count;
- enum ultra_chipset_feature features;
+ enum visor_chipset_feature features;
u32 platform_number; /* Platform Number */
} __packed init_chipset; /* for CONTROLVM_CHIPSET_INIT */
struct {
@@ -349,7 +348,7 @@ struct controlvm_message {
struct controlvm_message_packet cmd;
} __packed;
-struct spar_controlvm_channel_protocol {
+struct visor_controlvm_channel {
struct channel_header header;
u64 gp_controlvm; /* guest phys addr of this channel */
u64 gp_partition_tables;/* guest phys addr of partition tables */
@@ -371,7 +370,7 @@ struct spar_controlvm_channel_protocol {
u32 message_count; /* CONTROLVM_MESSAGE_MAX */
u64 gp_smbios_table; /* guest phys addr of SMBIOS tables */
u64 gp_physical_smbios_table; /* guest phys addr of SMBIOS table */
- /* ULTRA_MAX_GUESTS_PER_SERVICE */
+ /* VISOR_MAX_GUESTS_PER_SERVICE */
char gp_reserved[2688];
/* guest physical address of EFI firmware image base */
@@ -402,11 +401,10 @@ struct spar_controlvm_channel_protocol {
u32 installation_text_id; /* Id of string to display */
/* Number of remaining installation steps (for progress bars) */
u16 installation_remaining_steps;
- /* ULTRA_TOOL_ACTIONS Installation Action field */
+ /* VISOR_TOOL_ACTIONS Installation Action field */
u8 tool_action;
u8 reserved; /* alignment */
- struct efi_spar_indication efi_spar_ind;
- struct efi_spar_indication efi_spar_ind_supported;
+ struct efi_visor_indication efi_visor_ind;
u32 sp_reserved;
/* Force signals to begin on 128-byte cache line */
u8 reserved2[28];
@@ -444,7 +442,7 @@ struct spar_controlvm_channel_protocol {
* of total_length should equal PayloadBytes. The format of the strings at
* PayloadVmOffset will take different forms depending on the message.
*/
-struct spar_controlvm_parameters_header {
+struct visor_controlvm_parameters_header {
u32 total_length;
u32 header_length;
u32 connection_offset;
diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h b/drivers/staging/unisys/visorbus/vbuschannel.h
index f0ef5ecf3d7d..01d7d517dba7 100644
--- a/drivers/staging/unisys/visorbus/vbuschannel.h
+++ b/drivers/staging/unisys/visorbus/vbuschannel.h
@@ -27,13 +27,12 @@
#include "channel.h"
/* {193b331b-c58f-11da-95a9-00e08161165f} */
-#define SPAR_VBUS_CHANNEL_PROTOCOL_UUID \
+#define VISOR_VBUS_CHANNEL_UUID \
UUID_LE(0x193b331b, 0xc58f, 0x11da, \
0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)
-static const uuid_le spar_vbus_channel_protocol_uuid =
- SPAR_VBUS_CHANNEL_PROTOCOL_UUID;
+static const uuid_le visor_vbus_channel_uuid = VISOR_VBUS_CHANNEL_UUID;
-#define SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE ULTRA_CHANNEL_PROTOCOL_SIGNATURE
+#define VISOR_VBUS_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
/* Must increment this whenever you insert or delete fields within this channel
* struct. Also increment whenever you change the meaning of fields within this
@@ -41,7 +40,7 @@ static const uuid_le spar_vbus_channel_protocol_uuid =
* usually add fields to the END of the channel struct withOUT needing to
* increment this.
*/
-#define SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID 1
+#define VISOR_VBUS_CHANNEL_VERSIONID 1
/*
* An array of this struct is present in the channel area for each vbus.
@@ -49,16 +48,16 @@ static const uuid_le spar_vbus_channel_protocol_uuid =
* It is filled in by the client side to provide info about the device
* and driver from the client's perspective.
*/
-struct ultra_vbus_deviceinfo {
+struct visor_vbus_deviceinfo {
u8 devtype[16]; /* short string identifying the device type */
u8 drvname[16]; /* driver .sys file name */
u8 infostrs[96]; /* kernel version */
u8 reserved[128]; /* pad size to 256 bytes */
} __packed;
-struct spar_vbus_headerinfo {
+struct visor_vbus_headerinfo {
u32 struct_bytes; /* size of this struct in bytes */
- u32 device_info_struct_bytes; /* sizeof(ULTRA_VBUS_DEVICEINFO) */
+ u32 device_info_struct_bytes; /* sizeof(VISOR_VBUS_DEVICEINFO) */
u32 dev_info_count; /* num of items in DevInfo member */
/* (this is the allocated size) */
u32 chp_info_offset; /* byte offset from beginning of this struct */
@@ -70,15 +69,15 @@ struct spar_vbus_headerinfo {
u8 reserved[104];
} __packed;
-struct spar_vbus_channel_protocol {
+struct visor_vbus_channel {
struct channel_header channel_header; /* initialized by server */
- struct spar_vbus_headerinfo hdr_info; /* initialized by server */
+ struct visor_vbus_headerinfo hdr_info; /* initialized by server */
/* the remainder of this channel is filled in by the client */
- struct ultra_vbus_deviceinfo chp_info;
+ struct visor_vbus_deviceinfo chp_info;
/* describes client chipset device and driver */
- struct ultra_vbus_deviceinfo bus_info;
+ struct visor_vbus_deviceinfo bus_info;
/* describes client bus device and driver */
- struct ultra_vbus_deviceinfo dev_info[0];
+ struct visor_vbus_deviceinfo dev_info[0];
/* describes client device and driver for each device on the bus */
} __packed;
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index a692561c81c8..1c785dd19ddd 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -64,9 +64,9 @@ static const struct attribute_group *visorbus_dev_groups[] = {
};
/* filled in with info about parent chipset driver when we register with it */
-static struct ultra_vbus_deviceinfo chipset_driverinfo;
+static struct visor_vbus_deviceinfo chipset_driverinfo;
/* filled in with info about this driver, wrt it servicing client busses */
-static struct ultra_vbus_deviceinfo clientbus_driverinfo;
+static struct visor_vbus_deviceinfo clientbus_driverinfo;
/* list of visor_device structs, linked via .list_all */
static LIST_HEAD(list_all_bus_instances);
@@ -356,9 +356,9 @@ static const struct attribute_group *visorbus_groups[] = {
* /sys/kernel/debug/visorbus/visorbus<n>.
*/
/*
- * vbuschannel_print_devinfo() - format a struct ultra_vbus_deviceinfo
+ * vbuschannel_print_devinfo() - format a struct visor_vbus_deviceinfo
* and write it to a seq_file
- * @devinfo: the struct ultra_vbus_deviceinfo to format
+ * @devinfo: the struct visor_vbus_deviceinfo to format
* @seq: seq_file to write to
* @devix: the device index to be included in the output data, or -1 if no
* device index is to be included
@@ -366,7 +366,7 @@ static const struct attribute_group *visorbus_groups[] = {
* Reads @devInfo, and writes it in human-readable notation to @seq.
*/
static void
-vbuschannel_print_devinfo(struct ultra_vbus_deviceinfo *devinfo,
+vbuschannel_print_devinfo(struct visor_vbus_deviceinfo *devinfo,
struct seq_file *seq, int devix)
{
if (!isprint(devinfo->devtype[0]))
@@ -397,7 +397,7 @@ static int client_bus_info_debugfs_show(struct seq_file *seq, void *v)
int i;
unsigned long off;
- struct ultra_vbus_deviceinfo dev_info;
+ struct visor_vbus_deviceinfo dev_info;
if (!channel)
return 0;
@@ -407,16 +407,14 @@ static int client_bus_info_debugfs_show(struct seq_file *seq, void *v)
((vdev->name) ? (char *)(vdev->name) : ""),
vdev->chipset_bus_no);
if (visorchannel_read(channel,
- offsetof(struct spar_vbus_channel_protocol,
- chp_info),
+ offsetof(struct visor_vbus_channel, chp_info),
&dev_info, sizeof(dev_info)) >= 0)
vbuschannel_print_devinfo(&dev_info, seq, -1);
if (visorchannel_read(channel,
- offsetof(struct spar_vbus_channel_protocol,
- bus_info),
+ offsetof(struct visor_vbus_channel, bus_info),
&dev_info, sizeof(dev_info)) >= 0)
vbuschannel_print_devinfo(&dev_info, seq, -1);
- off = offsetof(struct spar_vbus_channel_protocol, dev_info);
+ off = offsetof(struct visor_vbus_channel, dev_info);
i = 0;
while (off + sizeof(dev_info) <= visorchannel_get_nbytes(channel)) {
if (visorchannel_read(channel, off, &dev_info,
@@ -684,16 +682,16 @@ remove_visor_device(struct visor_device *dev)
static int
get_vbus_header_info(struct visorchannel *chan,
- struct spar_vbus_headerinfo *hdr_info)
+ struct visor_vbus_headerinfo *hdr_info)
{
int err;
- if (!spar_check_channel(visorchannel_get_header(chan),
- spar_vbus_channel_protocol_uuid,
- "vbus",
- sizeof(struct spar_vbus_channel_protocol),
- SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID,
- SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE))
+ if (!visor_check_channel(visorchannel_get_header(chan),
+ visor_vbus_channel_uuid,
+ "vbus",
+ sizeof(struct visor_vbus_channel),
+ VISOR_VBUS_CHANNEL_VERSIONID,
+ VISOR_VBUS_CHANNEL_SIGNATURE))
return -EINVAL;
err = visorchannel_read(chan, sizeof(struct channel_header), hdr_info,
@@ -701,11 +699,11 @@ get_vbus_header_info(struct visorchannel *chan,
if (err < 0)
return err;
- if (hdr_info->struct_bytes < sizeof(struct spar_vbus_headerinfo))
+ if (hdr_info->struct_bytes < sizeof(struct visor_vbus_headerinfo))
return -EINVAL;
if (hdr_info->device_info_struct_bytes <
- sizeof(struct ultra_vbus_deviceinfo))
+ sizeof(struct visor_vbus_deviceinfo))
return -EINVAL;
return 0;
@@ -713,7 +711,7 @@ get_vbus_header_info(struct visorchannel *chan,
/*
* write_vbus_chp_info() - write the contents of <info> to the struct
- * spar_vbus_channel_protocol.chp_info
+ * visor_vbus_channel.chp_info
* @chan: indentifies the s-Par channel that will be updated
* @hdr_info: used to find appropriate channel offset to write data
* @info: contains the information to write
@@ -726,8 +724,8 @@ get_vbus_header_info(struct visorchannel *chan,
*/
static void
write_vbus_chp_info(struct visorchannel *chan,
- struct spar_vbus_headerinfo *hdr_info,
- struct ultra_vbus_deviceinfo *info)
+ struct visor_vbus_headerinfo *hdr_info,
+ struct visor_vbus_deviceinfo *info)
{
int off = sizeof(struct channel_header) + hdr_info->chp_info_offset;
@@ -739,7 +737,7 @@ write_vbus_chp_info(struct visorchannel *chan,
/*
* write_vbus_bus_info() - write the contents of <info> to the struct
- * spar_vbus_channel_protocol.bus_info
+ * visor_vbus_channel.bus_info
* @chan: indentifies the s-Par channel that will be updated
* @hdr_info: used to find appropriate channel offset to write data
* @info: contains the information to write
@@ -752,8 +750,8 @@ write_vbus_chp_info(struct visorchannel *chan,
*/
static void
write_vbus_bus_info(struct visorchannel *chan,
- struct spar_vbus_headerinfo *hdr_info,
- struct ultra_vbus_deviceinfo *info)
+ struct visor_vbus_headerinfo *hdr_info,
+ struct visor_vbus_deviceinfo *info)
{
int off = sizeof(struct channel_header) + hdr_info->bus_info_offset;
@@ -765,7 +763,7 @@ write_vbus_bus_info(struct visorchannel *chan,
/*
* write_vbus_dev_info() - write the contents of <info> to the struct
- * spar_vbus_channel_protocol.dev_info[<devix>]
+ * visor_vbus_channel.dev_info[<devix>]
* @chan: indentifies the s-Par channel that will be updated
* @hdr_info: used to find appropriate channel offset to write data
* @info: contains the information to write
@@ -779,8 +777,8 @@ write_vbus_bus_info(struct visorchannel *chan,
*/
static void
write_vbus_dev_info(struct visorchannel *chan,
- struct spar_vbus_headerinfo *hdr_info,
- struct ultra_vbus_deviceinfo *info, unsigned int devix)
+ struct visor_vbus_headerinfo *hdr_info,
+ struct visor_vbus_deviceinfo *info, unsigned int devix)
{
int off =
(sizeof(struct channel_header) + hdr_info->dev_info_offset) +
@@ -793,10 +791,10 @@ write_vbus_dev_info(struct visorchannel *chan,
}
static void bus_device_info_init(
- struct ultra_vbus_deviceinfo *bus_device_info_ptr,
+ struct visor_vbus_deviceinfo *bus_device_info_ptr,
const char *dev_type, const char *drv_name)
{
- memset(bus_device_info_ptr, 0, sizeof(struct ultra_vbus_deviceinfo));
+ memset(bus_device_info_ptr, 0, sizeof(struct visor_vbus_deviceinfo));
snprintf(bus_device_info_ptr->devtype,
sizeof(bus_device_info_ptr->devtype),
"%s", (dev_type) ? dev_type : "unknownType");
@@ -823,9 +821,9 @@ fix_vbus_dev_info(struct visor_device *visordev)
struct visor_driver *visordrv;
u32 bus_no = visordev->chipset_bus_no;
u32 dev_no = visordev->chipset_dev_no;
- struct ultra_vbus_deviceinfo dev_info;
+ struct visor_vbus_deviceinfo dev_info;
const char *chan_type_name = NULL;
- struct spar_vbus_headerinfo *hdr_info;
+ struct visor_vbus_headerinfo *hdr_info;
if (!visordev->device.driver)
return;
@@ -833,7 +831,7 @@ fix_vbus_dev_info(struct visor_device *visordev)
bdev = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL);
if (!bdev)
return;
- hdr_info = (struct spar_vbus_headerinfo *)bdev->vbus_hdr_info;
+ hdr_info = (struct visor_vbus_headerinfo *)bdev->vbus_hdr_info;
if (!hdr_info)
return;
visordrv = to_visor_driver(visordev->device.driver);
@@ -981,18 +979,18 @@ int visorbus_register_visor_driver(struct visor_driver *drv)
EXPORT_SYMBOL_GPL(visorbus_register_visor_driver);
/*
- * create_bus_instance() - create a device instance for the visor bus itself
+ * visorbus_create_instance() - create a device instance for the visorbus itself
* @dev: struct visor_device indicating the bus instance
*
* Return: 0 for success, otherwise negative errno value indicating reason for
* failure
*/
static int
-create_bus_instance(struct visor_device *dev)
+visorbus_create_instance(struct visor_device *dev)
{
int id = dev->chipset_bus_no;
int err;
- struct spar_vbus_headerinfo *hdr_info;
+ struct visor_vbus_headerinfo *hdr_info;
hdr_info = kzalloc(sizeof(*hdr_info), GFP_KERNEL);
if (!hdr_info)
@@ -1032,16 +1030,16 @@ create_bus_instance(struct visor_device *dev)
err_debugfs_dir:
debugfs_remove_recursive(dev->debugfs_dir);
kfree(hdr_info);
- dev_err(&dev->device, "create_bus_instance failed: %d\n", err);
+ dev_err(&dev->device, "visorbus_create_instance failed: %d\n", err);
return err;
}
/*
- * remove_bus_instance() - remove a device instance for the visor bus itself
+ * visorbus_remove_instance() - remove a device instance for the visorbus itself
* @dev: struct visor_device indentifying the bus to remove
*/
static void
-remove_bus_instance(struct visor_device *dev)
+visorbus_remove_instance(struct visor_device *dev)
{
/*
* Note that this will result in the release method for
@@ -1061,7 +1059,7 @@ remove_bus_instance(struct visor_device *dev)
}
/*
- * remove_all_visor_devices() - remove all child visor bus device instances
+ * remove_all_visor_devices() - remove all child visorbus device instances
*/
static void
remove_all_visor_devices(void)
@@ -1077,29 +1075,29 @@ remove_all_visor_devices(void)
}
int
-chipset_bus_create(struct visor_device *dev)
+visorchipset_bus_create(struct visor_device *dev)
{
int err;
- err = create_bus_instance(dev);
+ err = visorbus_create_instance(dev);
if (err < 0)
return err;
- bus_create_response(dev, err);
+ visorbus_create_response(dev, err);
return 0;
}
void
-chipset_bus_destroy(struct visor_device *dev)
+visorchipset_bus_destroy(struct visor_device *dev)
{
- remove_bus_instance(dev);
- bus_destroy_response(dev, 0);
+ visorbus_remove_instance(dev);
+ visorbus_destroy_response(dev, 0);
}
int
-chipset_device_create(struct visor_device *dev_info)
+visorchipset_device_create(struct visor_device *dev_info)
{
int err;
@@ -1107,17 +1105,17 @@ chipset_device_create(struct visor_device *dev_info)
if (err < 0)
return err;
- device_create_response(dev_info, err);
+ visorbus_device_create_response(dev_info, err);
return 0;
}
void
-chipset_device_destroy(struct visor_device *dev_info)
+visorchipset_device_destroy(struct visor_device *dev_info)
{
remove_visor_device(dev_info);
- device_destroy_response(dev_info, 0);
+ visorbus_device_destroy_response(dev_info, 0);
}
/*
@@ -1137,7 +1135,7 @@ pause_state_change_complete(struct visor_device *dev, int status)
dev->pausing = false;
- device_pause_response(dev, status);
+ visorbus_device_pause_response(dev, status);
}
/*
@@ -1162,12 +1160,12 @@ resume_state_change_complete(struct visor_device *dev, int status)
* which will presumably want to send some sort of response to
* the initiator.
*/
- device_resume_response(dev, status);
+ visorbus_device_resume_response(dev, status);
}
/*
- * initiate_chipset_device_pause_resume() - start a pause or resume operation
- * for a visor device
+ * visorchipset_initiate_device_pause_resume() - start a pause or resume
+ * operation for a visor device
* @dev: struct visor_device identifying the device being paused or resumed
* @is_pause: true to indicate pause operation, false to indicate resume
*
@@ -1177,7 +1175,8 @@ resume_state_change_complete(struct visor_device *dev, int status)
* resume_state_change_complete().
*/
static int
-initiate_chipset_device_pause_resume(struct visor_device *dev, bool is_pause)
+visorchipset_initiate_device_pause_resume(struct visor_device *dev,
+ bool is_pause)
{
int err;
struct visor_driver *drv = NULL;
@@ -1211,7 +1210,7 @@ initiate_chipset_device_pause_resume(struct visor_device *dev, bool is_pause)
}
/**
- * chipset_device_pause() - start a pause operation for a visor device
+ * visorchipset_device_pause() - start a pause operation for a visor device
* @dev_info: struct visor_device identifying the device being paused
*
* Tell the subordinate function driver for a specific device to pause
@@ -1219,11 +1218,11 @@ initiate_chipset_device_pause_resume(struct visor_device *dev, bool is_pause)
* via a callback function; see pause_state_change_complete().
*/
int
-chipset_device_pause(struct visor_device *dev_info)
+visorchipset_device_pause(struct visor_device *dev_info)
{
int err;
- err = initiate_chipset_device_pause_resume(dev_info, true);
+ err = visorchipset_initiate_device_pause_resume(dev_info, true);
if (err < 0) {
dev_info->pausing = false;
@@ -1234,7 +1233,7 @@ chipset_device_pause(struct visor_device *dev_info)
}
/**
- * chipset_device_resume() - start a resume operation for a visor device
+ * visorchipset_device_resume() - start a resume operation for a visor device
* @dev_info: struct visor_device identifying the device being resumed
*
* Tell the subordinate function driver for a specific device to resume
@@ -1242,11 +1241,11 @@ chipset_device_pause(struct visor_device *dev_info)
* via a callback function; see resume_state_change_complete().
*/
int
-chipset_device_resume(struct visor_device *dev_info)
+visorchipset_device_resume(struct visor_device *dev_info)
{
int err;
- err = initiate_chipset_device_pause_resume(dev_info, false);
+ err = visorchipset_initiate_device_pause_resume(dev_info, false);
if (err < 0) {
dev_info->resuming = false;
@@ -1289,7 +1288,7 @@ visorbus_exit(void)
struct visor_device *dev = list_entry(listentry,
struct visor_device,
list_all);
- remove_bus_instance(dev);
+ visorbus_remove_instance(dev);
}
bus_unregister(&visorbus_type);
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h
index 9f030b1f589f..98a5af19189d 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -27,19 +27,19 @@
* command line
*/
-int chipset_bus_create(struct visor_device *bus_info);
-void chipset_bus_destroy(struct visor_device *bus_info);
-int chipset_device_create(struct visor_device *dev_info);
-void chipset_device_destroy(struct visor_device *dev_info);
-int chipset_device_pause(struct visor_device *dev_info);
-int chipset_device_resume(struct visor_device *dev_info);
+int visorchipset_bus_create(struct visor_device *bus_info);
+void visorchipset_bus_destroy(struct visor_device *bus_info);
+int visorchipset_device_create(struct visor_device *dev_info);
+void visorchipset_device_destroy(struct visor_device *dev_info);
+int visorchipset_device_pause(struct visor_device *dev_info);
+int visorchipset_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);
+void visorbus_create_response(struct visor_device *p, int response);
+void visorbus_destroy_response(struct visor_device *p, int response);
+void visorbus_device_create_response(struct visor_device *p, int response);
+void visorbus_device_destroy_response(struct visor_device *p, int response);
+void visorbus_device_resume_response(struct visor_device *p, int response);
+void visorbus_device_pause_response(struct visor_device *p, int response);
int visorbus_init(void);
void visorbus_exit(void);
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c
index 9e1cea22ce68..6885c2cb7135 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -28,11 +28,11 @@
#define MYDRVNAME "visorchannel"
-#define SPAR_CONSOLEVIDEO_CHANNEL_PROTOCOL_GUID \
+#define VISOR_CONSOLEVIDEO_CHANNEL_GUID \
UUID_LE(0x3cd6e705, 0xd6a2, 0x4aa5, \
0xad, 0x5c, 0x7b, 0x8, 0x88, 0x9d, 0xff, 0xe2)
-static const uuid_le spar_video_guid = SPAR_CONSOLEVIDEO_CHANNEL_PROTOCOL_GUID;
+static const uuid_le visor_video_guid = VISOR_CONSOLEVIDEO_CHANNEL_GUID;
struct visorchannel {
u64 physaddr;
@@ -415,7 +415,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
* release later on.
*/
channel->requested = request_mem_region(physaddr, size, MYDRVNAME);
- if (!channel->requested && uuid_le_cmp(guid, spar_video_guid))
+ if (!channel->requested && uuid_le_cmp(guid, visor_video_guid))
/* we only care about errors if this is not the video channel */
goto err_destroy_channel;
@@ -445,7 +445,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
channel->mapped = NULL;
channel->requested = request_mem_region(channel->physaddr,
channel_bytes, MYDRVNAME);
- if (!channel->requested && uuid_le_cmp(guid, spar_video_guid))
+ if (!channel->requested && uuid_le_cmp(guid, visor_video_guid))
/* we only care about errors if this is not the video channel */
goto err_destroy_channel;
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 4cfd0fae9bd5..22150564b4fb 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -34,12 +34,12 @@
#define MAX_CONTROLVM_PAYLOAD_BYTES (1024 * 128)
-#define UNISYS_SPAR_LEAF_ID 0x40000000
+#define UNISYS_VISOR_LEAF_ID 0x40000000
/* The s-Par leaf ID returns "UnisysSpar64" encoded across ebx, ecx, edx */
-#define UNISYS_SPAR_ID_EBX 0x73696e55
-#define UNISYS_SPAR_ID_ECX 0x70537379
-#define UNISYS_SPAR_ID_EDX 0x34367261
+#define UNISYS_VISOR_ID_EBX 0x73696e55
+#define UNISYS_VISOR_ID_ECX 0x70537379
+#define UNISYS_VISOR_ID_EDX 0x34367261
/*
* When the controlvm channel is idle for at least MIN_IDLE_SECONDS,
@@ -101,7 +101,7 @@ static ssize_t toolaction_show(struct device *dev,
int err;
err = visorchannel_read(chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
+ offsetof(struct visor_controlvm_channel,
tool_action),
&tool_action, sizeof(u8));
if (err)
@@ -120,11 +120,10 @@ static ssize_t toolaction_store(struct device *dev,
if (kstrtou8(buf, 10, &tool_action))
return -EINVAL;
- err = visorchannel_write
- (chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
- tool_action),
- &tool_action, sizeof(u8));
+ err = visorchannel_write(chipset_dev->controlvm_channel,
+ offsetof(struct visor_controlvm_channel,
+ tool_action),
+ &tool_action, sizeof(u8));
if (err)
return err;
@@ -136,18 +135,18 @@ static ssize_t boottotool_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct efi_spar_indication efi_spar_indication;
+ struct efi_visor_indication efi_visor_indication;
int err;
err = visorchannel_read(chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
- efi_spar_ind),
- &efi_spar_indication,
- sizeof(struct efi_spar_indication));
+ offsetof(struct visor_controlvm_channel,
+ efi_visor_ind),
+ &efi_visor_indication,
+ sizeof(struct efi_visor_indication));
if (err)
return err;
- return sprintf(buf, "%u\n", efi_spar_indication.boot_to_tool);
+ return sprintf(buf, "%u\n", efi_visor_indication.boot_to_tool);
}
static ssize_t boottotool_store(struct device *dev,
@@ -155,17 +154,17 @@ static ssize_t boottotool_store(struct device *dev,
const char *buf, size_t count)
{
int val, err;
- struct efi_spar_indication efi_spar_indication;
+ struct efi_visor_indication efi_visor_indication;
if (kstrtoint(buf, 10, &val))
return -EINVAL;
- efi_spar_indication.boot_to_tool = val;
- err = visorchannel_write
- (chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
- efi_spar_ind), &(efi_spar_indication),
- sizeof(struct efi_spar_indication));
+ efi_visor_indication.boot_to_tool = val;
+ err = visorchannel_write(chipset_dev->controlvm_channel,
+ offsetof(struct visor_controlvm_channel,
+ efi_visor_ind),
+ &(efi_visor_indication),
+ sizeof(struct efi_visor_indication));
if (err)
return err;
@@ -180,7 +179,7 @@ static ssize_t error_show(struct device *dev, struct device_attribute *attr,
int err;
err = visorchannel_read(chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
+ offsetof(struct visor_controlvm_channel,
installation_error),
&error, sizeof(u32));
if (err)
@@ -197,11 +196,10 @@ static ssize_t error_store(struct device *dev, struct device_attribute *attr,
if (kstrtou32(buf, 10, &error))
return -EINVAL;
- err = visorchannel_write
- (chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
- installation_error),
- &error, sizeof(u32));
+ err = visorchannel_write(chipset_dev->controlvm_channel,
+ offsetof(struct visor_controlvm_channel,
+ installation_error),
+ &error, sizeof(u32));
if (err)
return err;
return count;
@@ -214,11 +212,10 @@ static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
u32 text_id = 0;
int err;
- err = visorchannel_read
- (chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
- installation_text_id),
- &text_id, sizeof(u32));
+ err = visorchannel_read(chipset_dev->controlvm_channel,
+ offsetof(struct visor_controlvm_channel,
+ installation_text_id),
+ &text_id, sizeof(u32));
if (err)
return err;
@@ -234,11 +231,10 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
if (kstrtou32(buf, 10, &text_id))
return -EINVAL;
- err = visorchannel_write
- (chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
- installation_text_id),
- &text_id, sizeof(u32));
+ err = visorchannel_write(chipset_dev->controlvm_channel,
+ offsetof(struct visor_controlvm_channel,
+ installation_text_id),
+ &text_id, sizeof(u32));
if (err)
return err;
return count;
@@ -252,7 +248,7 @@ static ssize_t remaining_steps_show(struct device *dev,
int err;
err = visorchannel_read(chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
+ offsetof(struct visor_controlvm_channel,
installation_remaining_steps),
&remaining_steps, sizeof(u16));
if (err)
@@ -271,11 +267,10 @@ static ssize_t remaining_steps_store(struct device *dev,
if (kstrtou16(buf, 10, &remaining_steps))
return -EINVAL;
- err = visorchannel_write
- (chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
- installation_remaining_steps),
- &remaining_steps, sizeof(u16));
+ err = visorchannel_write(chipset_dev->controlvm_channel,
+ offsetof(struct visor_controlvm_channel,
+ installation_remaining_steps),
+ &remaining_steps, sizeof(u16));
if (err)
return err;
return count;
@@ -285,9 +280,9 @@ static DEVICE_ATTR_RW(remaining_steps);
static uuid_le
parser_id_get(struct parser_context *ctx)
{
- struct spar_controlvm_parameters_header *phdr = NULL;
+ struct visor_controlvm_parameters_header *phdr = NULL;
- phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
+ phdr = (struct visor_controlvm_parameters_header *)(ctx->data);
return phdr->id;
}
@@ -331,9 +326,9 @@ parser_string_get(struct parser_context *ctx)
static void *
parser_name_get(struct parser_context *ctx)
{
- struct spar_controlvm_parameters_header *phdr = NULL;
+ struct visor_controlvm_parameters_header *phdr = NULL;
- phdr = (struct spar_controlvm_parameters_header *)(ctx->data);
+ phdr = (struct visor_controlvm_parameters_header *)(ctx->data);
if (phdr->name_offset + phdr->name_length > ctx->param_bytes)
return NULL;
@@ -400,7 +395,7 @@ controlvm_init_response(struct controlvm_message *msg,
static int
controlvm_respond_chipset_init(struct controlvm_message_header *msg_hdr,
int response,
- enum ultra_chipset_feature features)
+ enum visor_chipset_feature features)
{
struct controlvm_message outmsg;
@@ -414,7 +409,7 @@ static int
chipset_init(struct controlvm_message *inmsg)
{
static int chipset_inited;
- enum ultra_chipset_feature features = 0;
+ enum visor_chipset_feature features = 0;
int rc = CONTROLVM_RESP_SUCCESS;
int res = 0;
@@ -430,13 +425,13 @@ chipset_init(struct controlvm_message *inmsg)
* also supports it).
*/
features = inmsg->cmd.init_chipset.features &
- ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG;
+ VISOR_CHIPSET_FEATURE_PARA_HOTPLUG;
/*
* Set the "reply" bit so Command knows this is a
* features-aware driver.
*/
- features |= ULTRA_CHIPSET_FEATURE_REPLY;
+ features |= VISOR_CHIPSET_FEATURE_REPLY;
out_respond:
if (inmsg->hdr.flags.response_expected)
@@ -447,7 +442,7 @@ out_respond:
static int
controlvm_respond(struct controlvm_message_header *msg_hdr, int response,
- struct spar_segment_state *state)
+ struct visor_segment_state *state)
{
struct controlvm_message outmsg;
@@ -470,14 +465,14 @@ enum crash_obj_type {
};
static int
-save_crash_message(struct controlvm_message *msg, enum crash_obj_type typ)
+save_crash_message(struct controlvm_message *msg, enum crash_obj_type cr_type)
{
u32 local_crash_msg_offset;
u16 local_crash_msg_count;
int err;
err = visorchannel_read(chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
+ offsetof(struct visor_controlvm_channel,
saved_crash_message_count),
&local_crash_msg_count, sizeof(u16));
if (err) {
@@ -493,7 +488,7 @@ save_crash_message(struct controlvm_message *msg, enum crash_obj_type typ)
}
err = visorchannel_read(chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
+ offsetof(struct visor_controlvm_channel,
saved_crash_message_offset),
&local_crash_msg_offset, sizeof(u32));
if (err) {
@@ -502,7 +497,7 @@ save_crash_message(struct controlvm_message *msg, enum crash_obj_type typ)
return err;
}
- switch (typ) {
+ switch (cr_type) {
case CRASH_DEV:
local_crash_msg_offset += sizeof(struct controlvm_message);
err = visorchannel_write(chipset_dev->controlvm_channel,
@@ -551,7 +546,7 @@ controlvm_responder(enum controlvm_id cmd_id,
static int
device_changestate_responder(enum controlvm_id cmd_id,
struct visor_device *p, int response,
- struct spar_segment_state response_state)
+ struct visor_segment_state response_state)
{
struct controlvm_message outmsg;
u32 bus_no = p->chipset_bus_no;
@@ -573,7 +568,7 @@ device_changestate_responder(enum controlvm_id cmd_id,
}
static int
-bus_create(struct controlvm_message *inmsg)
+visorbus_create(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
struct controlvm_message_header *pmsg_hdr = NULL;
@@ -585,7 +580,7 @@ bus_create(struct controlvm_message *inmsg)
bus_info = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL);
if (bus_info && (bus_info->state.created == 1)) {
dev_err(&chipset_dev->acpi_device->dev,
- "failed bus_create: already exists\n");
+ "failed visorbus_create: already exists\n");
err = -EEXIST;
goto err_respond;
}
@@ -600,7 +595,7 @@ bus_create(struct controlvm_message *inmsg)
bus_info->chipset_bus_no = bus_no;
bus_info->chipset_dev_no = BUS_ROOT_DEVICE;
- if (uuid_le_cmp(cmd->create_bus.bus_inst_uuid, spar_siovm_uuid) == 0) {
+ if (uuid_le_cmp(cmd->create_bus.bus_inst_uuid, visor_siovm_uuid) == 0) {
err = save_crash_message(inmsg, CRASH_BUS);
if (err)
goto err_free_bus_info;
@@ -630,9 +625,9 @@ bus_create(struct controlvm_message *inmsg)
}
bus_info->visorchannel = visorchannel;
- /* Response will be handled by chipset_bus_create */
- err = chipset_bus_create(bus_info);
- /* If error chipset_bus_create didn't respond, need to respond here */
+ /* Response will be handled by visorchipset_bus_create */
+ err = visorchipset_bus_create(bus_info);
+ /* If visorchipset_bus_create didn't respond, need to respond here */
if (err)
goto err_destroy_channel;
@@ -654,7 +649,7 @@ err_respond:
}
static int
-bus_destroy(struct controlvm_message *inmsg)
+visorbus_destroy(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
struct controlvm_message_header *pmsg_hdr = NULL;
@@ -688,8 +683,8 @@ bus_destroy(struct controlvm_message *inmsg)
bus_info->pending_msg_hdr = pmsg_hdr;
}
- /* Response will be handled by chipset_bus_destroy */
- chipset_bus_destroy(bus_info);
+ /* Response will be handled by visorchipset_bus_destroy */
+ visorchipset_bus_destroy(bus_info);
return 0;
err_respond:
@@ -699,8 +694,8 @@ err_respond:
}
static int
-bus_configure(struct controlvm_message *inmsg,
- struct parser_context *parser_ctx)
+visorbus_configure(struct controlvm_message *inmsg,
+ struct parser_context *parser_ctx)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
u32 bus_no;
@@ -737,14 +732,14 @@ bus_configure(struct controlvm_message *inmsg,
err_respond:
dev_err(&chipset_dev->acpi_device->dev,
- "bus_configured exited with err: %d\n", err);
+ "visorbus_configure exited with err: %d\n", err);
if (inmsg->hdr.flags.response_expected == 1)
controlvm_responder(inmsg->hdr.id, &inmsg->hdr, err);
return err;
}
static int
-my_device_create(struct controlvm_message *inmsg)
+visorbus_device_create(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
struct controlvm_message_header *pmsg_hdr = NULL;
@@ -807,7 +802,7 @@ my_device_create(struct controlvm_message *inmsg)
dev_info->visorchannel = visorchannel;
dev_info->channel_type_guid = cmd->create_device.data_type_uuid;
if (uuid_le_cmp(cmd->create_device.data_type_uuid,
- spar_vhba_channel_protocol_uuid) == 0) {
+ visor_vhba_channel_uuid) == 0) {
err = save_crash_message(inmsg, CRASH_DEV);
if (err)
goto err_destroy_visorchannel;
@@ -824,8 +819,8 @@ my_device_create(struct controlvm_message *inmsg)
sizeof(struct controlvm_message_header));
dev_info->pending_msg_hdr = pmsg_hdr;
}
- /* Chipset_device_create will send response */
- err = chipset_device_create(dev_info);
+ /* visorchipset_device_create will send response */
+ err = visorchipset_device_create(dev_info);
if (err)
goto err_destroy_visorchannel;
@@ -844,13 +839,13 @@ err_respond:
}
static int
-my_device_changestate(struct controlvm_message *inmsg)
+visorbus_device_changestate(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
struct controlvm_message_header *pmsg_hdr = NULL;
u32 bus_no = cmd->device_change_state.bus_no;
u32 dev_no = cmd->device_change_state.dev_no;
- struct spar_segment_state state = cmd->device_change_state.state;
+ struct visor_segment_state state = cmd->device_change_state.state;
struct visor_device *dev_info;
int err = 0;
@@ -882,16 +877,16 @@ my_device_changestate(struct controlvm_message *inmsg)
if (state.alive == segment_state_running.alive &&
state.operating == segment_state_running.operating)
- /* Response will be sent from chipset_device_resume */
- err = chipset_device_resume(dev_info);
+ /* Response will be sent from visorchipset_device_resume */
+ err = visorchipset_device_resume(dev_info);
/* ServerNotReady / ServerLost / SegmentStateStandby */
else if (state.alive == segment_state_standby.alive &&
state.operating == segment_state_standby.operating)
/*
* technically this is standby case where server is lost.
- * Response will be sent from chipset_device_pause.
+ * Response will be sent from visorchipset_device_pause.
*/
- err = chipset_device_pause(dev_info);
+ err = visorchipset_device_pause(dev_info);
if (err)
goto err_respond;
@@ -905,7 +900,7 @@ err_respond:
}
static int
-my_device_destroy(struct controlvm_message *inmsg)
+visorbus_device_destroy(struct controlvm_message *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
struct controlvm_message_header *pmsg_hdr = NULL;
@@ -941,7 +936,7 @@ my_device_destroy(struct controlvm_message *inmsg)
dev_info->pending_msg_hdr = pmsg_hdr;
}
- chipset_device_destroy(dev_info);
+ visorchipset_device_destroy(dev_info);
return 0;
err_respond:
@@ -1179,15 +1174,15 @@ parahotplug_request_kickoff(struct parahotplug_request *req)
env_cmd, env_id, env_state, env_bus, env_dev, env_func, NULL
};
- sprintf(env_cmd, "SPAR_PARAHOTPLUG=1");
- sprintf(env_id, "SPAR_PARAHOTPLUG_ID=%d", req->id);
- sprintf(env_state, "SPAR_PARAHOTPLUG_STATE=%d",
+ sprintf(env_cmd, "VISOR_PARAHOTPLUG=1");
+ sprintf(env_id, "VISOR_PARAHOTPLUG_ID=%d", req->id);
+ sprintf(env_state, "VISOR_PARAHOTPLUG_STATE=%d",
cmd->device_change_state.state.active);
- sprintf(env_bus, "SPAR_PARAHOTPLUG_BUS=%d",
+ sprintf(env_bus, "VISOR_PARAHOTPLUG_BUS=%d",
cmd->device_change_state.bus_no);
- sprintf(env_dev, "SPAR_PARAHOTPLUG_DEVICE=%d",
+ sprintf(env_dev, "VISOR_PARAHOTPLUG_DEVICE=%d",
cmd->device_change_state.dev_no >> 3);
- sprintf(env_func, "SPAR_PARAHOTPLUG_FUNCTION=%d",
+ sprintf(env_func, "VISOR_PARAHOTPLUG_FUNCTION=%d",
cmd->device_change_state.dev_no & 0x7);
return kobject_uevent_env(&chipset_dev->acpi_device->dev.kobj,
@@ -1387,7 +1382,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
/* get saved message count */
if (visorchannel_read(chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
+ offsetof(struct visor_controlvm_channel,
saved_crash_message_count),
&local_crash_msg_count, sizeof(u16)) < 0) {
dev_err(&chipset_dev->acpi_device->dev,
@@ -1403,7 +1398,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
/* get saved crash message offset */
if (visorchannel_read(chipset_dev->controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
+ offsetof(struct visor_controlvm_channel,
saved_crash_message_offset),
&local_crash_msg_offset, sizeof(u32)) < 0) {
dev_err(&chipset_dev->acpi_device->dev,
@@ -1438,7 +1433,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
"no valid create_bus message\n");
return;
}
- bus_create(&local_crash_bus_msg);
+ visorbus_create(&local_crash_bus_msg);
/* reuse create device message for storage device */
if (!local_crash_dev_msg.cmd.create_device.channel_addr) {
@@ -1446,11 +1441,11 @@ setup_crash_devices_work_queue(struct work_struct *work)
"no valid create_device message\n");
return;
}
- my_device_create(&local_crash_dev_msg);
+ visorbus_device_create(&local_crash_dev_msg);
}
void
-bus_create_response(struct visor_device *bus_info, int response)
+visorbus_create_response(struct visor_device *bus_info, int response)
{
if (response >= 0)
bus_info->state.created = 1;
@@ -1463,7 +1458,7 @@ bus_create_response(struct visor_device *bus_info, int response)
}
void
-bus_destroy_response(struct visor_device *bus_info, int response)
+visorbus_destroy_response(struct visor_device *bus_info, int response)
{
controlvm_responder(CONTROLVM_BUS_DESTROY, bus_info->pending_msg_hdr,
response);
@@ -1473,7 +1468,7 @@ bus_destroy_response(struct visor_device *bus_info, int response)
}
void
-device_create_response(struct visor_device *dev_info, int response)
+visorbus_device_create_response(struct visor_device *dev_info, int response)
{
if (response >= 0)
dev_info->state.created = 1;
@@ -1486,7 +1481,7 @@ device_create_response(struct visor_device *dev_info, int response)
}
void
-device_destroy_response(struct visor_device *dev_info, int response)
+visorbus_device_destroy_response(struct visor_device *dev_info, int response)
{
controlvm_responder(CONTROLVM_DEVICE_DESTROY, dev_info->pending_msg_hdr,
response);
@@ -1496,8 +1491,7 @@ device_destroy_response(struct visor_device *dev_info, int response)
}
void
-device_pause_response(struct visor_device *dev_info,
- int response)
+visorbus_device_pause_response(struct visor_device *dev_info, int response)
{
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
dev_info, response,
@@ -1508,7 +1502,7 @@ device_pause_response(struct visor_device *dev_info,
}
void
-device_resume_response(struct visor_device *dev_info, int response)
+visorbus_device_resume_response(struct visor_device *dev_info, int response)
{
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
dev_info, response,
@@ -1599,9 +1593,6 @@ handle_command(struct controlvm_message inmsg, u64 channel_addr)
/* create parsing context if necessary */
local_addr = (inmsg.hdr.flags.test_message == 1);
- if (channel_addr == 0)
- return -EINVAL;
-
parm_addr = channel_addr + inmsg.hdr.payload_vm_offset;
parm_bytes = inmsg.hdr.payload_bytes;
@@ -1634,16 +1625,16 @@ handle_command(struct controlvm_message inmsg, u64 channel_addr)
err = chipset_init(&inmsg);
break;
case CONTROLVM_BUS_CREATE:
- err = bus_create(&inmsg);
+ err = visorbus_create(&inmsg);
break;
case CONTROLVM_BUS_DESTROY:
- err = bus_destroy(&inmsg);
+ err = visorbus_destroy(&inmsg);
break;
case CONTROLVM_BUS_CONFIGURE:
- err = bus_configure(&inmsg, parser_ctx);
+ err = visorbus_configure(&inmsg, parser_ctx);
break;
case CONTROLVM_DEVICE_CREATE:
- err = my_device_create(&inmsg);
+ err = visorbus_device_create(&inmsg);
break;
case CONTROLVM_DEVICE_CHANGESTATE:
if (cmd->device_change_state.flags.phys_device) {
@@ -1653,12 +1644,12 @@ handle_command(struct controlvm_message inmsg, u64 channel_addr)
* save the hdr and cmd structures for later use
* when sending back the response to Command
*/
- err = my_device_changestate(&inmsg);
+ err = visorbus_device_changestate(&inmsg);
break;
}
break;
case CONTROLVM_DEVICE_DESTROY:
- err = my_device_destroy(&inmsg);
+ err = visorbus_device_destroy(&inmsg);
break;
case CONTROLVM_DEVICE_CONFIGURE:
/* no op just send a respond that we passed */
@@ -1793,6 +1784,11 @@ controlvm_periodic_work(struct work_struct *work)
/* parahotplug_worker */
parahotplug_process_list();
+/*
+ * The controlvm messages are sent in a bulk. If we start receiving messages, we
+ * want the polling to be fast. If we do not receive any message for
+ * MIN_IDLE_SECONDS, we can slow down the polling.
+ */
schedule_out:
if (time_after(jiffies, chipset_dev->most_recent_message_jiffies +
(HZ * MIN_IDLE_SECONDS))) {
@@ -1821,7 +1817,7 @@ visorchipset_init(struct acpi_device *acpi_device)
{
int err = -ENODEV;
u64 addr;
- uuid_le uuid = SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
+ uuid_le uuid = VISOR_CONTROLVM_CHANNEL_UUID;
struct visorchannel *controlvm_channel;
chipset_dev = kzalloc(sizeof(*chipset_dev), GFP_KERNEL);
@@ -1849,7 +1845,7 @@ visorchipset_init(struct acpi_device *acpi_device)
if (err < 0)
goto error_destroy_channel;
- if (!SPAR_CONTROLVM_CHANNEL_OK_CLIENT(
+ if (!VISOR_CONTROLVM_CHANNEL_OK_CLIENT(
visorchannel_get_header(controlvm_channel)))
goto error_delete_groups;
@@ -1928,10 +1924,10 @@ static __init int visorutil_spar_detect(void)
if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
/* check the ID */
- cpuid(UNISYS_SPAR_LEAF_ID, &eax, &ebx, &ecx, &edx);
- return (ebx == UNISYS_SPAR_ID_EBX) &&
- (ecx == UNISYS_SPAR_ID_ECX) &&
- (edx == UNISYS_SPAR_ID_EDX);
+ cpuid(UNISYS_VISOR_LEAF_ID, &eax, &ebx, &ecx, &edx);
+ return (ebx == UNISYS_VISOR_ID_EBX) &&
+ (ecx == UNISYS_VISOR_ID_ECX) &&
+ (edx == UNISYS_VISOR_ID_EDX);
} else {
return 0;
}
diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c
index 6997b16b4dcd..a6e7a6bbc428 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -37,14 +37,14 @@ static struct dentry *visorhba_debugfs_dir;
/* GUIDS for HBA channel type supported by this driver */
static struct visor_channeltype_descriptor visorhba_channel_types[] = {
/* Note that the only channel type we expect to be reported by the
- * bus driver is the SPAR_VHBA channel.
+ * bus driver is the VISOR_VHBA channel.
*/
- { SPAR_VHBA_CHANNEL_PROTOCOL_UUID, "sparvhba" },
+ { VISOR_VHBA_CHANNEL_UUID, "sparvhba" },
{ NULL_UUID_LE, NULL }
};
MODULE_DEVICE_TABLE(visorbus, visorhba_channel_types);
-MODULE_ALIAS("visorbus:" SPAR_VHBA_CHANNEL_PROTOCOL_UUID_STR);
+MODULE_ALIAS("visorbus:" VISOR_VHBA_CHANNEL_UUID_STR);
struct visordisk_info {
u32 valid;
@@ -657,7 +657,7 @@ static int info_debugfs_show(struct seq_file *seq, void *v)
seq_printf(seq, "phys_flags_addr = 0x%016llx\n",
phys_flags_addr);
seq_printf(seq, "FeatureFlags = %llu\n",
- (__le64)readq(devdata->flags_addr));
+ (u64)readq(devdata->flags_addr));
}
seq_printf(seq, "acquire_failed_cnt = %llu\n",
devdata->acquire_failed_cnt);
@@ -1060,8 +1060,7 @@ static int visorhba_probe(struct visor_device *dev)
if (!scsihost)
return -ENODEV;
- channel_offset = offsetof(struct spar_io_channel_protocol,
- vhba.max);
+ channel_offset = offsetof(struct visor_io_channel, vhba.max);
err = visorbus_read_channel(dev, channel_offset, &max,
sizeof(struct vhba_config_max));
if (err < 0)
@@ -1091,7 +1090,7 @@ static int visorhba_probe(struct visor_device *dev)
goto err_scsi_remove_host;
}
devdata->debugfs_info =
- debugfs_create_file("info", S_IRUSR | S_IRGRP,
+ debugfs_create_file("info", 0440,
devdata->debugfs_dir, devdata,
&info_debugfs_fops);
if (!devdata->debugfs_info) {
@@ -1105,12 +1104,12 @@ static int visorhba_probe(struct visor_device *dev)
devdata->serverchangingstate = false;
devdata->scsihost = scsihost;
- channel_offset = offsetof(struct spar_io_channel_protocol,
+ channel_offset = offsetof(struct visor_io_channel,
channel_header.features);
err = visorbus_read_channel(dev, channel_offset, &features, 8);
if (err)
goto err_debugfs_info;
- features |= ULTRA_IO_CHANNEL_IS_POLLING;
+ features |= VISOR_CHANNEL_IS_POLLING;
err = visorbus_write_channel(dev, channel_offset, &features, 8);
if (err)
goto err_debugfs_info;
@@ -1166,7 +1165,7 @@ static void visorhba_remove(struct visor_device *dev)
debugfs_remove_recursive(devdata->debugfs_dir);
}
-/* This is used to tell the visor bus driver which types of visor devices
+/* This is used to tell the visorbus driver which types of visor devices
* we support, and what functions to call when a visor device that we support
* is attached or removed.
*/
diff --git a/drivers/staging/unisys/visorinput/ultrainputreport.h b/drivers/staging/unisys/visorinput/ultrainputreport.h
index 53dde7c53809..a4baea53c518 100644
--- a/drivers/staging/unisys/visorinput/ultrainputreport.h
+++ b/drivers/staging/unisys/visorinput/ultrainputreport.h
@@ -17,26 +17,23 @@
#include <linux/types.h>
-/* Identifies mouse and keyboard activity which is specified by the firmware to
- * the host using the cmsimpleinput protocol. @ingroup coretypes
+/* These defines identify mouse and keyboard activity which is specified by the
+ * firmware to the host using the cmsimpleinput protocol. @ingroup coretypes
*/
-enum ultra_inputaction {
- inputaction_none = 0,
- inputaction_xy_motion = 1, /* only motion; arg1=x, arg2=y */
- inputaction_mouse_button_down = 2, /* arg1: 1=left,2=center,3=right */
- inputaction_mouse_button_up = 3, /* arg1: 1=left,2=center,3=right */
- inputaction_mouse_button_click = 4, /* arg1: 1=left,2=center,3=right */
- inputaction_mouse_button_dclick = 5, /* arg1: 1=left,2=center,
- * 3=right
- */
- inputaction_wheel_rotate_away = 6, /* arg1: wheel rotation away from
- * user
- */
- inputaction_wheel_rotate_toward = 7, /* arg1: wheel rotation toward
- * user
- */
- inputaction_set_max_xy = 8, /* set screen maxXY; arg1=x, arg2=y */
- inputaction_key_down = 64, /* arg1: scancode, as follows:
+#define INPUTACTION_XY_MOTION 1 /* only motion; arg1=x, arg2=y */
+#define INPUTACTION_MOUSE_BUTTON_DOWN 2 /* arg1: 1=left,2=center,3=right */
+#define INPUTACTION_MOUSE_BUTTON_UP 3 /* arg1: 1=left,2=center,3=right */
+#define INPUTACTION_MOUSE_BUTTON_CLICK 4 /* arg1: 1=left,2=center,3=right */
+#define INPUTACTION_MOUSE_BUTTON_DCLICK 5 /* arg1: 1=left,2=center,
+ * 3=right
+ */
+#define INPUTACTION_WHEEL_ROTATE_AWAY 6 /* arg1: wheel rotation away from
+ * user
+ */
+#define INPUTACTION_WHEEL_ROTATE_TOWARD 7 /* arg1: wheel rotation toward
+ * user
+ */
+#define INPUTACTION_KEY_DOWN 64 /* arg1: scancode, as follows:
* If arg1 <= 0xff, it's a 1-byte
* scancode and arg1 is that scancode.
* If arg1 > 0xff, it's a 2-byte
@@ -45,10 +42,10 @@ enum ultra_inputaction {
* high 8 bits. E.g., the right ALT key
* would appear as x'38e0'.
*/
- inputaction_key_up = 65, /* arg1: scancode (in same format as
+#define INPUTACTION_KEY_UP 65 /* arg1: scancode (in same format as
* inputaction_keyDown)
*/
- inputaction_set_locking_key_state = 66,
+#define INPUTACTION_SET_LOCKING_KEY_STATE 66
/* arg1: scancode (in same format
* as inputaction_keyDown);
* MUST refer to one of the
@@ -58,22 +55,20 @@ enum ultra_inputaction {
* in the LOCKED position
* (e.g., light is ON)
*/
- inputaction_key_down_up = 67, /* arg1: scancode (in same format
+#define INPUTACTION_KEY_DOWN_UP 67 /* arg1: scancode (in same format
* as inputaction_keyDown)
*/
- inputaction_last
-};
-struct ultra_inputactivity {
+struct visor_inputactivity {
u16 action;
u16 arg1;
u16 arg2;
u16 arg3;
} __packed;
-struct ultra_inputreport {
+struct visor_inputreport {
u64 seq_no;
- struct ultra_inputactivity activity;
+ struct visor_inputactivity activity;
} __packed;
#endif
diff --git a/drivers/staging/unisys/visorinput/visorinput.c b/drivers/staging/unisys/visorinput/visorinput.c
index cdd35437f0a0..45bc340d4e9d 100644
--- a/drivers/staging/unisys/visorinput/visorinput.c
+++ b/drivers/staging/unisys/visorinput/visorinput.c
@@ -33,17 +33,16 @@
#include "ultrainputreport.h"
/* Keyboard channel {c73416d0-b0b8-44af-b304-9d2ae99f1b3d} */
-#define SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID \
+#define VISOR_KEYBOARD_CHANNEL_UUID \
UUID_LE(0xc73416d0, 0xb0b8, 0x44af, \
0xb3, 0x4, 0x9d, 0x2a, 0xe9, 0x9f, 0x1b, 0x3d)
-#define SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR "c73416d0-b0b8-44af-b304-9d2ae99f1b3d"
+#define VISOR_KEYBOARD_CHANNEL_UUID_STR "c73416d0-b0b8-44af-b304-9d2ae99f1b3d"
/* Mouse channel {addf07d4-94a9-46e2-81c3-61abcdbdbd87} */
-#define SPAR_MOUSE_CHANNEL_PROTOCOL_UUID \
+#define VISOR_MOUSE_CHANNEL_UUID \
UUID_LE(0xaddf07d4, 0x94a9, 0x46e2, \
0x81, 0xc3, 0x61, 0xab, 0xcd, 0xbd, 0xbd, 0x87)
-#define SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR \
- "addf07d4-94a9-46e2-81c3-61abcdbdbd87"
+#define VISOR_MOUSE_CHANNEL_UUID_STR "addf07d4-94a9-46e2-81c3-61abcdbdbd87"
#define PIXELS_ACROSS_DEFAULT 800
#define PIXELS_DOWN_DEFAULT 600
@@ -70,10 +69,8 @@ struct visorinput_devdata {
unsigned char keycode_table[0];
};
-static const uuid_le spar_keyboard_channel_protocol_uuid =
- SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID;
-static const uuid_le spar_mouse_channel_protocol_uuid =
- SPAR_MOUSE_CHANNEL_PROTOCOL_UUID;
+static const uuid_le visor_keyboard_channel_uuid = VISOR_KEYBOARD_CHANNEL_UUID;
+static const uuid_le visor_mouse_channel_uuid = VISOR_MOUSE_CHANNEL_UUID;
/*
* Borrowed from drivers/input/keyboard/atakbd.c
@@ -456,9 +453,9 @@ visorinput_probe(struct visor_device *dev)
enum visorinput_device_type devtype;
guid = visorchannel_get_uuid(dev->visorchannel);
- if (uuid_le_cmp(guid, spar_mouse_channel_protocol_uuid) == 0)
+ if (uuid_le_cmp(guid, visor_mouse_channel_uuid) == 0)
devtype = visorinput_mouse;
- else if (uuid_le_cmp(guid, spar_keyboard_channel_protocol_uuid) == 0)
+ else if (uuid_le_cmp(guid, visor_keyboard_channel_uuid) == 0)
devtype = visorinput_keyboard;
else
return -ENODEV;
@@ -568,7 +565,7 @@ calc_button(int x)
static void
visorinput_channel_interrupt(struct visor_device *dev)
{
- struct ultra_inputreport r;
+ struct visor_inputreport r;
int scancode, keycode;
struct input_dev *visorinput_dev;
int xmotion, ymotion, button;
@@ -585,46 +582,46 @@ visorinput_channel_interrupt(struct visor_device *dev)
scancode = r.activity.arg1;
keycode = scancode_to_keycode(scancode);
switch (r.activity.action) {
- case inputaction_key_down:
+ case INPUTACTION_KEY_DOWN:
input_report_key(visorinput_dev, keycode, 1);
input_sync(visorinput_dev);
break;
- case inputaction_key_up:
+ case INPUTACTION_KEY_UP:
input_report_key(visorinput_dev, keycode, 0);
input_sync(visorinput_dev);
break;
- case inputaction_key_down_up:
+ case INPUTACTION_KEY_DOWN_UP:
input_report_key(visorinput_dev, keycode, 1);
input_sync(visorinput_dev);
input_report_key(visorinput_dev, keycode, 0);
input_sync(visorinput_dev);
break;
- case inputaction_set_locking_key_state:
+ case INPUTACTION_SET_LOCKING_KEY_STATE:
handle_locking_key(visorinput_dev, keycode,
r.activity.arg2);
break;
- case inputaction_xy_motion:
+ case INPUTACTION_XY_MOTION:
xmotion = r.activity.arg1;
ymotion = r.activity.arg2;
input_report_abs(visorinput_dev, ABS_X, xmotion);
input_report_abs(visorinput_dev, ABS_Y, ymotion);
input_sync(visorinput_dev);
break;
- case inputaction_mouse_button_down:
+ case INPUTACTION_MOUSE_BUTTON_DOWN:
button = calc_button(r.activity.arg1);
if (button < 0)
break;
input_report_key(visorinput_dev, button, 1);
input_sync(visorinput_dev);
break;
- case inputaction_mouse_button_up:
+ case INPUTACTION_MOUSE_BUTTON_UP:
button = calc_button(r.activity.arg1);
if (button < 0)
break;
input_report_key(visorinput_dev, button, 0);
input_sync(visorinput_dev);
break;
- case inputaction_mouse_button_click:
+ case INPUTACTION_MOUSE_BUTTON_CLICK:
button = calc_button(r.activity.arg1);
if (button < 0)
break;
@@ -634,7 +631,7 @@ visorinput_channel_interrupt(struct visor_device *dev)
input_report_key(visorinput_dev, button, 0);
input_sync(visorinput_dev);
break;
- case inputaction_mouse_button_dclick:
+ case INPUTACTION_MOUSE_BUTTON_DCLICK:
button = calc_button(r.activity.arg1);
if (button < 0)
break;
@@ -645,11 +642,11 @@ visorinput_channel_interrupt(struct visor_device *dev)
input_sync(visorinput_dev);
}
break;
- case inputaction_wheel_rotate_away:
+ case INPUTACTION_WHEEL_ROTATE_AWAY:
input_report_rel(visorinput_dev, REL_WHEEL, 1);
input_sync(visorinput_dev);
break;
- case inputaction_wheel_rotate_toward:
+ case INPUTACTION_WHEEL_ROTATE_TOWARD:
input_report_rel(visorinput_dev, REL_WHEEL, -1);
input_sync(visorinput_dev);
break;
@@ -730,8 +727,8 @@ out:
/* GUIDS for all channel types supported by this driver. */
static struct visor_channeltype_descriptor visorinput_channel_types[] = {
- { SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID, "keyboard"},
- { SPAR_MOUSE_CHANNEL_PROTOCOL_UUID, "mouse"},
+ { VISOR_KEYBOARD_CHANNEL_UUID, "keyboard"},
+ { VISOR_MOUSE_CHANNEL_UUID, "mouse"},
{ NULL_UUID_LE, NULL }
};
@@ -767,5 +764,5 @@ MODULE_AUTHOR("Unisys");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("s-Par human input driver for virtual keyboard/mouse");
-MODULE_ALIAS("visorbus:" SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR);
-MODULE_ALIAS("visorbus:" SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR);
+MODULE_ALIAS("visorbus:" VISOR_MOUSE_CHANNEL_UUID_STR);
+MODULE_ALIAS("visorbus:" VISOR_KEYBOARD_CHANNEL_UUID_STR);
diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c
index adebf224f73a..2891622eef18 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -39,9 +39,9 @@
/* GUIDS for director channel type supported by this driver. */
static struct visor_channeltype_descriptor visornic_channel_types[] = {
/* Note that the only channel type we expect to be reported by the
- * bus driver is the SPAR_VNIC channel.
+ * bus driver is the VISOR_VNIC channel.
*/
- { SPAR_VNIC_CHANNEL_PROTOCOL_UUID, "ultravnic" },
+ { VISOR_VNIC_CHANNEL_UUID, "ultravnic" },
{ NULL_UUID_LE, NULL }
};
MODULE_DEVICE_TABLE(visorbus, visornic_channel_types);
@@ -52,7 +52,7 @@ MODULE_DEVICE_TABLE(visorbus, visornic_channel_types);
* must be added to scripts/mode/file2alias.c, etc., to get this working
* properly.
*/
-MODULE_ALIAS("visorbus:" SPAR_VNIC_CHANNEL_PROTOCOL_UUID_STR);
+MODULE_ALIAS("visorbus:" VISOR_VNIC_CHANNEL_UUID_STR);
struct chanstat {
unsigned long got_rcv;
@@ -1807,8 +1807,7 @@ static int visornic_probe(struct visor_device *dev)
/* Get MAC address from channel and read it into the device. */
netdev->addr_len = ETH_ALEN;
- channel_offset = offsetof(struct spar_io_channel_protocol,
- vnic.macaddr);
+ channel_offset = offsetof(struct visor_io_channel, vnic.macaddr);
err = visorbus_read_channel(dev, channel_offset, netdev->dev_addr,
ETH_ALEN);
if (err < 0) {
@@ -1836,8 +1835,7 @@ static int visornic_probe(struct visor_device *dev)
atomic_set(&devdata->usage, 1);
/* Setup rcv bufs */
- channel_offset = offsetof(struct spar_io_channel_protocol,
- vnic.num_rcv_bufs);
+ channel_offset = offsetof(struct visor_io_channel, vnic.num_rcv_bufs);
err = visorbus_read_channel(dev, channel_offset,
&devdata->num_rcv_bufs, 4);
if (err) {
@@ -1884,8 +1882,7 @@ static int visornic_probe(struct visor_device *dev)
devdata->server_change_state = false;
/*set the default mtu */
- channel_offset = offsetof(struct spar_io_channel_protocol,
- vnic.mtu);
+ channel_offset = offsetof(struct visor_io_channel, vnic.mtu);
err = visorbus_read_channel(dev, channel_offset, &netdev->mtu, 4);
if (err) {
dev_err(&dev->device,
@@ -1906,7 +1903,7 @@ static int visornic_probe(struct visor_device *dev)
*/
mod_timer(&devdata->irq_poll_timer, msecs_to_jiffies(2));
- channel_offset = offsetof(struct spar_io_channel_protocol,
+ channel_offset = offsetof(struct visor_io_channel,
channel_header.features);
err = visorbus_read_channel(dev, channel_offset, &features, 8);
if (err) {
@@ -1916,8 +1913,8 @@ static int visornic_probe(struct visor_device *dev)
goto cleanup_napi_add;
}
- features |= ULTRA_IO_CHANNEL_IS_POLLING;
- features |= ULTRA_IO_DRIVER_SUPPORTS_ENHANCED_RCVBUF_CHECKING;
+ features |= VISOR_CHANNEL_IS_POLLING;
+ features |= VISOR_DRIVER_ENHANCED_RCVBUF_CHECKING;
err = visorbus_write_channel(dev, channel_offset, &features, 8);
if (err) {
dev_err(&dev->device,
@@ -2115,7 +2112,7 @@ static int visornic_resume(struct visor_device *dev,
return 0;
}
-/* This is used to tell the visor bus driver which types of visor devices
+/* This is used to tell the visorbus driver which types of visor devices
* we support, and what functions to call when a visor device that we support
* is attached or removed.
*/