Lines Matching refs:cmd

150 static inline void *scsi_cmd_priv(struct scsi_cmnd *cmd)  in scsi_cmd_priv()  argument
152 return cmd + 1; in scsi_cmd_priv()
155 void scsi_done(struct scsi_cmnd *cmd);
156 void scsi_done_direct(struct scsi_cmnd *cmd);
158 extern void scsi_finish_command(struct scsi_cmnd *cmd);
164 blk_status_t scsi_alloc_sgtables(struct scsi_cmnd *cmd);
165 void scsi_free_sgtables(struct scsi_cmnd *cmd);
168 extern int scsi_dma_map(struct scsi_cmnd *cmd);
169 extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
171 static inline int scsi_dma_map(struct scsi_cmnd *cmd) { return -ENOSYS; } in scsi_dma_map() argument
172 static inline void scsi_dma_unmap(struct scsi_cmnd *cmd) { } in scsi_dma_unmap() argument
175 static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd) in scsi_sg_count() argument
177 return cmd->sdb.table.nents; in scsi_sg_count()
180 static inline struct scatterlist *scsi_sglist(struct scsi_cmnd *cmd) in scsi_sglist() argument
182 return cmd->sdb.table.sgl; in scsi_sglist()
185 static inline unsigned scsi_bufflen(struct scsi_cmnd *cmd) in scsi_bufflen() argument
187 return cmd->sdb.length; in scsi_bufflen()
190 static inline void scsi_set_resid(struct scsi_cmnd *cmd, unsigned int resid) in scsi_set_resid() argument
192 cmd->resid_len = resid; in scsi_set_resid()
195 static inline unsigned int scsi_get_resid(struct scsi_cmnd *cmd) in scsi_get_resid() argument
197 return cmd->resid_len; in scsi_get_resid()
200 #define scsi_for_each_sg(cmd, sg, nseg, __i) \ argument
201 for_each_sg(scsi_sglist(cmd), sg, nseg, __i)
203 static inline int scsi_sg_copy_from_buffer(struct scsi_cmnd *cmd, in scsi_sg_copy_from_buffer() argument
206 return sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), in scsi_sg_copy_from_buffer()
210 static inline int scsi_sg_copy_to_buffer(struct scsi_cmnd *cmd, in scsi_sg_copy_to_buffer() argument
213 return sg_copy_to_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), in scsi_sg_copy_to_buffer()
310 static inline unsigned scsi_prot_sg_count(struct scsi_cmnd *cmd) in scsi_prot_sg_count() argument
312 return cmd->prot_sdb ? cmd->prot_sdb->table.nents : 0; in scsi_prot_sg_count()
315 static inline struct scatterlist *scsi_prot_sglist(struct scsi_cmnd *cmd) in scsi_prot_sglist() argument
317 return cmd->prot_sdb ? cmd->prot_sdb->table.sgl : NULL; in scsi_prot_sglist()
320 static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd) in scsi_prot() argument
322 return cmd->prot_sdb; in scsi_prot()
325 #define scsi_for_each_prot_sg(cmd, sg, nseg, __i) \ argument
326 for_each_sg(scsi_prot_sglist(cmd), sg, nseg, __i)
328 static inline void set_status_byte(struct scsi_cmnd *cmd, char status) in set_status_byte() argument
330 cmd->result = (cmd->result & 0xffffff00) | status; in set_status_byte()
333 static inline u8 get_status_byte(struct scsi_cmnd *cmd) in get_status_byte() argument
335 return cmd->result & 0xff; in get_status_byte()
338 static inline void set_host_byte(struct scsi_cmnd *cmd, char status) in set_host_byte() argument
340 cmd->result = (cmd->result & 0xff00ffff) | (status << 16); in set_host_byte()
343 static inline u8 get_host_byte(struct scsi_cmnd *cmd) in get_host_byte() argument
345 return (cmd->result >> 16) & 0xff; in get_host_byte()
358 static inline void scsi_msg_to_host_byte(struct scsi_cmnd *cmd, u8 msg) in scsi_msg_to_host_byte() argument
364 set_host_byte(cmd, DID_ABORT); in scsi_msg_to_host_byte()
367 set_host_byte(cmd, DID_RESET); in scsi_msg_to_host_byte()
370 set_host_byte(cmd, DID_ERROR); in scsi_msg_to_host_byte()