Lines Matching refs:cmd
135 static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) in scsi_cmd_to_driver() argument
139 if (!cmd->request->rq_disk) in scsi_cmd_to_driver()
142 sdp = (struct scsi_driver **)cmd->request->rq_disk->private_data; in scsi_cmd_to_driver()
154 extern void scsi_finish_command(struct scsi_cmnd *cmd);
160 extern int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask);
161 extern void scsi_release_buffers(struct scsi_cmnd *cmd);
163 extern int scsi_dma_map(struct scsi_cmnd *cmd);
164 extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
167 void scsi_free_command(gfp_t gfp_mask, struct scsi_cmnd *cmd);
169 static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd) in scsi_sg_count() argument
171 return cmd->sdb.table.nents; in scsi_sg_count()
174 static inline struct scatterlist *scsi_sglist(struct scsi_cmnd *cmd) in scsi_sglist() argument
176 return cmd->sdb.table.sgl; in scsi_sglist()
179 static inline unsigned scsi_bufflen(struct scsi_cmnd *cmd) in scsi_bufflen() argument
181 return cmd->sdb.length; in scsi_bufflen()
184 static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid) in scsi_set_resid() argument
186 cmd->sdb.resid = resid; in scsi_set_resid()
189 static inline int scsi_get_resid(struct scsi_cmnd *cmd) in scsi_get_resid() argument
191 return cmd->sdb.resid; in scsi_get_resid()
194 #define scsi_for_each_sg(cmd, sg, nseg, __i) \ argument
195 for_each_sg(scsi_sglist(cmd), sg, nseg, __i)
197 static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd) in scsi_bidi_cmnd() argument
199 return blk_bidi_rq(cmd->request) && in scsi_bidi_cmnd()
200 (cmd->request->next_rq->special != NULL); in scsi_bidi_cmnd()
203 static inline struct scsi_data_buffer *scsi_in(struct scsi_cmnd *cmd) in scsi_in() argument
205 return scsi_bidi_cmnd(cmd) ? in scsi_in()
206 cmd->request->next_rq->special : &cmd->sdb; in scsi_in()
209 static inline struct scsi_data_buffer *scsi_out(struct scsi_cmnd *cmd) in scsi_out() argument
211 return &cmd->sdb; in scsi_out()
214 static inline int scsi_sg_copy_from_buffer(struct scsi_cmnd *cmd, in scsi_sg_copy_from_buffer() argument
217 return sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), in scsi_sg_copy_from_buffer()
221 static inline int scsi_sg_copy_to_buffer(struct scsi_cmnd *cmd, in scsi_sg_copy_to_buffer() argument
224 return sg_copy_to_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), in scsi_sg_copy_to_buffer()
287 static inline unsigned scsi_prot_sg_count(struct scsi_cmnd *cmd) in scsi_prot_sg_count() argument
289 return cmd->prot_sdb ? cmd->prot_sdb->table.nents : 0; in scsi_prot_sg_count()
292 static inline struct scatterlist *scsi_prot_sglist(struct scsi_cmnd *cmd) in scsi_prot_sglist() argument
294 return cmd->prot_sdb ? cmd->prot_sdb->table.sgl : NULL; in scsi_prot_sglist()
297 static inline struct scsi_data_buffer *scsi_prot(struct scsi_cmnd *cmd) in scsi_prot() argument
299 return cmd->prot_sdb; in scsi_prot()
302 #define scsi_for_each_prot_sg(cmd, sg, nseg, __i) \ argument
303 for_each_sg(scsi_prot_sglist(cmd), sg, nseg, __i)
305 static inline void set_msg_byte(struct scsi_cmnd *cmd, char status) in set_msg_byte() argument
307 cmd->result = (cmd->result & 0xffff00ff) | (status << 8); in set_msg_byte()
310 static inline void set_host_byte(struct scsi_cmnd *cmd, char status) in set_host_byte() argument
312 cmd->result = (cmd->result & 0xff00ffff) | (status << 16); in set_host_byte()
315 static inline void set_driver_byte(struct scsi_cmnd *cmd, char status) in set_driver_byte() argument
317 cmd->result = (cmd->result & 0x00ffffff) | (status << 24); in set_driver_byte()