History log of /drivers/scsi/qla2xxx/qla_init.c
Revision Date Author Comments
0eba25df2190f191cb92879b225a0e484c3e5b51 09-Feb-2012 Arun Easi <arun.easi@qlogic.com> [SCSI] qla2xxx: Handle device mapping changes due to device logout.

A device logout sent in the delete path of a fcport would clear the
port handle binding inside the firmware. This could lead to queued
work items for the fcport, if any, getting incorrect results. This
patch fixes the issue by checking for device name changes after a
call to get port database.

Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
642ef983861a6a7ba41e9d7c0aa4da8f6d5af5bf 09-Feb-2012 Chad Dupuis <chad.dupuis@qlogic.com> [SCSI] qla2xxx: Add ha->max_fibre_devices to keep track of the maximum number of targets.

Add a field to the qla_hw_data struct to allow us to set the maximum number of
fabric devices on a per adapter basis based on ISP type.

[jejb: fix up missing rval = QLA_SUCCESS to prevent uninit var warning]
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>
7a67735b07aa1bf61b8535eec6f6fb6474cf7926 09-Feb-2012 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Cache swl during fabric discovery.

Rather than continuously allocating and freeing swl within the discovery
process, simply pre-allocate it the first time that it's needed, cache it
through the rest of the lifecycle of the driver and free it at module unload.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
557cf7857cbf396f899034f1a7a13e245ef7e914 09-Feb-2012 Arun Easi <arun.easi@qlogic.com> [SCSI] qla2xxx: Add new message when a new loopid is assigned.

Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
0b91d1169e5382040d80622fe79e40c60ff88555 09-Feb-2012 Chad Dupuis <chad.dupuis@qlogic.com> [SCSI] qla2xxx: Handle failure cases during fabric_login

Make sure that all calls to ha->isp_ops->fabric_login() check the
return value for failure.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
b3b02e6e9512636d5a1839b325e4722e80cda90d 09-Feb-2012 Arun Easi <arun.easi@qlogic.com> [SCSI] qla2xxx: Handle change notifications based on switch scan results.

Instead of processing each RSCN individually, use only the name server results
from the switch to tell the existance of a given fcport.

Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
9ba56b95a588906a65664a9299a9f8ac1a0f6a91 09-Feb-2012 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Consolidation of SRB processing.

Rework the structures related to SRB processing to minimize the memory
allocations per I/O and manage resources associated with and completions
from common routines.

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>
69e5f1ea61a3e84c03103c6a18ee9cacef4cbb9e 09-Feb-2012 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Use a valid enode-mac if none defined.

Original 'defaults' were not OUI valid.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
6246b8a1d26c7cdb77fd2f3f3578d4db025d5c9e 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>
050c9bb1361439e63dafb5f192f87b81d8ffbf4a 09-Feb-2012 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Enhanced the dump routines to capture multiple request and response queues.

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>
5780790ee6836ad64648c0905fcf15e073aad19b 18-Nov-2011 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Ensure there's enough request-queue space for passthru IOCBs.

The driver should ensure there's a sufficient number of IOCBs
to satisfy the number of scatter-gather entries specified in the
command. Add a 'count' to the control structure, srb_ctx, to use
in qla2x00_alloc_iocbs().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
a00f6296aaf92ebe89c72eb98c440410992a33c4 18-Nov-2011 Saurav Kashyap <saurav.kashyap@qlogic.com> [SCSI] qla2xxx: Implement FCP priority tagging for 82xx adapters.

This provides a capability to set a priority in the FCP packet.

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>
cfb0919c12a33132f75fb91971bbd8bdd44ebb90 18-Nov-2011 Chad Dupuis <chad.dupuis@qlogic.com> [SCSI] qla2xxx: Update to dynamic logging.

This patch contains minor fixes to our new logging infrastructure:

- Remove extranous messages.
- Re-add 'nexus' and 'hdl' information.
- Adjusted the message ids to fill up the holes.
- Display FCP_CMND priority on update.
- Log only mail box error conditions.
- Do not print "Firmware ready **** FAILED ****" if cable is unplugged.
- Drop noisy 'fw_state...curr time...' message.
- Correct nexus display during abort.
- Add a special case error-logging set to '1'.
- Catagorize I/O exception display handling.
- Correct the bsg msg code printing.
- Dont use dynamic logging after host is removed.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
d8424f68c0160c45c446e56cb586fd8b9c538a1a 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>
be5ea3cfa15ddef0bee9dfbc214c2113119087a2 18-Nov-2011 Saurav Kashyap <saurav.kashyap@qlogic.com> [SCSI] qla2xxx: Don't call alloc_fw_dump for ISP82XX.

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>
3173167f015b779e549e1be04707316cce1b57f1 16-Aug-2011 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Issue mailbox command only when firmware hung bit is reset 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>
08de2844c626511cfd1db9c36e5e7d126707f780 16-Aug-2011 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Add support for ISP82xx to capture dump (minidump) on failure.

Minidump allows us to catpure a snapshot of the firmware/hardware states at the
time of failure for further analysis.

