History log of /linux-master/drivers/scsi/qla2xxx/qla_sup.c
Revision Date Author Comments
# 0d6a536c 09-Jan-2022 Joe Carnuccio <joe.carnuccio@cavium.com>

scsi: qla2xxx: Add devids and conditionals for 28xx

This is an update to the original 28xx adapter enablement. Add a bunch of
conditionals that are applicable for 28xx.

Link: https://lore.kernel.org/r/20220110050218.3958-16-njavali@marvell.com
Fixes: ecc89f25e225 ("scsi: qla2xxx: Add Device ID for ISP28XX")
Cc: stable@vger.kernel.org
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 37306698 02-Jul-2021 Colin Ian King <colin.king@canonical.com>

scsi: qla2xxx: Remove redundant continue statement in a for-loop

The continue statement at the end of the for-loop is redundant, remove it.

Link: https://lore.kernel.org/r/20210702131542.19880-1-colin.king@canonical.com
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Addresses-Coverity: ("Continue has no effect")


# 37ce4f35 20-Mar-2021 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Fix endianness annotations

Fix all recently introduced endianness annotation issues.

Link: https://lore.kernel.org/r/20210320232359.941-4-bvanassche@acm.org
Cc: Quinn Tran <qutran@marvell.com>
Cc: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 0bc17251 02-Dec-2020 Arun Easi <aeasi@marvell.com>

scsi: qla2xxx: Fix flash update in 28XX adapters on big endian machines

Flash update failed due to missing endian conversion in FLT region access
as well as in checksum computation.

Link: https://lore.kernel.org/r/20201202132312.19966-12-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 77adf3f0 08-Sep-2020 Thomas Gleixner <tglx@linutronix.de>

scsi/qla2xxx: Convert to SPDX license identifiers

All files in this driver directory contain the following notice:

See LICENSE.qla2xxx for copyright and licensing details.

LICENSE.qla2xxx can be found in Documentation/scsi/. The file contains:

- A copyright notice

This copyright notice is redundant as all files contain the same
copyright notice already

- A license notice

You may modify and redistribute the device driver code under the
GNU General Public License (a copy of which is attached hereto as
Exhibit A) published by the Free Software Foundation (version 2).

This can be replaced with the corresponding SPDX license identifier
(GPL-2.0-only) in the source files which reference this license
file.

- The full GPLv2 license text

A redundant copy of LICENSES/preferred/GPL-2.0

Remove the notices and add the SPDX license identifier GPL-2.0-only to the
source files.

Finally remove the now redundant LICENSE.qla2xxx file.

Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Acked-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Acked-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# df561f66 23-Aug-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

treewide: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# 7ffa5b93 18-May-2020 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Fix endianness annotations in source files

Fix all endianness complaints reported by sparse (C=2) without affecting
the behavior of the code on little endian CPUs.

Link: https://lore.kernel.org/r/20200518211712.11395-16-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Daniel Wagner <dwagner@suse.de>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# ab053c09 18-May-2020 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Cast explicitly to uint16_t / uint32_t

Casting a pointer to void * and relying on an implicit cast from void *
to uint16_t or uint32_t suppresses sparse warnings about endianness. Hence
cast explicitly to uint16_t and uint32_t. Additionally, remove superfluous
void * casts.

Link: https://lore.kernel.org/r/20200518211712.11395-13-bvanassche@acm.org
Cc: Arun Easi <aeasi@marvell.com>
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Daniel Wagner <dwagner@suse.de>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 04474d3a 18-May-2020 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Change {RD,WRT}_REG_*() function names from upper case into lower case

This was suggested by Daniel Wagner.

Link: https://lore.kernel.org/r/20200518211712.11395-12-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# e544b720 18-May-2020 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Change two hardcoded constants into offsetof() / sizeof() expressions

This patch does not change any functionality.

Link: https://lore.kernel.org/r/20200518211712.11395-9-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 1b81e7f3 26-Feb-2020 Michael Hernandez <mhernandez@marvell.com>

scsi: qla2xxx: Return appropriate failure through BSG Interface

This patch ensures flash updates API calls return possible failure
status through BSG interface to the application.

Link: https://lore.kernel.org/r/20200226224022.24518-7-hmadhani@marvell.com
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Michael Hernandez <mhernandez@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# a27747a2 18-Dec-2019 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Improve readability of the code that handles qla_flt_header

