Reduce the size of the qla2xxx kernel module by moving an array definition
from a .h into a .c file.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8305 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The "(&ctio->u.status1.sense_data)[i]" where i >= 0 expressions in
qlt_send_resp_ctio() are probably typos and should have been
"(&ctio->u.status1.sense_data[4 * i])" instead. Instead of only fixing
these typos, modify the code for storing sense data such that it becomes
easy to read. This patch fixes a Coverity complaint about accessing an
array outside its bounds.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8303 d57e44dd-8a1f-0410-8b47-8ef2f437770f
A reference count underflow is a severe bug. Hence complain loudly if a
reference count underflow happens.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8302 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Introduce two structures for the (DMA address, length) combination instead
of using separate structure members for the DMA address and length. This
patch fixes several Coverity complaints about 'cur_dsd' being used to write
outside the bounds of structure members.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8300 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since the next patch will modify several firmware data structures, add
compile time checks that verify that these structures have the correct
size.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8299 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Move two if-statements from where the 'patch' command dropped them to
where these should be. See also r8296.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8298 d57e44dd-8a1f-0410-8b47-8ef2f437770f
All qlt_send_term_imm_notif() callers pass '1' as second argument to this
function. Hence remove the (broken) code that depends on that second
argument having another value. Add a pr_debug() statement that prints rc to
avoid that the compiler would complain that rc has been set but is not
used.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8297 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The current order for freeing memory is as follows:
- struct crc_context itself.
- struct crc_context member pointers.
Change the freeing order into the following:
- struct crc_context member pointers.
- struct crc_context itself.
Detected by Coverity.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8296 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Clear each pointer after having freed memory such that it becomes safe to
call qla2x00_mem_free() twice.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8295 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Instead of clearing all freed pointers at the end of qla2x00_mem_free(),
clear freed pointers immediately after having freed the memory these
pointers point at.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8294 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch avoids that Coverity complains that qla2x00_async_event() writes
outside the bounds of the mb[] arrays (MBA_IDC_AEN case).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8293 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since Coverity cannot know that rport != NULL in qla2xxx_queuecommand() and
since there is code in that function that dereferences the rport pointer,
modify qla2xxx_queuecommand() such that it fails SCSI commands if rport ==
NULL.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8292 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Testing whether a pointer is not NULL after it has been dereferenced is not
useful. Hence remove the if (fcport) test. This was detected by Coverity.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8291 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since qla2x00_init_timer() is not used for I/O commands there is no need to
inline this function. Hence uninline this function.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8290 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The previous patch moved all qla2x00_is_reserved_id() callers into
qla_init.c. Hence also move the qla2x00_is_reserved_id() definition into
qla_init.c.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8289 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since all qla2x00_find_new_loop_id() calls occur in the same source file as
the definition of this function, move that function to just before its
first caller and declare it static. Convert the header above this function
into kernel-doc format.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8286 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since qla2x00_set_reserved_loop_ids() only has a single caller, move it
into the source file from where it is called.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8285 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Change one occurrence of "*(" into "()". Fix the reference to
qla_tgt_handle_cmd_for_atio(): there has never been a function with
that name.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8284 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Submitting the NEXUS LOSS task management function is not required when
freeing an SCST session.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8276 d57e44dd-8a1f-0410-8b47-8ef2f437770f
ELS IOCB done message should be moved to verbose logging
to prevent confusion about the error case v/s sucessful
submission case.
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8274 d57e44dd-8a1f-0410-8b47-8ef2f437770f
From: Quinn Tran <qtran@marvell.com>
This patch fixes issue reported by some of the customers,
who discovered that after cable pull scenario the devices
disappear and path seems to remain in blocked state. Once
the device reappears, driver does not seem to update path
to online. This issue appears because of the defer flag
creating race condition where the same session reappears.
This patch fixes this issue by indicating SCSI-ML of device
lost when qlt_free_session_done() is called from qlt_unreg_sess().
Fixes: "qla2xxx: Improve RSCN handling in driver"
Signed-off-by: Quinn Tran <qtran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8273 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch avoids that the build_mode file is read when applying the
generate-kernel-patch output to the kernel tree and when building the
kernel tree.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8272 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that the compiler complains that the assert() expression compares a
signed with an unsigned integer.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8269 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This driver is obsolete and is no longer supported since a long time, so
remove it. From the README of this driver (this note was added in 2009):
"From other side, qla2x00t is simpler, smaller and much better tested
on 22xx and 23xx, hence perform more reliable and, thus, is recommended
for these adapters. Since 24xx/25xx become fully supported on qla2x00t
we encourage users to switch to this driver."
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8260 d57e44dd-8a1f-0410-8b47-8ef2f437770f