Commit Graph

104 Commits

Author SHA1 Message Date
Vladislav Bolkhovitin
2092cff5cd 3 small patches from Bart Van Assche <bart.vanassche@gmail.com>:
The patch below fixes the following category of checkpatch complaints:
ERROR: do not use C99 // comments

This patch has been verified as follows:
- Verified that checkpatch does no longer complain about C99 comments.
- Verified that make -s clean && make -s iscsi scst && make -s -C srpt
  still works.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>

The patch below fixes the following category of checkpatch complaints:
WARNING: unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html

This patch has been verified as follows:
- Verified that checkpatch does no longer complain about unnecessary casts.
- Verified that make -s clean && make -s iscsi scst && make -s -C srpt
  still works and does not trigger any new compiler warnings.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>

The patch below fixes the following category of checkpatch warnings:
ERROR: Use of SPIN_LOCK_UNLOCKED is deprecated: see Documentation/spinlocks.txt

This patch has been verified as follows:
- Verified that checkpatch does no longer complain about spinlocks.
- Verified that make -s clean && make -s iscsi scst && make -s -C srpt
  still works and does not trigger any new compiler warnings.
- Verified that the patch generated by generate-kernel-patch still applies
  cleanly to the 2.6.25.4 kernel, and that the patched kernel tree still
  compiles, installs and boots fine, and that the iscsi-scst, ib_srpt,
  scst_disk and scst_vdisk modules still load.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@401 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-05-28 11:17:08 +00:00
Stanislaw Gruszka
684a1ed5b8 Check preprocesor definitions when releasing firmware.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@395 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-05-24 13:48:20 +00:00
Vladislav Bolkhovitin
56e642cf77 Patch from Bart Van Assche <bart.vanassche@gmail.com>:
The patch below implements the following changes:
- Fixes the remaining warnings reported by checkpatch.pl with regard to the use
  of whitespace in C code.
- Adds double qoutes around some #warning messages, such that checkpatch.pl
  does no longer try to interprete the text behind the #warning preprocessor
  directive.
- Adds an extra conversion to the generate-kernel-patch script that removes
  the single space from before goto-labels while generating the kernel patch.

This patch has been tested as follows:
- Verified that svn diff -x -w only shows changes in the #warning preprocessor directives.
- Verified the output of svn diff by reading it.
- Verified that checkpatch.pl does no longer complain on the use of whitespace
  (searched through the checkpatch.pl output for the text ' space').
- Verified that the patch generated by the generate-kernel-patch script still
  applies cleanly to the 2.6.24 kernel, and that the patched kernel still compiles cleanly.

Please let me know if I have to resubmit parts of this patch to other SCST authors.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@381 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-05-21 11:56:09 +00:00
Vladislav Bolkhovitin
1213800b2f Patch from Bart Van Assche <bart.vanassche@gmail.com>, except few chuncks from qla2x00t/ obviously not related to the target mode addon:
One of the Linux kernel patch submission requirements is that source files do
not contain trailing whitespace. The patch below removes trailing whitespace
from .c and .h source files.

Note: it might be more convenient to run the script I used to generate this
patch than to review and apply the patch below. This is how I generated and
verified the patch below:

cat <<EOF >./strip-trailing-whitespace
#!/bin/bash
trap "rm -f $t" EXIT
t=/tmp/temporary-file.$$
for f in "$@"
do
  sed 's/[	 ]*$//' <"$f" >"$t" && mv "$t" "$f"
done
EOF
chmod a+x ./strip-trailing-whitespace
find -name '*.[ch]' | xargs ./strip-trailing-whitespace
svn diff -x -w

Signed-off-by: <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-05-19 10:21:41 +00:00
Vladislav Bolkhovitin
2bff6d9765 - Rejecting command reimplemented in a more simple, straightforward and readable way.
- Minor external interface change: now target drivers should set for aborted commands SCST_CMD_DELIVERY_ABORTED status via scst_set_delivery_status(). In-tree drivers updated.
 - Fixed broken compilation if put_page_callback patch not applied to the kernel. Reported by Erez Zilber <erezz@Voltaire.COM>
 - Fixed several minor problems reported by David Berton <davidbrt@yahoo.com>
 - Fixed __exit misuse, when such functions called from __init functions.
 - Docs updated.
 - Other minor changes and cleanups.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@364 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-05-07 18:44:15 +00:00