Declare qla_hw_data.flt as a qla_flt_header pointer instead of as a void
pointer. Add a zero-length array at the end of struct qla_flt_header to
make it clear that qla_flt_header and qla_flt_region are contiguous. This
patch removes several casts but does not change any functionality.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Daniel Wagner <dwagner@suse.de>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Link: https://lore.kernel.org/r/20191219004706.39039-1-bvanassche@acm.org
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# c868907e 03-Dec-2019 Michael Hernandez <mhernandez@marvell.com>

scsi: qla2xxx: Fix incorrect SFUB length used for Secure Flash Update MB Cmd

SFUB length should be in DWORDs when passed to FW.

Fixes: 3f006ac342c03 ("scsi: qla2xxx: Secure flash update support for ISP28XX")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191203223657.22109-4-hmadhani@marvell.com
Signed-off-by: Michael Hernandez <mhernandez@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# a530bf69 03-Dec-2019 Michael Hernandez <mhernandez@marvell.com>

scsi: qla2xxx: Added support for MPI and PEP regions for ISP28XX

This patch adds support for MPI/PEP region updates which is required with
secure flash updates for ISP28XX.

Fixes: 3f006ac342c0 ("scsi: qla2xxx: Secure flash update support for ISP28XX")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191203223657.22109-3-hmadhani@marvell.com
Signed-off-by: Michael Hernandez <mhernandez@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 4e71dcae 03-Dec-2019 Himanshu Madhani <hmadhani@marvell.com>

scsi: qla2xxx: Correctly retrieve and interpret active flash region

ISP27XX/28XX supports multiple flash regions. This patch fixes issue where
active flash region was not interpreted correctly during secure flash
update process.

[mkp: typo]

Fixes: 5fa8774c7f38c ("scsi: qla2xxx: Add 28xx flash primary/secondary status/image mechanism")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191203223657.22109-2-hmadhani@marvell.com
Signed-off-by: Michael Hernandez <mhernandez@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# cb92cb16 30-Aug-2019 Quinn Tran <qutran@marvell.com>

scsi: qla2xxx: Fix flash read for Qlogic ISPs

Use adapter specific callback to read flash instead of ISP adapter
specific.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Link: https://lore.kernel.org/r/20190830222402.23688-3-hmadhani@marvell.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# c43e7832 08-Aug-2019 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Change the return type of qla24xx_read_flash_data()

This change makes it easier to detect qla24xx_read_flash_data() failures
and also to handle such failures. This change does not modify the behavior
of the driver since all callers ignore the qla24xx_read_flash_data()
return value.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 58e2753c 11-Apr-2019 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Insert spaces where required

Improve source code readability by inserting spaces where these are
required according to the coding standard. This patch only inserts
whitespace and does not make any other changes.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 3f006ac3 12-Mar-2019 Michael Hernandez <mhernandez@marvell.com>

scsi: qla2xxx: Secure flash update support for ISP28XX

This patch adds support for Secure flash update with ISP28xx.

Signed-off-by: Michael Hernandez <mhernandez@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 5fa8774c 12-Mar-2019 Joe Carnuccio <joe.carnuccio@cavium.com>

scsi: qla2xxx: Add 28xx flash primary/secondary status/image mechanism

Includes the following:
- correction to 27xx image status struct;
- factoring of 27xx image status validating routines to make common;
- image status generation compare that works across zero wrap;
- bsg interface to report current active images (as loaded by driver).

Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Mike Hernandez <mhernandez@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 3695310e 12-Mar-2019 Joe Carnuccio <joe.carnuccio@cavium.com>

scsi: qla2xxx: Update flash read/write routine

This patch makes following changes to flash access routines:

- update return type for read_optrom
- use void instead of uint32_t * for buffer parameter in read
and write optrom routines
- fix flash/nvram addressing

Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# a28d9e4e 12-Mar-2019 Joe Carnuccio <joe.carnuccio@cavium.com>

scsi: qla2xxx: Add support for multiple fwdump templates/segments

This patch adds multipe firmware dump template and segments support for
ISP27XX/28XX.

Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# f8f97b0c 12-Mar-2019 Joe Carnuccio <joe.carnuccio@cavium.com>

scsi: qla2xxx: Cleanups for NVRAM/Flash read/write path

This patch does following:

