Lines Matching refs:drv_buf_iter
572 struct mpi3mr_buf_map *drv_buf_iter = drv_bufs; in mpi3mr_bsg_build_sgl() local
581 sgl_flags_last, drv_buf_iter->kern_buf_len, in mpi3mr_bsg_build_sgl()
582 drv_buf_iter->kern_buf_dma); in mpi3mr_bsg_build_sgl()
583 sgl = (u8 *)drv_buf_iter->kern_buf + drv_buf_iter->bsg_buf_len; in mpi3mr_bsg_build_sgl()
584 drv_buf_iter++; in mpi3mr_bsg_build_sgl()
588 sgl_flags_last, drv_buf_iter->kern_buf_len, in mpi3mr_bsg_build_sgl()
589 drv_buf_iter->kern_buf_dma); in mpi3mr_bsg_build_sgl()
590 drv_buf_iter++; in mpi3mr_bsg_build_sgl()
600 for (; count < bufcnt; count++, drv_buf_iter++) { in mpi3mr_bsg_build_sgl()
601 if (drv_buf_iter->data_dir == DMA_NONE) in mpi3mr_bsg_build_sgl()
605 drv_buf_iter->kern_buf_len, drv_buf_iter->kern_buf_dma); in mpi3mr_bsg_build_sgl()
608 drv_buf_iter->kern_buf_len, drv_buf_iter->kern_buf_dma); in mpi3mr_bsg_build_sgl()
654 struct mpi3mr_buf_map *drv_buf_iter = drv_bufs; in mpi3mr_build_nvme_sgl() local
664 for (count = 0; count < bufcnt; count++, drv_buf_iter++) { in mpi3mr_build_nvme_sgl()
665 if (drv_buf_iter->data_dir == DMA_NONE) in mpi3mr_build_nvme_sgl()
667 sgl_ptr = (u64)drv_buf_iter->kern_buf_dma; in mpi3mr_build_nvme_sgl()
668 length = drv_buf_iter->kern_buf_len; in mpi3mr_build_nvme_sgl()
717 struct mpi3mr_buf_map *drv_buf_iter = drv_bufs; in mpi3mr_build_nvme_prp() local
747 for (count = 0; count < bufcnt; count++, drv_buf_iter++) { in mpi3mr_build_nvme_prp()
748 if (drv_buf_iter->data_dir == DMA_NONE) in mpi3mr_build_nvme_prp()
750 dma_addr = drv_buf_iter->kern_buf_dma; in mpi3mr_build_nvme_prp()
751 length = drv_buf_iter->kern_buf_len; in mpi3mr_build_nvme_prp()
951 struct mpi3mr_buf_map *drv_bufs = NULL, *drv_buf_iter = NULL; in mpi3mr_bsg_process_mpt_cmds() local
1010 drv_buf_iter = drv_bufs; in mpi3mr_bsg_process_mpt_cmds()
1012 for (count = 0; count < bufcnt; count++, buf_entries++, drv_buf_iter++) { in mpi3mr_bsg_process_mpt_cmds()
1031 drv_buf_iter->data_dir = DMA_TO_DEVICE; in mpi3mr_bsg_process_mpt_cmds()
1039 drv_buf_iter->data_dir = DMA_FROM_DEVICE; in mpi3mr_bsg_process_mpt_cmds()
1047 drv_buf_iter->data_dir = DMA_FROM_DEVICE; in mpi3mr_bsg_process_mpt_cmds()
1049 din_size += drv_buf_iter->bsg_buf_len; in mpi3mr_bsg_process_mpt_cmds()
1056 drv_buf_iter->data_dir = DMA_TO_DEVICE; in mpi3mr_bsg_process_mpt_cmds()
1058 dout_size += drv_buf_iter->bsg_buf_len; in mpi3mr_bsg_process_mpt_cmds()
1065 drv_buf_iter->data_dir = DMA_NONE; in mpi3mr_bsg_process_mpt_cmds()
1071 drv_buf_iter->data_dir = DMA_NONE; in mpi3mr_bsg_process_mpt_cmds()
1077 drv_buf_iter->data_dir = DMA_NONE; in mpi3mr_bsg_process_mpt_cmds()
1099 drv_buf_iter->bsg_buf = sgl_iter; in mpi3mr_bsg_process_mpt_cmds()
1100 drv_buf_iter->bsg_buf_len = buf_entries->buf_len; in mpi3mr_bsg_process_mpt_cmds()
1129 drv_buf_iter = drv_bufs; in mpi3mr_bsg_process_mpt_cmds()
1130 for (count = 0; count < bufcnt; count++, drv_buf_iter++) { in mpi3mr_bsg_process_mpt_cmds()
1131 if (drv_buf_iter->data_dir == DMA_NONE) in mpi3mr_bsg_process_mpt_cmds()
1134 drv_buf_iter->kern_buf_len = drv_buf_iter->bsg_buf_len; in mpi3mr_bsg_process_mpt_cmds()
1136 drv_buf_iter->kern_buf_len += ((dout_cnt + din_cnt) * in mpi3mr_bsg_process_mpt_cmds()
1139 if (!drv_buf_iter->kern_buf_len) in mpi3mr_bsg_process_mpt_cmds()
1142 drv_buf_iter->kern_buf = dma_alloc_coherent(&mrioc->pdev->dev, in mpi3mr_bsg_process_mpt_cmds()
1143 drv_buf_iter->kern_buf_len, &drv_buf_iter->kern_buf_dma, in mpi3mr_bsg_process_mpt_cmds()
1145 if (!drv_buf_iter->kern_buf) { in mpi3mr_bsg_process_mpt_cmds()
1149 if (drv_buf_iter->data_dir == DMA_TO_DEVICE) { in mpi3mr_bsg_process_mpt_cmds()
1150 tmplen = min(drv_buf_iter->kern_buf_len, in mpi3mr_bsg_process_mpt_cmds()
1151 drv_buf_iter->bsg_buf_len); in mpi3mr_bsg_process_mpt_cmds()
1152 memcpy(drv_buf_iter->kern_buf, drv_buf_iter->bsg_buf, tmplen); in mpi3mr_bsg_process_mpt_cmds()
1258 drv_buf_iter = &drv_bufs[0]; in mpi3mr_bsg_process_mpt_cmds()
1259 dprint_dump(drv_buf_iter->kern_buf, in mpi3mr_bsg_process_mpt_cmds()
1260 drv_buf_iter->kern_buf_len, "mpi3_mgmt_req"); in mpi3mr_bsg_process_mpt_cmds()
1293 drv_buf_iter = &drv_bufs[0]; in mpi3mr_bsg_process_mpt_cmds()
1294 dprint_dump(drv_buf_iter->kern_buf, in mpi3mr_bsg_process_mpt_cmds()
1295 drv_buf_iter->kern_buf_len, "mpi3_mgmt_req"); in mpi3mr_bsg_process_mpt_cmds()
1331 drv_buf_iter = &drv_bufs[mpirep_offset]; in mpi3mr_bsg_process_mpt_cmds()
1332 drv_buf_iter->kern_buf_len = (sizeof(*bsg_reply_buf) - 1 + in mpi3mr_bsg_process_mpt_cmds()
1334 bsg_reply_buf = kzalloc(drv_buf_iter->kern_buf_len, GFP_KERNEL); in mpi3mr_bsg_process_mpt_cmds()
1353 tmplen = min(drv_buf_iter->kern_buf_len, in mpi3mr_bsg_process_mpt_cmds()
1354 drv_buf_iter->bsg_buf_len); in mpi3mr_bsg_process_mpt_cmds()
1355 memcpy(drv_buf_iter->bsg_buf, bsg_reply_buf, tmplen); in mpi3mr_bsg_process_mpt_cmds()
1360 drv_buf_iter = &drv_bufs[erb_offset]; in mpi3mr_bsg_process_mpt_cmds()
1361 tmplen = min(erbsz, drv_buf_iter->bsg_buf_len); in mpi3mr_bsg_process_mpt_cmds()
1362 memcpy(drv_buf_iter->bsg_buf, sense_buff_k, tmplen); in mpi3mr_bsg_process_mpt_cmds()
1365 drv_buf_iter = drv_bufs; in mpi3mr_bsg_process_mpt_cmds()
1366 for (count = 0; count < bufcnt; count++, drv_buf_iter++) { in mpi3mr_bsg_process_mpt_cmds()
1367 if (drv_buf_iter->data_dir == DMA_NONE) in mpi3mr_bsg_process_mpt_cmds()
1369 if (drv_buf_iter->data_dir == DMA_FROM_DEVICE) { in mpi3mr_bsg_process_mpt_cmds()
1370 tmplen = min(drv_buf_iter->kern_buf_len, in mpi3mr_bsg_process_mpt_cmds()
1371 drv_buf_iter->bsg_buf_len); in mpi3mr_bsg_process_mpt_cmds()
1372 memcpy(drv_buf_iter->bsg_buf, in mpi3mr_bsg_process_mpt_cmds()
1373 drv_buf_iter->kern_buf, tmplen); in mpi3mr_bsg_process_mpt_cmds()
1394 drv_buf_iter = drv_bufs; in mpi3mr_bsg_process_mpt_cmds()
1395 for (count = 0; count < bufcnt; count++, drv_buf_iter++) { in mpi3mr_bsg_process_mpt_cmds()
1396 if (drv_buf_iter->kern_buf && drv_buf_iter->kern_buf_dma) in mpi3mr_bsg_process_mpt_cmds()
1398 drv_buf_iter->kern_buf_len, in mpi3mr_bsg_process_mpt_cmds()
1399 drv_buf_iter->kern_buf, in mpi3mr_bsg_process_mpt_cmds()
1400 drv_buf_iter->kern_buf_dma); in mpi3mr_bsg_process_mpt_cmds()