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

Commit 2ac224bc authored by Joe Carnuccio's avatar Joe Carnuccio Committed by Christoph Hellwig
Browse files

qla2xxx: Add ISP27xx fwdump template entry T275 (insert buffer).

parent ce9b9b08
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -64,11 +64,10 @@
 * |                              |                    | 0xb13c-0xb140  |
 * |                              |                    | 0xb149		|
 * | MultiQ                       |       0xc00c       |		|
 * | Misc                         |       0xd212       | 0xd011-0xd017	|
 * |                              |                    | 0xd020		|
 * |                              |                    | 0xd030-0xd0ff	|
 * | Misc                         |       0xd213       | 0xd011-0xd017	|
 * |                              |                    | 0xd031-0xd0ff	|
 * |                              |                    | 0xd101-0xd1fe	|
 * |                              |                    | 0xd213-0xd2fe	|
 * |                              |                    | 0xd214-0xd2fe	|
 * | Target Mode		  |	  0xe078       |		|
 * | Target Mode Management	  |	  0xf072       | 0xf002-0xf003	|
 * |                              |                    | 0xf046-0xf049  |
+27 −0
Original line number Diff line number Diff line
@@ -689,6 +689,32 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
	return false;
}

static int
qla27xx_fwdt_entry_t275(struct scsi_qla_host *vha,
	struct qla27xx_fwdt_entry *ent, void *buf, ulong *len)
{
	ulong offset = offsetof(typeof(*ent), t275.buffer);

	ql_dbg(ql_dbg_misc, vha, 0xd213,
	    "%s: buffer(%x) [%lx]\n", __func__, ent->t275.length, *len);
	if (!ent->t275.length) {
		ql_dbg(ql_dbg_misc, vha, 0xd020,
		    "%s: buffer zero length\n", __func__);
		qla27xx_skip_entry(ent, buf);
		goto done;
	}
	if (offset + ent->t275.length > ent->hdr.entry_size) {
		ql_dbg(ql_dbg_misc, vha, 0xd030,
		    "%s: buffer overflow\n", __func__);
		qla27xx_skip_entry(ent, buf);
		goto done;
	}

	qla27xx_insertbuf(ent->t275.buffer, ent->t275.length, buf, len);
done:
	return false;
}

static int
qla27xx_fwdt_entry_other(struct scsi_qla_host *vha,
	struct qla27xx_fwdt_entry *ent, void *buf, ulong *len)
@@ -731,6 +757,7 @@ static struct qla27xx_fwdt_entry_call ql27xx_fwdt_entry_call_list[] = {
	{ ENTRY_TYPE_RDREMRAM		, qla27xx_fwdt_entry_t272  } ,
	{ ENTRY_TYPE_PCICFG		, qla27xx_fwdt_entry_t273  } ,
	{ ENTRY_TYPE_GET_SHADOW		, qla27xx_fwdt_entry_t274  } ,
	{ ENTRY_TYPE_WRITE_BUF		, qla27xx_fwdt_entry_t275  } ,
	{ -1				, qla27xx_fwdt_entry_other }
};

+6 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ struct __packed qla27xx_fwdt_template {
#define ENTRY_TYPE_RDREMRAM		272
#define ENTRY_TYPE_PCICFG		273
#define ENTRY_TYPE_GET_SHADOW		274
#define ENTRY_TYPE_WRITE_BUF		275

#define CAPTURE_FLAG_PHYS_ONLY		BIT_0
#define CAPTURE_FLAG_PHYS_VIRT		BIT_1
@@ -193,6 +194,11 @@ struct __packed qla27xx_fwdt_entry {
			uint8_t  queue_type;
			uint8_t  reserved[3];
		} t274;

		struct __packed {
			uint32_t length;
			uint8_t  buffer[];
		} t275;
	};
};