[jejb: added missing #include <linux/vmalloc.h>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> ]
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>
58b48576966ed0afd3f63ef17480ec12748a7119 16-Aug-2011 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct inadvertent loop state transitions during port-update handling.

Transitioning to a LOOP_UPDATE loop-state could cause the driver
to miss normal link/target processing. LOOP_UPDATE is a crufty
artifact leftover from at time the driver performed it's own
internal command-queuing. Safely remove this state.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
7c3df1320e5e875478775e78d01a09aee96b8abe 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>
3ce8866ceae87258cf66d1f7fd72abc918753cec 14-Jul-2011 Saurav Kashyap <saurav.kashyap@qlogic.com> [SCSI] qla2xxx: Basic infrastructure for dynamic logging.

This patch adds the dynamic logging framework to the qla2xxx driver.
The user will be able to change the logging levels on the fly i.e.
without load/unload of the driver. This also enables logging to be
enabled for a particular section of the driver such as initialization,
device discovery etc.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
773120e4df1d2bf543345ad850cc92dc1f1bad8a 10-May-2011 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Clear complete initialization control block.

Use proper init_cb_size member which takes into account
MID/non-MID init-cb structure sizes.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
53296788f425def50d09c7e0d773bdeaae57c623 10-May-2011 Saurav Kashyap <saurav.kashyap@qlogic.com> [SCSI] qla2xxx: Update firmware version after flash update for ISP82xx.

The driver keeps a copy of the fw_version within the ha structure.
For ISP82xx, this local copy doesn't get updated, and as a result,
the old firmware version ends up getting displayed. This patch fixes
this issue.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
ec426e106c410b000ac590b6e776d5a6cd9bccd9 30-Mar-2011 Chad Dupuis <chad.dupuis@qlogic.com> [SCSI] qla2xxx: Log fcport state transitions when debug messages are enabled.

Add the inline function qla2x00_set_port_state() so that when a fcport state
transition happens we can log the state transition if debug messages are
enabled.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
a4f92a32a0fb827f7bd40c69f021cf57d3dc4249 30-Mar-2011 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Verify login-state has transitioned to PRLI-completed.

Before driver's own internal state is marked as PLOGI/PRLI
complete. This additional check closes a window seen with
dual-personality initiator/target devices where a driver's
PLOGI/PRLI request occurs within the window after the target's
PLOGI request has completed, but prior to the target's PRLI
arriving and processed by the firmware. Without this additional
check, the firmware will return port-information stating that the
port neither supports target nor initiator functions, causing the
driver to register the rport prematurely to the FC-transport
without the proper 'roles' being set.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
03bcfb57c098016e318e2672028f93ec072a2333 30-Mar-2011 Joe Carnuccio <joe.carnuccio@qlogic.com> [SCSI] qla2xxx: Add test for valid loop id to qla2x00_relogin().

If fabric device has invalid loop id (FC_NO_LOOP_ID) then call
qla2x00_find_new_loop_id() to attempt to obtain valid loop id.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
07e264b76d1db5794614ca3d726fdf1c0399dac0 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>
3e8bb8410fafb36739beeb27e1c2fe76261a80dc 30-Mar-2011 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Remove extraneous setting of FCF_ASYNC_SENT during login-done completion.

The bit is already set upon entry.

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>
f28a0a96130e7557d0cdcba0bcd394735eadfad8 30-Mar-2011 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Check for a match before attempting to set FCP-priority information.

Modifying qla24xx_get_fcp_prio() to return a 'found' status
allows the driver to short circuit the 'set FCP-priority' call
and reduce the amount of noise generated in the messages file:

scsi(5): Unable to activate fcp priority, ret=0x102
scsi(5): Unable to activate fcp priority, ret=0x102

Also make qla24xx_get_fcp_prio() static.

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>
80d79440ad98a660bd6d81e5c06e85581ff6ac46 30-Mar-2011 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct calling contexts of qla2x00_mark_device_lost() in async paths.

The respective done() functions are called from process context,
so there's no reason to 'defer' the request.

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>
e46ef004f8938eb7bc80f350d8efed9bf57f04b3 24-Feb-2011 Saurav Kashyap <saurav.kashyap@qlogic.com> [SCSI] qla2xxx: The ISP82XX should be online while waiting for commands completion.

If adapter is not online, the driver will not process the response queue, even
on getting an interrupt.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
6aef87bea9d37d5adf45f3d1c674ccf6f95799ca 24-Feb-2011 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Clear any stale login-states during an adapter reset.

By not clearing the 'login needed' nor 'login outstanding' states
for an fcport after a big-hammer (adapter reset), the driver may
not properly perform a PLOGI/PRLI sequence (and lose visibility
to the rport) during a follow-on SNS scan.

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>
7190575f7a48c82fd99363748544023739dc4bb8 24-Feb-2011 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Abort pending commands for faster recovery during ISP reset.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
044d78e1acb6614f5d79040e490f1fd9bfa45487 29-Jan-2011 Madhuranath Iyengar <Madhu.Iyengar@qlogic.com> [SCSI] qla2xxx: Change from irq to irqsave with host_lock

Make the driver safer by using irqsave/irqrestore with host_lock.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
7a44b86e777fc5d7a267df984d12b05fca59f487 22-Dec-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Don't perform a BIG_HAMMER if Get-ID (0x20) mailbox command fails on CNAs.

The semantics we employ now in the driver, performing a
BIG_HAMMER in the event of Get-ID (0x20) mailbox command
failing, should only be done for FC. On FC configurations, it
makes sense since advertising is only really performed once,
so a BIG_HAMMER to reinitiate the process is needed to
restart. Under FCoE, this is not needed, as there's a
continous stream of advertisements/ACks at the protocol layer
to initiate a relogin/reinitialization process.

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>
794a5691147652387f4a2ffa890c5c1983e38849 22-Dec-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add sysfs node for displaying board temperature.

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>
21090cbe95189d4ce6135fc8fec2f416b3eb227f 22-Dec-2010 Madhuranath Iyengar <Madhu.Iyengar@qlogic.com> [SCSI] qla2xxx: Update FCP priority information to firmware before sending IOs

The FCP priority info was not being updated properly in certain situations.
Here are the changes that needs to be done to take care of this issue:
1. No need to check fcport->state for FCS_UNCONFIGURED in
qla24xx_update_fcport_fcp_prio(), since an invalid loop id check is
already performed which is sufficient.
2. Add the missing qla24xx_update_fcport_fcp_prio() function call
within qla2x00_update_fcport() function, so that the priority info
is updated on every port addition or change.
3. Perform proper adapter types checking.
4. Other changes, associated with DEBUG/printk's and parameter passing.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
8ae598d02517af967685a671303c4ed10cded3c4 22-Dec-2010 Dan Carpenter <error27@gmail.com> [SCSI] qla2xxx: list cursors are not null

This is just a cleanup.

The unneeded NULL check annoys static checkers because we already
derefenced it and the we check it and then (if it's not the _safe()
version) we dereference it again without checking. And the static
checker is all, "Wah? Is it null or not?"

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
579d12b58abb4bd1161728f0a4a2524258ecf0a3 22-Dec-2010 Saurav Kashyap <saurav.kashyap@qlogic.com> [SCSI] qla2xxx: Added support for quiescence mode for ISP82xx.

Support is added for quiescence mode. This feature is for P3P
adapters. Any of the functions can put the firmware into quiescence
state. All the others have to ack that request. During quiescence mode
current commands are processed and all the new incoming I/Os are
blocked. Loop resync is performed after firmware comes out of
quiescence state.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
38170fa8e66bb75fe806bdc91657732aef0eae90 15-Oct-2010 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Avoid depending on SCSI host_lock in queuecommand function.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
e30d1756480dc5d139458b140b69873cdb10119f 15-Oct-2010 Madhuranath Iyengar <Madhu.Iyengar@qlogic.com> [SCSI] qla2xxx: Addition of shutdown callback handler.

This patch adds a shutdown handler to qla2xxx driver to make sure that all
DMA and firmware activities are stopped, and any associated driver resources
are released. The need for this handler arose when executing kexec in specific
environments caused the data of the 2nd kernel to be corrupted, due to DMA
activities.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
4d97cc5342ebb1bef83477fafe18490dd8c59464 15-Oct-2010 Chad Dupuis <chad.dupuis@qlogic.com> [SCSI] qla2xxx: Change del_timer_sync() to del_timer() in qla2x00_ctx_sp_free().

Using del_timer_sync() in the qla2x00_ctx_sp_free() function may cause a kernel
panic as it is not interrupt context safe and qla2x00_ctx_sp_free() may be
called from a softirq context. Changing the call from del_timer_sync() to
del_timer() will make the function interrupt context safe.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
4da26e162b69d89c3186a35a052c05e61a555637 15-Oct-2010 Chad Dupuis <chad.dupuis@qlogic.com> [SCSI] qla2xxx: Add module parameter to enable/disable GFF_ID device type check.

Add the module parameter ql2xgffidenable to disable/enable the use of the
GFF_ID name server command to prevent non FCP SCSI devices from being added to
the driver's internal fc_port database.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1e6d0670921ea4e736b172e9a3c32a2ba0c33f6a 15-Oct-2010 Chad Dupuis <chad.dupuis@qlogic.com> [SCSI] qla2xxx: Remove port down retry count.

This patch removes the use of the port down retry counter as a mechanism to
update a fcport state. The internal driver counter is a residual carry-over
from pre-FC-transport aware driver inteaction. The ql2xport_down_retry module
parameter and NVRAM set ha->port_down_retry_count remain in order to seed the
fc-host's default dev-loss-tmo.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
542bce1f255673816e82eaebb422ead5ad3f5a17 15-Oct-2010 Dan Carpenter <error27@gmail.com> [SCSI] qla2xxx: locking problem in qla2x00_init_rings()

IRQs are already disabled here so we don't need to disable them again.
But more importantly, the spin_lock_irqsave() overwrites "flags" and
that breaks things when we want to re-enable the IRQs when we call
spin_unlock_irqrestore(&ha->hardware_lock, flags);

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
b1d46989c12ec4d93f274ca8378bb1a6014d244a 04-Sep-2010 Madhuranath Iyengar <madhuranath.iyengar@qlogic.com> [SCSI] qla2xxx: Handle MPI timeout indicated by AE8002

In case the MPI times out, the FW issues an async event AE8002
to indicate this to every FCoE function. The FC/FCoE driver is
required to handle this, by doing a soft reset and issuing a
Write MPI register mailbox command to reset the MPI.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
bddd2d65a48c492d3e585e65df0be89c58b4acda 04-Sep-2010 Lalit Chandivade <lalit.chandivade@qlogic.com> [SCSI] qla2xxx: Update to AER support, do early abort commands.

Currently the IOs are returned back in slot reset, this
could be late and can cause error handler to invoke.
If error handler invokes, eh_abort fails and escalate to
device/bus/host resets causing issues.
The commands need to be returned back to upper layer in
io_error_detected.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
c9afb9a24db2e673971e790ee4c1bac55708f333 04-Sep-2010 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Don't issue set or get port param MBC if port is not online.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
feafb7b1714cf599a6d0fed45801ab3f66046cbd 03-Sep-2010 Arun Easi <arun.easi@qlogic.com> [SCSI] qla2xxx: Fix vport delete issues

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
3dbe756a66afbec6487068d4213ecccc3a18807f 23-Jul-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Cleanup some dead-code and make some functions static.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
de7c5d059dbd245ad80011725f9c86f560e61fff 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>
4d78c973ef2d21e90ff55f97489d663a0959a93f 23-Jul-2010 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Rearranged and cleaned up the code for processing the pending commands.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
14e303d98bcfe4a6075407b531b1df2f237deb28 23-Jul-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Stop firmware before doing init firmware.

If BIOS is enabled then drivers init firmware fails since
BIOS has done the init once.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
e8c72ba51a159f5d1cb195d3fb47262c782939d9 23-Jul-2010 Chad Dupuis <chad.dupuis@qlogic.com> [SCSI] qla2xxx: Use GFF_ID to check FCP-SCSI FC4 type before logging into Nx_Ports

The default method that qla2xxx uses is the GID_PT nameserver command to
get a list of Nx_Ports. This patch adds a GFF_ID call for each port
returned by GID_PT to get the FC4 type. If the FC4 type is not FCP SCSI
then the qla2xxx driver will not record that port in it's port database.
For switches that do not support the GFF_ID command, the behavior will be
for qla2xxx to store that port anyways.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2f0f3f4f06f7cfadebf58b70bd9e7f71d8fd96e4 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>
d94d10e7277069801b4e31b40770314a8421f996 23-Jul-2010 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Removed dependency for SRB structure for Marker processing

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
5b91490e457a88080b4dbc68f4bc2eadd65e30ea 29-May-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: For ISP 23xx, select user specified login timeout value if greater than minuimum value(4 secs).

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
cdbb0a4f31c486e4f6fb6e673a892f4f5205f91c 29-May-2010 Santosh Vernekar <santosh.vernekar@qlogic.com> [SCSI] qla2xxx: Handle outstanding mbx cmds on hung f/w scenarios.

Outstanding mailbox commands, have no way to recover on f/w hung, and we
timeout on waiting for mbx response. This in turn affects the recovery process
as follows:
- We might already be in dpc while waiting for mbx to complete, so recovery for
that pci function will never get invoked. Reset Timeout (10 sec) is far less
than mbx timeout (30 sec).
- Other mbx cmds will get stuck due to serial mbx access.

Solution is to identify fw-hung scenario and handle outstanding mbx commands to
have an early-exit instead of waiting for response.
Other mbx commands waiting for access will also do an early-exit if fw-hung is
still applicable.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
3a6478df74c271cb3be5895b39fddf75e9cef89c 29-May-2010 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Limit rport-flaps during link-disruptions.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
6ac5260850841eb4055811a68ff47d658ebe9a59 29-May-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct async-srb issues.

* hold the hardware_lock throughout the duration of ctx-sp
timeout handling -- could result in use-after-free oops.

* retry a timed-out login-request.

* done() routines are called with the hardware-lock held, issue
qla2x00_mark_device_lost() with proper 'defer' flag.

* FCP2 capabilities are only relevant to target devices.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
d3fa9e7d270e3d9b3fda325cdcb2ea77a00ed876 29-May-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add portid to async-request messages.

This helps to correlate submission/completion messages during
triaging.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
b963752f47c54a29c11acee99e6c99b3c6bb35c5 29-May-2010 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Clear drive active CRB register when not in use.

The CRB drive active register is cleared when driver is unloaded
or when driver enters failed state.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
f1af6208c8cef81e313ec2e64b44e783c3a11c13 05-May-2010 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Updates to ISP82xx support.

1) Allow transition to NEED RESET state only from READY state for ISP82xx.
2) Avoid infinite ISP aborts when chip reset fails.
3) Code cleanup to remove some of the unused debug code.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Santosh Vernekar <santosh.vernekar@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1516ef44835417f55645cdd9ccf203551ca6e8c0 05-May-2010 Mike Waychison <mikew@google.com> [SCSI] qla2xxx: Silence bogus warning by gcc for wrap and did.

