607 Commits

Author SHA1 Message Date
Gleb Chesnokov
ebae8bd223 scst: Remove unnecessary null check
kmem_cache_destroy() can handle NULL pointer correctly, so there is no need
to check NULL pointer before calling kmem_cache_destroy().

For kernel versions before v4.3 there is a backport of
kmem_cache_destroy() that checks for a null pointer.

This patch fixes the following checkpatch warnings:

    WARNING:NEEDLESS_IF: kmem_cache_destroy(NULL) is safe and this check
    is probably not required
2022-08-09 19:38:00 +03:00
Gleb Chesnokov
55ba4339dd qla2x00t/doc/qla2x00t-howto.html: Add information about initiator and target modes
Qlogic documentation lack of the information about initiator and target modes
usage.
2022-06-16 13:30:21 +03:00
Gleb Chesnokov
f7fabfd200 qla2x00t: Remove pci-dma-compat wrapper API
The legacy API wrappers in include/linux/pci-dma-compat.h should go away as
they create unnecessary midlayering for include/linux/dma-mapping.h API.
Instead use dma-mapping.h API directly.

This patch fixes build for linux kernel v5.18.
2022-05-24 17:58:45 +03:00
Gleb Chesnokov
be46206a69 qla2x00t: Stop using the SCSI pointer
Instead of using the SCp.ptr field to track whether or not a command is
in flight, use the sp->type field to track this information. sp->type
must be set for proper operation of the qla2xxx driver. See e.g. the
switch (sp->type) statement in qla2x00_ct_entry().

Port the commit 8cc7b18f ("qla2x00t-32gbit: Stop using the SCSI pointer")
to the old qlogic driver.
2022-04-04 19:56:13 +03:00
Gleb Chesnokov
5d23bc00ad qla2x00t: Clean up set_bsg_result() function
Move common code out of LINUX_VERSION_CODE statements.

This patch does not change any functionality.
2022-04-03 14:44:17 +03:00
Gleb Chesnokov
a1ded333e8 scst: Replace zero-length arrays with flexible-array members
There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should
no longer be used[2].

This code was transformed with the help of Coccinelle:
($ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)

@@
identifier S, member, array;
type T1, T2;
@@

struct S {
  ...
  T1 member;
  T2 array[
- 0
  ];
};

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/78
2022-04-03 14:44:17 +03:00
Chesnokov Gleb
8aec03276a qla2x00t: Remove support for kernel versions before 3.10
The SCST has dropped support for kernels older than 3.10.0 (RHEL 7 / Centos 7) since SCST v3.6.
2022-01-13 17:26:37 +03:00
Chesnokov Gleb
64a8485fe7 Bump the version number to 3.7.0-pre
These changes have been generated by running the following command:

$ scripts/update-version 3 7 0-pre
2022-01-11 16:37:34 +03:00
Bart Van Assche
9c5406664a Bump the version number to 3.6.0
These changes have been generated by running the following command:

