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

Commit 5df6d737 authored by Abhijeet Joglekar's avatar Abhijeet Joglekar Committed by James Bottomley
Browse files

[SCSI] fnic: Add new Cisco PCI-Express FCoE HBA



fnic is a driver for the Cisco PCI-Express FCoE HBA

Signed-off-by: default avatarAbhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: default avatarJoe Eykholt <jeykholt@cisco.com>
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 210af919
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -1431,6 +1431,14 @@ P: Russell King
M:	linux@arm.linux.org.uk
M:	linux@arm.linux.org.uk
F:	include/linux/clk.h
F:	include/linux/clk.h


CISCO FCOE HBA DRIVER
P:	Abhijeet Joglekar
M:	abjoglek@cisco.com
P:	Joe Eykholt
M:	jeykholt@cisco.com
L:	linux-scsi@vger.kernel.org
S:	Supported

CODA FILE SYSTEM
CODA FILE SYSTEM
P:	Jan Harkes
P:	Jan Harkes
M:	jaharkes@cs.cmu.edu
M:	jaharkes@cs.cmu.edu
+11 −0
Original line number Original line Diff line number Diff line
@@ -628,6 +628,17 @@ config FCOE
	---help---
	---help---
	  Fibre Channel over Ethernet module
	  Fibre Channel over Ethernet module


config FCOE_FNIC
	tristate "Cisco FNIC Driver"
	depends on PCI && X86
	select LIBFC
	help
	  This is support for the Cisco PCI-Express FCoE HBA.

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

config SCSI_DMX3191D
config SCSI_DMX3191D
	tristate "DMX3191D SCSI support"
	tristate "DMX3191D SCSI support"
	depends on PCI && SCSI
	depends on PCI && SCSI
+1 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@ obj-$(CONFIG_SCSI_DH) += device_handler/
obj-$(CONFIG_LIBFC)		+= libfc/
obj-$(CONFIG_LIBFC)		+= libfc/
obj-$(CONFIG_LIBFCOE)		+= fcoe/
obj-$(CONFIG_LIBFCOE)		+= fcoe/
obj-$(CONFIG_FCOE)		+= fcoe/
obj-$(CONFIG_FCOE)		+= fcoe/
obj-$(CONFIG_FCOE_FNIC)		+= fnic/
obj-$(CONFIG_ISCSI_TCP) 	+= libiscsi.o	libiscsi_tcp.o iscsi_tcp.o
obj-$(CONFIG_ISCSI_TCP) 	+= libiscsi.o	libiscsi_tcp.o iscsi_tcp.o
obj-$(CONFIG_INFINIBAND_ISER) 	+= libiscsi.o
obj-$(CONFIG_INFINIBAND_ISER) 	+= libiscsi.o
obj-$(CONFIG_SCSI_A4000T)	+= 53c700.o	a4000t.o
obj-$(CONFIG_SCSI_A4000T)	+= 53c700.o	a4000t.o
+15 −0
Original line number Original line Diff line number Diff line
obj-$(CONFIG_FCOE_FNIC) += fnic.o

fnic-y	:= \
	fnic_attrs.o \
	fnic_isr.o \
	fnic_main.o \
	fnic_res.o \
	fnic_fcs.o \
	fnic_scsi.o \
	vnic_cq.o \
	vnic_dev.o \
	vnic_intr.o \
	vnic_rq.o \
	vnic_wq_copy.o \
	vnic_wq.o
+78 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright 2008 Cisco Systems, Inc.  All rights reserved.
 * Copyright 2007 Nuova 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_specfic area is unique for each completion
 * queue type.
 */
struct cq_desc {
	__le16 completed_index;
	__le16 q_number;
	u8 type_specfic[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