The qla2xxx driver uses a port_id_t to mark the start of its enumerations. gcc
is complaining that wrap.b24 may be used uninitialized, but this doesn't look
to be possible. Silence it.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
3822263eb1e74821ad1ae886ddd2184ae9395ff7 05-May-2010 Madhuranath Iyengar <madhuranath.iyengar@qlogic.com> [SCSI] qla2xxx: Support for asynchronous TM and Marker IOCBs.

Currently we can only issue the task management (TM)
commands via the mailbox mechanism. This is a limitation,
since only one mailbox command can be issued at a time.
The purpose of this effort is to provide support for
issuing and processing the respose to TM and Marker
IOCBs asynchronously. Towards achieving this, the
consolidated srb architecture that is currently used for
BSG and IOCB/Logio commands has been enhanced and used.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
4916392b56921b4aaaeaca3ef492135f42fbb5f2 05-May-2010 Madhuranath Iyengar <madhuranath.iyengar@qlogic.com> [SCSI] qla2xxx: Provide common framework for BSG and IOCB commands.

Currently, BSG and IOCB/Logio commands have a different
framework (srb structs). The purpose of this effort is to
consolidate them into a generalized framework for these
as well as other asynchronous operations in the future.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
5ff1d58410ffb160b388d622ef0c6a0411a05559 05-May-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Limit mailbox command contention for ADISC requests.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
99b0bec7bbf3350d1a920a7138fa62c456a8ecf1 05-May-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Further generalization of SRB CTX infrastructure.

Prepare CTX infrastructure for additional asynchronous
executions, add generic done() operator, pull CMD definitions.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
a9083016a5314b3aeba6e0d2e814872e72168c08 13-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>
6c452a45e5d8a93812360a5581e93ac5a8776025 20-Mar-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: General checkpatch corrections.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
09ff701a177b116c6c15b6e501e58fbfb306b424 20-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>
5a0e3ad6af8660be21ca98a971cd00f331318c05 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>
ae97c91eb1f139b19c1e7cbc5c1380dae8ad874e 18-Feb-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add firmware ETS burst support.

Can be used to balance NIC/FCoE traffic distribution.

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
bb2d52b2fd8b19355957e34271f79917f69e4059 18-Feb-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct loop-resync issues during SNS scans.

Original code could inadvertently skip the post processing of
port information returned from the SNS scan, if any link-flopping
asynchronous-events were received (noticed in FCAL topologies).

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
9a069e196767d7b87184fd8d8211d22bb5b9c0b8 12-Jan-2010 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Add BSG support for FC ELS/CT passthrough and vendor commands.

[jejb: fixed printk casting issues]
Signed-off-by: Sarang Radke <sarang.radke@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
f08b7251c40090b8c522a306642944cd7322eebb 12-Jan-2010 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct FCP2 recovery handling.

The driver did not account for non-tape devices needing to employ
proper FCP2 recovery. Driver now checks the FCP2-capable flag
only, rather than using a midlayer-determined flag (TYPE_TAPE).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
858808019313f217d63ec4ad26686e6fb7b08c19 16-Dec-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Extend base EEH support in qla2xxx.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
3064ff39b8121acbd731f64d046218ebf3c2f9c0 16-Dec-2009 Michael Hernandez <michael.hernandez@qlogic.com> [SCSI] qla2xxx: Get the link data rate explicitly during device resync.

When the hba port gets logged out of the fabric, or other
such transitional state when the physical link is still present,
the driver doesn't receive a loop up asyn event (where the link
data rate currently gets set). Hence send a explicit mailbox command
to get the link rate in such conditions.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
3155754a6b7985a80c41d84dd06530ff543f52a8 02-Dec-2009 Anirban Chakraborty <anirban.chakraborty@qlogic.com> [SCSI] qla2xxx: fix for multiqueue in MISX disabled case

Fix to accommodate a hardware bug in multiqueue mode that does not
work properly when acknowledgement of MSIX Interrupts is disabled.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
531a82d1bd73152130b9e3b1f3e2e875c6cff7cd 14-Oct-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Properly re-register FC4/FDMI after physical and logical link disruptions.

Original code would not register FC4 nor FDMI information after a
logical tear-down of an VFC link. Code now triggers registration
date during processing of a 'Report ID Acquisition IOCB', which
is submitted after a FLOGI or FDISC completes.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
f3a0a77e8df2f5c78648ce5971176e610dbc35c0 14-Oct-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Retrieve firmware's maximum number of supported FCFs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
29c5397fc1d28f9b75057644ce8e546671d2a9a9 14-Oct-2009 Lalit Chandivade <lalit.chandivade@qlogic.com> [SCSI] qla2xxx: Reread firmware versions information after an ISP abort.

In some case, the MPI and PHY versions when retrieved after the
Execute-FW mailbox-command are incorrect (255.255.255.255).
Instead, query the information after the check for firmware ready
is done in the abort ISP path.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
67becc0041615651b75e4496204a0835a8c345a8 25-Aug-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Properly delete rports attached to a vport.

Original code would inadvertently skip the deferred
fc_remote_port_delete() call for rports hanging off any vport.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
0d6e61bc6a4f3f54444b088ae6d447f1703a21dd 25-Aug-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct various NPIV issues.

* Consolidate vport-count processing.
* Correct vp_idx restrictions during RSCN processing.
* Push topology verification check to qla2x00_do_dpc_all_vps().
* Don't skip vport full-login-lip/lip-reset mailbox handling.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
ab67114935d611caffe18063d1777f8c4f8b4272 25-Aug-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Further limit device-table (qla_devtbl) lookup to non-24xx.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
8474f3a02a18e18459663ad88951822c62a45068 25-Aug-2009 Santosh Vernekar <santosh.vernekar@qlogic.com> [SCSI] qla2xxx: Correctly set FCF_TAPE_PRESENT flag based on scsi-device.

In fabric-login based on iop BIT_8 firmware notifies presence of
a FCP2 device and not necessarily a TAPE device. So instead of
setting FCF_TAPE_PRESENT flag there we set it using
scsi_device->type after mid-layer scan recognises "type" of the
device.

It also adds a new flag FCF_FCP2_DEVICE for any future use.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
ac280b670e6d6666667aba02324e2fc50bd96ae7 20-Aug-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add asynchronous-login support.

ISPs which support this feature include 23xx and above.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
7163ea815170f8c5d56ead27d7e6fa3fa1f9844b 05-Aug-2009 Anirban Chakraborty <anirban.chakraborty@qlogic.com> [SCSI] qla2xxx: Fix to ensure driver works in sinlge queue mode if multiqueue fails

When the multiqueue mode fails to work, the driver falls back on single
queue mode. This ensures that the firmware is reinitialized with single
queue options and all the resources are readjusted accordingly.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1bb395485160d203a726a19e4fcb1a154748d804 17-Jun-2009 Harish Zunjarrao <harish.zunjarrao@qlogic.com> qla2xxx: Correct iiDMA-update calling conventions.

* To set iiDMA speeds for ISP81XX, bits 5-0 are used whereas for
other older ISPs bits 2-0 are used.
* Pass proper VP index

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>
18e7555a38eaadb757353c4b76667e07166ad26c 03-Jun-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Synchronize MPI settings after a PE Reset.

Ensure MPS remains in synchronization across all NIC/FCoE
functions after a reset.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
656e89122a737b60cebc7b8fcb669faf0e7bc905 03-Jun-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Export additional firmware-states for application support.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
e8233ca40bfe7b9dade6cefc984e305516c4eceb 03-Jun-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Avoid redundant RISC reset during (re)-initialization.

ISP24xx and above ISPs perform a RISC reset in
qla24xx_reset_chip(), which is called prior to
qla24xx_chip_diag().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
eeebcc922326a2ea0302937b425a0d1471cbd6a7 03-Jun-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Fallback enode-mac should not be a multicast address.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
9f8fddeef2264a0315032b0aa2ee0052dad90076 03-Jun-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add 10Gb iiDMA support.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
f4658b6ccc9d54b28b89004accc989db185b6a2e 03-Jun-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Mark a port's state as needing-rediscovery during link disruptions.

With RSCN states not being kept across qla2x00_configure_loop()
invocations, loop-resync distruptions during fabric-discovery may
cause ports to remain in a lost state. Force state
renegotiation during a follow-on configure-loop iteration.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
ca9e9c3eb118d0cb9dc2e5232f6f2dcaa4b7a5e0 03-Jun-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Check status of qla2x00_get_fw_version() call.

Unlike earlier ISPs, recent ISPs (ISP81xx) can in fact fail this
mailbox command.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
cbc8eb67da11a4972834f61fe4729f4c037a17c9 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>
1b91a2e6712393cffc33eeff5cf857f7d5b62fed 03-Jun-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct logic-bug in set-model-info().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
e5b68a61e15ca8e200c60cfd4dbe1818e6beb4e1 07-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>
e337d9070e5821e7c8e5973679bdd34376263bd1 07-Apr-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add an override option to specify ISP firmware load semantics.

