1a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich/****************************************************************************
2a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ****************************************************************************
3a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***
4a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***   This header was automatically generated from a Linux kernel header
5a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***   of the same name, to make information necessary for userspace to
6a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***   call into the kernel available to libc.  It contains only constants,
7a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***   structures, and macros generated from the original header, and thus,
8a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***   contains no copyrightable information.
9a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***
10a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***   To edit the content of this header, modify the corresponding
11a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***   source file (e.g. under external/kernel-headers/original/) then
12a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***   run bionic/libc/kernel/tools/update_all.py
13a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***
14a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***   Any manual change here will be lost the next time this script will
15a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***   be run. You've been warned!
16a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ***
17a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ****************************************************************************
18a67e4de6620b570dabe0f92985228af0d0204f2cNick Kralevich ****************************************************************************/
19655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#ifndef _UAPIBSG_H
20655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define _UAPIBSG_H
21655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#include <linux/types.h>
22655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BSG_PROTOCOL_SCSI 0
23655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BSG_SUB_PROTOCOL_SCSI_CMD 0
24655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BSG_SUB_PROTOCOL_SCSI_TMF 1
25655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2
26655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define BSG_FLAG_Q_AT_TAIL 0x10
2782d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris#define BSG_FLAG_Q_AT_HEAD 0x20
28655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct sg_io_v4 {
29d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __s32 guard;
30d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 protocol;
31d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 subprotocol;
32d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 request_len;
33d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u64 request;
34d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u64 request_tag;
35d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 request_attr;
36d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 request_priority;
37d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 request_extra;
38d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 max_response_len;
39d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u64 response;
40d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 dout_iovec_count;
41d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 dout_xfer_len;
42d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 din_iovec_count;
43d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 din_xfer_len;
44d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u64 dout_xferp;
45d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u64 din_xferp;
46d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 timeout;
47d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 flags;
48d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u64 usr_ptr;
49d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 spare_in;
50d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 driver_status;
51d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 transport_status;
52d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 device_status;
53d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 retry_delay;
54d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 info;
55d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 duration;
56d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 response_len;
57d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __s32 din_resid;
58d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __s32 dout_resid;
59d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u64 generated_tag;
60d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 spare_out;
61d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  __u32 padding;
62655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng};
6382d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris#endif
64