qla2xxx: Add ISP27xx fwdump template entry T275 (insert buffer).
authorJoe Carnuccio <joe.carnuccio@qlogic.com>
Thu, 25 Sep 2014 09:16:36 +0000 (05:16 -0400)
committerChristoph Hellwig <hch@lst.de>
Thu, 25 Sep 2014 12:25:01 +0000 (14:25 +0200)
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_tmpl.c
drivers/scsi/qla2xxx/qla_tmpl.h

index 61bd49f4f7bf4cb9715909cd9ef1d2304b0b2565..fff8769f0b3323b4f8c3e81224ded9a052629a8c 100644 (file)
  * |                              |                    | 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  |
index 6f2f7b29607d6ac159c03adc80af40de0e72fa2b..d92ee068e802129df810d0fe5f8694f83ab1041e 100644 (file)
@@ -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 }
 };
 
index 1967424c8e64c832bac74ea98841556f762c5e39..f19856bb873f225ec6b6d3c4c6731c439bbf2c97 100644 (file)
@@ -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;
        };
 };