diff --git a/qla2x00t/Kconfig b/qla2x00t/Kconfig index 49f71d644..9949c1d02 100644 --- a/qla2x00t/Kconfig +++ b/qla2x00t/Kconfig @@ -41,7 +41,7 @@ config SCSI_QLA2XXX_TARGET You will also need the SCST middle level drivers from http://scst.sf.net/. config SCSI_QLA2XXX_EMBEDDED_FIRMWARE - bool " Use firmware-loader modules (DEPRECATED)" + bool "Use firmware-loader modules (DEPRECATED)" depends on SCSI_QLA_FC help This option offers you the deprecated firmware-loader @@ -49,33 +49,33 @@ config SCSI_QLA2XXX_EMBEDDED_FIRMWARE Firmware Loader interface in the qla2xxx driver. config SCSI_QLA21XX - tristate " Build QLogic ISP2100 firmware-module" + tristate "Build QLogic ISP2100 firmware-module" depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE ---help--- This driver supports the QLogic 21xx (ISP2100) host adapter family. config SCSI_QLA22XX - tristate " Build QLogic ISP2200 firmware-module" + tristate "Build QLogic ISP2200 firmware-module" depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE ---help--- This driver supports the QLogic 22xx (ISP2200) host adapter family. config SCSI_QLA2300 - tristate " Build QLogic ISP2300/ISP6312 firmware-module" + tristate "Build QLogic ISP2300/ISP6312 firmware-module" depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE ---help--- This driver supports the QLogic 2300 (ISP2300, ISP2312 and ISP6312) host adapter family. config SCSI_QLA2322 - tristate " Build QLogic ISP2322/ISP6322 firmware-module" + tristate "Build QLogic ISP2322/ISP6322 firmware-module" depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE ---help--- This driver supports the QLogic 2322 (ISP2322 and ISP6322) host adapter family. config SCSI_QLA24XX - tristate " Build QLogic ISP24xx firmware-module" + tristate "Build QLogic ISP24xx firmware-module" depends on SCSI_QLA_FC && SCSI_QLA2XXX_EMBEDDED_FIRMWARE ---help--- This driver supports the QLogic 24xx (ISP2422 and ISP2432) host diff --git a/qla2x00t/ql2400.c b/qla2x00t/ql2400.c index 77914fcfa..ccb016f40 100644 --- a/qla2x00t/ql2400.c +++ b/qla2x00t/ql2400.c @@ -78,6 +78,7 @@ static struct pci_device_id qla24xx_pci_tbl[] = { .subdevice = PCI_ANY_ID, .driver_data = (unsigned long)&qla_board_tbl[1], }, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) { .vendor = PCI_VENDOR_ID_QLOGIC, .device = PCI_DEVICE_ID_QLOGIC_ISP5422, @@ -92,7 +93,7 @@ static struct pci_device_id qla24xx_pci_tbl[] = { .subdevice = PCI_ANY_ID, .driver_data = (unsigned long)&qla_board_tbl[3], }, - +#endif {0, 0}, }; MODULE_DEVICE_TABLE(pci, qla24xx_pci_tbl); diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index bd8b85c65..1b5b80211 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -56,10 +56,10 @@ qla2x00tgt-objs := qla2x00t.o else -all: Modules.symvers +all: Modules.symvers Module.symvers $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m -tgt: Modules.symvers +tgt: Modules.symvers Module.symvers $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=n install: all @@ -67,8 +67,23 @@ install: all modules_install -depmod -a +SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Modules.symvers 2>/dev/null) +ifneq ($(SCST_MOD_VERS),) Modules.symvers: $(SCST_DIR)/Modules.symvers - -cp $(SCST_DIR)/Modules.symvers . + echo $(SCST_MOD_VERS) + cp $(SCST_DIR)/Modules.symvers . +else +.PHONY: Modules.symvers +endif + +# It's renamed in 2.6.18 +SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Module.symvers 2>/dev/null) +ifneq ($(SCST_MOD_VERS),) +Module.symvers: $(SCST_DIR)/Module.symvers + cp $(SCST_DIR)/Module.symvers . +else +.PHONY: Module.symvers +endif uninstall: rm -f $(INSTALL_DIR)/qla2[23x]00tgt.ko diff --git a/qla2x00t/qla2x00-target/README b/qla2x00t/qla2x00-target/README index d1e2a4305..45a0acf62 100644 --- a/qla2x00t/qla2x00-target/README +++ b/qla2x00t/qla2x00-target/README @@ -20,7 +20,9 @@ kernel or only its modules. This version is compatible with SCST version 0.9.5 and higher. -Tested on stable kernels from http://www.kernel.org +Tested on stable kernels from http://www.kernel.org. The original +initiator driver was taken from kernel version 2.6.17.8, but it should +also work on other versions, including 2.6.18.x and 2.6.16.x. NOTE: WWN-based authentification on 2200 cards doesn't always work from ---- the first "connect", but works on all subsequent attempts. diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index 869de4b31..d12542d45 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -1197,12 +1198,14 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha) ha->device_type |= DT_ISP2432; ha->device_type |= DT_ZIO_SUPPORTED; break; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) case PCI_DEVICE_ID_QLOGIC_ISP5422: ha->device_type |= DT_ISP5422; break; case PCI_DEVICE_ID_QLOGIC_ISP5432: ha->device_type |= DT_ISP5432; break; +#endif } } @@ -2168,7 +2171,12 @@ qla2x00_allocate_sp_pool(scsi_qla_host_t *ha) int rval; rval = QLA_SUCCESS; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) ha->srb_mempool = mempool_create_slab_pool(SRB_MIN_REQ, srb_cachep); +#else + ha->srb_mempool = mempool_create(SRB_MIN_REQ, mempool_alloc_slab, + mempool_free_slab, srb_cachep); +#endif if (ha->srb_mempool == NULL) { qla_printk(KERN_INFO, ha, "Unable to allocate SRB mempool.\n"); rval = QLA_FUNCTION_FAILED; @@ -2701,10 +2709,12 @@ static struct pci_device_id qla2xxx_pci_tbl[] = { PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432, PCI_ANY_ID, PCI_ANY_ID, }, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422, PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432, PCI_ANY_ID, PCI_ANY_ID, }, +#endif { 0 }, }; MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl);