Commit 5433383e authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley
Browse files

[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: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>

Rejections fixed up and
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 26a68019
Loading
Loading
Loading
Loading
+42 −27
Original line number Diff line number Diff line
config SCSI_QLA2XXX
	tristate
	default (SCSI && PCI)
	depends on SCSI && PCI

config SCSI_QLA21XX
	tristate "QLogic ISP2100 host adapter family support"
	depends on SCSI_QLA2XXX
	tristate "QLogic QLA2XXX Fibre Channel Support"
	depends on PCI && SCSI
	select SCSI_FC_ATTRS
	select FW_LOADER
	---help---
	This qla2xxx driver supports all QLogic Fibre Channel
	PCI and PCIe host adapters.

	By default, firmware for the ISP parts will be loaded
	via the Firmware Loader interface.

	ISP             Firmware Filename
	----------      -----------------
	21xx            ql2100_fw.bin
	22xx            ql2200_fw.bin
	2300, 2312      ql2300_fw.bin
	2322            ql2322_fw.bin
	6312, 6322      ql6312_fw.bin
	24xx            ql2400_fw.bin

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

	NOTE: The original method of building firmware-loader
	modules has been deprecated as the firmware-images will
	be removed from the kernel sources.

config SCSI_QLA2XXX_EMBEDDED_FIRMWARE
	bool "  Use firmware-loader modules (DEPRECATED)"
	depends on SCSI_QLA2XXX

config SCSI_QLA21XX
	tristate "  Build QLogic ISP2100 firmware-module"
	depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE
	---help---
	This driver supports the QLogic 21xx (ISP2100) host adapter family.

config SCSI_QLA22XX
	tristate "QLogic ISP2200 host adapter family support"
	depends on SCSI_QLA2XXX
        select SCSI_FC_ATTRS
	select FW_LOADER
	tristate "  Build QLogic ISP2200 firmware-module"
	depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE
	---help---
	This driver supports the QLogic 22xx (ISP2200) host adapter family.

config SCSI_QLA2300
	tristate "QLogic ISP2300 host adapter family support"
	depends on SCSI_QLA2XXX
        select SCSI_FC_ATTRS
	select FW_LOADER
	tristate "  Build QLogic ISP2300 firmware-module"
	depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE
	---help---
	This driver supports the QLogic 2300 (ISP2300 and ISP2312) host
	adapter family.

config SCSI_QLA2322
	tristate "QLogic ISP2322 host adapter family support"
	depends on SCSI_QLA2XXX
        select SCSI_FC_ATTRS
	select FW_LOADER
	tristate "  Build QLogic ISP2322 firmware-module"
	depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE
	---help---
	This driver supports the QLogic 2322 (ISP2322) host adapter family.

config SCSI_QLA6312
	tristate "QLogic ISP63xx host adapter family support"
	depends on SCSI_QLA2XXX
        select SCSI_FC_ATTRS
	select FW_LOADER
	tristate "  Build QLogic ISP63xx firmware-module"
	depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE
	---help---
	This driver supports the QLogic 63xx (ISP6312 and ISP6322) host
	adapter family.

config SCSI_QLA24XX
	tristate "QLogic ISP24xx host adapter family support"
	depends on SCSI_QLA2XXX
	select SCSI_FC_ATTRS
	select FW_LOADER
	tristate "  Build QLogic ISP24xx firmware-module"
	depends on SCSI_QLA2XXX_EMBEDDED_FIRMWARE
	---help---
	This driver supports the QLogic 24xx (ISP2422 and ISP2432) host
	adapter family.
+2 −0
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@ EXTRA_CFLAGS += -DUNIQUE_FW_NAME
qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \
		qla_dbg.o qla_sup.o qla_rscn.o qla_attr.o

obj-$(CONFIG_SCSI_QLA2XXX) += qla2xxx.o

qla2100-y := ql2100.o ql2100_fw.o
qla2200-y := ql2200.o ql2200_fw.o
qla2300-y := ql2300.o ql2300_fw.o
+1 −1
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ static ssize_t
qla2x00_isp_name_show(struct class_device *cdev, char *buf)
{
	scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
	return snprintf(buf, PAGE_SIZE, "%s\n", ha->brd_info->isp_name);
	return snprintf(buf, PAGE_SIZE, "ISP%04X\n", ha->pdev->device);
}

static ssize_t
+23 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/firmware.h>
#include <asm/semaphore.h>

#include <scsi/scsi.h>
@@ -29,6 +30,7 @@
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>

#if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE)
#if defined(CONFIG_SCSI_QLA21XX) || defined(CONFIG_SCSI_QLA21XX_MODULE)
#define IS_QLA2100(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2100)
#else
@@ -79,9 +81,23 @@
#define IS_QLA2522(ha)	0
#endif

#else	/* !defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) */

#define IS_QLA2100(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2100)
#define IS_QLA2200(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2200)
#define IS_QLA2300(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2300)
#define IS_QLA2312(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2312)
#define IS_QLA2322(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2322)
#define IS_QLA6312(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP6312)
#define IS_QLA6322(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP6322)
#define IS_QLA2422(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422)
#define IS_QLA2432(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432)
#define IS_QLA2512(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2512)
#define IS_QLA2522(ha)	((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2522)
#endif

#define IS_QLA23XX(ha)	(IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \
    			 IS_QLA6312(ha) || IS_QLA6322(ha))

#define IS_QLA24XX(ha)	(IS_QLA2422(ha) || IS_QLA2432(ha))
#define IS_QLA25XX(ha)	(IS_QLA2512(ha) || IS_QLA2522(ha))

@@ -2124,6 +2140,12 @@ struct qla_board_info {
	struct scsi_host_template *sht;
};

struct fw_blob {
	char *name;
	uint32_t segs[4];
	const struct firmware *fw;
};

/* Return data from MBC_GET_ID_LIST call. */
struct gid_list_info {
	uint8_t	al_pa;
+3 −1
Original line number Diff line number Diff line
@@ -33,8 +33,8 @@ extern int qla24xx_nvram_config(struct scsi_qla_host *);
extern void qla2x00_update_fw_options(struct scsi_qla_host *);
extern void qla24xx_update_fw_options(scsi_qla_host_t *);
extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *);
extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *);
extern int qla24xx_load_risc_flash(scsi_qla_host_t *, uint32_t *);
extern int qla24xx_load_risc_hotplug(scsi_qla_host_t *, uint32_t *);

extern fc_port_t *qla2x00_alloc_fcport(scsi_qla_host_t *, gfp_t);

@@ -76,6 +76,8 @@ extern void qla2x00_blink_led(scsi_qla_host_t *);

extern int qla2x00_down_timeout(struct semaphore *, unsigned long);

extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *);

/*
 * Global Function Prototypes in qla_iocb.c source file.
 */
Loading