As it may be useful during debugging to use a specific firmware
image.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
b469a7cbe9bf68939c90f4ac6bc2bb99e47d7229 07-Apr-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Don't try to 'stop' firmware if already in ROM code.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
7d0dba174af217c73931532adf6bffb91d16c40f 07-Apr-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Restrict model-name/description device-table usage.

Information present in static table is only valid for pre-ISP25xx
adapters.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
67c2e93ae7465a3e279503ceddd7bd153d74bcf8 07-Apr-2009 Anirban Chakraborty <anirban.chakraborty@qlogic.com> [SCSI] qla2xxx: Remove reference to request queue from scsi request block.

srbs used to maintain a reference to the request queue on which
it was enqueued. This is no longer required as the request queue
pointer is now maintained in the scsi host that issues the srb.

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>
2afa19a9377ca61b9489e44bf50029574fbe63be 07-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>
7640335ea5b1a2da0d64303e6003012c619ae01a 07-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>
24a081386e4236e10e80af4c62d5f6e68feb2081 24-Mar-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Explicitly set the execution-throttle with recent ISPs.

Firmware semantics changed for 24xx and above ISPs in their
handling of the specified execution-throttle passed during
firmware initialization. The original codes use of a theoretical
maximum (0xffff, as carried over from earlier ISPs) could in fact
act as a throttle in some circumstances. Now set the value based
of the firmware's own 'resource' (exchange IOCBs) capabilities.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
d743de66754a662399bd9fe7da7a34e189f71876 24-Mar-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Reduce request queue-size overhead with recent ISPs.

The original code to 'resize request-queues' based on iocb-counts
and employed during early ISP23xx testing was too
overly-pessimistic with regards to latencies in the firmware
pulling requests. Recent ISPs can easily keep up processing a
stream of commands from an abbreviated (effectively, half the
original size) queue.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
3d79038f92841052aced9aec43c9d9aa864d28ab 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>
ddb9b12632ab28460c281d50963bbe3eeda5984a 24-Mar-2009 Shyam Sundar <shyam.sundar@qlogic.com> [SCSI] qla2xxx: Cleanup unused flags and #defines.

General cleanup of extraneous/legacy crud.

Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2533cf671da0603129c8af9c31c735e1d2654e20 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>
1d2874de809a14e6780246b99a18bbc0fc0a8f2a 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>
55a961581fd34632bf724dd144c0dbf740c9fede 24-Mar-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Update MPI/PHY version retrieval codes.

Reflects layout and format of latest specification.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
b64b0e8fd964ce637794d4aaa772db1ae4298ea9 24-Mar-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Pass in optional extended-initialization control block.

Recent ISPs use this data to configure FCF information.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
dda772e8e3b9832d3368f84df3a3b7ec7dfbd9f0 24-Mar-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Always (re)read firmware version/capabilities information.

With recent ISPs loading firmware from flash, a flash-update to
the firmware-image region with a follow-on reset will reload the
new image.

Original caching of data only made sense when firmware was bound
with the driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
7d9dade34b72a0fe12a0ac63259b4810602736fe 24-Mar-2009 Giridhar Malavali <giridhar.malavali@qlogic.com> [SCSI] qla2xxx: Correct over-allocation of firmware-dump buffer.

fce_size should be calculated based on the FCE_SIZE #define.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
c6b2fca8205dc33e3bb444835769e4ea4c6bc58d 05-Mar-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct truncation in return-code status checking.

QLA_* return codes are 'int' in size. There were still several
legacy check-points which assumed a return-code width of 8-bits.
This could cause incorrect assumptions of 'good' status if a
return of QLA_FUNCTION_TIMEOUT.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
ee546b6e048586381462ce7bb51c7ddc03819619 05-Mar-2009 Anirban Chakraborty <anirban.chakraborty@qlogic.com> [SCSI] qla2xxx: Correct vport delete bug.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
605aa2bcd5e9dddc4666f12e0c19822809186d6d 05-Mar-2009 Lalit Chandivade <lalit.chandivade@qlogic.com> [SCSI] qla2xxx: Use correct value for max vport in LOOP topology.

Use minimum value for max vport during firmware initialization in LOOP
topology. Using max vport value from get resource count in LOOP topology
causes firmware initialization failure.

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>
618a752319503a64d1b66615e8ea2a0e7edaf914 09-Feb-2009 Anirban Chakraborty <anirban.chakraborty@qlogic.com> [SCSI] qla2xxx: Remove interrupt request bit check in the response processing path in multiq mode.

Correct response-queue-0 processing by instructing the firmware
to run with interrupt-handshaking disabled, similarly to what is
now done for all non-0 response queues. Since all
response-queues now run in the same mode, the driver no longer
needs the hot-path 'is-disabled-HCCR' test.

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>
eaac30be268b90e9288b3945fb5cc9ee8c5397c0 22-Jan-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Modify firmware-load order precedence for ISP81XX parts.

Pre-ISP81XX parts (including ISP24xx and ISP25xx) could contain a
firmware image within a segment of flash, driver would fallback
to loading this firmware if the request-firmware interface failed
(userspace .bin file). Moving forward, all ISP81XX parts will
ship with a suggested-to-be-used firmware image within flash
which all driver should first attempt to load. If the flash
firmware load fails, the driver will then fallback to loading
firmware via the request-firmware interface (ql8100_fw.bin).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
09ff36d30c27ee23b50ffb419c80a0aaef1db4a0 22-Jan-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Ensure RISC-interrupt-enabled consistency for IS_NOPOLLING_TYPE() ISPs.

Original code should work as well given qla24xx_reset_adapter()
is only called in extreme cases where the HBA is taken offline.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
29bdccbee69c199910b2b39377e66ee5c33f241c 09-Jan-2009 Anirban Chakraborty <anirban.chakraborty@qlogic.com> [SCSI] qla2xxx: Fix ISP restart bug in multiq code

After restarting ISP the additional queues are not being setup correctly. The
following patch fixes the issue.
Please apply.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
3a03eb797ce76ae8868a1497e9e746ad0add1e3b 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>
bb99de6703526ebed42e29b8dee402df235f28c7 05-Jan-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Collapse EFT/FCE copy procedures during a firmware dump.

In preparation for new ISP types with varying dump procedures.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
124f85e6cc0290a85adb7e14cd90e96105f4f9fb 05-Jan-2009 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Don't fallback to interrupt-polling during re-initialization with MSI-X enabled.

ROMs in recent ISPs have MSI-X support, so it's no longer
necessary for the driver to fallback to interrupt polling during
ISP re-initialization.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
1ded85e2850b7b890fb6b51241429ed685ec2763 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>
17d98630a4f2a38537618503ad0c7ec97ba461ca 18-Dec-2008 Anirban Chakraborty <anirban.chakraborty@qlogic.com> [SCSI] qla2xxx: changes in multiq code

Following changes have been made:
1. Scan outstanding commands only in the queue where it is submitted
2. Update queue registers directly in the fast path
3. Queue specific BAR is remapped only for multiq capable adapters

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
73208dfd7ab19f379d73e8a0fbf30f92c203e5e8 10-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>
e315cd28b9ef0d7b71e462ac16e18dbaa2f5adfe 06-Nov-2008 Anirban Chakraborty <anirban.chakraborty@qlogic.com> [SCSI] qla2xxx: Code changes for qla data structure refactoring

Following changes have been made:

1. Outstanding commands are based on a request queue, scsi_qla_host
does not maintain it anymore.

2. start_scsi is accessed via isp_ops struct instead of direct
invocation.

3. Interrupt registrations are done using response queue instead of
device id.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
680d7db88ace53c673e1c437c9b6abcc053e8d6f 25-Oct-2008 Shyam Sundar <shyam.sundar@qlogic.com> [SCSI] qla2xxx: Do not honour max_vports from firmware for 2G ISPs and below.

For 23XX ISPs, max_vports may return an invalid value.
Do not honour it.

Cc: Stable Tree <stable@kernel.org>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
737faece278ffec78612675bc378a4258d8293bb 25-Oct-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Use pci_disable_rom() to manipulate PCI config space.

http://bugzilla.kernel.org/show_bug.cgi?id=9422

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
cc3ef7bc40bbede7bbd0bb395d6452a575e95efe 12-Sep-2008 Bjorn Helgaas <bjorn.helgaas@hp.com> [SCSI] qla2xxx: Fix "occured" spelling errors.

Fix "occured" spelling errors. Most of these are in comments, which
I wouldn't normally bother with, but a couple are in printks, which
irritate me more. So I just fixed them all at the same time.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
c00d8994d91e51aa6b891ad0e877f66cc1011de2 12-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>
4b89258c7320bab4155b692e76ae9ffdd85e79be 12-Sep-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Change GFP_ATOMIC to GFP_KERNEL for non-atomic allocations.

Both call-sites are sleeping-capable.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
946fb8915a47bbd76de75b2ae7f1c7e92c0666ca 14-Aug-2008 Mike Hernandez <mike.hernandez@qlogic.com> [SCSI] qla2xxx: Set npiv_supported flag for FCoE HBAs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
a7a28504bfa61dc6caa495f55c52623d10b42b32 14-Aug-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct vport-state management issues during ISP-ABORT.

* Use correct 'ha' to mark a device lost from ISR.
I/Os will always be returned on the physical-HA.
qla2x00_mark_device_lost() should be called with the HA bound
to the fcport.
* Mark *all* devices lost during ISP-ABORT (bighammer).

These fixes correct issues discovered locally where during
link-perturbation and heavy vport-I/O fcport/rport states would
stray and an rport's scsi-target lost (timed-out).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
c9c5ced90abc22a94c96fa7db0e29c13483a6db0 24-Jul-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Additional NPIV corrections.

