Lines Matching refs:sc
87 lpfc_prot_group_type(struct lpfc_hba *phba, struct scsi_cmnd *sc);
147 lpfc_cmd_blksize(struct scsi_cmnd *sc) in lpfc_cmd_blksize() argument
149 return sc->device->sector_size; in lpfc_cmd_blksize()
155 lpfc_cmd_protect(struct scsi_cmnd *sc, int flag) in lpfc_cmd_protect() argument
161 lpfc_cmd_guard_csum(struct scsi_cmnd *sc) in lpfc_cmd_guard_csum() argument
163 if (lpfc_prot_group_type(NULL, sc) == LPFC_PG_TYPE_NO_DIF) in lpfc_cmd_guard_csum()
165 if (scsi_host_get_guard(sc->device->host) == SHOST_DIX_GUARD_IP) in lpfc_cmd_guard_csum()
1292 lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_err_inject() argument
1301 uint32_t op = scsi_get_prot_op(sc); in lpfc_bg_err_inject()
1311 sgpe = scsi_prot_sglist(sc); in lpfc_bg_err_inject()
1312 sgde = scsi_sglist(sc); in lpfc_bg_err_inject()
1313 lba = scsi_get_lba(sc); in lpfc_bg_err_inject()
1317 blksize = lpfc_cmd_blksize(sc); in lpfc_bg_err_inject()
1318 numblks = (scsi_bufflen(sc) + blksize - 1) / blksize; in lpfc_bg_err_inject()
1334 rdata = lpfc_rport_data_from_scsi_device(sc->device); in lpfc_bg_err_inject()
1357 lpfc_cmd = (struct lpfc_scsi_buf *)sc->host_scribble; in lpfc_bg_err_inject()
1699 lpfc_sc_to_bg_opcodes(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_sc_to_bg_opcodes() argument
1704 if (lpfc_cmd_guard_csum(sc)) { in lpfc_sc_to_bg_opcodes()
1705 switch (scsi_get_prot_op(sc)) { in lpfc_sc_to_bg_opcodes()
1728 scsi_get_prot_op(sc)); in lpfc_sc_to_bg_opcodes()
1734 switch (scsi_get_prot_op(sc)) { in lpfc_sc_to_bg_opcodes()
1757 scsi_get_prot_op(sc)); in lpfc_sc_to_bg_opcodes()
1779 lpfc_bg_err_opcodes(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_err_opcodes() argument
1784 if (lpfc_cmd_guard_csum(sc)) { in lpfc_bg_err_opcodes()
1785 switch (scsi_get_prot_op(sc)) { in lpfc_bg_err_opcodes()
1810 switch (scsi_get_prot_op(sc)) { in lpfc_bg_err_opcodes()
1871 lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_setup_bpl() argument
1879 int datadir = sc->sc_data_direction; in lpfc_bg_setup_bpl()
1888 status = lpfc_sc_to_bg_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_bpl()
1893 blksize = lpfc_cmd_blksize(sc); in lpfc_bg_setup_bpl()
1894 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */ in lpfc_bg_setup_bpl()
1897 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); in lpfc_bg_setup_bpl()
1900 lpfc_bg_err_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_bpl()
1931 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) in lpfc_bg_setup_bpl()
1936 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) in lpfc_bg_setup_bpl()
1955 scsi_for_each_sg(sc, sgde, datasegcnt, i) { in lpfc_bg_setup_bpl()
2013 lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_setup_bpl_prot() argument
2028 int datadir = sc->sc_data_direction; in lpfc_bg_setup_bpl_prot()
2039 sgpe = scsi_prot_sglist(sc); in lpfc_bg_setup_bpl_prot()
2040 sgde = scsi_sglist(sc); in lpfc_bg_setup_bpl_prot()
2049 status = lpfc_sc_to_bg_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_bpl_prot()
2054 blksize = lpfc_cmd_blksize(sc); in lpfc_bg_setup_bpl_prot()
2055 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */ in lpfc_bg_setup_bpl_prot()
2058 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); in lpfc_bg_setup_bpl_prot()
2061 lpfc_bg_err_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_bpl_prot()
2093 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) in lpfc_bg_setup_bpl_prot()
2098 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) in lpfc_bg_setup_bpl_prot()
2258 lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_setup_sgl() argument
2275 status = lpfc_sc_to_bg_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_sgl()
2280 blksize = lpfc_cmd_blksize(sc); in lpfc_bg_setup_sgl()
2281 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */ in lpfc_bg_setup_sgl()
2284 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); in lpfc_bg_setup_sgl()
2287 lpfc_bg_err_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_sgl()
2306 if (sc->sc_data_direction == DMA_FROM_DEVICE) { in lpfc_bg_setup_sgl()
2307 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) in lpfc_bg_setup_sgl()
2312 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) in lpfc_bg_setup_sgl()
2334 scsi_for_each_sg(sc, sgde, datasegcnt, i) { in lpfc_bg_setup_sgl()
2395 lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_setup_sgl_prot() argument
2420 sgpe = scsi_prot_sglist(sc); in lpfc_bg_setup_sgl_prot()
2421 sgde = scsi_sglist(sc); in lpfc_bg_setup_sgl_prot()
2430 status = lpfc_sc_to_bg_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_sgl_prot()
2435 blksize = lpfc_cmd_blksize(sc); in lpfc_bg_setup_sgl_prot()
2436 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */ in lpfc_bg_setup_sgl_prot()
2439 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); in lpfc_bg_setup_sgl_prot()
2442 lpfc_bg_err_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_sgl_prot()
2463 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) { in lpfc_bg_setup_sgl_prot()
2482 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) in lpfc_bg_setup_sgl_prot()
2628 lpfc_prot_group_type(struct lpfc_hba *phba, struct scsi_cmnd *sc) in lpfc_prot_group_type() argument
2631 unsigned char op = scsi_get_prot_op(sc); in lpfc_prot_group_type()
2668 struct scsi_cmnd *sc = lpfc_cmd->pCmd; in lpfc_bg_scsi_adjust_dl() local
2671 fcpdl = scsi_bufflen(sc); in lpfc_bg_scsi_adjust_dl()
2674 if (sc->sc_data_direction == DMA_FROM_DEVICE) { in lpfc_bg_scsi_adjust_dl()
2676 if (scsi_get_prot_op(sc) == SCSI_PROT_READ_INSERT) in lpfc_bg_scsi_adjust_dl()
2681 if (scsi_get_prot_op(sc) == SCSI_PROT_WRITE_STRIP) in lpfc_bg_scsi_adjust_dl()
2690 fcpdl += (fcpdl / lpfc_cmd_blksize(sc)) * 8; in lpfc_bg_scsi_adjust_dl()