- Clean up NVRAM code.
- Optimizes reading of primary/secondary flash image validation.
- Remove 0xff mask and make correct width in FLT structure.
- Use endian macros to assign static fields in fwdump header.
- Correct fdwt checksum calculation.
- Simplify ql_dump_buffer() interface usage.
- Add endianizers to 27xx firmware image validator.
- fixes compiler warnings for big endian architecture.

Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# ecc89f25 12-Mar-2019 Joe Carnuccio <joe.carnuccio@cavium.com>

scsi: qla2xxx: Add Device ID for ISP28XX

This patch adds PCI device ID ISP28XX for Gen7 support. Also signature
determination for primary/secondary flash image for ISP27XX/28XX is aded as
part of Gen7 support.

Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 807eb907 18-Oct-2018 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Improve several kernel-doc headers

This patch avoids that complaints about kernel-doc headers are reported
when building with W=1.

Cc: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 45235022 18-Jul-2018 Quinn Tran <quinn.tran@cavium.com>

scsi: qla2xxx: Fix driver unload by shutting down chip

Use chip shutdown at the start of unload to stop all DMA + traffic and
bring down the laser. This prevents any link activities from triggering the
driver to be re-engaged.

Fixes: 4b60c82736d0 ("scsi: qla2xxx: Add fw_started flags to qpair")
Cc: <stable@vger.kernel.org> #4.16
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 2db6228d 23-Jan-2018 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Fix function argument descriptions

Bring the kernel-doc headers in sync with the function argument lists.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Himanshu Madhani <himanshu.madhani@cavium.com>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 81881861 07-Dec-2017 Bart Van Assche <bvanassche@acm.org>

scsi: qla2xxx: Suppress gcc 7 fall-through warnings

Avoid that building with gcc 7 and W=1 triggers warnings similar to the
following:

drivers/scsi/qla2xxx/qla_isr.c:1189:27: warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Himanshu Madhani <himanshu.madhani@cavium.com>
Cc: Quinn Tran <quinn.tran@cavium.com>
Cc: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 7c0f6ba6 24-Dec-2016 Linus Torvalds <torvalds@linux-foundation.org>

Replace <asm/uaccess.h> with <linux/uaccess.h> globally

This was entirely automated, using the script by Al:

PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>'
sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \
$(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)

to do the replacement at the end of the merge window.

Requested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# c01e0159 19-Apr-2016 Masanari Iida <standby24x7@gmail.com>

treewide: Fix typos in printk

This patch fix spelling typos in printk from various part
of the codes.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# da08ef5c 26-Jan-2016 Joe Carnuccio <joe.carnuccio@qlogic.com>

qla2xxx: Avoid side effects when using endianizer macros.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 4243c115 26-Jan-2016 Sawan Chandak <sawan.chandak@qlogic.com>

qla2xxx: Add support for online flash update for ISP27XX.

Signed-off-by: Sawan Chandak <sawan.chandak@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# ad950360 09-Jul-2015 Bart Van Assche <bvanassche@acm.org>

qla2xxx: Remove __constant_ prefix

Whether htonl() or __constant_htonl() is used, if the argument
is a constant the conversion happens at compile time. Hence leave
out the __constant_ prefix for this and other endianness
conversion functions. This improves source code readability.

[jejb: checkpatch fixes]
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Acked-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>


# b20f02e1 10-Jun-2015 Himanshu Madhani <himanshu.madhani@qlogic.com>

qla2xxx: Enable target mode for ISP27XX

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>


# b21ba319 09-Apr-2015 Nigel Kirkland <nigel.kirkland@qlogic.com>

qla2xxx: Fix beacon blink for ISP27XX.

Signed-off-by: Nigel Kirkland <nigel.kirkland@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>


# 00ef7d88 25-Sep-2014 Himanshu Madhani <himanshu.madhani@qlogic.com>

qla2xxx: Fix driver version string message.

Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>


# efcdf9f5 25-Sep-2014 Joe Carnuccio <joe.carnuccio@qlogic.com>

qla2xxx: Fix potential return count bug in qla2xxx_get_vpd_field().

Call scnprintf() instead of snprintf() since the latter may return
an incorrect count in cases where the write is truncated to fit.

scnprintf() returns the count of what was actually written;
snprintf() returns the count of what would have been written.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>


# 420854b3 25-Sep-2014 Chad Dupuis <chad.dupuis@qlogic.com>

qla2xxx: Enable fast flash access for ISP83xx.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>


# 90b604f2 11-Apr-2014 Himanshu Madani <himanshu.madani@qlogic.com>

qla2xxx: Fix beacon blink logic for ISP26xx/83xx.

Signed-off-by: Himanshu Madani <himanshu.madani@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>


