add hotplug support for updating HBA flash.
Subsystems (2)
PATCH 1/1 add hotplug support for updating HBA flash.
Currently the only way to update an HBA's flash-part (for boot-code such as BIOS, EFI, or FCODE) is to use the managment-tools which rely on IOCTL support within the driver. The attached patch adds support for updating the flash via the request_firmware() hotplug infrastructure. This code is fashioned around similar code in the IPR driver:
# echo "ql23rom.bin" > /sys/class/scsi_host/host0/update_flash
which signals the driver to request the file image via the request_firmware() interface.
The attached patch is against scsi-misc-2.6. Please consider for inclusion.
Kconfig | 1 qla_def.h | 11 qla_gbl.h | 4 qla_os.c | 95 +++++++ qla_sup.c | 809 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 919 insertions(+), 1 deletion(-)
===== drivers/scsi/qla2xxx/Kconfig 1.7 vs edited =====
drivers/scsi/qla2xxx/Kconfig +1 -0
@@ -2,6 +2,7 @@ config SCSI_QLA2XXX tristate default (SCSI && PCI) depends on SCSI && PCI + select FW_LOADER config SCSI_QLA21XX tristate "QLogic ISP2100 host adapter family support"
===== drivers/scsi/qla2xxx/qla_def.h 1.27 vs edited =====
drivers/scsi/qla2xxx/qla_def.h +11 -0
@@ -83,8 +83,12 @@#if defined(CONFIG_SCSI_QLA2322 ) || defined(CONFIG_SCSI_QLA2322_MODULE )#define IS_QLA2322 (ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2322) +#define IS_OEM_001 (ha) ((ha)->pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2322 && \ + (ha)->pdev->subsystem_vendor == 0x1028 && \ + (ha)->pdev->subsystem_device == 0x0170)#else #define IS_QLA2322 (ha) 0 +#define IS_OEM_001 (ha) 0#endif #if defined(CONFIG_SCSI_QLA6312 ) || defined(CONFIG_SCSI_QLA6312_MODULE )
@@ -176,6 +180,13 @@#define WRT_REG_BYTE (addr, data) writeb(data,addr)#define WRT_REG_WORD (addr, data) writew(data,addr)#define WRT_REG_DWORD (addr, data) writel(data,addr) + +#define RD_REG_WORD_PIO (addr) (inw((unsigned long)addr)) +#define WRT_REG_WORD_PIO (addr, data) (outw(data,(unsigned long)addr)) +#define QLA2X00_READ 1 +#define QLA2X00_WRITE 2 +#define OPT_ROM_SIZE_2312 0x20000 +#define OPT_ROM_SIZE_2322 0x100000/* * Fibre Channel device definitions.
===== drivers/scsi/qla2xxx/qla_gbl.h 1.16 vs edited =====
drivers/scsi/qla2xxx/qla_gbl.h +4 -0
@@ -96,6 +96,7 @@ extern void qla2x00_abort_queues(scsi_qlextern void qla2x00_blink_led (scsi_qla_host_t *);extern int qla2x00_down_timeout (struct semaphore *,unsigned long ); +extern int qla2x00_wait_for_hba_online (scsi_qla_host_t *);/* * Global Function Prototypes in qla_iocb.c source file.
@@ -215,6 +216,9 @@ extern void qla2x00_unlock_nvram_access(extern void qla2x00_release_nvram_protection (scsi_qla_host_t *);extern uint16_t qla2x00_get_nvram_word (scsi_qla_host_t *,uint32_t );extern void qla2x00_write_nvram_word (scsi_qla_host_t *,uint32_t ,uint16_t ); +extern uint16_t qla2x00_update_or_read_flash (scsi_qla_host_t *,uint8_t *, +uint32_t ,uint32_t ,uint8_t ); +/* * Global Function Prototypes in qla_dbg.c source file. */
===== drivers/scsi/qla2xxx/qla_os.c 1.53 vs edited =====
drivers/scsi/qla2xxx/qla_os.c +94 -1
125 lines not on this page · raw message
===== drivers/scsi/qla2xxx/qla_sup.c 1.8 vs edited =====
drivers/scsi/qla2xxx/qla_sup.c +809 -0
812 lines not on this page · raw message