Minor fixes addressing:
- rport managements during vport deletion.
- acquire proper physical-ha during qla24xx_abort_command() and
qla24xx_queuecommand()
- do not needlessly acquire the pha for non-NPIV capable ISPs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
8201e207997b4665a5fcb375bab293fddb2e6adb 24-Jul-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Issue proper ISP callbacks during stop-firmware.

As the original code would incorrectly call the non-ISP24xx/25xx
callbacks during recovery, a stop-firmware failure could result
in improper bit-banging of the RISC and in some cases manifest in
a NMI-watchdog trigger due to the RISC not coming out of its
reset state.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
6d0525292ad13f17abcd4a21e488d5b667e90668 11-Jul-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Don't hardcode fw_transfer_size for ISP2[45]xx parts.

Use the full buffer size available, as there's no reason to limit
the firwmare-image load-segment size for these parts.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
42e421b184967c8bc70d72eed8e1b179e9a51acb 11-Jul-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Verify the RISC is not in ROM code if firmware-load is disabled.

Add an additional check to verify that the current executing
firmware is in fact non-ROM code. The non-ROM Get-ID mailbox
command is used for verification.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
5de1f70f4103253f72d92da16d9618bc573b4534 11-Jul-2008 Seokmann Ju <seokmann.ju@qlogic.com> [SCSI] qla2xxx: Correct rport/fcport visibility-state handling during loop-resync.

There were several issues here, one, during RSCN handling if a
follow-on RSCN occurred (within interrupt context) the DPC thread
could inadvertantly leave the fcport in a stale lost state.
Secondly, scheduled rport removal is handled exclusively by the
'parent' DPC thread, so wake up the proper thread. Finally,
process vport loop-resync's only when the vport has in an
"active" state (ID acquired).

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
246de42cfc0abc4e25585f2dca53f8226f62391c 11-Jul-2008 Seokmann Ju <seokmann.ju@qlogic.com> [SCSI] qla2xxx: Always aquire the parent's hardware_lock.

While issuing a marker, manipulating the request/response queues
and modifying the outstanding command array.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
436a7b11234ccccd91e3000aacdbdd25bd7847a8 11-Jul-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Swap enablement order of EFT and FCE.

The firmware group has suggested that FCE (Fibre Channel Event)
tracing be enabled prior to EFT (Extended Firmware Tracing) to
maximize the capturing of data on the wire. This change has no
real semantic effect on driver operation, as it's mostly a
shuffling of code.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
1ee2714632ce3f7e6477069b41cb685112f5f217 11-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>
e5896bd5dcf71fa43ddcc545340b847c13d29c44 11-Jul-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Allow the user the option of disabling iIDMA.

iIDMA support requires the driver issue several additional
fabric-managegment (FM) commands per port discovered during SNS
scanning -- GFPN (Get Fabric Port Name) and GPSC (Get Port Speed
Capabilities). It has been found during testing that some
switches do not respond as *well* as expected to these commands
(silence -- no ACC nor BS_RJT). So, to handle such conditions,
allow the user the ability to indirectly disable the FM commands
by disabling iIDMA with the ql2xiidmaenable module-parameter.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
e5f5f6f72b10c4c6209f0522a7c5b27079d64429 11-Jul-2008 Harish Zunjarrao <harish.zunjarrao@qlogic.com> [SCSI] qla2xxx: Track total number of ISP aborts.

This parameter counts the total number of ISP aborts during
driver execution. The value is exported through a DEVICE_ATTR()
off the scsi_host.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
5f3a9a207f1fccde476dd31b4c63ead2967d934f 11-Jul-2008 Seokmann Ju <seokmann.ju@qlogic.com> [SCSI] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
c6852c4c5984fff130a859792d4b26d30c85c54b 25-Apr-2008 Seokmann Ju <seokmann.ju@qlogic.com> [SCSI] qla2xxx: Correct misc. endian and byte-ordering issues.

There were several places in the driver which could cause byte
ordering problem as provided by Al Viro
<viro@ZenIV.linux.org.uk>.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
d4486fd6deb3354aa39cfedfcfd114cfe9ff9238 03-Apr-2008 Seokmann Ju <seokmann.ju@qlogic.com> [SCSI] qla2xxx: Consistently access the physical HA port.

There were several places where referencing ha structure of
virtual ports for resources. Among those refereces, certain
fields are get up-to-dated only on ha structure of physical port.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
4d4df1932b6b116aecc81039066fec27f2050762 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>
7d232c745ef2ce141cc9d9538421affa32846fdb 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>
587f4cae4a8ce1315c3def2229c2a912637269b6 03-Apr-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Cruft cleanup of functions and structures.

Strip unused (DEBUG-ONLY) enabled functions, inlines, useless
wrappers, and unused DPC flags from the code. Another step in
the migration towards a cleaner (less-crusty) driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
cb8dacbf1110d8bd39413f3116ff1720f757854e 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>
5ab5a4dd5444db0715b5748bab916725138d3a32 03-Apr-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Use an rport's scsi_target_id member consistently throughout driver.

Rather than using a duplicate/cached value stored in the driver's
internal fcport structure.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
01e58d8eac93f3b73246b8d0bdee071d9fb85661 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>
00a537b8204c7360852379b4d56adbeedecc9bb9 28-Feb-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct usage of inconsistent timeout values while issuing ELS commands.

The original code would incorrectly hardcode ELS timeout values
rather than using the traditional '2 * r_a_tov' value. In some
cases, the hardcoded values would be larger than the
mailbox-command-timeout and result in a needless BIG_HAMMER (ISP
reset), the typical recovery mechanism employed in such cases.

The second defect in the original code was in the assignment of
the default 'ha->r_a_tov' to twice the traditional value.
Correct this by setting the value to 10 seconds.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
7c7f1f299b7f21f1f5fd4fa3da6b626406109f30 28-Feb-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct needless clean-up resets during shutdown.

There's no point in hitting the RISC with what will most
assuredly be an unsucessful reset of the RISC hardware if the
initial stop-firmware mailbox command fails with a time-out
status. Instead, to avoid what could amount to a lengthy
stop-firmware/detect-failure/reset-risc loop, continue with
driver unloading and discard the stop-firmware requirement.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
3db0652ef986f3bc3d779c4f986330ee3fdd50cc 31-Jan-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Consolidate RISC-parity enablement codes.

Collapse duplicate codes called during probe() and RISC-reset
into qla2x00_setup_chip().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
0afb467b4757adb9c6e3817f2e752d658a494352 31-Jan-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Clear EFT buffer before firmware reinitialization.

To insure that there is no stale data present during EFT
re-registration.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
df4bf0bb5b077545031e8ad5ef3cc0dd8a5fbe05 31-Jan-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Cleanup any outstanding SRB resources during shutdown.

Refactor SRB-failure completion codes in the process. Also,
signal the DPC routine to complete sooner as backend processing
at shutdown-time is superflous.

[jejb: resolve conflicts with pci_enable_device_bars removal]

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
c48339decceec8e011498b0fc4c7c7d8b2ea06c1 17-Jan-2008 Seokmann Ju <seokmann.ju@qlogic.com> [SCSI] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command.

There is a case where 54xx HBA loads MID firmware as it use 24xx
firmware. In this case, the driver should issue
MBC_MID_INITIALIZE FIRMWARE even though the HBA doesn't support
NPIV. This patch make changes in the driver so that could behave
accordingly.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
fc44765f5a232d451fa58a04606b254ac257b429 17-Jan-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct late-memset() of EFT buffer.

Original code would clear the buffer after the firmware had
already been initialized to use the buffer, thus potentially
and inadvertantly clearing data previously DMA'd by the
firmware.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
df613b96077cee826b14089ae6e75eeabf71faa3 17-Jan-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add Fibre Channel Event (FCE) tracing support.

FCE support enables the firmware to record FC extended link
services and basic link services frames which have been
transmitted and received by the ISP. This allows for a limited
view of the FC traffic through the ISP without using a FC
analyzer. This can be useful in situations where a physical
connection to the FC bus is not possible.

The driver exports this information in two ways -- first, via a
debugfs node exported for all supported ISPs under:

<debugfs_mount_point>/qla2xxx/qla2xxx_<host_no>/fce

where a read of the 'fce' file will provide a snapshot of the
firmware's FCE buffer; and finally, the FCE buffer will be
extracted during a firmware-dump scenario.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
00b6bd25166e2a4bad23c614c10c55993bb2489e 17-Jan-2008 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Trace-Control naming cleanups.

In preparation for FCE (Fibre Channel Event) tracing support.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
eb66dc60be5a72bc940458a5adfd400e4d810d49 12-Nov-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct NPIV support for recent ISPs.

Firmware will export to software the maximum number of vports
supported for any given firmware version and ISP type. Use this
information rather than the current hardcoding of limitations
within the driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
39bd962269f0f10ba890aea4769693f8f9a3cb47 20-Sep-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Limit iIDMA speed adjustments.

Do not adjust the iIDMA speed on ports which have a faster
link-speed than the HBA itself.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
4d0ea24769c81581b8fd25fd7deff281b1b97dee 20-Sep-2007 Seokmann Ju <seokmann.ju@qlogic.com> [SCSI] qla2xxx: Retrieve max-NPIV support capabilities from FW.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
bbfbbbc1182f8b44c8cc4c99f4a3f3a512149022 11-Aug-2007 Mariusz Kozlowski <m.kozlowski@tuxland.pl> [SCSI] kmalloc + memset conversion to kzalloc

In NCR_D700, a4000t, aic7xxx_old, bvme6000, dpt_i2o, gdth, lpfc,
megaraid, mvme16x osst, pluto, qla2xxx, zorro7xx

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
a3cbdfad15dee42eb2d17d28fd36447082278dc9 13-Aug-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct 8GB iIDMA support.

