diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mid.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 61 |
1 files changed, 8 insertions, 53 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 8220e7b9799b..987c5b0ca78e 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * QLogic Fibre Channel HBA Driver | 2 | * QLogic Fibre Channel HBA Driver |
3 | * Copyright (c) 2003-2008 QLogic Corporation | 3 | * Copyright (c) 2003-2010 QLogic Corporation |
4 | * | 4 | * |
5 | * See LICENSE.qla2xxx for copyright and licensing details. | 5 | * See LICENSE.qla2xxx for copyright and licensing details. |
6 | */ | 6 | */ |
@@ -136,7 +136,8 @@ qla24xx_enable_vp(scsi_qla_host_t *vha) | |||
136 | 136 | ||
137 | /* Check if physical ha port is Up */ | 137 | /* Check if physical ha port is Up */ |
138 | if (atomic_read(&base_vha->loop_state) == LOOP_DOWN || | 138 | if (atomic_read(&base_vha->loop_state) == LOOP_DOWN || |
139 | atomic_read(&base_vha->loop_state) == LOOP_DEAD) { | 139 | atomic_read(&base_vha->loop_state) == LOOP_DEAD || |
140 | !(ha->current_topology & ISP_CFG_F)) { | ||
140 | vha->vp_err_state = VP_ERR_PORTDWN; | 141 | vha->vp_err_state = VP_ERR_PORTDWN; |
141 | fc_vport_set_state(vha->fc_vport, FC_VPORT_LINKDOWN); | 142 | fc_vport_set_state(vha->fc_vport, FC_VPORT_LINKDOWN); |
142 | goto enable_failed; | 143 | goto enable_failed; |
@@ -398,7 +399,10 @@ qla24xx_create_vhost(struct fc_vport *fc_vport) | |||
398 | host->can_queue = base_vha->req->length + 128; | 399 | host->can_queue = base_vha->req->length + 128; |
399 | host->this_id = 255; | 400 | host->this_id = 255; |
400 | host->cmd_per_lun = 3; | 401 | host->cmd_per_lun = 3; |
401 | host->max_cmd_len = MAX_CMDSZ; | 402 | if ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && ql2xenabledif) |
403 | host->max_cmd_len = 32; | ||
404 | else | ||
405 | host->max_cmd_len = MAX_CMDSZ; | ||
402 | host->max_channel = MAX_BUSES - 1; | 406 | host->max_channel = MAX_BUSES - 1; |
403 | host->max_lun = MAX_LUNS; | 407 | host->max_lun = MAX_LUNS; |
404 | host->unique_id = host->host_no; | 408 | host->unique_id = host->host_no; |
@@ -481,7 +485,7 @@ qla25xx_delete_req_que(struct scsi_qla_host *vha, struct req_que *req) | |||
481 | return ret; | 485 | return ret; |
482 | } | 486 | } |
483 | 487 | ||
484 | int | 488 | static int |
485 | qla25xx_delete_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp) | 489 | qla25xx_delete_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp) |
486 | { | 490 | { |
487 | int ret = -1; | 491 | int ret = -1; |
@@ -496,23 +500,6 @@ qla25xx_delete_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp) | |||
496 | return ret; | 500 | return ret; |
497 | } | 501 | } |
498 | 502 | ||
499 | int qla25xx_update_req_que(struct scsi_qla_host *vha, uint8_t que, uint8_t qos) | ||
500 | { | ||
501 | int ret = 0; | ||
502 | struct qla_hw_data *ha = vha->hw; | ||
503 | struct req_que *req = ha->req_q_map[que]; | ||
504 | |||
505 | req->options |= BIT_3; | ||
506 | req->qos = qos; | ||
507 | ret = qla25xx_init_req_que(vha, req); | ||
508 | if (ret != QLA_SUCCESS) | ||
509 | DEBUG2_17(printk(KERN_WARNING "%s failed\n", __func__)); | ||
510 | /* restore options bit */ | ||
511 | req->options &= ~BIT_3; | ||
512 | return ret; | ||
513 | } | ||
514 | |||
515 | |||
516 | /* Delete all queues for a given vhost */ | 503 | /* Delete all queues for a given vhost */ |
517 | int | 504 | int |
518 | qla25xx_delete_queues(struct scsi_qla_host *vha) | 505 | qla25xx_delete_queues(struct scsi_qla_host *vha) |
@@ -739,35 +726,3 @@ que_failed: | |||
739 | failed: | 726 | failed: |
740 | return 0; | 727 | return 0; |
741 | } | 728 | } |
742 | |||
743 | int | ||
744 | qla25xx_create_queues(struct scsi_qla_host *vha, uint8_t qos) | ||
745 | { | ||
746 | uint16_t options = 0; | ||
747 | uint8_t ret = 0; | ||
748 | struct qla_hw_data *ha = vha->hw; | ||
749 | struct rsp_que *rsp; | ||
750 | |||
751 | options |= BIT_1; | ||
752 | ret = qla25xx_create_rsp_que(ha, options, vha->vp_idx, 0, -1); | ||
753 | if (!ret) { | ||
754 | qla_printk(KERN_WARNING, ha, "Response Que create failed\n"); | ||
755 | return ret; | ||
756 | } else | ||
757 | qla_printk(KERN_INFO, ha, "Response Que:%d created.\n", ret); | ||
758 | rsp = ha->rsp_q_map[ret]; | ||
759 | |||
760 | options = 0; | ||
761 | if (qos & BIT_7) | ||
762 | options |= BIT_8; | ||
763 | ret = qla25xx_create_req_que(ha, options, vha->vp_idx, 0, ret, | ||
764 | qos & ~BIT_7); | ||
765 | if (ret) { | ||
766 | vha->req = ha->req_q_map[ret]; | ||
767 | qla_printk(KERN_INFO, ha, "Request Que:%d created.\n", ret); | ||
768 | } else | ||
769 | qla_printk(KERN_WARNING, ha, "Request Que create failed\n"); | ||
770 | rsp->req = ha->req_q_map[ret]; | ||
771 | |||
772 | return ret; | ||
773 | } | ||