Lines Matching refs:crq

232 	entry->fmt = evt->crq.format;  in ibmvfc_trc_start()
269 entry->fmt = evt->crq.format; in ibmvfc_trc_end()
830 evt->crq.valid = 0x80; in ibmvfc_init_event_pool()
831 evt->crq.ioba = cpu_to_be64(pool->iu_token + (sizeof(*evt->xfer_iu) * i)); in ibmvfc_init_event_pool()
902 struct ibmvfc_queue *crq = &vhost->crq; in ibmvfc_release_crq_queue() local
916 ibmvfc_free_queue(vhost, crq); in ibmvfc_release_crq_queue()
945 spin_lock(vhost->crq.q_lock); in ibmvfc_reenable_crq_queue()
948 spin_unlock(vhost->crq.q_lock); in ibmvfc_reenable_crq_queue()
968 struct ibmvfc_queue *crq = &vhost->crq; in ibmvfc_reset_crq() local
980 spin_lock(vhost->crq.q_lock); in ibmvfc_reset_crq()
987 memset(crq->msgs.crq, 0, PAGE_SIZE); in ibmvfc_reset_crq()
988 crq->cur = 0; in ibmvfc_reset_crq()
992 crq->msg_token, PAGE_SIZE); in ibmvfc_reset_crq()
1000 spin_unlock(vhost->crq.q_lock); in ibmvfc_reset_crq()
1136 spin_lock_irqsave(&vhost->crq.l_lock, flags); in ibmvfc_purge_requests()
1137 list_for_each_entry_safe(evt, pos, &vhost->crq.sent, queue_list) in ibmvfc_purge_requests()
1139 list_splice_init(&vhost->crq.sent, &vhost->purge); in ibmvfc_purge_requests()
1140 spin_unlock_irqrestore(&vhost->crq.l_lock, flags); in ibmvfc_purge_requests()
1595 evt->crq.format = format; in ibmvfc_init_event()
1717 __be64 *crq_as_u64 = (__be64 *) &evt->crq; in ibmvfc_send_event()
1723 if (evt->crq.format == IBMVFC_CMD_FORMAT) in ibmvfc_send_event()
1725 else if (evt->crq.format == IBMVFC_MAD_FORMAT) in ibmvfc_send_event()
1943 vfc_cmd->resp.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) + offset); in ibmvfc_init_vfc_cmd()
1991 evt = ibmvfc_get_event(&vhost->crq); in ibmvfc_queuecommand()
2081 evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_bsg_timeout()
2144 evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_bsg_plogi()
2266 evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_bsg_request()
2280 mad->cmd_ioba.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) + in ibmvfc_bsg_request()
2358 evt = ibmvfc_get_event(&vhost->crq); in ibmvfc_reset_device()
2503 queues = &vhost->crq; in ibmvfc_wait_for_ops()
2690 spin_lock(&vhost->crq.l_lock); in ibmvfc_cancel_all_sq()
2691 list_for_each_entry(evt, &vhost->crq.sent, queue_list) { in ibmvfc_cancel_all_sq()
2697 spin_unlock(&vhost->crq.l_lock); in ibmvfc_cancel_all_sq()
2707 evt = ibmvfc_init_tmf(&vhost->crq, sdev, type); in ibmvfc_cancel_all_sq()
2780 if (evt->crq.format == IBMVFC_CMD_FORMAT && in ibmvfc_match_key()
2826 spin_lock(&vhost->crq.l_lock); in ibmvfc_abort_task_set()
2827 list_for_each_entry(evt, &vhost->crq.sent, queue_list) { in ibmvfc_abort_task_set()
2833 spin_unlock(&vhost->crq.l_lock); in ibmvfc_abort_task_set()
2843 evt = ibmvfc_get_event(&vhost->crq); in ibmvfc_abort_task_set()
3193 static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq, in ibmvfc_handle_async() argument
3196 const struct ibmvfc_async_desc *desc = ibmvfc_get_ae_desc(be64_to_cpu(crq->event)); in ibmvfc_handle_async()
3200 " node_name: %llx%s\n", desc->desc, be64_to_cpu(crq->scsi_id), in ibmvfc_handle_async()
3201 be64_to_cpu(crq->wwpn), be64_to_cpu(crq->node_name), in ibmvfc_handle_async()
3202 ibmvfc_get_link_state(crq->link_state)); in ibmvfc_handle_async()
3204 switch (be64_to_cpu(crq->event)) { in ibmvfc_handle_async()
3206 switch (crq->link_state) { in ibmvfc_handle_async()
3245 if (!crq->scsi_id && !crq->wwpn && !crq->node_name) in ibmvfc_handle_async()
3247 if (crq->scsi_id && cpu_to_be64(tgt->scsi_id) != crq->scsi_id) in ibmvfc_handle_async()
3249 if (crq->wwpn && cpu_to_be64(tgt->ids.port_name) != crq->wwpn) in ibmvfc_handle_async()
3251 if (crq->node_name && cpu_to_be64(tgt->ids.node_name) != crq->node_name) in ibmvfc_handle_async()
3253 if (tgt->need_login && be64_to_cpu(crq->event) == IBMVFC_AE_ELS_LOGO) in ibmvfc_handle_async()
3255 if (!tgt->need_login || be64_to_cpu(crq->event) == IBMVFC_AE_ELS_PLOGI) { in ibmvfc_handle_async()
3272 dev_err(vhost->dev, "Unknown async event received: %lld\n", crq->event); in ibmvfc_handle_async()
3284 static void ibmvfc_handle_crq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost, in ibmvfc_handle_crq() argument
3288 struct ibmvfc_event *evt = (struct ibmvfc_event *)be64_to_cpu(crq->ioba); in ibmvfc_handle_crq()
3290 switch (crq->valid) { in ibmvfc_handle_crq()
3292 switch (crq->format) { in ibmvfc_handle_crq()
3307 dev_err(vhost->dev, "Unknown crq message type: %d\n", crq->format); in ibmvfc_handle_crq()
3314 if (crq->format == IBMVFC_PARTITION_MIGRATED) { in ibmvfc_handle_crq()
3324 } else if (crq->format == IBMVFC_PARTNER_FAILED || crq->format == IBMVFC_PARTNER_DEREGISTER) { in ibmvfc_handle_crq()
3325 dev_err(vhost->dev, "Host partner adapter deregistered or failed (rc=%d)\n", crq->format); in ibmvfc_handle_crq()
3330 dev_err(vhost->dev, "Received unknown transport event from partner (rc=%d)\n", crq->format); in ibmvfc_handle_crq()
3336 dev_err(vhost->dev, "Got an invalid message type 0x%02x\n", crq->valid); in ibmvfc_handle_crq()
3340 if (crq->format == IBMVFC_ASYNC_EVENT) in ibmvfc_handle_crq()
3347 if (unlikely(!ibmvfc_valid_event(&vhost->crq.evt_pool, evt))) { in ibmvfc_handle_crq()
3349 crq->ioba); in ibmvfc_handle_crq()
3355 crq->ioba); in ibmvfc_handle_crq()
3723 struct ibmvfc_async_crq *crq; in ibmvfc_next_async_crq() local
3725 crq = &async_crq->msgs.async[async_crq->cur]; in ibmvfc_next_async_crq()
3726 if (crq->valid & 0x80) { in ibmvfc_next_async_crq()
3731 crq = NULL; in ibmvfc_next_async_crq()
3733 return crq; in ibmvfc_next_async_crq()
3745 struct ibmvfc_queue *queue = &vhost->crq; in ibmvfc_next_crq()
3746 struct ibmvfc_crq *crq; in ibmvfc_next_crq() local
3748 crq = &queue->msgs.crq[queue->cur]; in ibmvfc_next_crq()
3749 if (crq->valid & 0x80) { in ibmvfc_next_crq()
3754 crq = NULL; in ibmvfc_next_crq()
3756 return crq; in ibmvfc_next_crq()
3790 struct ibmvfc_crq *crq; in ibmvfc_tasklet() local
3798 spin_lock(vhost->crq.q_lock); in ibmvfc_tasklet()
3808 while ((crq = ibmvfc_next_crq(vhost)) != NULL) { in ibmvfc_tasklet()
3809 ibmvfc_handle_crq(crq, vhost, &evt_doneq); in ibmvfc_tasklet()
3810 crq->valid = 0; in ibmvfc_tasklet()
3820 } else if ((crq = ibmvfc_next_crq(vhost)) != NULL) { in ibmvfc_tasklet()
3822 ibmvfc_handle_crq(crq, vhost, &evt_doneq); in ibmvfc_tasklet()
3823 crq->valid = 0; in ibmvfc_tasklet()
3829 spin_unlock(vhost->crq.q_lock); in ibmvfc_tasklet()
3860 static void ibmvfc_handle_scrq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost, in ibmvfc_handle_scrq() argument
3863 struct ibmvfc_event *evt = (struct ibmvfc_event *)be64_to_cpu(crq->ioba); in ibmvfc_handle_scrq()
3865 switch (crq->valid) { in ibmvfc_handle_scrq()
3871 dev_err(vhost->dev, "Got and invalid message type 0x%02x\n", crq->valid); in ibmvfc_handle_scrq()
3881 crq->ioba); in ibmvfc_handle_scrq()
3887 crq->ioba); in ibmvfc_handle_scrq()
3898 struct ibmvfc_crq *crq; in ibmvfc_next_scrq() local
3900 crq = &scrq->msgs.scrq[scrq->cur].crq; in ibmvfc_next_scrq()
3901 if (crq->valid & 0x80) { in ibmvfc_next_scrq()
3906 crq = NULL; in ibmvfc_next_scrq()
3908 return crq; in ibmvfc_next_scrq()
3913 struct ibmvfc_crq *crq; in ibmvfc_drain_sub_crq() local
3921 while ((crq = ibmvfc_next_scrq(scrq)) != NULL) { in ibmvfc_drain_sub_crq()
3922 ibmvfc_handle_scrq(crq, scrq->vhost, &evt_doneq); in ibmvfc_drain_sub_crq()
3923 crq->valid = 0; in ibmvfc_drain_sub_crq()
3928 if ((crq = ibmvfc_next_scrq(scrq)) != NULL) { in ibmvfc_drain_sub_crq()
3930 ibmvfc_handle_scrq(crq, scrq->vhost, &evt_doneq); in ibmvfc_drain_sub_crq()
3931 crq->valid = 0; in ibmvfc_drain_sub_crq()
4108 evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_tgt_send_prli()
4221 evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_tgt_send_plogi()
4303 evt = ibmvfc_get_reserved_event(&vhost->crq); in __ibmvfc_tgt_get_implicit_logout_evt()
4478 evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_tgt_move_login()
4584 mad->cmd_ioba.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) + in ibmvfc_init_passthru()
4589 mad->iu.cmd.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) + in ibmvfc_init_passthru()
4593 mad->iu.rsp.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) + in ibmvfc_init_passthru()
4650 evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_adisc_timeout()
4708 evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_tgt_adisc()
4817 evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_tgt_query_target()
4995 struct ibmvfc_event *evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_discover_targets()
5076 struct ibmvfc_event *evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_channel_setup()
5149 struct ibmvfc_event *evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_channel_enquiry()
5277 struct ibmvfc_event *evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_npiv_login()
5320 if (list_empty(&vhost->crq.sent) && in ibmvfc_npiv_logout_done()
5348 evt = ibmvfc_get_reserved_event(&vhost->crq); in ibmvfc_npiv_logout()
5807 fmt_size = sizeof(*queue->msgs.crq); in ibmvfc_alloc_queue()
5868 struct ibmvfc_queue *crq = &vhost->crq; in ibmvfc_init_crq() local
5871 if (ibmvfc_alloc_queue(vhost, crq, IBMVFC_CRQ_FMT)) in ibmvfc_init_crq()
5875 crq->msg_token, PAGE_SIZE); in ibmvfc_init_crq()
5911 ibmvfc_free_queue(vhost, crq); in ibmvfc_init_crq()
6008 memset(scrq->msgs.crq, 0, PAGE_SIZE); in ibmvfc_deregister_channel()