Go to the documentation of this file.
6 #include <linux/types.h>
10 #define SBP_VERSION "v0.1"
11 #define SBP_NAMELEN 32
13 #define SBP_ORB_FETCH_SIZE 8
15 #define MANAGEMENT_AGENT_STATE_IDLE 0
16 #define MANAGEMENT_AGENT_STATE_BUSY 1
18 #define ORB_NOTIFY(v) (((v) >> 31) & 0x01)
19 #define ORB_REQUEST_FORMAT(v) (((v) >> 29) & 0x03)
21 #define MANAGEMENT_ORB_FUNCTION(v) (((v) >> 16) & 0x0f)
23 #define MANAGEMENT_ORB_FUNCTION_LOGIN 0x0
24 #define MANAGEMENT_ORB_FUNCTION_QUERY_LOGINS 0x1
25 #define MANAGEMENT_ORB_FUNCTION_RECONNECT 0x3
26 #define MANAGEMENT_ORB_FUNCTION_SET_PASSWORD 0x4
27 #define MANAGEMENT_ORB_FUNCTION_LOGOUT 0x7
28 #define MANAGEMENT_ORB_FUNCTION_ABORT_TASK 0xb
29 #define MANAGEMENT_ORB_FUNCTION_ABORT_TASK_SET 0xc
30 #define MANAGEMENT_ORB_FUNCTION_LOGICAL_UNIT_RESET 0xe
31 #define MANAGEMENT_ORB_FUNCTION_TARGET_RESET 0xf
33 #define LOGIN_ORB_EXCLUSIVE(v) (((v) >> 28) & 0x01)
34 #define LOGIN_ORB_RESERVED(v) (((v) >> 24) & 0x0f)
35 #define LOGIN_ORB_RECONNECT(v) (((v) >> 20) & 0x0f)
36 #define LOGIN_ORB_LUN(v) (((v) >> 0) & 0xffff)
37 #define LOGIN_ORB_PASSWORD_LENGTH(v) (((v) >> 16) & 0xffff)
38 #define LOGIN_ORB_RESPONSE_LENGTH(v) (((v) >> 0) & 0xffff)
40 #define RECONNECT_ORB_LOGIN_ID(v) (((v) >> 0) & 0xffff)
41 #define LOGOUT_ORB_LOGIN_ID(v) (((v) >> 0) & 0xffff)
43 #define CMDBLK_ORB_DIRECTION(v) (((v) >> 27) & 0x01)
44 #define CMDBLK_ORB_SPEED(v) (((v) >> 24) & 0x07)
45 #define CMDBLK_ORB_MAX_PAYLOAD(v) (((v) >> 20) & 0x0f)
46 #define CMDBLK_ORB_PG_TBL_PRESENT(v) (((v) >> 19) & 0x01)
47 #define CMDBLK_ORB_PG_SIZE(v) (((v) >> 16) & 0x07)
48 #define CMDBLK_ORB_DATA_SIZE(v) (((v) >> 0) & 0xffff)
50 #define STATUS_BLOCK_SRC(v) (((v) & 0x03) << 30)
51 #define STATUS_BLOCK_RESP(v) (((v) & 0x03) << 28)
52 #define STATUS_BLOCK_DEAD(v) (((v) ? 1 : 0) << 27)
53 #define STATUS_BLOCK_LEN(v) (((v) & 0x07) << 24)
54 #define STATUS_BLOCK_SBP_STATUS(v) (((v) & 0xff) << 16)
55 #define STATUS_BLOCK_ORB_OFFSET_HIGH(v) (((v) & 0xffff) << 0)
57 #define STATUS_SRC_ORB_CONTINUING 0
58 #define STATUS_SRC_ORB_FINISHED 1
59 #define STATUS_SRC_UNSOLICITED 2
61 #define STATUS_RESP_REQUEST_COMPLETE 0
62 #define STATUS_RESP_TRANSPORT_FAILURE 1
63 #define STATUS_RESP_ILLEGAL_REQUEST 2
64 #define STATUS_RESP_VENDOR_DEPENDENT 3
66 #define SBP_STATUS_OK 0
67 #define SBP_STATUS_REQ_TYPE_NOTSUPP 1
68 #define SBP_STATUS_SPEED_NOTSUPP 2
69 #define SBP_STATUS_PAGE_SIZE_NOTSUPP 3
70 #define SBP_STATUS_ACCESS_DENIED 4
71 #define SBP_STATUS_LUN_NOTSUPP 5
72 #define SBP_STATUS_PAYLOAD_TOO_SMALL 6
74 #define SBP_STATUS_RESOURCES_UNAVAIL 8
75 #define SBP_STATUS_FUNCTION_REJECTED 9
76 #define SBP_STATUS_LOGIN_ID_UNKNOWN 10
77 #define SBP_STATUS_DUMMY_ORB_COMPLETE 11
78 #define SBP_STATUS_REQUEST_ABORTED 12
79 #define SBP_STATUS_UNSPECIFIED_ERROR 0xff
81 #define AGENT_STATE_RESET 0
82 #define AGENT_STATE_ACTIVE 1
83 #define AGENT_STATE_SUSPENDED 2
84 #define AGENT_STATE_DEAD 3