diff options
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gbl.h | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 16 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 11 |
5 files changed, 22 insertions, 13 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 445d583cf713..c90dc59abe0f 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1250,6 +1250,6 @@ qla2x00_init_host_attr(scsi_qla_host_t *ha) | |||
1250 | fc_host_node_name(ha->host) = wwn_to_u64(ha->node_name); | 1250 | fc_host_node_name(ha->host) = wwn_to_u64(ha->node_name); |
1251 | fc_host_port_name(ha->host) = wwn_to_u64(ha->port_name); | 1251 | fc_host_port_name(ha->host) = wwn_to_u64(ha->port_name); |
1252 | fc_host_supported_classes(ha->host) = FC_COS_CLASS3; | 1252 | fc_host_supported_classes(ha->host) = FC_COS_CLASS3; |
1253 | fc_host_max_npiv_vports(ha->host) = MAX_NUM_VPORT_FABRIC; | 1253 | fc_host_max_npiv_vports(ha->host) = ha->max_npiv_vports;; |
1254 | fc_host_npiv_vports_inuse(ha->host) = ha->cur_vport_count; | 1254 | fc_host_npiv_vports_inuse(ha->host) = ha->cur_vport_count; |
1255 | } | 1255 | } |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 511e3cd435fa..1396f4df7bd6 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2534,7 +2534,7 @@ typedef struct scsi_qla_host { | |||
2534 | #define VP_ERR_FAB_NORESOURCES 3 | 2534 | #define VP_ERR_FAB_NORESOURCES 3 |
2535 | #define VP_ERR_FAB_LOGOUT 4 | 2535 | #define VP_ERR_FAB_LOGOUT 4 |
2536 | #define VP_ERR_ADAP_NORESOURCES 5 | 2536 | #define VP_ERR_ADAP_NORESOURCES 5 |
2537 | int max_npiv_vports; /* 63 or 125 per topoloty */ | 2537 | uint16_t max_npiv_vports; /* 63 or 125 per topoloty */ |
2538 | int cur_vport_count; | 2538 | int cur_vport_count; |
2539 | } scsi_qla_host_t; | 2539 | } scsi_qla_host_t; |
2540 | 2540 | ||
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index e8122e8444c7..09cb2a908059 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -215,8 +215,8 @@ extern int | |||
215 | qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *); | 215 | qla2x00_get_id_list(scsi_qla_host_t *, void *, dma_addr_t, uint16_t *); |
216 | 216 | ||
217 | extern int | 217 | extern int |
218 | qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *, | 218 | qla2x00_get_resource_cnts(scsi_qla_host_t *, uint16_t *, uint16_t *, |
219 | uint16_t *); | 219 | uint16_t *, uint16_t *, uint16_t *); |
220 | 220 | ||
221 | extern int | 221 | extern int |
222 | qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map); | 222 | qla2x00_get_fcal_position_map(scsi_qla_host_t *ha, char *pos_map); |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 083997c3066e..e449f4807bb1 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -849,7 +849,8 @@ qla2x00_resize_request_q(scsi_qla_host_t *ha) | |||
849 | return; | 849 | return; |
850 | 850 | ||
851 | /* Retrieve IOCB counts available to the firmware. */ | 851 | /* Retrieve IOCB counts available to the firmware. */ |
852 | rval = qla2x00_get_resource_cnts(ha, NULL, NULL, NULL, &fw_iocb_cnt); | 852 | rval = qla2x00_get_resource_cnts(ha, NULL, NULL, NULL, &fw_iocb_cnt, |
853 | &ha->max_npiv_vports); | ||
853 | if (rval) | 854 | if (rval) |
854 | return; | 855 | return; |
855 | /* No point in continuing if current settings are sufficient. */ | 856 | /* No point in continuing if current settings are sufficient. */ |
@@ -916,9 +917,15 @@ qla2x00_setup_chip(scsi_qla_host_t *ha) | |||
916 | &ha->fw_attributes, &ha->fw_memory_size); | 917 | &ha->fw_attributes, &ha->fw_memory_size); |
917 | qla2x00_resize_request_q(ha); | 918 | qla2x00_resize_request_q(ha); |
918 | ha->flags.npiv_supported = 0; | 919 | ha->flags.npiv_supported = 0; |
919 | if (IS_QLA24XX(ha) && | 920 | if ((IS_QLA24XX(ha) || IS_QLA25XX(ha)) && |
920 | (ha->fw_attributes & BIT_2)) | 921 | (ha->fw_attributes & BIT_2)) { |
921 | ha->flags.npiv_supported = 1; | 922 | ha->flags.npiv_supported = 1; |
923 | if ((!ha->max_npiv_vports) || | ||
924 | ((ha->max_npiv_vports + 1) % | ||
925 | MAX_MULTI_ID_FABRIC)) | ||
926 | ha->max_npiv_vports = | ||
927 | MAX_NUM_VPORT_FABRIC; | ||
928 | } | ||
922 | 929 | ||
923 | if (ql2xallocfwdump) | 930 | if (ql2xallocfwdump) |
924 | qla2x00_alloc_fw_dump(ha); | 931 | qla2x00_alloc_fw_dump(ha); |
@@ -1155,8 +1162,7 @@ qla2x00_init_rings(scsi_qla_host_t *ha) | |||
1155 | 1162 | ||
1156 | DEBUG(printk("scsi(%ld): Issue init firmware.\n", ha->host_no)); | 1163 | DEBUG(printk("scsi(%ld): Issue init firmware.\n", ha->host_no)); |
1157 | 1164 | ||
1158 | mid_init_cb->count = MAX_NUM_VPORT_FABRIC; | 1165 | mid_init_cb->count = ha->max_npiv_vports; |
1159 | ha->max_npiv_vports = MAX_NUM_VPORT_FABRIC; | ||
1160 | 1166 | ||
1161 | rval = qla2x00_init_firmware(ha, ha->init_cb_size); | 1167 | rval = qla2x00_init_firmware(ha, ha->init_cb_size); |
1162 | if (rval) { | 1168 | if (rval) { |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index e4f4b1fc2b29..ec48871ad55c 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -1919,7 +1919,8 @@ qla2x00_get_id_list(scsi_qla_host_t *ha, void *id_list, dma_addr_t id_list_dma, | |||
1919 | */ | 1919 | */ |
1920 | int | 1920 | int |
1921 | qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, | 1921 | 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) | 1922 | uint16_t *orig_xchg_cnt, uint16_t *cur_iocb_cnt, |
1923 | uint16_t *orig_iocb_cnt, uint16_t *max_npiv_vports) | ||
1923 | { | 1924 | { |
1924 | int rval; | 1925 | int rval; |
1925 | mbx_cmd_t mc; | 1926 | mbx_cmd_t mc; |
@@ -1929,7 +1930,7 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, | |||
1929 | 1930 | ||
1930 | mcp->mb[0] = MBC_GET_RESOURCE_COUNTS; | 1931 | mcp->mb[0] = MBC_GET_RESOURCE_COUNTS; |
1931 | mcp->out_mb = MBX_0; | 1932 | mcp->out_mb = MBX_0; |
1932 | mcp->in_mb = MBX_10|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; | 1933 | mcp->in_mb = MBX_11|MBX_10|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; |
1933 | mcp->tov = 30; | 1934 | mcp->tov = 30; |
1934 | mcp->flags = 0; | 1935 | mcp->flags = 0; |
1935 | rval = qla2x00_mailbox_command(ha, mcp); | 1936 | rval = qla2x00_mailbox_command(ha, mcp); |
@@ -1940,9 +1941,9 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, | |||
1940 | ha->host_no, mcp->mb[0])); | 1941 | ha->host_no, mcp->mb[0])); |
1941 | } else { | 1942 | } else { |
1942 | DEBUG11(printk("%s(%ld): done. mb1=%x mb2=%x mb3=%x mb6=%x " | 1943 | DEBUG11(printk("%s(%ld): done. mb1=%x mb2=%x mb3=%x mb6=%x " |
1943 | "mb7=%x mb10=%x.\n", __func__, ha->host_no, | 1944 | "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], | 1945 | mcp->mb[1], mcp->mb[2], mcp->mb[3], mcp->mb[6], mcp->mb[7], |
1945 | mcp->mb[10])); | 1946 | mcp->mb[10], mcp->mb[11])); |
1946 | 1947 | ||
1947 | if (cur_xchg_cnt) | 1948 | if (cur_xchg_cnt) |
1948 | *cur_xchg_cnt = mcp->mb[3]; | 1949 | *cur_xchg_cnt = mcp->mb[3]; |
@@ -1952,6 +1953,8 @@ qla2x00_get_resource_cnts(scsi_qla_host_t *ha, uint16_t *cur_xchg_cnt, | |||
1952 | *cur_iocb_cnt = mcp->mb[7]; | 1953 | *cur_iocb_cnt = mcp->mb[7]; |
1953 | if (orig_iocb_cnt) | 1954 | if (orig_iocb_cnt) |
1954 | *orig_iocb_cnt = mcp->mb[10]; | 1955 | *orig_iocb_cnt = mcp->mb[10]; |
1956 | if (max_npiv_vports) | ||
1957 | *max_npiv_vports = mcp->mb[11]; | ||
1955 | } | 1958 | } |
1956 | 1959 | ||
1957 | return (rval); | 1960 | return (rval); |