# bd21eaf9 11-Apr-2014 Armen Baloyan <armen.baloyan@qlogic.com>

qla2xxx: Change copyright year to 2014 in all the source files.

Signed-off-by: Armen Baloyan <armen.baloyan@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>


# f73cb695 26-Feb-2014 Chad Dupuis <chad.dupuis@qlogic.com>

[SCSI] qla2xxx: Add support for ISP2071.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Armen Baloyan <armen.baloyan@qlogic.com>
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 6ddcfef7 26-Aug-2013 Saurav Kashyap <saurav.kashyap@qlogic.com>

[SCSI] qla2xxx: Correction to message ids.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 7ec0effd 26-Aug-2013 Atul Deshmukh <atul.deshmukh@qlogic.com>

[SCSI] qla2xxx: Add support for ISP8044.

[jejb: checkpatch fixes]
Signed-off-by: Atul Deshmukh <atul.deshmukh@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 1e63395c 07-Feb-2013 Saurav Kashyap <saurav.kashyap@qlogic.com>

[SCSI] qla2xxx: Update the copyright information.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# a865c50a 07-Feb-2013 Saurav Kashyap <saurav.kashyap@qlogic.com>

[SCSI] qla2xxx: Get VPD information from common location for CNA.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 0143d8b7 22-Aug-2012 Chad Dupuis <chad.dupuis@qlogic.com>

[SCSI] qla2xxx: Implement beacon support for ISP83xx.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 46152ceb 22-Aug-2012 Chad Dupuis <chad.dupuis@qlogic.com>

[SCSI] qla2xxx: Update the driver copyright.

Update the driver copyright from 2003-2011 to 2003-2012.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 7d613ac6 22-Aug-2012 Santosh Vernekar <santosh.vernekar@qlogic.com>

[SCSI] qla2xxx: IDC implementation for ISP83xx.

Signed-off-by: Santosh Vernekar <santosh.vernekar@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# a49393f2 25-Apr-2012 Giridhar Malavali <giridhar.malavali@qlogic.com>

[SCSI] qla2xxx: Block flash access from application when device is initialized for ISP82xx.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 6246b8a1 09-Feb-2012 Giridhar Malavali <giridhar.malavali@qlogic.com>

[SCSI] qla2xxx: Enhancements to support ISP83xx.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Nigel Kirkland <nigel.kirkland@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# d8424f68 18-Nov-2011 Joe Perches <joe@perches.com>

[SCSI] qla2xxx: Make the logging functions verify their arguments and fixed the current broken uses as appropriate.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 7c3df132 14-Jul-2011 Saurav Kashyap <saurav.kashyap@qlogic.com>

[SCSI] qla2xxx: Code changes to support new dynamic logging infrastructure.

The code is changed to support the new dynamic logging infrastructure.
Following are the levels added.
Default is 0 - no logging. 0x40000000 - Module Init & Probe.
0x20000000 - Mailbox Cmnds. 0x10000000 - Device Discovery.
0x08000000 - IO tracing. 0x04000000 - DPC Thread.
0x02000000 - Async events. 0x01000000 - Timer routines.
0x00800000 - User space. 0x00400000 - Task Management.
0x00200000 - AER/EEH. 0x00100000 - Multi Q.
0x00080000 - P3P Specific. 0x00040000 - Virtual Port.
0x00020000 - Buffer Dump. 0x00010000 - Misc.
0x7fffffff - For enabling all logs, can be too many logs.

Setting ql2xextended_error_logging module parameter to any of the above
value, will enable the debug for that particular level.
Do LOGICAL OR of the value to enable more than one level.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 07e264b7 30-Mar-2011 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Update copyright banner.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# ff8073ff 21-Dec-2010 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Populate FCP_PRIO location for no *FLT* case

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# de7c5d05 23-Jul-2010 Giridhar Malavali <giridhar.malavali@qlogic.com>

[SCSI] qla2xxx: Update copyright banner.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 0f2d962f 23-Jul-2010 Madhuranath Iyengar <madhuranath.iyengar@qlogic.com>

[SCSI] qla2xxx: Check for golden firmware and show version if available

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 2f0f3f4f 23-Jul-2010 Madhuranath Iyengar <madhuranath.iyengar@qlogic.com>

[SCSI] qla2xxx: Appropriately log FCP priority data messages

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# a9083016 12-Apr-2010 Giridhar Malavali <giridhar.malavali@qlogic.com>

