Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 044cc6c8 authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley
Browse files

[SCSI] qla2xxx: Add ISP54xx support.



Chip is similar in form to our ISP24xx offering.

Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent ea5b6382
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -49,6 +49,18 @@ static struct qla_board_info qla_board_tbl[] = {
		.fw_info	= qla_fw_tbl,
		.fw_fname	= "ql2400_fw.bin",
	},
	{
		.drv_name	= qla_driver_name,
		.isp_name	= "ISP5422",
		.fw_info	= qla_fw_tbl,
		.fw_fname	= "ql2400_fw.bin",
	},
	{
		.drv_name	= qla_driver_name,
		.isp_name	= "ISP5432",
		.fw_info	= qla_fw_tbl,
		.fw_fname	= "ql2400_fw.bin",
	},
};

static struct pci_device_id qla24xx_pci_tbl[] = {
@@ -66,6 +78,21 @@ static struct pci_device_id qla24xx_pci_tbl[] = {
		.subdevice	= PCI_ANY_ID,
		.driver_data	= (unsigned long)&qla_board_tbl[1],
	},
	{
		.vendor		= PCI_VENDOR_ID_QLOGIC,
		.device		= PCI_DEVICE_ID_QLOGIC_ISP5422,
		.subvendor	= PCI_ANY_ID,
		.subdevice	= PCI_ANY_ID,
		.driver_data	= (unsigned long)&qla_board_tbl[2],
	},
	{
		.vendor		= PCI_VENDOR_ID_QLOGIC,
		.device		= PCI_DEVICE_ID_QLOGIC_ISP5432,
		.subvendor	= PCI_ANY_ID,
		.subdevice	= PCI_ANY_ID,
		.driver_data	= (unsigned long)&qla_board_tbl[3],
	},

	{0, 0},
};
MODULE_DEVICE_TABLE(pci, qla24xx_pci_tbl);
+4 −4
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off,
			    ha->host_no);

			vfree(ha->fw_dump_buffer);
			if (!IS_QLA24XX(ha) && !IS_QLA25XX(ha))
			if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
				free_pages((unsigned long)ha->fw_dump,
				    ha->fw_dump_order);

