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
1300 uint32_t op = scsi_get_prot_op(sc); in lpfc_bg_err_inject()
1310 sgpe = scsi_prot_sglist(sc); in lpfc_bg_err_inject()
1311 lba = scsi_get_lba(sc); in lpfc_bg_err_inject()
1315 blksize = lpfc_cmd_blksize(sc); in lpfc_bg_err_inject()
1316 numblks = (scsi_bufflen(sc) + blksize - 1) / blksize; in lpfc_bg_err_inject()
1332 rdata = lpfc_rport_data_from_scsi_device(sc->device); in lpfc_bg_err_inject()
1355 lpfc_cmd = (struct lpfc_scsi_buf *)sc->host_scribble; in lpfc_bg_err_inject()
1697 lpfc_sc_to_bg_opcodes(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_sc_to_bg_opcodes() argument
1702 if (lpfc_cmd_guard_csum(sc)) { in lpfc_sc_to_bg_opcodes()
1703 switch (scsi_get_prot_op(sc)) { in lpfc_sc_to_bg_opcodes()
1726 scsi_get_prot_op(sc)); in lpfc_sc_to_bg_opcodes()
1732 switch (scsi_get_prot_op(sc)) { in lpfc_sc_to_bg_opcodes()
1755 scsi_get_prot_op(sc)); in lpfc_sc_to_bg_opcodes()
1777 lpfc_bg_err_opcodes(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_err_opcodes() argument
1782 if (lpfc_cmd_guard_csum(sc)) { in lpfc_bg_err_opcodes()
1783 switch (scsi_get_prot_op(sc)) { in lpfc_bg_err_opcodes()
1808 switch (scsi_get_prot_op(sc)) { in lpfc_bg_err_opcodes()
1869 lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_setup_bpl() argument
1877 int datadir = sc->sc_data_direction; in lpfc_bg_setup_bpl()
1885 status = lpfc_sc_to_bg_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_bpl()
1890 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */ in lpfc_bg_setup_bpl()
1893 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); in lpfc_bg_setup_bpl()
1896 lpfc_bg_err_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_bpl()
1927 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) in lpfc_bg_setup_bpl()
1932 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) in lpfc_bg_setup_bpl()
1951 scsi_for_each_sg(sc, sgde, datasegcnt, i) { in lpfc_bg_setup_bpl()
2009 lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_setup_bpl_prot() argument
2024 int datadir = sc->sc_data_direction; in lpfc_bg_setup_bpl_prot()
2035 sgpe = scsi_prot_sglist(sc); in lpfc_bg_setup_bpl_prot()
2036 sgde = scsi_sglist(sc); in lpfc_bg_setup_bpl_prot()
2045 status = lpfc_sc_to_bg_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_bpl_prot()
2050 blksize = lpfc_cmd_blksize(sc); in lpfc_bg_setup_bpl_prot()
2051 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */ in lpfc_bg_setup_bpl_prot()
2054 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); in lpfc_bg_setup_bpl_prot()
2057 lpfc_bg_err_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_bpl_prot()
2089 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) in lpfc_bg_setup_bpl_prot()
2094 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) in lpfc_bg_setup_bpl_prot()
2254 lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_setup_sgl() argument
2270 status = lpfc_sc_to_bg_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_sgl()
2275 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */ in lpfc_bg_setup_sgl()
2278 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); in lpfc_bg_setup_sgl()
2281 lpfc_bg_err_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_sgl()
2300 if (sc->sc_data_direction == DMA_FROM_DEVICE) { in lpfc_bg_setup_sgl()
2301 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) in lpfc_bg_setup_sgl()
2306 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) in lpfc_bg_setup_sgl()
2328 scsi_for_each_sg(sc, sgde, datasegcnt, i) { in lpfc_bg_setup_sgl()
2389 lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, in lpfc_bg_setup_sgl_prot() argument
2414 sgpe = scsi_prot_sglist(sc); in lpfc_bg_setup_sgl_prot()
2415 sgde = scsi_sglist(sc); in lpfc_bg_setup_sgl_prot()
2424 status = lpfc_sc_to_bg_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_sgl_prot()
2429 blksize = lpfc_cmd_blksize(sc); in lpfc_bg_setup_sgl_prot()
2430 reftag = (uint32_t)scsi_get_lba(sc); /* Truncate LBA */ in lpfc_bg_setup_sgl_prot()
2433 rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); in lpfc_bg_setup_sgl_prot()
2436 lpfc_bg_err_opcodes(phba, sc, &txop, &rxop); in lpfc_bg_setup_sgl_prot()
2457 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_GUARD)) { in lpfc_bg_setup_sgl_prot()
2476 if (lpfc_cmd_protect(sc, LPFC_CHECK_PROTECT_REF)) in lpfc_bg_setup_sgl_prot()
2622 lpfc_prot_group_type(struct lpfc_hba *phba, struct scsi_cmnd *sc) in lpfc_prot_group_type() argument
2625 unsigned char op = scsi_get_prot_op(sc); in lpfc_prot_group_type()
2662 struct scsi_cmnd *sc = lpfc_cmd->pCmd; in lpfc_bg_scsi_adjust_dl() local
2665 fcpdl = scsi_bufflen(sc); in lpfc_bg_scsi_adjust_dl()
2668 if (sc->sc_data_direction == DMA_FROM_DEVICE) { in lpfc_bg_scsi_adjust_dl()
2670 if (scsi_get_prot_op(sc) == SCSI_PROT_READ_INSERT) in lpfc_bg_scsi_adjust_dl()
2675 if (scsi_get_prot_op(sc) == SCSI_PROT_WRITE_STRIP) in lpfc_bg_scsi_adjust_dl()
2684 fcpdl += (fcpdl / lpfc_cmd_blksize(sc)) * 8; in lpfc_bg_scsi_adjust_dl()