[SCSI] qla2xxx: Add ISP82XX support.

Enhanced the driver to support new FCoE host bus adapter.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# bfdaa761 19-Mar-2010 Sarang Radke <sarang.radke@qlogic.com>

[SCSI] qla2xxx: Fix to make conditional decision based on port number.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 09ff701a 19-Mar-2010 Sarang Radke <sarang.radke@qlogic.com>

[SCSI] qla2xxx: Add APEX support.

Allows priority setting for FCP_CMNDs.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 5a0e3ad6 24-Mar-2010 Tejun Heo <tj@kernel.org>

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>


# 368bbe07 12-Jan-2010 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Perform fast mailbox read of flash regardless of size nor address alignment.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>


# 18020ba7 10-Jun-2009 Randy Dunlap <randy.dunlap@oracle.com>

[SCSI] qla2xxx: fix printk format warnings

Fix qla2xxx printk format warnings:

drivers/scsi/qla2xxx/qla_sup.c:915: warning: long long unsigned int format, u64 arg (arg 5)
drivers/scsi/qla2xxx/qla_sup.c:915: warning: long long unsigned int format, u64 arg (arg 6)
drivers/scsi/qla2xxx/qla_sup.c:923: warning: long long unsigned int format, u64 arg (arg 5)
drivers/scsi/qla2xxx/qla_sup.c:923: warning: long long unsigned int format, u64 arg (arg 6)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# cbc8eb67 03-Jun-2009 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Fallback to 'golden-firmware' operation on supported ISPs.

In case the onboard firmware is unable to be read or loaded for
operation, attempt to fallback to a limited-operational firmware
image stored in a different flash region. This will allow a user
to reflash and correct a board with proper operational firmware.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 40859ae5 03-Jun-2009 Anirban Chakraborty <anirban.chakraborty@qlogic.com>

[SCSI] qla2xxx: Correct queue-creation bug when driver loaded in QoS mode.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# e5b68a61 06-Apr-2009 Anirban Chakraborty <anirban.chakraborty@qlogic.com>

[SCSI] qla2xxx: Use port number to compute nvram/vpd parameter offsets.

Read adapter's physical port number from interrupt pin register
and use it instead of pci function number to offset into the
nvram to obtain the port's configuration parameters.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 2afa19a9 06-Apr-2009 Anirban Chakraborty <anirban.chakraborty@qlogic.com>

[SCSI] qla2xxx: Add QoS support.

Set the number of request queues to the module paramater
ql2xmaxqueues. Each vport gets a request queue. The QoS value
set to the request queues determines priority control for queued
IOs. If QoS value is not specified, the vports use the default
queue 0.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 7640335e 06-Apr-2009 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Correct compilation failures when DEBUG'n' options are enabled.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 79c13a74 24-Mar-2009 Harish Zunjarrao <harish.zunjarrao@qlogic.com>

[SCSI] qla2xxx: Get FLT address in dword format.

FLTDS provides FLT address in the byte address format,
convert it to dword address for further use.

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 3d79038f 24-Mar-2009 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Always use an FLT's NVRAM/VPD region information.

Rather than assuming a particular layout of the data. Applies to
recent ISPs only.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# d0c3eefa 24-Mar-2009 Lalit Chandivade <lalit.chandivade@qlogic.com>

[SCSI] qla2xxx: Remove implicit ISP-abort after a flash update.

For ISP24xx and above the ISP-abort after flash update is not
needed, as the only purpose it was serving was to update the boot
code and firmware versions in the scsi_qla_host_t structure. Now
an update of the versions will be done in the write-vpd path.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 2533cf67 24-Mar-2009 Lalit Chandivade <lalit.chandivade@qlogic.com>

[SCSI] qla2xxx: Correct ISP abort semantics for NVRAM, VPD, and flash update.

Ensure that an ISP-abort has completed before performing any
update. After the update do not wait for an ISP-abort completion,
instead just wait until the ISP is reset. This avoids long
delays due to waiting for loop ready in qla2x00_abort_isp().

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 1d2874de 24-Mar-2009 Joe Carnuccio <joe.carnuccio@qlogic.com>

[SCSI] qla2xxx: Add Flash-Access-Control support for recent ISPs.

Given the low-level interface varies from one flash-part
manufacturer to the next, the Flash-Access-Control (FAC) mailbox
command makes the specific flash type transparent to the driver
by encapsulating a basic set of accessor and update routines.
Use these new routines where applicable by querying FAC opcode
get-sector-size at init-time.

Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 6315a5f8 24-Mar-2009 Harish Zunjarrao <harish.zunjarrao@qlogic.com>

