Lines Matching refs:im_port
36 static void bfad_im_fc_rport_add(struct bfad_im_port_s *im_port,
182 struct bfad_im_port_s *im_port = in bfad_im_info() local
184 struct bfad_s *bfad = im_port->bfad; in bfad_im_info()
203 struct bfad_im_port_s *im_port = in bfad_im_abort_handler() local
205 struct bfad_s *bfad = im_port->bfad; in bfad_im_abort_handler()
226 im_port->shost->host_no, cmnd, hal_io->iotag); in bfad_im_abort_handler()
243 im_port->shost->host_no, cmnd, hal_io->iotag); in bfad_im_abort_handler()
291 struct bfad_im_port_s *im_port = in bfad_im_reset_lun_handler() local
294 struct bfad_s *bfad = im_port->bfad; in bfad_im_reset_lun_handler()
355 struct bfad_im_port_s *im_port = in bfad_im_reset_bus_handler() local
357 struct bfad_s *bfad = im_port->bfad; in bfad_im_reset_bus_handler()
366 itnim = bfad_get_itnim(im_port, i); in bfad_im_reset_bus_handler()
458 itnim_drv->im_port = port->im_port; in bfa_fcb_itnim_free()
465 port->im_port->shost->host_no, in bfa_fcb_itnim_free()
487 itnim_drv->im_port = port->im_port; in bfa_fcb_itnim_online()
512 itnim_drv->im_port = port->im_port; in bfa_fcb_itnim_offline()
525 bfad_im_scsi_host_alloc(struct bfad_s *bfad, struct bfad_im_port_s *im_port, in bfad_im_scsi_host_alloc() argument
531 error = idr_alloc(&bfad_im_port_index, im_port, 0, 0, GFP_KERNEL); in bfad_im_scsi_host_alloc()
537 im_port->idr_id = error; in bfad_im_scsi_host_alloc()
540 im_port->shost = bfad_scsi_host_alloc(im_port, bfad); in bfad_im_scsi_host_alloc()
541 if (!im_port->shost) { in bfad_im_scsi_host_alloc()
546 im_port->shost->hostdata[0] = (unsigned long)im_port; in bfad_im_scsi_host_alloc()
547 im_port->shost->unique_id = im_port->idr_id; in bfad_im_scsi_host_alloc()
548 im_port->shost->this_id = -1; in bfad_im_scsi_host_alloc()
549 im_port->shost->max_id = MAX_FCP_TARGET; in bfad_im_scsi_host_alloc()
550 im_port->shost->max_lun = MAX_FCP_LUN; in bfad_im_scsi_host_alloc()
551 im_port->shost->max_cmd_len = 16; in bfad_im_scsi_host_alloc()
552 im_port->shost->can_queue = bfad->cfg_data.ioc_queue_depth; in bfad_im_scsi_host_alloc()
553 if (im_port->port->pvb_type == BFAD_PORT_PHYS_BASE) in bfad_im_scsi_host_alloc()
554 im_port->shost->transportt = bfad_im_scsi_transport_template; in bfad_im_scsi_host_alloc()
556 im_port->shost->transportt = in bfad_im_scsi_host_alloc()
559 error = scsi_add_host_with_dma(im_port->shost, dev, &bfad->pcidev->dev); in bfad_im_scsi_host_alloc()
568 scsi_host_put(im_port->shost); in bfad_im_scsi_host_alloc()
569 im_port->shost = NULL; in bfad_im_scsi_host_alloc()
572 idr_remove(&bfad_im_port_index, im_port->idr_id); in bfad_im_scsi_host_alloc()
579 bfad_im_scsi_host_free(struct bfad_s *bfad, struct bfad_im_port_s *im_port) in bfad_im_scsi_host_free() argument
583 im_port->shost->host_no); in bfad_im_scsi_host_free()
585 fc_remove_host(im_port->shost); in bfad_im_scsi_host_free()
587 scsi_remove_host(im_port->shost); in bfad_im_scsi_host_free()
588 scsi_host_put(im_port->shost); in bfad_im_scsi_host_free()
591 idr_remove(&bfad_im_port_index, im_port->idr_id); in bfad_im_scsi_host_free()
598 struct bfad_im_port_s *im_port = in bfad_im_port_delete_handler() local
601 if (im_port->port->pvb_type != BFAD_PORT_PHYS_BASE) { in bfad_im_port_delete_handler()
602 im_port->flags |= BFAD_PORT_DELETE; in bfad_im_port_delete_handler()
603 fc_vport_terminate(im_port->fc_vport); in bfad_im_port_delete_handler()
611 struct bfad_im_port_s *im_port; in bfad_im_port_new() local
613 im_port = kzalloc(sizeof(struct bfad_im_port_s), GFP_ATOMIC); in bfad_im_port_new()
614 if (im_port == NULL) { in bfad_im_port_new()
618 port->im_port = im_port; in bfad_im_port_new()
619 im_port->port = port; in bfad_im_port_new()
620 im_port->bfad = bfad; in bfad_im_port_new()
622 INIT_WORK(&im_port->port_delete_work, bfad_im_port_delete_handler); in bfad_im_port_new()
623 INIT_LIST_HEAD(&im_port->itnim_mapped_list); in bfad_im_port_new()
624 INIT_LIST_HEAD(&im_port->binding_list); in bfad_im_port_new()
633 struct bfad_im_port_s *im_port = port->im_port; in bfad_im_port_delete() local
636 &im_port->port_delete_work); in bfad_im_port_delete()
640 bfad_im_port_clean(struct bfad_im_port_s *im_port) in bfad_im_port_clean() argument
644 struct bfad_s *bfad = im_port->bfad; in bfad_im_port_clean()
647 list_for_each_entry_safe(bp, bp_new, &im_port->binding_list, in bfad_im_port_clean()
654 WARN_ON(!list_empty(&im_port->itnim_mapped_list)); in bfad_im_port_clean()
665 struct Scsi_Host *shost = bfad->pport.im_port->shost; in bfad_aen_im_notify_handler()
716 bfad_scsi_host_alloc(struct bfad_im_port_s *im_port, struct bfad_s *bfad) in bfad_scsi_host_alloc() argument
720 if (im_port->port->pvb_type == BFAD_PORT_PHYS_BASE) in bfad_scsi_host_alloc()
734 bfad_scsi_host_free(struct bfad_s *bfad, struct bfad_im_port_s *im_port) in bfad_scsi_host_free() argument
736 if (!(im_port->flags & BFAD_PORT_DELETE)) in bfad_scsi_host_free()
738 bfad_im_scsi_host_free(im_port->bfad, im_port); in bfad_scsi_host_free()
739 bfad_im_port_clean(im_port); in bfad_scsi_host_free()
740 kfree(im_port); in bfad_scsi_host_free()
901 bfad_get_itnim(struct bfad_im_port_s *im_port, int id) in bfad_get_itnim() argument
906 list_for_each_entry(itnim, &im_port->itnim_mapped_list, list_entry) { in bfad_get_itnim()
1021 bfad_fc_host_init(struct bfad_im_port_s *im_port) in bfad_fc_host_init() argument
1023 struct Scsi_Host *host = im_port->shost; in bfad_fc_host_init()
1024 struct bfad_s *bfad = im_port->bfad; in bfad_fc_host_init()
1025 struct bfad_port_s *port = im_port->port; in bfad_fc_host_init()
1054 bfad_im_fc_rport_add(struct bfad_im_port_s *im_port, struct bfad_itnim_s *itnim) in bfad_im_fc_rport_add() argument
1069 fc_remote_port_add(im_port->shost, 0, &rport_ids); in bfad_im_fc_rport_add()
1106 struct bfad_im_port_s *im_port; in bfad_im_itnim_work_handler() local
1114 im_port = itnim->im_port; in bfad_im_itnim_work_handler()
1120 bfad_im_fc_rport_add(im_port, itnim); in bfad_im_itnim_work_handler()
1127 &im_port->itnim_mapped_list); in bfad_im_itnim_work_handler()
1131 im_port->shost->host_no, in bfad_im_itnim_work_handler()
1149 if (!(im_port->port->flags & BFAD_PORT_DELETE)) { in bfad_im_itnim_work_handler()
1164 im_port->shost->host_no, in bfad_im_itnim_work_handler()
1175 if (!(im_port->port->flags & BFAD_PORT_DELETE)) { in bfad_im_itnim_work_handler()
1201 struct bfad_im_port_s *im_port = in bfad_im_queuecommand_lck() local
1203 struct bfad_s *bfad = im_port->bfad; in bfad_im_queuecommand_lck()