diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 62 |
1 files changed, 57 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index d3746ec80a8..c53ec67c47f 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -391,7 +391,8 @@ qla2x00_execute_fw(scsi_qla_host_t *ha, uint32_t risc_addr) | |||
391 | mcp->mb[1] = MSW(risc_addr); | 391 | mcp->mb[1] = MSW(risc_addr); |
392 | mcp->mb[2] = LSW(risc_addr); | 392 | mcp->mb[2] = LSW(risc_addr); |
393 | mcp->mb[3] = 0; | 393 | mcp->mb[3] = 0; |
394 | mcp->out_mb |= MBX_3|MBX_2|MBX_1; | 394 | mcp->mb[4] = 0; |
395 | mcp->out_mb |= MBX_4|MBX_3|MBX_2|MBX_1; | ||
395 | mcp->in_mb |= MBX_1; | 396 | mcp->in_mb |= MBX_1; |
396 | } else { | 397 | } else { |
397 | mcp->mb[1] = LSW(risc_addr); | 398 | mcp->mb[1] = LSW(risc_addr); |
@@ -1919,7 +1920,8 @@ qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma, | |||
1919 | */ | 1920 | */ |
1920 | int | 1921 | int |
1921 | qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, | 1922 | qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, |
1922 | uint16_t *orig_xchg_cnt, uint16_t *cur_iocb_cnt, uint16_t *orig_iocb_cnt) | 1923 | uint16_t *orig_xchg_cnt, uint16_t *cur_iocb_cnt, |
1924 | uint16_t *orig_iocb_cnt, uint16_t *max_npiv_vports) | ||
1923 | { | 1925 | { |
1924 | int rval; | 1926 | int rval; |
1925 | mbx_cmd_t mc; | 1927 | mbx_cmd_t mc; |
@@ -1929,7 +1931,7 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, | |||
1929 | 1931 | ||
1930 | mcp->mb[0] = MBC_GET_RESOURCE_COUNTS; | 1932 | mcp->mb[0] = MBC_GET_RESOURCE_COUNTS; |
1931 | mcp->out_mb = MBX_0; | 1933 | mcp->out_mb = MBX_0; |
1932 | mcp->in_mb = MBX_10|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; | 1934 | mcp->in_mb = MBX_11|MBX_10|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; |
1933 | mcp->tov = 30; | 1935 | mcp->tov = 30; |
1934 | mcp->flags = 0; | 1936 | mcp->flags = 0; |
1935 | rval = qla2x00_mailbox_command(ha, mcp); | 1937 | rval = qla2x00_mailbox_command(ha, mcp); |
@@ -1940,9 +1942,9 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, | |||
1940 | ha->host_no, mcp->mb[0])); | 1942 | ha->host_no, mcp->mb[0])); |
1941 | } else { | 1943 | } else { |
1942 | DEBUG11(printk("%s(%ld): done. mb1=%x mb2=%x mb3=%x mb6=%x " | 1944 | DEBUG11(printk("%s(%ld): done. mb1=%x mb2=%x mb3=%x mb6=%x " |
1943 | "mb7=%x mb10=%x.\n", __func__, ha->host_no, | 1945 | "mb7=%x mb10=%x mb11=%x.\n", __func__, ha->host_no, |
1944 | mcp->mb[1], mcp->mb[2], mcp->mb[3], mcp->mb[6], mcp->mb[7], | 1946 | mcp->mb[1], mcp->mb[2], mcp->mb[3], mcp->mb[6], mcp->mb[7], |
1945 | mcp->mb[10])); | 1947 | mcp->mb[10], mcp->mb[11])); |
1946 | 1948 | ||
1947 | if (cur_xchg_cnt) | 1949 | if (cur_xchg_cnt) |
1948 | *cur_xchg_cnt = mcp->mb[3]; | 1950 | *cur_xchg_cnt = mcp->mb[3]; |
@@ -1952,6 +1954,8 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, | |||
1952 | *cur_iocb_cnt = mcp->mb[7]; | 1954 | *cur_iocb_cnt = mcp->mb[7]; |
1953 | if (orig_iocb_cnt) | 1955 | if (orig_iocb_cnt) |
1954 | *orig_iocb_cnt = mcp->mb[10]; | 1956 | *orig_iocb_cnt = mcp->mb[10]; |
1957 | if (max_npiv_vports) | ||
1958 | *max_npiv_vports = mcp->mb[11]; | ||
1955 | } | 1959 | } |
1956 | 1960 | ||
1957 | return (rval); | 1961 | return (rval); |
@@ -2980,3 +2984,51 @@ qla2x00_send_change_request(scsi_qla_host_t *ha, uint16_t format, | |||
2980 | 2984 | ||
2981 | return rval; | 2985 | return rval; |
2982 | } | 2986 | } |
2987 | |||
2988 | int | ||
2989 | qla2x00_dump_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t addr, | ||
2990 | uint32_t size) | ||
2991 | { | ||
2992 | int rval; | ||
2993 | mbx_cmd_t mc; | ||
2994 | mbx_cmd_t *mcp = &mc; | ||
2995 | |||
2996 | DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); | ||
2997 | |||
2998 | if (MSW(addr) || IS_FWI2_CAPABLE(ha)) { | ||
2999 | mcp->mb[0] = MBC_DUMP_RISC_RAM_EXTENDED; | ||
3000 | mcp->mb[8] = MSW(addr); | ||
3001 | mcp->out_mb = MBX_8|MBX_0; | ||
3002 | } else { | ||
3003 | mcp->mb[0] = MBC_DUMP_RISC_RAM; | ||
3004 | mcp->out_mb = MBX_0; | ||
3005 | } | ||
3006 | mcp->mb[1] = LSW(addr); | ||
3007 | mcp->mb[2] = MSW(req_dma); | ||
3008 | mcp->mb[3] = LSW(req_dma); | ||
3009 | mcp->mb[6] = MSW(MSD(req_dma)); | ||
3010 | mcp->mb[7] = LSW(MSD(req_dma)); | ||
3011 | mcp->out_mb |= MBX_7|MBX_6|MBX_3|MBX_2|MBX_1; | ||
3012 | if (IS_FWI2_CAPABLE(ha)) { | ||
3013 | mcp->mb[4] = MSW(size); | ||
3014 | mcp->mb[5] = LSW(size); | ||
3015 | mcp->out_mb |= MBX_5|MBX_4; | ||
3016 | } else { | ||
3017 | mcp->mb[4] = LSW(size); | ||
3018 | mcp->out_mb |= MBX_4; | ||
3019 | } | ||
3020 | |||
3021 | mcp->in_mb = MBX_0; | ||
3022 | mcp->tov = 30; | ||
3023 | mcp->flags = 0; | ||
3024 | rval = qla2x00_mailbox_command(ha, mcp); | ||
3025 | |||
3026 | if (rval != QLA_SUCCESS) { | ||
3027 | DEBUG2_3_11(printk("%s(%ld): failed=%x mb[0]=%x.\n", __func__, | ||
3028 | ha->host_no, rval, mcp->mb[0])); | ||
3029 | } else { | ||
3030 | DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); | ||
3031 | } | ||
3032 | |||
3033 | return rval; | ||
3034 | } | ||