@@ -64,7 +64,7 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off,
		if ((ha->fw_dump || ha->fw_dumped) && !ha->fw_dump_reading) {
			ha->fw_dump_reading = 1;

			if (IS_QLA24XX(ha) || IS_QLA25XX(ha))
			if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
				dump_size = FW_DUMP_SIZE_24XX;
			else {
				dump_size = FW_DUMP_SIZE_1M;
@@ -138,7 +138,7 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj, char *buf, loff_t off,
		return 0;

	/* Checksum NVRAM. */
	if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) {
	if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
		uint32_t *iter;
		uint32_t chksum;

@@ -750,7 +750,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
	pfc_host_stat = &ha->fc_host_stat;
	memset(pfc_host_stat, -1, sizeof(struct fc_host_statistics));

	if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) {
	if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
		rval = qla24xx_get_isp_stats(ha, (uint32_t *)&stat_buf,
		    sizeof(stat_buf) / 4, mb_stat);
	} else {
+6 −6
Original line number Diff line number Diff line
@@ -2234,9 +2234,9 @@ typedef struct scsi_qla_host {
#define DT_ISP6322			BIT_6
#define DT_ISP2422			BIT_7
#define DT_ISP2432			BIT_8
#define DT_ISP2512			BIT_9
#define DT_ISP2522			BIT_10
#define DT_ISP_LAST			(DT_ISP2522 << 1)
#define DT_ISP5422			BIT_9
#define DT_ISP5432			BIT_10
#define DT_ISP_LAST			(DT_ISP5432 << 1)

#define DT_OEM_001			BIT_29
#define DT_ISP2200A			BIT_30
@@ -2252,13 +2252,13 @@ typedef struct scsi_qla_host {
#define IS_QLA6322(ha)	(DT_MASK(ha) & DT_ISP6322)
#define IS_QLA2422(ha)	(DT_MASK(ha) & DT_ISP2422)
#define IS_QLA2432(ha)	(DT_MASK(ha) & DT_ISP2432)
#define IS_QLA2512(ha)	(DT_MASK(ha) & DT_ISP2512)
#define IS_QLA2522(ha)	(DT_MASK(ha) & DT_ISP2522)
#define IS_QLA5422(ha)	(DT_MASK(ha) & DT_ISP5422)
#define IS_QLA5432(ha)	(DT_MASK(ha) & DT_ISP5432)

#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))
#define IS_QLA54XX(ha)	(IS_QLA5422(ha) || IS_QLA5432(ha))

#define IS_OEM_001(ha)		((ha)->device_type & DT_OEM_001)
#define HAS_EXTENDED_IDS(ha)	((ha)->device_type & DT_EXTENDED_IDS)
+4 −6
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ qla2x00_chk_ms_status(scsi_qla_host_t *ha, ms_iocb_entry_t *ms_pkt,
		DEBUG2_3(printk("scsi(%ld): %s failed, error status (%x).\n",
		    ha->host_no, routine, ms_pkt->entry_status));
	} else {
		if (IS_QLA24XX(ha) || IS_QLA25XX(ha))
		if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
			comp_status =
			    ((struct ct_entry_24xx *)ms_pkt)->comp_status;
		else
@@ -1200,7 +1200,7 @@ qla2x00_update_ms_fdmi_iocb(scsi_qla_host_t *ha, uint32_t req_size)
	ms_iocb_entry_t *ms_pkt = ha->ms_iocb;
	struct ct_entry_24xx *ct_pkt = (struct ct_entry_24xx *)ha->ms_iocb;

	if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) {
	if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
		ct_pkt->cmd_byte_count = cpu_to_le32(req_size);
		ct_pkt->dseg_0_len = ct_pkt->cmd_byte_count;
	} else {
@@ -1529,9 +1529,7 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *ha)
	eiter = (struct ct_fdmi_port_attr *) (entries + size);
	eiter->type = __constant_cpu_to_be16(FDMI_PORT_SUPPORT_SPEED);
	eiter->len = __constant_cpu_to_be16(4 + 4);
	if (IS_QLA25XX(ha))
		eiter->a.sup_speed = __constant_cpu_to_be32(8);
	else if (IS_QLA24XX(ha))
	if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
		eiter->a.sup_speed = __constant_cpu_to_be32(4);
	else if (IS_QLA23XX(ha))
		eiter->a.sup_speed = __constant_cpu_to_be32(2);
@@ -1566,7 +1564,7 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *ha)
	eiter = (struct ct_fdmi_port_attr *) (entries + size);
	eiter->type = __constant_cpu_to_be16(FDMI_PORT_MAX_FRAME_SIZE);
	eiter->len = __constant_cpu_to_be16(4 + 4);
	max_frame_size = IS_QLA24XX(ha) || IS_QLA25XX(ha) ?
	max_frame_size = IS_QLA24XX(ha) || IS_QLA54XX(ha) ?
		(uint32_t) icb24->frame_payload_size:
		(uint32_t) ha->init_cb->frame_payload_size;
	eiter->a.max_frame_size = cpu_to_be32(max_frame_size);
+7 −7
Original line number Diff line number Diff line
@@ -387,7 +387,7 @@ qla2x00_isp_firmware(scsi_qla_host_t *ha)

		/* Verify checksum of loaded RISC code. */
		rval = qla2x00_verify_checksum(ha,
		    IS_QLA24XX(ha) || IS_QLA25XX(ha) ? RISC_SADDRESS :
		    IS_QLA24XX(ha) || IS_QLA54XX(ha) ? RISC_SADDRESS :
		    *ha->brd_info->fw_info[0].fwstart);
	}

@@ -822,7 +822,7 @@ qla2x00_resize_request_q(scsi_qla_host_t *ha)
	if (IS_QLA2100(ha) || IS_QLA2200(ha))
		return;

	if (IS_QLA24XX(ha) || IS_QLA25XX(ha))
	if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
		qla2x00_alloc_fw_dump(ha);

	/* Retrieve IOCB counts available to the firmware. */
@@ -2123,7 +2123,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha)
	LIST_HEAD(new_fcports);

	/* If FL port exists, then SNS is present */
	if (IS_QLA24XX(ha) || IS_QLA25XX(ha))
	if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
		loop_id = NPH_F_PORT;
	else
		loop_id = SNS_FL_PORT;
@@ -2149,7 +2149,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha)
			qla2x00_fdmi_register(ha);

		/* Ensure we are logged into the SNS. */
		if (IS_QLA24XX(ha) || IS_QLA25XX(ha))
		if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
			loop_id = NPH_SNS;
		else
			loop_id = SIMPLE_NAME_SERVER;
@@ -2640,7 +2640,7 @@ qla2x00_device_resync(scsi_qla_host_t *ha)
			if (ql2xprocessrscn &&
			    !IS_QLA2100(ha) && !IS_QLA2200(ha) &&
			    !IS_QLA6312(ha) && !IS_QLA6322(ha) &&
			    !IS_QLA24XX(ha) && !IS_QLA25XX(ha) &&
			    !IS_QLA24XX(ha) && !IS_QLA54XX(ha) &&
			    ha->flags.init_done) {
				/* Handle port RSCN via asyncronous IOCBs */
				rval2 = qla2x00_handle_port_rscn(ha, rscn_entry,
@@ -3130,7 +3130,7 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)

			spin_lock_irqsave(&ha->hardware_lock, flags);

			if (!IS_QLA24XX(ha) && !IS_QLA25XX(ha)) {
			if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) {
				/*
				 * Disable SRAM, Instruction RAM and GP RAM
				 * parity.
@@ -3146,7 +3146,7 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)

			spin_lock_irqsave(&ha->hardware_lock, flags);

			if (!IS_QLA24XX(ha) && !IS_QLA25XX(ha)) {
			if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) {
				/* Enable proper parity */
				if (IS_QLA2300(ha))
					/* SRAM parity */
Loading