Stanislaw Gruszka
fa2612efd1 Remove request sense warning and fix typo.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@361 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-05-01 06:49:33 +00:00
Stanislaw Gruszka
eac485e270 Nullify f/w pointer if load fails.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@360 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-05-01 06:46:23 +00:00
Stanislaw Gruszka
fda0d8a9a4 Bugfix - disallow to free initiator data when disabling target mode,
as long as all reference to it is dropped.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@359 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-30 14:19:38 +00:00
Stanislaw Gruszka
37c1a3ab1a Add missing definition of strncasecmp() for older kernels.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@358 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-24 13:12:08 +00:00
Stanislaw Gruszka
0f3f7be821 - Update README.scst.
- Add comment about overall isp_scst.c design.
- Put some compile time selectable values in one place.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@357 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-24 12:50:51 +00:00
Stanislaw Gruszka
db1399ff87 Bugfix: put initiator reference counter when finish task management.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@356 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-24 09:31:02 +00:00
Stanislaw Gruszka
9252bb3170 Synchronize with Feral CVS repository:
- use kthread
- MBOX_ACQUIRE macro redefined


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@355 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-24 06:34:08 +00:00
Stanislaw Gruszka
1b384e9234 Remove unnecessary variables.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@354 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-23 11:17:33 +00:00
Stanislaw Gruszka
6d004ffe91 - Compile time conditinal debug.
- Initialize variable.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@353 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-23 09:23:43 +00:00
Stanislaw Gruszka
8cfda488ba - Avoid tmd's leakage when disable target mode when pending I/O (some work still
needed in low level driver).
- Properly free channels on error case.
- Start HBA unregistation after proc file is removed.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@352 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-23 09:15:14 +00:00
Vladislav Bolkhovitin
925fbcdda3 The bunch of pending changes. Sorry, it's quite big.
- "RECEIVE DIAGNOSTIC RESULTS" command handling fixed
 - Obtaining device queue parameters in scst_obtain_device_parameters() changed to handle NOT READY sense
 - Fixed possible dev_cmd_count underflow
 - Minor iSCSI-SCST connection closing cleanups and fixes
 - Semantic of other *_atomic flags changed a bit. Now they are intended only to allow SCST to optimize execution context. The corresponing functions now can *always* be called on atomic context and, if necessary, should manually determine that using scst_cmd_atomic() function and restart using corresponding *_NEED_THREAD_* return value.
 - scst_cmd_get_tgt_resp_flags() and SCST_TSC_FLAG_STATUS flag made obsolete and replaced by scst_cmd_get_is_send_status(). All in-tree drivers updated accordingly
 - Cleanup: preprocessing_done_atomic removed, now preprocessing_done() callback always called on thread context
 - 64-bit cleanups
 - Documented that iscsi-scst-adm is currently broken and explained why
 - In user space Makefile's added possibility to specify external linker flags
 - Minor performance optimizations
 - Other minor cleanups


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@350 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-22 10:30:53 +00:00
Stanislaw Gruszka
56382c20ac Type fix.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@349 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-21 17:37:43 +00:00
Stanislaw Gruszka
9be327002c Remove not necessary headers and definitions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@348 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-21 17:34:42 +00:00
Stanislaw Gruszka
9696649c7c Limit scatter/gather table size (need to be reviewed).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@345 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-21 10:45:22 +00:00
Stanislaw Gruszka
1399e8e64c - bug fix: pass error to scst_rx_data
- set transfer length for SPI transport
- add unlikely()/likely()
- print error when don't know what to do with tmd


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@344 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-21 10:37:35 +00:00
Stanislaw Gruszka
c921c18c13 Remove obsolete kernel_thread and use kthread API.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@343 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-21 10:31:16 +00:00
Stanislaw Gruszka
5b11d67e24 Change proc interface to SCST like. Allow to enable/disable each lun for SPI device.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@342 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-21 10:27:59 +00:00
Stanislaw Gruszka
a437da7b02 Logout implementation, reference counting to protect initiator data.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@341 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-21 08:36:14 +00:00
Vladislav Bolkhovitin
fa84d540ef scsi_tgt.h renamed to scst.h
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@337 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-17 17:35:37 +00:00
Stanislaw Gruszka
67ea9c1d0a Remove unintended change from r334, added there only for testing TM.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@335 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-11 08:18:02 +00:00
Stanislaw Gruszka
83c63625e6 Fixes for task management:
- abort only tasks from initiator, which send TM function
- check LUN for LUN_RESET function
- schedule tasklet to free aborted command from tmd's queue
- call scst_tgt_cmd_done() to free aborted command from SCST


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@334 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-11 07:34:07 +00:00
Stanislaw Gruszka
aaa202a398 Fix bug when checking tmd flags against bidirectional transfer.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@332 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-08 09:11:10 +00:00
Stanislaw Gruszka
21850b4dca Pass expected transfer length and direction to SCST for fibre channel devices.
Fix bug when using SCST_DATA_UNKNOWN insted of SCST_DATA_NONE.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@331 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-08 06:47:30 +00:00
Stanislaw Gruszka
94eeba176d We need only 2 debug level, one for error situations, second for normal
data flow. Print only in debug mode about sense buffer cutting.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@330 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-04 12:18:00 +00:00
Stanislaw Gruszka
c4c19fa17f Fix bug when enabling target on nonzero channel.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@328 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-04 11:57:40 +00:00
Stanislaw Gruszka
19827957bb Fix bugs introduced in r325 and r324.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@327 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-04 11:53:01 +00:00
Stanislaw Gruszka
adb98e77c3 Remove trailing whitespaces.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@326 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-04 11:49:19 +00:00
Stanislaw Gruszka
16717c2bc9 Implement multichannel support in the way each channel is seen by SCST
as separate HBA.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@325 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-04 11:48:28 +00:00
Stanislaw Gruszka
be3bbaa220 Fix HBA registration / unregistration:
- not acknowledge when fail to register
- unregistration when no one can call functions from HBA


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@324 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-04 11:26:53 +00:00
Stanislaw Gruszka
09b77a6eeb Do not dump stack when data length is bigger than low level driver can handle.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@323 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-04 11:17:49 +00:00
Stanislaw Gruszka
f9af070111 Print error when we can not send all sense data (which is very unlikely).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@322 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-01 13:51:07 +00:00
Stanislaw Gruszka
ca650f2bb6 Add missed things from Feral CVS repository.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@321 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-01 12:04:34 +00:00
Stanislaw Gruszka
802ee69a76 Stop setting command expected values for SCST,
as we can not assure values are right.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@320 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-01 07:14:26 +00:00
Stanislaw Gruszka
a5fb49273f - Update copyrights.
- Substitute scsi_tdebug to debug.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@319 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-01 06:47:11 +00:00
Stanislaw Gruszka
dd108f6edb Remove obsolete linux stuff.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@318 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-04-01 06:38:55 +00:00
Stanislaw Gruszka
2152c7ad20 Synchronize with Feral CVS repository:
- define an IS_1020 macro
- more dma mask cleanups


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@317 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-03-28 13:03:31 +00:00
Stanislaw Gruszka
e9b645432d Synchronize with Feral CVS repository:
- Make pre-1240 cards be able to do 64 bit dma as well, making sure that
  they don't cross a 16MB boundary.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@316 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-03-28 13:01:38 +00:00
