Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8806b6c authored by Narsimhulu Musini's avatar Narsimhulu Musini Committed by James Bottomley
Browse files

snic: driver for Cisco SCSI HBA



Cisco has developed a new PCI HBA interface called sNIC, which stands for
SCSI NIC. This is a new storage feature supported on specialized network
adapter. The new PCI function provides a uniform host interface and abstracts
backend storage.

[jejb: fix up checkpatch errors]
Signed-off-by: default avatarNarsimhulu Musini <nmusini@cisco.com>
Signed-off-by: default avatarSesidhar Baddela <sebaddel@cisco.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 8d2b21db
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2590,6 +2590,13 @@ L: linux-scsi@vger.kernel.org
S:	Supported
F:	drivers/scsi/fnic/

CISCO SCSI HBA DRIVER
M:	Narsimhulu Musini <nmusini@cisco.com>
M:	Sesidhar Baddela <sebaddel@cisco.com>
L:	linux-scsi@vger.kernel.org
S:	Supported
F:	drivers/scsi/snic/

CMPC ACPI DRIVER
M:	Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
M:	Daniel Oliveira Nascimento <don@syst.com.br>
+17 −0
Original line number Diff line number Diff line
@@ -634,6 +634,23 @@ config FCOE_FNIC
	  <file:Documentation/scsi/scsi.txt>.
	  The module will be called fnic.

config SCSI_SNIC
	tristate "Cisco SNIC Driver"
	depends on PCI && SCSI
	help
	  This is support for the Cisco PCI-Express SCSI HBA.

	  To compile this driver as a module, choose M here and read
	  <file:Documentation/scsi/scsi.txt>.
	  The module will be called snic.

config SCSI_SNIC_DEBUG_FS
	bool "Cisco SNIC Driver Debugfs Support"
	depends on SCSI_SNIC && DEBUG_FS
	help
	  This enables to list debugging information from SNIC Driver
	  available via debugfs file system

config SCSI_DMX3191D
	tristate "DMX3191D SCSI support"
	depends on PCI && SCSI
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ obj-$(CONFIG_LIBFC) += libfc/
obj-$(CONFIG_LIBFCOE)		+= fcoe/
obj-$(CONFIG_FCOE)		+= fcoe/
obj-$(CONFIG_FCOE_FNIC)		+= fnic/
obj-$(CONFIG_SCSI_SNIC)		+= snic/
obj-$(CONFIG_SCSI_BNX2X_FCOE)	+= libfc/ fcoe/ bnx2fc/
obj-$(CONFIG_ISCSI_TCP) 	+= libiscsi.o	libiscsi_tcp.o iscsi_tcp.o
obj-$(CONFIG_INFINIBAND_ISER) 	+= libiscsi.o
+17 −0
Original line number Diff line number Diff line
obj-$(CONFIG_SCSI_SNIC) += snic.o

snic-y := \
	snic_attrs.o \
	snic_main.o \
	snic_res.o \
	snic_isr.o \
	snic_ctl.o \
	snic_io.o \
	snic_scsi.o \
	snic_disc.o \
	vnic_cq.o \
	vnic_intr.o \
	vnic_dev.o \
	vnic_wq.o

snic-$(CONFIG_SCSI_SNIC_DEBUG_FS) += snic_debugfs.o snic_trc.o
+77 −0
Original line number Diff line number Diff line
/*
 * Copyright 2014 Cisco Systems, Inc.  All rights reserved.
 *
 * This program is free software; you may redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#ifndef _CQ_DESC_H_
#define _CQ_DESC_H_

/*
 * Completion queue descriptor types
 */
enum cq_desc_types {
	CQ_DESC_TYPE_WQ_ENET = 0,
	CQ_DESC_TYPE_DESC_COPY = 1,
	CQ_DESC_TYPE_WQ_EXCH = 2,
	CQ_DESC_TYPE_RQ_ENET = 3,
	CQ_DESC_TYPE_RQ_FCP = 4,
};

/* Completion queue descriptor: 16B
 *
 * All completion queues have this basic layout.  The
 * type_specific area is unique for each completion
 * queue type.
 */
struct cq_desc {
	__le16 completed_index;
	__le16 q_number;
	u8 type_specific[11];
	u8 type_color;
};

#define CQ_DESC_TYPE_BITS        4
#define CQ_DESC_TYPE_MASK        ((1 << CQ_DESC_TYPE_BITS) - 1)
#define CQ_DESC_COLOR_MASK       1
#define CQ_DESC_COLOR_SHIFT      7
#define CQ_DESC_Q_NUM_BITS       10
#define CQ_DESC_Q_NUM_MASK       ((1 << CQ_DESC_Q_NUM_BITS) - 1)
#define CQ_DESC_COMP_NDX_BITS    12
#define CQ_DESC_COMP_NDX_MASK    ((1 << CQ_DESC_COMP_NDX_BITS) - 1)

static inline void cq_desc_dec(const struct cq_desc *desc_arg,
	u8 *type, u8 *color, u16 *q_number, u16 *completed_index)
{
	const struct cq_desc *desc = desc_arg;
	const u8 type_color = desc->type_color;

	*color = (type_color >> CQ_DESC_COLOR_SHIFT) & CQ_DESC_COLOR_MASK;

	/*
	 * Make sure color bit is read from desc *before* other fields
	 * are read from desc.  Hardware guarantees color bit is last
	 * bit (byte) written.  Adding the rmb() prevents the compiler
	 * and/or CPU from reordering the reads which would potentially
	 * result in reading stale values.
	 */
	rmb();

	*type = type_color & CQ_DESC_TYPE_MASK;
	*q_number = le16_to_cpu(desc->q_number) & CQ_DESC_Q_NUM_MASK;
	*completed_index = le16_to_cpu(desc->completed_index) &
		CQ_DESC_COMP_NDX_MASK;
}

#endif /* _CQ_DESC_H_ */
Loading