[SCSI] qla2xxx: Use byte-address while reading FC boot code versions from flash.

The pcihdr variable is used to find valid boot code image to get
FC boot code versions from flash. The pcihdr variable should be
byte aligned.

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 9088608e 08-Feb-2009 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Mask out 'reserved' bits while processing FLT regions.

Bits 31-8 are marked as reserved and should be ignored while
interpreting a region's code.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# b872ca40 22-Jan-2009 Joe Carnuccio <joe.carnuccio@qlogic.com>

[SCSI] qla2xxx: Correct descriptions in flash manipulation routines.

When clearing the flash device's SR, the comment is incorrect...
clearing the SR is 2 steps:

1. the SR protect bit is 1, so the first write zero clears only
that bit,

2. the SR protect bit is now 0, so the next write zero clears the
remaining bits.

The sector erase debug print more correctly identifies that the erase failed.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 7c283177 22-Jan-2009 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Correct endianness issue during flash manipulation.

The flash data was incorrectly being converted (cpu_to_le32())
when using the bulk-flash-write mailbox command (ISP25xx and
above).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 85d0acbb 22-Jan-2009 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Simplify sector-mask calculation in preparation for larger flash parts.

Also removes unneeded 'findex' local variable within routine.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 3a03eb79 05-Jan-2009 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add ISP81XX support.

Codes to support new FCoE boards.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 1ded85e2 05-Jan-2009 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Remove support for reading/writing HW-event-log.

Software should not touch this region of flash, as the firmware
will be the only writer and consumer of the region.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 73208dfd 09-Dec-2008 Anirban Chakraborty <anirban.chakraborty@qlogic.com>

[SCSI] qla2xxx: add support for multi-queue adapter

Following changes have been made.
1. qla_hw_data structure holds an array for request queue pointers,
and an array for response queue pointers.
2. The base request and response queues are created by default.
3. Additional request and response queues are created at the time of vport
creation. If queue resources are exhausted during vport creation, newly
created vports use the default queue.
4. Requests are sent to the request queue that the vport was assigned
in the beginning.
5. Responses are completed on the response queue with which the request queue
is associated with.

[fixup memcpy argument reversal spotted by davej@redhat.com]
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 7b867cf7 06-Nov-2008 Anirban Chakraborty <anirban.chakraborty@qlogic.com>

[SCSI] qla2xxx: Refactor qla data structures

Following changes have been made to the qla2xxx FC driver in
preparation for the multi- queue and future SR IOV hardware.

1. scsi_qla_host structure has been changed to contain scsi host
specific data only.

2. A new structure, qla_hw_data is created to contain HBA specific
hardware data.

3. Request and response IO specific data strucures are created.

4. The global list of fcports for the hba is not maintained anymore,
instead a fcport list is construted on per scsi_qla_host.

Signed-of-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 821b3996 24-Oct-2008 Lalit Chandivade <lalit.chandivade@qlogic.com>

[SCSI] qla2xxx: Correct Atmel flash-part handling.

Use correct block size (4K) for erase command 0x20 for Atmel
Flash. Use dword addresses for determining sector boundary.

Cc: Stable Tree <stable@kernel.org>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 4a3e1ea8 17-Sep-2008 Alexander Beregalov <a.beregalov@gmail.com>

[SCSI] qla2xxx: fix printk format warnings

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 272976ca 11-Sep-2008 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add NPIV-Config Table support.

To instatiate pre-configured vport entities defined within an
HBA's flash memory.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# c00d8994 11-Sep-2008 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add Flash Layout Table support.

The Flash Layout Table (FLT) present on many recent HBAs encodes
flash usage information, organizes data stored into separate
regions and presents the information uniformly to the driver.
Use this information rather than using specific hard-coded values
based on ISP type.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 1ee27146 10-Jul-2008 Joe Carnuccio <joe.carnuccio@qlogic.com>

[SCSI] qla2xxx: Retrieve board serial-number and description from VPD.

Recent ISPs have this information written at manufacturing time,
so use the information. This also reduces future churn of the
qla_devtbl.h file contents, as the driver can now depend on the
information to be present in VPD.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# bbfb21da 10-Jul-2008 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Correct locking during NVRAM manipulation.