Original implementation manipulated the FC_GS values for
port-speed. Transition the codes to use the driver's own
internal representations as this makes for a reduction in
duplicate 'conversion' codes throughout the driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
8fef696b00b863c8c898293bd09be581b934849b 13-Aug-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Don't modify parity bits during ISP25XX restart.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
281afe1947d855661754850de29d7530b2ff18dc 26-Jul-2007 Seokmann Ju <seokmann.ju@qlogic.com> [SCSI] qla2xxx: fix to honor ignored parameters in sysfs attributes

This is a patch to fix 'segmentation fault' issue which was initiated
by Richard Lary <rlary@us.ibm.com>. Thanks again Richard.

- on following sysfs attritute function, changes have made so that both
count and offset input parameters are honored by the functions.
= qla2x00_sysfs_read_nvram()
= qla2x00_sysfs_read_vpd()
- made changes so that NVRAM data to be cached to minimize H/W accesses
during agent querying of the driver's.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
c3a2f0dfe1cecac76950f340f540c1a887dd2500 20-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>
af6177d88d76834b4d05499482d471d64559a6af 20-Jul-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Use pci_try_set_mwi().

As the "must-check" return-value of pci_set_msi() is never
really checked.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
f85ec187dcd65c76dcb29f70ff3b5c7f2ae37cc8 20-Jul-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Use PCI-X/PCI-Express read control interfaces.

Original from Peter Oruba <peter.oruba@amd.com>. Additional
cleanups included.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
fd34f55694a784052981977cb84c50ea369ffc68 20-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>
c76f2c013f7fce83d54acd9d414af7e989e0a1dd 20-Jul-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Generalize iIDMA support.

In preparation for new ISP types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
e428924ccdf4644c58e23c2314ab970ff3afc607 20-Jul-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Generalize FW-Interface-2 support.

In preparation for new ISP types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2c3dfe3f6ad8daff5acdb01713e4f2b116e78136 05-Jul-2007 Seokmann Ju <seokmann.ju@qlogic.com> [SCSI] qla2xxx: add support for NPIV

Following patch adds support for NPIV (N-Port ID Virtualization) to the
qla2xxx.

- supported within switched-fabric topologies only.
- supports up to 63 virtual ports on each physical port.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
44c10138fd4bbc4b6d6bff0873c24902f2a9da65 09-Jun-2007 Auke Kok <auke-jan.h.kok@intel.com> PCI: Change all drivers to use pci_device->revision

Instead of all drivers reading pci config space to get the revision
ID, they can now use the pci_device->revision member.

This exposes some issues where drivers where reading a word or a dword
for the revision number, and adding useless error-handling around the
read. Some drivers even just read it for no purpose of all.

In devices where the revision ID is being copied over and used in what
appears to be the equivalent of hotpath, I have left the copy code
and the cached copy as not to influence the driver's performance.

Compile tested with make all{yes,mod}config on x86_64 and i386.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15576bc8adb33d58867942385ae849cc48379610 08-May-2007 David S. Miller <davem@sunset.davemloft.net> [QLA2XXX]: Fix build on sparc.

We now use pci_device_to_OF_node() to get properties
and of_get_property() returns const pointers.

Signed-off-by: David S. Miller <davem@davemloft.net>
a157b1014f9eaf7f80f9105defed2117c5f6653c 07-May-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct pci_set_msi() usage semantics.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
75edf81d337ea84a291f0fdae2777cfd07045eca 07-May-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Attempt to stop firmware only if it had been previously executed.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
4e08df3f91837656c36712f559d5ce8d80852760 16-Apr-2007 David Miller <davem@davemloft.net> [SCSI] qla2xxx: fix regression on sparc64

Some sparc64 boxes don't have a valid NVRAM (from which the driver
takes its WWPN) try to extract this from open firmware instead and if
that fails, fall back to a default, which would be invalid if more
than one machine on the same SAN does this, since two machines with
the same WWPN would be illegal, so warn when taking this potentially
invalid default.

Tested on SunBlade-1000:

Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
7c98a046b76a3a858c21b75235bf146493b76e11 29-Jan-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Fixup printk() with proper new-line character.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
7aef45ac92f49e76d990b51b7ecd714b9a608be1 29-Jan-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Fail initialization when inconsistent NVRAM detected.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
9bb9fcf2f2b4deeb3ae8a44ed4b8686302297030 29-Jan-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Refactor set-HBA-model/description code.

Limit assignments via qla2x00_model_name[] array to HBA
subsystem vendor IDs equal to QLogic.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2603221a285e32a1033dcefa8de38a989a7633e0 29-Jan-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Set correct cabling state during initialization.

Previous work to add asynchronous-scsi-scanning support
(d19044c32baadeb80e135027124a9e845c6f057c) caused peculiar
semantic changes when no cabling was attached to the HBA
whereby unneeded and intrusive 'error-handling' would take
place due to the initial link state being unset.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
30c4766213aeb684ee477ac7f36703f9134ac7ad 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>
a8488abefaa863a0c3a19888f03395adb3f1c6d2 29-Jan-2007 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add MSI-X support.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
0c8c39af1699227e5a5d13e54a71f93347fe4f61 14-Dec-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct reset handling logic.

- honor ISP24XX NVRAM settings for lip-reset, full-login-lip, and
device-reset.
- correct LIP_FULL_LOGIN mailbox command issuance.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
23be331d9e5077edf07d73813f870d3b895c8593 24-Nov-2006 Adrian Bunk <bunk@stusta.de> [SCSI] qla2xxx: make qla2x00_reg_remote_port() static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d19044c32baadeb80e135027124a9e845c6f057c 22-Nov-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: defer topology discovery to DPC thread during initialization.

Modify intialization semantics:

- perform basic hardware configuration only (as usual)
- allocate resources
- load and execute firmware

- defer link (transport) negotiations to the DPC thread
- again the code in qla2x00_initialize_adapter() to stall probe()
completion was needed for legacy-style scanning.
- DPC thread stalls until probe() complete.

- before probe() completes, set DPC flags to perform loop-resync logic
(similar to what's done during cable-insertion/removal).

Benefits: user does not have to wait 20+ seconds in case the FC cable
is unplugged during driver load, code consolidation (removal of
redundant link negotiation logic during initialize_adaoter()), and
finilly, the driver no longer needs to defer the fc_remote_port_add()
calls to hold off lun-scanning prior to returning from the probe()
function.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
18c6c12759813c988bb05796d1b3352e98ae77de 13-Oct-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Workaround D3 power-management issues.

Early ISP2432 parts have a known hardware issue when coming
out of a D3 hot state. This issue can result in a hung PCIe
link. Recent firmwares contain a workaround whereby the
stop-firmware mailbox command prevents the ISP from entering
the D3 hot state.

In order to ensure that the workaround succeeded the driver
must verify that the stop-firmware mailbox command completes
successfully. In the event of a failure, the driver
attempts a shutdown-retry after resetting the ISP and
re-executing firmware.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
11010fecd2a1fdae684237b61709367ae6a93289 06-Oct-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] Maintain module-parameter name consistency with qla2xxx/qla4xxx.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d7a297baa6edea94167163bed808c6a8933bd5aa 05-Oct-2006 Frederik Deweerdt <deweerdt@free.fr> [PATCH] fix qla{2,4} build error

commit 0181944fe647cae18d545ac1167df3d15d393701 adds a
'extended_error_logging' global variable to qla2xxx which is defined by
qla4xxx too.

Trying to build both drivers results in the following error:

LD drivers/scsi/built-in.o
drivers/scsi/qla4xxx/built-in.o: In function `qla4xxx_slave_configure':
drivers/scsi/qla4xxx/ql4_os.c:1433: multiple definition of `extended_error_logging'
drivers/scsi/qla2xxx/built-in.o:drivers/scsi/qla2xxx/qla_os.c:2166:
first defined here
make[2]: *** [drivers/scsi/built-in.o] Error 1
make[1]: *** [drivers/scsi] Error 2
make: *** [drivers] Error 2

The following patch simply adds a qla2_ (qla4_ respectively) prefix to
the variable name.

Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
90991c85d398fd46b2b07440b5639eb50dfacb2b 02-Oct-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add support for fabric name FC transport attribute.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d8b4521349274ab610d0b29384c704444e55cbca 02-Oct-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add iIDMA support.

iIDMA (Intelligent Interleaved Direct Memory Access) allows for
the HBA hardware to send FC frames at the rate at which they can
be received by a target device. By taking advantage of the
higher link rate, the HBA can maximize bandwidth utilization in a
heterogeneous multi-speed SAN.

Within a fabric topology, port speed detection is done via a Name
Server command (GFPN_ID) followed by a Fabric Management command
(GPSC). In an FCAL/N2N topology, port speed is based on the HBA
link-rate.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
476e8978d9ccacfc911bd42e083dd784ad1465b1 23-Aug-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Properly re-enable EFT support after an ISP abort.

Software must explicitely re-enable extended firmware tracing
after any ISP abort condition.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
413975a0f1a43a896490fc5c589d05c95624c6d2 30-Jun-2006 Adrian Bunk <bunk@stusta.de> [SCSI] qla2xxx: make some more functions static

Make 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>
3ea66e28c20e3b23749c9001c58b37ad44263442 24-Jun-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correctly set the firmware NOS/OLS timeout during initialization.

Original code incorrectly assigned it to the driver's
link-down-timeout value (a value in seconds).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
7d7abc77cc469ff41dde8eea606e1dab88d4ba86 24-Jun-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct 'loop-down' determination logic in qla2x00_fw_ready().

As there is no point in failing the initialization process when
firmware informs the host software that it could not transition
beyond a CONFIG_WAIT nor WAIT_FOR_LOGIN state. Previous logic
would mark such conditions as a general *failure* and subsequently
tear-down the scsi-host during initialization.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
0181944fe647cae18d545ac1167df3d15d393701 24-Jun-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add support for extended error logging.

