blob: 26472499620ac064284e0a676436073e91ca128a [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
Christopher Ferris9584fa42019-12-09 15:36:13 -080021#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070022#define FC_DEFAULT_BSG_TIMEOUT (10 * HZ)
23#define FC_BSG_CLS_MASK 0xF0000000
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define FC_BSG_HST_MASK 0x80000000
25#define FC_BSG_RPT_MASK 0x40000000
26#define FC_BSG_HST_ADD_RPORT (FC_BSG_HST_MASK | 0x00000001)
27#define FC_BSG_HST_DEL_RPORT (FC_BSG_HST_MASK | 0x00000002)
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define FC_BSG_HST_ELS_NOLOGIN (FC_BSG_HST_MASK | 0x00000003)
29#define FC_BSG_HST_CT (FC_BSG_HST_MASK | 0x00000004)
30#define FC_BSG_HST_VENDOR (FC_BSG_HST_MASK | 0x000000FF)
31#define FC_BSG_RPT_ELS (FC_BSG_RPT_MASK | 0x00000001)
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define FC_BSG_RPT_CT (FC_BSG_RPT_MASK | 0x00000002)
33struct fc_bsg_host_add_rport {
Christopher Ferris9584fa42019-12-09 15:36:13 -080034 __u8 reserved;
35 __u8 port_id[3];
Ben Cheng655a7c02013-10-16 16:09:24 -070036};
37struct fc_bsg_host_del_rport {
Christopher Ferris9584fa42019-12-09 15:36:13 -080038 __u8 reserved;
39 __u8 port_id[3];
Ben Cheng655a7c02013-10-16 16:09:24 -070040};
41struct fc_bsg_host_els {
Christopher Ferris9584fa42019-12-09 15:36:13 -080042 __u8 command_code;
43 __u8 port_id[3];
Ben Cheng655a7c02013-10-16 16:09:24 -070044};
45#define FC_CTELS_STATUS_OK 0x00000000
46#define FC_CTELS_STATUS_REJECT 0x00000001
47#define FC_CTELS_STATUS_P_RJT 0x00000002
Ben Cheng655a7c02013-10-16 16:09:24 -070048#define FC_CTELS_STATUS_F_RJT 0x00000003
49#define FC_CTELS_STATUS_P_BSY 0x00000004
50#define FC_CTELS_STATUS_F_BSY 0x00000006
51struct fc_bsg_ctels_reply {
Christopher Ferris9584fa42019-12-09 15:36:13 -080052 __u32 status;
Tao Baod7db5942015-01-28 10:07:51 -080053 struct {
Christopher Ferris9584fa42019-12-09 15:36:13 -080054 __u8 action;
55 __u8 reason_code;
56 __u8 reason_explanation;
57 __u8 vendor_unique;
Tao Baod7db5942015-01-28 10:07:51 -080058 } rjt_data;
Ben Cheng655a7c02013-10-16 16:09:24 -070059};
Ben Cheng655a7c02013-10-16 16:09:24 -070060struct fc_bsg_host_ct {
Christopher Ferris9584fa42019-12-09 15:36:13 -080061 __u8 reserved;
62 __u8 port_id[3];
63 __u32 preamble_word0;
64 __u32 preamble_word1;
65 __u32 preamble_word2;
Ben Cheng655a7c02013-10-16 16:09:24 -070066};
67struct fc_bsg_host_vendor {
Christopher Ferris9584fa42019-12-09 15:36:13 -080068 __u64 vendor_id;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070069 __u32 vendor_cmd[];
Ben Cheng655a7c02013-10-16 16:09:24 -070070};
71struct fc_bsg_host_vendor_reply {
Christopher Ferris9584fa42019-12-09 15:36:13 -080072 __u32 vendor_rsp[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070073};
74struct fc_bsg_rport_els {
Christopher Ferris9584fa42019-12-09 15:36:13 -080075 __u8 els_code;
Ben Cheng655a7c02013-10-16 16:09:24 -070076};
77struct fc_bsg_rport_ct {
Christopher Ferris9584fa42019-12-09 15:36:13 -080078 __u32 preamble_word0;
79 __u32 preamble_word1;
80 __u32 preamble_word2;
Ben Cheng655a7c02013-10-16 16:09:24 -070081};
82struct fc_bsg_request {
Christopher Ferris9584fa42019-12-09 15:36:13 -080083 __u32 msgcode;
Tao Baod7db5942015-01-28 10:07:51 -080084 union {
85 struct fc_bsg_host_add_rport h_addrport;
86 struct fc_bsg_host_del_rport h_delrport;
87 struct fc_bsg_host_els h_els;
Tao Baod7db5942015-01-28 10:07:51 -080088 struct fc_bsg_host_ct h_ct;
89 struct fc_bsg_host_vendor h_vendor;
90 struct fc_bsg_rport_els r_els;
91 struct fc_bsg_rport_ct r_ct;
Tao Baod7db5942015-01-28 10:07:51 -080092 } rqst_data;
Ben Cheng655a7c02013-10-16 16:09:24 -070093} __attribute__((packed));
94struct fc_bsg_reply {
Christopher Ferris9584fa42019-12-09 15:36:13 -080095 __u32 result;
96 __u32 reply_payload_rcv_len;
Tao Baod7db5942015-01-28 10:07:51 -080097 union {
98 struct fc_bsg_host_vendor_reply vendor_reply;
99 struct fc_bsg_ctels_reply ctels_reply;
Tao Baod7db5942015-01-28 10:07:51 -0800100 } reply_data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700101};
102#endif