Lines Matching refs:hdr

34 static int bsg_transport_check_proto(struct sg_io_v4 *hdr)  in bsg_transport_check_proto()  argument
36 if (hdr->protocol != BSG_PROTOCOL_SCSI || in bsg_transport_check_proto()
37 hdr->subprotocol != BSG_SUB_PROTOCOL_SCSI_TRANSPORT) in bsg_transport_check_proto()
44 static int bsg_transport_fill_hdr(struct request *rq, struct sg_io_v4 *hdr, in bsg_transport_fill_hdr() argument
49 job->request_len = hdr->request_len; in bsg_transport_fill_hdr()
50 job->request = memdup_user(uptr64(hdr->request), hdr->request_len); in bsg_transport_fill_hdr()
55 static int bsg_transport_complete_rq(struct request *rq, struct sg_io_v4 *hdr) in bsg_transport_complete_rq() argument
64 hdr->device_status = job->result & 0xff; in bsg_transport_complete_rq()
65 hdr->transport_status = host_byte(job->result); in bsg_transport_complete_rq()
66 hdr->driver_status = driver_byte(job->result); in bsg_transport_complete_rq()
67 hdr->info = 0; in bsg_transport_complete_rq()
68 if (hdr->device_status || hdr->transport_status || hdr->driver_status) in bsg_transport_complete_rq()
69 hdr->info |= SG_INFO_CHECK; in bsg_transport_complete_rq()
70 hdr->response_len = 0; in bsg_transport_complete_rq()
78 if (job->reply_len && hdr->response) { in bsg_transport_complete_rq()
79 int len = min(hdr->max_response_len, job->reply_len); in bsg_transport_complete_rq()
81 if (copy_to_user(uptr64(hdr->response), job->reply, len)) in bsg_transport_complete_rq()
84 hdr->response_len = len; in bsg_transport_complete_rq()
88 hdr->dout_resid = 0; in bsg_transport_complete_rq()
94 hdr->din_resid = 0; in bsg_transport_complete_rq()
96 hdr->din_resid = rsp_len - job->reply_payload_rcv_len; in bsg_transport_complete_rq()
98 hdr->din_resid = 0; in bsg_transport_complete_rq()