Lines Matching +full:carry +full:- +full:less
1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/dma-mapping.h>
7 #include <linux/t10-pi.h>
18 * The longest fixed-length SCSI CDB as per the SCSI standard.
19 * fixed-length means: commands that their size can be determined
20 * by their opcode and the CDB does not carry a length specifier, (unlike
25 * So in effect MAX_COMMAND_SIZE means the maximum size command scsi-ml
51 /* for scmd->flags */
57 * SCSI EH should not overwrite scmd->result when SCMD_FORCE_EH_SUCCESS is set.
64 /* for scmd->state */
109 unsigned underflow; /* Return error if less than
122 * command (auto-sense). Length must be
177 static inline int scsi_dma_map(struct scsi_cmnd *cmd) { return -ENOSYS; } in scsi_dma_map()
183 return cmd->sdb.table.nents; in scsi_sg_count()
188 return cmd->sdb.table.sgl; in scsi_sglist()
193 return cmd->sdb.length; in scsi_bufflen()
198 cmd->resid_len = resid; in scsi_set_resid()
203 return cmd->resid_len; in scsi_get_resid()
230 unsigned int shift = ilog2(scmd->device->sector_size) - SECTOR_SHIFT; in scsi_get_lba()
237 unsigned int shift = ilog2(scmd->device->sector_size); in scsi_logical_block_count()
250 /* OS-HBA: Protected, HBA-Target: Unprotected */
254 /* OS-HBA: Unprotected, HBA-Target: Protected */
258 /* OS-HBA: Protected, HBA-Target: Protected */
265 scmd->prot_op = op; in scsi_set_prot_op()
270 return scmd->prot_op; in scsi_get_prot_op()
296 scmd->prot_type = type; in scsi_set_prot_type()
301 return scmd->prot_type; in scsi_get_prot_type()
313 return scmd->device->sector_size; in scsi_prot_interval()
318 return cmd->prot_sdb ? cmd->prot_sdb->table.nents : 0; in scsi_prot_sg_count()
323 return cmd->prot_sdb ? cmd->prot_sdb->table.sgl : NULL; in scsi_prot_sglist()
328 return cmd->prot_sdb; in scsi_prot()
336 cmd->result = (cmd->result & 0xffffff00) | status; in set_status_byte()
341 return cmd->result & 0xff; in get_status_byte()
346 cmd->result = (cmd->result & 0xff00ffff) | (status << 16); in set_host_byte()
351 return (cmd->result >> 16) & 0xff; in get_host_byte()
355 * scsi_msg_to_host_byte() - translate message byte
385 unsigned int xfer_len = scmd->sdb.length; in scsi_transfer_length()
388 if (scmd->prot_flags & SCSI_PROT_TRANSFER_PI) in scsi_transfer_length()