blob: ba0aeb980f7e7cb654171697316f6089b9db01d0 [file] [log] [blame]
Christoph Hellwig82ed4db2017-01-27 09:46:29 +01001#ifndef _SCSI_SCSI_REQUEST_H
2#define _SCSI_SCSI_REQUEST_H
3
4#include <linux/blk-mq.h>
5
6#define BLK_MAX_CDB 16
7
8struct scsi_request {
9 unsigned char __cmd[BLK_MAX_CDB];
10 unsigned char *cmd;
11 unsigned short cmd_len;
12 unsigned int sense_len;
13 unsigned int resid_len; /* residual count */
14 void *sense;
15};
16
17static inline struct scsi_request *scsi_req(struct request *rq)
18{
19 return blk_mq_rq_to_pdu(rq);
20}
21
22static inline void scsi_req_free_cmd(struct scsi_request *req)
23{
24 if (req->cmd != req->__cmd)
25 kfree(req->cmd);
26}
27
28void scsi_req_init(struct request *);
29
30#endif /* _SCSI_SCSI_REQUEST_H */