Lines Matching refs:ha
32 struct qla_hw_data *ha = vha->hw; in qla24xx_allocate_vp_id() local
35 mutex_lock(&ha->vport_lock); in qla24xx_allocate_vp_id()
36 vp_id = find_first_zero_bit(ha->vp_idx_map, ha->max_npiv_vports + 1); in qla24xx_allocate_vp_id()
37 if (vp_id > ha->max_npiv_vports) { in qla24xx_allocate_vp_id()
39 vp_id, ha->max_npiv_vports)); in qla24xx_allocate_vp_id()
40 mutex_unlock(&ha->vport_lock); in qla24xx_allocate_vp_id()
44 set_bit(vp_id, ha->vp_idx_map); in qla24xx_allocate_vp_id()
45 ha->num_vhosts++; in qla24xx_allocate_vp_id()
46 ha->cur_vport_count++; in qla24xx_allocate_vp_id()
48 list_add_tail(&vha->list, &ha->vp_list); in qla24xx_allocate_vp_id()
49 mutex_unlock(&ha->vport_lock); in qla24xx_allocate_vp_id()
57 struct qla_hw_data *ha = vha->hw; in qla24xx_deallocate_vp_id() local
59 mutex_lock(&ha->vport_lock); in qla24xx_deallocate_vp_id()
61 ha->num_vhosts--; in qla24xx_deallocate_vp_id()
62 ha->cur_vport_count--; in qla24xx_deallocate_vp_id()
63 clear_bit(vp_id, ha->vp_idx_map); in qla24xx_deallocate_vp_id()
65 mutex_unlock(&ha->vport_lock); in qla24xx_deallocate_vp_id()
69 qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name) in qla24xx_find_vhost_by_name() argument
75 list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) { in qla24xx_find_vhost_by_name()
136 struct qla_hw_data *ha = vha->hw; in qla24xx_enable_vp() local
137 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); in qla24xx_enable_vp()
148 mutex_lock(&ha->vport_lock); in qla24xx_enable_vp()
150 mutex_unlock(&ha->vport_lock); in qla24xx_enable_vp()
157 DEBUG15(qla_printk(KERN_INFO, ha, in qla24xx_enable_vp()
162 DEBUG15(qla_printk(KERN_INFO, ha, in qla24xx_enable_vp()
199 struct qla_hw_data *ha = rsp->hw; in qla2x00_alert_all_vps() local
202 list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) { in qla2x00_alert_all_vps()
251 struct qla_hw_data *ha = vha->hw; in qla2x00_do_dpc_vp() local
252 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); in qla2x00_do_dpc_vp()
302 struct qla_hw_data *ha = vha->hw; in qla2x00_do_dpc_all_vps() local
308 if (list_empty(&ha->vp_list)) in qla2x00_do_dpc_all_vps()
313 list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { in qla2x00_do_dpc_all_vps()
323 struct qla_hw_data *ha = base_vha->hw; in qla24xx_vport_create_req_sanity_check() local
331 if (!ha->flags.npiv_supported) in qla24xx_vport_create_req_sanity_check()
335 if (!(ha->switch_cap & FLOGI_MID_SUPPORT)) in qla24xx_vport_create_req_sanity_check()
342 vha = qla24xx_find_vhost_by_name(ha, port_name); in qla24xx_vport_create_req_sanity_check()
347 if (ha->num_vhosts > ha->max_npiv_vports) { in qla24xx_vport_create_req_sanity_check()
350 ha->num_vhosts, ha->max_npiv_vports)); in qla24xx_vport_create_req_sanity_check()
360 struct qla_hw_data *ha = base_vha->hw; in qla24xx_create_vhost() local
365 vha = qla2x00_create_host(sht, ha); in qla24xx_create_vhost()
380 if (vha->vp_idx > ha->max_npiv_vports) { in qla24xx_create_vhost()
402 vha->req_ques[0] = ha->req_q_map[0]->id; in qla24xx_create_vhost()
403 host->can_queue = ha->req_q_map[0]->length + 128; in qla24xx_create_vhost()
427 struct qla_hw_data *ha = vha->hw; in qla25xx_free_req_que() local
430 dma_free_coherent(&ha->pdev->dev, (req->length + 1) * in qla25xx_free_req_que()
435 ha->req_q_map[que_id] = NULL; in qla25xx_free_req_que()
436 mutex_lock(&ha->vport_lock); in qla25xx_free_req_que()
437 clear_bit(que_id, ha->req_qid_map); in qla25xx_free_req_que()
438 mutex_unlock(&ha->vport_lock); in qla25xx_free_req_que()
447 struct qla_hw_data *ha = vha->hw; in qla25xx_free_rsp_que() local
455 dma_free_coherent(&ha->pdev->dev, (rsp->length + 1) * in qla25xx_free_rsp_que()
460 ha->rsp_q_map[que_id] = NULL; in qla25xx_free_rsp_que()
461 mutex_lock(&ha->vport_lock); in qla25xx_free_rsp_que()
462 clear_bit(que_id, ha->rsp_qid_map); in qla25xx_free_rsp_que()
463 mutex_unlock(&ha->vport_lock); in qla25xx_free_rsp_que()
502 struct qla_hw_data *ha = vha->hw; in qla25xx_update_req_que() local
503 struct req_que *req = ha->req_q_map[que]; in qla25xx_update_req_que()
523 struct qla_hw_data *ha = vha->hw; in qla25xx_delete_queues() local
527 req = ha->req_q_map[que_no]; in qla25xx_delete_queues()
532 qla_printk(KERN_WARNING, ha, in qla25xx_delete_queues()
540 qla_printk(KERN_WARNING, ha, in qla25xx_delete_queues()
550 req = ha->req_q_map[vha->req_ques[cnt]]; in qla25xx_delete_queues()
555 qla_printk(KERN_WARNING, ha, in qla25xx_delete_queues()
560 vha->req_ques[cnt] = ha->req_q_map[0]->id; in qla25xx_delete_queues()
565 qla_printk(KERN_WARNING, ha, in qla25xx_delete_queues()
574 qla_printk(KERN_INFO, ha, "Queues deleted for vport:%d\n", in qla25xx_delete_queues()
580 qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options, in qla25xx_create_req_que() argument
585 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); in qla25xx_create_req_que()
590 qla_printk(KERN_WARNING, ha, "could not allocate memory" in qla25xx_create_req_que()
596 req->ring = dma_alloc_coherent(&ha->pdev->dev, in qla25xx_create_req_que()
600 qla_printk(KERN_WARNING, ha, in qla25xx_create_req_que()
605 mutex_lock(&ha->vport_lock); in qla25xx_create_req_que()
606 que_id = find_first_zero_bit(ha->req_qid_map, ha->max_queues); in qla25xx_create_req_que()
607 if (que_id >= ha->max_queues) { in qla25xx_create_req_que()
608 mutex_unlock(&ha->vport_lock); in qla25xx_create_req_que()
609 qla_printk(KERN_INFO, ha, "No resources to create " in qla25xx_create_req_que()
613 set_bit(que_id, ha->req_qid_map); in qla25xx_create_req_que()
614 ha->req_q_map[que_id] = req; in qla25xx_create_req_que()
619 if (ha->rsp_q_map[rsp_que]) { in qla25xx_create_req_que()
620 req->rsp = ha->rsp_q_map[rsp_que]; in qla25xx_create_req_que()
634 req->max_q_depth = ha->req_q_map[0]->max_q_depth; in qla25xx_create_req_que()
635 mutex_unlock(&ha->vport_lock); in qla25xx_create_req_que()
639 qla_printk(KERN_WARNING, ha, "%s failed\n", __func__); in qla25xx_create_req_que()
640 mutex_lock(&ha->vport_lock); in qla25xx_create_req_que()
641 clear_bit(que_id, ha->req_qid_map); in qla25xx_create_req_que()
642 mutex_unlock(&ha->vport_lock); in qla25xx_create_req_que()
655 qla25xx_create_rsp_que(struct qla_hw_data *ha, uint16_t options, in qla25xx_create_rsp_que() argument
660 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); in qla25xx_create_rsp_que()
665 qla_printk(KERN_WARNING, ha, "could not allocate memory for" in qla25xx_create_rsp_que()
671 rsp->ring = dma_alloc_coherent(&ha->pdev->dev, in qla25xx_create_rsp_que()
675 qla_printk(KERN_WARNING, ha, in qla25xx_create_rsp_que()
680 mutex_lock(&ha->vport_lock); in qla25xx_create_rsp_que()
681 que_id = find_first_zero_bit(ha->rsp_qid_map, ha->max_queues); in qla25xx_create_rsp_que()
682 if (que_id >= ha->max_queues) { in qla25xx_create_rsp_que()
683 mutex_unlock(&ha->vport_lock); in qla25xx_create_rsp_que()
684 qla_printk(KERN_INFO, ha, "No resources to create " in qla25xx_create_rsp_que()
688 set_bit(que_id, ha->rsp_qid_map); in qla25xx_create_rsp_que()
690 if (ha->flags.msix_enabled) in qla25xx_create_rsp_que()
691 rsp->msix = &ha->msix_entries[que_id + 1]; in qla25xx_create_rsp_que()
693 qla_printk(KERN_WARNING, ha, "msix not enabled\n"); in qla25xx_create_rsp_que()
695 ha->rsp_q_map[que_id] = rsp; in qla25xx_create_rsp_que()
698 rsp->hw = ha; in qla25xx_create_rsp_que()
709 mutex_unlock(&ha->vport_lock); in qla25xx_create_rsp_que()
717 qla_printk(KERN_WARNING, ha, "%s failed\n", __func__); in qla25xx_create_rsp_que()
718 mutex_lock(&ha->vport_lock); in qla25xx_create_rsp_que()
719 clear_bit(que_id, ha->rsp_qid_map); in qla25xx_create_rsp_que()
720 mutex_unlock(&ha->vport_lock); in qla25xx_create_rsp_que()
738 struct qla_hw_data *ha = vha->hw; in qla25xx_create_queues() local
741 ret = qla25xx_create_rsp_que(ha, options, vha->vp_idx, 0); in qla25xx_create_queues()
743 qla_printk(KERN_WARNING, ha, "Response Que create failed\n"); in qla25xx_create_queues()
746 qla_printk(KERN_INFO, ha, "Response Que:%d created.\n", ret); in qla25xx_create_queues()
751 ret = qla25xx_create_req_que(ha, options, vha->vp_idx, 0, ret, in qla25xx_create_queues()
755 qla_printk(KERN_INFO, ha, "Request Que:%d created.\n", ret); in qla25xx_create_queues()
757 qla_printk(KERN_WARNING, ha, "Request Que create failed\n"); in qla25xx_create_queues()