diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_dbg.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index cb2eca4c26d8..2afc8a362f2c 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -769,6 +769,9 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) | |||
769 | void *nxt; | 769 | void *nxt; |
770 | struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); | 770 | struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); |
771 | 771 | ||
772 | if (IS_QLA82XX(ha)) | ||
773 | return; | ||
774 | |||
772 | risc_address = ext_mem_cnt = 0; | 775 | risc_address = ext_mem_cnt = 0; |
773 | flags = 0; | 776 | flags = 0; |
774 | 777 | ||
@@ -1660,4 +1663,62 @@ qla2x00_dump_buffer(uint8_t * b, uint32_t size) | |||
1660 | printk("\n"); | 1663 | printk("\n"); |
1661 | } | 1664 | } |
1662 | 1665 | ||
1666 | void | ||
1667 | qla2x00_dump_buffer_zipped(uint8_t *b, uint32_t size) | ||
1668 | { | ||
1669 | uint32_t cnt; | ||
1670 | uint8_t c; | ||
1671 | uint8_t last16[16], cur16[16]; | ||
1672 | uint32_t lc = 0, num_same16 = 0, j; | ||
1673 | |||
1674 | printk(KERN_DEBUG " 0 1 2 3 4 5 6 7 8 9 " | ||
1675 | "Ah Bh Ch Dh Eh Fh\n"); | ||
1676 | printk(KERN_DEBUG "----------------------------------------" | ||
1677 | "----------------------\n"); | ||
1678 | |||
1679 | for (cnt = 0; cnt < size;) { | ||
1680 | c = *b++; | ||
1663 | 1681 | ||
1682 | cur16[lc++] = c; | ||
1683 | |||
1684 | cnt++; | ||
1685 | if (cnt % 16) | ||
1686 | continue; | ||
1687 | |||
1688 | /* We have 16 now */ | ||
1689 | lc = 0; | ||
1690 | if (num_same16 == 0) { | ||
1691 | memcpy(last16, cur16, 16); | ||
1692 | num_same16++; | ||
1693 | continue; | ||
1694 | } | ||
1695 | if (memcmp(cur16, last16, 16) == 0) { | ||
1696 | num_same16++; | ||
1697 | continue; | ||
1698 | } | ||
1699 | for (j = 0; j < 16; j++) | ||
1700 | printk(KERN_DEBUG "%02x ", (uint32_t)last16[j]); | ||
1701 | printk(KERN_DEBUG "\n"); | ||
1702 | |||
1703 | if (num_same16 > 1) | ||
1704 | printk(KERN_DEBUG "> prev pattern repeats (%u)" | ||
1705 | "more times\n", num_same16-1); | ||
1706 | memcpy(last16, cur16, 16); | ||
1707 | num_same16 = 1; | ||
1708 | } | ||
1709 | |||
1710 | if (num_same16) { | ||
1711 | for (j = 0; j < 16; j++) | ||
1712 | printk(KERN_DEBUG "%02x ", (uint32_t)last16[j]); | ||
1713 | printk(KERN_DEBUG "\n"); | ||
1714 | |||
1715 | if (num_same16 > 1) | ||
1716 | printk(KERN_DEBUG "> prev pattern repeats (%u)" | ||
1717 | "more times\n", num_same16-1); | ||
1718 | } | ||
1719 | if (lc) { | ||
1720 | for (j = 0; j < lc; j++) | ||
1721 | printk(KERN_DEBUG "%02x ", (uint32_t)cur16[j]); | ||
1722 | printk(KERN_DEBUG "\n"); | ||
1723 | } | ||
1724 | } | ||