$ scripts/update-version 3 6 0
2021-12-29 19:19:14 -08:00
Bart Van Assche
2f0a5426d0 qla2x00t/doc/qla2x00t-howto.html: Make this document HTML-compliant 2021-12-22 20:03:06 -08:00
Bart Van Assche
47f5a89f3e qla2x00t/doc/Makefile: Add to repository 2021-12-22 20:02:45 -08:00
Bart Van Assche
6b8b4a8004 qla2x00t: Port to Linux kernel v5.16
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9600 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-11-22 03:49:47 +00:00
Bart Van Assche
193e63d118 qla2x00t: Port to Linux kernel v5.15
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9593 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-11-03 14:29:35 +00:00
Bart Van Assche
567a1d5a35 qla2x00t*: Fix a 'make' invocation
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9590 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-11-03 14:27:57 +00:00
Bart Van Assche
2a4412e6c5 qla2x00t: Fix the build for UEK kernel 5.4.17-2136.300.7.el8uek
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9588 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-10-28 05:43:57 +00:00
Bart Van Assche
34b4ac48ed qla2x00t: Fix three kernel-doc headers
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9511 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 03:11:34 +00:00
Bart Van Assche
bd5b6fad83 qla2x00t: Simplify the backwards compatibility code
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9509 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-05 03:08:01 +00:00
Bart Van Assche
bdf56c04b6 qla2x00t: Use scsi_build_sense()
This patch fixes a bug by changing SAM_STAT_CHECK_CONDITION << 1 into
SAM_STAT_CHECK_CONDITION in the SCSI result code.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9502 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 04:57:38 +00:00
Bart Van Assche
309d11589a qla2x00t: Use the fallthrough keyword to annotate switch/case fallthrough
This patch prevents that a compiler warning is reported when building this
driver against kernel v5.14.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9500 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 02:35:53 +00:00
Bart Van Assche
078e1b774c qla2x00t/qla_bsg: Fix error codes
Use the proper error codes when reporting a BSG error. The DID_* codes are
the codes that are shifted left 16 bits while the DRIVER_* codes must be
shifted left 24 bits.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9499 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-09-03 02:34:47 +00:00
Bart Van Assche
ccdb440ae4 qla2x00t: Always check the qla2x00_wait_for_hba_online() return value
This patch suppresses the following Coverity complaint:

