forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: Narsimhulu Musini <[email protected]> Signed-off-by: Sesidhar Baddela <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: James Bottomley <[email protected]>
- Loading branch information
Narsimhulu Musini
authored and
James Bottomley
committed
Jun 19, 2015
1 parent
8d2b21d
commit c8806b6
Showing
37 changed files
with
10,263 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2590,6 +2590,13 @@ L: [email protected] | |
S: Supported | ||
F: drivers/scsi/fnic/ | ||
|
||
CISCO SCSI HBA DRIVER | ||
M: Narsimhulu Musini <[email protected]> | ||
M: Sesidhar Baddela <[email protected]> | ||
L: [email protected] | ||
S: Supported | ||
F: drivers/scsi/snic/ | ||
|
||
CMPC ACPI DRIVER | ||
M: Thadeu Lima de Souza Cascardo <[email protected]> | ||
M: Daniel Oliveira Nascimento <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* 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_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* 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_ENET_DESC_H_ | ||
#define _CQ_ENET_DESC_H_ | ||
|
||
#include "cq_desc.h" | ||
|
||
/* Ethernet completion queue descriptor: 16B */ | ||
struct cq_enet_wq_desc { | ||
__le16 completed_index; | ||
__le16 q_number; | ||
u8 reserved[11]; | ||
u8 type_color; | ||
}; | ||
|
||
static inline void cq_enet_wq_desc_dec(struct cq_enet_wq_desc *desc, | ||
u8 *type, u8 *color, u16 *q_number, u16 *completed_index) | ||
{ | ||
cq_desc_dec((struct cq_desc *)desc, type, | ||
color, q_number, completed_index); | ||
} | ||
|
||
#endif /* _CQ_ENET_DESC_H_ */ |
Oops, something went wrong.