Commit 6ea9b6e6 authored by Tim Sell's avatar Tim Sell Committed by Greg Kroah-Hartman

staging: unisys: visorhid: rename to visorinput

This visorhid driver provides a Human Interface Device, but is not at all
using HID, the protocol.  It's a plain input driver, so for clarity, it is
being renamed to visorinput.
Signed-off-by: default avatarTim Sell <Timothy.Sell@unisys.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 63417188
...@@ -12,7 +12,7 @@ normally be unsharable, specifically: ...@@ -12,7 +12,7 @@ normally be unsharable, specifically:
* visornic - network interface * visornic - network interface
* visorhba - scsi disk adapter * visorhba - scsi disk adapter
* visorhid - keyboard and mouse * visorinput - keyboard and mouse
These drivers conform to the standard Linux bus/device model described These drivers conform to the standard Linux bus/device model described
within Documentation/driver-model/, and utilize a driver named visorbus to within Documentation/driver-model/, and utilize a driver named visorbus to
...@@ -44,7 +44,7 @@ NOT covered in this document: ...@@ -44,7 +44,7 @@ NOT covered in this document:
* Because the s-Par back-end provides a standard EFI framebuffer to each * Because the s-Par back-end provides a standard EFI framebuffer to each
guest, the already-existing efifb Linux driver is used to provide guest guest, the already-existing efifb Linux driver is used to provide guest
video access. Thus, the only s-Par-unique support that is necessary to video access. Thus, the only s-Par-unique support that is necessary to
provide a guest graphics console are for keyboard and mouse (via visorhid). provide a guest graphics console are for keyboard and mouse (via visorinput).
2. Driver Descriptions 2. Driver Descriptions
...@@ -296,13 +296,13 @@ i.e.: ...@@ -296,13 +296,13 @@ i.e.:
alias visorbus:8cd5994d-c58e-11da-95a9-00e08161165f visornic alias visorbus:8cd5994d-c58e-11da-95a9-00e08161165f visornic
2.4. visorhid 2.4. visorinput
------------- ---------------
The visorhid driver registers with visorbus as the function driver to The visorinput driver registers with visorbus as the function driver to
handle human input devices, specified using the handle human input devices, specified using the
SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID and SPAR_MOUSE_CHANNEL_PROTOCOL_UUID SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID and SPAR_MOUSE_CHANNEL_PROTOCOL_UUID
types in the visorbus_register_visor_driver() call. visorhid uses types in the visorbus_register_visor_driver() call. visorinput uses
input_register_device() to expose devices of class input input_register_device() to expose devices of class input
(e.g., /sys/class/input/) for virtual keyboard and virtual mouse devices. (e.g., /sys/class/input/) for virtual keyboard and virtual mouse devices.
A s-Par virtual keyboard device maps 1-to-1 with a Linux input device A s-Par virtual keyboard device maps 1-to-1 with a Linux input device
...@@ -312,7 +312,7 @@ devices created for it: 1 named "visor Wheel", and 1 named "visor Mouse". ...@@ -312,7 +312,7 @@ devices created for it: 1 named "visor Wheel", and 1 named "visor Mouse".
By registering as input class devices, modern versions of X will By registering as input class devices, modern versions of X will
automatically find and properly use s-Par virtual keyboard and mouse devices. automatically find and properly use s-Par virtual keyboard and mouse devices.
As the s-Par back-end reports keyboard and mouse activity via events on the As the s-Par back-end reports keyboard and mouse activity via events on the
virtual device channel, the visorhid driver delivers the activity to the virtual device channel, the visorinput driver delivers the activity to the
Linux environment by calling input_report_key() and input_report_abs(). Linux environment by calling input_report_key() and input_report_abs().
You can interact with the guest console using the usyscon Partition Desktop You can interact with the guest console using the usyscon Partition Desktop
...@@ -322,7 +322,7 @@ usyscon_partitiondesktop-*.rpm, or into a Windows environment via ...@@ -322,7 +322,7 @@ usyscon_partitiondesktop-*.rpm, or into a Windows environment via
PartitionDesktop.msi, you will be able to launch a console for your guest PartitionDesktop.msi, you will be able to launch a console for your guest
Linux environment by clicking the console icon in the s-Par web UI. Linux environment by clicking the console icon in the s-Par web UI.
When compiled as a module, visorhid can be autoloaded by visorbus in When compiled as a module, visorinput can be autoloaded by visorbus in
standard udev/systemd environments, as it includes the modules.alias standard udev/systemd environments, as it includes the modules.alias
definition: definition:
...@@ -331,8 +331,8 @@ definition: ...@@ -331,8 +331,8 @@ definition:
i.e.: i.e.:
alias visorbus:c73416d0-b0b8-44af-b304-9d2ae99f1b3d visorhid alias visorbus:c73416d0-b0b8-44af-b304-9d2ae99f1b3d visorinput
alias visorbus:addf07d4-94a9-46e2-81c3-61abcdbdbd87 visorhid alias visorbus:addf07d4-94a9-46e2-81c3-61abcdbdbd87 visorinput
3. Minimum Required Driver Set 3. Minimum Required Driver Set
...@@ -352,5 +352,5 @@ the s-Par back-end, which is the default configuration. However, for ...@@ -352,5 +352,5 @@ the s-Par back-end, which is the default configuration. However, for
configurations where the Linux guest is provided with an SR-IOV NIC configurations where the Linux guest is provided with an SR-IOV NIC
for example, visornic is not technically required. for example, visornic is not technically required.
visorhid is only required for a Linux guest running under s-Par if you visorinput is only required for a Linux guest running under s-Par if you
require graphics-mode access to your guest console. require graphics-mode access to your guest console.
...@@ -13,7 +13,7 @@ if UNISYSSPAR ...@@ -13,7 +13,7 @@ if UNISYSSPAR
source "drivers/staging/unisys/visorbus/Kconfig" source "drivers/staging/unisys/visorbus/Kconfig"
source "drivers/staging/unisys/visornic/Kconfig" source "drivers/staging/unisys/visornic/Kconfig"
source "drivers/staging/unisys/visorhid/Kconfig" source "drivers/staging/unisys/visorinput/Kconfig"
source "drivers/staging/unisys/visorhba/Kconfig" source "drivers/staging/unisys/visorhba/Kconfig"
endif # UNISYSSPAR endif # UNISYSSPAR
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
# #
obj-$(CONFIG_UNISYS_VISORBUS) += visorbus/ obj-$(CONFIG_UNISYS_VISORBUS) += visorbus/
obj-$(CONFIG_UNISYS_VISORNIC) += visornic/ obj-$(CONFIG_UNISYS_VISORNIC) += visornic/
obj-$(CONFIG_UNISYS_VISORHID) += visorhid/ obj-$(CONFIG_UNISYS_VISORINPUT) += visorinput/
obj-$(CONFIG_UNISYS_VISORHBA) += visorhba/ obj-$(CONFIG_UNISYS_VISORHBA) += visorhba/
#
# Unisys visorhid configuration
#
config UNISYS_VISORHID
tristate "Unisys visorhid driver"
depends on UNISYSSPAR && UNISYS_VISORBUS && FB
---help---
If you say Y here, you will enable the Unisys visorhid driver.
#
# Unisys visorinput configuration
#
config UNISYS_VISORINPUT
tristate "Unisys visorinput driver"
depends on UNISYSSPAR && UNISYS_VISORBUS && FB
---help---
If you say Y here, you will enable the Unisys visorinput driver.
# #
# Makefile for Unisys visorhid # Makefile for Unisys visorinput
# #
obj-$(CONFIG_UNISYS_VISORHID) += visorhid.o obj-$(CONFIG_UNISYS_VISORINPUT) += visorinput.o
ccflags-y += -Idrivers/staging/unisys/include ccflags-y += -Idrivers/staging/unisys/include
/* visorhid.c /* visorinput.c
* *
* Copyright (C) 2011 - 2015 UNISYS CORPORATION * Copyright (C) 2011 - 2015 UNISYS CORPORATION
* All rights reserved. * All rights reserved.
...@@ -38,24 +38,24 @@ static const uuid_le spar_keyboard_channel_protocol_uuid = ...@@ -38,24 +38,24 @@ static const uuid_le spar_keyboard_channel_protocol_uuid =
SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID; SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID;
static const uuid_le spar_mouse_channel_protocol_uuid = static const uuid_le spar_mouse_channel_protocol_uuid =
SPAR_MOUSE_CHANNEL_PROTOCOL_UUID; SPAR_MOUSE_CHANNEL_PROTOCOL_UUID;
static int visorhid_probe(struct visor_device *dev); static int visorinput_probe(struct visor_device *dev);
static void visorhid_remove(struct visor_device *dev); static void visorinput_remove(struct visor_device *dev);
static void visorhid_channel_interrupt(struct visor_device *dev); static void visorinput_channel_interrupt(struct visor_device *dev);
static int visorhid_pause(struct visor_device *dev, static int visorinput_pause(struct visor_device *dev,
visorbus_state_complete_func complete_func); visorbus_state_complete_func complete_func);
static int visorhid_resume(struct visor_device *dev, static int visorinput_resume(struct visor_device *dev,
visorbus_state_complete_func complete_func); visorbus_state_complete_func complete_func);
static struct input_dev *register_client_keyboard(void); static struct input_dev *register_client_keyboard(void);
static struct input_dev *register_client_mouse(void); static struct input_dev *register_client_mouse(void);
static void unregister_client_input(struct input_dev *visorinput_dev); static void unregister_client_input(struct input_dev *visorinput_dev);
/* GUIDS for all channel types supported by this driver. */ /* GUIDS for all channel types supported by this driver. */
static struct visor_channeltype_descriptor visorhid_channel_types[] = { static struct visor_channeltype_descriptor visorinput_channel_types[] = {
{ SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID, "keyboard"}, { SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID, "keyboard"},
{ SPAR_MOUSE_CHANNEL_PROTOCOL_UUID, "mouse"}, { SPAR_MOUSE_CHANNEL_PROTOCOL_UUID, "mouse"},
{ NULL_UUID_LE, NULL } { NULL_UUID_LE, NULL }
}; };
MODULE_DEVICE_TABLE(visorbus, visorhid_channel_types); MODULE_DEVICE_TABLE(visorbus, visorinput_channel_types);
MODULE_ALIAS("visorbus:" SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR); MODULE_ALIAS("visorbus:" SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR);
MODULE_ALIAS("visorbus:" SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR); MODULE_ALIAS("visorbus:" SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR);
...@@ -63,28 +63,28 @@ MODULE_ALIAS("visorbus:" SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR); ...@@ -63,28 +63,28 @@ MODULE_ALIAS("visorbus:" SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR);
* we support, and what functions to call when a visor device that we support * we support, and what functions to call when a visor device that we support
* is attached or removed. * is attached or removed.
*/ */
static struct visor_driver visorhid_driver = { static struct visor_driver visorinput_driver = {
.name = "visorhid", .name = "visorinput",
.vertag = NULL, .vertag = NULL,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.channel_types = visorhid_channel_types, .channel_types = visorinput_channel_types,
.probe = visorhid_probe, .probe = visorinput_probe,
.remove = visorhid_remove, .remove = visorinput_remove,
.channel_interrupt = visorhid_channel_interrupt, .channel_interrupt = visorinput_channel_interrupt,
.pause = visorhid_pause, .pause = visorinput_pause,
.resume = visorhid_resume, .resume = visorinput_resume,
}; };
enum visorhid_device_type { enum visorinput_device_type {
visorhid_keyboard, visorinput_keyboard,
visorhid_mouse, visorinput_mouse,
}; };
/* This is the private data that we store for each device. /* This is the private data that we store for each device.
* A pointer to this struct is maintained via * A pointer to this struct is maintained via
* dev_get_drvdata() / dev_set_drvdata() for each struct device. * dev_get_drvdata() / dev_set_drvdata() for each struct device.
*/ */
struct visorhid_devdata { struct visorinput_devdata {
struct visor_device *dev; struct visor_device *dev;
/** lock for dev */ /** lock for dev */
struct rw_semaphore lock_visor_dev; struct rw_semaphore lock_visor_dev;
...@@ -228,10 +228,10 @@ static unsigned char visorkbd_ext_keycode[256] = { ...@@ -228,10 +228,10 @@ static unsigned char visorkbd_ext_keycode[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
}; };
static struct visorhid_devdata * static struct visorinput_devdata *
devdata_create(struct visor_device *dev, enum visorhid_device_type devtype) devdata_create(struct visor_device *dev, enum visorinput_device_type devtype)
{ {
struct visorhid_devdata *devdata = NULL; struct visorinput_devdata *devdata = NULL;
devdata = kzalloc(sizeof(*devdata), GFP_KERNEL); devdata = kzalloc(sizeof(*devdata), GFP_KERNEL);
if (!devdata) if (!devdata)
...@@ -243,12 +243,12 @@ devdata_create(struct visor_device *dev, enum visorhid_device_type devtype) ...@@ -243,12 +243,12 @@ devdata_create(struct visor_device *dev, enum visorhid_device_type devtype)
* deliver our inputs to the guest OS. * deliver our inputs to the guest OS.
*/ */
switch (devtype) { switch (devtype) {
case visorhid_keyboard: case visorinput_keyboard:
devdata->visorinput_dev = register_client_keyboard(); devdata->visorinput_dev = register_client_keyboard();
if (!devdata->visorinput_dev) if (!devdata->visorinput_dev)
goto cleanups_register; goto cleanups_register;
break; break;
case visorhid_mouse: case visorinput_mouse:
devdata->visorinput_dev = register_client_mouse(); devdata->visorinput_dev = register_client_mouse();
if (!devdata->visorinput_dev) if (!devdata->visorinput_dev)
goto cleanups_register; goto cleanups_register;
...@@ -265,17 +265,17 @@ devdata_create(struct visor_device *dev, enum visorhid_device_type devtype) ...@@ -265,17 +265,17 @@ devdata_create(struct visor_device *dev, enum visorhid_device_type devtype)
} }
static int static int
visorhid_probe(struct visor_device *dev) visorinput_probe(struct visor_device *dev)
{ {
struct visorhid_devdata *devdata = NULL; struct visorinput_devdata *devdata = NULL;
uuid_le guid; uuid_le guid;
enum visorhid_device_type devtype; enum visorinput_device_type devtype;
guid = visorchannel_get_uuid(dev->visorchannel); guid = visorchannel_get_uuid(dev->visorchannel);
if (uuid_le_cmp(guid, spar_mouse_channel_protocol_uuid) == 0) if (uuid_le_cmp(guid, spar_mouse_channel_protocol_uuid) == 0)
devtype = visorhid_mouse; devtype = visorinput_mouse;
else if (uuid_le_cmp(guid, spar_keyboard_channel_protocol_uuid) == 0) else if (uuid_le_cmp(guid, spar_keyboard_channel_protocol_uuid) == 0)
devtype = visorhid_keyboard; devtype = visorinput_keyboard;
else else
return -ENODEV; return -ENODEV;
devdata = devdata_create(dev, devtype); devdata = devdata_create(dev, devtype);
...@@ -287,9 +287,9 @@ visorhid_probe(struct visor_device *dev) ...@@ -287,9 +287,9 @@ visorhid_probe(struct visor_device *dev)
} }
static void static void
visorhid_remove(struct visor_device *dev) visorinput_remove(struct visor_device *dev)
{ {
struct visorhid_devdata *devdata = dev_get_drvdata(&dev->device); struct visorinput_devdata *devdata = dev_get_drvdata(&dev->device);
if (!devdata) if (!devdata)
return; return;
...@@ -297,7 +297,7 @@ visorhid_remove(struct visor_device *dev) ...@@ -297,7 +297,7 @@ visorhid_remove(struct visor_device *dev)
visorbus_disable_channel_interrupts(dev); visorbus_disable_channel_interrupts(dev);
/* due to above, at this time no thread of execution will be /* due to above, at this time no thread of execution will be
* in visorhid_channel_interrupt() * in visorinput_channel_interrupt()
*/ */
down_write(&devdata->lock_visor_dev); down_write(&devdata->lock_visor_dev);
...@@ -498,7 +498,7 @@ calc_button(int x) ...@@ -498,7 +498,7 @@ calc_button(int x)
* from the channel, and deliver them to the guest OS. * from the channel, and deliver them to the guest OS.
*/ */
static void static void
visorhid_channel_interrupt(struct visor_device *dev) visorinput_channel_interrupt(struct visor_device *dev)
{ {
struct ultra_inputreport r; struct ultra_inputreport r;
int scancode, keycode; int scancode, keycode;
...@@ -506,7 +506,7 @@ visorhid_channel_interrupt(struct visor_device *dev) ...@@ -506,7 +506,7 @@ visorhid_channel_interrupt(struct visor_device *dev)
int xmotion, ymotion, zmotion, button; int xmotion, ymotion, zmotion, button;
int i; int i;
struct visorhid_devdata *devdata = dev_get_drvdata(&dev->device); struct visorinput_devdata *devdata = dev_get_drvdata(&dev->device);
if (!devdata) if (!devdata)
return; return;
...@@ -600,11 +600,11 @@ visorhid_channel_interrupt(struct visor_device *dev) ...@@ -600,11 +600,11 @@ visorhid_channel_interrupt(struct visor_device *dev)
} }
static int static int
visorhid_pause(struct visor_device *dev, visorinput_pause(struct visor_device *dev,
visorbus_state_complete_func complete_func) visorbus_state_complete_func complete_func)
{ {
int rc; int rc;
struct visorhid_devdata *devdata = dev_get_drvdata(&dev->device); struct visorinput_devdata *devdata = dev_get_drvdata(&dev->device);
if (!devdata) { if (!devdata) {
rc = -ENODEV; rc = -ENODEV;
...@@ -626,11 +626,11 @@ visorhid_pause(struct visor_device *dev, ...@@ -626,11 +626,11 @@ visorhid_pause(struct visor_device *dev,
} }
static int static int
visorhid_resume(struct visor_device *dev, visorinput_resume(struct visor_device *dev,
visorbus_state_complete_func complete_func) visorbus_state_complete_func complete_func)
{ {
int rc; int rc;
struct visorhid_devdata *devdata = dev_get_drvdata(&dev->device); struct visorinput_devdata *devdata = dev_get_drvdata(&dev->device);
if (!devdata) { if (!devdata) {
rc = -ENODEV; rc = -ENODEV;
...@@ -651,19 +651,19 @@ visorhid_resume(struct visor_device *dev, ...@@ -651,19 +651,19 @@ visorhid_resume(struct visor_device *dev,
} }
static int static int
visorhid_init(void) visorinput_init(void)
{ {
return visorbus_register_visor_driver(&visorhid_driver); return visorbus_register_visor_driver(&visorinput_driver);
} }
static void static void
visorhid_cleanup(void) visorinput_cleanup(void)
{ {
visorbus_unregister_visor_driver(&visorhid_driver); visorbus_unregister_visor_driver(&visorinput_driver);
} }
module_init(visorhid_init); module_init(visorinput_init);
module_exit(visorhid_cleanup); module_exit(visorinput_cleanup);
MODULE_AUTHOR("Unisys"); MODULE_AUTHOR("Unisys");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
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