Commit 2c96d8d0c17978bbf5eb82314d488f46d4a51280 pushed the
acquisition of hardware_lock to too fine a level, which in turn
will cause problems with cond_resched()s added with
40a2e34a94c336b716f631b2952d233e1ba76e3c.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 4d4df193 03-Apr-2008 Harihara Kadayam <harihara.kadayam@qlogic.com>

[SCSI] qla2xxx: Add ISP84XX support.

Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 7d232c74 03-Apr-2008 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add Flash Descriptor Table layout support.

The Flash Descriptor Table (FDT) present on many recent HBAs
encodes flash accessing characteristics of the flash-part used on
the HBA. Use this information during flash manipulation (writes)
rather than using specific hard-coded values based on queried
manufacturer and device IDs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# cb8dacbf 03-Apr-2008 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add hardware trace-logging support.

Recent ISPs have a region within FLASH which acts as a repository
for the logging of serious hardware and software failures.
Currently, the region is large enough to support up to 255
entries.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 01e58d8e 03-Apr-2008 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Update copyright banner.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 948882f6 31-Jan-2008 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Correct resource_size_t usages.

Hmm, it looks like the conversion to resource_size_t usage
(3776541d8a46347a4924353a192c6ce4a3d04e2e) requires some additional
fixups to cleanup the structure-pointer castings used during IO mapped
accesses to the chip.

There's only a small number of locations, where the driver uses IO
mapped accesses to the hardware, the patch below should take care of
it without introducing to many structural changes to code flow.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# a824ebb3 17-Jan-2008 Adrian Bunk <bunk@kernel.org>

[SCSI] qla2xxx: Code cleanups.

- make the following needlessly global code static:
- qla_attr.c: qla24xx_vport_delete()
- qla_attr.c: qla24xx_vport_disable()
- qla_mid.c: qla24xx_allocate_vp_id()
- qla_mid.c: qla24xx_find_vhost_by_name()
- qla_mid.c: qla2x00_do_dpc_vp()
- qla_os.c: struct qla2x00_driver_template
- qla_os.c: qla2x00_stop_timer()
- qla_os.c: qla2x00_mem_alloc()
- qla_os.c: qla2x00_mem_free()
- qla_sup.c: qla2x00_lock_nvram_access()
- qla_sup.c: qla2x00_unlock_nvram_access()
- qla_sup.c: qla2x00_get_nvram_word()
- qla_sup.c: qla2x00_write_nvram_word()
- #if 0 the following unused global functions:
- qla_mbx.c: qla2x00_system_error()
- qla_os.c: remove some unneeded function prototypes
- removed unused functions:
- qla_dbg.c: qla2x00_dump_pkt()
- qla_mbx.c: qla2x00_get_serdes_params()
- qla_mbx.c: qla2x00_get_idma_speed()
- qla_mbx.c: qla24xx_get_vp_database()
- qla_mbx.c: qla24xx_get_vp_entry()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Small modifications and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 6f13fd57 17-Jan-2008 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Wait for FLASH write-protection to complete after a write.

Some flash parts have a slow enable write-protection (WP)
operation whereby subsequent FLASH accesses would fail if the WP
operation had not completed. Software now polls the SPI's
status-register for WP completion.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 94d6a2b3 19-Oct-2007 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Fix issue where final flash-segment updates were falling into the slow-path write handler.

Original implementation would not use the burst-write mechanisms
for requests equal to OPTROM_BURST_DWORDS transfer dwords.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 2c96d8d0 19-Oct-2007 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Handle unaligned sector writes during NVRAM/VPD updates.

Since both NVRAM and VPD regions of the flash reside on unaligned
sector boundaries, during update, the driver must perform a
read-modify-write operation to the composite NVRAM/VPD region.
This affects ISP25xx type boards only.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 875baf3c 16-Oct-2007 Andrew Morton <akpm@linux-foundation.org>

[SCSI] qla2xxx: printk fixes

drivers/scsi/qla2xxx/qla_sup.c: In function 'qla24xx_write_flash_data':
drivers/scsi/qla2xxx/qla_sup.c:655: warning: format '%llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
drivers/scsi/qla2xxx/qla_sup.c: In function 'qla25xx_read_optrom_data':
drivers/scsi/qla2xxx/qla_sup.c:1853: warning: format '%llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# b7cc176c 20-Sep-2007 Joe Carnuccio <joe.carnuccio@qlogic.com>

