[PATCH 017/141] staging: unisys: finddevice() doesn't need to be inline

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset.h | 12 
 .../unisys/visorchipset/visorchipset_main.c| 32 --
 2 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 59552af..a3fe8b7 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -91,18 +91,6 @@ struct visorchipset_device_info {
void *bus_driver_context;
 };
 
-static inline struct visorchipset_device_info *finddevice(
-   struct list_head *list, u32 bus_no, u32 dev_no)
-{
-   struct visorchipset_device_info *p;
-
-   list_for_each_entry(p, list, entry) {
-   if (p->bus_no == bus_no && p->dev_no == dev_no)
-   return p;
-   }
-   return NULL;
-}
-
 static inline void delbusdevices(struct list_head *list, u32 bus_no)
 {
struct visorchipset_device_info *p, *tmp;
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index f647567..d1f0d18 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -539,6 +539,19 @@ bus_find(struct list_head *list, u32 bus_no)
return NULL;
 }
 
+static struct visorchipset_device_info *
+device_find(struct list_head *list, u32 bus_no, u32 dev_no)
+{
+   struct visorchipset_device_info *p;
+
+   list_for_each_entry(p, list, entry) {
+   if (p->bus_no == bus_no && p->dev_no == dev_no)
+   return p;
+   }
+
+   return NULL;
+}
+
 static u8
 check_chipset_events(void)
 {
@@ -825,7 +838,7 @@ device_changestate_responder(enum controlvm_id cmd_id,
struct visorchipset_device_info *p;
struct controlvm_message outmsg;
 
-   p = finddevice(&dev_info_list, bus_no, dev_no);
+   p = device_find(&dev_info_list, bus_no, dev_no);
if (!p)
return;
if (p->pending_msg_hdr.id == CONTROLVM_INVALID)
@@ -852,7 +865,7 @@ device_responder(enum controlvm_id cmd_id, u32 bus_no, u32 
dev_no, int response)
struct visorchipset_device_info *p;
bool need_clear = false;
 
-   p = finddevice(&dev_info_list, bus_no, dev_no);
+   p = device_find(&dev_info_list, bus_no, dev_no);
if (!p)
return;
if (response >= 0) {
@@ -951,7 +964,7 @@ device_epilog(u32 bus_no, u32 dev_no, struct 
spar_segment_state state, u32 cmd,
bool notified = false;
 
struct visorchipset_device_info *dev_info =
-   finddevice(&dev_info_list, bus_no, dev_no);
+   device_find(&dev_info_list, bus_no, dev_no);
char *envp[] = {
"SPARSP_DIAGPOOL_PAUSED_STATE = 1",
NULL
@@ -1157,7 +1170,7 @@ my_device_create(struct controlvm_message *inmsg)
struct visorchipset_bus_info *bus_info;
int rc = CONTROLVM_RESP_SUCCESS;
 
-   dev_info = finddevice(&dev_info_list, bus_no, dev_no);
+   dev_info = device_find(&dev_info_list, bus_no, dev_no);
if (dev_info && (dev_info->state.created == 1)) {
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
 POSTCODE_SEVERITY_ERR);
@@ -1227,7 +1240,7 @@ my_device_changestate(struct controlvm_message *inmsg)
struct visorchipset_device_info *dev_info;
int rc = CONTROLVM_RESP_SUCCESS;
 
-   dev_info = finddevice(&dev_info_list, bus_no, dev_no);
+   dev_info = device_find(&dev_info_list, bus_no, dev_no);
if (!dev_info) {
POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
 POSTCODE_SEVERITY_ERR);
@@ -1254,7 +1267,7 @@ my_device_destroy(struct controlvm_message *inmsg)
struct visorchipset_device_info *dev_info;
int rc = CONTROLVM_RESP_SUCCESS;
 
-   dev_info = finddevice(&dev_info_list, bus_no, dev_no);
+   dev_info = device_find(&dev_info_list, bus_no, dev_no);
if (!dev_info)
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
else if (dev_info->state.created == 0)
@@ -2033,7 +2046,7 @@ bool
 visorchipset_get_device_info(u32 bus_no, u32 dev_no,
 struct visorchipset_device_info *dev_info)
 {
-   void *p = finddevice(&dev_info_list, bus_no, dev_no);
+   void *p = device_find(&dev_info_list, bus_no, dev_no);
 
if (!p)
return false;
@@ -2045,8 +2058,9 @@ EXPORT_SYMBOL_GPL(visorchipset_get_device_info);
 bool
 visorchipset_set_device_context(u32 bus_no, u32 dev_no, void *context)
 {
-   struc

[PATCH 107/141] staging: unisys: Move channel.h to include. Controvlm to visorbus

2015-05-05 Thread Benjamin Romer
From: David Kershner 

Channel.h is used by all channels, it needs to be in include.
Controlvm Channel is only used by visorbus, it needs to just be there.

Signed-off-by: David Kershner 
Signed-off-by: Benjamin Romer 
---
 .../unisys/common-spar/include/channels/channel.h  | 590 -
 .../common-spar/include/channels/channel_guid.h|  61 ---
 .../include/channels/controlvmchannel.h| 485 -
 drivers/staging/unisys/include/channel.h   | 555 +++
 drivers/staging/unisys/include/channel_guid.h  |  61 +++
 drivers/staging/unisys/visorbus/controlvmchannel.h | 485 +
 6 files changed, 1101 insertions(+), 1136 deletions(-)
 delete mode 100644 
drivers/staging/unisys/common-spar/include/channels/channel.h
 delete mode 100644 
drivers/staging/unisys/common-spar/include/channels/channel_guid.h
 delete mode 100644 
drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
 create mode 100644 drivers/staging/unisys/include/channel.h
 create mode 100644 drivers/staging/unisys/include/channel_guid.h
 create mode 100644 drivers/staging/unisys/visorbus/controlvmchannel.h

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
deleted file mode 100644
index 6fb6e5b..000
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ /dev/null
@@ -1,590 +0,0 @@
-/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#ifndef __CHANNEL_H__
-#define __CHANNEL_H__
-
-#include 
-#include 
-#include 
-
-/*
-* Whenever this file is changed a corresponding change must be made in
-* the Console/ServicePart/visordiag_early/supervisor_channel.h file
-* which is needed for Linux kernel compiles. These two files must be
-* in sync.
-*/
-
-/* define the following to prevent include nesting in kernel header
- * files of similar abbreviated content
- */
-#define __SUPERVISOR_CHANNEL_H__
-
-#define SIGNATURE_16(A, B) ((A) | (B<<8))
-#define SIGNATURE_32(A, B, C, D) \
-   (SIGNATURE_16(A, B) | (SIGNATURE_16(C, D) << 16))
-#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
-   (SIGNATURE_32(A, B, C, D) | ((u64)(SIGNATURE_32(E, F, G, H)) << 32))
-
-#ifndef lengthof
-#define lengthof(TYPE, MEMBER) (sizeof(((TYPE *)0)->MEMBER))
-#endif
-#ifndef COVERQ
-#define COVERQ(v, d)  (((v)+(d)-1) / (d))
-#endif
-#ifndef COVER
-#define COVER(v, d)   ((d)*COVERQ(v, d))
-#endif
-
-#define ULTRA_CHANNEL_PROTOCOL_SIGNATURE  SIGNATURE_32('E', 'C', 'N', 'L')
-
-enum channel_serverstate {
-   CHANNELSRV_UNINITIALIZED = 0,   /* channel is in an undefined state */
-   CHANNELSRV_READY = 1/* channel has been initialized by server */
-};
-
-enum channel_clientstate {
-   CHANNELCLI_DETACHED = 0,
-   CHANNELCLI_DISABLED = 1,/* client can see channel but is NOT
-* allowed to use it unless given TBD
-* explicit request (should actually be
-* < DETACHED) */
-   CHANNELCLI_ATTACHING = 2,   /* legacy EFI client request
-* for EFI server to attach */
-   CHANNELCLI_ATTACHED = 3,/* idle, but client may want
-* to use channel any time */
-   CHANNELCLI_BUSY = 4,/* client either wants to use or is
-* using channel */
-   CHANNELCLI_OWNED = 5/* "no worries" state - client can
-* access channel anytime */
-};
-
-static inline const u8 *
-ULTRA_CHANNELCLI_STRING(u32 v)
-{
-   switch (v) {
-   case CHANNELCLI_DETACHED:
-   return (const u8 *)("DETACHED");
-   case CHANNELCLI_DISABLED:
-   return (const u8 *)("DISABLED");
-   case CHANNELCLI_ATTACHING:
-   return (const u8 *)("ATTACHING");
-   case CHANNELCLI_ATTACHED:
-   return (const u8 *)("ATTACHED");
-   case CHANNELCLI_BUSY:
-   return (const u8 *)("BUSY");
-   case CHANNELCLI_OWNED:
-   return (const u8 *)("OWNED");
-   default:
-   break;
-   }
-   return (const u8 *)("?");

[PATCH 069/141] staging: unisys: remove unused #define in iochannel.h

2015-05-05 Thread Benjamin Romer
From: Erik Arfvidson 

This patch simply remove all unused #define's in iochannel.h

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 .../common-spar/include/channels/iochannel.h   | 137 -
 1 file changed, 137 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/iochannel.h 
b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
index ff393c2..fad7fe9 100644
--- a/drivers/staging/unisys/common-spar/include/channels/iochannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
@@ -86,41 +86,10 @@
  * ioguestparts */
 #define IOCHAN_TO_IOPART 0 /* used by ioguestpart to 'insert' signals to
* iopart */
-#define IOCHAN_FROM_GUESTPART 0 /* used by iopart to 'remove' signals from
-* ioguestpart - same queue as previous queue */
 
-#define IOCHAN_TO_GUESTPART 1 /* used by iopart to 'insert' signals to
-  * ioguestpart */
 #define IOCHAN_FROM_IOPART 1 /* used by ioguestpart to 'remove' signals from
  * iopart - same queue as previous queue */
 
-/* these define the two queues per control channel between controlpart and 
"its"
- * guests, which includes the iopart  */
-#define CTRLCHAN_TO_CTRLGUESTPART 0 /* used by ctrlguestpart to 'insert' 
signals
-* to ctrlpart */
-#define CTLRCHAN_FROM_CTRLPART 0 /* used by ctrlpart to 'remove' signals from
- * ctrlquestpart - same queue as previous
- * queue */
-
-#define CTRLCHAN_TO_CTRLPART 1 /* used by ctrlpart to 'insert' signals to
-   * ctrlguestpart */
-#define CTRLCHAN_FROM_CTRLGUESTPART 1 /* used by ctrguestpart to 'remove'
-  * signals from ctrlpart - same queue as
-  * previous queue */
-
-/* these define the Event & Ack queues per control channel Events are generated
-* by CTRLGUESTPART and sent to CTRLPART; Acks are generated by CTRLPART and 
sent
-* to CTRLGUESTPART. */
-#define CTRLCHAN_EVENT_TO_CTRLPART 2 /* used by ctrlguestpart to 'insert' 
Events
- * to ctrlpart */
-#define CTRLCHAN_EVENT_FROM_CTRLGUESTPART 2 /* used by ctrlpart to 'remove'
-* Events from ctrlguestpart */
-
-#define CTRLCHAN_ACK_TO_CTRLGUESTPART 3/* used by ctrlpart to 'insert' 
Acks to
-* ctrlguestpart */
-#define CTRLCHAN_ACK_FROM_CTRLPART 3 /* used by ctrlguestpart to 'remove' 
Events
- * from ctrlpart */
-
 /* size of cdb - i.e., scsi cmnd */
 #define MAX_CMND_SIZE 16
 
@@ -128,24 +97,6 @@
 
 #define MAX_PHYS_INFO 64
 
-/* Because GuestToGuestCopy is limited to 4KiB segments, and we have limited 
the
-* Emulex Driver to 256 scatter list segments via the lpfc_sg_seg_cnt parameter
-* to 256, the maximum I/O size is limited to 256 * 4 KiB = 1 MB */
-#define MAX_IO_SIZE   (1024*1024)  /* 1 MB */
-
-/* NOTE 1: lpfc defines its support for segments in
-* #define LPFC_SG_SEG_CNT 64
-*
-* NOTE 2: In Linux, frags array in skb is currently allocated to be
-* MAX_SKB_FRAGS size, which is 18 which is smaller than MAX_PHYS_INFO for
-* now.  */
-
-#define MAX_SCSI_BUSES 1
-#define MAX_SCSI_TARGETS   8
-#define MAX_SCSI_LUNS  16
-#define MAX_SCSI_FROM_HOST 0x  /* Indicator to use Physical HBA
-* SCSI Host value */
-
 /* various types of network packets that can be sent in cmdrsp */
 enum net_types {
NET_RCV_POST = 0,   /* submit buffer to hold receiving
@@ -178,19 +129,12 @@ enum net_types {
 #defineETH_MIN_DATA_SIZE 46/* minimum eth data size */
 #defineETH_MIN_PACKET_SIZE (ETH_HEADER_SIZE + 
ETH_MIN_DATA_SIZE)
 
-#define ETH_DEF_DATA_SIZE 1500 /* default data size */
-#define ETH_DEF_PACKET_SIZE (ETH_HEADER_SIZE + ETH_DEF_DATA_SIZE)
-
 #defineETH_MAX_MTU 16384   /* maximum data size */
 
 #ifndef MAX_MACADDR_LEN
 #define MAX_MACADDR_LEN 6  /* number of bytes in MAC address */
 #endif /* MAX_MACADDR_LEN */
 
-#define ETH_IS_LOCALLY_ADMINISTERED(address) \
-   (((u8 *)(address))[0] & ((u8)0x02))
-#define NIC_VENDOR_ID 0x0008000B
-
 /* various types of scsi task mgmt commands  */
 enum task_mgmt_types {
TASK_MGMT_ABORT_TASK = 1,
@@ -205,20 +149,6 @@ enum vdisk_mgmt_types {
VDISK_MGMT_RELEASE,
 };
 
-/* this is used in the vdest field  */
-#define VDEST_ALL 0x
-
-#define MIN_NUMSIGNALS 64
-#define MAX_NUMSIGNALS 4096
-
-/* MAX_NET_RCV_BUF specifies the number of rcv buffers

[PATCH 034/141] staging: unisys: remove visorchipset_umode.h

2015-05-05 Thread Benjamin Romer
From: Erik Arfvidson 

removes visorchipset_umode.h and pass functionality to
visorchipset.h

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/file.c |  1 -
 drivers/staging/unisys/visorchipset/visorchipset.h |  1 +
 .../unisys/visorchipset/visorchipset_umode.h   | 35 --
 3 files changed, 1 insertion(+), 36 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorchipset/visorchipset_umode.h

diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index 9822e9d..153f736 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -23,7 +23,6 @@
 #include 
 #include "version.h"
 #include "visorchipset.h"
-#include "visorchipset_umode.h"
 #include "visorbus.h"
 #include "uisutils.h"
 #include "file.h"
diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 1d66c37..dcf8a23 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -28,6 +28,7 @@
 #include "vbushelper.h"
 
 #define MYDRVNAME "visorchipset"
+#define VISORCHIPSET_MMAP_CONTROLCHANOFFSET0x
 
 /** Describes the state from the perspective of which controlvm messages have
  *  been received for a bus or device.
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_umode.h 
b/drivers/staging/unisys/visorchipset/visorchipset_umode.h
deleted file mode 100644
index 8af5bf3..000
--- a/drivers/staging/unisys/visorchipset/visorchipset_umode.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* visorchipset_umode.h
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/** @file *
- *
- *  This describes structures needed for the interface between the
- *  visorchipset driver and a user-mode component that opens the device.
- *
- **
- */
-
-#ifndef __VISORCHIPSET_UMODE_H
-#define __VISORCHIPSET_UMODE_H
-
-/** The user-mode program can access the control channel buffer directly
- *  via this memory map.
- */
-#define VISORCHIPSET_MMAP_CONTROLCHANOFFSET0x
-#define VISORCHIPSET_MMAP_CONTROLCHANSIZE  0x0040  /* 4MB */
-
-#endif /* __VISORCHIPSET_UMODE_H */
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 100/141] staging: unisys: visorchipset_file_{init, cleanup}(): mark static

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index ca22f49..66ae3d0 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -2351,7 +2351,7 @@ static const struct file_operations visorchipset_fops = {
.mmap = visorchipset_mmap,
 };
 
-int
+static int
 visorchipset_file_init(dev_t major_dev, struct visorchannel 
**controlvm_channel)
 {
int rc = 0;
@@ -2460,7 +2460,7 @@ cleanup:
return rc;
 }
 
-void
+static void
 visorchipset_file_cleanup(dev_t major_dev)
 {
if (file_cdev.ops)
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 082/141] staging: unisys: Eliminate visor_memregion_write()

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

visorchannel's signal code should call visorchannel_write() directly.
This is more consistent and cleaner, and allows us to remove the last
memregion call.

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 34 ++
 drivers/staging/unisys/visorutil/memregion.h   |  2 --
 .../staging/unisys/visorutil/memregion_direct.c| 12 
 3 files changed, 16 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 549128d..564d325 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -250,8 +250,8 @@ visorchannel_clear(struct visorchannel *channel, ulong 
offset, u8 ch,
 
if (nbytes < thisbytes)
thisbytes = nbytes;
-   err = visor_memregion_write(&channel->memregion,
-   offset + written, buf, thisbytes);
+   err = visorchannel_write(channel, offset + written,
+buf, thisbytes);
if (err)
goto cleanup;
 
@@ -290,12 +290,12 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header);
 /** Write the contents of a specific field within a SIGNAL_QUEUE_HEADER back
  *  into host memory
  */
-#define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD)
\
-   (visor_memregion_write(&channel->memregion, \
-  SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)+ \
-  offsetof(struct signal_queue_header, FIELD),\
-  &((sig_hdr)->FIELD), \
-  sizeof((sig_hdr)->FIELD)) >= 0)
+#define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD)
 \
+   (visorchannel_write(channel, \
+   SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)+ \
+   offsetof(struct signal_queue_header, FIELD), \
+   &((sig_hdr)->FIELD), \
+   sizeof((sig_hdr)->FIELD)) >= 0)
 
 static BOOL
 sig_read_header(struct visorchannel *channel, u32 queue,
@@ -340,9 +340,8 @@ sig_write_data(struct visorchannel *channel, u32 queue,
int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue,
 sig_hdr, slot);
 
-   err = visor_memregion_write(&channel->memregion,
-   signal_data_offset,
-   data, sig_hdr->signal_size);
+   err = visorchannel_write(channel, signal_data_offset,
+data, sig_hdr->signal_size);
if (err)
return FALSE;
 
@@ -403,13 +402,12 @@ signalinsert_inner(struct visorchannel *channel, u32 
queue, void *msg)
sig_hdr.head = ((sig_hdr.head + 1) % sig_hdr.max_slots);
if (sig_hdr.head == sig_hdr.tail) {
sig_hdr.num_overflows++;
-   visor_memregion_write(&channel->memregion,
- SIG_QUEUE_OFFSET(&channel->chan_hdr,
-  queue) +
- offsetof(struct signal_queue_header,
-  num_overflows),
- &(sig_hdr.num_overflows),
- sizeof(sig_hdr.num_overflows));
+   visorchannel_write(channel,
+  SIG_QUEUE_OFFSET(&channel->chan_hdr, queue) +
+  offsetof(struct signal_queue_header,
+   num_overflows),
+  &(sig_hdr.num_overflows),
+  sizeof(sig_hdr.num_overflows));
return FALSE;
}
 
diff --git a/drivers/staging/unisys/visorutil/memregion.h 
b/drivers/staging/unisys/visorutil/memregion.h
index 4122b48..62036cd 100644
--- a/drivers/staging/unisys/visorutil/memregion.h
+++ b/drivers/staging/unisys/visorutil/memregion.h
@@ -29,8 +29,6 @@ struct memregion {
void __iomem *mapped;
 };
 
-int visor_memregion_write(struct memregion *memregion,
- ulong offset, void *src, ulong nbytes);
 void memregion_dump(struct memregion *memregion, char *s,
ulong off, ulong len, struct seq_file *seq);
 
diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c 
b/drivers/staging/unisys/visorutil/memregion_direct.c
index 17b1033..818f6a8 100644
--- a/drivers/staging/unisys/visorutil/memregion_direct.c
+++ b/driv

[PATCH 092/141] staging: unisys: remove visorutil from top level Makefile

2015-05-05 Thread Benjamin Romer
The visorutil directory is still mentioned in the top level makefile for
the Unisys drivers, so remove it.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile
index e0c893a..566af8e 100644
--- a/drivers/staging/unisys/Makefile
+++ b/drivers/staging/unisys/Makefile
@@ -1,5 +1,4 @@
 #
 # Makefile for Unisys SPAR drivers
 #
-obj-$(CONFIG_UNISYS_VISORUTIL) += visorutil/
 obj-$(CONFIG_UNISYS_VISORBUS)  += visorbus/
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 014/141] staging: unisys: Remove write-only visorchipset_bus_info.dev_no

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset.h  | 1 -
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 53bbc49..d21fcb0 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -140,7 +140,6 @@ struct visorchipset_bus_info {
struct controlvm_message_header pending_msg_hdr;/* CONTROLVM MsgHdr */
/** For private use by the bus driver */
void *bus_driver_context;
-   u32 dev_no;
 };
 
 static inline struct visorchipset_bus_info *
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 69730d1..e78ae7b 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1051,7 +1051,6 @@ bus_create(struct controlvm_message *inmsg)
 
INIT_LIST_HEAD(&bus_info->entry);
bus_info->bus_no = bus_no;
-   bus_info->dev_no = cmd->create_bus.dev_count;
 
POSTCODE_LINUX_3(BUS_CREATE_ENTRY_PC, bus_no, POSTCODE_SEVERITY_INFO);
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 046/141] staging: unisys: memregion: Use proper errno for mapit()

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 .../staging/unisys/visorutil/memregion_direct.c| 28 +-
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c 
b/drivers/staging/unisys/visorutil/memregion_direct.c
index 93c10b4..7ba68bc 100644
--- a/drivers/staging/unisys/visorutil/memregion_direct.c
+++ b/drivers/staging/unisys/visorutil/memregion_direct.c
@@ -32,7 +32,7 @@ struct memregion {
BOOL requested;
 };
 
-static BOOL mapit(struct memregion *memregion);
+static int mapit(struct memregion *memregion);
 static void unmapit(struct memregion *memregion);
 
 struct memregion *
@@ -47,7 +47,7 @@ visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes)
 
memregion->physaddr = physaddr;
memregion->nbytes = nbytes;
-   if (!mapit(memregion)) {
+   if (mapit(memregion)) {
rc = NULL;
goto cleanup;
}
@@ -61,19 +61,24 @@ cleanup:
 }
 EXPORT_SYMBOL_GPL(visor_memregion_create);
 
-static BOOL
+static int
 mapit(struct memregion *memregion)
 {
ulong physaddr = (ulong)(memregion->physaddr);
ulong nbytes = memregion->nbytes;
 
memregion->requested = FALSE;
-   if (request_mem_region(physaddr, nbytes, MYDRVNAME))
-   memregion->requested = TRUE;
+   if (!request_mem_region(physaddr, nbytes, MYDRVNAME))
+   return -EBUSY;
+
+   memregion->requested = TRUE;
memregion->mapped = ioremap_cache(physaddr, nbytes);
-   if (!memregion->mapped)
-   return FALSE;
-   return TRUE;
+   if (!memregion->mapped) {
+   memregion->requested = TRUE;
+   return -EFAULT;
+   }
+
+   return 0;
 }
 
 static void
@@ -114,15 +119,16 @@ EXPORT_SYMBOL_GPL(visor_memregion_get_pointer);
 int
 visor_memregion_resize(struct memregion *memregion, ulong newsize)
 {
+   int rc;
+
if (newsize == memregion->nbytes)
return 0;
 
unmapit(memregion);
memregion->nbytes = newsize;
-   if (!mapit(memregion))
-   return -EIO;
+   rc = mapit(memregion);
 
-   return 0;
+   return rc;
 }
 EXPORT_SYMBOL_GPL(visor_memregion_resize);
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 050/141] staging: unisys: visorchipset.c: No need to include memregion.h anymore

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 9390ed6..e0f8d76 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -15,7 +15,6 @@
  * details.
  */
 
-#include "memregion.h"
 #include "controlvmchannel.h"
 #include "version.h"
 #include "procobjecttree.h"
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 124/141] staging: unisys: Add checks for creation

2015-05-05 Thread Benjamin Romer
From: Don Zickus 

There was a bunch of channel creation checks before the
visorchannel_create function was called, moving some of those
checks inside.  This keeps the outside code cleaner and handles
the situation where a caller forgets to make these checks.

Signed-off-by: Don Zickus 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 1789f9d..6e7675e 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -62,6 +62,9 @@ visorchannel_create_guts(u64 physaddr, unsigned long 
channel_bytes,
int err;
size_t size = sizeof(struct channel_header);
 
+   if (physaddr == 0)
+   return NULL;
+
channel = kzalloc(sizeof(*channel), gfp);
if (!channel)
goto cleanup;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 121/141] staging: unisys: Prep for removing 'info' structs

2015-05-05 Thread Benjamin Romer
From: Don Zickus 

The visorbus driver has three _info structs lying around
(device, bus, channel) that store subsets of info from the
bigger structs.

Having these structs around make resource handling very difficult
and more complicated than it needs to be.  Use the device
infrastructure and instead pass 'struct visor_device' all
over the place.

In order to do that 'struct visor_device' needs to get smarter.
This patch adds the pieces to prep for it.  The new elements
will be used in later patches.

Signed-off-by: Don Zickus 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/visorbus.h  | 22 ++
 drivers/staging/unisys/visorbus/visorbus_private.h |  9 -
 drivers/staging/unisys/visorbus/visorchannel.c |  4 
 3 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index 6c551df..bba4825 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -37,12 +37,23 @@
 
 #include "periodic_work.h"
 #include "channel.h"
+#include "controlvmchannel.h"
+#include "vbuschannel.h"
 
 struct visor_driver;
 struct visor_device;
+extern struct bus_type visorbus_type;
 
 typedef void (*visorbus_state_complete_func) (struct visor_device *dev,
  int status);
+struct visorchipset_state {
+   u32 created:1;
+   u32 attached:1;
+   u32 configured:1;
+   u32 running:1;
+   /* Add new fields above. */
+   /* Remaining bits in this 32-bit word are unused. */
+};
 
 /** This struct describes a specific Supervisor channel, by providing its
  *  GUID, name, and sizes.
@@ -141,6 +152,17 @@ struct visor_device {
bool resuming;
unsigned long chipset_bus_no;
unsigned long chipset_dev_no;
+   struct visorchipset_state state;
+   uuid_le type;
+   uuid_le inst;
+   u8 *name;
+   u8 *description;
+   struct controlvm_message_header pending_msg_hdr;
+   struct spar_vbus_headerinfo vbus_hdr_info;
+   u32 switch_no;
+   u32 internal_port_no;
+   uuid_le partition_uuid;
+   struct irq_info intr;
 };
 
 #define to_visor_device(x) container_of(x, struct visor_device, device)
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 8326e4d..bbc64bd 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -27,15 +27,6 @@
 
 struct visorchannel;
 
-struct visorchipset_state {
-   u32 created:1;
-   u32 attached:1;
-   u32 configured:1;
-   u32 running:1;
-   /* Add new fields above. */
-   /* Remaining bits in this 32-bit word are unused. */
-};
-
 enum visorchipset_addresstype {
/** address is guest physical, but outside of the physical memory
 *  region that is controlled by the running OS (this is the normal
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 2d3e4d6..a9c3ae1 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -23,6 +23,7 @@
 #include "version.h"
 #include "visorbus.h"
 #include 
+#include "controlvmchannel.h"
 
 #define MYDRVNAME "visorchannel"
 
@@ -44,6 +45,9 @@ struct visorchannel {
struct signal_queue_header event_queue;
struct signal_queue_header ack_queue;
} safe_uis_queue;
+   struct irq_info intr;
+   uuid_le type;
+   uuid_le inst;
 };
 
 /* Creates the struct visorchannel abstraction for a data area in memory,
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 065/141] staging: unisys: controlvmchannel.h comment aligment and cleanup

2015-05-05 Thread Benjamin Romer
From: Erik Arfvidson 

This patch is a comment aligment and cleanup for
controlvmchannel.h.

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 .../include/channels/controlvmchannel.h| 231 ++---
 1 file changed, 107 insertions(+), 124 deletions(-)

diff --git 
a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h 
b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
index d3c1aab..8830d70 100644
--- a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
@@ -23,20 +23,21 @@
 /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
 #define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID   \
UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \
-   0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
+   0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
 
 static const uuid_le spar_controlvm_channel_protocol_uuid =
SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
 
 #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \
ULTRA_CHANNEL_PROTOCOL_SIGNATURE
-#define CONTROLVM_MESSAGE_MAX 64
+#define CONTROLVM_MESSAGE_MAX 64
 
 /* Must increment this whenever you insert or delete fields within
-* this channel struct.  Also increment whenever you change the meaning
-* of fields within this channel struct so as to break pre-existing
-* software.  Note that you can usually add fields to the END of the
-* channel struct withOUT needing to increment this. */
+ * this channel struct.  Also increment whenever you change the meaning
+ * of fields within this channel struct so as to break pre-existing
+ * 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 SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch)   \
@@ -49,17 +50,16 @@ static const uuid_le spar_controlvm_channel_protocol_uuid =
 
 #define MAX_SERIAL_NUM 32
 
-/* Defines for various channel queues... */
+/* Defines for various channel queues */
 #define CONTROLVM_QUEUE_REQUEST0
 #define CONTROLVM_QUEUE_RESPONSE   1
-#defineCONTROLVM_QUEUE_EVENT   2
+#define CONTROLVM_QUEUE_EVENT  2
 #define CONTROLVM_QUEUE_ACK3
 
-/* Max number of messages stored during IOVM creation to be reused
- * after crash */
+/* Max num of messages stored during IOVM creation to be reused after crash */
 #define CONTROLVM_CRASHMSG_MAX 2
 
-/** Ids for commands that may appear in either queue of a ControlVm channel.
+/* Ids for commands that may appear in either queue of a ControlVm channel.
  *
  *  Commands that are initiated by the command partition (CP), by an IO or
  *  console service partition (SP), or by a guest partition (GP)are:
@@ -73,55 +73,50 @@ static const uuid_le spar_controlvm_channel_protocol_uuid =
  */
 enum controlvm_id {
CONTROLVM_INVALID = 0,
-   /* SWITCH commands required Parameter: SwitchNumber  */
-   /* BUS commands required Parameter: BusNumber  */
-   CONTROLVM_BUS_CREATE = 0x101,   /* CP --> SP, GP */
-   CONTROLVM_BUS_DESTROY = 0x102,  /* CP --> SP, GP */
-   CONTROLVM_BUS_CONFIGURE = 0x104,/* CP --> SP */
-   CONTROLVM_BUS_CHANGESTATE = 0x105,  /* CP --> SP, GP */
-   CONTROLVM_BUS_CHANGESTATE_EVENT = 0x106, /* SP, GP --> CP */
-/* DEVICE commands required Parameter: BusNumber, DeviceNumber  */
-
-   CONTROLVM_DEVICE_CREATE = 0x201,/* CP --> SP, GP */
-   CONTROLVM_DEVICE_DESTROY = 0x202,   /* CP --> SP, GP */
-   CONTROLVM_DEVICE_CONFIGURE = 0x203, /* CP --> SP */
-   CONTROLVM_DEVICE_CHANGESTATE = 0x204,   /* CP --> SP, GP */
-   CONTROLVM_DEVICE_CHANGESTATE_EVENT = 0x205, /* SP, GP --> CP */
-   CONTROLVM_DEVICE_RECONFIGURE = 0x206,   /* CP --> Boot */
+   /* SWITCH commands required Parameter: SwitchNumber */
+   /* BUS commands required Parameter: BusNumber */
+   CONTROLVM_BUS_CREATE = 0x101,   /* CP --> SP, GP */
+   CONTROLVM_BUS_DESTROY = 0x102,  /* CP --> SP, GP */
+   CONTROLVM_BUS_CONFIGURE = 0x104,/* CP --> SP */
+   CONTROLVM_BUS_CHANGESTATE = 0x105,  /* CP --> SP, GP */
+   CONTROLVM_BUS_CHANGESTATE_EVENT = 0x106,/* SP, GP --> CP */
+/* DEVICE commands required Parameter: BusNumber, DeviceNumber */
+
+   CONTROLVM_DEVICE_CREATE = 0x201,/* CP --> SP, GP */
+   CONTROLVM_DEVICE_DESTROY = 0x202,   /* CP --> SP, GP */
+   CONTROLVM_DEVICE_CONFIGURE = 0x203, /* CP --> SP */
+   CONTROLVM_DEVICE_CHANGESTATE = 0x204,   /* CP --> SP, GP */
+   CONTROLVM_DEVICE_CHANGESTATE_EVENT = 0x205, /* SP, GP --> CP */
+   CONTROLVM_DEVICE_RECONF

[PATCH 130/141] staging: unisys: Convert the device attributes to visor_device

2015-05-05 Thread Benjamin Romer
From: Don Zickus 

Convert the device attribute files to properly use visor_device.
This removes a whole bunch of checks and assumptions and simplifies
the code.  Everything is straightforward.

No testing down as I can't mimic channel info correctl.

Signed-off-by: Don Zickus 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 80 +
 1 file changed, 28 insertions(+), 52 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1a46788..7b585d8 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -543,78 +543,54 @@ static const struct attribute_group 
*visorbus_dev_groups[] = {
 static ssize_t partition_handle_show(struct device *dev,
 struct device_attribute *attr,
 char *buf) {
-   struct visorbus_devdata *businst = to_visorbus_devdata(dev);
-   struct visorchipset_bus_info bus_info;
-   int len = 0;
+   struct visor_device *vdev = to_visor_device(dev);
+   u64 handle = visorchannel_get_clientpartition(vdev->visorchannel);
 
-   if (businst && visorchipset_get_bus_info(businst->devno, &bus_info))
-   len = snprintf(buf, PAGE_SIZE,
-  "0x%Lx\n",
-  (unsigned long long)bus_info.partition_handle);
-   return len;
+   return snprintf(buf, PAGE_SIZE, "0x%Lx\n", handle);
 }
 
 static ssize_t partition_guid_show(struct device *dev,
   struct device_attribute *attr,
   char *buf) {
-   struct visorbus_devdata *businst = to_visorbus_devdata(dev);
-   struct visorchipset_bus_info bus_info;
-   int len = 0;
+   struct visor_device *vdev = to_visor_device(dev);
 
-   if (businst && visorchipset_get_bus_info(businst->devno, &bus_info))
-   len = snprintf(buf, PAGE_SIZE, "{%pUb}\n",
-  &bus_info.partition_uuid);
-   return len;
+   return snprintf(buf, PAGE_SIZE, "{%pUb}\n", &vdev->partition_uuid);
 }
 
 static ssize_t partition_name_show(struct device *dev,
   struct device_attribute *attr,
   char *buf) {
-   struct visorbus_devdata *businst = to_visorbus_devdata(dev);
-   struct visorchipset_bus_info bus_info;
-   int len = 0;
+   struct visor_device *vdev = to_visor_device(dev);
 
-   if (businst &&
-   visorchipset_get_bus_info(businst->devno, &bus_info) &&
-   bus_info.name)
-   len = snprintf(buf, PAGE_SIZE, "%s\n", bus_info.name);
-   return len;
+   return snprintf(buf, PAGE_SIZE, "%s\n", vdev->name);
 }
 
 static ssize_t channel_addr_show(struct device *dev,
 struct device_attribute *attr,
 char *buf) {
-   struct visorbus_devdata *businst = to_visorbus_devdata(dev);
-   struct visorchipset_bus_info bus_info;
-   int len = 0;
+   struct visor_device *vdev = to_visor_device(dev);
+   u64 addr = visorchannel_get_physaddr(vdev->visorchannel);
 
-   if (businst && visorchipset_get_bus_info(businst->devno, &bus_info))
-   len = snprintf(buf, PAGE_SIZE, "0x%Lx\n", (unsigned long long)
-  bus_info.chan_info.channel_addr);
-   return len;
+   return snprintf(buf, PAGE_SIZE, "0x%Lx\n", addr);
 }
 
 static ssize_t channel_bytes_show(struct device *dev,
  struct device_attribute *attr,
  char *buf) {
-   struct visorbus_devdata *businst = to_visorbus_devdata(dev);
-   struct visorchipset_bus_info bus_info;
-   int len = 0;
+   struct visor_device *vdev = to_visor_device(dev);
+   u64 nbytes = visorchannel_get_nbytes(vdev->visorchannel);
 
-   if (businst && visorchipset_get_bus_info(businst->devno, &bus_info))
-   len = snprintf(buf, PAGE_SIZE, "0x%Lx\n", (unsigned long long)
-  bus_info.chan_info.n_channel_bytes);
-   return len;
+   return snprintf(buf, PAGE_SIZE, "0x%Lx\n", nbytes);
 }
 
 static ssize_t channel_id_show(struct device *dev,
   struct device_attribute *attr,
   char *buf) {
-   struct visorbus_devdata *businst = to_visorbus_devdata(dev);
+   struct visor_device *vdev = to_visor_device(dev);
int len = 0;
 
-   if (businst && businst->chan) {
-   visorchannel_id(businst->chan, buf);
+   if (vdev->visorchannel

[PATCH 111/141] staging: unisys: Get rid of references to common-spar

2015-05-05 Thread Benjamin Romer
From: David Kershner 

Makefiles still had common-spar listed in ccflags.

This gets rid of them.

Signed-off-by: David Kershner 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/Makefile | 2 --
 drivers/staging/unisys/visorchannel/Makefile | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/Makefile 
b/drivers/staging/unisys/visorbus/Makefile
index 72d4d44..fa27ee5 100644
--- a/drivers/staging/unisys/visorbus/Makefile
+++ b/drivers/staging/unisys/visorbus/Makefile
@@ -10,6 +10,4 @@ visorbus-y += visorchipset.o
 visorbus-y += periodic_work.o
 
 ccflags-y += -Idrivers/staging/unisys/include
-ccflags-y += -Idrivers/staging/unisys/common-spar/include
-ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels
 ccflags-y += -Idrivers/staging/unisys/visorutil
diff --git a/drivers/staging/unisys/visorchannel/Makefile 
b/drivers/staging/unisys/visorchannel/Makefile
index e079c96..0c0cacb 100644
--- a/drivers/staging/unisys/visorchannel/Makefile
+++ b/drivers/staging/unisys/visorchannel/Makefile
@@ -7,6 +7,4 @@ obj-$(CONFIG_UNISYS_VISORCHANNEL)   += visorchannel.o
 visorchannel-y := visorchannel_main.o visorchannel_funcs.o
 
 ccflags-y += -Idrivers/staging/unisys/include
-ccflags-y += -Idrivers/staging/unisys/common-spar/include
-ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels
 ccflags-y += -Idrivers/staging/unisys/visorutil
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 104/141] staging: unisys: Remove appos_subsystems.h

2015-05-05 Thread Benjamin Romer
From: David Kershner 

Get rid of common-spar/include/diagnostics/appos_subsystems.h.

No one is using it.

Signed-off-by: David Kershner 
Signed-off-by: Benjamin Romer 
---
 .../include/diagnostics/appos_subsystems.h | 310 -
 drivers/staging/unisys/include/uisutils.h  |   1 -
 2 files changed, 311 deletions(-)
 delete mode 100644 
drivers/staging/unisys/common-spar/include/diagnostics/appos_subsystems.h

diff --git 
a/drivers/staging/unisys/common-spar/include/diagnostics/appos_subsystems.h 
b/drivers/staging/unisys/common-spar/include/diagnostics/appos_subsystems.h
deleted file mode 100644
index 18cc9ed..000
--- a/drivers/staging/unisys/common-spar/include/diagnostics/appos_subsystems.h
+++ /dev/null
@@ -1,310 +0,0 @@
-/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/* Please note that this file is to be used ONLY for defining diagnostic
- * subsystem values for the appos (sPAR Linux service partitions) component.
- */
-#ifndef __APPOS_SUBSYSTEMS_H__
-#define __APPOS_SUBSYSTEMS_H__
-
-#ifdef __KERNEL__
-#include 
-#include 
-#else
-#include 
-#include 
-#endif
-
-static inline char *
-subsys_unknown_to_s(int subsys, char *s, int n)
-{
-   snprintf(s, n, "SUBSYS-%-2.2d", subsys);
-   s[n - 1] = '\0';
-   return s;
-}
-
-#define SUBSYS_TO_MASK(subsys)  (1ULL << (subsys))
-
-/* The first SUBSYS_APPOS_MAX subsystems are the same for each AppOS type
- * (IOVM, SMS, etc.) The rest have unique values for each AppOS type.
- */
-#define SUBSYS_APPOS_MAX 16
-
-#defineSUBSYS_APPOS_DEFAULT 1  /* or "other" */
-#define SUBSYS_APPOS_CHIPSET 2 /* controlvm and other */
-   /* low-level sPAR activity */
-#define SUBSYS_APPOS_BUS 3 /* sPAR bus */
-/* DAK #define SUBSYS_APPOS_DIAG4  // diagnostics and dump */
-#define SUBSYS_APPOS_CHANNELACCESS   5 /* generic channel access */
-#define SUBSYS_APPOS_NICCLIENT   6 /* virtual NIC client */
-#define SUBSYS_APPOS_HBACLIENT   7 /* virtual HBA client */
-#define SUBSYS_APPOS_CONSOLESERIAL   8 /* sPAR virtual serial console */
-#define SUBSYS_APPOS_UISLIB  9 /*  */
-#define SUBSYS_APPOS_VRTCUPDD   10 /*  */
-#define SUBSYS_APPOS_WATCHDOG   11 /* watchdog timer and healthcheck */
-#define SUBSYS_APPOS_13 13 /* available */
-#define SUBSYS_APPOS_14 14 /* available */
-#define SUBSYS_APPOS_15 15 /* available */
-#define SUBSYS_APPOS_16 16 /* available */
-static inline char *
-subsys_generic_to_s(int subsys, char *s, int n)
-{
-   switch (subsys) {
-   case SUBSYS_APPOS_DEFAULT:
-   strncpy(s, "APPOS_DEFAULT", n);
-   break;
-   case SUBSYS_APPOS_CHIPSET:
-   strncpy(s, "APPOS_CHIPSET", n);
-   break;
-   case SUBSYS_APPOS_BUS:
-   strncpy(s, "APPOS_BUS", n);
-   break;
-   case SUBSYS_APPOS_CHANNELACCESS:
-   strncpy(s, "APPOS_CHANNELACCESS", n);
-   break;
-   case SUBSYS_APPOS_NICCLIENT:
-   strncpy(s, "APPOS_NICCLIENT", n);
-   break;
-   case SUBSYS_APPOS_HBACLIENT:
-   strncpy(s, "APPOS_HBACLIENT", n);
-   break;
-   case SUBSYS_APPOS_CONSOLESERIAL:
-   strncpy(s, "APPOS_CONSOLESERIAL", n);
-   break;
-   case SUBSYS_APPOS_UISLIB:
-   strncpy(s, "APPOS_UISLIB", n);
-   break;
-   case SUBSYS_APPOS_VRTCUPDD:
-   strncpy(s, "APPOS_VRTCUPDD", n);
-   break;
-   case SUBSYS_APPOS_WATCHDOG:
-   strncpy(s, "APPOS_WATCHDOG", n);
-   break;
-   case SUBSYS_APPOS_13:
-   strncpy(s, "APPOS_13", n);
-   break;
-   case SUBSYS_APPOS_14:
-   strncpy(s, "APPOS_14", n);
-   break;
-   case SUBSYS_APPOS_15:
-   strncpy(s, "APPOS_15", n);
-   break;
-   case SUBSYS_APPOS_16:
-   strncpy(s, "APPOS_16", n);
-   break;
-   default:
-   subsys_unknown_to_s(subsys, s, n);
-   break;
-   }
-   s[n - 1] = '\0

[PATCH 098/141] staging: unisys: visorchipset: Remove unused cache allocator

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 39 --
 1 file changed, 39 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index ac75ddf..ca22f49 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -2223,45 +2223,6 @@ visorchipset_set_device_context(u32 bus_no, u32 dev_no, 
void *context)
 }
 EXPORT_SYMBOL_GPL(visorchipset_set_device_context);
 
-/* Generic wrapper function for allocating memory from a kmem_cache pool.
- */
-void *
-visorchipset_cache_alloc(struct kmem_cache *pool, bool ok_to_block,
-char *fn, int ln)
-{
-   gfp_t gfp;
-   void *p;
-
-   if (ok_to_block)
-   gfp = GFP_KERNEL;
-   else
-   gfp = GFP_ATOMIC;
-   /* __GFP_NORETRY means "ok to fail", meaning
-* kmem_cache_alloc() can return NULL, implying the caller CAN
-* cope with failure.  If you do NOT specify __GFP_NORETRY,
-* Linux will go to extreme measures to get memory for you
-* (like, invoke oom killer), which will probably cripple the
-* system.
-*/
-   gfp |= __GFP_NORETRY;
-   p = kmem_cache_alloc(pool, gfp);
-   if (!p)
-   return NULL;
-
-   return p;
-}
-
-/* Generic wrapper function for freeing memory from a kmem_cache pool.
- */
-void
-visorchipset_cache_free(struct kmem_cache *pool, void *p, char *fn, int ln)
-{
-   if (!p)
-   return;
-
-   kmem_cache_free(pool, p);
-}
-
 static ssize_t chipsetready_store(struct device *dev,
  struct device_attribute *attr,
  const char *buf, size_t count)
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 036/141] staging: unisys: remove file.c and pass functionality to visorchipset

2015-05-05 Thread Benjamin Romer
From: Erik Arfvidson 

This patch trasitions the include files and functions from file.c
and places them into visorchipset_main.c

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/Makefile   |   2 +-
 drivers/staging/unisys/visorchipset/file.c | 162 -
 .../unisys/visorchipset/visorchipset_main.c| 136 -
 3 files changed, 136 insertions(+), 164 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorchipset/file.c

diff --git a/drivers/staging/unisys/visorchipset/Makefile 
b/drivers/staging/unisys/visorchipset/Makefile
index 1bf6699..6886cb7 100644
--- a/drivers/staging/unisys/visorchipset/Makefile
+++ b/drivers/staging/unisys/visorchipset/Makefile
@@ -4,7 +4,7 @@
 
 obj-$(CONFIG_UNISYS_VISORCHIPSET)  += visorchipset.o
 
-visorchipset-y := visorchipset_main.o file.o parser.o
+visorchipset-y := visorchipset_main.o parser.o
 
 ccflags-y += -Idrivers/staging/unisys/include
 ccflags-y += -Idrivers/staging/unisys/uislib
diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
deleted file mode 100644
index c0bd416..000
--- a/drivers/staging/unisys/visorchipset/file.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* file.c
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/* This contains the implementation that allows a usermode program to
- * communicate with the visorchipset driver using a device/file interface.
- */
-
-#include 
-#include 
-
-#include "version.h"
-#include "visorchipset.h"
-#include "visorbus.h"
-#include "uisutils.h"
-#include "visorchipset.h"
-
-#define CURRENT_FILE_PC VISOR_CHIPSET_PC_file_c
-
-static struct cdev file_cdev;
-static struct visorchannel **file_controlvm_channel;
-
-void
-visorchipset_file_cleanup(dev_t major_dev)
-{
-   if (file_cdev.ops)
-   cdev_del(&file_cdev);
-   file_cdev.ops = NULL;
-   unregister_chrdev_region(major_dev, 1);
-}
-
-static int
-visorchipset_open(struct inode *inode, struct file *file)
-{
-   unsigned minor_number = iminor(inode);
-
-   if (minor_number)
-   return -ENODEV;
-   file->private_data = NULL;
-   return 0;
-}
-
-static int
-visorchipset_release(struct inode *inode, struct file *file)
-{
-   return 0;
-}
-
-static int
-visorchipset_mmap(struct file *file, struct vm_area_struct *vma)
-{
-   unsigned long physaddr = 0;
-   unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
-   GUEST_PHYSICAL_ADDRESS addr = 0;
-
-   /* sv_enable_dfp(); */
-   if (offset & (PAGE_SIZE - 1))
-   return -ENXIO;  /* need aligned offsets */
-
-   switch (offset) {
-   case VISORCHIPSET_MMAP_CONTROLCHANOFFSET:
-   vma->vm_flags |= VM_IO;
-   if (!*file_controlvm_channel)
-   return -ENXIO;
-
-   visorchannel_read(*file_controlvm_channel,
-   offsetof(struct spar_controlvm_channel_protocol,
-gp_control_channel),
-   &addr, sizeof(addr));
-   if (!addr)
-   return -ENXIO;
-
-   physaddr = (unsigned long)addr;
-   if (remap_pfn_range(vma, vma->vm_start,
-   physaddr >> PAGE_SHIFT,
-   vma->vm_end - vma->vm_start,
-   /*pgprot_noncached */
-   (vma->vm_page_prot))) {
-   return -EAGAIN;
-   }
-   break;
-   default:
-   return -ENOSYS;
-   }
-   return 0;
-}
-
-static long visorchipset_ioctl(struct file *file, unsigned int cmd,
-  unsigned long arg)
-{
-   s64 adjustment;
-   s64 vrtc_offset;
-
-   switch (cmd) {
-   case VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET:
-   /* get the physical rtc offset */
-   vrtc_offset = issue_vmcall_query_guest_virtual_time_offset();
-   if (copy_to_user((void __user *)arg, &vrtc_offset,
-sizeof(vrtc_offset))) {
-   return -EFAULT;
-   }
-   return SUCCESS;
-   c

[PATCH 102/141] staging: unisys: visorchipset_init(): Simplify initial checks

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 40 +++---
 1 file changed, 17 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index d88f11f..88a2b5e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1474,15 +1474,14 @@ initialize_controlvm_payload(void)
 /*  Send ACTION=online for DEVPATH=/sys/devices/platform/visorchipset.
  *  Returns CONTROLVM_RESP_xxx code.
  */
-int
+static int
 visorchipset_chipset_ready(void)
 {
kobject_uevent(&visorchipset_platform_device.dev.kobj, KOBJ_ONLINE);
return CONTROLVM_RESP_SUCCESS;
 }
-EXPORT_SYMBOL_GPL(visorchipset_chipset_ready);
 
-int
+static int
 visorchipset_chipset_selftest(void)
 {
char env_selftest[20];
@@ -1493,18 +1492,16 @@ visorchipset_chipset_selftest(void)
   envp);
return CONTROLVM_RESP_SUCCESS;
 }
-EXPORT_SYMBOL_GPL(visorchipset_chipset_selftest);
 
 /*  Send ACTION=offline for DEVPATH=/sys/devices/platform/visorchipset.
  *  Returns CONTROLVM_RESP_xxx code.
  */
-int
+static int
 visorchipset_chipset_notready(void)
 {
kobject_uevent(&visorchipset_platform_device.dev.kobj, KOBJ_OFFLINE);
return CONTROLVM_RESP_SUCCESS;
 }
-EXPORT_SYMBOL_GPL(visorchipset_chipset_notready);
 
 static void
 chipset_ready(struct controlvm_message_header *msg_hdr)
@@ -2099,14 +2096,13 @@ device_destroy_response(u32 bus_no, u32 dev_no, int 
response)
device_responder(CONTROLVM_DEVICE_DESTROY, bus_no, dev_no, response);
 }
 
-void
+static void
 visorchipset_device_pause_response(u32 bus_no, u32 dev_no, int response)
 {
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
 bus_no, dev_no, response,
 segment_state_standby);
 }
-EXPORT_SYMBOL_GPL(visorchipset_device_pause_response);
 
 static void
 device_resume_response(u32 bus_no, u32 dev_no, int response)
@@ -2327,28 +2323,26 @@ visorchipset_init(struct acpi_device *acpi_device)
 {
int rc = 0;
u64 addr;
+   int tmp_sz = sizeof(struct spar_controlvm_channel_protocol);
+   uuid_le uuid = SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
+
+   addr = controlvm_get_channel_address();
+   if (!addr)
+   return -ENODEV;
 
memset(&busdev_notifiers, 0, sizeof(busdev_notifiers));
memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info));
memset(&livedump_info, 0, sizeof(livedump_info));
atomic_set(&livedump_info.buffers_in_use, 0);
 
-   addr = controlvm_get_channel_address();
-   if (addr) {
-   int tmp_sz = sizeof(struct spar_controlvm_channel_protocol);
-   uuid_le uuid = SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
-   controlvm_channel =
-   visorchannel_create_with_lock(addr, tmp_sz,
- GFP_KERNEL, uuid);
-   if (SPAR_CONTROLVM_CHANNEL_OK_CLIENT(
-   visorchannel_get_header(controlvm_channel))) {
-   initialize_controlvm_payload();
-   } else {
-   visorchannel_destroy(controlvm_channel);
-   controlvm_channel = NULL;
-   return -ENODEV;
-   }
+   controlvm_channel = visorchannel_create_with_lock(addr, tmp_sz,
+ GFP_KERNEL, uuid);
+   if (SPAR_CONTROLVM_CHANNEL_OK_CLIENT(
+   visorchannel_get_header(controlvm_channel))) {
+   initialize_controlvm_payload();
} else {
+   visorchannel_destroy(controlvm_channel);
+   controlvm_channel = NULL;
return -ENODEV;
}
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 053/141] staging: unisys: decouple visor_memregion_{read, write}()

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 .../staging/unisys/visorutil/memregion_direct.c| 26 --
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c 
b/drivers/staging/unisys/visorutil/memregion_direct.c
index 0ee7cb2..96460d7 100644
--- a/drivers/staging/unisys/visorutil/memregion_direct.c
+++ b/drivers/staging/unisys/visorutil/memregion_direct.c
@@ -124,35 +124,27 @@ visor_memregion_resize(struct memregion *memregion, ulong 
newsize)
 }
 EXPORT_SYMBOL_GPL(visor_memregion_resize);
 
-static int
-memregion_readwrite(BOOL is_write,
-   struct memregion *memregion, ulong offset,
-   void *local, ulong nbytes)
+int
+visor_memregion_read(struct memregion *memregion, ulong offset, void *dest,
+ulong nbytes)
 {
if (offset + nbytes > memregion->nbytes)
return -EIO;
 
-   if (is_write)
-   memcpy_toio(memregion->mapped + offset, local, nbytes);
-   else
-   memcpy_fromio(local, memregion->mapped + offset, nbytes);
-
+   memcpy_fromio(dest, memregion->mapped + offset, nbytes);
return 0;
 }
-
-int
-visor_memregion_read(struct memregion *memregion, ulong offset, void *dest,
-ulong nbytes)
-{
-   return memregion_readwrite(FALSE, memregion, offset, dest, nbytes);
-}
 EXPORT_SYMBOL_GPL(visor_memregion_read);
 
 int
 visor_memregion_write(struct memregion *memregion, ulong offset, void *src,
  ulong nbytes)
 {
-   return memregion_readwrite(TRUE, memregion, offset, src, nbytes);
+   if (offset + nbytes > memregion->nbytes)
+   return -EIO;
+
+   memcpy_toio(memregion->mapped + offset, src, nbytes);
+   return 0;
 }
 EXPORT_SYMBOL_GPL(visor_memregion_write);
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 113/141] staging: unisys: remove remaining utility headers

