[PATCH] staging: unisys: Add s-Par visorhba

Greg KH gregkh at linuxfoundation.org
Wed Jul 15 01:50:06 UTC 2015


On Mon, Jul 13, 2015 at 02:38:23PM -0400, Benjamin Romer wrote:
> From: David Kershner <david.kershner at unisys.com>
> 
> This driver create a host bus adapter device when s-Par sends a
> device create message to create a storage adapter on the visorbus.
> When the message is received by visorbus, the visorhba_probe function
> is called and the hba device is created and managed by the visorhba
> driver.
> 
> Signed-off-by: Erik Arfvidson <erik.arfvidson at unisys.com>
> Signed-off-by: Benjamin Romer <benjamin.romer at unisys.com>
> Signed-off-by: David Kershner <david.kershner at unisys.com>
> ---
>  drivers/staging/unisys/Kconfig                  |    1 +
>  drivers/staging/unisys/Makefile                 |    1 +
>  drivers/staging/unisys/include/iochannel.h      |    4 +
>  drivers/staging/unisys/visorhba/Kconfig         |   14 +
>  drivers/staging/unisys/visorhba/Makefile        |   10 +
>  drivers/staging/unisys/visorhba/visorhba_main.c | 1372 +++++++++++++++++++++++
>  6 files changed, 1402 insertions(+)
>  create mode 100644 drivers/staging/unisys/visorhba/Kconfig
>  create mode 100644 drivers/staging/unisys/visorhba/Makefile
>  create mode 100644 drivers/staging/unisys/visorhba/visorhba_main.c
> 
> diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig
> index ca850a8..5cbb791 100644
> --- a/drivers/staging/unisys/Kconfig
> +++ b/drivers/staging/unisys/Kconfig
> @@ -14,5 +14,6 @@ if UNISYSSPAR
>  source "drivers/staging/unisys/visorbus/Kconfig"
>  source "drivers/staging/unisys/visornic/Kconfig"
>  source "drivers/staging/unisys/visorhid/Kconfig"
> +source "drivers/staging/unisys/visorhba/Kconfig"
>  
>  endif # UNISYSSPAR
> diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile
> index d071094..79c9036 100644
> --- a/drivers/staging/unisys/Makefile
> +++ b/drivers/staging/unisys/Makefile
> @@ -4,3 +4,4 @@
>  obj-$(CONFIG_UNISYS_VISORBUS)		+= visorbus/
>  obj-$(CONFIG_UNISYS_VISORNIC)		+= visornic/
>  obj-$(CONFIG_UNISYS_VISORHID)          += visorhid/
> +obj-$(CONFIG_UNISYS_VISORHBA)		+= visorhba/
> diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h
> index a559812..1cca0fb 100644
> --- a/drivers/staging/unisys/include/iochannel.h
> +++ b/drivers/staging/unisys/include/iochannel.h
> @@ -147,6 +147,10 @@ struct phys_info {
>  	u16 pi_len;
>  } __packed;
>  
> +#define MIN_NUMSIGNALS 64
> +
> +/* structs with pragma pack  */
> +
>  struct guest_phys_info {
>  	u64 address;
>  	u64 length;
> diff --git a/drivers/staging/unisys/visorhba/Kconfig b/drivers/staging/unisys/visorhba/Kconfig
> new file mode 100644
> index 0000000..241d803
> --- /dev/null
> +++ b/drivers/staging/unisys/visorhba/Kconfig
> @@ -0,0 +1,14 @@
> +#
> +# Unisys visorhba configuration
> +#
> +
> +config UNISYS_VISORHBA
> +	tristate "Unisys visorhba driver"
> +	depends on UNISYSSPAR && UNISYS_VISORBUS && SCSI
> +	---help---
> +	The Unisys visorhba driver provides support for s-Par HBA
> +	devices exposed on the s-Par visorbus. When a message is sent
> +	to visorbus to create a HBA device, the probe function of
> +	visorhba is called to create the scsi device.
> +	If you say Y here, you will enable the Unisys visorhba driver.
> +
> diff --git a/drivers/staging/unisys/visorhba/Makefile b/drivers/staging/unisys/visorhba/Makefile
> new file mode 100644
> index 0000000..a8a8e0e
> --- /dev/null
> +++ b/drivers/staging/unisys/visorhba/Makefile
> @@ -0,0 +1,10 @@
> +#
> +# Makefile for Unisys channel
> +#
> +
> +obj-$(CONFIG_UNISYS_VISORHBA)	+= visorhba.o
> +
> +visorhba-y := visorhba_main.o
> +
> +ccflags-y += -Idrivers/staging/unisys/include
> +
> diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c
> new file mode 100644
> index 0000000..04fe110
> --- /dev/null
> +++ b/drivers/staging/unisys/visorhba/visorhba_main.c
> @@ -0,0 +1,1372 @@
> +/* Copyright (c) 2012 - 2015 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 <linux/debugfs.h>
> +#include <linux/skbuff.h>
> +#include <linux/kthread.h>
> +#include <scsi/scsi.h>
> +#include <scsi/scsi_host.h>
> +#include <scsi/scsi_cmnd.h>
> +#include <scsi/scsi_device.h>
> +
> +#include "visorbus.h"
> +#include "iochannel.h"
> +
> +#define VERSION "1.0.0.0"
> +
> +/* The Send and Receive Buffers of the IO Queue may both be full */
> +#define MAX_PENDING_REQUESTS (MIN_NUMSIGNALS * 2)
> +
> +#define VISORHBA_ERROR_COUNT 30
> +#define IOS_ERROR_THRESHOLD 1000
> +
> +#define MAXDEVICES 1024

Same as the other driver, please use an idr or ida structure instead of
rolling your own.

I didn't review anything else here, it seems a lot of comments on the
input driver also are relevant here, so please fix this up and resend
and I'll do a "real" review.

thanks,

greg k-h


More information about the devel mailing list