Lines Matching full:shadow

121 	struct vscsifrnt_shadow *shadow[VSCSIIF_MAX_REQS];  member
163 info->shadow[id] = NULL; in _scsifront_put_rqid()
182 struct vscsifrnt_shadow *shadow) in scsifront_do_request() argument
186 struct scsi_cmnd *sc = shadow->sc; in scsifront_do_request()
197 info->shadow[id] = shadow; in scsifront_do_request()
198 shadow->rqid = id; in scsifront_do_request()
204 ring_req->act = shadow->act; in scsifront_do_request()
205 ring_req->ref_rqid = shadow->ref_rqid; in scsifront_do_request()
206 ring_req->nr_segments = shadow->nr_segments; in scsifront_do_request()
220 for (i = 0; i < (shadow->nr_segments & ~VSCSIIF_SG_GRANT); i++) in scsifront_do_request()
221 ring_req->seg[i] = shadow->seg[i]; in scsifront_do_request()
223 shadow->inflight = true; in scsifront_do_request()
240 struct vscsifrnt_shadow *shadow) in scsifront_gnttab_done() argument
244 if (shadow->sc->sc_data_direction == DMA_NONE) in scsifront_gnttab_done()
247 for (i = 0; i < shadow->nr_grants; i++) { in scsifront_gnttab_done()
248 if (unlikely(!gnttab_try_end_foreign_access(shadow->gref[i]))) { in scsifront_gnttab_done()
254 kfree(shadow->sg); in scsifront_gnttab_done()
302 struct vscsifrnt_shadow *shadow; in scsifront_cdb_cmd_done() local
308 shadow = info->shadow[id]; in scsifront_cdb_cmd_done()
309 sc = shadow->sc; in scsifront_cdb_cmd_done()
313 scsifront_gnttab_done(info, shadow); in scsifront_cdb_cmd_done()
336 struct vscsifrnt_shadow *shadow = info->shadow[id]; in scsifront_sync_cmd_done() local
340 shadow->wait_reset = 1; in scsifront_sync_cmd_done()
341 switch (shadow->rslt_reset) { in scsifront_sync_cmd_done()
344 shadow->rslt_reset = SUCCESS; in scsifront_sync_cmd_done()
346 shadow->rslt_reset = FAILED; in scsifront_sync_cmd_done()
351 kfree(shadow); in scsifront_sync_cmd_done()
361 wake_up(&shadow->wq_reset); in scsifront_sync_cmd_done()
367 struct vscsifrnt_shadow *shadow; in scsifront_do_response() local
370 !info->shadow[ring_rsp->rqid]->inflight) { in scsifront_do_response()
374 shadow = info->shadow[ring_rsp->rqid]; in scsifront_do_response()
375 shadow->inflight = false; in scsifront_do_response()
377 if (shadow->act == VSCSIIF_ACT_SCSI_CDB) in scsifront_do_response()
472 struct vscsifrnt_shadow *shadow) in map_data_for_request() argument
497 shadow->sg = kcalloc(data_grants, in map_data_for_request()
499 if (!shadow->sg) in map_data_for_request()
502 seg = shadow->sg ? : shadow->seg; in map_data_for_request()
507 kfree(shadow->sg); in map_data_for_request()
526 shadow->gref[ref_cnt] = ref; in map_data_for_request()
527 shadow->seg[ref_cnt].gref = ref; in map_data_for_request()
528 shadow->seg[ref_cnt].offset = (uint16_t)off; in map_data_for_request()
529 shadow->seg[ref_cnt].length = (uint16_t)bytes; in map_data_for_request()
562 shadow->gref[ref_cnt] = ref; in map_data_for_request()
577 shadow->nr_segments = VSCSIIF_SG_GRANT | seg_grants; in map_data_for_request()
579 shadow->nr_segments = (uint8_t)ref_cnt; in map_data_for_request()
580 shadow->nr_grants = ref_cnt; in map_data_for_request()
610 struct vscsifrnt_shadow *shadow = scsi_cmd_priv(sc); in scsifront_queuecommand() local
619 shadow->sc = sc; in scsifront_queuecommand()
620 shadow->act = VSCSIIF_ACT_SCSI_CDB; in scsifront_queuecommand()
628 err = map_data_for_request(info, sc, shadow); in scsifront_queuecommand()
640 if (scsifront_do_request(info, shadow)) { in scsifront_queuecommand()
641 scsifront_gnttab_done(info, shadow); in scsifront_queuecommand()
666 struct vscsifrnt_shadow *shadow, *s = scsi_cmd_priv(sc); in scsifront_action_handler() local
672 shadow = kzalloc(sizeof(*shadow), GFP_NOIO); in scsifront_action_handler()
673 if (!shadow) in scsifront_action_handler()
676 shadow->act = act; in scsifront_action_handler()
677 shadow->rslt_reset = RSLT_RESET_WAITING; in scsifront_action_handler()
678 shadow->sc = sc; in scsifront_action_handler()
679 shadow->ref_rqid = s->rqid; in scsifront_action_handler()
680 init_waitqueue_head(&shadow->wq_reset); in scsifront_action_handler()
688 if (!scsifront_do_request(info, shadow)) in scsifront_action_handler()
702 err = wait_event_interruptible(shadow->wq_reset, shadow->wait_reset); in scsifront_action_handler()
706 err = shadow->rslt_reset; in scsifront_action_handler()
707 scsifront_put_rqid(info, shadow->rqid); in scsifront_action_handler()
708 kfree(shadow); in scsifront_action_handler()
711 shadow->rslt_reset = RSLT_RESET_ERR; in scsifront_action_handler()
722 kfree(shadow); in scsifront_action_handler()