blob: 2d76a05948ea35c29af48b55b8664c4cd362e848 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef SCSI_BSG_FC_H
20#define SCSI_BSG_FC_H
21#define FC_DEFAULT_BSG_TIMEOUT (10 * HZ)
22#define FC_BSG_CLS_MASK 0xF0000000
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define FC_BSG_HST_MASK 0x80000000
24#define FC_BSG_RPT_MASK 0x40000000
25#define FC_BSG_HST_ADD_RPORT (FC_BSG_HST_MASK | 0x00000001)
26#define FC_BSG_HST_DEL_RPORT (FC_BSG_HST_MASK | 0x00000002)
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define FC_BSG_HST_ELS_NOLOGIN (FC_BSG_HST_MASK | 0x00000003)
28#define FC_BSG_HST_CT (FC_BSG_HST_MASK | 0x00000004)
29#define FC_BSG_HST_VENDOR (FC_BSG_HST_MASK | 0x000000FF)
30#define FC_BSG_RPT_ELS (FC_BSG_RPT_MASK | 0x00000001)
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002)
32struct fc_bsg_host_add_rport {
Tao Baod7db5942015-01-28 10:07:51 -080033 uint8_t reserved;
34 uint8_t port_id[3];
Ben Cheng655a7c02013-10-16 16:09:24 -070035};
36struct fc_bsg_host_del_rport {
Tao Baod7db5942015-01-28 10:07:51 -080037 uint8_t reserved;
38 uint8_t port_id[3];
Ben Cheng655a7c02013-10-16 16:09:24 -070039};
40struct fc_bsg_host_els {
Tao Baod7db5942015-01-28 10:07:51 -080041 uint8_t command_code;
42 uint8_t port_id[3];
Ben Cheng655a7c02013-10-16 16:09:24 -070043};
44#define FC_CTELS_STATUS_OK 0x00000000
45#define FC_CTELS_STATUS_REJECT 0x00000001
46#define FC_CTELS_STATUS_P_RJT 0x00000002
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define FC_CTELS_STATUS_F_RJT 0x00000003
48#define FC_CTELS_STATUS_P_BSY 0x00000004
49#define FC_CTELS_STATUS_F_BSY 0x00000006
50struct fc_bsg_ctels_reply {
Tao Baod7db5942015-01-28 10:07:51 -080051 uint32_t status;
52 struct {
53 uint8_t action;
54 uint8_t reason_code;
Tao Baod7db5942015-01-28 10:07:51 -080055 uint8_t reason_explanation;
56 uint8_t vendor_unique;
57 } rjt_data;
Ben Cheng655a7c02013-10-16 16:09:24 -070058};
Ben Cheng655a7c02013-10-16 16:09:24 -070059struct fc_bsg_host_ct {
Tao Baod7db5942015-01-28 10:07:51 -080060 uint8_t reserved;
61 uint8_t port_id[3];
62 uint32_t preamble_word0;
Tao Baod7db5942015-01-28 10:07:51 -080063 uint32_t preamble_word1;
64 uint32_t preamble_word2;
Ben Cheng655a7c02013-10-16 16:09:24 -070065};
66struct fc_bsg_host_vendor {
Tao Baod7db5942015-01-28 10:07:51 -080067 uint64_t vendor_id;
68 uint32_t vendor_cmd[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070069};
70struct fc_bsg_host_vendor_reply {
Tao Baod7db5942015-01-28 10:07:51 -080071 uint32_t vendor_rsp[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070072};
73struct fc_bsg_rport_els {
Tao Baod7db5942015-01-28 10:07:51 -080074 uint8_t els_code;
Ben Cheng655a7c02013-10-16 16:09:24 -070075};
76struct fc_bsg_rport_ct {
Tao Baod7db5942015-01-28 10:07:51 -080077 uint32_t preamble_word0;
78 uint32_t preamble_word1;
Tao Baod7db5942015-01-28 10:07:51 -080079 uint32_t preamble_word2;
Ben Cheng655a7c02013-10-16 16:09:24 -070080};
81struct fc_bsg_request {
Tao Baod7db5942015-01-28 10:07:51 -080082 uint32_t msgcode;
Tao Baod7db5942015-01-28 10:07:51 -080083 union {
84 struct fc_bsg_host_add_rport h_addrport;
85 struct fc_bsg_host_del_rport h_delrport;
86 struct fc_bsg_host_els h_els;
Tao Baod7db5942015-01-28 10:07:51 -080087 struct fc_bsg_host_ct h_ct;
88 struct fc_bsg_host_vendor h_vendor;
89 struct fc_bsg_rport_els r_els;
90 struct fc_bsg_rport_ct r_ct;
Tao Baod7db5942015-01-28 10:07:51 -080091 } rqst_data;
Ben Cheng655a7c02013-10-16 16:09:24 -070092} __attribute__((packed));
93struct fc_bsg_reply {
Tao Baod7db5942015-01-28 10:07:51 -080094 uint32_t result;
Tao Baod7db5942015-01-28 10:07:51 -080095 uint32_t reply_payload_rcv_len;
96 union {
97 struct fc_bsg_host_vendor_reply vendor_reply;
98 struct fc_bsg_ctels_reply ctels_reply;
Tao Baod7db5942015-01-28 10:07:51 -080099 } reply_data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700100};
101#endif