Commit aa230bc5 authored by Arun Easi's avatar Arun Easi Committed by James Bottomley
Browse files

[SCSI] qla2xxx: Enable target mode support for ISP83xx.

parent 3c290d0b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@
 * | MultiQ                       |       0xc00c       |		|
 * | Misc                         |       0xd010       |		|
 * | Target Mode		  |	  0xe06f       |		|
 * | Target Mode Management	  |	  0xf071       |		|
 * | Target Mode Management	  |	  0xf072       |		|
 * | Target Mode Task Management  |	  0x1000b      |		|
 * ----------------------------------------------------------------------
 */
+8 −0
Original line number Diff line number Diff line
@@ -537,6 +537,8 @@ struct device_reg_25xxmq {
	uint32_t req_q_out;
	uint32_t rsp_q_in;
	uint32_t rsp_q_out;
	uint32_t atio_q_in;
	uint32_t atio_q_out;
};

typedef union {
@@ -563,6 +565,9 @@ typedef union {
	 &(reg)->u.isp2100.mailbox5 : \
	 &(reg)->u.isp2300.rsp_q_out)

#define ISP_ATIO_Q_IN(vha) (vha->hw->tgt.atio_q_in)
#define ISP_ATIO_Q_OUT(vha) (vha->hw->tgt.atio_q_out)

#define MAILBOX_REG(ha, reg, num) \
	(IS_QLA2100(ha) || IS_QLA2200(ha) ? \
	 (num < 8 ? \
@@ -2559,6 +2564,8 @@ struct qlt_hw_data {
	struct atio *atio_ring_ptr;	/* Current address. */
	uint16_t atio_ring_index; /* Current index. */
	uint16_t atio_q_length;
	uint32_t __iomem *atio_q_in;
	uint32_t __iomem *atio_q_out;

	void *target_lport_ptr;
	struct qla_tgt_func_tmpl *tgt_ops;
@@ -2790,6 +2797,7 @@ struct qla_hw_data {
#define IS_PI_SPLIT_DET_CAPABLE_HBA(ha)	(IS_QLA83XX(ha))
#define IS_PI_SPLIT_DET_CAPABLE(ha)	(IS_PI_SPLIT_DET_CAPABLE_HBA(ha) && \
    (((ha)->fw_attributes_h << 16 | (ha)->fw_attributes) & BIT_22))
#define IS_ATIO_MSIX_CAPABLE(ha) (IS_QLA83XX(ha))

	/* HBA serial number */
	uint8_t		serial0;
+2 −1
Original line number Diff line number Diff line
@@ -300,7 +300,8 @@ struct init_cb_24xx {
	uint32_t prio_request_q_address[2];

	uint16_t msix;
	uint8_t reserved_2[6];
	uint16_t msix_atio;
	uint8_t reserved_2[4];

	uint16_t atio_q_inpointer;
	uint16_t atio_q_length;
+5 −1
Original line number Diff line number Diff line
@@ -1964,7 +1964,7 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
		WRT_REG_DWORD(&reg->isp24.rsp_q_in, 0);
		WRT_REG_DWORD(&reg->isp24.rsp_q_out, 0);
	}
	qlt_24xx_config_rings(vha, reg);
	qlt_24xx_config_rings(vha);

	/* PCI posting */
	RD_REG_DWORD(&ioreg->hccr);
@@ -5579,6 +5579,8 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
	if (IS_T10_PI_CAPABLE(ha))
		nv->frame_payload_size &= ~7;

	qlt_81xx_config_nvram_stage1(vha, nv);

	/* Reset Initialization control block */
	memset(icb, 0, ha->init_cb_size);

@@ -5619,6 +5621,8 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
	qla2x00_set_model_info(vha, nv->model_name, sizeof(nv->model_name),
	    "QLE8XXX");

	qlt_81xx_config_nvram_stage2(vha, icb);

	/* Use alternate WWN? */
	if (nv->host_p & __constant_cpu_to_le32(BIT_15)) {
		memcpy(icb->node_name, nv->alternate_node_name, WWN_SIZE);
+14 −2
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
#include <scsi/scsi_bsg_fc.h>
#include <scsi/scsi_eh.h>

#include "qla_target.h"

static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t);
static void qla2x00_process_completed_request(struct scsi_qla_host *,
	struct req_que *, uint32_t);
@@ -2751,6 +2753,12 @@ static struct qla_init_msix_entry qla82xx_msix_entries[2] = {
	{ "qla2xxx (rsp_q)", qla82xx_msix_rsp_q },
};

static struct qla_init_msix_entry qla83xx_msix_entries[3] = {
	{ "qla2xxx (default)", qla24xx_msix_default },
	{ "qla2xxx (rsp_q)", qla24xx_msix_rsp_q },
	{ "qla2xxx (atio_q)", qla83xx_msix_atio_q },
};

static void
qla24xx_disable_msix(struct qla_hw_data *ha)
{
@@ -2831,9 +2839,13 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
	}

	/* Enable MSI-X vectors for the base queue */
	for (i = 0; i < 2; i++) {
	for (i = 0; i < ha->msix_count; i++) {
		qentry = &ha->msix_entries[i];
		if (IS_QLA82XX(ha)) {
		if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) {
			ret = request_irq(qentry->vector,
				qla83xx_msix_entries[i].handler,
				0, qla83xx_msix_entries[i].name, rsp);
		} else if (IS_QLA82XX(ha)) {
			ret = request_irq(qentry->vector,
				qla82xx_msix_entries[i].handler,
				0, qla82xx_msix_entries[i].name, rsp);
Loading