2015-05-05 Thread Benjamin Romer
From: David Kershner 

remove uisqueue.h, uisthread.h, and uisutils.h
replace HOSTADDRESS with u64
remove "uisutils.h" from header list in visorchipset.c

Signed-off-by: David Kershner 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/uisqueue.h  | 396 -
 drivers/staging/unisys/include/uisthread.h |  42 ---
 drivers/staging/unisys/include/uisutils.h  | 293 --
 drivers/staging/unisys/visorbus/visorchipset.c |  37 ++-
 4 files changed, 36 insertions(+), 732 deletions(-)
 delete mode 100644 drivers/staging/unisys/include/uisqueue.h
 delete mode 100644 drivers/staging/unisys/include/uisthread.h
 delete mode 100644 drivers/staging/unisys/include/uisutils.h

diff --git a/drivers/staging/unisys/include/uisqueue.h 
b/drivers/staging/unisys/include/uisqueue.h
deleted file mode 100644
index 08ba16e..000
--- a/drivers/staging/unisys/include/uisqueue.h
+++ /dev/null
@@ -1,396 +0,0 @@
-/* uisqueue.h
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/*
- * Unisys IO Virtualization header NOTE: This file contains only Linux
- * specific structs.  All OS-independent structs are in iochannel.h.xx
- */
-
-#ifndef __UISQUEUE_H__
-#define __UISQUEUE_H__
-
-#include "linux/version.h"
-#include "iochannel.h"
-#include 
-#include 
-#include 
-
-#include "controlvmchannel.h"
-#include "controlvmcompletionstatus.h"
-
-struct uisqueue_info {
-   struct channel_header __iomem *chan;
-   /* channel containing queues in which scsi commands &
-* responses are queued
-*/
-   u64 packets_sent;
-   u64 packets_received;
-   u64 interrupts_sent;
-   u64 interrupts_received;
-   u64 max_not_empty_cnt;
-   u64 total_wakeup_cnt;
-   u64 non_empty_wakeup_cnt;
-
-   struct {
-   struct signal_queue_header reserved1;   /*  */
-   struct signal_queue_header reserved2;   /*  */
-   } safe_uis_queue;
-   unsigned int (*send_int_if_needed)(struct uisqueue_info *info,
-  unsigned int whichcqueue,
-  unsigned char issue_irq_if_empty,
-  u64 irq_handle,
-  unsigned char io_termination);
-};
-
-/* uisqueue_put_cmdrsp_with_lock_client queues a commmand or response
- * to the specified queue, at the tail if the queue is full but
- * oktowait == 0, then it return 0 indicating failure.  otherwise it
- * wait for the queue to become non-full. If command is queued, return
- * 1 for success.
- */
-#define DONT_ISSUE_INTERRUPT 0
-#define ISSUE_INTERRUPT 1
-
-#define DONT_WAIT   0
-#define OK_TO_WAIT  1
-#define UISLIB_LOCK_PREFIX \
-   ".section .smp_locks,\"a\"\n"   \
-   _ASM_ALIGN "\n" \
-   _ASM_PTR "661f\n" /* address */ \
-   ".previous\n"   \
-   "661:\n\tlock; "
-
-unsigned long long uisqueue_interlocked_or(unsigned long long __iomem *tgt,
-  unsigned long long set);
-unsigned long long uisqueue_interlocked_and(unsigned long long __iomem *tgt,
-   unsigned long long set);
-
-int uisqueue_put_cmdrsp_with_lock_client(struct uisqueue_info *queueinfo,
-struct uiscmdrsp *cmdrsp,
-unsigned int queue,
-void *insertlock,
-unsigned char issue_irq_if_empty,
-u64 irq_handle,
-char oktowait,
-u8 *channel_id);
-
-/* uisqueue_get_cmdrsp gets the cmdrsp entry at the head of the queue
- * and copies it to the area pointed by cmdrsp param.
- * returns 0 if queue is empty, 1 otherwise
- */
-int
-
-uisqueue_get_cmdrsp(struct uisqueue_info *queueinfo, void *cmdrsp,
-   unsigned int queue);
-
-#define MAX_NAME_SIZE_UISQUEUE 64
-
-struct extport_info {
-   u8 valid:1;
-   /* if 1, indicates this extport slot is occupied
-* if 0, indicates t

[PATCH 019/141] staging: unisys: Avoid some == 0 checks

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/file.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index e63ef2a..a17027c 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -36,7 +36,7 @@ static struct visorchannel **file_controlvm_channel;
 void
 visorchipset_file_cleanup(dev_t major_dev)
 {
-   if (file_cdev.ops != NULL)
+   if (file_cdev.ops)
cdev_del(&file_cdev);
file_cdev.ops = NULL;
unregister_chrdev_region(major_dev, 1);
@@ -47,7 +47,7 @@ visorchipset_open(struct inode *inode, struct file *file)
 {
unsigned minor_number = iminor(inode);
 
-   if (minor_number != 0)
+   if (minor_number)
return -ENODEV;
file->private_data = NULL;
return 0;
@@ -73,16 +73,16 @@ visorchipset_mmap(struct file *file, struct vm_area_struct 
*vma)
switch (offset) {
case VISORCHIPSET_MMAP_CONTROLCHANOFFSET:
vma->vm_flags |= VM_IO;
-   if (*file_controlvm_channel == NULL) {
+   if (!*file_controlvm_channel)
return -ENXIO;
-   }
+
visorchannel_read(*file_controlvm_channel,
offsetof(struct spar_controlvm_channel_protocol,
 gp_control_channel),
&addr, sizeof(addr));
-   if (addr == 0) {
+   if (!addr)
return -ENXIO;
-   }
+
physaddr = (unsigned long)addr;
if (remap_pfn_range(vma, vma->vm_start,
physaddr >> PAGE_SHIFT,
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 037/141] staging: unisys: move parser.[ch] functionality into visorchipset

2015-05-05 Thread Benjamin Romer
From: Erik Arfvidson 

This patch moves includes files and functions from parser.[ch] into
visorchipset.

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorbus_main.c|   2 +-
 drivers/staging/unisys/visorchipset/Makefile   |   2 +-
 drivers/staging/unisys/visorchipset/parser.c   | 430 -
 drivers/staging/unisys/visorchipset/parser.h   |  45 ---
 drivers/staging/unisys/visorchipset/visorchipset.h |  24 +-
 .../unisys/visorchipset/visorchipset_main.c| 411 +++-
 6 files changed, 432 insertions(+), 482 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorchipset/parser.c
 delete mode 100644 drivers/staging/unisys/visorchipset/parser.h

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 13a270d..d7ca116 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -2040,7 +2040,7 @@ visorbus_init(void)
 
POSTCODE_LINUX_3(DRIVER_ENTRY_PC, rc, POSTCODE_SEVERITY_INFO);
bus_device_info_init(&clientbus_driverinfo,
-"clientbus", MYDRVNAME,
+"clientbus", "visorbus",
 VERSION, NULL);
 
/* process module options */
diff --git a/drivers/staging/unisys/visorchipset/Makefile 
b/drivers/staging/unisys/visorchipset/Makefile
index 6886cb7..e9168d8 100644
--- a/drivers/staging/unisys/visorchipset/Makefile
+++ b/drivers/staging/unisys/visorchipset/Makefile
@@ -4,7 +4,7 @@
 
 obj-$(CONFIG_UNISYS_VISORCHIPSET)  += visorchipset.o
 
-visorchipset-y := visorchipset_main.o parser.o
+visorchipset-y := visorchipset_main.o
 
 ccflags-y += -Idrivers/staging/unisys/include
 ccflags-y += -Idrivers/staging/unisys/uislib
diff --git a/drivers/staging/unisys/visorchipset/parser.c 
b/drivers/staging/unisys/visorchipset/parser.c
deleted file mode 100644
index 6ca6da8..000
--- a/drivers/staging/unisys/visorchipset/parser.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/* parser.c
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#include "parser.h"
-#include "memregion.h"
-#include "controlvmchannel.h"
-#include 
-#include 
-#include 
-
-#define MYDRVNAME "visorchipset_parser"
-#define CURRENT_FILE_PC VISOR_CHIPSET_PC_parser_c
-
-/* We will refuse to allocate more than this many bytes to copy data from
- * incoming payloads.  This serves as a throttling mechanism.
- */
-#define MAX_CONTROLVM_PAYLOAD_BYTES (1024*128)
-static unsigned long controlvm_payload_bytes_buffered;
-
-struct parser_context {
-   unsigned long allocbytes;
-   unsigned long param_bytes;
-   u8 *curr;
-   unsigned long bytes_remaining;
-   bool byte_stream;
-   char data[0];
-};
-
-static struct parser_context *
-parser_init_guts(u64 addr, u32 bytes, bool local,
-bool standard_payload_header, bool *retry)
-{
-   int allocbytes = sizeof(struct parser_context) + bytes;
-   struct parser_context *rc = NULL;
-   struct parser_context *ctx = NULL;
-   struct memregion *rgn = NULL;
-   struct spar_controlvm_parameters_header *phdr = NULL;
-
-   if (retry)
-   *retry = false;
-   if (!standard_payload_header)
-   /* alloc and 0 extra byte to ensure payload is
-* '\0'-terminated
-*/
-   allocbytes++;
-   if ((controlvm_payload_bytes_buffered + bytes)
-   > MAX_CONTROLVM_PAYLOAD_BYTES) {
-   if (retry)
-   *retry = true;
-   rc = NULL;
-   goto cleanup;
-   }
-   ctx = kzalloc(allocbytes, GFP_KERNEL|__GFP_NORETRY);
-   if (!ctx) {
-   if (retry)
-   *retry = true;
-   rc = NULL;
-   goto cleanup;
-   }
-
-   ctx->allocbytes = allocbytes;
-   ctx->param_bytes = bytes;
-   ctx->curr = NULL;
-   ctx->bytes_remaining = 0;
-   ctx->byte_stream = false;
-   if (local) {
-   void *p;
-
-   if (addr > virt_to_phys(high_memory - 1)) {
-   rc = NULL;
-   goto cleanup;
-   }
-   p = __va((

[PATCH 075/141] staging: unisys: memregion: Eliminate visor_memregion_get_*() functions

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchannel.c  |  7 +++
 drivers/staging/unisys/visorutil/memregion.h|  3 ---
 drivers/staging/unisys/visorutil/memregion_direct.c | 21 -
 3 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index cfbb19f..bf2f17a 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(visorchannel_destroy);
 HOSTADDRESS
 visorchannel_get_physaddr(struct visorchannel *channel)
 {
-   return visor_memregion_get_physaddr(&channel->memregion);
+   return channel->memregion.physaddr;
 }
 EXPORT_SYMBOL_GPL(visorchannel_get_physaddr);
 
@@ -501,7 +501,6 @@ visorchannel_debug(struct visorchannel *channel, int 
num_queues,
 {
HOSTADDRESS addr = 0;
ulong nbytes = 0, nbytes_region = 0;
-   struct memregion *memregion = NULL;
struct channel_header hdr;
struct channel_header *phdr = &hdr;
int i = 0;
@@ -510,8 +509,8 @@ visorchannel_debug(struct visorchannel *channel, int 
num_queues,
if (!channel)
return;
 
-   addr = visor_memregion_get_physaddr(memregion);
-   nbytes_region = visor_memregion_get_nbytes(memregion);
+   addr = visorchannel_get_physaddr(channel);
+   nbytes_region = visorchannel_get_nbytes(channel);
errcode = visorchannel_read(channel, off,
phdr, sizeof(struct channel_header));
if (errcode < 0) {
diff --git a/drivers/staging/unisys/visorutil/memregion.h 
b/drivers/staging/unisys/visorutil/memregion.h
index 57d617f..6893937 100644
--- a/drivers/staging/unisys/visorutil/memregion.h
+++ b/drivers/staging/unisys/visorutil/memregion.h
@@ -33,10 +33,7 @@ int visor_memregion_read(struct memregion *memregion,
 ulong offset, void *dest, ulong nbytes);
 int visor_memregion_write(struct memregion *memregion,
  ulong offset, void *src, ulong nbytes);
-HOSTADDRESS visor_memregion_get_physaddr(struct memregion *memregion);
-ulong visor_memregion_get_nbytes(struct memregion *memregion);
 void memregion_dump(struct memregion *memregion, char *s,
ulong off, ulong len, struct seq_file *seq);
-void __iomem *visor_memregion_get_pointer(struct memregion *memregion);
 
 #endif
diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c 
b/drivers/staging/unisys/visorutil/memregion_direct.c
index fa7a406..238e62f 100644
--- a/drivers/staging/unisys/visorutil/memregion_direct.c
+++ b/drivers/staging/unisys/visorutil/memregion_direct.c
@@ -55,27 +55,6 @@ unmapit(struct memregion *memregion)
}
 }
 
-HOSTADDRESS
-visor_memregion_get_physaddr(struct memregion *memregion)
-{
-   return memregion->physaddr;
-}
-EXPORT_SYMBOL_GPL(visor_memregion_get_physaddr);
-
-ulong
-visor_memregion_get_nbytes(struct memregion *memregion)
-{
-   return memregion->nbytes;
-}
-EXPORT_SYMBOL_GPL(visor_memregion_get_nbytes);
-
-void __iomem *
-visor_memregion_get_pointer(struct memregion *memregion)
-{
-   return memregion->mapped;
-}
-EXPORT_SYMBOL_GPL(visor_memregion_get_pointer);
-
 int
 visor_memregion_read(struct memregion *memregion, ulong offset, void *dest,
 ulong nbytes)
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 081/141] staging: unisys: Eliminate visor_memregion_read()

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchannel.c  | 11 +--
 drivers/staging/unisys/visorutil/memregion.h|  2 --
 drivers/staging/unisys/visorutil/memregion_direct.c | 12 
 3 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 6d7ea8b..549128d 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -307,9 +307,9 @@ sig_read_header(struct visorchannel *channel, u32 queue,
return FALSE;
 
/* Read the appropriate SIGNAL_QUEUE_HEADER into local memory. */
-   err = visor_memregion_read(&channel->memregion,
-  SIG_QUEUE_OFFSET(&channel->chan_hdr, queue),
-  sig_hdr, sizeof(struct signal_queue_header));
+   err = visorchannel_read(channel,
+   SIG_QUEUE_OFFSET(&channel->chan_hdr, queue),
+   sig_hdr, sizeof(struct signal_queue_header));
if (err)
return FALSE;
 
@@ -324,9 +324,8 @@ sig_read_data(struct visorchannel *channel, u32 queue,
int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue,
 sig_hdr, slot);
 
-   err = visor_memregion_read(&channel->memregion,
-  signal_data_offset,
-  data, sig_hdr->signal_size);
+   err = visorchannel_read(channel, signal_data_offset,
+   data, sig_hdr->signal_size);
if (err)
return FALSE;
 
diff --git a/drivers/staging/unisys/visorutil/memregion.h 
b/drivers/staging/unisys/visorutil/memregion.h
index 6893937..4122b48 100644
--- a/drivers/staging/unisys/visorutil/memregion.h
+++ b/drivers/staging/unisys/visorutil/memregion.h
@@ -29,8 +29,6 @@ struct memregion {
void __iomem *mapped;
 };
 
-int visor_memregion_read(struct memregion *memregion,
-ulong offset, void *dest, ulong nbytes);
 int visor_memregion_write(struct memregion *memregion,
  ulong offset, void *src, ulong nbytes);
 void memregion_dump(struct memregion *memregion, char *s,
diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c 
b/drivers/staging/unisys/visorutil/memregion_direct.c
index 82fb263..17b1033 100644
--- a/drivers/staging/unisys/visorutil/memregion_direct.c
+++ b/drivers/staging/unisys/visorutil/memregion_direct.c
@@ -26,18 +26,6 @@
 #define MYDRVNAME "memregion"
 
 int
-visor_memregion_read(struct memregion *memregion, ulong offset, void *dest,
-ulong nbytes)
-{
-   if (offset + nbytes > memregion->nbytes)
-   return -EIO;
-
-   memcpy_fromio(dest, memregion->mapped + offset, nbytes);
-   return 0;
-}
-EXPORT_SYMBOL_GPL(visor_memregion_read);
-
-int
 visor_memregion_write(struct memregion *memregion, ulong offset, void *src,
  ulong nbytes)
 {
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 083/141] staging: unisys: Finally remove the last remnants of memregion

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/visorbus.h  |  1 -
 drivers/staging/unisys/visorbus/visorchannel.c | 53 ++
 drivers/staging/unisys/visorchannel/globals.h  |  1 -
 drivers/staging/unisys/visorutil/Makefile  |  2 +-
 drivers/staging/unisys/visorutil/memregion.h   | 35 --
 .../staging/unisys/visorutil/memregion_direct.c| 26 ---
 6 files changed, 25 insertions(+), 93 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorutil/memregion.h
 delete mode 100644 drivers/staging/unisys/visorutil/memregion_direct.c

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index e1c6662..874 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -36,7 +36,6 @@
 
 #include "periodic_work.h"
 #include "channel.h"
-#include "memregion.h"
 
 #ifndef HOSTADDRESS
 #define HOSTADDRESS u64
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 564d325..ed652a0 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -17,12 +17,9 @@
 
 /*
  *  This provides Supervisor channel communication primitives, which are
- *  independent of the mechanism used to access the channel data.  All channel
- *  data is accessed using the memregion abstraction.  (memregion has both
- *  a CM2 implementation and a direct memory implementation.)
+ *  independent of the mechanism used to access the channel data.
  */
 
-#include "memregion.h"
 #include "version.h"
 #include "visorbus.h"
 #include 
@@ -30,7 +27,9 @@
 #define MYDRVNAME "visorchannel"
 
 struct visorchannel {
-   struct memregion memregion; /* from visor_memregion_create() */
+   HOSTADDRESS physaddr;
+   ulong nbytes;
+   void __iomem *mapped;
struct channel_header chan_hdr;
uuid_le guid;
ulong size;
@@ -69,14 +68,14 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong 
channel_bytes,
if (!request_mem_region(physaddr, size, MYDRVNAME))
goto cleanup;
 
-   channel->memregion.mapped = ioremap_cache(physaddr, size);
-   if (!channel->memregion.mapped) {
+   channel->mapped = ioremap_cache(physaddr, size);
+   if (!channel->mapped) {
release_mem_region(physaddr, size);
goto cleanup;
}
 
-   channel->memregion.physaddr = physaddr;
-   channel->memregion.nbytes = size;
+   channel->physaddr = physaddr;
+   channel->nbytes = size;
 
err = visorchannel_read(channel, 0, &channel->chan_hdr,
sizeof(struct channel_header));
@@ -89,22 +88,19 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong 
channel_bytes,
if (uuid_le_cmp(guid, NULL_UUID_LE) == 0)
guid = channel->chan_hdr.chtype;
 
-   iounmap(channel->memregion.mapped);
-   release_mem_region(channel->memregion.physaddr,
-  channel->memregion.nbytes);
-   channel->memregion.mapped = NULL;
-   if (!request_mem_region(channel->memregion.physaddr, channel_bytes,
-   MYDRVNAME))
+   iounmap(channel->mapped);
+   release_mem_region(channel->physaddr, channel->nbytes);
+   channel->mapped = NULL;
+   if (!request_mem_region(channel->physaddr, channel_bytes, MYDRVNAME))
goto cleanup;
 
-   channel->memregion.mapped = ioremap_cache(channel->memregion.physaddr,
- channel_bytes);
-   if (!channel->memregion.mapped) {
-   release_mem_region(channel->memregion.physaddr, channel_bytes);
+   channel->mapped = ioremap_cache(channel->physaddr, channel_bytes);
+   if (!channel->mapped) {
+   release_mem_region(channel->physaddr, channel_bytes);
goto cleanup;
}
 
-   channel->memregion.nbytes = channel_bytes;
+   channel->nbytes = channel_bytes;
 
channel->size = channel_bytes;
channel->guid = guid;
@@ -137,10 +133,9 @@ visorchannel_destroy(struct visorchannel *channel)
 {
if (!channel)
return;
-   if (channel->memregion.mapped) {
-   iounmap(channel->memregion.mapped);
-   release_mem_region(channel->memregion.physaddr,
-  channel->memregion.nbytes);
+   if (channel->mapped) {
+   iounmap(channel->mapped);
+   release_mem_region(channel->physaddr, channel->nbytes);
}
kfree(channel);
 }
@@ -149,7 +144,7 @@ EXPORT_SYMBOL_GPL(v

[PATCH 020/141] staging: unisys: No point in checking != 0

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 .../unisys/visorchipset/visorchipset_main.c| 26 +++---
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 9f5c539..3b5f3d6 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -368,7 +368,7 @@ static ssize_t toolaction_store(struct device *dev,
u8 tool_action;
int ret;
 
-   if (kstrtou8(buf, 10, &tool_action) != 0)
+   if (kstrtou8(buf, 10, &tool_action))
return -EINVAL;
 
ret = visorchannel_write(controlvm_channel,
@@ -402,7 +402,7 @@ static ssize_t boottotool_store(struct device *dev,
int val, ret;
struct efi_spar_indication efi_spar_indication;
 
-   if (kstrtoint(buf, 10, &val) != 0)
+   if (kstrtoint(buf, 10, &val))
return -EINVAL;
 
efi_spar_indication.boot_to_tool = val;
@@ -434,7 +434,7 @@ static ssize_t error_store(struct device *dev, struct 
device_attribute *attr,
u32 error;
int ret;
 
-   if (kstrtou32(buf, 10, &error) != 0)
+   if (kstrtou32(buf, 10, &error))
return -EINVAL;
 
ret = visorchannel_write(controlvm_channel,
@@ -464,7 +464,7 @@ static ssize_t textid_store(struct device *dev, struct 
device_attribute *attr,
u32 text_id;
int ret;
 
-   if (kstrtou32(buf, 10, &text_id) != 0)
+   if (kstrtou32(buf, 10, &text_id))
return -EINVAL;
 
ret = visorchannel_write(controlvm_channel,
@@ -495,7 +495,7 @@ static ssize_t remaining_steps_store(struct device *dev,
u16 remaining_steps;
int ret;
 
-   if (kstrtou16(buf, 10, &remaining_steps) != 0)
+   if (kstrtou16(buf, 10, &remaining_steps))
return -EINVAL;
 
ret = visorchannel_write(controlvm_channel,
@@ -1701,7 +1701,7 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
 * within our OS-controlled memory.  We need to know that, because it
 * makes a difference in how we compute the virtual address.
 */
-   if (parm_addr != 0 && parm_bytes != 0) {
+   if (parm_addr && parm_bytes) {
bool retry = false;
 
parser_ctx =
@@ -1962,7 +1962,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
}
 
/* reuse IOVM create bus message */
-   if (local_crash_bus_msg.cmd.create_bus.channel_addr != 0) {
+   if (local_crash_bus_msg.cmd.create_bus.channel_addr) {
bus_create(&local_crash_bus_msg);
} else {
POSTCODE_LINUX_2(CRASH_DEV_BUS_NULL_FAILURE_PC,
@@ -1971,7 +1971,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
}
 
/* reuse create device message for storage device */
-   if (local_crash_dev_msg.cmd.create_device.channel_addr != 0) {
+   if (local_crash_dev_msg.cmd.create_device.channel_addr) {
my_device_create(&local_crash_dev_msg);
} else {
POSTCODE_LINUX_2(CRASH_DEV_DEV_NULL_FAILURE_PC,
@@ -2129,10 +2129,10 @@ static ssize_t chipsetready_store(struct device *dev,
if (sscanf(buf, "%63s", msgtype) != 1)
return -EINVAL;
 
-   if (strcmp(msgtype, "CALLHOMEDISK_MOUNTED") == 0) {
+   if (!strcmp(msgtype, "CALLHOMEDISK_MOUNTED")) {
chipset_events[0] = 1;
return count;
-   } else if (strcmp(msgtype, "MODULES_LOADED") == 0) {
+   } else if (!strcmp(msgtype, "MODULES_LOADED")) {
chipset_events[1] = 1;
return count;
}
@@ -2149,7 +2149,7 @@ static ssize_t devicedisabled_store(struct device *dev,
 {
unsigned int id;
 
-   if (kstrtouint(buf, 10, &id) != 0)
+   if (kstrtouint(buf, 10, &id))
return -EINVAL;
 
parahotplug_request_complete(id, 0);
@@ -2166,7 +2166,7 @@ static ssize_t deviceenabled_store(struct device *dev,
 {
unsigned int id;
 
-   if (kstrtouint(buf, 10, &id) != 0)
+   if (kstrtouint(buf, 10, &id))
return -EINVAL;
 
parahotplug_request_complete(id, 1);
@@ -2195,7 +2195,7 @@ visorchipset_init(void)
}
 
addr = controlvm_get_channel_address();
-   if (addr != 0) {
+   if (addr) {
controlvm_channel =
visorchannel_create_with_lock
(addr,
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 106/141] staging: unisys: Move controlframework into controlvmchannel.h

2015-05-05 Thread Benjamin Romer
From: David Kershner 

Controlframework was only needed by controlvmchannel, move the
structures into that header file.

Signed-off-by: David Kershner 
Signed-off-by: Benjamin Romer 
---
 .../include/channels/controlframework.h| 62 --
 .../include/channels/controlvmchannel.h| 32 ++-
 2 files changed, 31 insertions(+), 63 deletions(-)
 delete mode 100644 
drivers/staging/unisys/common-spar/include/channels/controlframework.h

diff --git 
a/drivers/staging/unisys/common-spar/include/channels/controlframework.h 
b/drivers/staging/unisys/common-spar/include/channels/controlframework.h
deleted file mode 100644
index 33d9caf..000
--- a/drivers/staging/unisys/common-spar/include/channels/controlframework.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/*
- * Module Name:
- *  controlframework.h
- *
- * Abstract: This file defines common structures in the unmanaged
- *  Ultravisor (mostly EFI) space.
- *
- */
-
-#ifndef _CONTROL_FRAMEWORK_H_
-#define _CONTROL_FRAMEWORK_H_
-
-#include 
-#include "channel.h"
-
-struct spar_segment_state  {
-   u16 enabled:1;  /* Bit 0: May enter other states */
-   u16 active:1;   /* Bit 1: Assigned to active partition */
-   u16 alive:1;/* Bit 2: Configure message sent to
-* service/server */
-   u16 revoked:1;  /* Bit 3: similar to partition state
-* ShuttingDown */
-   u16 allocated:1;/* Bit 4: memory (device/port number)
-* has been selected by Command */
-   u16 known:1;/* Bit 5: has been introduced to the
-* service/guest partition */
-   u16 ready:1;/* Bit 6: service/Guest partition has
-* responded to introduction */
-   u16 operating:1;/* Bit 7: resource is configured and
-* operating */
-   /* Note: don't use high bit unless we need to switch to ushort
-* which is non-compliant */
-};
-
-static const struct spar_segment_state segment_state_running = {
-   1, 1, 1, 0, 1, 1, 1, 1
-};
-
-static const struct spar_segment_state segment_state_paused = {
-   1, 1, 1, 0, 1, 1, 1, 0
-};
-
-static const struct spar_segment_state segment_state_standby = {
-   1, 1, 0, 0, 1, 1, 1, 0
-};
-
-#endif /* _CONTROL_FRAMEWORK_H_ not defined */
diff --git 
a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h 
b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
index f1c86fb..a50d9cf 100644
--- a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
@@ -18,7 +18,6 @@
 
 #include 
 #include "channel.h"
-#include "controlframework.h"
 
 /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
 #define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID   \
@@ -56,6 +55,37 @@
 /* Max num of messages stored during IOVM creation to be reused after crash */
 #define CONTROLVM_CRASHMSG_MAX 2
 
+struct spar_segment_state  {
+   u16 enabled:1;  /* Bit 0: May enter other states */
+   u16 active:1;   /* Bit 1: Assigned to active partition */
+   u16 alive:1;/* Bit 2: Configure message sent to
+* service/server */
+   u16 revoked:1;  /* Bit 3: similar to partition state
+* ShuttingDown */
+   u16 allocated:1;/* Bit 4: memory (device/port number)
+* has been selected by Command */
+   u16 known:1;/* Bit 5: has been introduced to the
+* service/guest partition */
+   u16 ready:1;/* Bit 6: service/Guest partition has
+* responded to introduction */
+   u16 operating:1;/* Bit 7: resource is configured and
+* operating */
+   /* Note: don't use high bit unless we need to switch to ushort
+* which is non-compliant */
+};
+
+static const struct spar_segment_state segment_state_running = {
+   1, 1, 1, 0, 1, 1, 1, 1
+};
+

[PATCH 097/141] staging: unisys: Remove wrapper around parser_init_guts()

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 2cf59ca..ac75ddf 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -376,7 +376,7 @@ static void controlvm_respond_physdev_changestate(
 static void parser_done(struct parser_context *ctx);
 
 static struct parser_context *
-parser_init_guts(u64 addr, u32 bytes, bool local, bool *retry)
+parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry)
 {
int allocbytes = sizeof(struct parser_context) + bytes;
struct parser_context *rc = NULL;
@@ -451,17 +451,6 @@ cleanup:
return rc;
 }
 
-/* Call this instead of parser_init() if the payload area consists of just
- * a sequence of bytes, rather than a struct spar_controlvm_parameters_header
- * structures.  Afterwards, you can call parser_simpleString_get() or
- * parser_byteStream_get() to obtain the data.
- */
-static struct parser_context *
-parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry)
-{
-   return parser_init_guts(addr, bytes, local, retry);
-}
-
 static uuid_le
 parser_id_get(struct parser_context *ctx)
 {
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 023/141] staging: unisys: add visorbus driver

2015-05-05 Thread Benjamin Romer
From: Erik Arfvidson 

This base driver provides bus functionality to visorhid, visorhba,
and visornic which will be later added to our driver base. Visorbus
supports sPar bus model and manages bus specific functionality. It
maintains the sysfs subtree /sys/devices/visorbus*/.It is
responsible for device creation and destruction of the devices on
its bus.

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/Kconfig |1 +
 drivers/staging/unisys/Makefile|1 +
 .../common-spar/include/channels/vbuschannel.h |2 +-
 drivers/staging/unisys/visorbus/Kconfig|   10 +
 drivers/staging/unisys/visorbus/Makefile   |   14 +
 drivers/staging/unisys/visorbus/businst_attr.c |  103 ++
 drivers/staging/unisys/visorbus/businst_attr.h |   40 +
 drivers/staging/unisys/visorbus/channel_attr.c |  227 +++
 drivers/staging/unisys/visorbus/channel_attr.h |   27 +
 .../staging/unisys/visorbus/devmajorminor_attr.c   |  192 +++
 .../staging/unisys/visorbus/devmajorminor_attr.h   |   31 +
 drivers/staging/unisys/visorbus/visorbus.h |  166 ++
 drivers/staging/unisys/visorbus/visorbus_main.c| 1643 
 drivers/staging/unisys/visorbus/visorbus_private.h |   50 +
 14 files changed, 2506 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/unisys/visorbus/Kconfig
 create mode 100644 drivers/staging/unisys/visorbus/Makefile
 create mode 100644 drivers/staging/unisys/visorbus/businst_attr.c
 create mode 100644 drivers/staging/unisys/visorbus/businst_attr.h
 create mode 100644 drivers/staging/unisys/visorbus/channel_attr.c
 create mode 100644 drivers/staging/unisys/visorbus/channel_attr.h
 create mode 100644 drivers/staging/unisys/visorbus/devmajorminor_attr.c
 create mode 100644 drivers/staging/unisys/visorbus/devmajorminor_attr.h
 create mode 100644 drivers/staging/unisys/visorbus/visorbus.h
 create mode 100644 drivers/staging/unisys/visorbus/visorbus_main.c
 create mode 100644 drivers/staging/unisys/visorbus/visorbus_private.h

diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig
index 14e1ea6..8d056b5 100644
--- a/drivers/staging/unisys/Kconfig
+++ b/drivers/staging/unisys/Kconfig
@@ -12,5 +12,6 @@ if UNISYSSPAR
 source "drivers/staging/unisys/visorutil/Kconfig"
 source "drivers/staging/unisys/visorchannel/Kconfig"
 source "drivers/staging/unisys/visorchipset/Kconfig"
+source "drivers/staging/unisys/visorbus/Kconfig"
 
 endif # UNISYSSPAR
diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile
index 97e750d..1ed9d39 100644
--- a/drivers/staging/unisys/Makefile
+++ b/drivers/staging/unisys/Makefile
@@ -4,3 +4,4 @@
 obj-$(CONFIG_UNISYS_VISORUTIL) += visorutil/
 obj-$(CONFIG_UNISYS_VISORCHANNEL)  += visorchannel/
 obj-$(CONFIG_UNISYS_VISORCHIPSET)  += visorchipset/
+obj-$(CONFIG_UNISYS_VISORBUS)  += visorbus/
diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 2c42ce1..5ed83a3 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -54,7 +54,7 @@ static const uuid_le spar_vbus_channel_protocol_uuid =
 #define SPAR_VBUS_CHANNEL_OK_SERVER(actual_bytes)\
(spar_check_channel_server(spar_vbus_channel_protocol_uuid, \
   "vbus",  \
-  sizeof(struct ultra_vbus_channel_protocol),\
+  sizeof(struct spar_vbus_channel_protocol),\
   actual_bytes))
 
 #pragma pack(push, 1)  /* both GCC and VC now allow this pragma */
diff --git a/drivers/staging/unisys/visorbus/Kconfig 
b/drivers/staging/unisys/visorbus/Kconfig
new file mode 100644
index 000..0141528
--- /dev/null
+++ b/drivers/staging/unisys/visorbus/Kconfig
@@ -0,0 +1,10 @@
+#
+# Unisys visorbus configuration
+#
+
+config UNISYS_VISORBUS
+   tristate "Unisys visorbus driver"
+   depends on UNISYSSPAR && UNISYS_VISORUTIL && UNISYS_VISORCHANNEL && 
UNISYS_VISORCHIPSET
+   ---help---
+   If you say Y here, you will enable the Unisys visorbus driver.
+
diff --git a/drivers/staging/unisys/visorbus/Makefile 
b/drivers/staging/unisys/visorbus/Makefile
new file mode 100644
index 000..60bb96b
--- /dev/null
+++ b/drivers/staging/unisys/visorbus/Makefile
@@ -0,0 +1,14 @@
+#
+# Makefile for Unisys visorbus
+#
+
+obj-$(CONFIG_UNISYS_VISORBUS)  += visorbus.o
+
+visorbus-y := visorbus_main.o devmajorminor_attr.o businst_attr.o 
channel_attr.o
+
+ccflags-y += -Idrivers/staging/unisys/include
+ccflags-y += -Idrivers/staging/unisys/visorchannel
+ccflags-y += -Idrivers/staging/unisys/visorchipset
+ccfla

[PATCH 028/141] staging: unisys: unify businst attributes into visorbus_main.c

2015-05-05 Thread Benjamin Romer
From: Prarit Bhargava 

The code in businst_attr.[ch] only creates sysfs files and is called
only in visorbus_main.c.  This code should be unified into
visorbus_main.c.  There are some functions that have been made static.

Signed-off-by: Prarit Bhargava 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/Makefile|   2 +-
 drivers/staging/unisys/visorbus/businst_attr.c  | 103 
 drivers/staging/unisys/visorbus/businst_attr.h  |  40 -
 drivers/staging/unisys/visorbus/visorbus_main.c |  97 +-
 4 files changed, 97 insertions(+), 145 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorbus/businst_attr.c
 delete mode 100644 drivers/staging/unisys/visorbus/businst_attr.h

diff --git a/drivers/staging/unisys/visorbus/Makefile 
b/drivers/staging/unisys/visorbus/Makefile
index 20d87da..e1b667d 100644
--- a/drivers/staging/unisys/visorbus/Makefile
+++ b/drivers/staging/unisys/visorbus/Makefile
@@ -4,7 +4,7 @@
 
 obj-$(CONFIG_UNISYS_VISORBUS)  += visorbus.o
 
-visorbus-y := visorbus_main.o devmajorminor_attr.o businst_attr.o 
channel_attr.o
+visorbus-y := visorbus_main.o devmajorminor_attr.o channel_attr.o
 visorbus-y += visorchannel_funcs.o
 
 ccflags-y += -Idrivers/staging/unisys/include
diff --git a/drivers/staging/unisys/visorbus/businst_attr.c 
b/drivers/staging/unisys/visorbus/businst_attr.c
deleted file mode 100644
index b3fea9d..000
--- a/drivers/staging/unisys/visorbus/businst_attr.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* businst_attr.c
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/*   This is actually something they forgot to put in the kernel.
- *   struct bus_type in the kernel SHOULD have a "busses" member, which
- *   should be treated similarly to the "devices" and "drivers" members.
- *   There SHOULD be:
- *   - a "businst_attribute" analogous to the existing "bus_attribute"
- *   - a "businst_create_file" and "businst_remove_file" analogous to the
- * existing "bus_create_file" and "bus_remove_file".
- *   That's what I created businst.c and businst.h to do.
- *
- *   We want to add the "busses" sub-tree in sysfs, where we will house the
- *   names and properties of each bus instance:
- *
- *   /sys/bus//
- *   version
- *   devices
- *--> /sys/devices/
- *--> /sys/devices/
- *   drivers
- *   
- *   
- *   
- *   ...
- *   
- *   
- *   
- *   ...
- *   >>  busses
- *   >>  
- *   >>  
- *   >>  
- *   >>  ...
- *   >>  
- *   >>  
- *   >>  
- *   >>  ...
- *
- *   I considered adding bus instance properties under
- *   /sys/devices/.  But I thought there may be existing
- *   notions that ONLY device sub-trees should live under
- *   /sys/devices/.  So I stayed out of there.
- *
- */
-
-#include "businst_attr.h"
-
-#define to_businst_attr(_attr) \
-   container_of(_attr, struct businst_attribute, attr)
-#define to_visorbus_devdata(obj) \
-   container_of(obj, struct visorbus_devdata, kobj)
-#define CURRENT_FILE_PC VISOR_BUS_PC_businst_attr_c
-
-ssize_t businst_attr_show(struct kobject *kobj, struct attribute *attr,
- char *buf)
-{
-   struct businst_attribute *businst_attr = to_businst_attr(attr);
-   struct visorbus_devdata *bus = to_visorbus_devdata(kobj);
-   ssize_t ret = 0;
-
-   if (businst_attr->show)
-   ret = businst_attr->show(bus, buf);
-   return ret;
-}
-
-ssize_t businst_attr_store(struct kobject *kobj, struct attribute *attr,
-  const char *buf, size_t count)
-{
-   struct businst_attribute *businst_attr = to_businst_attr(attr);
-   struct visorbus_devdata *bus = to_visorbus_devdata(kobj);
-   ssize_t ret = 0;
-
-   if (businst_attr->store)
-   ret = businst_attr->store(bus, buf, count);
-   return ret;
-}
-
-int businst_create_file(struct visorbus_devdata *bus,
-   struct businst_attribute *attr)
-{
-   return sys

[PATCH 139/141] staging: unisys: Remove unneeded fields in diagchannel.h

2015-05-05 Thread Benjamin Romer
From: David Kershner 

Diagchannel.h is used primarily for the diagnostics channel. The
diagnostics channel is not being used by linux guests currently, so
the majority of the file is not needed. What is left is what is
needed to perform postcode vmcalls. Those postcodes will eventually
end up in the diag channel.

Signed-off-by: David Kershner 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/diagchannel.h| 366 +---
 drivers/staging/unisys/visorbus/visorbus_main.c |  48 
 drivers/staging/unisys/visorbus/visorchipset.c  |  45 ---
 3 files changed, 2 insertions(+), 457 deletions(-)

diff --git a/drivers/staging/unisys/include/diagchannel.h 
b/drivers/staging/unisys/include/diagchannel.h
index c1e74e8..82932c5 100644
--- a/drivers/staging/unisys/include/diagchannel.h
+++ b/drivers/staging/unisys/include/diagchannel.h
@@ -13,169 +13,15 @@
  * details.
  */
 
-/*++
- *
- * Module Name:
- *
- * diagchannel.h
- *
- * Abstract:
- *
- * This file defines the DiagChannel protocol.  This protocol is used to aid in
- * preserving event data sent by external applications.  This protocol provides
- * a region for event data to reside in.  This data will eventually be sent to
- * the Boot Partition where it will be committed to memory and/or disk.  This
- * file contains platform-independent data that can be built using any
- * Supervisor build environment (Windows, Linux, EFI).
- *
-*/
-
 #ifndef _DIAG_CHANNEL_H_
 #define _DIAG_CHANNEL_H_
 
 #include 
-#include "channel.h"
-
-/* {EEA7A573-DB82-447c-8716-EFBEAAAE4858} */
-#define SPAR_DIAG_CHANNEL_PROTOCOL_UUID \
-   UUID_LE(0xeea7a573, 0xdb82, 0x447c, \
-   0x87, 0x16, 0xef, 0xbe, 0xaa, 0xae, 0x48, 0x58)
-
-static const uuid_le spar_diag_channel_protocol_uuid =
-   SPAR_DIAG_CHANNEL_PROTOCOL_UUID;
-
-/* {E850F968-3263-4484-8CA5-2A35D087A5A8} */
-#define ULTRA_DIAG_ROOT_CHANNEL_PROTOCOL_GUID \
-   UUID_LE(0xe850f968, 0x3263, 0x4484, \
-   0x8c, 0xa5, 0x2a, 0x35, 0xd0, 0x87, 0xa5, 0xa8)
-
-#define ULTRA_DIAG_CHANNEL_PROTOCOL_SIGNATURE  ULTRA_CHANNEL_PROTOCOL_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
-* channel struct so as to break pre-existing software.  Note that you can
-* usually add fields to the END of the channel struct withOUT needing to
-* increment this. */
-#define ULTRA_DIAG_CHANNEL_PROTOCOL_VERSIONID 2
 
 #define MAX_MODULE_NAME_SIZE 128   /* Maximum length of module name... */
 #define MAX_ADDITIONAL_INFO_SIZE 256   /* Maximum length of any additional info
-* accompanying event... */
-#define MAX_SUBSYSTEMS 64  /* Maximum number of subsystems allowed in
-* DiagChannel... */
-#define LOW_SUBSYSTEMS 32  /* Half of MAX_SUBSYSTEMS to allow 64-bit
-* math */
-#define SUBSYSTEM_DEBUG 0  /* Standard subsystem for debug events */
-#define SUBSYSTEM_DEFAULT 1/* Default subsystem for legacy calls to
-* ReportEvent */
-
-/* few useful subsystem mask values */
-#define SUBSYSTEM_MASK_DEBUG   0x01/* Standard subsystem for debug
-* events */
-#define SUBSYSTEM_MASK_DEFAULT  0x02   /* Default subsystem for legacy calls to
-* ReportEvents */
-
-/* Event parameter "Severity" is overloaded with Cause in byte 2 and Severity 
in
- * byte 0, bytes 1 and 3 are reserved */
-#define SEVERITY_MASK 0x0FF/* mask out all but the Severity in byte 0 */
-#define CAUSE_MASK 0x0FF   /* mask out all but the cause in byte 2 */
-#define CAUSE_SHIFT_AMT 16 /* shift 2 bytes to place it in byte 2 */
-
-/* SubsystemSeverityFilter */
-#define SEVERITY_FILTER_MASK 0x0F /* mask out the Cause half, SeverityFilter is
-  * in the lower nibble */
-#define CAUSE_FILTER_MASK 0xF0 /* mask out the Severity half, CauseFilter is in
-* the upper nibble */
-#define CAUSE_FILTER_SHIFT_AMT 4 /* shift amount to place it in lower or upper
-  * nibble */
-
-/* Copied from EFI's EFI_TIME struct in efidef.h.  EFI headers are not allowed
-* in some of the Supervisor areas, such as Monitor, so it has been "ported" 
here
-* for use in diagnostic event timestamps... */
-struct diag_efi_time  {
-   u16 year;   /* 1998 - 20XX */
-   u8 month;   /* 1 - 12 */
-   u8 day; /* 1 - 31 */
-   u8 hour;/* 0 - 23 */
-   u8 minute;  /* 0 - 59 */
-   u8 second;  /* 0 - 59 */
-   u8 pad1;
-   u32 nanosecond; /* 0 - 999, 999, 999 */
-   s16 timezone;   /* -1440 to 1440 or 2047 */
-

[PATCH 122/141] staging: unisys: Add visor device find routine

2015-05-05 Thread Benjamin Romer
From: Don Zickus 

If we are going to remove the bus_info structs than we need a way
to find the devices when the *_create/destroy cmds are sent over
the vmchannel.

This function crudely impements what pci has.  It takes a bus_no
and dev_no and finds the matching 'struct visor_device'.

This function can/should be optimzed later once we get our heads
wrapped around its needs.  For now, I am using dev_no=0 to mean
the visorbus itself.

The function is limited to chipset.c only because it is only needed
to do the lookups upon receiving a vmchannel command.  Future patches
will make sure the resulting 'struct visor_device' is used every
where else.

Also allow visorbus_type to be more visible for use.

Signed-off-by: Don Zickus 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorbus_main.c |  2 +-
 drivers/staging/unisys/visorbus/visorchipset.c  | 39 +
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 6bd7ef5..bc865cd 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -88,7 +88,7 @@ const struct attribute_group *visorbus_bus_groups[] = {
 /** This describes the TYPE of bus.
  *  (Don't confuse this with an INSTANCE of the bus.)
  */
-static struct bus_type visorbus_type = {
+struct bus_type visorbus_type = {
.name = "visorbus",
.match = visorbus_match,
.uevent = visorbus_uevent,
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index b96a40c..42bf02a 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -711,6 +711,45 @@ dev_info_clear(void *v)
memset(p, 0, sizeof(struct visorchipset_device_info));
 }
 
+struct visor_busdev {
+   u32 bus_no;
+   u32 dev_no;
+};
+
+static int match_visorbus_dev_by_id(struct device *dev, void *data)
+{
+   struct visor_device *vdev = to_visor_device(dev);
+   struct visor_busdev *id = (struct visor_busdev *)data;
+   u32 bus_no = id->bus_no;
+   u32 dev_no = id->dev_no;
+
+   if (((bus_no == -1) || (vdev->chipset_bus_no == bus_no)) &&
+   ((dev_no == -1) || (vdev->chipset_dev_no == dev_no)))
+   return 1;
+
+   return 0;
+}
+struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no,
+  struct visor_device *from)
+{
+   struct device *dev;
+   struct device *dev_start = NULL;
+   struct visor_device *vdev = NULL;
+   struct visor_busdev id = {
+   .bus_no = bus_no,
+   .dev_no = dev_no
+   };
+
+   if (from)
+   dev_start = &from->device;
+   dev = bus_find_device(&visorbus_type, dev_start, (void *)&id,
+ match_visorbus_dev_by_id);
+   if (dev)
+   vdev = to_visor_device(dev);
+   return vdev;
+}
+EXPORT_SYMBOL(visorbus_get_device_by_id);
+
 static struct visorchipset_bus_info *
 bus_find(struct list_head *list, u32 bus_no)
 {
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 118/141] staging: unisys: Properly move version file into bus attr

2015-05-05 Thread Benjamin Romer
From: Don Zickus 

Simplify things by moving the version file handling into the core.

Signed-off-by: Don Zickus 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 66 +++--
 1 file changed, 30 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 4c35d34..b3e69d6 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -88,6 +88,35 @@ static int visorbus_uevent(struct device *xdev, struct 
kobj_uevent_env *env);
 static int visorbus_match(struct device *xdev, struct device_driver *xdrv);
 static void fix_vbus_dev_info(struct visor_device *visordev);
 
+/*  BUS type attributes
+ *
+ *  define & implement display of bus attributes under
+ *  /sys/bus/visorbus.
+ *
+ */
+
+static ssize_t version_show(struct bus_type *bus, char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, "%s\n", VERSION);
+}
+
+static BUS_ATTR_RO(version);
+
+static struct attribute *visorbus_bus_attrs[] = {
+   &bus_attr_version.attr,
+   NULL,
+};
+
+static const struct attribute_group visorbus_bus_group = {
+   .attrs = visorbus_bus_attrs,
+};
+
+const struct attribute_group *visorbus_bus_groups[] = {
+   &visorbus_bus_group,
+   NULL,
+};
+
+
 /** This describes the TYPE of bus.
  *  (Don't confuse this with an INSTANCE of the bus.)
  */
@@ -95,6 +124,7 @@ static struct bus_type visorbus_type = {
.name = "visorbus",
.match = visorbus_match,
.uevent = visorbus_uevent,
+   .bus_groups = visorbus_bus_groups,
 };
 
 static struct delayed_work periodic_work;
@@ -609,37 +639,6 @@ void unregister_channel_attributes(struct visor_device 
*dev)
 #define to_visorbus_devdata(obj) \
container_of(obj, struct visorbus_devdata, dev)
 
-/*  BUS type attributes
- *
- *  define & implement display of bus attributes under
- *  /sys/bus/visorbus.
- *
- */
-
-static ssize_t
-BUSTYPE_ATTR_version(struct bus_type *bus, char *buf)
-{
-   return snprintf(buf, PAGE_SIZE, "%s\n", VERSION);
-}
-
-static struct bus_attribute bustype_attr_version =
-__ATTR(version, S_IRUGO, BUSTYPE_ATTR_version, NULL);
-
-static int
-register_bustype_attributes(void)
-{
-   int rc = 0;
-
-   rc = bus_create_file(&visorbus_type, &bustype_attr_version);
-   return rc;
-}
-
-static void
-unregister_bustype_attributes(void)
-{
-   bus_remove_file(&visorbus_type, &bustype_attr_version);
-}
-
 /*  BUS instance attributes
  *
  *  define & implement display of bus attributes under
@@ -1580,10 +1579,6 @@ create_bus_type(void)
 
visorbus_type.dev_attrs = visor_device_attrs;
rc = bus_register(&visorbus_type);
-   if (rc < 0)
-   return rc;
-
-   rc = register_bustype_attributes();
return rc;
 }
 
@@ -1592,7 +1587,6 @@ create_bus_type(void)
 static void
 remove_bus_type(void)
 {
-   unregister_bustype_attributes();
bus_unregister(&visorbus_type);
 }
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 059/141] staging: unisys: remove unused enum from controlvmchannel.h

2015-05-05 Thread Benjamin Romer
From: Erik Arfvidson 

This patch removes this enum since it is unused

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 .../staging/unisys/common-spar/include/channels/controlvmchannel.h| 4 
 1 file changed, 4 deletions(-)

diff --git 
a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h 
b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
index 435ac92..4e6dec2 100644
--- a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
@@ -20,10 +20,6 @@
 #include "channel.h"
 #include "controlframework.h"
 
-enum { INVALID_GUEST_FIRMWARE, SAMPLE_GUEST_FIRMWARE,
-   TIANO32_GUEST_FIRMWARE, TIANO64_GUEST_FIRMWARE
-};
-
 /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
 #define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID   \
UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 136/141] staging: unisys: Removed unused entries from struct visor_channeltype_descriptor

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

min_size/max_size aren't used anywhere, and they were just causing
headaches in the drivers being ported over to the new interfaces.

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/visorbus.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index d60421c..cc0724a 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -60,8 +60,6 @@ struct visorchipset_state {
 struct visor_channeltype_descriptor {
const uuid_le guid;
const char *name;
-   unsigned long min_size;
-   unsigned long max_size;
 };
 
 /** Information provided by each visor driver when it registers with the
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 016/141] staging: unisys: Remove unused typedef SPARREPORTEVENT_COMPLETE_FUNC

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 70b9e6e..59552af 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -194,9 +194,6 @@ visorchipset_register_busdev_server(
struct visorchipset_busdev_responders *responders,
struct ultra_vbus_deviceinfo *driver_info);
 
-typedef void (*SPARREPORTEVENT_COMPLETE_FUNC) (struct controlvm_message *msg,
-  int status);
-
 void visorchipset_device_pause_response(u32 bus_no, u32 dev_no, int response);
 
 bool visorchipset_get_bus_info(u32 bus_no,
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 134/141] staging: unisys: Hide vbus_hdr_info from public visor_device

2015-05-05 Thread Benjamin Romer
From: Don Zickus 

The vbus_hdr_info is a private struct that is used to communicate
bus info over the channel.  Currently it is public in visorbus.h
and causes compile problems (missing header).

Fix this by allocating memory and turn the public element into
a pointer.

Signed-off-by: Don Zickus 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/visorbus.h   |  3 +--
 drivers/staging/unisys/visorbus/visorbus_main.c | 28 +
 2 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index dc5de471..d60421c 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -38,7 +38,6 @@
 #include "periodic_work.h"
 #include "channel.h"
 #include "controlvmchannel.h"
-#include "vbuschannel.h"
 
 struct visor_driver;
 struct visor_device;
@@ -158,7 +157,7 @@ struct visor_device {
u8 *name;
u8 *description;
struct controlvm_message_header pending_msg_hdr;
-   struct spar_vbus_headerinfo vbus_hdr_info;
+   void *vbus_hdr_info;
u32 switch_no;
u32 internal_port_no;
uuid_le partition_uuid;
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index a79996a..59cf220 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -24,6 +24,7 @@
 #include "vbuschannel.h"
 #include "guestlinuxdebug.h"
 #include "vbusdeviceinfo.h"
+#include "vbuschannel.h"
 #include "controlvmchannel.h"
 
 #define MYDRVNAME "visorbus"
@@ -1188,10 +1189,13 @@ fix_vbus_dev_info(struct visor_device *visordev)
struct visorchannel *channel = visordev->visorchannel;
struct ultra_vbus_deviceinfo dev_info;
const char *chan_type_name = NULL;
+   struct spar_vbus_headerinfo *hdr_info;
 
if (!visordev->device.driver)
return;
 
+   hdr_info = (struct spar_vbus_headerinfo *)visordev->vbus_hdr_info;
+
visordrv = to_visor_driver(visordev->device.driver);
 
/* Within the list of device types (by GUID) that the driver
@@ -1211,16 +1215,13 @@ fix_vbus_dev_info(struct visor_device *visordev)
bus_device_info_init(&dev_info, chan_type_name,
 visordrv->name, visordrv->version,
 visordrv->vertag);
-   write_vbus_dev_info(channel,
-   &visordev->vbus_hdr_info, &dev_info, dev_no);
+   write_vbus_dev_info(channel, hdr_info, &dev_info, dev_no);
 
/* Re-write bus+chipset info, because it is possible that this
* was previously written by our evil counterpart, virtpci.
*/
-   write_vbus_chp_info(channel, &visordev->vbus_hdr_info,
-   &chipset_driverinfo);
-   write_vbus_bus_info(channel, &visordev->vbus_hdr_info,
-   &clientbus_driverinfo);
+   write_vbus_chp_info(channel, hdr_info, &chipset_driverinfo);
+   write_vbus_bus_info(channel, hdr_info, &clientbus_driverinfo);
 }
 
 /** Create a device instance for the visor bus itself.
@@ -1230,8 +1231,16 @@ create_bus_instance(struct visor_device *vdev)
 {
int rc;
u32 id = vdev->chipset_bus_no;
+   struct spar_vbus_headerinfo *hdr_info;
 
POSTCODE_LINUX_2(BUS_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
+
+   hdr_info = kzalloc(sizeof(struct spar_vbus_headerinfo), GFP_KERNEL);
+   if (!hdr_info) {
+   rc = -ENOMEM;
+   goto away;
+   }
+   vdev->vbus_hdr_info = (void *)hdr_info;
dev_set_name(&vdev->device, "visorbus%d", id);
vdev->device.bus = &visorbus_type;
vdev->device.groups = visorbus_groups;
@@ -1245,10 +1254,10 @@ create_bus_instance(struct visor_device *vdev)
if (vdev->visorchannel) {
struct visorchannel *channel = vdev->visorchannel;
 
-   if (get_vbus_header_info(channel, &vdev->vbus_hdr_info) >= 0) {
-   write_vbus_chp_info(channel, &vdev->vbus_hdr_info,
+   if (get_vbus_header_info(channel, hdr_info) >= 0) {
+   write_vbus_chp_info(channel, hdr_info,
&chipset_driverinfo);
-   write_vbus_bus_info(channel, &vdev->vbus_hdr_info,
+   write_vbus_bus_info(channel, hdr_info,
&clientbus_driverinfo);
}
}
@@ -1276,6 +1285,7 @@ remove_bus_instance(struct visor_device *dev)
visorchannel_destroy(dev->visorchannel);
dev->

[PATCH 041/141] staging: unisys: visorchannel some general function cleanups

2015-05-05 Thread Benjamin Romer
From: Prarit Bhargava 

Just some cleanups for visorchannel.c, and removal of
safe_sig_queue_validate() which is dead code.

Signed-off-by: Prarit Bhargava 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 110 +
 1 file changed, 41 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index ff14a0d..30bedcc 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -211,13 +211,12 @@ int
 visorchannel_read(struct visorchannel *channel, ulong offset,
  void *local, ulong nbytes)
 {
-   int rc = visor_memregion_read(channel->memregion, offset,
- local, nbytes);
-   if ((rc >= 0) && (offset == 0) &&
-   (nbytes >= sizeof(struct channel_header))) {
-   memcpy(&channel->chan_hdr, local,
-  sizeof(struct channel_header));
-   }
+   int rc;
+   size_t size = sizeof(struct channel_header);
+
+   rc = visor_memregion_read(channel->memregion, offset, local, nbytes);
+   if (rc && !offset && (nbytes >= size))
+   memcpy(&channel->chan_hdr, local, size);
return rc;
 }
 EXPORT_SYMBOL_GPL(visorchannel_read);
@@ -226,9 +225,10 @@ int
 visorchannel_write(struct visorchannel *channel, ulong offset,
   void *local, ulong nbytes)
 {
-   if (offset == 0 && nbytes >= sizeof(struct channel_header))
-   memcpy(&channel->chan_hdr, local,
-  sizeof(struct channel_header));
+   size_t size = sizeof(struct channel_header);
+
+   if (!offset && nbytes >= size)
+   memcpy(&channel->chan_hdr, local, size);
return visor_memregion_write(channel->memregion, offset, local, nbytes);
 }
 EXPORT_SYMBOL_GPL(visorchannel_write);
@@ -237,38 +237,34 @@ int
 visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
   ulong nbytes)
 {
-   int rc = -1;
+   int err;
int bufsize = 65536;
int written = 0;
-   u8 *buf = vmalloc(bufsize);
+   u8 *buf;
 
+   buf = vmalloc(bufsize);
if (!buf)
-   goto cleanup;
+   return -ENOMEM;
 
memset(buf, ch, bufsize);
while (nbytes > 0) {
ulong thisbytes = bufsize;
-   int x = -1;
 
if (nbytes < thisbytes)
thisbytes = nbytes;
-   x = visor_memregion_write(channel->memregion, offset + written,
- buf, thisbytes);
-   if (x < 0) {
-   rc = x;
+   err = visor_memregion_write(channel->memregion,
+   offset + written, buf, thisbytes);
+   if (err)
goto cleanup;
-   }
+
written += thisbytes;
nbytes -= thisbytes;
}
-   rc = 0;
+   return 0;
 
 cleanup:
-   if (buf) {
-   vfree(buf);
-   buf = NULL;
-   }
-   return rc;
+   vfree(buf);
+   return err;
 }
 EXPORT_SYMBOL_GPL(visorchannel_clear);
 
@@ -307,22 +303,19 @@ static BOOL
 sig_read_header(struct visorchannel *channel, u32 queue,
struct signal_queue_header *sig_hdr)
 {
-   BOOL rc = FALSE;
+   int err;
 
if (channel->chan_hdr.ch_space_offset < sizeof(struct channel_header))
-   goto cleanup;
+   return FALSE;
 
/* Read the appropriate SIGNAL_QUEUE_HEADER into local memory. */
+   err = visor_memregion_read(channel->memregion,
+  SIG_QUEUE_OFFSET(&channel->chan_hdr, queue),
+  sig_hdr, sizeof(struct signal_queue_header));
+   if (err)
+   return FALSE;
 
-   if (visor_memregion_read(channel->memregion,
-SIG_QUEUE_OFFSET(&channel->chan_hdr, queue),
-sig_hdr,
-sizeof(struct signal_queue_header)) < 0) {
-   goto cleanup;
-   }
-   rc = TRUE;
-cleanup:
-   return rc;
+   return TRUE;
 }
 
 static BOOL
@@ -330,24 +323,23 @@ sig_do_data(struct visorchannel *channel, u32 queue,
struct signal_queue_header *sig_hdr, u32 slot, void *data,
BOOL is_write)
 {
-   BOOL rc = FALSE;
+   int err;
int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue,
 sig_hdr, slot);
if (is_write) {
-   if (visor_memregion_write(channel->memregion,
-

[PATCH 085/141] staging: unisys: add acpi pnp driver

2015-05-05 Thread Benjamin Romer
From: Prarit Bhargava 

According to Unisys, another OS detects the PNP0A07 as the auto load
device.  We can also do this in the linux kernel by simply converting the
driver over to the ACPI driver model.

Notes: This changes the usage of __init and it had to be removed from some
functions to avoid a !__init function calling an __init function.
Additionally I also cleaned up the headers in visorchipset.c since I was
adding a header file.

Signed-off-by: Prarit Bhargava 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorbus_main.c|  2 +-
 drivers/staging/unisys/visorbus/visorbus_private.h |  2 +-
 drivers/staging/unisys/visorbus/visorchipset.c | 77 --
 3 files changed, 58 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index f7976ca..b522ea4 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -2034,7 +2034,7 @@ struct channel_size_info {
unsigned long max_size;
 };
 
-int __init
+int
 visorbus_init(void)
 {
int rc = 0;
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index f9a5e01..1153c99 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -155,6 +155,6 @@ bool visorchipset_get_device_info(u32 bus_no, u32 dev_no,
 bool visorchipset_set_bus_context(u32 bus_no, void *context);
 
 /* visorbus init and exit functions */
-int __init visorbus_init(void);
+int visorbus_init(void);
 void visorbus_exit(void);
 #endif
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 76923bf..fde8993 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -15,16 +15,7 @@
  * details.
  */
 
-#include "controlvmchannel.h"
-#include "version.h"
-#include "procobjecttree.h"
-#include "visorbus.h"
-#include "periodic_work.h"
-#include "uisutils.h"
-#include "controlvmcompletionstatus.h"
-#include "guestlinuxdebug.h"
-#include "visorbus_private.h"
-
+#include 
 #include 
 #include 
 #include 
@@ -34,6 +25,16 @@
 #include 
 #include 
 
+#include "controlvmchannel.h"
+#include "controlvmcompletionstatus.h"
+#include "guestlinuxdebug.h"
+#include "periodic_work.h"
+#include "procobjecttree.h"
+#include "uisutils.h"
+#include "version.h"
+#include "visorbus.h"
+#include "visorbus_private.h"
+
 #define CURRENT_FILE_PC VISOR_CHIPSET_PC_visorchipset_main_c
 
 #define MAX_NAME_SIZE 128
@@ -2637,17 +2638,12 @@ visorchipset_file_init(dev_t major_dev, struct 
visorchannel **controlvm_channel)
return 0;
 }
 
-
-
-static int __init
-visorchipset_init(void)
+static int
+visorchipset_init(struct acpi_device *acpi_device)
 {
int rc = 0;
HOSTADDRESS addr;
 
-   if (!unisys_spar_platform)
-   return -ENODEV;
-
memset(&busdev_notifiers, 0, sizeof(busdev_notifiers));
memset(&controlvm_payload_info, 0, sizeof(controlvm_payload_info));
memset(&livedump_info, 0, sizeof(livedump_info));
@@ -2733,8 +2729,8 @@ visorchipset_file_cleanup(dev_t major_dev)
unregister_chrdev_region(major_dev, 1);
 }
 
-static void
-visorchipset_exit(void)
+static int
+visorchipset_exit(struct acpi_device *acpi_device)
 {
POSTCODE_LINUX_2(DRIVER_EXIT_PC, POSTCODE_SEVERITY_INFO);
 
@@ -2754,6 +2750,45 @@ visorchipset_exit(void)
 
visorchipset_file_cleanup(visorchipset_platform_device.dev.devt);
POSTCODE_LINUX_2(DRIVER_EXIT_PC, POSTCODE_SEVERITY_INFO);
+
+   return 0;
+}
+
+static const struct acpi_device_id unisys_device_ids[] = {
+   {"PNP0A07", 0},
+   {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, unisys_device_ids);
+
+static struct acpi_driver unisys_acpi_driver = {
+   .name = "unisys_acpi",
+   .class = "unisys_acpi_class",
+   .owner = THIS_MODULE,
+   .ids = unisys_device_ids,
+   .ops = {
+   .add = visorchipset_init,
+   .remove = visorchipset_exit,
+   },
+};
+
+static int init_unisys(void)
+{
+   int result;
+
+   if (!unisys_spar_platform)
+   return -ENODEV;
+
+   result = acpi_bus_register_driver(&unisys_acpi_driver);
+   if (result)
+   return -ENODEV;
+
+   pr_info("Unisys Visorchipset Driver Loaded.\n");
+   return 0;
+};
+
+static void exit_unisys(void)
+{
+   acpi_bus_unregister_driver(&unisys_acpi_driver);
 }
 
 module_param_named(major, visorchipset_major, int, S_IRUGO);
@@ -2767,8 +2802,8 @@ module_param_named(holdchipsetre

[PATCH 042/141] staging: unisys: fix sig_read_data and sig_read_data functions

2015-05-05 Thread Benjamin Romer
From: Prarit Bhargava 

The sig_read_data() and sig_write_data() functions are involved in 2 steps
of calls.  They really don't need to be and this makes for much simpler
code.

Signed-off-by: Prarit Bhargava 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 46 --
 1 file changed, 21 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 30bedcc..d7ddc3a 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -318,42 +318,38 @@ sig_read_header(struct visorchannel *channel, u32 queue,
return TRUE;
 }
 
-static BOOL
-sig_do_data(struct visorchannel *channel, u32 queue,
-   struct signal_queue_header *sig_hdr, u32 slot, void *data,
-   BOOL is_write)
+static inline BOOL
+sig_read_data(struct visorchannel *channel, u32 queue,
+ struct signal_queue_header *sig_hdr, u32 slot, void *data)
 {
int err;
int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue,
 sig_hdr, slot);
-   if (is_write) {
-   err = visor_memregion_write(channel->memregion,
-   signal_data_offset,
-   data, sig_hdr->signal_size);
-   if (err)
-   return FALSE;
-   } else {
-   err = visor_memregion_read(channel->memregion,
-  signal_data_offset,
-  data, sig_hdr->signal_size);
-   if (err)
-   return FALSE;
-   }
-   return TRUE;
-}
 
-static inline BOOL
-sig_read_data(struct visorchannel *channel, u32 queue,
- struct signal_queue_header *sig_hdr, u32 slot, void *data)
-{
-   return sig_do_data(channel, queue, sig_hdr, slot, data, FALSE);
+   err = visor_memregion_read(channel->memregion,
+  signal_data_offset,
+  data, sig_hdr->signal_size);
+   if (err)
+   return FALSE;
+
+   return TRUE;
 }
 
 static inline BOOL
 sig_write_data(struct visorchannel *channel, u32 queue,
   struct signal_queue_header *sig_hdr, u32 slot, void *data)
 {
-   return sig_do_data(channel, queue, sig_hdr, slot, data, TRUE);
+   int err;
+   int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue,
+sig_hdr, slot);
+
+   err = visor_memregion_write(channel->memregion,
+   signal_data_offset,
+   data, sig_hdr->signal_size);
+   if (err)
+   return FALSE;
+
+   return TRUE;
 }
 
 static BOOL
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 080/141] staging: unisys: visorchannel_create_guts(): Use visorchannel_read()

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

There is no benefit to calling visor_memregion_read() at this point.

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index da7bd9c..6d7ea8b 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -78,8 +78,8 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong 
channel_bytes,
channel->memregion.physaddr = physaddr;
channel->memregion.nbytes = size;
 
-   err = visor_memregion_read(&channel->memregion, 0, &channel->chan_hdr,
-  sizeof(struct channel_header));
+   err = visorchannel_read(channel, 0, &channel->chan_hdr,
+   sizeof(struct channel_header));
if (err)
goto cleanup;
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 091/141] staging: unisys: fix visorbus Kconfig

2015-05-05 Thread Benjamin Romer
Removing visorutil made it impossible to build visorbus. Remove the config
setting from the Kconfig so the module can be enabled in the build.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/Kconfig 
b/drivers/staging/unisys/visorbus/Kconfig
index 420c9ee..9b299ac 100644
--- a/drivers/staging/unisys/visorbus/Kconfig
+++ b/drivers/staging/unisys/visorbus/Kconfig
@@ -4,6 +4,6 @@
 
 config UNISYS_VISORBUS
tristate "Unisys visorbus driver"
-   depends on UNISYSSPAR && UNISYS_VISORUTIL
+   depends on UNISYSSPAR
---help---
If you say Y here, you will enable the Unisys visorbus driver.
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 078/141] staging: unisys: visorchannel_read(): Use memcpy_fromio() directly

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Note, this changes the behavior of visorchannel_read(). The old code
would return the channel header, if the offset argument was 0, and the
caller tried to read beyond the size of the visorchannel. Note this
only worked for offset == 0, but not for
(offset > 0) && (offset < header_size), which was inconsistent.

The new implementation returns an error if someone tries to read
beyond the visorchannel size.

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index bf75aa0..cae62fed 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -200,13 +200,12 @@ int
 visorchannel_read(struct visorchannel *channel, ulong offset,
  void *local, ulong nbytes)
 {
-   int rc;
-   size_t size = sizeof(struct channel_header);
+   if (offset + nbytes > channel->memregion.nbytes)
+   return -EIO;
 
-   rc = visor_memregion_read(&channel->memregion, offset, local, nbytes);
-   if (rc && !offset && (nbytes >= size))
-   memcpy(&channel->chan_hdr, local, size);
-   return rc;
+   memcpy_fromio(local, channel->memregion.mapped + offset, nbytes);
+
+   return 0;
 }
 EXPORT_SYMBOL_GPL(visorchannel_read);
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 089/141] staging: unisys: remove timskmod.h and procobjecttree.h

2015-05-05 Thread Benjamin Romer
From: Erik Arfvidson 

This patch move the needed linux include files from timskmod.h
to the files that calls those include. Also procobjecttree.h is
removed since it is dead code.

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/periodic_work.h |  3 +-
 drivers/staging/unisys/include/procobjecttree.h| 47 ---
 drivers/staging/unisys/include/sparstop.h  |  1 -
 drivers/staging/unisys/include/timskmod.h  | 54 --
 drivers/staging/unisys/include/visorbus.h  |  1 +
 drivers/staging/unisys/visorbus/visorbus_main.c|  1 -
 drivers/staging/unisys/visorbus/visorbus_private.h |  1 -
 drivers/staging/unisys/visorbus/visorchipset.c |  2 +-
 drivers/staging/unisys/visorchannel/globals.h  |  1 -
 drivers/staging/unisys/visorutil/periodic_work.c   |  1 -
 10 files changed, 4 insertions(+), 108 deletions(-)
 delete mode 100644 drivers/staging/unisys/include/procobjecttree.h
 delete mode 100644 drivers/staging/unisys/include/timskmod.h

diff --git a/drivers/staging/unisys/include/periodic_work.h 
b/drivers/staging/unisys/include/periodic_work.h
index 65bad08..4e19c28 100644
--- a/drivers/staging/unisys/include/periodic_work.h
+++ b/drivers/staging/unisys/include/periodic_work.h
@@ -18,7 +18,8 @@
 #ifndef __PERIODIC_WORK_H__
 #define __PERIODIC_WORK_H__
 
-#include "timskmod.h"
+#include 
+#include 
 
 
 /* PERIODIC_WORK an opaque structure to users.
diff --git a/drivers/staging/unisys/include/procobjecttree.h 
b/drivers/staging/unisys/include/procobjecttree.h
deleted file mode 100644
index 809c679..000
--- a/drivers/staging/unisys/include/procobjecttree.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* procobjecttree.h
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/** @file *
- *
- *  This describes the interfaces necessary for creating a tree of types,
- *  objects, and properties in /proc.
- *
- **
- */
-
-#ifndef __PROCOBJECTTREE_H__
-#define __PROCOBJECTTREE_H__
-
-#include "timskmod.h"
-
-/* These are opaque structures to users.
- * Fields are declared only in the implementation .c files.
- */
-typedef struct MYPROCOBJECT_Tag MYPROCOBJECT;
-typedef struct MYPROCTYPE_Tag   MYPROCTYPE;
-
-MYPROCOBJECT *visor_proc_CreateObject(MYPROCTYPE *type, const char *name,
- void *context);
-void  visor_proc_DestroyObject(MYPROCOBJECT *obj);
-MYPROCTYPE   *visor_proc_CreateType(struct proc_dir_entry *procRootDir,
-   const char **name,
-   const char **propertyNames,
-   void (*show_property)(struct seq_file *,
- void *, int));
-void  visor_proc_DestroyType(MYPROCTYPE *type);
-
-#endif
diff --git a/drivers/staging/unisys/include/sparstop.h 
b/drivers/staging/unisys/include/sparstop.h
index 0583739..6150d2d 100644
--- a/drivers/staging/unisys/include/sparstop.h
+++ b/drivers/staging/unisys/include/sparstop.h
@@ -18,7 +18,6 @@
 #ifndef __SPARSTOP_H__
 #define __SPARSTOP_H__
 
-#include "timskmod.h"
 #include "version.h"
 #include 
 
diff --git a/drivers/staging/unisys/include/timskmod.h 
b/drivers/staging/unisys/include/timskmod.h
deleted file mode 100644
index 30d8e7a..000
--- a/drivers/staging/unisys/include/timskmod.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* timskmod.h
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#ifndef __TIMSKMOD_H__
-#define __TIMSKMOD_H__
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#

[PATCH 138/141] staging: unisys: Update diag serverity enum

2015-05-05 Thread Benjamin Romer
From: David Kershner 

Give the enum the correct values instead of based on other values.

Signed-off-by: David Kershner 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/diagchannel.h | 34 
 1 file changed, 10 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/unisys/include/diagchannel.h 
b/drivers/staging/unisys/include/diagchannel.h
index e8fb867..c1e74e8 100644
--- a/drivers/staging/unisys/include/diagchannel.h
+++ b/drivers/staging/unisys/include/diagchannel.h
@@ -58,20 +58,6 @@ static const uuid_le spar_diag_channel_protocol_uuid =
 * increment this. */
 #define ULTRA_DIAG_CHANNEL_PROTOCOL_VERSIONID 2
 
-#define SPAR_DIAG_CHANNEL_OK_CLIENT(ch)\
-   (spar_check_channel_client(ch,\
-  spar_diag_channel_protocol_uuid,\
-  "diag",\
-  sizeof(struct spar_diag_channel_protocol),\
-  ULTRA_DIAG_CHANNEL_PROTOCOL_VERSIONID,\
-  ULTRA_DIAG_CHANNEL_PROTOCOL_SIGNATURE))
-
-#define SPAR_DIAG_CHANNEL_OK_SERVER(bytes)\
-   (spar_check_channel_server(spar_diag_channel_protocol_uuid,\
-  "diag",\
-  sizeof(struct spar_diag_channel_protocol),\
-  bytes))
-
 #define MAX_MODULE_NAME_SIZE 128   /* Maximum length of module name... */
 #define MAX_ADDITIONAL_INFO_SIZE 256   /* Maximum length of any additional info
 * accompanying event... */
@@ -204,16 +190,16 @@ struct diag_channel_event {
 * change is made to this enum, they should also be reflected in that file.  */
 enum diag_severity {
DIAG_SEVERITY_ENUM_BEGIN = 0,
-   DIAG_SEVERITY_OVERRIDE = DIAG_SEVERITY_ENUM_BEGIN,
-   DIAG_SEVERITY_VERBOSE = DIAG_SEVERITY_OVERRIDE, /* 0 */
-   DIAG_SEVERITY_INFO = DIAG_SEVERITY_VERBOSE + 1, /* 1 */
-   DIAG_SEVERITY_WARNING = DIAG_SEVERITY_INFO + 1, /* 2 */
-   DIAG_SEVERITY_ERR = DIAG_SEVERITY_WARNING + 1,  /* 3 */
-   DIAG_SEVERITY_PRINT = DIAG_SEVERITY_ERR + 1,/* 4 */
-   DIAG_SEVERITY_SHUTOFF = DIAG_SEVERITY_PRINT + 1, /* 5 */
-   DIAG_SEVERITY_ENUM_END = DIAG_SEVERITY_SHUTOFF, /* 5 */
-   DIAG_SEVERITY_NONFATAL_ERR = DIAG_SEVERITY_ERR,
-   DIAG_SEVERITY_FATAL_ERR = DIAG_SEVERITY_PRINT
+   DIAG_SEVERITY_OVERRIDE = 0,
+   DIAG_SEVERITY_VERBOSE = 0,
+   DIAG_SEVERITY_INFO = 1,
+   DIAG_SEVERITY_WARNING = 2,
+   DIAG_SEVERITY_ERR = 3,
+   DIAG_SEVERITY_NONFATAL_ERR = 3,
+   DIAG_SEVERITY_PRINT = 4,
+   DIAG_SEVERITY_FATAL_ERR = 4,
+   DIAG_SEVERITY_SHUTOFF = 5,
+   DIAG_SEVERITY_ENUM_END = 5
 };
 
 /* Event Cause enums
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 109/141] staging: unisys: Move diagchannel to include

2015-05-05 Thread Benjamin Romer
From: David Kershner 

Diagchannel needs to go to standard include.

Signed-off-by: David Kershner 
Signed-off-by: Benjamin Romer 
---
 .../common-spar/include/channels/diagchannel.h | 427 -
 drivers/staging/unisys/include/diagchannel.h   | 427 +
 2 files changed, 427 insertions(+), 427 deletions(-)
 delete mode 100644 
drivers/staging/unisys/common-spar/include/channels/diagchannel.h
 create mode 100644 drivers/staging/unisys/include/diagchannel.h

diff --git a/drivers/staging/unisys/common-spar/include/channels/diagchannel.h 
b/drivers/staging/unisys/common-spar/include/channels/diagchannel.h
deleted file mode 100644
index e8fb867..000
--- a/drivers/staging/unisys/common-spar/include/channels/diagchannel.h
+++ /dev/null
@@ -1,427 +0,0 @@
-/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/*++
- *
- * Module Name:
- *
- * diagchannel.h
- *
- * Abstract:
- *
- * This file defines the DiagChannel protocol.  This protocol is used to aid in
- * preserving event data sent by external applications.  This protocol provides
- * a region for event data to reside in.  This data will eventually be sent to
- * the Boot Partition where it will be committed to memory and/or disk.  This
- * file contains platform-independent data that can be built using any
- * Supervisor build environment (Windows, Linux, EFI).
- *
-*/
-
-#ifndef _DIAG_CHANNEL_H_
-#define _DIAG_CHANNEL_H_
-
-#include 
-#include "channel.h"
-
-/* {EEA7A573-DB82-447c-8716-EFBEAAAE4858} */
-#define SPAR_DIAG_CHANNEL_PROTOCOL_UUID \
-   UUID_LE(0xeea7a573, 0xdb82, 0x447c, \
-   0x87, 0x16, 0xef, 0xbe, 0xaa, 0xae, 0x48, 0x58)
-
-static const uuid_le spar_diag_channel_protocol_uuid =
-   SPAR_DIAG_CHANNEL_PROTOCOL_UUID;
-
-/* {E850F968-3263-4484-8CA5-2A35D087A5A8} */
-#define ULTRA_DIAG_ROOT_CHANNEL_PROTOCOL_GUID \
-   UUID_LE(0xe850f968, 0x3263, 0x4484, \
-   0x8c, 0xa5, 0x2a, 0x35, 0xd0, 0x87, 0xa5, 0xa8)
-
-#define ULTRA_DIAG_CHANNEL_PROTOCOL_SIGNATURE  ULTRA_CHANNEL_PROTOCOL_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
-* channel struct so as to break pre-existing software.  Note that you can
-* usually add fields to the END of the channel struct withOUT needing to
-* increment this. */
-#define ULTRA_DIAG_CHANNEL_PROTOCOL_VERSIONID 2
-
-#define SPAR_DIAG_CHANNEL_OK_CLIENT(ch)\
-   (spar_check_channel_client(ch,\
-  spar_diag_channel_protocol_uuid,\
-  "diag",\
-  sizeof(struct spar_diag_channel_protocol),\
-  ULTRA_DIAG_CHANNEL_PROTOCOL_VERSIONID,\
-  ULTRA_DIAG_CHANNEL_PROTOCOL_SIGNATURE))
-
-#define SPAR_DIAG_CHANNEL_OK_SERVER(bytes)\
-   (spar_check_channel_server(spar_diag_channel_protocol_uuid,\
-  "diag",\
-  sizeof(struct spar_diag_channel_protocol),\
-  bytes))
-
-#define MAX_MODULE_NAME_SIZE 128   /* Maximum length of module name... */
-#define MAX_ADDITIONAL_INFO_SIZE 256   /* Maximum length of any additional info
-* accompanying event... */
-#define MAX_SUBSYSTEMS 64  /* Maximum number of subsystems allowed in
-* DiagChannel... */
-#define LOW_SUBSYSTEMS 32  /* Half of MAX_SUBSYSTEMS to allow 64-bit
-* math */
-#define SUBSYSTEM_DEBUG 0  /* Standard subsystem for debug events */
-#define SUBSYSTEM_DEFAULT 1/* Default subsystem for legacy calls to
-* ReportEvent */
-
-/* few useful subsystem mask values */
-#define SUBSYSTEM_MASK_DEBUG   0x01/* Standard subsystem for debug
-* events */
-#define SUBSYSTEM_MASK_DEFAULT  0x02   /* Default subsystem for legacy calls to
-* ReportEvents */
-
-/* Event parameter "Severity" is overloaded with Cause in byte 2 and Severity 
in
- * byte 0, bytes 1 and 3 are reserved */
-#define SEVERITY_MASK 0x0FF/* mask out all but the Severity in

[PATCH 057/141] staging: unisys: Eliminate unused visorchannel_dump_section()

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/visorbus.h  |  2 --
 drivers/staging/unisys/visorbus/visorchannel.c | 37 --
 2 files changed, 39 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index 749beac..e1c6662 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -199,8 +199,6 @@ uuid_le visorchannel_get_uuid(struct visorchannel *channel);
 char *visorchannel_uuid_id(uuid_le *guid, char *s);
 void visorchannel_debug(struct visorchannel *channel, int num_queues,
struct seq_file *seq, u32 off);
-void visorchannel_dump_section(struct visorchannel *chan, char *s,
-  int off, int len, struct seq_file *seq);
 void __iomem *visorchannel_get_header(struct visorchannel *channel);
 
 #endif
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 5e4a591..150e3df 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -548,40 +548,3 @@ visorchannel_debug(struct visorchannel *channel, int 
num_queues,
   addr + off, nbytes);
 }
 EXPORT_SYMBOL_GPL(visorchannel_debug);
-
-void
-visorchannel_dump_section(struct visorchannel *chan, char *s,
- int off, int len, struct seq_file *seq)
-{
-   char *buf, *tbuf, *fmtbuf;
-   int fmtbufsize = 0;
-   int i;
-   int errcode = 0;
-
-   fmtbufsize = 100 * COVQ(len, 16);
-   buf = kmalloc(len, GFP_KERNEL|__GFP_NORETRY);
-   if (!buf)
-   return;
-   fmtbuf = kmalloc(fmtbufsize, GFP_KERNEL|__GFP_NORETRY);
-   if (!fmtbuf)
-   goto fmt_failed;
-
-   errcode = visorchannel_read(chan, off, buf, len);
-   if (errcode < 0)
-   goto read_failed;
-   seq_printf(seq, "channel %s:\n", s);
-   tbuf = buf;
-   while (len > 0) {
-   i = (len < 16) ? len : 16;
-   hex_dump_to_buffer(tbuf, i, 16, 1, fmtbuf, fmtbufsize, TRUE);
-   seq_printf(seq, "%s\n", fmtbuf);
-   tbuf += 16;
-   len -= 16;
-   }
-
-read_failed:
-   kfree(fmtbuf);
-fmt_failed:
-   kfree(buf);
-}
-EXPORT_SYMBOL_GPL(visorchannel_dump_section);
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 029/141] staging: unisys: unify channel attributes into visorbus_main.c

2015-05-05 Thread Benjamin Romer
From: Prarit Bhargava 

The code in channel_attr.[ch] only creates sysfs files and is called
only in visorbus_main.c.  This code should be unified into
visorbus_main.c.   There are some functions that have been made static.

Signed-off-by: Prarit Bhargava 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/Makefile|   2 +-
 drivers/staging/unisys/visorbus/channel_attr.c  | 227 
 drivers/staging/unisys/visorbus/channel_attr.h  |  27 ---
 drivers/staging/unisys/visorbus/visorbus_main.c | 209 +-
 4 files changed, 209 insertions(+), 256 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorbus/channel_attr.c
 delete mode 100644 drivers/staging/unisys/visorbus/channel_attr.h

diff --git a/drivers/staging/unisys/visorbus/Makefile 
b/drivers/staging/unisys/visorbus/Makefile
index e1b667d..d44fbf6 100644
--- a/drivers/staging/unisys/visorbus/Makefile
+++ b/drivers/staging/unisys/visorbus/Makefile
@@ -4,7 +4,7 @@
 
 obj-$(CONFIG_UNISYS_VISORBUS)  += visorbus.o
 
-visorbus-y := visorbus_main.o devmajorminor_attr.o channel_attr.o
+visorbus-y := visorbus_main.o devmajorminor_attr.o
 visorbus-y += visorchannel_funcs.o
 
 ccflags-y += -Idrivers/staging/unisys/include
diff --git a/drivers/staging/unisys/visorbus/channel_attr.c 
b/drivers/staging/unisys/visorbus/channel_attr.c
deleted file mode 100644
index 0d7184a..000
--- a/drivers/staging/unisys/visorbus/channel_attr.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/* channel_attr.c
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/* Implement publishing of channel attributes under:
- *
- * /sys/bus/visorbus/dev/channel
- *
- */
-
-#include "channel_attr.h"
-#define CURRENT_FILE_PC VISOR_BUS_PC_channel_attr_c
-#define to_channel_attr(_attr) \
-   container_of(_attr, struct channel_attribute, attr)
-#define to_visor_device_from_kobjchannel(obj) \
-   container_of(obj, struct visor_device, kobjchannel)
-
-struct channel_attribute {
-   struct attribute attr;
-ssize_t (*show)(struct visor_device*, char *buf);
-ssize_t (*store)(struct visor_device*, const char *buf, size_t count);
-};
-
-/* begin implementation of specific channel attributes to appear under
-* /sys/bus/visorbus/dev/channel
-*/
-static ssize_t devicechannel_attr_physaddr(struct visor_device *dev, char *buf)
-{
-   if (!dev->visorchannel)
-   return 0;
-   return snprintf(buf, PAGE_SIZE, "0x%Lx\n",
-   visorchannel_get_physaddr(dev->visorchannel));
-}
-
-static ssize_t devicechannel_attr_nbytes(struct visor_device *dev, char *buf)
-{
-   if (!dev->visorchannel)
-   return 0;
-   return snprintf(buf, PAGE_SIZE, "0x%lx\n",
-   visorchannel_get_nbytes(dev->visorchannel));
-}
-
-static ssize_t devicechannel_attr_clientpartition(struct visor_device *dev,
- char *buf) {
-   if (!dev->visorchannel)
-   return 0;
-   return snprintf(buf, PAGE_SIZE, "0x%Lx\n",
-   visorchannel_get_clientpartition(dev->visorchannel));
-}
-
-static ssize_t devicechannel_attr_typeguid(struct visor_device *dev, char *buf)
-{
-   char s[99];
-
-   if (!dev->visorchannel)
-   return 0;
-   return snprintf(buf, PAGE_SIZE, "%s\n",
-   visorchannel_id(dev->visorchannel, s));
-}
-
-static ssize_t devicechannel_attr_zoneguid(struct visor_device *dev, char *buf)
-{
-   char s[99];
-
-   if (!dev->visorchannel)
-   return 0;
-   return snprintf(buf, PAGE_SIZE, "%s\n",
-   visorchannel_zoneid(dev->visorchannel, s));
-}
-
-static ssize_t devicechannel_attr_typename(struct visor_device *dev, char *buf)
-{
-   int i = 0;
-   struct bus_type *xbus = dev->device.bus;
-   struct device_driver *xdrv = dev->device.driver;
-   struct visor_driver *drv = NULL;
-
-   if (!dev->visorchannel || !xbus || !xdrv)
-   return 0;
-   i = xbus->match(&dev->device, xdrv);
-   if (!i)
-   return 0;
-   drv = to_visor_driver(xdrv);
-   return snprintf(buf, PAGE_SIZE, "%s\n", drv->channel_types[i - 1].name);
-}
-
-static ssize_t devicechannel_attr_dump(struct v

[PATCH 099/141] staging: unisys: uislib.h: Remove unused cache allocation prototypes

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/uisutils.h | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/unisys/include/uisutils.h 
b/drivers/staging/unisys/include/uisutils.h
index c7d0ba8..4514772 100644
--- a/drivers/staging/unisys/include/uisutils.h
+++ b/drivers/staging/unisys/include/uisutils.h
@@ -284,11 +284,6 @@ static inline unsigned int 
issue_vmcall_channel_mismatch(const char *chname,
 }
 
 #define UIS_DAEMONIZE(nam)
-void *uislib_cache_alloc(struct kmem_cache *cur_pool, char *fn, int ln);
-#define UISCACHEALLOC(cur_pool) uislib_cache_alloc(cur_pool, __FILE__, 
__LINE__)
-void uislib_cache_free(struct kmem_cache *cur_pool, void *p, char *fn, int ln);
-#define UISCACHEFREE(cur_pool, p) \
-   uislib_cache_free(cur_pool, p, __FILE__, __LINE__)
 
 void uislib_enable_channel_interrupts(u32 bus_no, u32 dev_no,
  int (*interrupt)(void *),
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 012/141] staging: unisys: Remove a couple of unnecessary blank lines

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 3c57782..53bbc49 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -68,7 +68,6 @@ struct visorchipset_channel_info {
u64 n_channel_bytes;
uuid_le channel_type_uuid;
uuid_le channel_inst_uuid;
-
 };
 
 /** Attributes for a particular Supervisor device.
@@ -90,7 +89,6 @@ struct visorchipset_device_info {
struct controlvm_message_header pending_msg_hdr;/* CONTROLVM_MESSAGE */
/** For private use by the bus driver */
void *bus_driver_context;
-
 };
 
 static inline struct visorchipset_device_info *finddevice(
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 003/141] staging: unisys: Eliminate globals.h

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/file.c |  6 +++--
 drivers/staging/unisys/visorchipset/file.h |  2 --
 drivers/staging/unisys/visorchipset/globals.h  | 29 --
 .../unisys/visorchipset/visorchipset_main.c|  2 +-
 4 files changed, 5 insertions(+), 34 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorchipset/globals.h

diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index 6fc5689..7d8247a 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -19,10 +19,12 @@
  * communicate with the visorchipset driver using a device/file interface.
  */
 
-#include "globals.h"
-#include "visorchannel.h"
 #include 
 #include 
+#include "version.h"
+#include "visorchipset.h"
+#include "visorchipset_umode.h"
+#include "visorchannel.h"
 #include "uisutils.h"
 #include "file.h"
 
diff --git a/drivers/staging/unisys/visorchipset/file.h 
b/drivers/staging/unisys/visorchipset/file.h
index 51f7699..6ff28a1 100644
--- a/drivers/staging/unisys/visorchipset/file.h
+++ b/drivers/staging/unisys/visorchipset/file.h
@@ -18,8 +18,6 @@
 #ifndef __FILE_H__
 #define __FILE_H__
 
-#include "globals.h"
-
 int visorchipset_file_init(dev_t majorDev,
   struct visorchannel **pControlVm_channel);
 void visorchipset_file_cleanup(dev_t major_dev);
diff --git a/drivers/staging/unisys/visorchipset/globals.h 
b/drivers/staging/unisys/visorchipset/globals.h
deleted file mode 100644
index ee7e3b4..000
--- a/drivers/staging/unisys/visorchipset/globals.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* globals.h
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#ifndef __VISORCHIPSET_GLOBALS_H__
-#define __VISORCHIPSET_GLOBALS_H__
-
-#include "diagnostics/appos_subsystems.h"
-#include "timskmod.h"
-#include "visorchipset.h"
-#include "visorchipset_umode.h"
-#include "version.h"
-
-/* module parameters */
-
-#endif
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 7720d2c..767c495 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -15,7 +15,7 @@
  * details.
  */
 
-#include "globals.h"
+#include "version.h"
 #include "visorchipset.h"
 #include "procobjecttree.h"
 #include "visorchannel.h"
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 008/141] staging: unisys: Do not initialize variables unnecessarily

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 .../unisys/visorchipset/visorchipset_main.c| 36 +++---
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 90018ac..0d3abce 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -782,7 +782,7 @@ EXPORT_SYMBOL_GPL(visorchipset_save_message);
 static void
 bus_responder(enum controlvm_id cmd_id, u32 bus_no, int response)
 {
-   struct visorchipset_bus_info *p = NULL;
+   struct visorchipset_bus_info *p;
bool need_clear = false;
 
p = findbus(&bus_info_list, bus_no);
@@ -818,7 +818,7 @@ device_changestate_responder(enum controlvm_id cmd_id,
 u32 bus_no, u32 dev_no, int response,
 struct spar_segment_state response_state)
 {
-   struct visorchipset_device_info *p = NULL;
+   struct visorchipset_device_info *p;
struct controlvm_message outmsg;
 
p = finddevice(&dev_info_list, bus_no, dev_no);
@@ -845,7 +845,7 @@ device_changestate_responder(enum controlvm_id cmd_id,
 static void
 device_responder(enum controlvm_id cmd_id, u32 bus_no, u32 dev_no, int 
response)
 {
-   struct visorchipset_device_info *p = NULL;
+   struct visorchipset_device_info *p;
bool need_clear = false;
 
p = finddevice(&dev_info_list, bus_no, dev_no);
@@ -943,7 +943,7 @@ device_epilog(u32 bus_no, u32 dev_no, struct 
spar_segment_state state, u32 cmd,
  struct controlvm_message_header *msg_hdr, int response,
  bool need_response, bool for_visorbus)
 {
-   struct visorchipset_busdev_notifiers *notifiers = NULL;
+   struct visorchipset_busdev_notifiers *notifiers;
bool notified = false;
 
struct visorchipset_device_info *dev_info =
@@ -1041,7 +1041,7 @@ bus_create(struct controlvm_message *inmsg)
struct controlvm_message_packet *cmd = &inmsg->cmd;
u32 bus_no = cmd->create_bus.bus_no;
int rc = CONTROLVM_RESP_SUCCESS;
-   struct visorchipset_bus_info *bus_info = NULL;
+   struct visorchipset_bus_info *bus_info;
 
bus_info = findbus(&bus_info_list, bus_no);
if (bus_info && (bus_info->state.created == 1)) {
@@ -1108,8 +1108,8 @@ bus_configure(struct controlvm_message *inmsg,
  struct parser_context *parser_ctx)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
-   u32 bus_no = cmd->configure_bus.bus_no;
-   struct visorchipset_bus_info *bus_info = NULL;
+   u32 bus_no;
+   struct visorchipset_bus_info *bus_info;
int rc = CONTROLVM_RESP_SUCCESS;
char s[99];
 
@@ -1150,8 +1150,8 @@ my_device_create(struct controlvm_message *inmsg)
struct controlvm_message_packet *cmd = &inmsg->cmd;
u32 bus_no = cmd->create_device.bus_no;
u32 dev_no = cmd->create_device.dev_no;
-   struct visorchipset_device_info *dev_info = NULL;
-   struct visorchipset_bus_info *bus_info = NULL;
+   struct visorchipset_device_info *dev_info;
+   struct visorchipset_bus_info *bus_info;
int rc = CONTROLVM_RESP_SUCCESS;
 
dev_info = finddevice(&dev_info_list, bus_no, dev_no);
@@ -1221,7 +1221,7 @@ my_device_changestate(struct controlvm_message *inmsg)
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 visorchipset_device_info *dev_info = NULL;
+   struct visorchipset_device_info *dev_info;
int rc = CONTROLVM_RESP_SUCCESS;
 
dev_info = finddevice(&dev_info_list, bus_no, dev_no);
@@ -1248,7 +1248,7 @@ my_device_destroy(struct controlvm_message *inmsg)
struct controlvm_message_packet *cmd = &inmsg->cmd;
u32 bus_no = cmd->destroy_device.bus_no;
u32 dev_no = cmd->destroy_device.dev_no;
-   struct visorchipset_device_info *dev_info = NULL;
+   struct visorchipset_device_info *dev_info;
int rc = CONTROLVM_RESP_SUCCESS;
 
dev_info = finddevice(&dev_info_list, bus_no, dev_no);
@@ -1538,8 +1538,8 @@ parahotplug_request_kickoff(struct parahotplug_request 
*req)
 static void
 parahotplug_process_list(void)
 {
-   struct list_head *pos = NULL;
-   struct list_head *tmp = NULL;
+   struct list_head *pos;
+   struct list_head *tmp;
 
spin_lock(¶hotplug_request_list_lock);
 
@@ -1570,8 +1570,8 @@ parahotplug_process_list(void)
 static int
 parahotplug_request_complete(int id, u16 active)
 {
-   struct list_head *pos = NULL;
-   struct list_head *tmp = NULL;
+   struct list_head *pos;
+   struct list_hea

[PATCH 011/141] staging: unisys: Don't include timskmod.h

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/parser.h   | 1 -
 drivers/staging/unisys/visorchipset/visorchipset.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/parser.h 
b/drivers/staging/unisys/visorchipset/parser.h
index 73be279..3fe17c0 100644
--- a/drivers/staging/unisys/visorchipset/parser.h
+++ b/drivers/staging/unisys/visorchipset/parser.h
@@ -20,7 +20,6 @@
 
 #include 
 
-#include "timskmod.h"
 #include "channel.h"
 
 typedef enum {
diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index 2c2d3fb..3c57782 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -20,7 +20,6 @@
 
 #include 
 
-#include "timskmod.h"
 #include "channel.h"
 #include "controlvmchannel.h"
 #include "parser.h"
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 015/141] staging: unisys: findbus() doesn't need to be inline

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset.h | 12 -
 .../unisys/visorchipset/visorchipset_main.c| 31 +++---
 2 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index d21fcb0..70b9e6e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -142,18 +142,6 @@ struct visorchipset_bus_info {
void *bus_driver_context;
 };
 
-static inline struct visorchipset_bus_info *
-findbus(struct list_head *list, u32 bus_no)
-{
-   struct visorchipset_bus_info *p;
-
-   list_for_each_entry(p, list, entry) {
-   if (p->bus_no == bus_no)
-   return p;
-   }
-   return NULL;
-}
-
 /*  These functions will be called from within visorchipset when certain
  *  events happen.  (The implementation of these functions is outside of
  *  visorchipset.)
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index e78ae7b..f647567 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -526,6 +526,19 @@ dev_info_clear(void *v)
memset(p, 0, sizeof(struct visorchipset_device_info));
 }
 
+static struct visorchipset_bus_info *
+bus_find(struct list_head *list, u32 bus_no)
+{
+   struct visorchipset_bus_info *p;
+
+   list_for_each_entry(p, list, entry) {
+   if (p->bus_no == bus_no)
+   return p;
+   }
+
+   return NULL;
+}
+
 static u8
 check_chipset_events(void)
 {
@@ -776,7 +789,7 @@ bus_responder(enum controlvm_id cmd_id, u32 bus_no, int 
response)
struct visorchipset_bus_info *p;
bool need_clear = false;
 
-   p = findbus(&bus_info_list, bus_no);
+   p = bus_find(&bus_info_list, bus_no);
if (!p)
return;
 
@@ -866,10 +879,10 @@ bus_epilog(u32 bus_no,
   u32 cmd, struct controlvm_message_header *msg_hdr,
   int response, bool need_response)
 {
+   struct visorchipset_bus_info *bus_info;
bool notified = false;
 
-   struct visorchipset_bus_info *bus_info = findbus(&bus_info_list,
-bus_no);
+   bus_info = bus_find(&bus_info_list, bus_no);
 
if (!bus_info)
return;
@@ -1034,7 +1047,7 @@ bus_create(struct controlvm_message *inmsg)
int rc = CONTROLVM_RESP_SUCCESS;
struct visorchipset_bus_info *bus_info;
 
-   bus_info = findbus(&bus_info_list, bus_no);
+   bus_info = bus_find(&bus_info_list, bus_no);
if (bus_info && (bus_info->state.created == 1)) {
POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus_no,
 POSTCODE_SEVERITY_ERR);
@@ -1083,7 +1096,7 @@ bus_destroy(struct controlvm_message *inmsg)
struct visorchipset_bus_info *bus_info;
int rc = CONTROLVM_RESP_SUCCESS;
 
-   bus_info = findbus(&bus_info_list, bus_no);
+   bus_info = bus_find(&bus_info_list, bus_no);
if (!bus_info)
rc = -CONTROLVM_RESP_ERROR_BUS_INVALID;
else if (bus_info->state.created == 0)
@@ -1107,7 +1120,7 @@ bus_configure(struct controlvm_message *inmsg,
POSTCODE_LINUX_3(BUS_CONFIGURE_ENTRY_PC, bus_no,
 POSTCODE_SEVERITY_INFO);
 
-   bus_info = findbus(&bus_info_list, bus_no);
+   bus_info = bus_find(&bus_info_list, bus_no);
if (!bus_info) {
POSTCODE_LINUX_3(BUS_CONFIGURE_FAILURE_PC, bus_no,
 POSTCODE_SEVERITY_ERR);
@@ -1151,7 +1164,7 @@ my_device_create(struct controlvm_message *inmsg)
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
goto cleanup;
}
-   bus_info = findbus(&bus_info_list, bus_no);
+   bus_info = bus_find(&bus_info_list, bus_no);
if (!bus_info) {
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
 POSTCODE_SEVERITY_ERR);
@@ -1995,7 +2008,7 @@ device_resume_response(u32 bus_no, u32 dev_no, int 
response)
 bool
 visorchipset_get_bus_info(u32 bus_no, struct visorchipset_bus_info *bus_info)
 {
-   void *p = findbus(&bus_info_list, bus_no);
+   void *p = bus_find(&bus_info_list, bus_no);
 
if (!p)
return false;
@@ -2007,7 +2020,7 @@ EXPORT_SYMBOL_GPL(visorchipset_get_bus_info);
 bool
 visorchipset_set_bus_context(u32 bus_no, void *context)
 {
-   struct visorchipset_bus_info *p = findbus(&bus_info_list, bus_no);
+   struct visorchipset_bus_info *p = bus_find(&a

[PATCH 021/141] staging: unisys: Remove write-only variable g_diag_msg_hdr

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 3b5f3d6..b733147 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -75,7 +75,6 @@ static struct delayed_work periodic_controlvm_work;
 static struct workqueue_struct *periodic_controlvm_workqueue;
 static DEFINE_SEMAPHORE(notifier_lock);
 
-static struct controlvm_message_header g_diag_msg_hdr;
 static struct controlvm_message_header g_chipset_msg_hdr;
 static struct controlvm_message_header g_del_dump_msg_hdr;
 static const uuid_le spar_diag_pool_channel_protocol_uuid =
@@ -1742,7 +1741,6 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
/* save the hdr and cmd structures for later use */
/* when sending back the response to Command */
my_device_changestate(&inmsg);
-   g_diag_msg_hdr = inmsg.hdr;
g_devicechangestate_packet = inmsg.cmd;
break;
}
@@ -2220,8 +2218,6 @@ visorchipset_init(void)
goto cleanup;
}
 
-   memset(&g_diag_msg_hdr, 0, sizeof(struct controlvm_message_header));
-
memset(&g_chipset_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
memset(&g_del_dump_msg_hdr, 0, sizeof(struct controlvm_message_header));
@@ -2287,8 +2283,6 @@ visorchipset_exit(void)
 
cleanup_controlvm_structures();
 
-   memset(&g_diag_msg_hdr, 0, sizeof(struct controlvm_message_header));
-
memset(&g_chipset_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
memset(&g_del_dump_msg_hdr, 0, sizeof(struct controlvm_message_header));
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 049/141] staging: unisys: visorchipset: Use ioremap direction rather than heavy visor_memregion

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 2be8514..9390ed6 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -397,9 +397,7 @@ parser_init_guts(u64 addr, u32 bytes, bool local,
int allocbytes = sizeof(struct parser_context) + bytes;
struct parser_context *rc = NULL;
struct parser_context *ctx = NULL;
-   struct memregion *rgn = NULL;
struct spar_controlvm_parameters_header *phdr = NULL;
-   int cnt;
 
if (retry)
*retry = false;
@@ -438,18 +436,21 @@ parser_init_guts(u64 addr, u32 bytes, bool local,
p = __va((unsigned long) (addr));
memcpy(ctx->data, p, bytes);
} else {
-   rgn = visor_memregion_create(addr, bytes);
-   if (!rgn) {
+   void __iomem *mapping;
+
+   if (!request_mem_region(addr, bytes, "visorchipset")) {
rc = NULL;
goto cleanup;
}
-   cnt = visor_memregion_read(rgn, 0, ctx->data, bytes);
-   visor_memregion_destroy(rgn);
 
-   if (cnt < 0) {
+   mapping = ioremap_cache(addr, bytes);
+   if (!mapping) {
+   release_mem_region(addr, bytes);
rc = NULL;
goto cleanup;
}
+   memcpy_fromio(ctx->data, mapping, bytes);
+   release_mem_region(addr, bytes);
}
if (!standard_payload_header) {
ctx->byte_stream = true;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 010/141] staging: unisys: Remove unused cache object counter

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

kmem_cache statistics are available through SLAB anyway

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 9b6c768..e33d886 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -213,8 +213,6 @@ struct putfile_request {
int completion_status;
 };
 
-static atomic_t visorchipset_cache_buffers_in_use = ATOMIC_INIT(0);
-
 struct parahotplug_request {
struct list_head list;
int id;
@@ -2077,7 +2075,6 @@ visorchipset_cache_alloc(struct kmem_cache *pool, bool 
ok_to_block,
if (!p)
return NULL;
 
-   atomic_inc(&visorchipset_cache_buffers_in_use);
return p;
 }
 
@@ -2089,7 +2086,6 @@ visorchipset_cache_free(struct kmem_cache *pool, void *p, 
char *fn, int ln)
if (!p)
return;
 
-   atomic_dec(&visorchipset_cache_buffers_in_use);
kmem_cache_free(pool, p);
 }
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 061/141] staging: unisys: remove unused #define MAX_SERIAL_NUM

2015-05-05 Thread Benjamin Romer
From: Erik Arfvidson 

This patch simply removes #define MAX_SERIAL_NUM from iochannel.h

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/common-spar/include/channels/iochannel.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/iochannel.h 
b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
index 3bd7579..ff393c2 100644
--- a/drivers/staging/unisys/common-spar/include/channels/iochannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
@@ -140,10 +140,6 @@
 * MAX_SKB_FRAGS size, which is 18 which is smaller than MAX_PHYS_INFO for
 * now.  */
 
-#ifndef MAX_SERIAL_NUM
-#define MAX_SERIAL_NUM 32
-#endif /* MAX_SERIAL_NUM */
-
 #define MAX_SCSI_BUSES 1
 #define MAX_SCSI_TARGETS   8
 #define MAX_SCSI_LUNS  16
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 006/141] staging: unisys: Remove unncessary parenthesis

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 767c495..b4e28d2 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -519,7 +519,7 @@ static ssize_t remaining_steps_store(struct device *dev,
 static void
 bus_info_clear(void *v)
 {
-   struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) (v);
+   struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) v;
 
kfree(p->name);
p->name = NULL;
@@ -535,7 +535,7 @@ static void
 dev_info_clear(void *v)
 {
struct visorchipset_device_info *p =
-   (struct visorchipset_device_info *)(v);
+   (struct visorchipset_device_info *) v;
 
p->state.created = 0;
memset(p, 0, sizeof(struct visorchipset_device_info));
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 032/141] staging: unisys: remove globals.h

2015-05-05 Thread Benjamin Romer
From: Prarit Bhargava 

globals.h is only included in visorchannel.c and only contains 2 includes.
These can be included directly in visorchannel.c.

Signed-off-by: Prarit Bhargava 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/globals.h  | 27 --
 drivers/staging/unisys/visorbus/visorchannel.c |  3 ++-
 2 files changed, 2 insertions(+), 28 deletions(-)
 delete mode 100644 drivers/staging/unisys/visorbus/globals.h

diff --git a/drivers/staging/unisys/visorbus/globals.h 
b/drivers/staging/unisys/visorbus/globals.h
deleted file mode 100644
index 0ed8e1d..000
--- a/drivers/staging/unisys/visorbus/globals.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* globals.h
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#ifndef __VISORCHANNEL_GLOBALS_H__
-#define __VISORCHANNEL_GLOBALS_H__
-
-#include "timskmod.h"
-#include "memregion.h"
-#include "version.h"
-
-#define MYDRVNAME "visorchannel"
-
-#endif
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index b61f954..33a4360 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -22,7 +22,8 @@
  *  a CM2 implementation and a direct memory implementation.)
  */
 
-#include "globals.h"
+#include "memregion.h"
+#include "version.h"
 #include "visorbus.h"
 #include 
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 079/141] staging: unisys: visorchannel_write(): Handle partial channel_header writes

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index cae62fed..da7bd9c 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -213,13 +213,16 @@ int
 visorchannel_write(struct visorchannel *channel, ulong offset,
   void *local, ulong nbytes)
 {
-   size_t size = sizeof(struct channel_header);
+   size_t chdr_size = sizeof(struct channel_header);
+   size_t copy_size;
 
if (offset + nbytes > channel->memregion.nbytes)
return -EIO;
 
-   if (!offset && nbytes >= size)
-   memcpy(&channel->chan_hdr, local, size);
+   if (offset < chdr_size) {
+   copy_size = min(chdr_size, nbytes) - offset;
+   memcpy(&channel->chan_hdr + offset, local, copy_size);
+   }
 
memcpy_toio(channel->memregion.mapped + offset, local, nbytes);
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 040/141] staging: unisys: visorchannel cleanup visorchannel_create_guts()

2015-05-05 Thread Benjamin Romer
From: Prarit Bhargava 

The error handling in this function was broken and while looking at that
I noticed that the whole function was in need of cleanup.  This patch
fixes the error handling, specifically

if (!p) {
visorchannel_destroy(p);
channel = NULL;
}

and does a lot of cleanup.  I also verified that the called functions
returned correct errors, and that led to a change in
visor_memregion_resize(), visorchannel_destroy() and
visor_memregion_destroy().

Signed-off-by: Prarit Bhargava 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 79 ++
 .../staging/unisys/visorutil/memregion_direct.c|  4 +-
 2 files changed, 36 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 33a4360..ff14a0d 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -55,60 +55,52 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong 
channel_bytes,
 struct visorchannel *parent, ulong off, uuid_le guid,
 BOOL needs_lock)
 {
-   struct visorchannel *p = NULL;
-   void *rc = NULL;
+   struct visorchannel *channel;
+   int err;
+   size_t size = sizeof(struct channel_header);
+   struct memregion *memregion;
 
-   p = kmalloc(sizeof(*p), GFP_KERNEL|__GFP_NORETRY);
-   if (!p) {
-   rc = NULL;
+   channel = kmalloc(sizeof(*channel), GFP_KERNEL|__GFP_NORETRY);
+   if (!channel)
goto cleanup;
-   }
-   p->memregion = NULL;
-   p->needs_lock = needs_lock;
-   spin_lock_init(&p->insert_lock);
-   spin_lock_init(&p->remove_lock);
+
+   channel->memregion = NULL;
+   channel->needs_lock = needs_lock;
+   spin_lock_init(&channel->insert_lock);
+   spin_lock_init(&channel->remove_lock);
 
/* prepare chan_hdr (abstraction to read/write channel memory) */
if (!parent)
-   p->memregion =
-   visor_memregion_create(physaddr,
-  sizeof(struct channel_header));
+   memregion = visor_memregion_create(physaddr, size);
else
-   p->memregion =
-   visor_memregion_create_overlapped(parent->memregion,
-   off, sizeof(struct channel_header));
-   if (!p->memregion) {
-   rc = NULL;
+   memregion = visor_memregion_create_overlapped(parent->memregion,
+ off, size);
+   if (!memregion)
goto cleanup;
-   }
-   if (visor_memregion_read(p->memregion, 0, &p->chan_hdr,
-sizeof(struct channel_header)) < 0) {
-   rc = NULL;
+   channel->memregion = memregion;
+
+   err = visor_memregion_read(channel->memregion, 0, &channel->chan_hdr,
+  sizeof(struct channel_header));
+   if (err)
goto cleanup;
-   }
+
+   /* we had better be a CLIENT of this channel */
if (channel_bytes == 0)
-   /* we had better be a CLIENT of this channel */
-   channel_bytes = (ulong)p->chan_hdr.size;
+   channel_bytes = (ulong)channel->chan_hdr.size;
if (uuid_le_cmp(guid, NULL_UUID_LE) == 0)
-   /* we had better be a CLIENT of this channel */
-   guid = p->chan_hdr.chtype;
-   if (visor_memregion_resize(p->memregion, channel_bytes) < 0) {
-   rc = NULL;
+   guid = channel->chan_hdr.chtype;
+
+   err = visor_memregion_resize(channel->memregion, channel_bytes);
+   if (err)
goto cleanup;
-   }
-   p->size = channel_bytes;
-   p->guid = guid;
 
-   rc = p;
-cleanup:
+   channel->size = channel_bytes;
+   channel->guid = guid;
+   return channel;
 
-   if (!rc) {
-   if (!p) {
-   visorchannel_destroy(p);
-   p = NULL;
-   }
-   }
-   return rc;
+cleanup:
+   visorchannel_destroy(channel);
+   return NULL;
 }
 
 struct visorchannel *
@@ -153,10 +145,7 @@ visorchannel_destroy(struct visorchannel *channel)
 {
if (!channel)
return;
-   if (channel->memregion) {
-   visor_memregion_destroy(channel->memregion);
-   channel->memregion = NULL;
-   }
+   visor_memregion_destroy(channel->memregion);
kfree(channel);
 }
 EXPORT_SYMBOL_GPL(visorchannel_destroy);
diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c 
b/drivers/staging/unisys/viso

[PATCH 039/141] staging: unisys: cleanup visorbus_private.h

2015-05-05 Thread Benjamin Romer
From: Prarit Bhargava 

visorbus_private.h contains code that is called from visorbus into the
visorchipset code.  Now that the visorchipset code has been brought into
the visorbus directory, many of the declarations are not necessary and
can be cleaned up.

TODO: PARSER_WHICH_STRING enum only has one member used
(PARSERSTRING_NAME).

TODO: crash_obj_type appears to be unnecessary in the overall scheme of
code.

Signed-off-by: Prarit Bhargava 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorbus/visorbus_private.h | 57 --
 drivers/staging/unisys/visorbus/visorchipset.c | 35 -
 2 files changed, 33 insertions(+), 59 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 68d770f..a3d78f6 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -26,32 +26,7 @@
 #include "vbusdeviceinfo.h"
 #include "vbushelper.h"
 
-#define VISORCHIPSET_MMAP_CONTROLCHANOFFSET0x
-
-/** Describes the state from the perspective of which controlvm messages have
- *  been received for a bus or device.
- */
-
-enum PARSER_WHICH_STRING {
-   PARSERSTRING_INITIATOR,
-   PARSERSTRING_TARGET,
-   PARSERSTRING_CONNECTION,
-   PARSERSTRING_NAME,
-};
-
 struct visorchannel;
-struct parser_context *parser_init(u64 addr, u32 bytes, bool isLocal,
-  bool *tryAgain);
-struct parser_context *parser_init_byte_stream(u64 addr, u32 bytes, bool local,
-  bool *retry);
-void parser_param_start(struct parser_context *ctx,
-   PARSER_WHICH_STRING which_string);
-void *parser_param_get(struct parser_context *ctx, char *nam, int namesize);
-void *parser_string_get(struct parser_context *ctx);
-uuid_le parser_id_get(struct parser_context *ctx);
-char *parser_simpleString_get(struct parser_context *ctx);
-void *parser_byte_stream_get(struct parser_context *ctx, unsigned long 
*nbytes);
-void parser_done(struct parser_context *ctx);
 
 struct visorchipset_state {
u32 created:1;
@@ -75,11 +50,6 @@ enum visorchipset_addresstype {
ADDRTYPE_LOCALTEST,
 };
 
-enum crash_obj_type {
-   CRASH_DEV,
-   CRASH_BUS,
-};
-
 /** Attributes for a particular Supervisor channel.
  */
 struct visorchipset_channel_info {
@@ -169,18 +139,6 @@ struct visorchipset_busdev_responders {
 
 /** Register functions (in the bus driver) to get called by visorchipset
  *  whenever a bus or device appears for which this service partition is
- *  to be the server for.  visorchipset will fill in , to
- *  indicate functions the bus driver should call to indicate message
- *  responses.
- */
-void
-visorchipset_register_busdev_client(
-   struct visorchipset_busdev_notifiers *notifiers,
-   struct visorchipset_busdev_responders *responders,
-   struct ultra_vbus_deviceinfo *driver_info);
-
-/** Register functions (in the bus driver) to get called by visorchipset
- *  whenever a bus or device appears for which this service partition is
  *  to be the client for.  visorchipset will fill in , to
  *  indicate functions the bus driver should call to indicate message
  *  responses.
@@ -191,26 +149,11 @@ visorchipset_register_busdev_server(
struct visorchipset_busdev_responders *responders,
struct ultra_vbus_deviceinfo *driver_info);
 
-void visorchipset_device_pause_response(u32 bus_no, u32 dev_no, int response);
-
 bool visorchipset_get_bus_info(u32 bus_no,
   struct visorchipset_bus_info *bus_info);
 bool visorchipset_get_device_info(u32 bus_no, u32 dev_no,
  struct visorchipset_device_info *dev_info);
 bool visorchipset_set_bus_context(u32 bus_no, void *context);
-bool visorchipset_set_device_context(u32 bus_no, u32 dev_no, void *context);
-int visorchipset_chipset_ready(void);
-int visorchipset_chipset_selftest(void);
-int visorchipset_chipset_notready(void);
-void visorchipset_save_message(struct controlvm_message *msg,
-  enum crash_obj_type type);
-void *visorchipset_cache_alloc(struct kmem_cache *pool,
-  bool ok_to_block, char *fn, int ln);
-void visorchipset_cache_free(struct kmem_cache *pool, void *p,
-char *fn, int ln);
-int visorchipset_file_init(dev_t majorDev,
-  struct visorchannel **pControlVm_channel);
-void visorchipset_file_cleanup(dev_t major_dev);
 
 /* visorbus init and exit functions */
 int __init visorbus_init(void);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index f3a2145..5bf8266 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/vis

[PATCH 004/141] staging: unisys: Fix up a few cases of bad formatting

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/file.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index 7d8247a..e63ef2a 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -99,7 +99,7 @@ visorchipset_mmap(struct file *file, struct vm_area_struct 
*vma)
 }
 
 static long visorchipset_ioctl(struct file *file, unsigned int cmd,
-   unsigned long arg)
+  unsigned long arg)
 {
s64 adjustment;
s64 vrtc_offset;
@@ -108,14 +108,14 @@ static long visorchipset_ioctl(struct file *file, 
unsigned int cmd,
case VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET:
/* get the physical rtc offset */
vrtc_offset = issue_vmcall_query_guest_virtual_time_offset();
-   if (copy_to_user
-   ((void __user *)arg, &vrtc_offset, sizeof(vrtc_offset))) {
+   if (copy_to_user((void __user *)arg, &vrtc_offset,
+sizeof(vrtc_offset))) {
return -EFAULT;
}
return SUCCESS;
case VMCALL_UPDATE_PHYSICAL_TIME:
-   if (copy_from_user
-   (&adjustment, (void __user *)arg, sizeof(adjustment))) {
+   if (copy_from_user(&adjustment, (void __user *)arg,
+  sizeof(adjustment))) {
return -EFAULT;
}
return issue_vmcall_update_physical_time(adjustment);
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 047/141] staging: unisys: memregion: Eliminate unnecessary 'requested' flag

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorutil/memregion_direct.c | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/unisys/visorutil/memregion_direct.c 
b/drivers/staging/unisys/visorutil/memregion_direct.c
index 7ba68bc..0ee7cb2 100644
--- a/drivers/staging/unisys/visorutil/memregion_direct.c
+++ b/drivers/staging/unisys/visorutil/memregion_direct.c
@@ -29,7 +29,6 @@ struct memregion {
HOSTADDRESS physaddr;
ulong nbytes;
void __iomem *mapped;
-   BOOL requested;
 };
 
 static int mapit(struct memregion *memregion);
@@ -67,16 +66,12 @@ mapit(struct memregion *memregion)
ulong physaddr = (ulong)(memregion->physaddr);
ulong nbytes = memregion->nbytes;
 
-   memregion->requested = FALSE;
if (!request_mem_region(physaddr, nbytes, MYDRVNAME))
return -EBUSY;
 
-   memregion->requested = TRUE;
memregion->mapped = ioremap_cache(physaddr, nbytes);
-   if (!memregion->mapped) {
-   memregion->requested = TRUE;
+   if (!memregion->mapped)
return -EFAULT;
-   }
 
return 0;
 }
@@ -84,14 +79,11 @@ mapit(struct memregion *memregion)
 static void
 unmapit(struct memregion *memregion)
 {
-   if (memregion->mapped != NULL) {
+   if (memregion->mapped) {
iounmap(memregion->mapped);
memregion->mapped = NULL;
-   }
-   if (memregion->requested) {
-   release_mem_region((ulong)(memregion->physaddr),
+   release_mem_region((unsigned long)memregion->physaddr,
   memregion->nbytes);
-   memregion->requested = FALSE;
}
 }
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 013/141] staging: unisys: buffer_list_pool isn't used for anything

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 .../staging/unisys/visorchipset/visorchipset_main.c  | 20 
 1 file changed, 20 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index e33d886..69730d1 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -138,13 +138,6 @@ static struct visor_livedump_info livedump_info;
 static struct controlvm_message controlvm_pending_msg;
 static bool controlvm_pending_msg_valid = false;
 
-/* Pool of struct putfile_buffer_entry, for keeping track of pending (incoming)
- * TRANSMIT_FILE PutFile payloads.
- */
-static struct kmem_cache *putfile_buffer_list_pool;
-static const char putfile_buffer_list_pool_name[] =
-   "controlvm_putfile_buffer_list_pool";
-
 /* This identifies a data buffer that has been received via a controlvm 
messages
  * in a remote --> local CONTROLVM_TRANSMIT_FILE conversation.
  */
@@ -2195,15 +2188,6 @@ visorchipset_init(void)
 
memset(&g_del_dump_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
-   putfile_buffer_list_pool =
-   kmem_cache_create(putfile_buffer_list_pool_name,
- sizeof(struct putfile_buffer_entry),
- 0, SLAB_HWCACHE_ALIGN, NULL);
-   if (!putfile_buffer_list_pool) {
-   POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
-   rc = -1;
-   goto cleanup;
-   }
if (!visorchipset_disable_controlvm) {
/* if booting in a crash kernel */
if (is_kdump_kernel())
@@ -2262,10 +2246,6 @@ visorchipset_exit(void)
periodic_controlvm_workqueue = NULL;
destroy_controlvm_payload_info(&controlvm_payload_info);
}
-   if (putfile_buffer_list_pool) {
-   kmem_cache_destroy(putfile_buffer_list_pool);
-   putfile_buffer_list_pool = NULL;
-   }
 
cleanup_controlvm_structures();
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 009/141] staging: unisys: Get rid of uint usage

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 0d3abce..9b6c768 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -2120,7 +2120,7 @@ static ssize_t devicedisabled_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
 {
-   uint id;
+   unsigned int id;
 
if (kstrtouint(buf, 10, &id) != 0)
return -EINVAL;
@@ -2137,7 +2137,7 @@ static ssize_t deviceenabled_store(struct device *dev,
   struct device_attribute *attr,
   const char *buf, size_t count)
 {
-   uint id;
+   unsigned int id;
 
if (kstrtouint(buf, 10, &id) != 0)
return -EINVAL;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 001/141] staging: unisys: Move module parameters around and mark static

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Move the module parameters and make sure they are static.

Signed-off-by: Jes Sorensen 
Tested-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/globals.h  | 10 ---
 .../unisys/visorchipset/visorchipset_main.c| 31 +++---
 2 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/globals.h 
b/drivers/staging/unisys/visorchipset/globals.h
index 36b21ec..0884a68 100644
--- a/drivers/staging/unisys/visorchipset/globals.h
+++ b/drivers/staging/unisys/visorchipset/globals.h
@@ -28,14 +28,4 @@
 
 /* module parameters */
 
-extern int visorchipset_testvnic;
-extern int visorchipset_testvnicclient;
-extern int visorchipset_testmsg;
-extern int visorchipset_major;
-extern int visorchipset_serverregwait;
-extern int visorchipset_clientregwait;
-extern int visorchipset_testteardown;
-extern int visorchipset_disable_controlvm;
-extern int visorchipset_holdchipsetready;
-
 #endif
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 90e41cb..7720d2c 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -44,6 +44,19 @@
 #define POLLJIFFIES_CONTROLVMCHANNEL_FAST   1
 #define POLLJIFFIES_CONTROLVMCHANNEL_SLOW 100
 
+/*
+ * Module parameters
+ */
+static int visorchipset_testvnic;
+static int visorchipset_testvnicclient;
+static int visorchipset_testmsg;
+static int visorchipset_major;
+static int visorchipset_serverregwait;
+static int visorchipset_clientregwait = 1; /* default is on */
+static int visorchipset_testteardown;
+static int visorchipset_disable_controlvm;
+static int visorchipset_holdchipsetready;
+
 /* When the controlvm channel is idle for at least MIN_IDLE_SECONDS,
 * we switch to slow polling mode.  As soon as we get a controlvm
 * message, we switch back to fast polling mode.
@@ -2280,43 +2293,31 @@ visorchipset_exit(void)
 
 module_param_named(testvnic, visorchipset_testvnic, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_testvnic, "1 to test vnic, using dummy VNIC 
connected via a loopback to a physical ethernet");
-int visorchipset_testvnic = 0;
-
 module_param_named(testvnicclient, visorchipset_testvnicclient, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_testvnicclient, "1 to test vnic, using real VNIC 
channel attached to a separate IOVM guest");
-int visorchipset_testvnicclient = 0;
-
 module_param_named(testmsg, visorchipset_testmsg, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_testmsg,
 "1 to manufacture the chipset, bus, and switch messages");
-int visorchipset_testmsg = 0;
-
 module_param_named(major, visorchipset_major, int, S_IRUGO);
-MODULE_PARM_DESC(visorchipset_major, "major device number to use for the 
device node");
-int visorchipset_major = 0;
-
+MODULE_PARM_DESC(visorchipset_major,
+"major device number to use for the device node");
 module_param_named(serverregwait, visorchipset_serverregwait, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_serverreqwait,
 "1 to have the module wait for the visor bus to register");
-int visorchipset_serverregwait = 0;/* default is off */
 module_param_named(clientregwait, visorchipset_clientregwait, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_clientregwait, "1 to have the module wait for 
the visorclientbus to register");
-int visorchipset_clientregwait = 1;/* default is on */
 module_param_named(testteardown, visorchipset_testteardown, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_testteardown,
 "1 to test teardown of the chipset, bus, and switch");
-int visorchipset_testteardown = 0; /* default is off */
 module_param_named(disable_controlvm, visorchipset_disable_controlvm, int,
   S_IRUGO);
 MODULE_PARM_DESC(visorchipset_disable_controlvm,
 "1 to disable polling of controlVm channel");
-int visorchipset_disable_controlvm = 0;/* default is off */
 module_param_named(holdchipsetready, visorchipset_holdchipsetready,
   int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_holdchipsetready,
 "1 to hold response to CHIPSET_READY");
-int visorchipset_holdchipsetready = 0; /* default is to send CHIPSET_READY
- * response immediately */
+
 module_init(visorchipset_init);
 module_exit(visorchipset_exit);
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 043/141] staging: unisys: visorchannel: visorchannel_create_overlap() is never used

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/visorbus.h  |  9 +
 drivers/staging/unisys/visorbus/visorchannel.c | 20 
 2 files changed, 1 insertion(+), 28 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index 3956a3d..21fd785 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -167,22 +167,15 @@ void visorbus_enable_channel_interrupts(struct 
visor_device *dev);
 void visorbus_disable_channel_interrupts(struct visor_device *dev);
 #endif
 
-/* Note that for visorchannel_create() and visorchannel_create_overlapped(),
+/* Note that for visorchannel_create()
  *  and  arguments may be 0 if we are a channel CLIENT.
  * In this case, the values can simply be read from the channel header.
  */
 struct visorchannel *visorchannel_create(HOSTADDRESS physaddr,
 ulong channel_bytes, uuid_le guid);
-struct visorchannel *visorchannel_create_overlapped(ulong channel_bytes,
-   struct visorchannel *parent,
-   ulong off, uuid_le guid);
 struct visorchannel *visorchannel_create_with_lock(HOSTADDRESS physaddr,
   ulong channel_bytes,
   uuid_le guid);
-struct visorchannel *visorchannel_create_overlapped_with_lock(
-   ulong channel_bytes,
-   struct visorchannel *parent,
-   ulong off, uuid_le guid);
 void visorchannel_destroy(struct visorchannel *channel);
 int visorchannel_read(struct visorchannel *channel, ulong offset,
  void *local, ulong nbytes);
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index d7ddc3a..407c2b6 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -120,26 +120,6 @@ visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong 
channel_bytes,
 }
 EXPORT_SYMBOL_GPL(visorchannel_create_with_lock);
 
-struct visorchannel *
-visorchannel_create_overlapped(ulong channel_bytes,
-  struct visorchannel *parent, ulong off,
-  uuid_le guid)
-{
-   return visorchannel_create_guts(0, channel_bytes, parent, off, guid,
-   FALSE);
-}
-EXPORT_SYMBOL_GPL(visorchannel_create_overlapped);
-
-struct visorchannel *
-visorchannel_create_overlapped_with_lock(ulong channel_bytes,
-struct visorchannel *parent, ulong off,
-uuid_le guid)
-{
-   return visorchannel_create_guts(0, channel_bytes, parent, off, guid,
-   TRUE);
-}
-EXPORT_SYMBOL_GPL(visorchannel_create_overlapped_with_lock);
-
 void
 visorchannel_destroy(struct visorchannel *channel)
 {
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 005/141] staging: unisys: Remove some unnecessary parenthesis

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_umode.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_umode.h 
b/drivers/staging/unisys/visorchipset/visorchipset_umode.h
index 6cf6eccb..8af5bf3 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_umode.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset_umode.h
@@ -29,7 +29,7 @@
 /** The user-mode program can access the control channel buffer directly
  *  via this memory map.
  */
-#define VISORCHIPSET_MMAP_CONTROLCHANOFFSET(0x)
-#define VISORCHIPSET_MMAP_CONTROLCHANSIZE  (0x0040)  /* 4MB */
+#define VISORCHIPSET_MMAP_CONTROLCHANOFFSET0x
+#define VISORCHIPSET_MMAP_CONTROLCHANSIZE  0x0040  /* 4MB */
 
 #endif /* __VISORCHIPSET_UMODE_H */
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 000/141] staging: unisys: s-Par driver rebuild series

2015-05-05 Thread Benjamin Romer
This series of patches contains a complete overhaul of the s-Par driver tree,
introducing a new (and significantly improved) driver called visorbus.
This new module consolidates the support code from the many other
modules that existed in our tree, allowing us to remove those, and makes
much better use of built in kernel functionality. The driver tree is
flattened out and large amounts of old code are pruned away, and the ability
to automatically load the driver based on ACPI table data is added.

Benjamin Romer (3):
  staging: unisys: add ACPI and PCI requirement to Kconfig
  staging: unisys: fix visorbus Kconfig
  staging: unisys: remove visorutil from top level Makefile

David Kershner (16):
  staging: unisys: remove server crust from visorchipset.
  staging: unisys: get rid of serialloopbacktest
  staging: unisys: Remove appos_subsystems.h
  staging: unisys: move hypervisor calls into visorbus
  staging: unisys: Move controlframework into controlvmchannel.h
  staging: unisys: Move channel.h to include. Controvlm to visorbus
  staging: unisys: vbuschannel belonsg to visorbus
  staging: unisys: Move diagchannel to include
  staging: unisys: Move files out of common-spar
  staging: unisys: Get rid of references to common-spar
  staging: unisys: get rid of sparstop
  staging: unisys: remove remaining utility headers
  staging: unisys: Update diag serverity enum
  staging: unisys: Remove unneeded fields in diagchannel.h
  staging: unisys: Clean up diag_serverity enum
  staging: unisys: Get rid of unused function

Don Zickus (26):
  staging: unisys: Move visorchannel into visorbus
  staging: unisys: Dissolve visorchannel.h
  staging: unisys: Move visorbus.h to public namespace
  staging: unisys: Remove unused driver
  staging: unisys: Embed struct device for easier handling of attr
  staging: unisys: Wire up proper device attr for bus
  staging: unisys: Move the visorbus device underneath devices
  staging: unisys: remove unused bus attribute code
  staging: unisys: Properly move version file into bus attr
  staging: unisys: Remove dead kobj structs
  staging: unisys: Clean up device sysfs attributes
  staging: unisys: Prep for removing 'info' structs
  staging: unisys: Add visor device find routine
  staging: unisys: Add a function to set the clientpartition
  staging: unisys: Add checks for creation
  staging: unisys: Convert cmd functions to visor_device
  staging: unisys: Convert the epilog functions to visor_device
  staging: unisys: Convert the notifier functions to visor_device
  staging: unisys: Convert the bus/device creation to visor_device
  staging: unisys: Convert the responders to visor_device
  staging: unisys: Convert the device attributes to visor_device
  staging: unisys: Convert init/exit routines to visor_device
  staging: unisys: Remove dead code leftover from conversion
  staging: unisys: Remove unused intr
  staging: unisys: Hide vbus_hdr_info from public visor_device
  staging: unisys: Hide contents of pending_msg_hdr

Erik Arfvidson (21):
  staging: unisys: add visorbus driver
  staging: unisys: remove visorchipset_umode.h
  staging: unisys: moving file.h functionality to visorchipset.h
  staging: unisys: remove file.c and pass functionality to visorchipset
  staging: unisys: move parser.[ch] functionality into visorchipset
  staging: unisys: remove typedef GUEST_PHYSICAL_ADDRESS to u64
  staging: unisys: remove unused enum from controlvmchannel.h
  staging: unisys: remove unused #define in controlvmchannel
  staging: unisys: remove unused #define MAX_SERIAL_NUM
  staging: unisys: remove unused CONTROL_VM messages from enum
  staging: unisys: rename variable to reserverd since it is unused
  staging: unisys: controlvmchannel.h comment aligment and cleanup
  staging: unisys: remove unused device_map and guest_devices struct
  staging: unisys: remove unused CONTROLVM_CHIPSET_SHUTDOWN
  staging: unisys: remove unused chipset feature PCIVBUS
  staging: unisys: remove unused #define in iochannel.h
  staging: unisys: cleanup and align iochannel.h comments
  staging: unisys: move timskmod.h functionality
  staging: unisys: remove charqueue.c
  staging: unisys: remove timskmod.h and procobjecttree.h
  staging: unisys: move periodic_work.c into the visorbus directory

Jes Sorensen (62):
  staging: unisys: Move module parameters around and mark static
  staging: unisys: Move MYDRVNAME to visorchipset.h
  staging: unisys: Eliminate globals.h
  staging: unisys: Fix up a few cases of bad formatting
  staging: unisys: Remove some unnecessary parenthesis
  staging: unisys: Remove unncessary parenthesis
  staging: unisys: Don't zero struct elements which will be memset away
  staging: unisys: Do not initialize variables unnecessarily
  staging: unisys: Get rid of uint usage
  staging: unisys: Remove unused cache object counter
  staging: unisys: Don't include timskmod.h
  staging: unisys: Remove a couple of unnecessary blank lines
  staging: unisys: buffer_list_pool isn

[PATCH 058/141] staging: unisys: remove typedef GUEST_PHYSICAL_ADDRESS to u64

2015-05-05 Thread Benjamin Romer
From: Erik Arfvidson 

This patch removes typedef GUEST_PHYSICAL_ADDRESS to u64

Signed-off-by: Erik Arfvidson 
Signed-off-by: Benjamin Romer 
---
 .../include/channels/controlvmchannel.h| 38 ++
 drivers/staging/unisys/visorbus/visorchipset.c |  2 +-
 2 files changed, 19 insertions(+), 21 deletions(-)

diff --git 
a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h 
b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
index a66db79..435ac92 100644
--- a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
@@ -20,8 +20,6 @@
 #include "channel.h"
 #include "controlframework.h"
 
-typedef u64 GUEST_PHYSICAL_ADDRESS;
-
 enum { INVALID_GUEST_FIRMWARE, SAMPLE_GUEST_FIRMWARE,
TIANO32_GUEST_FIRMWARE, TIANO64_GUEST_FIRMWARE
 };
@@ -343,7 +341,7 @@ struct controlvm_message {
 };
 
 struct device_map {
-   GUEST_PHYSICAL_ADDRESS device_channel_address;
+   u64 device_channel_address;
u64 device_channel_size;
u32 ca_index;
u32 reserved;   /* natural alignment */
@@ -362,23 +360,23 @@ struct guest_devices  {
 
 struct spar_controlvm_channel_protocol {
 struct channel_header header;
-GUEST_PHYSICAL_ADDRESS gp_controlvm;   /* guest physical address of
+u64 gp_controlvm;  /* guest physical address of
 * this channel */
-GUEST_PHYSICAL_ADDRESS gp_partition_tables;/* guest physical address of
+u64 gp_partition_tables;/* guest physical address of
 * partition tables */
-GUEST_PHYSICAL_ADDRESS gp_diag_guest;  /* guest physical address of
+u64 gp_diag_guest; /* guest physical address of
 * diagnostic channel */
-GUEST_PHYSICAL_ADDRESS gp_boot_romdisk;/* guest phys addr of (read
+u64 gp_boot_romdisk;/* guest phys addr of (read
 * only) Boot ROM disk */
-GUEST_PHYSICAL_ADDRESS gp_boot_ramdisk;/* guest phys addr of writable
+u64 gp_boot_ramdisk;/* guest phys addr of writable
 * Boot RAM disk */
-GUEST_PHYSICAL_ADDRESS gp_acpi_table;  /* guest phys addr of acpi
+u64 gp_acpi_table; /* guest phys addr of acpi
 * table */
-GUEST_PHYSICAL_ADDRESS gp_control_channel;/* guest phys addr of control
+u64 gp_control_channel;/* guest phys addr of control
* channel */
-GUEST_PHYSICAL_ADDRESS gp_diag_romdisk;/* guest phys addr of diagnostic
+u64 gp_diag_romdisk;/* guest phys addr of diagnostic
 * ROM disk */
-GUEST_PHYSICAL_ADDRESS gp_nvram;   /* guest phys addr of NVRAM
+u64 gp_nvram;  /* guest phys addr of NVRAM
 * channel */
 u64 request_payload_offset;/* Offset to request payload area */
 u64 event_payload_offset;  /* Offset to event payload area */
@@ -389,28 +387,28 @@ struct spar_controlvm_channel_protocol {
 u32 nvram_channel_bytes;   /* Bytes in PartitionNvram segment */
 u32 message_bytes; /* sizeof(CONTROLVM_MESSAGE) */
 u32 message_count; /* CONTROLVM_MESSAGE_MAX */
-GUEST_PHYSICAL_ADDRESS gp_smbios_table;/* guest phys addr of SMBIOS
+u64 gp_smbios_table;/* guest phys addr of SMBIOS
 * tables */
-GUEST_PHYSICAL_ADDRESS gp_physical_smbios_table;/* guest phys addr of
+u64 gp_physical_smbios_table;/* guest phys addr of
  * SMBIOS table  */
 /* ULTRA_MAX_GUESTS_PER_SERVICE */
 struct guest_devices gp_obsolete_guest_devices[16];
 
 /* guest physical address of EFI firmware image base  */
-GUEST_PHYSICAL_ADDRESS virtual_guest_firmware_image_base;
+u64 virtual_guest_firmware_image_base;
 
 /* guest physical address of EFI firmware entry point  */
-GUEST_PHYSICAL_ADDRESS virtual_guest_firmware_entry_point;
+u64 virtual_guest_firmware_entry_point;
 
 /* guest EFI firmware image size  */
 u64 virtual_guest_firmware_image_size;
 
 /* GPA = 1MB where EFI firmware image is copied to  */
-GUEST_PHYSICAL_ADDRESS virtual_guest_firmware_boot_base;
-GUEST_PHYSICAL_ADDRESS virtual_guest_image_base;
-GUEST_PHYSICAL_ADDRESS virtual_guest_image_size;
+u64 virtual_guest_firmware_boot_base;
+u64 virtual_guest_image_base;
+u64 virtual_guest_image_size;
 u64 prototype_co

[PATCH 018/141] staging: unisys: delbusdevices() doesn't need to be inline

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset.h  | 12 
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 16 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
b/drivers/staging/unisys/visorchipset/visorchipset.h
index a3fe8b7..1d66c37 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset.h
+++ b/drivers/staging/unisys/visorchipset/visorchipset.h
@@ -91,18 +91,6 @@ struct visorchipset_device_info {
void *bus_driver_context;
 };
 
-static inline void delbusdevices(struct list_head *list, u32 bus_no)
-{
-   struct visorchipset_device_info *p, *tmp;
-
-   list_for_each_entry_safe(p, tmp, list, entry) {
-   if (p->bus_no == bus_no) {
-   list_del(&p->entry);
-   kfree(p);
-   }
-   }
-}
-
 /** Attributes for a particular Supervisor bus.
  *  (For a service partition acting as the server for buses/devices, there
  *  is a 1-to-1 relationship between busses and guest partitions.)
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index d1f0d18..9f5c539 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -552,6 +552,18 @@ device_find(struct list_head *list, u32 bus_no, u32 dev_no)
return NULL;
 }
 
+static void busdevices_del(struct list_head *list, u32 bus_no)
+{
+   struct visorchipset_device_info *p, *tmp;
+
+   list_for_each_entry_safe(p, tmp, list, entry) {
+   if (p->bus_no == bus_no) {
+   list_del(&p->entry);
+   kfree(p);
+   }
+   }
+}
+
 static u8
 check_chipset_events(void)
 {
@@ -810,7 +822,7 @@ bus_responder(enum controlvm_id cmd_id, u32 bus_no, int 
response)
if ((cmd_id == CONTROLVM_BUS_CREATE) &&
(response != (-CONTROLVM_RESP_ERROR_ALREADY_DONE)))
/* undo the row we just created... */
-   delbusdevices(&dev_info_list, bus_no);
+   busdevices_del(&dev_info_list, bus_no);
} else {
if (cmd_id == CONTROLVM_BUS_CREATE)
p->state.created = 1;
@@ -826,7 +838,7 @@ bus_responder(enum controlvm_id cmd_id, u32 bus_no, int 
response)
p->pending_msg_hdr.id = CONTROLVM_INVALID;
if (need_clear) {
bus_info_clear(p);
-   delbusdevices(&dev_info_list, bus_no);
+   busdevices_del(&dev_info_list, bus_no);
}
 }
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 007/141] staging: unisys: Don't zero struct elements which will be memset away

2015-05-05 Thread Benjamin Romer
From: Jes Sorensen 

Signed-off-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index b4e28d2..90018ac 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -522,12 +522,7 @@ bus_info_clear(void *v)
struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) v;
 
kfree(p->name);
-   p->name = NULL;
-
kfree(p->description);
-   p->description = NULL;
-
-   p->state.created = 0;
memset(p, 0, sizeof(struct visorchipset_bus_info));
 }
 
@@ -537,7 +532,6 @@ dev_info_clear(void *v)
struct visorchipset_device_info *p =
(struct visorchipset_device_info *) v;
 
-   p->state.created = 0;
memset(p, 0, sizeof(struct visorchipset_device_info));
 }
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] staging: unisys: remove virtpci driver from staging tree

2015-04-13 Thread Benjamin Romer
The virtpci driver is being rewritten, so remove the driver from the staging
tree.

Signed-off-by: Benjamin Romer 
Reviewed-by: Don Zickus 
Reviewed-by: Jes Sorensen 
---
 drivers/staging/unisys/Kconfig   |1 -
 drivers/staging/unisys/Makefile  |1 -
 drivers/staging/unisys/virtpci/Kconfig   |   10 -
 drivers/staging/unisys/virtpci/Makefile  |   10 -
 drivers/staging/unisys/virtpci/virtpci.c | 1394 --
 drivers/staging/unisys/virtpci/virtpci.h |  103 ---
 6 files changed, 1519 deletions(-)
 delete mode 100644 drivers/staging/unisys/virtpci/Kconfig
 delete mode 100644 drivers/staging/unisys/virtpci/Makefile
 delete mode 100644 drivers/staging/unisys/virtpci/virtpci.c
 delete mode 100644 drivers/staging/unisys/virtpci/virtpci.h

diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig
index 906cd58..1de86d1 100644
--- a/drivers/staging/unisys/Kconfig
+++ b/drivers/staging/unisys/Kconfig
@@ -13,6 +13,5 @@ source "drivers/staging/unisys/visorutil/Kconfig"
 source "drivers/staging/unisys/visorchannel/Kconfig"
 source "drivers/staging/unisys/visorchipset/Kconfig"
 source "drivers/staging/unisys/uislib/Kconfig"
-source "drivers/staging/unisys/virtpci/Kconfig"
 
 endif # UNISYSSPAR
diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile
index 3283a01..899b0cb 100644
--- a/drivers/staging/unisys/Makefile
+++ b/drivers/staging/unisys/Makefile
@@ -5,4 +5,3 @@ obj-$(CONFIG_UNISYS_VISORUTIL)  += visorutil/
 obj-$(CONFIG_UNISYS_VISORCHANNEL)  += visorchannel/
 obj-$(CONFIG_UNISYS_VISORCHIPSET)  += visorchipset/
 obj-$(CONFIG_UNISYS_UISLIB)+= uislib/
-obj-$(CONFIG_UNISYS_VIRTPCI)   += virtpci/
diff --git a/drivers/staging/unisys/virtpci/Kconfig 
b/drivers/staging/unisys/virtpci/Kconfig
deleted file mode 100644
index 6d19482..000
--- a/drivers/staging/unisys/virtpci/Kconfig
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Unisys virtpci configuration
-#
-
-config UNISYS_VIRTPCI
-   tristate "Unisys virtpci driver"
-   select UNISYS_UISLIB
-   ---help---
-   If you say Y here, you will enable the Unisys virtpci driver.
-
diff --git a/drivers/staging/unisys/virtpci/Makefile 
b/drivers/staging/unisys/virtpci/Makefile
deleted file mode 100644
index a26c696..000
--- a/drivers/staging/unisys/virtpci/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Makefile for Unisys virtpci
-#
-
-obj-$(CONFIG_UNISYS_VIRTPCI)   += virtpci.o
-
-ccflags-y += -Idrivers/staging/unisys/include
-ccflags-y += -Idrivers/staging/unisys/uislib
-ccflags-y += -Idrivers/staging/unisys/common-spar/include
-ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels
diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
deleted file mode 100644
index d5ad017..000
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ /dev/null
@@ -1,1394 +0,0 @@
-/* virtpci.c
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#define EXPORT_SYMTAB
-
-#include 
-#ifdef CONFIG_MODVERSIONS
-#include 
-#endif
-#include "diagnostics/appos_subsystems.h"
-#include "uisutils.h"
-#include "vbuschannel.h"
-#include "vbushelper.h"
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "version.h"
-#include "guestlinuxdebug.h"
-#include "timskmod.h"
-
-struct driver_private {
-   struct kobject kobj;
-   struct klist klist_devices;
-   struct klist_node knode_bus;
-   struct module_kobject *mkobj;
-   struct device_driver *driver;
-};
-
-#define to_driver(obj) container_of(obj, struct driver_private, kobj)
-
-/* bus_id went away in 2.6.30 - the size was 20 bytes, so we'll define
- * it ourselves, and a macro to make getting the field a bit simpler.
- */
-#ifndef BUS_ID_SIZE
-#define BUS_ID_SIZE 20
-#endif
-
-#define BUS_ID(x) dev_name(x)
-
-/* MAX_BUF = 4 busses x ( 32 devices/bus + 1 busline) x 80 characters
- * = 10,560 bytes ~ 2^14 = 16,384 bytes
- */
-#define MAX_BUF 16384
-
-#include "virtpci.h"
-
-/* this is shorter than using __FILE__ (full path name) in
- * debug/info/error messages
- */
-#define CURRENT_FILE_PC VIRT_PCI_PC_virtpci_c
-#def

[PATCH 3/3] staging: unisys: remove uislib module from staging tree

2015-04-13 Thread Benjamin Romer
This module is being removed completely, because it contained wrapper functions
and utility functions that were used in virtpci and virthba. Since these two
drivers are being rewritten to not use these wrappers and utilities, uislib
needs to go.

Signed-off-by: Benjamin Romer 
Reviewed-by: Don Zickus 
Reviewed-by: Jes Sorensen 
---
 drivers/staging/unisys/Kconfig|1 -
 drivers/staging/unisys/Makefile   |1 -
 drivers/staging/unisys/uislib/Kconfig |   10 -
 drivers/staging/unisys/uislib/Makefile|   12 -
 drivers/staging/unisys/uislib/uislib.c| 1372 -
 drivers/staging/unisys/uislib/uisqueue.c  |  322 ---
 drivers/staging/unisys/uislib/uisthread.c |   69 --
 drivers/staging/unisys/uislib/uisutils.c  |  137 ---
 8 files changed, 1924 deletions(-)
 delete mode 100644 drivers/staging/unisys/uislib/Kconfig
 delete mode 100644 drivers/staging/unisys/uislib/Makefile
 delete mode 100644 drivers/staging/unisys/uislib/uislib.c
 delete mode 100644 drivers/staging/unisys/uislib/uisqueue.c
 delete mode 100644 drivers/staging/unisys/uislib/uisthread.c
 delete mode 100644 drivers/staging/unisys/uislib/uisutils.c

diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig
index 1de86d1..14e1ea6 100644
--- a/drivers/staging/unisys/Kconfig
+++ b/drivers/staging/unisys/Kconfig
@@ -12,6 +12,5 @@ if UNISYSSPAR
 source "drivers/staging/unisys/visorutil/Kconfig"
 source "drivers/staging/unisys/visorchannel/Kconfig"
 source "drivers/staging/unisys/visorchipset/Kconfig"
-source "drivers/staging/unisys/uislib/Kconfig"
 
 endif # UNISYSSPAR
diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile
index 899b0cb..97e750d 100644
--- a/drivers/staging/unisys/Makefile
+++ b/drivers/staging/unisys/Makefile
@@ -4,4 +4,3 @@
 obj-$(CONFIG_UNISYS_VISORUTIL) += visorutil/
 obj-$(CONFIG_UNISYS_VISORCHANNEL)  += visorchannel/
 obj-$(CONFIG_UNISYS_VISORCHIPSET)  += visorchipset/
-obj-$(CONFIG_UNISYS_UISLIB)+= uislib/
diff --git a/drivers/staging/unisys/uislib/Kconfig 
b/drivers/staging/unisys/uislib/Kconfig
deleted file mode 100644
index c39a0a2..000
--- a/drivers/staging/unisys/uislib/Kconfig
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Unisys uislib configuration
-#
-
-config UNISYS_UISLIB
-   tristate "Unisys uislib driver"
-   select UNISYS_VISORCHIPSET
-   ---help---
-   If you say Y here, you will enable the Unisys uislib driver.
-
diff --git a/drivers/staging/unisys/uislib/Makefile 
b/drivers/staging/unisys/uislib/Makefile
deleted file mode 100644
index 860f494..000
--- a/drivers/staging/unisys/uislib/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Makefile for Unisys uislib
-#
-
-obj-$(CONFIG_UNISYS_UISLIB)+= visoruislib.o
-
-visoruislib-y := uislib.o uisqueue.o  uisthread.o  uisutils.o
-
-ccflags-y += -Idrivers/staging/unisys/include
-ccflags-y += -Idrivers/staging/unisys/visorchipset
-ccflags-y += -Idrivers/staging/unisys/common-spar/include
-ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels
diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
deleted file mode 100644
index f93d0bb..000
--- a/drivers/staging/unisys/uislib/uislib.c
+++ /dev/null
@@ -1,1372 +0,0 @@
-/* uislib.c
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-/* @ALL_INSPECTED */
-#define EXPORT_SYMTAB
-#include 
-#include 
-#ifdef CONFIG_MODVERSIONS
-#include 
-#endif
-#include 
-#include 
-
-#include 
-#include 
-
-#include 
-#include "diagnostics/appos_subsystems.h"
-#include "uisutils.h"
-#include "vbuschannel.h"
-
-#include 
-#include  /* for copy_from_user */
-#include/* for toupper */
-#include 
-
-#include "sparstop.h"
-#include "visorchipset.h"
-#include "version.h"
-#include "guestlinuxdebug.h"
-
-#define SET_PROC_OWNER(x, y)
-
-#define POLLJIFFIES_NORMAL 1
-/* Choose whether or not you want to wakeup the request-polling thread
- * after an IO termination:
- * this is shorter than using __FILE__ (full path name) in
- * debug/info/error messages
- */
-#define CURRENT_FILE_PC UISLIB_PC_uislib_c
-#define __MYFILE__ "uislib.c"
-
-/* global function pointers that act as callback functions into virtpcimod */
-int (*virt_c

[PATCH 1/3] staging: unisys: remove virthba driver for rewrite

2015-04-13 Thread Benjamin Romer
The virthba driver is being rewritten and will be renamed to visorhba, so delete
the old driver from the source tree.

Signed-off-by: Benjamin Romer 
Reviewed-by: Don Zickus 
Reviewed-by: Jes Sorensen 
---
 drivers/staging/unisys/Kconfig   |1 -
 drivers/staging/unisys/Makefile  |1 -
 drivers/staging/unisys/virthba/Kconfig   |   13 -
 drivers/staging/unisys/virthba/Makefile  |   12 -
 drivers/staging/unisys/virthba/virthba.c | 1572 --
 drivers/staging/unisys/virthba/virthba.h |   27 -
 6 files changed, 1626 deletions(-)
 delete mode 100644 drivers/staging/unisys/virthba/Kconfig
 delete mode 100644 drivers/staging/unisys/virthba/Makefile
 delete mode 100644 drivers/staging/unisys/virthba/virthba.c
 delete mode 100644 drivers/staging/unisys/virthba/virthba.h

diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig
index 19fcb34..906cd58 100644
--- a/drivers/staging/unisys/Kconfig
+++ b/drivers/staging/unisys/Kconfig
@@ -14,6 +14,5 @@ source "drivers/staging/unisys/visorchannel/Kconfig"
 source "drivers/staging/unisys/visorchipset/Kconfig"
 source "drivers/staging/unisys/uislib/Kconfig"
 source "drivers/staging/unisys/virtpci/Kconfig"
-source "drivers/staging/unisys/virthba/Kconfig"
 
 endif # UNISYSSPAR
diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile
index 68b9925..3283a01 100644
--- a/drivers/staging/unisys/Makefile
+++ b/drivers/staging/unisys/Makefile
@@ -6,4 +6,3 @@ obj-$(CONFIG_UNISYS_VISORCHANNEL)   += visorchannel/
 obj-$(CONFIG_UNISYS_VISORCHIPSET)  += visorchipset/
 obj-$(CONFIG_UNISYS_UISLIB)+= uislib/
 obj-$(CONFIG_UNISYS_VIRTPCI)   += virtpci/
-obj-$(CONFIG_UNISYS_VIRTHBA)   += virthba/
diff --git a/drivers/staging/unisys/virthba/Kconfig 
b/drivers/staging/unisys/virthba/Kconfig
deleted file mode 100644
index dfadfc4..000
--- a/drivers/staging/unisys/virthba/Kconfig
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Unisys virthba configuration
-#
-
-config UNISYS_VIRTHBA
-   tristate "Unisys virthba driver"
-   depends on SCSI
-   select UNISYS_VISORCHIPSET
-   select UNISYS_UISLIB
-   select UNISYS_VIRTPCI
-   ---help---
-   If you say Y here, you will enable the Unisys virthba driver.
-
diff --git a/drivers/staging/unisys/virthba/Makefile 
b/drivers/staging/unisys/virthba/Makefile
deleted file mode 100644
index a4e4037..000
--- a/drivers/staging/unisys/virthba/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Makefile for Unisys virthba
-#
-
-obj-$(CONFIG_UNISYS_VIRTHBA)   += virthba.o
-
-ccflags-y += -Idrivers/staging/unisys/include
-ccflags-y += -Idrivers/staging/unisys/uislib
-ccflags-y += -Idrivers/staging/unisys/visorchipset
-ccflags-y += -Idrivers/staging/unisys/virtpci
-ccflags-y += -Idrivers/staging/unisys/common-spar/include
-ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels
diff --git a/drivers/staging/unisys/virthba/virthba.c 
b/drivers/staging/unisys/virthba/virthba.c
deleted file mode 100644
index d9001cc..000
--- a/drivers/staging/unisys/virthba/virthba.c
+++ /dev/null
@@ -1,1572 +0,0 @@
-/* virthba.c
- *
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- * NON INFRINGEMENT.  See the GNU General Public License for more
- * details.
- */
-
-#define EXPORT_SYMTAB
-
-/* if you want to turn on some debugging of write device data or read
- * device data, define these two undefs.  You will probably want to
- * customize the code which is here since it was written assuming
- * reading and writing a specific data file df.64M.txt which is a
- * 64Megabyte file created by Art Nilson using a scritp I wrote called
- * cr_test_data.pl.  The data file consists of 256 byte lines of text
- * which start with an 8 digit sequence number, a colon, and then
- * letters after that */
-
-#include 
-#ifdef CONFIG_MODVERSIONS
-#include 
-#endif
-
-#include "diagnostics/appos_subsystems.h"
-#include "uisutils.h"
-#include "uisqueue.h"
-#include "uisthread.h"
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "virthba.h"
-#include "virtpci.h"
-#include "visorchipset.h"
-#include "version.h"
-#include "guestlinuxdebug.h"
-/* this is shorter than using __FILE__ (full path name) in
- * debug

[PATCH 0/3] staging: unisys: remove virtpci, virthba, and uislib

2015-04-13 Thread Benjamin Romer
We need to remove the old bus model so it can be replaced with a better design.
By removing virthba and virtpci, we can eliminate uislib as well, which will
get rid of many undesirable wrapper and library functions.

These removals will be followed with the addition of a replacement driver called
visorbus. This driver will consolidate the functions needed to support new
virtual device drivers, so the functions in visorchannel and visorutil will be
moved over to visorbus. Additionally, the message handling done in visorchipset
will make its way here too.

Benjamin Romer (3):
  staging: unisys: remove virthba driver for rewrite
  staging: unisys: remove virtpci driver from staging tree
  staging: unisys: remove uislib module from staging tree

 drivers/staging/unisys/Kconfig|3 -
 drivers/staging/unisys/Makefile   |3 -
 drivers/staging/unisys/uislib/Kconfig |   10 -
 drivers/staging/unisys/uislib/Makefile|   12 -
 drivers/staging/unisys/uislib/uislib.c| 1372 -
 drivers/staging/unisys/uislib/uisqueue.c  |  322 --
 drivers/staging/unisys/uislib/uisthread.c |   69 --
 drivers/staging/unisys/uislib/uisutils.c  |  137 ---
 drivers/staging/unisys/virthba/Kconfig|   13 -
 drivers/staging/unisys/virthba/Makefile   |   12 -
 drivers/staging/unisys/virthba/virthba.c  | 1572 -
 drivers/staging/unisys/virthba/virthba.h  |   27 -
 drivers/staging/unisys/virtpci/Kconfig|   10 -
 drivers/staging/unisys/virtpci/Makefile   |   10 -
 drivers/staging/unisys/virtpci/virtpci.c  | 1394 -
 drivers/staging/unisys/virtpci/virtpci.h  |  103 --
 16 files changed, 5069 deletions(-)
 delete mode 100644 drivers/staging/unisys/uislib/Kconfig
 delete mode 100644 drivers/staging/unisys/uislib/Makefile
 delete mode 100644 drivers/staging/unisys/uislib/uislib.c
 delete mode 100644 drivers/staging/unisys/uislib/uisqueue.c
 delete mode 100644 drivers/staging/unisys/uislib/uisthread.c
 delete mode 100644 drivers/staging/unisys/uislib/uisutils.c
 delete mode 100644 drivers/staging/unisys/virthba/Kconfig
 delete mode 100644 drivers/staging/unisys/virthba/Makefile
 delete mode 100644 drivers/staging/unisys/virthba/virthba.c
 delete mode 100644 drivers/staging/unisys/virthba/virthba.h
 delete mode 100644 drivers/staging/unisys/virtpci/Kconfig
 delete mode 100644 drivers/staging/unisys/virtpci/Makefile
 delete mode 100644 drivers/staging/unisys/virtpci/virtpci.c
 delete mode 100644 drivers/staging/unisys/virtpci/virtpci.h

-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: unisys: fix kdump support

2015-04-06 Thread Benjamin Romer
The s-Par drivers used to be out-of-tree, so they needed a parameter to
let them know we were going into a dump. This patch removes that code
and uses the built-in kernel function instead.

Reviewed-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/globals.h   | 1 -
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 7 ++-
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/globals.h 
b/drivers/staging/unisys/visorchipset/globals.h
index f76e498..36b21ec 100644
--- a/drivers/staging/unisys/visorchipset/globals.h
+++ b/drivers/staging/unisys/visorchipset/globals.h
@@ -36,7 +36,6 @@ extern int visorchipset_serverregwait;
 extern int visorchipset_clientregwait;
 extern int visorchipset_testteardown;
 extern int visorchipset_disable_controlvm;
-extern int visorchipset_crash_kernel;
 extern int visorchipset_holdchipsetready;
 
 #endif
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index f2663d2c..899bf68 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define CURRENT_FILE_PC VISOR_CHIPSET_PC_visorchipset_main_c
 #define TEST_VNIC_PHYSITF "eth0"   /* physical network itf for
@@ -2207,7 +2208,7 @@ visorchipset_init(void)
}
if (!visorchipset_disable_controlvm) {
/* if booting in a crash kernel */
-   if (visorchipset_crash_kernel)
+   if (is_kdump_kernel())
INIT_DELAYED_WORK(&periodic_controlvm_work,
  setup_crash_devices_work_queue);
else
@@ -2315,10 +2316,6 @@ module_param_named(disable_controlvm, 
visorchipset_disable_controlvm, int,
 MODULE_PARM_DESC(visorchipset_disable_controlvm,
 "1 to disable polling of controlVm channel");
 int visorchipset_disable_controlvm = 0;/* default is off */
-module_param_named(crash_kernel, visorchipset_crash_kernel, int, S_IRUGO);
-MODULE_PARM_DESC(visorchipset_crash_kernel,
-"1 means we are running in crash kernel");
-int visorchipset_crash_kernel = 0; /* default is running in non-crash kernel */
 module_param_named(holdchipsetready, visorchipset_holdchipsetready,
   int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_holdchipsetready,
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: unisys: fix CamelCase constant names for postcodes

2015-04-06 Thread Benjamin Romer
Fix these Camelcase constants:

VISOR_CHIPSET_PC_controlvm_c => VISOR_CHIPSET_PC_CONTROLVM_C
VISOR_CHIPSET_PC_controlvm_cm2 => VISOR_CHIPSET_PC_CONTROLVM_CM2
VISOR_CHIPSET_PC_controlvm_direct_c =>
VISOR_CHIPSET_PC_CONTROLVM_DIRECT_C
VISOR_CHIPSET_PC_file_c => VISOR_CHIPSET_PC_FILE_C
VISOR_CHIPSET_PC_parser_c => VISOR_CHIPSET_PC_PARSER_C
VISOR_CHIPSET_PC_testing_c => VISOR_CHIPSET_PC_TESTING_C
VISOR_CHIPSET_PC_visorchipset_main_c =>
VISOR_CHIPSET_PC_VISORCHIPSET_MAIN_C
VISOR_CHIPSET_PC_visorswitchbus_c => VISOR_CHIPSET_PC_VISORSWITCHBUS_C
VISOR_BUS_PC_businst_attr_c => VISOR_BUS_PC_BUSINST_ATTR_C
VISOR_BUS_PC_channel_attr_c => VISOR_BUS_PC_CHANNEL_ATTR_C
VISOR_BUS_PC_devmajorminor_attr_c => VISOR_BUS_PC_DEVMAJORMINOR_ATTR_C
VISOR_BUS_PC_visorbus_main_c => VISOR_BUS_PC_VISORBUS_MAIN_C
VISOR_CLIENT_BUS_PC_visorclientbus_main_c =>
VISOR_CLIENT_BUS_PC_VISORCLIENTBUS_MAIN_C
VIRT_HBA_PC_virthba_c => VIRT_HBA_PC_VIRTHBA_C
VIRT_PCI_PC_virtpci_c => VIRT_PCI_PC_VIRTPCI_C
VIRT_NIC_P_virtnic_c => VIRT_NIC_P_VIRTNIC_C
UISLIB_PC_uislib_c => UISLIB_PC_UISLIB_C
UISLIB_PC_uisqueue_c => UISLIB_PC_UISQUEUE_C
UISLIB_PC_uisthread_c => UISLIB_PC_UISTHREAD_C
UISLIB_PC_uisutils_c => UISLIB_PC_UISUTILS_C

Reviewed-by: Jes Sorensen 
Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/include/guestlinuxdebug.h | 40 
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/unisys/include/guestlinuxdebug.h 
b/drivers/staging/unisys/include/guestlinuxdebug.h
index 957a627..1e02d44 100644
--- a/drivers/staging/unisys/include/guestlinuxdebug.h
+++ b/drivers/staging/unisys/include/guestlinuxdebug.h
@@ -26,38 +26,38 @@
 enum driver_pc {   /* POSTCODE driver identifier tuples */
/* visorchipset driver files */
VISOR_CHIPSET_PC = 0xA0,
-   VISOR_CHIPSET_PC_controlvm_c = 0xA1,
-   VISOR_CHIPSET_PC_controlvm_cm2 = 0xA2,
-   VISOR_CHIPSET_PC_controlvm_direct_c = 0xA3,
-   VISOR_CHIPSET_PC_file_c = 0xA4,
-   VISOR_CHIPSET_PC_parser_c = 0xA5,
-   VISOR_CHIPSET_PC_testing_c = 0xA6,
-   VISOR_CHIPSET_PC_visorchipset_main_c = 0xA7,
-   VISOR_CHIPSET_PC_visorswitchbus_c = 0xA8,
+   VISOR_CHIPSET_PC_CONTROLVM_C = 0xA1,
+   VISOR_CHIPSET_PC_CONTROLVM_CM2 = 0xA2,
+   VISOR_CHIPSET_PC_CONTROLVM_DIRECT_C = 0xA3,
+   VISOR_CHIPSET_PC_FILE_C = 0xA4,
+   VISOR_CHIPSET_PC_PARSER_C = 0xA5,
+   VISOR_CHIPSET_PC_TESTING_C = 0xA6,
+   VISOR_CHIPSET_PC_VISORCHIPSET_MAIN_C = 0xA7,
+   VISOR_CHIPSET_PC_VISORSWITCHBUS_C = 0xA8,
/* visorbus driver files */
VISOR_BUS_PC = 0xB0,
-   VISOR_BUS_PC_businst_attr_c = 0xB1,
-   VISOR_BUS_PC_channel_attr_c = 0xB2,
-   VISOR_BUS_PC_devmajorminor_attr_c = 0xB3,
-   VISOR_BUS_PC_visorbus_main_c = 0xB4,
+   VISOR_BUS_PC_BUSINST_ATTR_C = 0xB1,
+   VISOR_BUS_PC_CHANNEL_ATTR_C = 0xB2,
+   VISOR_BUS_PC_DEVMAJORMINOR_ATTR_C = 0xB3,
+   VISOR_BUS_PC_VISORBUS_MAIN_C = 0xB4,
/* visorclientbus driver files */
VISOR_CLIENT_BUS_PC = 0xC0,
-   VISOR_CLIENT_BUS_PC_visorclientbus_main_c = 0xC1,
+   VISOR_CLIENT_BUS_PC_VISORCLIENTBUS_MAIN_C = 0xC1,
/* virt hba driver files */
VIRT_HBA_PC = 0xC2,
-   VIRT_HBA_PC_virthba_c = 0xC3,
+   VIRT_HBA_PC_VIRTHBA_C = 0xC3,
/* virtpci driver files */
VIRT_PCI_PC = 0xC4,
-   VIRT_PCI_PC_virtpci_c = 0xC5,
+   VIRT_PCI_PC_VIRTPCI_C = 0xC5,
/* virtnic driver files */
VIRT_NIC_PC = 0xC6,
-   VIRT_NIC_P_virtnic_c = 0xC7,
+   VIRT_NIC_P_VIRTNIC_C = 0xC7,
/* uislib driver files */
UISLIB_PC = 0xD0,
-   UISLIB_PC_uislib_c = 0xD1,
-   UISLIB_PC_uisqueue_c = 0xD2,
-   UISLIB_PC_uisthread_c = 0xD3,
-   UISLIB_PC_uisutils_c = 0xD4,
+   UISLIB_PC_UISLIB_C = 0xD1,
+   UISLIB_PC_UISQUEUE_C = 0xD2,
+   UISLIB_PC_UISTHREAD_C = 0xD3,
+   UISLIB_PC_UISUTILS_C = 0xD4,
 };
 
 enum event_pc {/* POSTCODE event identifier tuples */
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 36/69] staging: unisys: fix braces in visorchipset_main.c

2015-03-16 Thread Benjamin Romer
Fix all of the bracing mistakes by adding missing braces, and removing
unnecessary braces.

Signed-off-by: Benjamin Romer 
---
 .../staging/unisys/visorchipset/visorchipset_main.c  | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index fed675c..c1bcc4af 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -875,8 +875,9 @@ bus_epilog(u32 bus_no,
if (need_response) {
memcpy(&bus_info->pending_msg_hdr, msg_hdr,
   sizeof(struct controlvm_message_header));
-   } else
+   } else {
bus_info->pending_msg_hdr.id = CONTROLVM_INVALID;
+   }
 
down(¬ifier_lock);
if (response == CONTROLVM_RESP_SUCCESS) {
@@ -951,8 +952,9 @@ device_epilog(u32 bus_no, u32 dev_no, struct 
spar_segment_state state, u32 cmd,
if (need_response) {
memcpy(&dev_info->pending_msg_hdr, msg_hdr,
   sizeof(struct controlvm_message_header));
-   } else
+   } else {
dev_info->pending_msg_hdr.id = CONTROLVM_INVALID;
+   }
 
down(¬ifier_lock);
if (response >= 0) {
@@ -1257,9 +1259,8 @@ my_device_destroy(struct controlvm_message *inmsg)
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
goto Away;
}
-   if (pDevInfo->state.created == 0) {
+   if (pDevInfo->state.created == 0)
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
-   }
 
 Away:
if ((rc >= CONTROLVM_RESP_SUCCESS) && pDevInfo)
@@ -1813,8 +1814,9 @@ controlvm_periodic_work(struct work_struct *work)
inmsg = ControlVm_Pending_Msg;
ControlVm_Pending_Msg_Valid = FALSE;
gotACommand = TRUE;
-   } else
+   } else {
gotACommand = read_controlvm_event(&inmsg);
+   }
}
 
handle_command_failed = FALSE;
@@ -1936,18 +1938,18 @@ setup_crash_devices_work_queue(struct work_struct *work)
}
 
/* reuse IOVM create bus message */
-   if (localCrashCreateBusMsg.cmd.create_bus.channel_addr != 0)
+   if (localCrashCreateBusMsg.cmd.create_bus.channel_addr != 0) {
bus_create(&localCrashCreateBusMsg);
-   else {
+   } else {
POSTCODE_LINUX_2(CRASH_DEV_BUS_NULL_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
return;
}
 
/* reuse create device message for storage device */
-   if (localCrashCreateDevMsg.cmd.create_device.channel_addr != 0)
+   if (localCrashCreateDevMsg.cmd.create_device.channel_addr != 0) {
my_device_create(&localCrashCreateDevMsg);
-   else {
+   } else {
POSTCODE_LINUX_2(CRASH_DEV_DEV_NULL_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
return;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 56/69] staging: unisys: fix CamelCase in putfile-related globals

2015-03-16 Thread Benjamin Romer
Fix the CamelCase global names:

Putfile_buffer_list_pool => putfile_buffer_list_pool
Putfile_buffer_list_pool_name => putfile_buffer_list_pool_name
Putfile_request_list => putfile_request_list

Update all references to use the corrected names.

Signed-off-by: Benjamin Romer 
---
 .../staging/unisys/visorchipset/visorchipset_main.c| 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 670ac5b..0b09102 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -131,8 +131,8 @@ static BOOL controlvm_pending_msg_valid = FALSE;
 /* Pool of struct putfile_buffer_entry, for keeping track of pending (incoming)
  * TRANSMIT_FILE PutFile payloads.
  */
-static struct kmem_cache *Putfile_buffer_list_pool;
-static const char Putfile_buffer_list_pool_name[] =
+static struct kmem_cache *putfile_buffer_list_pool;
+static const char putfile_buffer_list_pool_name[] =
"controlvm_putfile_buffer_list_pool";
 
 /* This identifies a data buffer that has been received via a controlvm 
messages
@@ -147,7 +147,7 @@ struct putfile_buffer_entry {
  * Each entry in this list identifies an outstanding TRANSMIT_FILE
  * conversation.
  */
-static LIST_HEAD(Putfile_request_list);
+static LIST_HEAD(putfile_request_list);
 
 /* This describes a buffer and its current state of transfer (e.g., how many
  * bytes have already been supplied as putfile data, and how many bytes are
@@ -2185,11 +2185,11 @@ visorchipset_init(void)
 
memset(&g_del_dump_msg_hdr, 0, sizeof(struct controlvm_message_header));
 
-   Putfile_buffer_list_pool =
-   kmem_cache_create(Putfile_buffer_list_pool_name,
+   putfile_buffer_list_pool =
+   kmem_cache_create(putfile_buffer_list_pool_name,
  sizeof(struct putfile_buffer_entry),
  0, SLAB_HWCACHE_ALIGN, NULL);
-   if (!Putfile_buffer_list_pool) {
+   if (!putfile_buffer_list_pool) {
POSTCODE_LINUX_2(CHIPSET_INIT_FAILURE_PC, DIAG_SEVERITY_ERR);
rc = -1;
goto cleanup;
@@ -2252,9 +2252,9 @@ visorchipset_exit(void)
periodic_controlvm_workqueue = NULL;
destroy_controlvm_payload_info(&controlvm_payload_info);
}
-   if (Putfile_buffer_list_pool) {
-   kmem_cache_destroy(Putfile_buffer_list_pool);
-   Putfile_buffer_list_pool = NULL;
+   if (putfile_buffer_list_pool) {
+   kmem_cache_destroy(putfile_buffer_list_pool);
+   putfile_buffer_list_pool = NULL;
}
 
cleanup_controlvm_structures();
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 31/69] staging: unisys: fix Camelcase Away goto label

2015-03-16 Thread Benjamin Romer
Rename the label in both places:

Away => cleanup

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 5d1f1fa..8c58a14 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -621,7 +621,7 @@ chipset_init(struct controlvm_message *inmsg)
POSTCODE_LINUX_2(CHIPSET_INIT_ENTRY_PC, POSTCODE_SEVERITY_INFO);
if (chipset_inited) {
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
-   goto Away;
+   goto cleanup;
}
chipset_inited = 1;
POSTCODE_LINUX_2(CHIPSET_INIT_EXIT_PC, POSTCODE_SEVERITY_INFO);
@@ -636,7 +636,7 @@ chipset_init(struct controlvm_message *inmsg)
 * features-aware driver. */
features |= ULTRA_CHIPSET_FEATURE_REPLY;
 
-Away:
+cleanup:
if (rc < 0)
cleanup_controlvm_structures();
if (inmsg->hdr.flags.response_expected)
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 43/69] staging: unisys: refactor initialize_controlvm_payload_info()

2015-03-16 Thread Benjamin Romer
Fix the CamelCased goto label:

Away => cleanup

and get rid of the NULL comparison.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4fe1ad1..7956ae71 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1269,26 +1269,26 @@ initialize_controlvm_payload_info(HOSTADDRESS 
phys_addr, u64 offset, u32 bytes,
 
if (!info) {
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
-   goto Away;
+   goto cleanup;
}
memset(info, 0, sizeof(struct controlvm_payload_info));
if ((offset == 0) || (bytes == 0)) {
rc = -CONTROLVM_RESP_ERROR_PAYLOAD_INVALID;
-   goto Away;
+   goto cleanup;
}
payload = ioremap_cache(phys_addr + offset, bytes);
if (!payload) {
rc = -CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
-   goto Away;
+   goto cleanup;
}
 
info->offset = offset;
info->bytes = bytes;
info->ptr = payload;
 
-Away:
+cleanup:
if (rc < 0) {
-   if (payload != NULL) {
+   if (payload) {
iounmap(payload);
payload = NULL;
}
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 21/69] staging: unisys: fix placement of logical ops in visorchipset_main.c

2015-03-16 Thread Benjamin Romer
Several if statement lines had the logical operators in the wrong place,
so fix these by moving the operator to the end of the previous line.

Signed-off-by: Benjamin Romer 
---
 .../staging/unisys/visorchipset/visorchipset_main.c  | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4f36b4b..401cd1e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -84,8 +84,8 @@ static struct controlvm_message_packet 
g_devicechangestate_packet;
  */
 #define FOR_VISORHACKBUS(channel_type_guid) \
(((uuid_le_cmp(channel_type_guid,\
-  spar_vnic_channel_protocol_uuid) == 0)\
-   || (uuid_le_cmp(channel_type_guid,\
+  spar_vnic_channel_protocol_uuid) == 0) ||\
+   (uuid_le_cmp(channel_type_guid,\
spar_vhba_channel_protocol_uuid) == 0)))
 #define FOR_VISORBUS(channel_type_guid) 
(!(FOR_VISORHACKBUS(channel_type_guid)))
 
@@ -705,10 +705,10 @@ controlvm_respond(struct controlvm_message_header 
*msgHdr, int response)
controlvm_init_response(&outmsg, msgHdr, response);
/* For DiagPool channel DEVICE_CHANGESTATE, we need to send
* back the deviceChangeState structure in the packet. */
-   if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE
-   && g_devicechangestate_packet.device_change_state.bus_no ==
-   g_diagpool_bus_no
-   && g_devicechangestate_packet.device_change_state.dev_no ==
+   if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
+   g_devicechangestate_packet.device_change_state.bus_no ==
+   g_diagpool_bus_no &&
+   g_devicechangestate_packet.device_change_state.dev_no ==
g_diagpool_dev_no)
outmsg.cmd = g_devicechangestate_packet;
if (outmsg.hdr.flags.test_message == 1)
@@ -1030,8 +1030,8 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
/* this is lite pause where channel is
 * still valid just 'pause' of it
 */
-   if (busNo == g_diagpool_bus_no
-   && devNo == g_diagpool_dev_no) {
+   if (busNo == g_diagpool_bus_no &&
+   devNo == g_diagpool_dev_no) {
/* this will trigger the
 * diag_shutdown.sh script in
 * the visorchipset hotplug */
@@ -1828,8 +1828,8 @@ controlvm_periodic_work(struct work_struct *work)
/* Check events to determine if response to CHIPSET_READY
 * should be sent
 */
-   if (visorchipset_holdchipsetready
-   && (g_chipset_msg_hdr.id != CONTROLVM_INVALID)) {
+   if (visorchipset_holdchipsetready &&
+   (g_chipset_msg_hdr.id != CONTROLVM_INVALID)) {
if (check_chipset_events() == 1) {
controlvm_respond(&g_chipset_msg_hdr, 0);
clear_chipset_events();
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 68/69] staging: unisys: Fix CamelCase local variable in remaining_steps functions

2015-03-16 Thread Benjamin Romer
Rename the CamelCase local variable

remainingSteps => remaining_steps

Update all references to use the corrected name.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 6f4b491..ec48132 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -470,29 +470,29 @@ static ssize_t textid_store(struct device *dev, struct 
device_attribute *attr,
 static ssize_t remaining_steps_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
-   u16 remainingSteps;
+   u16 remaining_steps;
 
visorchannel_read(controlvm_channel,
offsetof(struct spar_controlvm_channel_protocol,
installation_remaining_steps),
-   &remainingSteps,
+   &remaining_steps,
sizeof(u16));
-   return scnprintf(buf, PAGE_SIZE, "%hu\n", remainingSteps);
+   return scnprintf(buf, PAGE_SIZE, "%hu\n", remaining_steps);
 }
 
 static ssize_t remaining_steps_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
 {
-   u16 remainingSteps;
+   u16 remaining_steps;
int ret;
 
-   if (kstrtou16(buf, 10, &remainingSteps) != 0)
+   if (kstrtou16(buf, 10, &remaining_steps) != 0)
return -EINVAL;
 
ret = visorchannel_write(controlvm_channel,
offsetof(struct spar_controlvm_channel_protocol,
installation_remaining_steps),
-   &remainingSteps, sizeof(u16));
+   &remaining_steps, sizeof(u16));
if (ret)
return ret;
return count;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 45/69] staging: unisys: fix Camelcase in initialize_controlvm_payload()

2015-03-16 Thread Benjamin Romer
Fix the CamelCase local variables:

payloadOffset => payload_offset
payloadBytes => payload_bytes

Update all references to use the new names.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 0f791fb..a32d092 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1310,13 +1310,13 @@ static void
 initialize_controlvm_payload(void)
 {
HOSTADDRESS phys_addr = visorchannel_get_physaddr(controlvm_channel);
-   u64 payloadOffset = 0;
-   u32 payloadBytes = 0;
+   u64 payload_offset = 0;
+   u32 payload_bytes = 0;
 
if (visorchannel_read(controlvm_channel,
  offsetof(struct spar_controlvm_channel_protocol,
   request_payload_offset),
- &payloadOffset, sizeof(payloadOffset)) < 0) {
+ &payload_offset, sizeof(payload_offset)) < 0) {
POSTCODE_LINUX_2(CONTROLVM_INIT_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
return;
@@ -1324,13 +1324,13 @@ initialize_controlvm_payload(void)
if (visorchannel_read(controlvm_channel,
  offsetof(struct spar_controlvm_channel_protocol,
   request_payload_bytes),
- &payloadBytes, sizeof(payloadBytes)) < 0) {
+ &payload_bytes, sizeof(payload_bytes)) < 0) {
POSTCODE_LINUX_2(CONTROLVM_INIT_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
return;
}
initialize_controlvm_payload_info(phys_addr,
- payloadOffset, payloadBytes,
+ payload_offset, payload_bytes,
  &controlvm_payload_info);
 }
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 18/69] staging: unisys: fix CamelCased diagpool bus/dev names

2015-03-16 Thread Benjamin Romer
Fix CamelCase names:

g_diagpoolBusNo => g_diagpool_bus_no
g_diagpoolDevNo => g_diagpool_dev_no

Update all references to the changed names.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 381d305..33fe82d 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -75,8 +75,8 @@ static struct controlvm_message_header g_del_dump_msg_hdr;
 static const uuid_le spar_diag_pool_channel_protocol_uuid =
SPAR_DIAG_POOL_CHANNEL_PROTOCOL_UUID;
 /* 0xff is an invalid Bus/Device number */
-static ulong g_diagpoolBusNo = 0xff;
-static ulong g_diagpoolDevNo = 0xff;
+static ulong g_diagpool_bus_no = 0xff;
+static ulong g_diagpool_dev_no = 0xff;
 static struct controlvm_message_packet g_DeviceChangeStatePacket;
 
 /* Only VNIC and VHBA channels are sent to visorclientbus (aka
@@ -707,9 +707,9 @@ controlvm_respond(struct controlvm_message_header *msgHdr, 
int response)
* back the deviceChangeState structure in the packet. */
if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE
&& g_DeviceChangeStatePacket.device_change_state.bus_no ==
-   g_diagpoolBusNo
+   g_diagpool_bus_no
&& g_DeviceChangeStatePacket.device_change_state.dev_no ==
-   g_diagpoolDevNo)
+   g_diagpool_dev_no)
outmsg.cmd = g_DeviceChangeStatePacket;
if (outmsg.hdr.flags.test_message == 1)
return;
@@ -1030,8 +1030,8 @@ device_epilog(u32 busNo, u32 devNo, struct 
spar_segment_state state, u32 cmd,
/* this is lite pause where channel is
 * still valid just 'pause' of it
 */
-   if (busNo == g_diagpoolBusNo
-   && devNo == g_diagpoolDevNo) {
+   if (busNo == g_diagpool_bus_no
+   && devNo == g_diagpool_dev_no) {
/* this will trigger the
 * diag_shutdown.sh script in
 * the visorchipset hotplug */
@@ -1241,8 +1241,8 @@ Away:
/* get the bus and devNo for DiagPool channel */
if (pDevInfo &&
is_diagpool_channel(pDevInfo->chan_info.channel_type_uuid)) {
-   g_diagpoolBusNo = busNo;
-   g_diagpoolDevNo = devNo;
+   g_diagpool_bus_no = busNo;
+   g_diagpool_dev_no = devNo;
}
device_epilog(busNo, devNo, segment_state_running,
  CONTROLVM_DEVICE_CREATE, &inmsg->hdr, rc,
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 63/69] staging: unisys: fix CamelCase parameter msgHdr in controlvm functions

2015-03-16 Thread Benjamin Romer
Fix the CamelCase parameter name

msgHdr => msg_hdr

In all of the controlvm functions in visorchipset_main.c. Update all references
to use the corrected name.

Signed-off-by: Benjamin Romer 
---
 .../unisys/visorchipset/visorchipset_main.c| 24 +++---
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 6427bad..8ca73b6 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -333,13 +333,13 @@ static struct platform_device 
visorchipset_platform_device = {
 };
 
 /* Function prototypes */
-static void controlvm_respond(struct controlvm_message_header *msgHdr,
+static void controlvm_respond(struct controlvm_message_header *msg_hdr,
  int response);
 static void controlvm_respond_chipset_init(
-   struct controlvm_message_header *msgHdr, int response,
+   struct controlvm_message_header *msg_hdr, int response,
enum ultra_chipset_feature features);
 static void controlvm_respond_physdev_changestate(
-   struct controlvm_message_header *msgHdr, int response,
+   struct controlvm_message_header *msg_hdr, int response,
struct spar_segment_state state);
 
 static ssize_t toolaction_show(struct device *dev,
@@ -645,10 +645,10 @@ cleanup:
 
 static void
 controlvm_init_response(struct controlvm_message *msg,
-   struct controlvm_message_header *msgHdr, int response)
+   struct controlvm_message_header *msg_hdr, int response)
 {
memset(msg, 0, sizeof(struct controlvm_message));
-   memcpy(&msg->hdr, msgHdr, sizeof(struct controlvm_message_header));
+   memcpy(&msg->hdr, msg_hdr, sizeof(struct controlvm_message_header));
msg->hdr.payload_bytes = 0;
msg->hdr.payload_vm_offset = 0;
msg->hdr.payload_max_bytes = 0;
@@ -659,14 +659,14 @@ controlvm_init_response(struct controlvm_message *msg,
 }
 
 static void
-controlvm_respond(struct controlvm_message_header *msgHdr, int response)
+controlvm_respond(struct controlvm_message_header *msg_hdr, int response)
 {
struct controlvm_message outmsg;
 
-   controlvm_init_response(&outmsg, msgHdr, response);
+   controlvm_init_response(&outmsg, msg_hdr, response);
/* For DiagPool channel DEVICE_CHANGESTATE, we need to send
* back the deviceChangeState structure in the packet. */
-   if (msgHdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
+   if (msg_hdr->id == CONTROLVM_DEVICE_CHANGESTATE &&
g_devicechangestate_packet.device_change_state.bus_no ==
g_diagpool_bus_no &&
g_devicechangestate_packet.device_change_state.dev_no ==
@@ -682,13 +682,13 @@ controlvm_respond(struct controlvm_message_header 
*msgHdr, int response)
 }
 
 static void
-controlvm_respond_chipset_init(struct controlvm_message_header *msgHdr,
+controlvm_respond_chipset_init(struct controlvm_message_header *msg_hdr,
   int response,
   enum ultra_chipset_feature features)
 {
struct controlvm_message outmsg;
 
-   controlvm_init_response(&outmsg, msgHdr, response);
+   controlvm_init_response(&outmsg, msg_hdr, response);
outmsg.cmd.init_chipset.features = features;
if (!visorchannel_signalinsert(controlvm_channel,
   CONTROLVM_QUEUE_REQUEST, &outmsg)) {
@@ -697,12 +697,12 @@ controlvm_respond_chipset_init(struct 
controlvm_message_header *msgHdr,
 }
 
 static void controlvm_respond_physdev_changestate(
-   struct controlvm_message_header *msgHdr, int response,
+   struct controlvm_message_header *msg_hdr, int response,
struct spar_segment_state state)
 {
struct controlvm_message outmsg;
 
-   controlvm_init_response(&outmsg, msgHdr, response);
+   controlvm_init_response(&outmsg, msg_hdr, response);
outmsg.cmd.device_change_state.state = state;
outmsg.cmd.device_change_state.flags.phys_device = 1;
if (!visorchannel_signalinsert(controlvm_channel,
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 44/69] staging: unisys: fix NULL comparison in destroy_controlvm_payload_info()

2015-03-16 Thread Benjamin Romer
Just remove the NULL from the check and test the pointer directly.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 7956ae71..0f791fb 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1299,7 +1299,7 @@ cleanup:
 static void
 destroy_controlvm_payload_info(struct controlvm_payload_info *info)
 {
-   if (info->ptr != NULL) {
+   if (info->ptr) {
iounmap(info->ptr);
info->ptr = NULL;
}
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 37/69] staging: unisys: refactor bus_create()

2015-03-16 Thread Benjamin Romer
First, fix all CamelCase names:

busNo => bus_no
pBusInfo => bus_info
Away => cleanup

Fix the kzalloc() call so it uses the variable name rather than the
type, and update all of the references to the renamed variables and
labels.

Signed-off-by: Benjamin Romer 
---
 .../unisys/visorchipset/visorchipset_main.c| 51 +++---
 1 file changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index c1bcc4af..e8795ac 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1028,50 +1028,49 @@ static void
 bus_create(struct controlvm_message *inmsg)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
-   ulong busNo = cmd->create_bus.bus_no;
+   ulong bus_no = cmd->create_bus.bus_no;
int rc = CONTROLVM_RESP_SUCCESS;
-   struct visorchipset_bus_info *pBusInfo = NULL;
-
+   struct visorchipset_bus_info *bus_info = NULL;
 
-   pBusInfo = findbus(&bus_info_list, busNo);
-   if (pBusInfo && (pBusInfo->state.created == 1)) {
-   POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
+   bus_info = findbus(&bus_info_list, bus_no);
+   if (bus_info && (bus_info->state.created == 1)) {
+   POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus_no,
 POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_ALREADY_DONE;
-   goto Away;
+   goto cleanup;
}
-   pBusInfo = kzalloc(sizeof(struct visorchipset_bus_info), GFP_KERNEL);
-   if (!pBusInfo) {
-   POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo,
+   bus_info = kzalloc(sizeof(*bus_info), GFP_KERNEL);
+   if (!bus_info) {
+   POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus_no,
 POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
-   goto Away;
+   goto cleanup;
}
 
-   INIT_LIST_HEAD(&pBusInfo->entry);
-   pBusInfo->bus_no = busNo;
-   pBusInfo->dev_no = cmd->create_bus.dev_count;
+   INIT_LIST_HEAD(&bus_info->entry);
+   bus_info->bus_no = bus_no;
+   bus_info->dev_no = cmd->create_bus.dev_count;
 
-   POSTCODE_LINUX_3(BUS_CREATE_ENTRY_PC, busNo, POSTCODE_SEVERITY_INFO);
+   POSTCODE_LINUX_3(BUS_CREATE_ENTRY_PC, bus_no, POSTCODE_SEVERITY_INFO);
 
if (inmsg->hdr.flags.test_message == 1)
-   pBusInfo->chan_info.addr_type = ADDRTYPE_LOCALTEST;
+   bus_info->chan_info.addr_type = ADDRTYPE_LOCALTEST;
else
-   pBusInfo->chan_info.addr_type = ADDRTYPE_LOCALPHYSICAL;
+   bus_info->chan_info.addr_type = ADDRTYPE_LOCALPHYSICAL;
 
-   pBusInfo->flags.server = inmsg->hdr.flags.server;
-   pBusInfo->chan_info.channel_addr = cmd->create_bus.channel_addr;
-   pBusInfo->chan_info.n_channel_bytes = cmd->create_bus.channel_bytes;
-   pBusInfo->chan_info.channel_type_uuid =
+   bus_info->flags.server = inmsg->hdr.flags.server;
+   bus_info->chan_info.channel_addr = cmd->create_bus.channel_addr;
+   bus_info->chan_info.n_channel_bytes = cmd->create_bus.channel_bytes;
+   bus_info->chan_info.channel_type_uuid =
cmd->create_bus.bus_data_type_uuid;
-   pBusInfo->chan_info.channel_inst_uuid = cmd->create_bus.bus_inst_uuid;
+   bus_info->chan_info.channel_inst_uuid = cmd->create_bus.bus_inst_uuid;
 
-   list_add(&pBusInfo->entry, &bus_info_list);
+   list_add(&bus_info->entry, &bus_info_list);
 
-   POSTCODE_LINUX_3(BUS_CREATE_EXIT_PC, busNo, POSTCODE_SEVERITY_INFO);
+   POSTCODE_LINUX_3(BUS_CREATE_EXIT_PC, bus_no, POSTCODE_SEVERITY_INFO);
 
-Away:
-   bus_epilog(busNo, CONTROLVM_BUS_CREATE, &inmsg->hdr,
+cleanup:
+   bus_epilog(bus_no, CONTROLVM_BUS_CREATE, &inmsg->hdr,
   rc, inmsg->hdr.flags.response_expected == 1);
 }
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 50/69] staging: unisys: fix CamelCase in setup_crash_devices_work_queue()

2015-03-16 Thread Benjamin Romer
Fix CamelCase names:

localCrashCreateBusMsg => local_crash_bus_msg
localCrashCreateDevMsg => local_crash_dev_msg
localSavedCrashMsgOffset => local_crash_msg_offset
localSavedCrashMsgCount => local_crash_msg_count
Away => cleanup

Update all references to use the fixed names.

Signed-off-by: Benjamin Romer 
---
 .../unisys/visorchipset/visorchipset_main.c| 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 4a25630..275a0a3 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1849,21 +1849,21 @@ cleanup:
 static void
 setup_crash_devices_work_queue(struct work_struct *work)
 {
-   struct controlvm_message localCrashCreateBusMsg;
-   struct controlvm_message localCrashCreateDevMsg;
+   struct controlvm_message local_crash_bus_msg;
+   struct controlvm_message local_crash_dev_msg;
struct controlvm_message msg;
-   u32 localSavedCrashMsgOffset;
-   u16 localSavedCrashMsgCount;
+   u32 local_crash_msg_offset;
+   u16 local_crash_msg_count;
 
/* make sure visorbus server is registered for controlvm callbacks */
if (visorchipset_serverregwait && !serverregistered)
-   goto Away;
+   goto cleanup;
 
/* make sure visorclientbus server is regsitered for controlvm
 * callbacks
 */
if (visorchipset_clientregwait && !clientregistered)
-   goto Away;
+   goto cleanup;
 
POSTCODE_LINUX_2(CRASH_DEV_ENTRY_PC, POSTCODE_SEVERITY_INFO);
 
@@ -1878,15 +1878,15 @@ setup_crash_devices_work_queue(struct work_struct *work)
if (visorchannel_read(controlvm_channel,
  offsetof(struct spar_controlvm_channel_protocol,
   saved_crash_message_count),
- &localSavedCrashMsgCount, sizeof(u16)) < 0) {
+ &local_crash_msg_count, sizeof(u16)) < 0) {
POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
return;
}
 
-   if (localSavedCrashMsgCount != CONTROLVM_CRASHMSG_MAX) {
+   if (local_crash_msg_count != CONTROLVM_CRASHMSG_MAX) {
POSTCODE_LINUX_3(CRASH_DEV_COUNT_FAILURE_PC,
-localSavedCrashMsgCount,
+local_crash_msg_count,
 POSTCODE_SEVERITY_ERR);
return;
}
@@ -1895,7 +1895,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
if (visorchannel_read(controlvm_channel,
  offsetof(struct spar_controlvm_channel_protocol,
   saved_crash_message_offset),
- &localSavedCrashMsgOffset, sizeof(u32)) < 0) {
+ &local_crash_msg_offset, sizeof(u32)) < 0) {
POSTCODE_LINUX_2(CRASH_DEV_CTRL_RD_FAILURE_PC,
 POSTCODE_SEVERITY_ERR);
return;
@@ -1903,8 +1903,8 @@ setup_crash_devices_work_queue(struct work_struct *work)
 
/* read create device message for storage bus offset */
if (visorchannel_read(controlvm_channel,
- localSavedCrashMsgOffset,
- &localCrashCreateBusMsg,
+ local_crash_msg_offset,
+ &local_crash_bus_msg,
  sizeof(struct controlvm_message)) < 0) {
POSTCODE_LINUX_2(CRASH_DEV_RD_BUS_FAIULRE_PC,
 POSTCODE_SEVERITY_ERR);
@@ -1913,9 +1913,9 @@ setup_crash_devices_work_queue(struct work_struct *work)
 
/* read create device message for storage device */
if (visorchannel_read(controlvm_channel,
- localSavedCrashMsgOffset +
+ local_crash_msg_offset +
  sizeof(struct controlvm_message),
- &localCrashCreateDevMsg,
+ &local_crash_dev_msg,
  sizeof(struct controlvm_message)) < 0) {
POSTCODE_LINUX_2(CRASH_DEV_RD_DEV_FAIULRE_PC,
 POSTCODE_SEVERITY_ERR);
@@ -1923,8 +1923,8 @@ setup_crash_devices_work_queue(struct work_struct *work)
}
 
/* reuse IOVM create bus message */
-   if (localCrashCreateBusMsg.cmd.create_bus.channel_addr != 0) {
-   bus_create(&localCrashCreateBusMsg);
+   if (local_crash_bus_msg.cmd.create_bus.channel_addr != 0) {
+ 

[PATCH 48/69] staging: unisys: refactor handle_command()

2015-03-16 Thread Benjamin Romer
First, fix the CamelCase local variable names:

parametersAddr => parm_addr
parametersBytes => parm_bytes
isLocalAddr => local_addr

Change the type of local_addr to bool instead of using the #defined
type. Update all references to use the fixed names. Fix the indentation of that
line that's over the 80 column limit.

Signed-off-by: Benjamin Romer 
---
 .../unisys/visorchipset/visorchipset_main.c| 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 1056831..7f1dec7 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1645,34 +1645,34 @@ static BOOL
 handle_command(struct controlvm_message inmsg, HOSTADDRESS channel_addr)
 {
struct controlvm_message_packet *cmd = &inmsg.cmd;
-   u64 parametersAddr = 0;
-   u32 parametersBytes = 0;
+   u64 parm_addr = 0;
+   u32 parm_bytes = 0;
struct parser_context *parser_ctx = NULL;
-   BOOL isLocalAddr = FALSE;
+   bool local_addr = false;
struct controlvm_message ackmsg;
 
/* create parsing context if necessary */
-   isLocalAddr = (inmsg.hdr.flags.test_message == 1);
+   local_addr = (inmsg.hdr.flags.test_message == 1);
if (channel_addr == 0)
return TRUE;
-   parametersAddr = channel_addr + inmsg.hdr.payload_vm_offset;
-   parametersBytes = inmsg.hdr.payload_bytes;
+   parm_addr = channel_addr + inmsg.hdr.payload_vm_offset;
+   parm_bytes = inmsg.hdr.payload_bytes;
 
/* Parameter and channel addresses within test messages actually lie
 * within our OS-controlled memory.  We need to know that, because it
 * makes a difference in how we compute the virtual address.
 */
-   if (parametersAddr != 0 && parametersBytes != 0) {
+   if (parm_addr != 0 && parm_bytes != 0) {
BOOL retry = FALSE;
 
parser_ctx =
-   parser_init_byte_stream(parametersAddr, parametersBytes,
-  isLocalAddr, &retry);
+   parser_init_byte_stream(parm_addr, parm_bytes,
+   local_addr, &retry);
if (!parser_ctx && retry)
return FALSE;
}
 
-   if (!isLocalAddr) {
+   if (!local_addr) {
controlvm_init_response(&ackmsg, &inmsg.hdr,
CONTROLVM_RESP_SUCCESS);
if (controlvm_channel)
@@ -1728,7 +1728,7 @@ handle_command(struct controlvm_message inmsg, 
HOSTADDRESS channel_addr)
default:
if (inmsg.hdr.flags.response_expected)
controlvm_respond(&inmsg.hdr,
- 
-CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN);
+   -CONTROLVM_RESP_ERROR_MESSAGE_ID_UNKNOWN);
break;
}
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 52/69] staging: unisys: fix NULL pointer comparisons in uislib.c

2015-03-16 Thread Benjamin Romer
Change pointer comparisons to NULL to just use the pointer directly.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/uislib/uislib.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/uislib/uislib.c 
b/drivers/staging/unisys/uislib/uislib.c
index 4318f06..e150bbd 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -281,7 +281,7 @@ destroy_bus(struct controlvm_message *msg, char *buf)
 
/* verify that this bus has no devices. */
for (i = 0; i < bus->device_count; i++) {
-   if (bus->device[i] != NULL) {
+   if (bus->device[i]) {
read_unlock(&bus_list_lock);
return CONTROLVM_RESP_ERROR_BUS_DEVICE_ATTACHED;
}
@@ -969,7 +969,7 @@ uislib_cache_alloc(struct kmem_cache *cur_pool, char *fn, 
int ln)
*/
void *p = kmem_cache_alloc(cur_pool, GFP_ATOMIC | __GFP_NORETRY);
 
-   if (p == NULL)
+   if (!p)
return NULL;
return p;
 }
@@ -978,7 +978,7 @@ EXPORT_SYMBOL_GPL(uislib_cache_alloc);
 void
 uislib_cache_free(struct kmem_cache *cur_pool, void *p, char *fn, int ln)
 {
-   if (p == NULL)
+   if (!p)
return;
kmem_cache_free(cur_pool, p);
 }
@@ -1057,10 +1057,10 @@ static ssize_t info_debugfs_read(struct file *file, 
char __user *buf,
int remaining_bytes = PROC_READ_BUFFER_SIZE;
 
 /* *start = buf; */
-   if (debug_buf == NULL) {
+   if (!debug_buf) {
debug_buf = vmalloc(PROC_READ_BUFFER_SIZE);
 
-   if (debug_buf == NULL)
+   if (!debug_buf)
return -ENOMEM;
}
 
@@ -1163,7 +1163,7 @@ static int process_incoming(void *v)
* Reschedule work to occur as soon as
* possible. */
idle_cycles = 0;
-   if (new_tail == NULL) {
+   if (!new_tail) {
dev->first_busy_cnt++;
if (!
(list_is_last
@@ -1179,7 +1179,7 @@ static int process_incoming(void *v)
if (kthread_should_stop())
break;
}
-   if (new_tail != NULL) {
+   if (new_tail) {
tot_moved_to_tail_cnt++;
list_move_tail(new_tail, &poll_dev_chan);
}
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 41/69] staging: unisys: refactor my_device_changestate()

2015-03-16 Thread Benjamin Romer
Fix the CamelCase names:

busNo => bus_no
devNo => dev_no
pDevInfo => dev_info

Update all references to use the new names, and remove the goto and
label entirely.

Signed-off-by: Benjamin Romer 
---
 .../unisys/visorchipset/visorchipset_main.c| 27 ++
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 603afed..9327837 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1207,31 +1207,28 @@ static void
 my_device_changestate(struct controlvm_message *inmsg)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
-   ulong busNo = cmd->device_change_state.bus_no;
-   ulong devNo = cmd->device_change_state.dev_no;
+   ulong bus_no = cmd->device_change_state.bus_no;
+   ulong dev_no = cmd->device_change_state.dev_no;
struct spar_segment_state state = cmd->device_change_state.state;
-   struct visorchipset_device_info *pDevInfo = NULL;
+   struct visorchipset_device_info *dev_info = NULL;
int rc = CONTROLVM_RESP_SUCCESS;
 
-   pDevInfo = finddevice(&dev_info_list, busNo, devNo);
-   if (!pDevInfo) {
-   POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo,
+   dev_info = finddevice(&dev_info_list, bus_no, dev_no);
+   if (!dev_info) {
+   POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
 POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
-   goto Away;
-   }
-   if (pDevInfo->state.created == 0) {
-   POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, devNo, busNo,
+   } else if (dev_info->state.created == 0) {
+   POSTCODE_LINUX_4(DEVICE_CHANGESTATE_FAILURE_PC, dev_no, bus_no,
 POSTCODE_SEVERITY_ERR);
rc = -CONTROLVM_RESP_ERROR_DEVICE_INVALID;
}
-Away:
-   if ((rc >= CONTROLVM_RESP_SUCCESS) && pDevInfo)
-   device_epilog(busNo, devNo, state, CONTROLVM_DEVICE_CHANGESTATE,
- &inmsg->hdr, rc,
+   if ((rc >= CONTROLVM_RESP_SUCCESS) && dev_info)
+   device_epilog(bus_no, dev_no, state,
+ CONTROLVM_DEVICE_CHANGESTATE, &inmsg->hdr, rc,
  inmsg->hdr.flags.response_expected == 1,
  FOR_VISORBUS(
-   pDevInfo->chan_info.channel_type_uuid));
+   dev_info->chan_info.channel_type_uuid));
 }
 
 static void
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 69/69] staging: unisys: fix parenthesis alignment in visorchipset_main.c

2015-03-16 Thread Benjamin Romer
Fix as many parenthesis alignment problems in this file as possible.

In cases where there was no good way to align to the leading parenthesis, the
content of the parenthesis were aligned as if there were no limit, and then the
leading indentation was moved back to one tab in from the previous line.

Signed-off-by: Benjamin Romer 
---
 .../unisys/visorchipset/visorchipset_main.c| 117 +++--
 1 file changed, 64 insertions(+), 53 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index ec48132..9c8605d 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -242,45 +242,51 @@ static dev_t major_dev = -1; /**< indicates major num for 
device */
 
 /* prototypes for attributes */
 static ssize_t toolaction_show(struct device *dev,
-   struct device_attribute *attr, char *buf);
+  struct device_attribute *attr, char *buf);
 static ssize_t toolaction_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+   struct device_attribute *attr,
+   const char *buf, size_t count);
 static DEVICE_ATTR_RW(toolaction);
 
 static ssize_t boottotool_show(struct device *dev,
-   struct device_attribute *attr, char *buf);
+  struct device_attribute *attr, char *buf);
 static ssize_t boottotool_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+   struct device_attribute *attr, const char *buf,
+   size_t count);
 static DEVICE_ATTR_RW(boottotool);
 
 static ssize_t error_show(struct device *dev, struct device_attribute *attr,
-   char *buf);
+ char *buf);
 static ssize_t error_store(struct device *dev, struct device_attribute *attr,
-   const char *buf, size_t count);
+  const char *buf, size_t count);
 static DEVICE_ATTR_RW(error);
 
 static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
-   char *buf);
+  char *buf);
 static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
-   const char *buf, size_t count);
+   const char *buf, size_t count);
 static DEVICE_ATTR_RW(textid);
 
 static ssize_t remaining_steps_show(struct device *dev,
-   struct device_attribute *attr, char *buf);
+   struct device_attribute *attr, char *buf);
 static ssize_t remaining_steps_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+struct device_attribute *attr,
+const char *buf, size_t count);
 static DEVICE_ATTR_RW(remaining_steps);
 
 static ssize_t chipsetready_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+ struct device_attribute *attr,
+ const char *buf, size_t count);
 static DEVICE_ATTR_WO(chipsetready);
 
 static ssize_t devicedisabled_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+   struct device_attribute *attr,
+   const char *buf, size_t count);
 static DEVICE_ATTR_WO(devicedisabled);
 
 static ssize_t deviceenabled_store(struct device *dev,
-   struct device_attribute *attr, const char *buf, size_t count);
+  struct device_attribute *attr,
+  const char *buf, size_t count);
 static DEVICE_ATTR_WO(deviceenabled);
 
 static struct attribute *visorchipset_install_attrs[] = {
@@ -350,7 +356,7 @@ static ssize_t toolaction_show(struct device *dev,
 
visorchannel_read(controlvm_channel,
offsetof(struct spar_controlvm_channel_protocol,
-  tool_action), &tool_action, sizeof(u8));
+tool_action), &tool_action, sizeof(u8));
return scnprintf(buf, PAGE_SIZE, "%u\n", tool_action);
 }
 
@@ -365,7 +371,8 @@ static ssize_t toolaction_store(struct device *dev,
return -EINVAL;
 
ret = visorchannel_write(controlvm_channel,
-   offsetof(struct spar_controlvm_channel_protocol, tool_action),
+   offsetof(struct spar_controlvm_channel_protocol,
+tool_action),
&tool_action, sizeof(u8));
 
if (ret)
@@ -380,11 +387,11 @@ static ssize_t boottotool_show(struct device *dev,
struct efi_spar_indication efi_spar_indication;
 
visorchannel_read(controlvm_channel,
- 

[PATCH 66/69] staging: unisys: fix CamelCase variables in boottotool functions

2015-03-16 Thread Benjamin Romer
Rename the local CamelCase variable

efiSparIndication => efi_spar_indication

Update all references to use the corrected name.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index c5eecce..b59988d 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -377,14 +377,14 @@ static ssize_t boottotool_show(struct device *dev,
   struct device_attribute *attr,
   char *buf)
 {
-   struct efi_spar_indication efiSparIndication;
+   struct efi_spar_indication efi_spar_indication;
 
visorchannel_read(controlvm_channel,
offsetof(struct spar_controlvm_channel_protocol,
-   efi_spar_ind), &efiSparIndication,
+   efi_spar_ind), &efi_spar_indication,
sizeof(struct efi_spar_indication));
return scnprintf(buf, PAGE_SIZE, "%u\n",
-   efiSparIndication.boot_to_tool);
+   efi_spar_indication.boot_to_tool);
 }
 
 static ssize_t boottotool_store(struct device *dev,
@@ -392,16 +392,16 @@ static ssize_t boottotool_store(struct device *dev,
const char *buf, size_t count)
 {
int val, ret;
-   struct efi_spar_indication efiSparIndication;
+   struct efi_spar_indication efi_spar_indication;
 
if (kstrtoint(buf, 10, &val) != 0)
return -EINVAL;
 
-   efiSparIndication.boot_to_tool = val;
+   efi_spar_indication.boot_to_tool = val;
ret = visorchannel_write(controlvm_channel,
offsetof(struct spar_controlvm_channel_protocol,
efi_spar_ind),
-   &(efiSparIndication),
+   &(efi_spar_indication),
sizeof(struct efi_spar_indication));
 
if (ret)
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 26/69] staging: unisys: remove extra blank lines in visorchipset_main.c

2015-03-16 Thread Benjamin Romer
Fix up the line spacing around braces in visorchipset_main.c.

Signed-off-by: Benjamin Romer 
---
 drivers/staging/unisys/visorchipset/visorchipset_main.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 6c6804f8..e459672 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -467,7 +467,6 @@ static ssize_t textid_store(struct device *dev, struct 
device_attribute *attr,
return count;
 }
 
-
 static ssize_t remaining_steps_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
@@ -1895,7 +1894,6 @@ Away:
 static void
 setup_crash_devices_work_queue(struct work_struct *work)
 {
-
struct controlvm_message localCrashCreateBusMsg;
struct controlvm_message localCrashCreateDevMsg;
struct controlvm_message msg;
@@ -2024,7 +2022,6 @@ device_destroy_response(ulong busNo, ulong devNo, int 
response)
 void
 visorchipset_device_pause_response(ulong bus_no, ulong dev_no, int response)
 {
-
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
 bus_no, dev_no, response,
 segment_state_standby);
@@ -2268,7 +2265,6 @@ visorchipset_init(void)
 DIAG_SEVERITY_ERR);
goto Away;
}
-
}
 
Visorchipset_platform_device.dev.devt = MajorDev;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/69] staging: unisys: driver code cleanup series

2015-03-16 Thread Benjamin Romer
This set of patches cleans up most of the remaining checkpatch.pl issues in the
unisys tree.

Benjamin Romer (69):
  staging: unisys: clean up NULL comparisons in visorchannel_funcs.c
  staging: unisys: cleanup NULL comparisons in virthba.c
  staging: unisys: fix CamelCase in virthba_probe()
  staging: unisys: fix CamelCase global Poll_jiffies
  staging: unisys: remove unnecessary complication from
delete_vbus_device
  staging: unisys: clean up NULL compares in virtpci.c
  staging: unisys: fix CamelCase variable
Controlvm_Payload_Bytes_Buffered
  staging: unisys: remove typedef for PARSER_CONTEXT
  staging: unisys: refactor parser_init_guts()
  staging: unisys: fix CamelCase names in parser_init()
  staging: unisys: refactor parser_init_byteStream
  staging: unisys: refactor parser_byteStream_get
  staging: unisys: fix CamelCase global Most_recent_message_jiffies
  staging: unisys: fix CamelCase controlvm globals
  staging: unisys: fix CamelCase message header variables
  staging: unisys: fix CamelCase semaphore NotifierLock
  staging: unisys: fix CamelCase name
  staging: unisys: fix CamelCased diagpool bus/dev names
  staging: unisys: fix CamelCase name for devicechangestate packet
  staging: unisys: fix CamelCase list names
  staging: unisys: fix placement of logical ops in visorchipset_main.c
  staging: unisys: fix CamelCase channel name ControlVm_channel
  staging: unisys: get rid of Test_Vnic_channel
  staging: unisys: fix CamelCase global ControlVm_payload_info
  staging: unisys: refactor livedump_info structure
  staging: unisys: remove extra blank lines in visorchipset_main.c
  staging: unisys: remove old code block in visorchipset_main.c
  staging: unisys: fix CamelCase-named clearing functions
  staging: unisys: remove obsolete proc entry code
  staging: unisys: fix all NULL comparisons in visorchipset_main.c
  staging: unisys: fix Camelcase Away goto label
  staging: unisys: fix CamelCase locals in visorchipset_save_message
  staging: unisys: fix CamelCase params in responder functions
  staging: unisys: fix CamelCase in epilog functions
  staging: unisys: fix spaces after typecasts in visorchipset_main.c
  staging: unisys: fix braces in visorchipset_main.c
  staging: unisys: refactor bus_create()
  staging: unisys: refactor bus_destroy()
  staging: unisys: refactor bus_configure()
  staging: unisys: refactor my_device_create()
  staging: unisys: refactor my_device_changestate()
  staging: unisys: refactor my_device_destroy()
  staging: unisys: refactor initialize_controlvm_payload_info()
  staging: unisys: fix NULL comparison in
destroy_controlvm_payload_info()
  staging: unisys: fix Camelcase in initialize_controlvm_payload()
  staging: unisys: refactor parahotplug_process_list()
  staging: unisys: fix spacing in parahotplug_request_create
  staging: unisys: refactor handle_command()
  staging: unisys: refactor controlvm_periodic_work()
  staging: unisys: fix CamelCase in setup_crash_devices_work_queue()
  staging: unisys: fix CamelCase label in visorchipset_init()
  staging: unisys: fix NULL pointer comparisons in uislib.c
  staging: unisys: remove unnecessary brackets in uislib.c
  staging: unisys: remove last remnants of proc entry code
  staging: unisys: fix CamelCased ControlVM globals
  staging: unisys: fix CamelCase in putfile-related globals
  staging: unisys: fix CamelCase global
Visorchipset_cache_buffers_in_use
  staging: unisys: fix CamelCased Parahotplug globals
  staging: unisys: fix CamelCased notifier globals
  staging: unisys: fix CamelCase in responders functions
  staging: unisys: fix CamelCased global MajorDev
  staging: unisys: fix CamelCase global Visorchipset_platform_device
  staging: unisys: fix CamelCase parameter msgHdr in controlvm functions
  staging: unisys: fix CamelCase parameter in chipset functions
  staging: unisys: fix CamelCase local toolAction
  staging: unisys: fix CamelCase variables in boottotool functions
  staging: unisys: fix CamelCase local in textid functions
  staging: unisys: Fix CamelCase local variable in remaining_steps
functions
  staging: unisys: fix parenthesis alignment in visorchipset_main.c

 drivers/staging/unisys/uislib/uislib.c |   32 +-
 drivers/staging/unisys/virthba/virthba.c   |   36 +-
 drivers/staging/unisys/virtpci/virtpci.c   |   12 +-
 .../unisys/visorchannel/visorchannel_funcs.c   |   23 +-
 drivers/staging/unisys/visorchipset/parser.c   |   95 +-
 drivers/staging/unisys/visorchipset/parser.h   |   24 +-
 drivers/staging/unisys/visorchipset/visorchipset.h |1 -
 .../unisys/visorchipset/visorchipset_main.c| 1206 ++--
 drivers/staging/unisys/visorutil/Makefile  |3 +-
 drivers/staging/unisys/visorutil/easyproc.c|  356 --
 drivers/staging/unisys/visorutil/easyproc.h|   92 --
 drivers/staging/unisys/visorutil/procobjecttree.c  |  335 --
 12 files changed, 688 insertions(+), 1527 deletions(-)
 delete mode

<    1   2   3   4   5   6   7   8   9   10   >