Similar in form to QLogic's standard offering -- via
the 'extended_error_logging' module parameter.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
744f11fdb1118c9306303529263e5ed09b463a0f 24-Jun-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Cleanup DEBUG macro usage.

- macro usage statements should terminate with a ';'
- remove unused macros.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d4c760c2119fca982f335d83ff9095479c5d6737 24-Jun-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add NVRAM 'Disable Serdes' bit support.

The host section of ISP24xx NVRAMs contain a new bit which
allows a user to selectively disable ports of an HBA. These
ports (hosts) will not be presented to the midlayer.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
a7a167bf7e2d196fc33f292e7b02e90fee03bc9a 24-Jun-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Rework firmware-trace facilities.

- Defer firmware dump-data raw-to-textual conversion to
user-space.
- Add module parameter (ql2xallocfwdump) to allow for per-HBA
allocations of firmware dump memory.
- Dump request and response queue data as per firmware group
request.
- Add extended firmware trace support for ISP24XX/ISP54XX chips.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
179e09172ab663b8587ecc46bb18a56a770304a9 26-Jun-2006 Akinobu Mita <mita@miraclelinux.com> [PATCH] drivers: use list_move()

This patch converts the combination of list_del(A) and list_add(A, B) to
list_move(A, B) under drivers/.

Acked-by: Corey Minyard <minyard@mvista.com>
Cc: Ben Collins <bcollins@debian.org>
Acked-by: Roland Dreier <rolandd@cisco.com>
Cc: Alasdair Kergon <dm-devel@redhat.com>
Cc: Gerd Knorr <kraxel@bytesex.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frank Pavlic <fpavlic@de.ibm.com>
Acked-by: Matthew Wilcox <matthew@wil.cx>
Cc: Andrew Vasquez <linux-driver@qlogic.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
21333b481159a78b5379b8ddb400efafd5857d55 18-May-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct issue where driver improperly issued SNS commands in N2N topologies.

Semantic changes in ISP24xx firmware behaviour inadvertently
caused the driver to believe an F-port topology was present in an
N_port-to-N_port configuration.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d4e3e04d789ba23027c66e176b10ac7477906948 18-May-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Consolidate firmware-dump handling across ISPs.

Simplify and centralise buffer allocation/deallocation, as
there's no point in having two memory request methods.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
441d1072040823feb4950a21094860bfddd310c0 18-May-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Remove obsolete firmware-loader-module support.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
4971cd221ad3f1266b87aa0e996d082d91bac2a6 18-May-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Remove unused port-type RSCN handling code.

Expandind on the previous commit:

commit 79f89a4296ff22f09baf538d4ff2a6d0c3097a73
Author: andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com>
Date: Fri Jan 13 17:05:58 2006 -0800

[SCSI] qla2xxx: Disable port-type RSCN handling via driver state-machine.

and given:

- the process-context requirements of the FC transport
rport-APIs.
- lack of port-type RSCN processing logic for ISP24xx and newer
chips.

it's time now to remove the state-machine logic from mainline.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
75bc4190701d3c6bdffdc21c8a9e17751de9f77a 18-May-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Drop unused driver cruft.

- structure definitions.
- structure members.
- #define's.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
5341e868fb2e98090a68860a35bf4c11d7f8e5da 18-May-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add support for alternate WWN NVRAM setting.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
fd0e7e4dd507cd21d714d34a1cc1a620d01e9772 18-May-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct endianess comparisons during ISP24xx NVRAM configuration.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
ffb39f0324b56bacaabac26133143cf861d0e9f9 18-May-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: ABBA lock ordering fix.

In qla2x00_reset_chip the driver first takes the hardware lock,
and then later on takes the mbx lock.

In the mailbox_command code.. it goes the other way around.

Discovered with the lock validator.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d1c61909c05ead100f855e640fba53925d0665ac 18-May-2006 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Update ISP24xx firwmare loading heuristics.

If firmware image is unavailable via request_firwmare(), then
attempt to load the image (likely out-of-date) stored in flash
memory.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
9a52a57cb9d247fc1cea018fd3f4421f8fd6642a 09-Mar-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct FCAL login retry logic for ISP24xx.

ISP24XX FW does not support Mbx 0x74 ie Login Local Port.
Added the equivalent code for ISP24XX ie to relogin in non
fabric case for ISP24XX use login iocb.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
4a59f71d7f0d6dd433fd509584352cdd7c62e877 09-Mar-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Further restrict ZIO mode support.

Only support ZIO mode 6 on specific ISP types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
6f6417905cf272337a9762e1f92a1fffa651fcd3 09-Mar-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add VPD sysfs attribute.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1328962eb4b00dd1cfd1ffb863b1612b08751768 09-Mar-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: NVRAM id-list updates.

Resync with latest NVRAM subsystem ID list.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
48c02fde949f15920c0018d33d285fd39730d24b 09-Mar-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Consolidate ISP63xx handling.

As new 23xx firmware will accomidate ISP63xx types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
044cc6c8ec311c4ddeebfcc31c53dea282de70b7 09-Mar-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add ISP54xx support.

Chip is similar in form to our ISP24xx offering.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
ea5b6382fde00e0dbcd0de2e4aa2fd15705e5fc3 09-Mar-2006 andrew.vasquez@qlogic.com <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>
392e2f651c8a83484116a407a9f121e534c22b5a 01-Feb-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add host-statistics FC transport attributes.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
77427f514f88143bfef41ba8c1e624bc45f42297 20-Jan-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Drop legacy 'bypass lun scan for tape device' code.

Internal lun discovery has been removed since fc_transport
integration. Short-circuiting for tape-devices in
qla2x00_update_fcport() could inadvertently result in a
blocked rport timing-out and its targets being reaped.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
052c40c83b4ca37be226112049b60097cb9961e1 20-Jan-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct issue where the rport's upcall was not being made after relogin.

A target can LOGO an initiator at any time (i.e. during I/O,
due to a controller hicup, or as a simple authentication
mechanism after an initial CDB command), when this occurs,
the driver attempts to relogin (PLOGI) to the device via the
DPC thread. Add code to make the appropriate upcall to the
FC transport layer (fc_remote_port_add()) upon successful
completion of the PLOGI.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d97994dc1fddcbb8212b745d9c9c9ce96262155c 20-Jan-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct synchronization issues during rport addition/deletion.