Stanislaw Gruszka
d2303505f5 Synchronize with Feral CVS repository:
- Make FC_SCRATCH_ACQUIRE a macro that returns true/false
- Fixes from Stanislaw for 2.6.23 & 2.6.24. Many thanks.
- A quick hack to isp_kthread to use waitqueues instead of semaphores
  to have less blockage. More rewrites later


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@314 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-03-28 12:58:58 +00:00
Stanislaw Gruszka
b3cbdff958 Synchronize with Feral CVS repository:
- whitespace and other minor fixes
- Remove F/W crash dump support. We only worked it out for 2200 and 2300
  cards. It's also true that QLogic would not support us even if we *did*
  give them a crash dump, so the usage here is not really worth it.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@311 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-03-28 12:42:36 +00:00
Stanislaw Gruszka
8ec477fea4 Synchronize with Feral CVS repository:
- Use a slightly cleaner macro.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@309 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-03-28 12:35:40 +00:00
Stanislaw Gruszka
7d98059854 Synchronize with Feral CVS repository:
- whitespace


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@308 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-03-28 12:33:36 +00:00
Stanislaw Gruszka
c2d9a1310f Synchronize with Feral CVS repository:
- Allow different platforms/environments to specificy the size of the
  high and low private storage for tmd_cmd_t structures
- Add a scan scsi thread event so that we can attach devices as we
  discover them
- Fix some tabs
- Make things work correctly when CONFIG_FW_LOADER is *not* defined
- Get rid of sema and use wait_interruptible


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@307 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-03-28 12:31:35 +00:00
Stanislaw Gruszka
dc05d8b731 Synchronize with Feral CVS repository:
- Copyright Update
- Fix some fabric login bugs


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@305 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-03-28 12:23:27 +00:00
Stanislaw Gruszka
c09205bd0c Bugfixes:
- pass commands to SCST after assigning initiator to them
- enable lun's on proper channel


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@302 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-03-13 10:58:44 +00:00
Stanislaw Gruszka
366a99f781 Protect initiators list using tmds_lock. Avoid possibility to
allocate initiator twice.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@300 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-03-11 14:27:13 +00:00