CID 364334 (#1 of 1): Unchecked return value (CHECKED_RETURN)
6. check_return: Calling qla2x00_wait_for_hba_online without checking return
   value (as is done elsewhere 8 out of 10 times).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9421 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-19 14:12:39 +00:00
Bart Van Assche
c0151f6cda Bump the version number to 3.6.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9310 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-01-02 23:16:59 +00:00
Bart Van Assche
d3c92ea7aa Bump the version number to 3.5.0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9231 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-12-22 03:38:21 +00:00
Bart Van Assche
cf4a11725a scst: Unbreak the non-RHEL build
This patch is a fix for r9221.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9227 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-12-21 19:54:08 +00:00
Bart Van Assche
ff294b83e7 qla2x00t: Build fix for RHEL / CentOS 8.3
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9226 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-12-21 19:21:28 +00:00
Bart Van Assche
e1f9a517c8 Port Kconfig files to kernel v5.9
Change '---help---' into 'help'. See also Linux kernel commit f70f74d15ca8
("kconfig: remove '---help---' support") # v5.9.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9216 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-12-20 02:07:40 +00:00
Bart Van Assche
d10a7bf5d5 Restore support for building with clang
The previous commit removed support for building with clang. Restore support
for building with clang without breaking cross-compilation support.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9209 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-12-05 21:23:17 +00:00
Bart Van Assche
8eb850acce Revert "Make it possible to build SCST with clang"
Since commit ecea60a694 breaks cross-compilation, revert it.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9208 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-12-05 18:39:38 +00:00
Bart Van Assche
c973152d8d qla2x00t, qla2x00t-32gbit: Remove unused code
This was detected by the clang compiler.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9096 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 22:55:54 +00:00
Bart Van Assche
757b42c2ba qla2x00t: Fix two buffer overflows
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9091 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 21:22:13 +00:00
Bart Van Assche
ecea60a694 Make it possible to build SCST with clang
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9089 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 21:19:24 +00:00
Bart Van Assche
214628043e qla2x00t: Remove a useless assignment
This was detected by the clang compiler.

Fixes: c006b05884 ("Update of the initiator driver to one from kernel 2.6.26. Sorry, the prior kernels not supported anymore, but backport patches are welcome.") # r473.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9081 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 03:33:03 +00:00
Bart Van Assche
7569ddaf2e Makefiles: Remove -Wextra
Since not all kernel header files are compatible with -Wextra, remove -Wextra.
To enable -Wextra, build SCST with W=1.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9054 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-19 01:18:24 +00:00
Bart Van Assche
cf909e3e16 Makefiles: If both KDIR and KVER have been set, preserve KDIR
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9052 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-19 00:00:49 +00:00
Bart Van Assche
d6fd03107f Split Makefiles: move kernel build rules into Kbuild files
This patch makes the Makefiles easier to read.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9039 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-05 02:13:40 +00:00
Bart Van Assche
47403656ee Make 'make clean' remove all build files
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9038 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-05 02:08:55 +00:00
Bart Van Assche
9be61ba538 Move KBUILD_EXTRA_SYMBOLS definitions into the kernel Makefiles
$(KBUILD_EXTRA_SYMBOLS) is not only used at compile time but also at link
time. Move the $(KBUILD_EXTRA_SYMBOLS) definitions such that it is
available both at compile time and at link time.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9000 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:15:47 +00:00
Bart Van Assche
80ac4d2810 Use $(src) instead of $(KBUILD_EXTMOD)
While $(src) is always defined, $(KBUILD_EXTMOD) is only defined when
building code as an external module.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8999 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:12:09 +00:00
Bart Van Assche
f7fe23928f Change $(MODULE_SYMVERS) into Module.symvers
Or in other words, drop support for kernel versions before 2.6.18.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8998 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:11:16 +00:00
Bart Van Assche
c6ff35fdee qla2x00t: Fix a 32-bit compiler warning
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8990 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-31 03:29:06 +00:00
Bart Van Assche
d12b0a0d91 Fix spelling in documentation and source code
See also https://github.com/bvanassche/scst/pull/20.

[ bvanassche: left out qla2x00t-32gbit changes and changed patch description ]



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8920 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-15 18:53:48 +00:00
Bart Van Assche
6773f8e9a5 scripts/run-regression-tests: Add support for distro kernels
A few examples of how to run the regression tests against a distro kernel:

scripts/run-regression-tests -l 4.18.0-147.5.1.el8_1^CentOS^8.1.1911-nc
scripts/run-regression-tests -l 4.18.0-80.11.2.el8_0^CentOS^8.0.1905-nc
scripts/run-regression-tests -l 3.10.0-1127.el7^CentOS^7.8.2003-nc
scripts/run-regression-tests -l 3.10.0-1062.18.1.el7^CentOS^7.7.1908-nc
scripts/run-regression-tests -l 3.10.0-957.27.2.el7^CentOS^7.6.1810-nc
scripts/run-regression-tests -l 3.10.0-862.14.4.el7^CentOS^7.5.1804-nc



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8885 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-09 22:54:47 +00:00
Bart Van Assche
b3b658bd09 scripts/generate-kernel-patch: Make several paths absolute
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8884 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-09 22:48:23 +00:00
Bart Van Assche
540dc57576 qla2x00t: Port to Linux kernel v5.7
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8864 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-04-21 02:25:58 +00:00
Bart Van Assche
688561c795 README, qla2x00t web page: Remove references to QLogic git repository
Since the QLogic qla2x00t git repository is no longer online, remove all
references to that repository.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8782 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-02-27 02:23:09 +00:00
Bart Van Assche
6fde88d57b scst, qla2x00t: Use pr_warn() instead of pr_warning()
pr_warning() has been removed from kernel v5.5. Hence use pr_warn() instead
of pr_warning().


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8697 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-23 18:54:35 +00:00
Bart Van Assche
60bf4671a4 scst: Change static const char * into static const char* const
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8696 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-23 18:53:43 +00:00
Bart Van Assche
a169500590 Makefiles: Use KBUILD_EXTRA_SYMBOLS instead of copying Module.symvers
Copying Module.symvers is the oldest supported method for building external
kernel modules that depend on another external kernel module. Since support
for that method will be removed from Linux kernel v5.5, use
KBUILD_EXTRA_SYMBOLS instead to specify the external symbols SCST kernel
modules depend on. Support for KBUILD_EXTRA_SYMBOLS was introduced in
upstream kernel v2.6.26 so this patch drops support for kernels before
v2.6.26.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8686 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-16 23:29:42 +00:00
Bart Van Assche
d0183001e4 Makefiles: Remove the $(BUILD_INI) variable
Since the BUILD_INI variable is set but not used, remove it.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8685 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-16 21:31:30 +00:00
Bart Van Assche
ecaab978f0 scst, scstadmin, ...: Bump the version number to 3.5.0-pre
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8683 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-06 05:28:56 +00:00