Lines Matching refs:hdr
12 static int scsi_bsg_sg_io_fn(struct request_queue *q, struct sg_io_v4 *hdr,
20 if (hdr->protocol != BSG_PROTOCOL_SCSI ||
21 hdr->subprotocol != BSG_SUB_PROTOCOL_SCSI_CMD)
23 if (hdr->dout_xfer_len && hdr->din_xfer_len) {
28 rq = scsi_alloc_request(q, hdr->dout_xfer_len ?
35 scmd->cmd_len = hdr->request_len;
42 if (copy_from_user(scmd->cmnd, uptr64(hdr->request), scmd->cmd_len))
49 if (hdr->dout_xfer_len) {
50 ret = blk_rq_map_user(rq->q, rq, NULL, uptr64(hdr->dout_xferp),
51 hdr->dout_xfer_len, GFP_KERNEL);
52 } else if (hdr->din_xfer_len) {
53 ret = blk_rq_map_user(rq->q, rq, NULL, uptr64(hdr->din_xferp),
54 hdr->din_xfer_len, GFP_KERNEL);
61 blk_execute_rq(rq, !(hdr->flags & BSG_FLAG_Q_AT_TAIL));
66 hdr->device_status = scmd->result & 0xff;
67 hdr->transport_status = host_byte(scmd->result);
68 hdr->driver_status = 0;
70 hdr->driver_status = DRIVER_SENSE;
71 hdr->info = 0;
72 if (hdr->device_status || hdr->transport_status || hdr->driver_status)
73 hdr->info |= SG_INFO_CHECK;
74 hdr->response_len = 0;
76 if (scmd->sense_len && hdr->response) {
77 int len = min_t(unsigned int, hdr->max_response_len,
80 if (copy_to_user(uptr64(hdr->response), scmd->sense_buffer,
84 hdr->response_len = len;
88 hdr->din_resid = scmd->resid_len;
90 hdr->dout_resid = scmd->resid_len;