The driver can typically detect port-loss during an
interrupt context (i.e. via interrogation of a status IOCB's
completion status [CS_PORT_LOGGED_OUT]. Due to the calling
requirements of the fc_rport APIs, the driver would defer
removal of the device to the default workqueue. If the
work-item was preceded by an event which caused the port to
obtain visibility (relogin successful, target re-logged into
the topology), deferred removal could inadvertently drop the
rport. The code also no longer defers removal via the
default workqueue, instead opting for use of the driver's
own DPC thread.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
79f89a4296ff22f09baf538d4ff2a6d0c3097a73 14-Jan-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Disable port-type RSCN handling via driver state-machine.

Given the semantic changes in both the device-model and
fc-transport APIs, the driver's handling of port-type RSCNs
via a series of ADISCs and PLOGIs can cause series of
badness ranging from unexpectedly device loss to devices not
being discovered.

In the interim, disable (via a module-parameter) this
feature and allow RSCN management to continue to occur
within the driver's DPC thread.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
bc8fb3cb9e208de0d69223f68058714b78f83833 14-Jan-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct execution-throttle setting for ISP24xx.

Similarly to other ISPs, set execution throttle to maximum
allowed value since 'throttling' is done on a per-lun basis
via queue-depth.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
590f98e5e8d6502cc21fdcddc90a0cc09c1f770e 14-Jan-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Collapse load RISC RAM implementations.

Simplify essentially duplicate load RISC RAM implementation
in qla2x00_load_ram_ext() and qla2x00_load_ram().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
f94097edf2c3ac9bc48580252c2eee52947b5e60 14-Jan-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct swing/emphasis settings for ISP24XX.

Swing/emphasis settings in NVRAM were not being honoured due
to the driver not converting the serial-link options from LE
to host-endian format.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
c9d02acf39d9fdde18b63281944003b9ec9a3271 14-Jan-2006 andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct issue where portstate does not transition during loop-resync.

If the Get Port Database call fails during local-loop
update, then schedule the DPC routine to perform a rescan as
the firmware would have updated the Get ID List port-entries
of their new state.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
331e34768657ead5a5b169337351e045305cafcb 10-Nov-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add support for embedded ISP24xx firmware.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
5433383ef33ed40c9c8a86a4355da344234af2a5 10-Nov-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add full firmware(-request) hotplug support for all ISPs.

Transition driver to exclusively use the request_firmware()
interfaces to retrieve firmware-blobs from user-space. This
will be the default behaviour going forward until the
embedded firmware-binary images are removed from the
upstream kernel.

Upon request, the driver caches the firmware image until the
driver is unloaded.

NOTE: The option is present to allow the user to continue to
use the firmware-loader modules, but, should be considered
deprecated.

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

Rejections fixed up and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
23443b1d6130eff8e1335e4f84eaf0577a331dcf 06-Dec-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct mis-handling of AENs.

A regression in a recent change
33135aa2a568ec1a30e734f18e5315e10516e4f3 caused the driver
to mistakenly drop handling of AENs. Due to the incorrect
handling, ports would not reappear after RSCNs and LIPs.

Drops unused/incorrect compound #define from qla_def.h.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
335a1cc976ffbb58491a9b6dc58955349e3f0388 08-Nov-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct ISP24xx soft-reset handling.

A driver must wait 100us before attempting an MMIO operation
to the RISC after a soft-reset has been initiated. A
similar delay was needed with earlier ISPs.

Note: a PCI config-space read is used to flush the MMIO
write to the ISP, since the ISP's state machines are unable
to respond to any MMIO read during the reset process.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
33135aa2a568ec1a30e734f18e5315e10516e4f3 08-Nov-2005 Ravi Anand <ravi.anand@qlogic.com> [SCSI] qla2xxx: Correct loop-in-transition issues

When mulitple initiators are coming up in an FCAL topology.

Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
c9475cb0c358ff0dd473544280d92482df491913 07-Nov-2005 Jesper Juhl <jesper.juhl@gmail.com> [PATCH] kfree cleanup: drivers/scsi

This is the drivers/scsi/ part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in drivers/scsi/.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Acked-by: Kai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19a7b4aebf9ad435c69a7e39930338499af4d152 18-Oct-2005 James.Smart@Emulex.Com <James.Smart@Emulex.Com> [SCSI] update fc_transport for removal of block/unblock functions

We recently went back to implement a board reset. When we perform the
reset, we wanted to tear down the internal data structures and rebuild
them. Unfortunately, when it came to the rport structure, things were
odd. If we deleted them, the scsi targets and sdevs would be
torn down. Not a good thing for a temporary reset. We could block the
rports, but we either maintain the internal structures to keep the
rport reference (perhaps even replicating what's in the transport),
or we have to fatten the fc transport with new search routines to find
the rport (and deal with a case of a dangling rport that the driver
forgets).

It dawned on me that we had actually reached this state incorrectly.
When the fc transport first started, we did the block/unblock first, then
added the rport interface. The purpose of block/unblock is to hide the
temporary disappearance of the rport (e.g. being deleted, then readded).
Why are we making the driver do the block/unblock ? We should be making
the transport have only an rport add/delete, and the let the transport
handle the block/unblock.

So... This patch removes the existing fc_remote_port_block/unblock
functions. It moves the block/unblock functionality into the
fc_remote_port_add/delete functions. Updates for the lpfc driver are
included. Qlogic driver updates are also enclosed, thanks to the
contributions of Andrew Vasquez. [Note: the qla2xxx changes are
relative to the scsi-misc-2.6 tree as of this morning - which does
not include the recent patches sent by Andrew]. The zfcp driver does
not use the block/unblock functions.

One last comment: The resulting behavior feels very clean. The LLDD is
concerned only with add/delete, which corresponds to the physical
disappearance. However, the fact that the scsi target and sdevs are
not immediately torn down after the LLDD calls delete causes an
interesting scenario... the midlayer can call the xxx_slave_alloc and
xxx_queuecommand functions with a sdev that is at the location the
rport used to be. The driver must validate the device exists when it
first enters these functions. In thinking about it, this has always
been the case for the LLDD and these routines. The existing drivers
already check for existence. However, this highlights that simple
validation via data structure dereferencing needs to be watched.
To deal with this, a new transport function, fc_remote_port_chkready()
was created that LLDDs should call when they first enter these two
routines. It validates the rport state, and returns a scsi result
which could be returned. In addition to solving the above, it also
creates consistent behavior from the LLDD's when the block and deletes
are occuring.

Rejections fixed up and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
fa90c54f6d27664cc67691f9e52d9165e0c25ca7 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>
4fdfefe52944f5c4132a372ed5c208962a73c3f2 27-Oct-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add support to dynamically enable/disable ZIO.

ISP23xx and ISP24xx chips have support for an adaptive
method of posting SCSI command completions for multiple SCSI
commands during a single system interrupt.

SCSI commands are placed on the system response queue
without interrupting the host until 1) a delay timer
expires; or 2) a SCSI command completes with an error.

As long as the host software (qla2xxx) services the response
queue for completions (this polling is done during
queuecommand()) within the 'delay timer' period, the
firmware will not generate system interrupt.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
0eedfcf0cdac30b14d1e6c99abc6604347ef0af8 27-Oct-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct issue where fcport is prematurely marked DEAD.

The non-handled failure cases of the Fabric Login mailbox
command handling logic would incorrectly mark the fcport as
dead and not allow the standard port-down-retry-count logic
to manage the transition.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
c53033f6b0bd7cc133b7f433083f0394cf29ac70 21-Oct-2005 Al Viro <viro@zeniv.linux.org.uk> [PATCH] gfp_t: drivers/scsi

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
27b2f6792f3b482e4636818c7efaf4c43fef32a3 17-Sep-2005 Adam Kropelin <akropel1@rochester.rr.com> [PATCH] qla2xxx: Use dword accessors for PCI_ROM_ADDRESS

PCI_ROM_ADDRESS is a 32 bit register and as such should be accessed using
pci_bus_{read,write}_config_dword(). A recent audit of drivers/ turned up
several cases of byte- and word-sized accesses. The harmful ones were fixed
by Linus directly. This patches up one of the remaining
harmless-but-still-wrong cases caught in the dragnet.

Signed-off-by: Adam Kropelin <akropel1@rochester.rr.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
f8b02a85ebbf5eed63163ca9ed915bf8c47309c5 01-Sep-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: use wwn_to_u64() transport helper

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
06c22bd13f4eb55e291d5a31280b2ae5a70ad00d 27-Aug-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct LED scheme definition.

Original implementation used an overloaded bit in the EFI
parameters. The correct bit is BIT_4 of the special_options
section of NVRAM.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
f7d289f62e2ea911ecb710015efd45c687fa81ce 27-Aug-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct domain/area exclusion logic.

In an FL topology, limit port recognition to those devices
not within the same area and domain of the ISP. The
firmware will recogonize such devices during local-loop
discovery.

Some devices may respond to a PLOGI before they have
completed their fabric login or they may not be a public
device. In this case they will report:

domain == 00
area == 00
alpa == <XX>

which is valid. Exclude such devices from local loop
discovery.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
cca5335caf2d19ef8bd6b833445d2c6ca652a89b 27-Aug-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add FDMI support.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
ad3e0edaceb9771be7ffbd7aa24fb444a7ed85bf 27-Aug-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Export class-of-service (COS) information.

Export COS information for the fc_host and fc_remote_port
objects added by the driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
77d74143612c1dab6c055dac21f965929ba0a7e6 09-Jul-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Cleanup FC remote port registration.

Cleanup FC remote port registration.

Due to the inherent behaviour (an immediate scan) of adding
a 'target'-role-capable rport via fc_remote_port_add(),
split the registration into two steps -- addition as
unknown-type role, then use fc_remote_port_rolchg() with
appropriate role (based on PLOGI/PRLI bits). This allows
for a more cleaner rport->dd_data management as can be seen
with the simplified qla2xxx_slave_alloc() function.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
88c2666351f41a7d4459e79594f687a356f5e57c 09-Jul-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Consolidate ISP24xx chip reset logic.

Consolidate ISP24xx chip reset logic.

Consolidate near-duplicate RISC reset logic from
qla24xx_reset_chip() and qla24xx_chip_diag(). Also, after
initiating a soft-reset, insure the firmware has completed
all NVRAM accesses before continuing.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
cc4731f5b4539faea237bacd170a27a230a7e724 06-Jul-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Correct maximum supported lun and target-id definitions.

Correct maximum supported lun and target-id definitions.

The driver uses command-IOCBs which support a maximum lun
value of 0xffff -- correct #define to reflect the change.
Also, remove superfluous MAX_TARGET definition.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
ae91193cd5bc80b4d62b1d4f0e7f3fea48f41ccd 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>
fa2a1ce53d4b869b74da9a770770c79f9af64914 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>
0107109ed69c9e04b6fa35ac41d870c74dcce3fc 06-Jul-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add ISP24xx initialization routines.

Add ISP24xx initialization routines.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1c7c63574ff3e568ca374e9f05e30b8d7d64273e 06-Jul-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Add MBX command routines for ISP24xx support.

Add MBX command routines for ISP24xx support.

Generalize several routines [qla2x00_load_ram_ext(),
qla2x00_execute_fw(), qla2x00_verify_checksum()] to handle
larger addressing space.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
3d71644cf952fd1157a13173237258422ba3c569 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>
abbd8870b9cb7754a4935826bc9f3c7b029f8b7c 06-Jul-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] qla2xxx: Factor-out ISP specific functions to method-based call tables.

Factor-out ISP specific functions to method-based call tables.

In anticipation of ISP24xx/ISP25xx support, factor-out ISP
specific functions into a method-based call table.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
354d6b2196c8e53e55e8f169804256ab9c72731d 23-Apr-2005 Andrew Vasquez <andrew.vasquez@qlogic.com> [SCSI] remove some dead code in qla2xxx

Original from: Christoph Hellwig <hch@lst.de>

Modified and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
bdf796210e01145fd77bbb3ae644d04f982b6c3b 17-Apr-2005 <andrew.vasquez@qlogic.com> [PATCH] qla2xxx: remove lun discovery codes...

Remove internal lun discovery routines and support
structures.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
8482e118afa0cb4321ab3d30b1100d27d63130c0 17-Apr-2005 <andrew.vasquez@qlogic.com> [PATCH] qla2xxx: add remote port codes...

Add initial support for FC remote port infrastructure.

o Use fc_remote_port...() registration and block/unlock
functions.
o Consolidate 'attribute' (fc-remote/sysfs) helpers into
new qla_attr.c file.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
f4f051ebb40e74ad0ba02d2cb3a6c16b0393472b 17-Apr-2005 <andrew.vasquez@qlogic.com> [PATCH] qla2xxx: remove internal queuing...

Remove internal command queuing from the driver. As is, this
driver cannot tolerate cable-pulls as I/Os will begin to fail
by the upper layers.

o Should be used in conjuction with the
11-fc_rport_adds_2.diff patch.
o Removes qla_listops.h file -- no longer needed.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-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!