Commit ba6d10ab authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'scsi-misc' of git://

Pull SCSI updates from James Bottomley:
 "This is mostly update of the usual drivers: qla2xxx, hpsa, lpfc, ufs,
  mpt3sas, ibmvscsi, megaraid_sas, bnx2fc and hisi_sas as well as the
  removal of the osst driver (I heard from Willem privately that he
  would like the driver removed because all his test hardware has
  failed). Plus number of minor changes, spelling fixes and other

  The big merge conflict this time around is the SPDX licence tags.
  Following discussion on linux-next, we believe our version to be more
  accurate than the one in the tree, so the resolution is to take our
  version for all the SPDX conflicts"

Note on the SPDX license tag conversion conflicts: the SCSI tree had
done its own SPDX conversion, which in some cases conflicted with the
treewide ones done by Thomas & co.

In almost all cases, the conflicts were purely syntactic: the SCSI tree
used the old-style SPDX tags ("GPL-2.0" and "GPL-2.0+") while the
treewide conversion had used the new-style ones ("GPL-2.0-only" and

In these cases I picked the new-style one.

In a few cases, the SPDX conversion was actually different, though.  As
explained by James above, and in more detail in a pre-pull-request

 "The other problem is actually substantive: In the libsas code Luben
  Tuikov originally specified gpl 2.0 only by dint of stating:

  * This file is licensed under GPLv2.

  In all the libsas files, but then muddied the water by quoting GPLv2
  verbatim (which includes the or later than language). So for these
  files Christoph did the conversion to v2 only SPDX tags and Thomas
  converted to v2 or later tags"

So in those cases, where the spdx tag substantially mattered, I took the
SCSI tree conversion of it, but then also took the opportunity to turn
the old-style "GPL-2.0" into a new-style "GPL-2.0-only" tag.

Similarly, when there were whitespace differences or other differences
to the comments around the copyright notices, I took the version from
the SCSI tree as being the more specific conversion.

Finally, in the spdx conversions that had no conflicts (because the
treewide ones hadn't been done for those files), I just took the SCSI
tree version as-is, even if it was old-style.  The old-style conversions
are perfectly valid, even if the "-only" and "-or-later" versions are
perhaps more descriptive.

* tag 'scsi-misc' of git:// (185 commits)
  scsi: qla2xxx: move IO flush to the front of NVME rport unregistration
  scsi: qla2xxx: Fix NVME cmd and LS cmd timeout race condition
  scsi: qla2xxx: on session delete, return nvme cmd
  scsi: qla2xxx: Fix kernel crash after disconnecting NVMe devices
  scsi: megaraid_sas: Update driver version to 07.710.06.00-rc1
  scsi: megaraid_sas: Introduce various Aero performance modes
  scsi: megaraid_sas: Use high IOPS queues based on IO workload
  scsi: megaraid_sas: Set affinity for high IOPS reply queues
  scsi: megaraid_sas: Enable coalescing for high IOPS queues
  scsi: megaraid_sas: Add support for High IOPS queues
  scsi: megaraid_sas: Add support for MPI toolbox commands
  scsi: megaraid_sas: Offload Aero RAID5/6 division calculations to driver
  scsi: megaraid_sas: RAID1 PCI bandwidth limit algorithm is applicable for only Ventura
  scsi: megaraid_sas: megaraid_sas: Add check for count returned by HOST_DEVICE_LIST DCMD
  scsi: megaraid_sas: Handle sequence JBOD map failure at driver level
  scsi: megaraid_sas: Don't send FPIO to RL Bypass queue
  scsi: megaraid_sas: In probe context, retry IOC INIT once if firmware is in fault
  scsi: megaraid_sas: Release Mutex lock before OCR in case of DCMD timeout
  scsi: megaraid_sas: Call disable_irq from process IRQ poll
  scsi: megaraid_sas: Remove few debug counters from IO path
parents 64b08df4 baf23edd
README file for the osst driver
(w) Kurt Garloff <> 12/2000
This file describes the osst driver as of version 0.8.x/0.9.x, the released
version of the osst driver.
It is intended to help advanced users to understand the role of osst and to
get them started using (and maybe debugging) it.
It won't address issues like "How do I compile a kernel?" or "How do I load
a module?", as these are too basic.
Once the OnStream got merged into the official kernel, the distro makers
will provide the OnStream support for those who are not familiar with
hacking their kernels.
The osst driver was developed, because the standard SCSI tape driver in
Linux, st, does not support the OnStream SC-x0 SCSI tape. The st is not to
blame for that, as the OnStream tape drives do not support the standard SCSI
command set for Serial Access Storage Devices (SASDs), which basically
corresponds to the QIC-157 spec.
Nevertheless, the OnStream tapes are nice pieces of hardware and therefore
the osst driver has been written to make these tape devs supported by Linux.
The driver is free software. It's released under the GNU GPL and planned to
be integrated into the mainstream kernel.
The osst is a new high-level SCSI driver, just like st, sr, sd and sg. It
can be compiled into the kernel or loaded as a module.
As it represents a new device, it got assigned a new device node: /dev/osstX
are character devices with major no 206 and minor numbers like the /dev/stX
devices. If those are not present, you may create them by calling as root (see below).
The driver started being a copy of st and as such, the osst devices'
behavior looks very much the same as st to the userspace applications.
In the first place, osst shared its identity very much with st. That meant
that it used the same kernel structures and the same device node as st.
So you could only have either of them being present in the kernel. This has
been fixed by registering an own device, now.
st and osst can coexist, each only accessing the devices it can support by
osst got integrated into the linux kernel. Select it during kernel
configuration as module or compile statically into the kernel.
Compile your kernel and install the modules.
Now, your osst driver is inside the kernel or available as a module,
depending on your choice during kernel config. You may still need to create
the device nodes by calling the script (see below) manually.
To load your module, you may use the command
modprobe osst
as root. dmesg should show you, whether your OnStream tapes have been
If you want to have the module autoloaded on access to /dev/osst, you may
add something like
alias char-major-206 osst
to a file under /etc/modprobe.d/ directory.
You may find it convenient to create a symbolic link
ln -s nosst0 /dev/tape
to make programs assuming a default name of /dev/tape more convenient to
The device nodes for osst have to be created. Use the script
attached to this file.
Using it
You may use the OnStream tape driver with your standard backup software,
which may be tar, cpio, amanda, arkeia, BRU, Lone Tar, ...
by specifying /dev/(n)osst0 as the tape device to use or using the above
symlink trick. The IOCTLs to control tape operation are also mostly
supported and you may try the mt (or mt_st) program to jump between
filemarks, eject the tape, ...
There's one limitation: You need to use a block size of 32kB.
(This limitation is worked on and will be fixed in version 0.8.8 of
this driver.)
If you just want to get started with standard software, here is an example
for creating and restoring a full backup:
# Backup
tar cvf - / --exclude /proc | buffer -s 32k -m 24M -B -t -o /dev/nosst0
# Restore
buffer -s 32k -m 8M -B -t -i /dev/osst0 | tar xvf - -C /
The buffer command has been used to buffer the data before it goes to the
tape (or the file system) in order to smooth out the data stream and prevent
the tape from needing to stop and rewind. The OnStream does have an internal
buffer and a variable speed which help this, but especially on writing, the
buffering still proves useful in most cases. It also pads the data to
guarantees the block size of 32k. (Otherwise you may pass the -b64 option to
Expect something like 1.8MB/s for the SC-x0 drives and 0.9MB/s for the DI-30.
The USB drive will give you about 0.7MB/s.
On a fast machine, you may profit from software data compression (z flag for
Via the SCSI emulation layers usb-storage and ide-scsi, you can also use the
osst driver to drive the USB-30 and the DI-30 drives. (Unfortunately, there
is no such layer for the parallel port, otherwise the DP-30 would work as
well.) For the USB support, you need the latest 2.4.0-test kernels and the
latest usb-storage driver from
Note that the ide-tape driver as of 1.16f uses a slightly outdated on-tape
format and therefore is not completely interoperable with osst tapes.
The ADR-x0 line is fully SCSI-2 compliant and is supported by st, not osst.
The on-tape format is supposed to be compatible with the one used by osst.
Feedback and updates
The driver development is coordinated through a mailing list
a CVS repository and some web pages.
The tester's pages which contain recent news and updated drivers to download
can be found on
If you find any problems, please have a look at the tester's page in order
to see whether the problem is already known and solved. Otherwise, please
report it to the mailing list. Your feedback is welcome. (This holds also
for reports of successful usage, of course.)
In case of trouble, please do always provide the following info:
* driver and kernel version used (see syslog)
* driver messages (syslog)
* SCSI config and OnStream Firmware (/proc/scsi/scsi)
* description of error. Is it reproducible?
* software and commands used
You may subscribe to the mailing list, BTW, it's a majordomo list.
0.8.0 was the first widespread BETA release. Since then a lot of reports
have been sent, but mostly reported success or only minor trouble.
All the issues have been addressed.
Check the web pages for more info about the current developments.
0.9.x is the tree for the 2.3/2.4 kernel.
The driver has been started by making a copy of Kai Makisara's st driver.
Most of the development has been done by Willem Riede. The presence of the
userspace program osg (onstreamsg) from Terry Hardie has been rather
helpful. The same holds for Gadi Oxman's ide-tape support for the DI-30.
I did add some patches to those drivers as well and coordinated things a
little bit.
Note that most of them did mostly spend their spare time for the creation of
this driver.
The people from OnStream, especially Jack Bombeeck did support this project
and always tried to answer HW or FW related questions. Furthermore, he
pushed the FW developers to do the right things.
SuSE did support this project by allowing me to work on it during my working
time for them and by integrating the driver into their distro.
More people did help by sending useful comments. Sorry to those who have
been forgotten. Thanks to all the GNU/FSF and Linux developers who made this
platform such an interesting, nice and stable platform.
Thanks go to those who tested the drivers and did send useful reports. Your
help is needed!
# Script to create OnStream SC-x0 device nodes (major 206)
# Usage: [nos [path to dev]]
# $Id: README.osst.kernel,v 1.4 2000/12/20 14:13:15 garloff Exp $
test -z "$1" || nrs=$1
test -z "$2" || dir=$2
declare -i nr
test -d $dir || mkdir -p $dir
while test $nr -lt $nrs; do
mknod $dir/osst$nr c $major $nr
chown 0.disk $dir/osst$nr; chmod 660 $dir/osst$nr;
mknod $dir/nosst$nr c $major $[nr+128]
chown 0.disk $dir/nosst$nr; chmod 660 $dir/nosst$nr;
mknod $dir/osst${nr}l c $major $[nr+32]
chown 0.disk $dir/osst${nr}l; chmod 660 $dir/osst${nr}l;
mknod $dir/nosst${nr}l c $major $[nr+160]
chown 0.disk $dir/nosst${nr}l; chmod 660 $dir/nosst${nr}l;
mknod $dir/osst${nr}m c $major $[nr+64]
chown 0.disk $dir/osst${nr}m; chmod 660 $dir/osst${nr}m;
mknod $dir/nosst${nr}m c $major $[nr+192]
chown 0.disk $dir/nosst${nr}m; chmod 660 $dir/nosst${nr}m;
mknod $dir/osst${nr}a c $major $[nr+96]
chown 0.disk $dir/osst${nr}a; chmod 660 $dir/osst${nr}a;
mknod $dir/nosst${nr}a c $major $[nr+224]
chown 0.disk $dir/nosst${nr}a; chmod 660 $dir/nosst${nr}a;
let nr+=1
......@@ -158,6 +158,13 @@ send SG_IO with the applicable sg_io_v4:
If you wish to read or write a descriptor, use the appropriate xferp of
The userspace tool that interacts with the ufs-bsg endpoint and uses its
upiu-based protocol is available at:
For more detailed information about the tool and its supported
features, please see the tool's README.
UFS Specifications can be found at,
......@@ -11779,16 +11779,6 @@ S: Maintained
F: drivers/mtd/nand/onenand/
F: include/linux/mtd/onenand*.h
M: Willem Riede <>
S: Maintained
F: Documentation/scsi/osst.txt
F: drivers/scsi/osst.*
F: drivers/scsi/osst_*.h
F: drivers/scsi/st.h
M: Jens Wiklander <>
S: Maintained
......@@ -12680,8 +12670,7 @@ S: Orphan
F: drivers/scsi/pmcraid.*
M: Jack Wang <>
M: Jack Wang <>
S: Supported
F: drivers/scsi/pm8001/
......@@ -911,6 +911,10 @@ static const struct resource mac_scsi_iifx_rsrc[] __initconst = {
.start = 0x50008000,
.end = 0x50009FFF,
}, {
.start = 0x50008000,
.end = 0x50009FFF,
......@@ -1012,10 +1016,12 @@ int __init mac_platform_init(void)
/* Addresses from The Guide to Mac Family Hardware.
* $5000 8000 - $5000 9FFF: SCSI DMA
* $5000 A000 - $5000 BFFF: Alternate SCSI
* $5000 C000 - $5000 DFFF: Alternate SCSI (DMA)
* $5000 E000 - $5000 FFFF: Alternate SCSI (Hsk)
* The SCSI DMA custom IC embeds the 53C80 core. mac_scsi does
* not make use of its DMA or hardware handshaking logic.
* The A/UX header file sys/uconfig.h says $50F0 8000.
* The "SCSI DMA" custom IC embeds the 53C80 core and
* supports Programmed IO, DMA and PDMA (hardware handshake).
platform_device_register_simple("mac_scsi", 0,
mac_scsi_iifx_rsrc, ARRAY_SIZE(mac_scsi_iifx_rsrc));
......@@ -2340,7 +2340,6 @@ static void srp_handle_qp_err(struct ib_cq *cq, struct ib_wc *wc,
static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
struct srp_target_port *target = host_to_target(shost);
struct srp_rport *rport = target->rport;
struct srp_rdma_ch *ch;
struct srp_request *req;
struct srp_iu *iu;
......@@ -2350,16 +2349,6 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
u32 tag;
u16 idx;
int len, ret;
const bool in_scsi_eh = !in_interrupt() && current == shost->ehandler;
* The SCSI EH thread is the only context from which srp_queuecommand()
* can get invoked for blocked devices (SDEV_BLOCK /
* SDEV_CREATED_BLOCK). Avoid racing with srp_reconnect_rport() by
* locking the rport mutex if invoked from inside the SCSI EH.
if (in_scsi_eh)
scmnd->result = srp_chkready(target->rport);
if (unlikely(scmnd->result))
......@@ -2428,13 +2417,7 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
goto err_unmap;
ret = 0;
if (in_scsi_eh)
return ret;
return 0;
srp_unmap_data(scmnd, ch, req);
......@@ -2456,7 +2439,7 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
goto unlock_rport;
return ret;
......@@ -6001,13 +6001,12 @@ mpt_findImVolumes(MPT_ADAPTER *ioc)
if (mpt_config(ioc, &cfg) != 0)
goto out;
mem = kmalloc(iocpage2sz, GFP_KERNEL);
mem = kmemdup(pIoc2, iocpage2sz, GFP_KERNEL);
if (!mem) {
rc = -ENOMEM;
goto out;
memcpy(mem, (u8 *)pIoc2, iocpage2sz);
ioc->raid_data.pIocPg2 = (IOCPage2_t *) mem;
......@@ -99,28 +99,6 @@ config CHR_DEV_ST
To compile this driver as a module, choose M here and read
<file:Documentation/scsi/scsi.txt>. The module will be called st.
tristate "SCSI OnStream SC-x0 tape support"
depends on SCSI
The OnStream SC-x0 SCSI tape drives cannot be driven by the
standard st driver, but instead need this special osst driver and
use the /dev/osstX char device nodes (major 206). Via usb-storage,
you may be able to drive the USB-x0 and DI-x0 drives as well.
Note that there is also a second generation of OnStream
tape drives (ADR-x0) that supports the standard SCSI-2 commands for
tapes (QIC-157) and can be driven by the standard driver st.
For more information, you may have a look at the SCSI-HOWTO
<> and
<file:Documentation/scsi/osst.txt> in the kernel source.
More info on the OnStream driver may be found on
Please also have a look at the standard st docu, as most of it
applies to osst as well.
To compile this driver as a module, choose M here and read
<file:Documentation/scsi/scsi.txt>. The module will be called osst.
config BLK_DEV_SR
tristate "SCSI CDROM support"
depends on SCSI && BLK_DEV
......@@ -664,6 +642,41 @@ config SCSI_DMX3191D
To compile this driver as a module, choose M here: the
module will be called dmx3191d.
depends on SCSI
tristate "Future Domain TMC-3260/AHA-2920A PCI SCSI support"
depends on PCI && SCSI
This is support for Future Domain's PCI SCSI host adapters (TMC-3260)
and other adapters with PCI bus based on the Future Domain chipsets
(Adaptec AHA-2920A).
NOTE: Newer Adaptec AHA-2920C boards use the Adaptec AIC-7850 chip
and should use the aic7xxx driver ("Adaptec AIC7xxx chipset SCSI
controller support"). This Future Domain driver works with the older
Adaptec AHA-2920A boards with a Future Domain chip on them.
To compile this driver as a module, choose M here: the
module will be called fdomain_pci.
tristate "Future Domain 16xx ISA SCSI support"
depends on ISA && SCSI
This is support for Future Domain's 16-bit SCSI host adapters
(TMC-1660/1680, TMC-1650/1670, TMC-1610M/MER/MEX) and other adapters
with ISA bus based on the Future Domain chipsets (Quantum ISA-200S,
ISA-250MG; and at least one IBM board).
To compile this driver as a module, choose M here: the
module will be called fdomain_isa.
config SCSI_GDTH
tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support"
depends on PCI && SCSI
......@@ -76,6 +76,9 @@ obj-$(CONFIG_SCSI_AIC94XX) += aic94xx/
obj-$(CONFIG_SCSI_PM8001) += pm8001/
obj-$(CONFIG_SCSI_ISCI) += isci/
obj-$(CONFIG_SCSI_IPS) += ips.o
obj-$(CONFIG_SCSI_FDOMAIN) += fdomain.o
obj-$(CONFIG_SCSI_FDOMAIN_PCI) += fdomain_pci.o
obj-$(CONFIG_SCSI_FDOMAIN_ISA) += fdomain_isa.o
obj-$(CONFIG_SCSI_GENERIC_NCR5380) += g_NCR5380.o
obj-$(CONFIG_SCSI_QLOGIC_FAS) += qlogicfas408.o qlogicfas.o
obj-$(CONFIG_PCMCIA_QLOGIC) += qlogicfas408.o
......@@ -143,7 +146,6 @@ obj-$(CONFIG_SCSI_WD719X) += wd719x.o
obj-$(CONFIG_ARM) += arm/
obj-$(CONFIG_CHR_DEV_ST) += st.o
obj-$(CONFIG_CHR_DEV_OSST) += osst.o
obj-$(CONFIG_BLK_DEV_SD) += sd_mod.o
obj-$(CONFIG_BLK_DEV_SR) += sr_mod.o
obj-$(CONFIG_CHR_DEV_SG) += sg.o
......@@ -709,6 +709,8 @@ static void NCR5380_main(struct work_struct *work)
done = 0;
if (!hostdata->connected)
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
if (!done)
......@@ -1110,8 +1112,6 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
if (!hostdata->connected)
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
shost_printk(KERN_ERR, instance, "reselection after won arbitration?\n");
goto out;
......@@ -1119,7 +1119,6 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
if (err < 0) {
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
/* Can't touch cmd if it has been reclaimed by the scsi ML */
if (!hostdata->selecting)
......@@ -1157,7 +1156,6 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
if (err < 0) {
shost_printk(KERN_ERR, instance, "select: REQ timeout\n");
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
goto out;
if (!hostdata->selecting) {
......@@ -1763,10 +1761,8 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
scmd_printk(KERN_INFO, cmd,
"switching to slow handshake\n");
cmd->device->borken = 1;
sink = 1;
cmd->result = DID_ERROR << 16;
/* XXX - need to source or sink data here, as appropriate */
} else {
/* Transfer a small chunk so that the
......@@ -1826,9 +1822,6 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
/* Enable reselect interrupts */
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
......@@ -1860,8 +1853,6 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
/* Enable reselect interrupts */
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
#ifdef SUN3_SCSI_VME
dregs->csr |= CSR_DMA_ENABLE;
......@@ -1964,7 +1955,6 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
cmd->result = DID_ERROR << 16;
complete_cmd(instance, cmd);
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
msgout = NOP;
......@@ -235,7 +235,7 @@ struct NCR5380_cmd {
#define NCR5380_PIO_CHUNK_SIZE 256
/* Time limit (ms) to poll registers when IRQs are disabled, e.g. during PDMA */
#define NCR5380_REG_POLL_TIME 15
#define NCR5380_REG_POLL_TIME 10
static inline struct scsi_cmnd *NCR5380_to_scmd(struct NCR5380_cmd *ncmd_ptr)
......@@ -1666,7 +1666,7 @@ scratch_ram {
size 6
* These are reserved registers in the card's scratch ram on the 2742.
* The EISA configuraiton chip is mapped here. On Rev E. of the
* The EISA configuration chip is mapped here. On Rev E. of the
* aic7770, the sequencer can use this area for scratch, but the
* host cannot directly access these registers. On later chips, this
* area can be read and written by both the host and the sequencer.
......@@ -170,9 +170,7 @@ static int asd_init_target_ddb(struct domain_device *dev)
} else {
if (!dev->parent &&
(dev->dev_type == SAS_EDGE_EXPANDER_DEVICE ||
if (!dev->parent && dev_is_expander(dev->dev_type))
asd_ddbsite_write_byte(asd_ha, ddb, MAX_CCONN,
......@@ -66,7 +66,7 @@
#include "bnx2fc_constants.h"
#define BNX2FC_NAME "bnx2fc"
#define BNX2FC_VERSION "2.11.8"
#define BNX2FC_VERSION "2.12.10"
#define PFX "bnx2fc: "
......@@ -75,8 +75,9 @@
#define BNX2FC_MAX_BD_LEN 0xffff
#define BNX2FC_BD_SPLIT_SZ 0x8000
#define BNX2FC_MAX_BDS_PER_CMD 256
#define BNX2FC_BD_SPLIT_SZ 0xffff
#define BNX2FC_MAX_BDS_PER_CMD 255
#define BNX2FC_SQ_WQES_MAX 256
......@@ -433,8 +434,10 @@ struct bnx2fc_cmd {
void (*cb_func)(struct bnx2fc_els_cb_arg *cb_arg);
struct bnx2fc_els_cb_arg *cb_arg;
struct delayed_work timeout_work; /* timer for ULP timeouts */
struct completion tm_done;
int wait_for_comp;
struct completion abts_done;
struct completion cleanup_done;
int wait_for_abts_comp;
int wait_for_cleanup_comp;
u16 xid;
struct fcoe_err_report_entry err_entry;
struct fcoe_task_ctx_entry *task;
......@@ -455,6 +458,7 @@ struct bnx2fc_cmd {
#define BNX2FC_FLAG_CMD_LOST 0xc
#define BNX2FC_FLAG_SRR_SENT 0xd
u8 rec_retry;
u8 srr_retry;
u32 srr_offset;
......@@ -610,7 +610,6 @@ int bnx2fc_send_rec(struct bnx2fc_cmd *orig_io_req)
rc = bnx2fc_initiate_els(tgt, ELS_REC, &rec, sizeof(rec),
bnx2fc_rec_compl, cb_arg,
if (rc) {
BNX2FC_IO_DBG(orig_io_req, "REC failed - release\n");
......@@ -618,6 +617,7 @@ int bnx2fc_send_rec(struct bnx2fc_cmd *orig_io_req)
return rc;
......@@ -654,7 +654,6 @@ int bnx2fc_send_srr(struct bnx2fc_cmd *orig_io_req, u32 offset, u8 r_ctl)
rc = bnx2fc_initiate_els(tgt, ELS_SRR, &srr, sizeof(srr),
bnx2fc_srr_compl, cb_arg,
if (rc) {
BNX2FC_IO_DBG(orig_io_req, "SRR failed - release\n");
......@@ -664,6 +663,7 @@ int bnx2fc_send_srr(struct bnx2fc_cmd *orig_io_req, u32 offset, u8 r_ctl)
} else
set_bit(BNX2FC_FLAG_SRR_SENT, &orig_io_req->req_flags);
return rc;
......@@ -854,33 +854,57 @@ void bnx2fc_process_els_compl(struct bnx2fc_cmd *els_req,
kref_put(&els_req->refcount, bnx2fc_cmd_release);
static void bnx2fc_flogi_resp(struct fc_seq *seq, struct fc_frame *fp,
void *arg)
struct fcoe_ctlr *fip = arg;
struct fc_exch *exch = fc_seq_exch(seq);
struct fc_lport *lport = exch->lp;
u8 *mac;
u8 op;
struct fc_frame_header *fh;
u8 *granted_mac;
u8 fcoe_mac[6];
u8 fc_map[3];
int method;
if (IS_ERR(fp))
goto done;
mac = fr_cb(fp)->granted_mac;
if (is_zero_ether_addr(mac)) {
op = fc_frame_payload_op(fp);
if (lport->vport) {
if (op == ELS_LS_RJT) {
printk(KERN_ERR PFX "bnx2fc_flogi_resp is LS_RJT\n");
fcoe_ctlr_recv_flogi(fip, lport, fp);
fh = fc_frame_header_get(fp);
granted_mac = fr_cb(fp)->granted_mac;
* We set the source MAC for FCoE traffic based on the Granted MAC
* address from the switch.
* If granted_mac is non-zero, we use that.
* If the granted_mac is zeroed out, create the FCoE MAC based on
* the sel_fcf->fc_map and the d_id fo the FLOGI frame.
* If sel_fcf->fc_map is 0, then we use the default FCF-MAC plus the
* d_id of the FLOGI frame.
if (!is_zero_ether_addr(granted_mac)) {
ether_addr_copy(fcoe_mac, granted_mac);
} else if (fip->sel_fcf && fip->sel_fcf->fc_map != 0) {
hton24(fc_map, fip->sel_fcf->fc_map);
fcoe_mac[0] = fc_map[0];
fcoe_mac[1] = fc_map[1];
fcoe_mac[2] = fc_map[2];
fcoe_mac[3] = fh->fh_d_id[0];
fcoe_mac[4] = fh->fh_d_id[1];
fcoe_mac[5] = fh->fh_d_id[2];
} else {
fc_fcoe_set_mac(fcoe_mac, fh->fh_d_id);
if (!is_zero_ether_addr(mac))
fip->update_mac(lport, mac);
BNX2FC_HBA_DBG(lport, "fcoe_mac=%pM method=%d\n", fcoe_mac, method);
fip->update_mac(lport, fcoe_mac);
fc_lport_flogi_resp(seq, fp, lport);
......@@ -2971,7 +2971,8 @@ static struct scsi_host_template bnx2fc_shost_template = {
.this_id = -1,
.cmd_per_lun = 3,
.sg_tablesize = BNX2FC_MAX_BDS_PER_CMD,
.max_sectors = 1024,
.dma_boundary = 0x7fff,
.max_sectors = 0x3fbf,
.track_queue_depth = 1,