[SCSI] qla2xxx: Allow region-based flash-part accesses.

Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 338c9161 20-Sep-2007 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add flash burst-read/write support.

Newer ISPs support a mechanism to read and write flash-memory via
the firmware LOAD/DUMP memory mailbox command routines. When
supported, utilizing these mechanisms significantly reduces
overall access times.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# c3a2f0df 19-Jul-2007 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add ISP25XX support.

Large code-reuse from ISP24xx, consolidate RISC memory
extraction routines during firmware-dump.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# fd34f556 19-Jul-2007 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Re-factor isp_operations to static structures.

In preparation for new ISP types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# fecf9788 12-Mar-2007 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Drop acquisition of hardware_lock during flash manipulations.

There's no need given, I/O has been quiesced, RISC
interrupts have been disabled, and finally the RISC has been
paused. Flash manipulation on ISP21xx, ISP22xx, and ISP23xx
parts requires the RISC to go through a full reset to
recover.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 40a2e34a 12-Mar-2007 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add cond_resched() calls during HBA flash manipulation.

We're observing soft lockups during HBA FLASH retrieval and
update. Add cond_resched() each time around the tight-loops
during flash read()s/write()s.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 30c47662 29-Jan-2007 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Export OptionROM boot-codes version information.

This includes BIOS, EFI, FCODE and firmware versions.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 3c606123 29-Jan-2007 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Correct sector-erase issues while writing flash.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# e5f82ab8 08-Nov-2006 Adrian Bunk <bunk@stusta.de>

[SCSI] qla2xxx: make some functions static

This patch makes some needlessly global functions static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 45aeaf1e 17-May-2006 Ravi Anand <ravi.anand@qlogic.com>

[SCSI] qla2xxx: Add support for new flash part.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# ea5b6382 09-Mar-2006 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Convert IS_QLA*() defines to bit-operations.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 39a11240 14-Feb-2006 Christoph Hellwig <hch@lst.de>

[SCSI] qla2xxx: use kthread_ API

Use the kthread_ API instead of opencoding lots of hairy code for kernel
thread creation and teardown.

Also switch from semaphore-based thread wakeup to wake_up_process.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-By: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 854165f4 31-Jan-2006 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add support to retrieve/update HBA option-rom.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# f6df144c 31-Jan-2006 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add beacon support via class-device attribute.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# e978010c 13-Jan-2006 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Re-enable flash-part write protection on ISP24xx boards.

Driver would not correctly re-enable the write-protection
bits of the flash part after updates.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# dcb36ce9 08-Nov-2005 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Correct additional posting issues during NVRAM accesses.

On MMIO relaxed-order platforms, it is possible for the
proper delay during NVRAM access to begin before the request
passes through the PCI bus (via a MMIO write) to the ISP.
Thus, causing a subsequent read to the NVRAM part to fail.
Add a MMIO read, after the MMIO write to insure any posted
writes are flushed.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# fa90c54f 27-Oct-2005 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Update license.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# c32c4cb9 26-Aug-2005 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Remove RISC pause/release barriers during flash manipulation.

Remove unnecessary RISC pause/release barriers during
ISP24xx flash manipulation. The ISP24xx can arbitrate flash
access requests during RISC executions.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# ae91193c 06-Jul-2005 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Update copyright banner.

Update copyright banner.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# fa2a1ce5 06-Jul-2005 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Code scrubbing.

Code scrubbing.

- Remove trailing whitespace from driver files.
- Remove unused #defines and inlines.
- Standardize on C comments (// -> /* */)

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 459c5378 06-Jul-2005 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add ISP24xx flash-manipulation routines.

Add ISP24xx flash-manipulation routines.

Add read/write flash manipulation routines for the ISP24xx.
Update sysfs NVRAM objects to use generalized accessor
functions.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 3d71644c 06-Jul-2005 Andrew Vasquez <andrew.vasquez@qlogic.com>

[SCSI] qla2xxx: Add ISP24xx definitions.

Add ISP24xx definitions.

Add requisite structure definitions and #define's for ISP24xx
support. Also drop volatile modifiers from device_reg_* register
layouts as the members are never really accessed, only their
offsets within the layout are used during reads and writes.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 93fc4294 27-Apr-2005 Al Viro <viro@www.linux.org.uk>

[SCSI] qla trivial iomem annotation

Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>


# 766f2fa1 26-Apr-2005 Al Viro <viro@www.linux.org.uk>

[PATCH] qla trivial iomem annotation

Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 1da177e4 16-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org>

Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!