162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * iSCSI User/Kernel Shares (Defines, Constants, Protocol definitions, etc) 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (C) 2005 Dmitry Yusupov 662306a36Sopenharmony_ci * Copyright (C) 2005 Alex Aizman 762306a36Sopenharmony_ci * maintained by open-iscsi@googlegroups.com 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef ISCSI_IF_H 1162306a36Sopenharmony_ci#define ISCSI_IF_H 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#include <scsi/iscsi_proto.h> 1462306a36Sopenharmony_ci#include <linux/in.h> 1562306a36Sopenharmony_ci#include <linux/in6.h> 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci#define ISCSI_NL_GRP_ISCSID 1 1862306a36Sopenharmony_ci#define ISCSI_NL_GRP_UIP 2 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#define UEVENT_BASE 10 2162306a36Sopenharmony_ci#define KEVENT_BASE 100 2262306a36Sopenharmony_ci#define ISCSI_ERR_BASE 1000 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_cienum iscsi_uevent_e { 2562306a36Sopenharmony_ci ISCSI_UEVENT_UNKNOWN = 0, 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci /* down events */ 2862306a36Sopenharmony_ci ISCSI_UEVENT_CREATE_SESSION = UEVENT_BASE + 1, 2962306a36Sopenharmony_ci ISCSI_UEVENT_DESTROY_SESSION = UEVENT_BASE + 2, 3062306a36Sopenharmony_ci ISCSI_UEVENT_CREATE_CONN = UEVENT_BASE + 3, 3162306a36Sopenharmony_ci ISCSI_UEVENT_DESTROY_CONN = UEVENT_BASE + 4, 3262306a36Sopenharmony_ci ISCSI_UEVENT_BIND_CONN = UEVENT_BASE + 5, 3362306a36Sopenharmony_ci ISCSI_UEVENT_SET_PARAM = UEVENT_BASE + 6, 3462306a36Sopenharmony_ci ISCSI_UEVENT_START_CONN = UEVENT_BASE + 7, 3562306a36Sopenharmony_ci ISCSI_UEVENT_STOP_CONN = UEVENT_BASE + 8, 3662306a36Sopenharmony_ci ISCSI_UEVENT_SEND_PDU = UEVENT_BASE + 9, 3762306a36Sopenharmony_ci ISCSI_UEVENT_GET_STATS = UEVENT_BASE + 10, 3862306a36Sopenharmony_ci ISCSI_UEVENT_GET_PARAM = UEVENT_BASE + 11, 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci ISCSI_UEVENT_TRANSPORT_EP_CONNECT = UEVENT_BASE + 12, 4162306a36Sopenharmony_ci ISCSI_UEVENT_TRANSPORT_EP_POLL = UEVENT_BASE + 13, 4262306a36Sopenharmony_ci ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT = UEVENT_BASE + 14, 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ci ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15, 4562306a36Sopenharmony_ci ISCSI_UEVENT_SET_HOST_PARAM = UEVENT_BASE + 16, 4662306a36Sopenharmony_ci ISCSI_UEVENT_UNBIND_SESSION = UEVENT_BASE + 17, 4762306a36Sopenharmony_ci ISCSI_UEVENT_CREATE_BOUND_SESSION = UEVENT_BASE + 18, 4862306a36Sopenharmony_ci ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, 5162306a36Sopenharmony_ci ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21, 5262306a36Sopenharmony_ci ISCSI_UEVENT_PING = UEVENT_BASE + 22, 5362306a36Sopenharmony_ci ISCSI_UEVENT_GET_CHAP = UEVENT_BASE + 23, 5462306a36Sopenharmony_ci ISCSI_UEVENT_DELETE_CHAP = UEVENT_BASE + 24, 5562306a36Sopenharmony_ci ISCSI_UEVENT_SET_FLASHNODE_PARAMS = UEVENT_BASE + 25, 5662306a36Sopenharmony_ci ISCSI_UEVENT_NEW_FLASHNODE = UEVENT_BASE + 26, 5762306a36Sopenharmony_ci ISCSI_UEVENT_DEL_FLASHNODE = UEVENT_BASE + 27, 5862306a36Sopenharmony_ci ISCSI_UEVENT_LOGIN_FLASHNODE = UEVENT_BASE + 28, 5962306a36Sopenharmony_ci ISCSI_UEVENT_LOGOUT_FLASHNODE = UEVENT_BASE + 29, 6062306a36Sopenharmony_ci ISCSI_UEVENT_LOGOUT_FLASHNODE_SID = UEVENT_BASE + 30, 6162306a36Sopenharmony_ci ISCSI_UEVENT_SET_CHAP = UEVENT_BASE + 31, 6262306a36Sopenharmony_ci ISCSI_UEVENT_GET_HOST_STATS = UEVENT_BASE + 32, 6362306a36Sopenharmony_ci ISCSI_UEVENT_DESTROY_SESSION_ASYNC = UEVENT_BASE + 33, 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci /* up events */ 6662306a36Sopenharmony_ci ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, 6762306a36Sopenharmony_ci ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2, 6862306a36Sopenharmony_ci ISCSI_KEVENT_IF_ERROR = KEVENT_BASE + 3, 6962306a36Sopenharmony_ci ISCSI_KEVENT_DESTROY_SESSION = KEVENT_BASE + 4, 7062306a36Sopenharmony_ci ISCSI_KEVENT_UNBIND_SESSION = KEVENT_BASE + 5, 7162306a36Sopenharmony_ci ISCSI_KEVENT_CREATE_SESSION = KEVENT_BASE + 6, 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ci ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, 7462306a36Sopenharmony_ci ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, 7562306a36Sopenharmony_ci ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9, 7662306a36Sopenharmony_ci ISCSI_KEVENT_HOST_EVENT = KEVENT_BASE + 10, 7762306a36Sopenharmony_ci ISCSI_KEVENT_PING_COMP = KEVENT_BASE + 11, 7862306a36Sopenharmony_ci}; 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_cienum iscsi_tgt_dscvr { 8162306a36Sopenharmony_ci ISCSI_TGT_DSCVR_SEND_TARGETS = 1, 8262306a36Sopenharmony_ci ISCSI_TGT_DSCVR_ISNS = 2, 8362306a36Sopenharmony_ci ISCSI_TGT_DSCVR_SLP = 3, 8462306a36Sopenharmony_ci}; 8562306a36Sopenharmony_ci 8662306a36Sopenharmony_cienum iscsi_host_event_code { 8762306a36Sopenharmony_ci ISCSI_EVENT_LINKUP = 1, 8862306a36Sopenharmony_ci ISCSI_EVENT_LINKDOWN, 8962306a36Sopenharmony_ci /* must always be last */ 9062306a36Sopenharmony_ci ISCSI_EVENT_MAX, 9162306a36Sopenharmony_ci}; 9262306a36Sopenharmony_ci 9362306a36Sopenharmony_cistruct iscsi_uevent { 9462306a36Sopenharmony_ci uint32_t type; /* k/u events type */ 9562306a36Sopenharmony_ci uint32_t iferror; /* carries interface or resource errors */ 9662306a36Sopenharmony_ci uint64_t transport_handle; 9762306a36Sopenharmony_ci 9862306a36Sopenharmony_ci union { 9962306a36Sopenharmony_ci /* messages u -> k */ 10062306a36Sopenharmony_ci struct msg_create_session { 10162306a36Sopenharmony_ci uint32_t initial_cmdsn; 10262306a36Sopenharmony_ci uint16_t cmds_max; 10362306a36Sopenharmony_ci uint16_t queue_depth; 10462306a36Sopenharmony_ci } c_session; 10562306a36Sopenharmony_ci struct msg_create_bound_session { 10662306a36Sopenharmony_ci uint64_t ep_handle; 10762306a36Sopenharmony_ci uint32_t initial_cmdsn; 10862306a36Sopenharmony_ci uint16_t cmds_max; 10962306a36Sopenharmony_ci uint16_t queue_depth; 11062306a36Sopenharmony_ci } c_bound_session; 11162306a36Sopenharmony_ci struct msg_destroy_session { 11262306a36Sopenharmony_ci uint32_t sid; 11362306a36Sopenharmony_ci } d_session; 11462306a36Sopenharmony_ci struct msg_create_conn { 11562306a36Sopenharmony_ci uint32_t sid; 11662306a36Sopenharmony_ci uint32_t cid; 11762306a36Sopenharmony_ci } c_conn; 11862306a36Sopenharmony_ci struct msg_bind_conn { 11962306a36Sopenharmony_ci uint32_t sid; 12062306a36Sopenharmony_ci uint32_t cid; 12162306a36Sopenharmony_ci uint64_t transport_eph; 12262306a36Sopenharmony_ci uint32_t is_leading; 12362306a36Sopenharmony_ci } b_conn; 12462306a36Sopenharmony_ci struct msg_destroy_conn { 12562306a36Sopenharmony_ci uint32_t sid; 12662306a36Sopenharmony_ci uint32_t cid; 12762306a36Sopenharmony_ci } d_conn; 12862306a36Sopenharmony_ci struct msg_send_pdu { 12962306a36Sopenharmony_ci uint32_t sid; 13062306a36Sopenharmony_ci uint32_t cid; 13162306a36Sopenharmony_ci uint32_t hdr_size; 13262306a36Sopenharmony_ci uint32_t data_size; 13362306a36Sopenharmony_ci } send_pdu; 13462306a36Sopenharmony_ci struct msg_set_param { 13562306a36Sopenharmony_ci uint32_t sid; 13662306a36Sopenharmony_ci uint32_t cid; 13762306a36Sopenharmony_ci uint32_t param; /* enum iscsi_param */ 13862306a36Sopenharmony_ci uint32_t len; 13962306a36Sopenharmony_ci } set_param; 14062306a36Sopenharmony_ci struct msg_start_conn { 14162306a36Sopenharmony_ci uint32_t sid; 14262306a36Sopenharmony_ci uint32_t cid; 14362306a36Sopenharmony_ci } start_conn; 14462306a36Sopenharmony_ci struct msg_stop_conn { 14562306a36Sopenharmony_ci uint32_t sid; 14662306a36Sopenharmony_ci uint32_t cid; 14762306a36Sopenharmony_ci uint64_t conn_handle; 14862306a36Sopenharmony_ci uint32_t flag; 14962306a36Sopenharmony_ci } stop_conn; 15062306a36Sopenharmony_ci struct msg_get_stats { 15162306a36Sopenharmony_ci uint32_t sid; 15262306a36Sopenharmony_ci uint32_t cid; 15362306a36Sopenharmony_ci } get_stats; 15462306a36Sopenharmony_ci struct msg_transport_connect { 15562306a36Sopenharmony_ci uint32_t non_blocking; 15662306a36Sopenharmony_ci } ep_connect; 15762306a36Sopenharmony_ci struct msg_transport_connect_through_host { 15862306a36Sopenharmony_ci uint32_t host_no; 15962306a36Sopenharmony_ci uint32_t non_blocking; 16062306a36Sopenharmony_ci } ep_connect_through_host; 16162306a36Sopenharmony_ci struct msg_transport_poll { 16262306a36Sopenharmony_ci uint64_t ep_handle; 16362306a36Sopenharmony_ci uint32_t timeout_ms; 16462306a36Sopenharmony_ci } ep_poll; 16562306a36Sopenharmony_ci struct msg_transport_disconnect { 16662306a36Sopenharmony_ci uint64_t ep_handle; 16762306a36Sopenharmony_ci } ep_disconnect; 16862306a36Sopenharmony_ci struct msg_tgt_dscvr { 16962306a36Sopenharmony_ci enum iscsi_tgt_dscvr type; 17062306a36Sopenharmony_ci uint32_t host_no; 17162306a36Sopenharmony_ci /* 17262306a36Sopenharmony_ci * enable = 1 to establish a new connection 17362306a36Sopenharmony_ci * with the server. enable = 0 to disconnect 17462306a36Sopenharmony_ci * from the server. Used primarily to switch 17562306a36Sopenharmony_ci * from one iSNS server to another. 17662306a36Sopenharmony_ci */ 17762306a36Sopenharmony_ci uint32_t enable; 17862306a36Sopenharmony_ci } tgt_dscvr; 17962306a36Sopenharmony_ci struct msg_set_host_param { 18062306a36Sopenharmony_ci uint32_t host_no; 18162306a36Sopenharmony_ci uint32_t param; /* enum iscsi_host_param */ 18262306a36Sopenharmony_ci uint32_t len; 18362306a36Sopenharmony_ci } set_host_param; 18462306a36Sopenharmony_ci struct msg_set_path { 18562306a36Sopenharmony_ci uint32_t host_no; 18662306a36Sopenharmony_ci } set_path; 18762306a36Sopenharmony_ci struct msg_set_iface_params { 18862306a36Sopenharmony_ci uint32_t host_no; 18962306a36Sopenharmony_ci uint32_t count; 19062306a36Sopenharmony_ci } set_iface_params; 19162306a36Sopenharmony_ci struct msg_iscsi_ping { 19262306a36Sopenharmony_ci uint32_t host_no; 19362306a36Sopenharmony_ci uint32_t iface_num; 19462306a36Sopenharmony_ci uint32_t iface_type; 19562306a36Sopenharmony_ci uint32_t payload_size; 19662306a36Sopenharmony_ci uint32_t pid; /* unique ping id associated 19762306a36Sopenharmony_ci with each ping request */ 19862306a36Sopenharmony_ci } iscsi_ping; 19962306a36Sopenharmony_ci struct msg_get_chap { 20062306a36Sopenharmony_ci uint32_t host_no; 20162306a36Sopenharmony_ci uint32_t num_entries; /* number of CHAP entries 20262306a36Sopenharmony_ci * on request, number of 20362306a36Sopenharmony_ci * valid CHAP entries on 20462306a36Sopenharmony_ci * response */ 20562306a36Sopenharmony_ci uint16_t chap_tbl_idx; 20662306a36Sopenharmony_ci } get_chap; 20762306a36Sopenharmony_ci struct msg_delete_chap { 20862306a36Sopenharmony_ci uint32_t host_no; 20962306a36Sopenharmony_ci uint16_t chap_tbl_idx; 21062306a36Sopenharmony_ci } delete_chap; 21162306a36Sopenharmony_ci struct msg_set_flashnode_param { 21262306a36Sopenharmony_ci uint32_t host_no; 21362306a36Sopenharmony_ci uint32_t flashnode_idx; 21462306a36Sopenharmony_ci uint32_t count; 21562306a36Sopenharmony_ci } set_flashnode; 21662306a36Sopenharmony_ci struct msg_new_flashnode { 21762306a36Sopenharmony_ci uint32_t host_no; 21862306a36Sopenharmony_ci uint32_t len; 21962306a36Sopenharmony_ci } new_flashnode; 22062306a36Sopenharmony_ci struct msg_del_flashnode { 22162306a36Sopenharmony_ci uint32_t host_no; 22262306a36Sopenharmony_ci uint32_t flashnode_idx; 22362306a36Sopenharmony_ci } del_flashnode; 22462306a36Sopenharmony_ci struct msg_login_flashnode { 22562306a36Sopenharmony_ci uint32_t host_no; 22662306a36Sopenharmony_ci uint32_t flashnode_idx; 22762306a36Sopenharmony_ci } login_flashnode; 22862306a36Sopenharmony_ci struct msg_logout_flashnode { 22962306a36Sopenharmony_ci uint32_t host_no; 23062306a36Sopenharmony_ci uint32_t flashnode_idx; 23162306a36Sopenharmony_ci } logout_flashnode; 23262306a36Sopenharmony_ci struct msg_logout_flashnode_sid { 23362306a36Sopenharmony_ci uint32_t host_no; 23462306a36Sopenharmony_ci uint32_t sid; 23562306a36Sopenharmony_ci } logout_flashnode_sid; 23662306a36Sopenharmony_ci struct msg_get_host_stats { 23762306a36Sopenharmony_ci uint32_t host_no; 23862306a36Sopenharmony_ci } get_host_stats; 23962306a36Sopenharmony_ci } u; 24062306a36Sopenharmony_ci union { 24162306a36Sopenharmony_ci /* messages k -> u */ 24262306a36Sopenharmony_ci int retcode; 24362306a36Sopenharmony_ci struct msg_create_session_ret { 24462306a36Sopenharmony_ci uint32_t sid; 24562306a36Sopenharmony_ci uint32_t host_no; 24662306a36Sopenharmony_ci } c_session_ret; 24762306a36Sopenharmony_ci struct msg_create_conn_ret { 24862306a36Sopenharmony_ci uint32_t sid; 24962306a36Sopenharmony_ci uint32_t cid; 25062306a36Sopenharmony_ci } c_conn_ret; 25162306a36Sopenharmony_ci struct msg_unbind_session { 25262306a36Sopenharmony_ci uint32_t sid; 25362306a36Sopenharmony_ci uint32_t host_no; 25462306a36Sopenharmony_ci } unbind_session; 25562306a36Sopenharmony_ci struct msg_recv_req { 25662306a36Sopenharmony_ci uint32_t sid; 25762306a36Sopenharmony_ci uint32_t cid; 25862306a36Sopenharmony_ci uint64_t recv_handle; 25962306a36Sopenharmony_ci } recv_req; 26062306a36Sopenharmony_ci struct msg_conn_login { 26162306a36Sopenharmony_ci uint32_t sid; 26262306a36Sopenharmony_ci uint32_t cid; 26362306a36Sopenharmony_ci uint32_t state; /* enum iscsi_conn_state */ 26462306a36Sopenharmony_ci } conn_login; 26562306a36Sopenharmony_ci struct msg_conn_error { 26662306a36Sopenharmony_ci uint32_t sid; 26762306a36Sopenharmony_ci uint32_t cid; 26862306a36Sopenharmony_ci uint32_t error; /* enum iscsi_err */ 26962306a36Sopenharmony_ci } connerror; 27062306a36Sopenharmony_ci struct msg_session_destroyed { 27162306a36Sopenharmony_ci uint32_t host_no; 27262306a36Sopenharmony_ci uint32_t sid; 27362306a36Sopenharmony_ci } d_session; 27462306a36Sopenharmony_ci struct msg_transport_connect_ret { 27562306a36Sopenharmony_ci uint64_t handle; 27662306a36Sopenharmony_ci } ep_connect_ret; 27762306a36Sopenharmony_ci struct msg_req_path { 27862306a36Sopenharmony_ci uint32_t host_no; 27962306a36Sopenharmony_ci } req_path; 28062306a36Sopenharmony_ci struct msg_notify_if_down { 28162306a36Sopenharmony_ci uint32_t host_no; 28262306a36Sopenharmony_ci } notify_if_down; 28362306a36Sopenharmony_ci struct msg_host_event { 28462306a36Sopenharmony_ci uint32_t host_no; 28562306a36Sopenharmony_ci uint32_t data_size; 28662306a36Sopenharmony_ci enum iscsi_host_event_code code; 28762306a36Sopenharmony_ci } host_event; 28862306a36Sopenharmony_ci struct msg_ping_comp { 28962306a36Sopenharmony_ci uint32_t host_no; 29062306a36Sopenharmony_ci uint32_t status; /* enum 29162306a36Sopenharmony_ci * iscsi_ping_status_code */ 29262306a36Sopenharmony_ci uint32_t pid; /* unique ping id associated 29362306a36Sopenharmony_ci with each ping request */ 29462306a36Sopenharmony_ci uint32_t data_size; 29562306a36Sopenharmony_ci } ping_comp; 29662306a36Sopenharmony_ci struct msg_new_flashnode_ret { 29762306a36Sopenharmony_ci uint32_t flashnode_idx; 29862306a36Sopenharmony_ci } new_flashnode_ret; 29962306a36Sopenharmony_ci } r; 30062306a36Sopenharmony_ci} __attribute__ ((aligned (sizeof(uint64_t)))); 30162306a36Sopenharmony_ci 30262306a36Sopenharmony_cienum iscsi_param_type { 30362306a36Sopenharmony_ci ISCSI_PARAM, /* iscsi_param (session, conn, target, LU) */ 30462306a36Sopenharmony_ci ISCSI_HOST_PARAM, /* iscsi_host_param */ 30562306a36Sopenharmony_ci ISCSI_NET_PARAM, /* iscsi_net_param */ 30662306a36Sopenharmony_ci ISCSI_FLASHNODE_PARAM, /* iscsi_flashnode_param */ 30762306a36Sopenharmony_ci ISCSI_CHAP_PARAM, /* iscsi_chap_param */ 30862306a36Sopenharmony_ci ISCSI_IFACE_PARAM, /* iscsi_iface_param */ 30962306a36Sopenharmony_ci}; 31062306a36Sopenharmony_ci 31162306a36Sopenharmony_ci/* structure for minimalist usecase */ 31262306a36Sopenharmony_cistruct iscsi_param_info { 31362306a36Sopenharmony_ci uint32_t len; /* Actual length of the param value */ 31462306a36Sopenharmony_ci uint16_t param; /* iscsi param */ 31562306a36Sopenharmony_ci uint8_t value[]; /* length sized value follows */ 31662306a36Sopenharmony_ci} __packed; 31762306a36Sopenharmony_ci 31862306a36Sopenharmony_cistruct iscsi_iface_param_info { 31962306a36Sopenharmony_ci uint32_t iface_num; /* iface number, 0 - n */ 32062306a36Sopenharmony_ci uint32_t len; /* Actual length of the param */ 32162306a36Sopenharmony_ci uint16_t param; /* iscsi param value */ 32262306a36Sopenharmony_ci uint8_t iface_type; /* IPv4 or IPv6 */ 32362306a36Sopenharmony_ci uint8_t param_type; /* iscsi_param_type */ 32462306a36Sopenharmony_ci uint8_t value[]; /* length sized value follows */ 32562306a36Sopenharmony_ci} __packed; 32662306a36Sopenharmony_ci 32762306a36Sopenharmony_ci/* 32862306a36Sopenharmony_ci * To keep the struct iscsi_uevent size the same for userspace code 32962306a36Sopenharmony_ci * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and 33062306a36Sopenharmony_ci * ISCSI_KEVENT_PATH_REQ is defined separately and comes after the 33162306a36Sopenharmony_ci * struct iscsi_uevent in the NETLINK_ISCSI message. 33262306a36Sopenharmony_ci */ 33362306a36Sopenharmony_cistruct iscsi_path { 33462306a36Sopenharmony_ci uint64_t handle; 33562306a36Sopenharmony_ci uint8_t mac_addr[6]; 33662306a36Sopenharmony_ci uint8_t mac_addr_old[6]; 33762306a36Sopenharmony_ci uint32_t ip_addr_len; /* 4 or 16 */ 33862306a36Sopenharmony_ci union { 33962306a36Sopenharmony_ci struct in_addr v4_addr; 34062306a36Sopenharmony_ci struct in6_addr v6_addr; 34162306a36Sopenharmony_ci } src; 34262306a36Sopenharmony_ci union { 34362306a36Sopenharmony_ci struct in_addr v4_addr; 34462306a36Sopenharmony_ci struct in6_addr v6_addr; 34562306a36Sopenharmony_ci } dst; 34662306a36Sopenharmony_ci uint16_t vlan_id; 34762306a36Sopenharmony_ci uint16_t pmtu; 34862306a36Sopenharmony_ci} __attribute__ ((aligned (sizeof(uint64_t)))); 34962306a36Sopenharmony_ci 35062306a36Sopenharmony_ci/* iscsi iface enabled/disabled setting */ 35162306a36Sopenharmony_ci#define ISCSI_IFACE_DISABLE 0x01 35262306a36Sopenharmony_ci#define ISCSI_IFACE_ENABLE 0x02 35362306a36Sopenharmony_ci 35462306a36Sopenharmony_ci/* ipv4 bootproto */ 35562306a36Sopenharmony_ci#define ISCSI_BOOTPROTO_STATIC 0x01 35662306a36Sopenharmony_ci#define ISCSI_BOOTPROTO_DHCP 0x02 35762306a36Sopenharmony_ci 35862306a36Sopenharmony_ci/* ipv6 addr autoconfig type */ 35962306a36Sopenharmony_ci#define ISCSI_IPV6_AUTOCFG_DISABLE 0x01 36062306a36Sopenharmony_ci#define ISCSI_IPV6_AUTOCFG_ND_ENABLE 0x02 36162306a36Sopenharmony_ci#define ISCSI_IPV6_AUTOCFG_DHCPV6_ENABLE 0x03 36262306a36Sopenharmony_ci 36362306a36Sopenharmony_ci/* ipv6 link local addr type */ 36462306a36Sopenharmony_ci#define ISCSI_IPV6_LINKLOCAL_AUTOCFG_ENABLE 0x01 36562306a36Sopenharmony_ci#define ISCSI_IPV6_LINKLOCAL_AUTOCFG_DISABLE 0x02 36662306a36Sopenharmony_ci 36762306a36Sopenharmony_ci/* ipv6 router addr type */ 36862306a36Sopenharmony_ci#define ISCSI_IPV6_ROUTER_AUTOCFG_ENABLE 0x01 36962306a36Sopenharmony_ci#define ISCSI_IPV6_ROUTER_AUTOCFG_DISABLE 0x02 37062306a36Sopenharmony_ci 37162306a36Sopenharmony_ci#define ISCSI_IFACE_TYPE_IPV4 0x01 37262306a36Sopenharmony_ci#define ISCSI_IFACE_TYPE_IPV6 0x02 37362306a36Sopenharmony_ci 37462306a36Sopenharmony_ci#define ISCSI_MAX_VLAN_ID 4095 37562306a36Sopenharmony_ci#define ISCSI_MAX_VLAN_PRIORITY 7 37662306a36Sopenharmony_ci 37762306a36Sopenharmony_ci/* iscsi vlan enable/disabled setting */ 37862306a36Sopenharmony_ci#define ISCSI_VLAN_DISABLE 0x01 37962306a36Sopenharmony_ci#define ISCSI_VLAN_ENABLE 0x02 38062306a36Sopenharmony_ci 38162306a36Sopenharmony_ci/* iscsi generic enable/disabled setting for various features */ 38262306a36Sopenharmony_ci#define ISCSI_NET_PARAM_DISABLE 0x01 38362306a36Sopenharmony_ci#define ISCSI_NET_PARAM_ENABLE 0x02 38462306a36Sopenharmony_ci 38562306a36Sopenharmony_ci/* iSCSI network params */ 38662306a36Sopenharmony_cienum iscsi_net_param { 38762306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_ADDR = 1, 38862306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_SUBNET, 38962306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_GW, 39062306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_BOOTPROTO, 39162306a36Sopenharmony_ci ISCSI_NET_PARAM_MAC, 39262306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_LINKLOCAL, 39362306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_ADDR, 39462306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_ROUTER, 39562306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG, 39662306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG, 39762306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG, 39862306a36Sopenharmony_ci ISCSI_NET_PARAM_IFACE_ENABLE, 39962306a36Sopenharmony_ci ISCSI_NET_PARAM_VLAN_ID, 40062306a36Sopenharmony_ci ISCSI_NET_PARAM_VLAN_PRIORITY, 40162306a36Sopenharmony_ci ISCSI_NET_PARAM_VLAN_ENABLED, 40262306a36Sopenharmony_ci ISCSI_NET_PARAM_VLAN_TAG, 40362306a36Sopenharmony_ci ISCSI_NET_PARAM_IFACE_TYPE, 40462306a36Sopenharmony_ci ISCSI_NET_PARAM_IFACE_NAME, 40562306a36Sopenharmony_ci ISCSI_NET_PARAM_MTU, 40662306a36Sopenharmony_ci ISCSI_NET_PARAM_PORT, 40762306a36Sopenharmony_ci ISCSI_NET_PARAM_IPADDR_STATE, 40862306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_LINKLOCAL_STATE, 40962306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_ROUTER_STATE, 41062306a36Sopenharmony_ci ISCSI_NET_PARAM_DELAYED_ACK_EN, 41162306a36Sopenharmony_ci ISCSI_NET_PARAM_TCP_NAGLE_DISABLE, 41262306a36Sopenharmony_ci ISCSI_NET_PARAM_TCP_WSF_DISABLE, 41362306a36Sopenharmony_ci ISCSI_NET_PARAM_TCP_WSF, 41462306a36Sopenharmony_ci ISCSI_NET_PARAM_TCP_TIMER_SCALE, 41562306a36Sopenharmony_ci ISCSI_NET_PARAM_TCP_TIMESTAMP_EN, 41662306a36Sopenharmony_ci ISCSI_NET_PARAM_CACHE_ID, 41762306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN, 41862306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN, 41962306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_TOS_EN, 42062306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_TOS, 42162306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN, 42262306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN, 42362306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID, 42462306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN, 42562306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN, 42662306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID, 42762306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN, 42862306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE, 42962306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN, 43062306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV4_TTL, 43162306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN, 43262306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_MLD_EN, 43362306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_FLOW_LABEL, 43462306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS, 43562306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_HOP_LIMIT, 43662306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO, 43762306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME, 43862306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_ND_STALE_TMO, 43962306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT, 44062306a36Sopenharmony_ci ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU, 44162306a36Sopenharmony_ci ISCSI_NET_PARAM_REDIRECT_EN, 44262306a36Sopenharmony_ci}; 44362306a36Sopenharmony_ci 44462306a36Sopenharmony_cienum iscsi_ipaddress_state { 44562306a36Sopenharmony_ci ISCSI_IPDDRESS_STATE_UNCONFIGURED, 44662306a36Sopenharmony_ci ISCSI_IPDDRESS_STATE_ACQUIRING, 44762306a36Sopenharmony_ci ISCSI_IPDDRESS_STATE_TENTATIVE, 44862306a36Sopenharmony_ci ISCSI_IPDDRESS_STATE_VALID, 44962306a36Sopenharmony_ci ISCSI_IPDDRESS_STATE_DISABLING, 45062306a36Sopenharmony_ci ISCSI_IPDDRESS_STATE_INVALID, 45162306a36Sopenharmony_ci ISCSI_IPDDRESS_STATE_DEPRECATED, 45262306a36Sopenharmony_ci}; 45362306a36Sopenharmony_ci 45462306a36Sopenharmony_cienum iscsi_router_state { 45562306a36Sopenharmony_ci ISCSI_ROUTER_STATE_UNKNOWN, 45662306a36Sopenharmony_ci ISCSI_ROUTER_STATE_ADVERTISED, 45762306a36Sopenharmony_ci ISCSI_ROUTER_STATE_MANUAL, 45862306a36Sopenharmony_ci ISCSI_ROUTER_STATE_STALE, 45962306a36Sopenharmony_ci}; 46062306a36Sopenharmony_ci 46162306a36Sopenharmony_ci/* iSCSI specific settings params for iface */ 46262306a36Sopenharmony_cienum iscsi_iface_param { 46362306a36Sopenharmony_ci ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO, 46462306a36Sopenharmony_ci ISCSI_IFACE_PARAM_HDRDGST_EN, 46562306a36Sopenharmony_ci ISCSI_IFACE_PARAM_DATADGST_EN, 46662306a36Sopenharmony_ci ISCSI_IFACE_PARAM_IMM_DATA_EN, 46762306a36Sopenharmony_ci ISCSI_IFACE_PARAM_INITIAL_R2T_EN, 46862306a36Sopenharmony_ci ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN, 46962306a36Sopenharmony_ci ISCSI_IFACE_PARAM_PDU_INORDER_EN, 47062306a36Sopenharmony_ci ISCSI_IFACE_PARAM_ERL, 47162306a36Sopenharmony_ci ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH, 47262306a36Sopenharmony_ci ISCSI_IFACE_PARAM_FIRST_BURST, 47362306a36Sopenharmony_ci ISCSI_IFACE_PARAM_MAX_R2T, 47462306a36Sopenharmony_ci ISCSI_IFACE_PARAM_MAX_BURST, 47562306a36Sopenharmony_ci ISCSI_IFACE_PARAM_CHAP_AUTH_EN, 47662306a36Sopenharmony_ci ISCSI_IFACE_PARAM_BIDI_CHAP_EN, 47762306a36Sopenharmony_ci ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL, 47862306a36Sopenharmony_ci ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN, 47962306a36Sopenharmony_ci ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN, 48062306a36Sopenharmony_ci ISCSI_IFACE_PARAM_INITIATOR_NAME, 48162306a36Sopenharmony_ci}; 48262306a36Sopenharmony_ci 48362306a36Sopenharmony_cienum iscsi_conn_state { 48462306a36Sopenharmony_ci ISCSI_CONN_STATE_FREE, 48562306a36Sopenharmony_ci ISCSI_CONN_STATE_XPT_WAIT, 48662306a36Sopenharmony_ci ISCSI_CONN_STATE_IN_LOGIN, 48762306a36Sopenharmony_ci ISCSI_CONN_STATE_LOGGED_IN, 48862306a36Sopenharmony_ci ISCSI_CONN_STATE_IN_LOGOUT, 48962306a36Sopenharmony_ci ISCSI_CONN_STATE_LOGOUT_REQUESTED, 49062306a36Sopenharmony_ci ISCSI_CONN_STATE_CLEANUP_WAIT, 49162306a36Sopenharmony_ci}; 49262306a36Sopenharmony_ci 49362306a36Sopenharmony_ci/* 49462306a36Sopenharmony_ci * Common error codes 49562306a36Sopenharmony_ci */ 49662306a36Sopenharmony_cienum iscsi_err { 49762306a36Sopenharmony_ci ISCSI_OK = 0, 49862306a36Sopenharmony_ci 49962306a36Sopenharmony_ci ISCSI_ERR_DATASN = ISCSI_ERR_BASE + 1, 50062306a36Sopenharmony_ci ISCSI_ERR_DATA_OFFSET = ISCSI_ERR_BASE + 2, 50162306a36Sopenharmony_ci ISCSI_ERR_MAX_CMDSN = ISCSI_ERR_BASE + 3, 50262306a36Sopenharmony_ci ISCSI_ERR_EXP_CMDSN = ISCSI_ERR_BASE + 4, 50362306a36Sopenharmony_ci ISCSI_ERR_BAD_OPCODE = ISCSI_ERR_BASE + 5, 50462306a36Sopenharmony_ci ISCSI_ERR_DATALEN = ISCSI_ERR_BASE + 6, 50562306a36Sopenharmony_ci ISCSI_ERR_AHSLEN = ISCSI_ERR_BASE + 7, 50662306a36Sopenharmony_ci ISCSI_ERR_PROTO = ISCSI_ERR_BASE + 8, 50762306a36Sopenharmony_ci ISCSI_ERR_LUN = ISCSI_ERR_BASE + 9, 50862306a36Sopenharmony_ci ISCSI_ERR_BAD_ITT = ISCSI_ERR_BASE + 10, 50962306a36Sopenharmony_ci ISCSI_ERR_CONN_FAILED = ISCSI_ERR_BASE + 11, 51062306a36Sopenharmony_ci ISCSI_ERR_R2TSN = ISCSI_ERR_BASE + 12, 51162306a36Sopenharmony_ci ISCSI_ERR_SESSION_FAILED = ISCSI_ERR_BASE + 13, 51262306a36Sopenharmony_ci ISCSI_ERR_HDR_DGST = ISCSI_ERR_BASE + 14, 51362306a36Sopenharmony_ci ISCSI_ERR_DATA_DGST = ISCSI_ERR_BASE + 15, 51462306a36Sopenharmony_ci ISCSI_ERR_PARAM_NOT_FOUND = ISCSI_ERR_BASE + 16, 51562306a36Sopenharmony_ci ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, 51662306a36Sopenharmony_ci ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, 51762306a36Sopenharmony_ci ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, 51862306a36Sopenharmony_ci ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, 51962306a36Sopenharmony_ci ISCSI_ERR_SCSI_EH_SESSION_RST = ISCSI_ERR_BASE + 21, 52062306a36Sopenharmony_ci ISCSI_ERR_NOP_TIMEDOUT = ISCSI_ERR_BASE + 22, 52162306a36Sopenharmony_ci}; 52262306a36Sopenharmony_ci 52362306a36Sopenharmony_ci/* 52462306a36Sopenharmony_ci * iSCSI Parameters (RFC3720) 52562306a36Sopenharmony_ci */ 52662306a36Sopenharmony_cienum iscsi_param { 52762306a36Sopenharmony_ci /* passed in using netlink set param */ 52862306a36Sopenharmony_ci ISCSI_PARAM_MAX_RECV_DLENGTH, 52962306a36Sopenharmony_ci ISCSI_PARAM_MAX_XMIT_DLENGTH, 53062306a36Sopenharmony_ci ISCSI_PARAM_HDRDGST_EN, 53162306a36Sopenharmony_ci ISCSI_PARAM_DATADGST_EN, 53262306a36Sopenharmony_ci ISCSI_PARAM_INITIAL_R2T_EN, 53362306a36Sopenharmony_ci ISCSI_PARAM_MAX_R2T, 53462306a36Sopenharmony_ci ISCSI_PARAM_IMM_DATA_EN, 53562306a36Sopenharmony_ci ISCSI_PARAM_FIRST_BURST, 53662306a36Sopenharmony_ci ISCSI_PARAM_MAX_BURST, 53762306a36Sopenharmony_ci ISCSI_PARAM_PDU_INORDER_EN, 53862306a36Sopenharmony_ci ISCSI_PARAM_DATASEQ_INORDER_EN, 53962306a36Sopenharmony_ci ISCSI_PARAM_ERL, 54062306a36Sopenharmony_ci ISCSI_PARAM_IFMARKER_EN, 54162306a36Sopenharmony_ci ISCSI_PARAM_OFMARKER_EN, 54262306a36Sopenharmony_ci ISCSI_PARAM_EXP_STATSN, 54362306a36Sopenharmony_ci ISCSI_PARAM_TARGET_NAME, 54462306a36Sopenharmony_ci ISCSI_PARAM_TPGT, 54562306a36Sopenharmony_ci ISCSI_PARAM_PERSISTENT_ADDRESS, 54662306a36Sopenharmony_ci ISCSI_PARAM_PERSISTENT_PORT, 54762306a36Sopenharmony_ci ISCSI_PARAM_SESS_RECOVERY_TMO, 54862306a36Sopenharmony_ci 54962306a36Sopenharmony_ci /* passed in through bind conn using transport_fd */ 55062306a36Sopenharmony_ci ISCSI_PARAM_CONN_PORT, 55162306a36Sopenharmony_ci ISCSI_PARAM_CONN_ADDRESS, 55262306a36Sopenharmony_ci 55362306a36Sopenharmony_ci ISCSI_PARAM_USERNAME, 55462306a36Sopenharmony_ci ISCSI_PARAM_USERNAME_IN, 55562306a36Sopenharmony_ci ISCSI_PARAM_PASSWORD, 55662306a36Sopenharmony_ci ISCSI_PARAM_PASSWORD_IN, 55762306a36Sopenharmony_ci 55862306a36Sopenharmony_ci ISCSI_PARAM_FAST_ABORT, 55962306a36Sopenharmony_ci ISCSI_PARAM_ABORT_TMO, 56062306a36Sopenharmony_ci ISCSI_PARAM_LU_RESET_TMO, 56162306a36Sopenharmony_ci ISCSI_PARAM_HOST_RESET_TMO, 56262306a36Sopenharmony_ci 56362306a36Sopenharmony_ci ISCSI_PARAM_PING_TMO, 56462306a36Sopenharmony_ci ISCSI_PARAM_RECV_TMO, 56562306a36Sopenharmony_ci 56662306a36Sopenharmony_ci ISCSI_PARAM_IFACE_NAME, 56762306a36Sopenharmony_ci ISCSI_PARAM_ISID, 56862306a36Sopenharmony_ci ISCSI_PARAM_INITIATOR_NAME, 56962306a36Sopenharmony_ci 57062306a36Sopenharmony_ci ISCSI_PARAM_TGT_RESET_TMO, 57162306a36Sopenharmony_ci ISCSI_PARAM_TARGET_ALIAS, 57262306a36Sopenharmony_ci 57362306a36Sopenharmony_ci ISCSI_PARAM_CHAP_IN_IDX, 57462306a36Sopenharmony_ci ISCSI_PARAM_CHAP_OUT_IDX, 57562306a36Sopenharmony_ci 57662306a36Sopenharmony_ci ISCSI_PARAM_BOOT_ROOT, 57762306a36Sopenharmony_ci ISCSI_PARAM_BOOT_NIC, 57862306a36Sopenharmony_ci ISCSI_PARAM_BOOT_TARGET, 57962306a36Sopenharmony_ci 58062306a36Sopenharmony_ci ISCSI_PARAM_AUTO_SND_TGT_DISABLE, 58162306a36Sopenharmony_ci ISCSI_PARAM_DISCOVERY_SESS, 58262306a36Sopenharmony_ci ISCSI_PARAM_PORTAL_TYPE, 58362306a36Sopenharmony_ci ISCSI_PARAM_CHAP_AUTH_EN, 58462306a36Sopenharmony_ci ISCSI_PARAM_DISCOVERY_LOGOUT_EN, 58562306a36Sopenharmony_ci ISCSI_PARAM_BIDI_CHAP_EN, 58662306a36Sopenharmony_ci ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL, 58762306a36Sopenharmony_ci 58862306a36Sopenharmony_ci ISCSI_PARAM_DEF_TIME2WAIT, 58962306a36Sopenharmony_ci ISCSI_PARAM_DEF_TIME2RETAIN, 59062306a36Sopenharmony_ci ISCSI_PARAM_MAX_SEGMENT_SIZE, 59162306a36Sopenharmony_ci ISCSI_PARAM_STATSN, 59262306a36Sopenharmony_ci ISCSI_PARAM_KEEPALIVE_TMO, 59362306a36Sopenharmony_ci ISCSI_PARAM_LOCAL_PORT, 59462306a36Sopenharmony_ci ISCSI_PARAM_TSID, 59562306a36Sopenharmony_ci ISCSI_PARAM_DEF_TASKMGMT_TMO, 59662306a36Sopenharmony_ci 59762306a36Sopenharmony_ci ISCSI_PARAM_TCP_TIMESTAMP_STAT, 59862306a36Sopenharmony_ci ISCSI_PARAM_TCP_WSF_DISABLE, 59962306a36Sopenharmony_ci ISCSI_PARAM_TCP_NAGLE_DISABLE, 60062306a36Sopenharmony_ci ISCSI_PARAM_TCP_TIMER_SCALE, 60162306a36Sopenharmony_ci ISCSI_PARAM_TCP_TIMESTAMP_EN, 60262306a36Sopenharmony_ci ISCSI_PARAM_TCP_XMIT_WSF, 60362306a36Sopenharmony_ci ISCSI_PARAM_TCP_RECV_WSF, 60462306a36Sopenharmony_ci ISCSI_PARAM_IP_FRAGMENT_DISABLE, 60562306a36Sopenharmony_ci ISCSI_PARAM_IPV4_TOS, 60662306a36Sopenharmony_ci ISCSI_PARAM_IPV6_TC, 60762306a36Sopenharmony_ci ISCSI_PARAM_IPV6_FLOW_LABEL, 60862306a36Sopenharmony_ci ISCSI_PARAM_IS_FW_ASSIGNED_IPV6, 60962306a36Sopenharmony_ci 61062306a36Sopenharmony_ci ISCSI_PARAM_DISCOVERY_PARENT_IDX, 61162306a36Sopenharmony_ci ISCSI_PARAM_DISCOVERY_PARENT_TYPE, 61262306a36Sopenharmony_ci ISCSI_PARAM_LOCAL_IPADDR, 61362306a36Sopenharmony_ci /* must always be last */ 61462306a36Sopenharmony_ci ISCSI_PARAM_MAX, 61562306a36Sopenharmony_ci}; 61662306a36Sopenharmony_ci 61762306a36Sopenharmony_ci/* iSCSI HBA params */ 61862306a36Sopenharmony_cienum iscsi_host_param { 61962306a36Sopenharmony_ci ISCSI_HOST_PARAM_HWADDRESS, 62062306a36Sopenharmony_ci ISCSI_HOST_PARAM_INITIATOR_NAME, 62162306a36Sopenharmony_ci ISCSI_HOST_PARAM_NETDEV_NAME, 62262306a36Sopenharmony_ci ISCSI_HOST_PARAM_IPADDRESS, 62362306a36Sopenharmony_ci ISCSI_HOST_PARAM_PORT_STATE, 62462306a36Sopenharmony_ci ISCSI_HOST_PARAM_PORT_SPEED, 62562306a36Sopenharmony_ci ISCSI_HOST_PARAM_MAX, 62662306a36Sopenharmony_ci}; 62762306a36Sopenharmony_ci 62862306a36Sopenharmony_ci/* portal type */ 62962306a36Sopenharmony_ci#define PORTAL_TYPE_IPV4 "ipv4" 63062306a36Sopenharmony_ci#define PORTAL_TYPE_IPV6 "ipv6" 63162306a36Sopenharmony_ci 63262306a36Sopenharmony_ci/* iSCSI Flash Target params */ 63362306a36Sopenharmony_cienum iscsi_flashnode_param { 63462306a36Sopenharmony_ci ISCSI_FLASHNODE_IS_FW_ASSIGNED_IPV6, 63562306a36Sopenharmony_ci ISCSI_FLASHNODE_PORTAL_TYPE, 63662306a36Sopenharmony_ci ISCSI_FLASHNODE_AUTO_SND_TGT_DISABLE, 63762306a36Sopenharmony_ci ISCSI_FLASHNODE_DISCOVERY_SESS, 63862306a36Sopenharmony_ci ISCSI_FLASHNODE_ENTRY_EN, 63962306a36Sopenharmony_ci ISCSI_FLASHNODE_HDR_DGST_EN, 64062306a36Sopenharmony_ci ISCSI_FLASHNODE_DATA_DGST_EN, 64162306a36Sopenharmony_ci ISCSI_FLASHNODE_IMM_DATA_EN, 64262306a36Sopenharmony_ci ISCSI_FLASHNODE_INITIAL_R2T_EN, 64362306a36Sopenharmony_ci ISCSI_FLASHNODE_DATASEQ_INORDER, 64462306a36Sopenharmony_ci ISCSI_FLASHNODE_PDU_INORDER, 64562306a36Sopenharmony_ci ISCSI_FLASHNODE_CHAP_AUTH_EN, 64662306a36Sopenharmony_ci ISCSI_FLASHNODE_SNACK_REQ_EN, 64762306a36Sopenharmony_ci ISCSI_FLASHNODE_DISCOVERY_LOGOUT_EN, 64862306a36Sopenharmony_ci ISCSI_FLASHNODE_BIDI_CHAP_EN, 64962306a36Sopenharmony_ci /* make authentication for discovery sessions optional */ 65062306a36Sopenharmony_ci ISCSI_FLASHNODE_DISCOVERY_AUTH_OPTIONAL, 65162306a36Sopenharmony_ci ISCSI_FLASHNODE_ERL, 65262306a36Sopenharmony_ci ISCSI_FLASHNODE_TCP_TIMESTAMP_STAT, 65362306a36Sopenharmony_ci ISCSI_FLASHNODE_TCP_NAGLE_DISABLE, 65462306a36Sopenharmony_ci ISCSI_FLASHNODE_TCP_WSF_DISABLE, 65562306a36Sopenharmony_ci ISCSI_FLASHNODE_TCP_TIMER_SCALE, 65662306a36Sopenharmony_ci ISCSI_FLASHNODE_TCP_TIMESTAMP_EN, 65762306a36Sopenharmony_ci ISCSI_FLASHNODE_IP_FRAG_DISABLE, 65862306a36Sopenharmony_ci ISCSI_FLASHNODE_MAX_RECV_DLENGTH, 65962306a36Sopenharmony_ci ISCSI_FLASHNODE_MAX_XMIT_DLENGTH, 66062306a36Sopenharmony_ci ISCSI_FLASHNODE_FIRST_BURST, 66162306a36Sopenharmony_ci ISCSI_FLASHNODE_DEF_TIME2WAIT, 66262306a36Sopenharmony_ci ISCSI_FLASHNODE_DEF_TIME2RETAIN, 66362306a36Sopenharmony_ci ISCSI_FLASHNODE_MAX_R2T, 66462306a36Sopenharmony_ci ISCSI_FLASHNODE_KEEPALIVE_TMO, 66562306a36Sopenharmony_ci ISCSI_FLASHNODE_ISID, 66662306a36Sopenharmony_ci ISCSI_FLASHNODE_TSID, 66762306a36Sopenharmony_ci ISCSI_FLASHNODE_PORT, 66862306a36Sopenharmony_ci ISCSI_FLASHNODE_MAX_BURST, 66962306a36Sopenharmony_ci ISCSI_FLASHNODE_DEF_TASKMGMT_TMO, 67062306a36Sopenharmony_ci ISCSI_FLASHNODE_IPADDR, 67162306a36Sopenharmony_ci ISCSI_FLASHNODE_ALIAS, 67262306a36Sopenharmony_ci ISCSI_FLASHNODE_REDIRECT_IPADDR, 67362306a36Sopenharmony_ci ISCSI_FLASHNODE_MAX_SEGMENT_SIZE, 67462306a36Sopenharmony_ci ISCSI_FLASHNODE_LOCAL_PORT, 67562306a36Sopenharmony_ci ISCSI_FLASHNODE_IPV4_TOS, 67662306a36Sopenharmony_ci ISCSI_FLASHNODE_IPV6_TC, 67762306a36Sopenharmony_ci ISCSI_FLASHNODE_IPV6_FLOW_LABEL, 67862306a36Sopenharmony_ci ISCSI_FLASHNODE_NAME, 67962306a36Sopenharmony_ci ISCSI_FLASHNODE_TPGT, 68062306a36Sopenharmony_ci ISCSI_FLASHNODE_LINK_LOCAL_IPV6, 68162306a36Sopenharmony_ci ISCSI_FLASHNODE_DISCOVERY_PARENT_IDX, 68262306a36Sopenharmony_ci ISCSI_FLASHNODE_DISCOVERY_PARENT_TYPE, 68362306a36Sopenharmony_ci ISCSI_FLASHNODE_TCP_XMIT_WSF, 68462306a36Sopenharmony_ci ISCSI_FLASHNODE_TCP_RECV_WSF, 68562306a36Sopenharmony_ci ISCSI_FLASHNODE_CHAP_IN_IDX, 68662306a36Sopenharmony_ci ISCSI_FLASHNODE_CHAP_OUT_IDX, 68762306a36Sopenharmony_ci ISCSI_FLASHNODE_USERNAME, 68862306a36Sopenharmony_ci ISCSI_FLASHNODE_USERNAME_IN, 68962306a36Sopenharmony_ci ISCSI_FLASHNODE_PASSWORD, 69062306a36Sopenharmony_ci ISCSI_FLASHNODE_PASSWORD_IN, 69162306a36Sopenharmony_ci ISCSI_FLASHNODE_STATSN, 69262306a36Sopenharmony_ci ISCSI_FLASHNODE_EXP_STATSN, 69362306a36Sopenharmony_ci ISCSI_FLASHNODE_IS_BOOT_TGT, 69462306a36Sopenharmony_ci 69562306a36Sopenharmony_ci ISCSI_FLASHNODE_MAX, 69662306a36Sopenharmony_ci}; 69762306a36Sopenharmony_ci 69862306a36Sopenharmony_cistruct iscsi_flashnode_param_info { 69962306a36Sopenharmony_ci uint32_t len; /* Actual length of the param */ 70062306a36Sopenharmony_ci uint16_t param; /* iscsi param value */ 70162306a36Sopenharmony_ci uint8_t value[]; /* length sized value follows */ 70262306a36Sopenharmony_ci} __packed; 70362306a36Sopenharmony_ci 70462306a36Sopenharmony_cienum iscsi_discovery_parent_type { 70562306a36Sopenharmony_ci ISCSI_DISC_PARENT_UNKNOWN = 0x1, 70662306a36Sopenharmony_ci ISCSI_DISC_PARENT_SENDTGT = 0x2, 70762306a36Sopenharmony_ci ISCSI_DISC_PARENT_ISNS = 0x3, 70862306a36Sopenharmony_ci}; 70962306a36Sopenharmony_ci 71062306a36Sopenharmony_ci/* iSCSI port Speed */ 71162306a36Sopenharmony_cienum iscsi_port_speed { 71262306a36Sopenharmony_ci ISCSI_PORT_SPEED_UNKNOWN = 0x1, 71362306a36Sopenharmony_ci ISCSI_PORT_SPEED_10MBPS = 0x2, 71462306a36Sopenharmony_ci ISCSI_PORT_SPEED_100MBPS = 0x4, 71562306a36Sopenharmony_ci ISCSI_PORT_SPEED_1GBPS = 0x8, 71662306a36Sopenharmony_ci ISCSI_PORT_SPEED_10GBPS = 0x10, 71762306a36Sopenharmony_ci ISCSI_PORT_SPEED_25GBPS = 0x20, 71862306a36Sopenharmony_ci ISCSI_PORT_SPEED_40GBPS = 0x40, 71962306a36Sopenharmony_ci}; 72062306a36Sopenharmony_ci 72162306a36Sopenharmony_ci/* iSCSI port state */ 72262306a36Sopenharmony_cienum iscsi_port_state { 72362306a36Sopenharmony_ci ISCSI_PORT_STATE_DOWN = 0x1, 72462306a36Sopenharmony_ci ISCSI_PORT_STATE_UP = 0x2, 72562306a36Sopenharmony_ci}; 72662306a36Sopenharmony_ci 72762306a36Sopenharmony_ci/* iSCSI PING status/error code */ 72862306a36Sopenharmony_cienum iscsi_ping_status_code { 72962306a36Sopenharmony_ci ISCSI_PING_SUCCESS = 0, 73062306a36Sopenharmony_ci ISCSI_PING_FW_DISABLED = 0x1, 73162306a36Sopenharmony_ci ISCSI_PING_IPADDR_INVALID = 0x2, 73262306a36Sopenharmony_ci ISCSI_PING_LINKLOCAL_IPV6_ADDR_INVALID = 0x3, 73362306a36Sopenharmony_ci ISCSI_PING_TIMEOUT = 0x4, 73462306a36Sopenharmony_ci ISCSI_PING_INVALID_DEST_ADDR = 0x5, 73562306a36Sopenharmony_ci ISCSI_PING_OVERSIZE_PACKET = 0x6, 73662306a36Sopenharmony_ci ISCSI_PING_ICMP_ERROR = 0x7, 73762306a36Sopenharmony_ci ISCSI_PING_MAX_REQ_EXCEEDED = 0x8, 73862306a36Sopenharmony_ci ISCSI_PING_NO_ARP_RECEIVED = 0x9, 73962306a36Sopenharmony_ci}; 74062306a36Sopenharmony_ci 74162306a36Sopenharmony_ci#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) 74262306a36Sopenharmony_ci#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) 74362306a36Sopenharmony_ci 74462306a36Sopenharmony_ci/* 74562306a36Sopenharmony_ci * These flags presents iSCSI Data-Path capabilities. 74662306a36Sopenharmony_ci */ 74762306a36Sopenharmony_ci#define CAP_RECOVERY_L0 0x1 74862306a36Sopenharmony_ci#define CAP_RECOVERY_L1 0x2 74962306a36Sopenharmony_ci#define CAP_RECOVERY_L2 0x4 75062306a36Sopenharmony_ci#define CAP_MULTI_R2T 0x8 75162306a36Sopenharmony_ci#define CAP_HDRDGST 0x10 75262306a36Sopenharmony_ci#define CAP_DATADGST 0x20 75362306a36Sopenharmony_ci#define CAP_MULTI_CONN 0x40 75462306a36Sopenharmony_ci#define CAP_TEXT_NEGO 0x80 75562306a36Sopenharmony_ci#define CAP_MARKERS 0x100 75662306a36Sopenharmony_ci#define CAP_FW_DB 0x200 75762306a36Sopenharmony_ci#define CAP_SENDTARGETS_OFFLOAD 0x400 /* offload discovery process */ 75862306a36Sopenharmony_ci#define CAP_DATA_PATH_OFFLOAD 0x800 /* offload entire IO path */ 75962306a36Sopenharmony_ci#define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */ 76062306a36Sopenharmony_ci#define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal, 76162306a36Sopenharmony_ci and verification */ 76262306a36Sopenharmony_ci#define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */ 76362306a36Sopenharmony_ci 76462306a36Sopenharmony_ci/* 76562306a36Sopenharmony_ci * These flags describes reason of stop_conn() call 76662306a36Sopenharmony_ci */ 76762306a36Sopenharmony_ci#define STOP_CONN_TERM 0x1 76862306a36Sopenharmony_ci#define STOP_CONN_SUSPEND 0x2 76962306a36Sopenharmony_ci#define STOP_CONN_RECOVER 0x3 77062306a36Sopenharmony_ci 77162306a36Sopenharmony_ci#define ISCSI_STATS_CUSTOM_MAX 32 77262306a36Sopenharmony_ci#define ISCSI_STATS_CUSTOM_DESC_MAX 64 77362306a36Sopenharmony_cistruct iscsi_stats_custom { 77462306a36Sopenharmony_ci char desc[ISCSI_STATS_CUSTOM_DESC_MAX]; 77562306a36Sopenharmony_ci uint64_t value; 77662306a36Sopenharmony_ci}; 77762306a36Sopenharmony_ci 77862306a36Sopenharmony_ci/* 77962306a36Sopenharmony_ci * struct iscsi_stats - iSCSI Statistics (iSCSI MIB) 78062306a36Sopenharmony_ci * 78162306a36Sopenharmony_ci * Note: this structure contains counters collected on per-connection basis. 78262306a36Sopenharmony_ci */ 78362306a36Sopenharmony_cistruct iscsi_stats { 78462306a36Sopenharmony_ci /* octets */ 78562306a36Sopenharmony_ci uint64_t txdata_octets; 78662306a36Sopenharmony_ci uint64_t rxdata_octets; 78762306a36Sopenharmony_ci 78862306a36Sopenharmony_ci /* xmit pdus */ 78962306a36Sopenharmony_ci uint32_t noptx_pdus; 79062306a36Sopenharmony_ci uint32_t scsicmd_pdus; 79162306a36Sopenharmony_ci uint32_t tmfcmd_pdus; 79262306a36Sopenharmony_ci uint32_t login_pdus; 79362306a36Sopenharmony_ci uint32_t text_pdus; 79462306a36Sopenharmony_ci uint32_t dataout_pdus; 79562306a36Sopenharmony_ci uint32_t logout_pdus; 79662306a36Sopenharmony_ci uint32_t snack_pdus; 79762306a36Sopenharmony_ci 79862306a36Sopenharmony_ci /* recv pdus */ 79962306a36Sopenharmony_ci uint32_t noprx_pdus; 80062306a36Sopenharmony_ci uint32_t scsirsp_pdus; 80162306a36Sopenharmony_ci uint32_t tmfrsp_pdus; 80262306a36Sopenharmony_ci uint32_t textrsp_pdus; 80362306a36Sopenharmony_ci uint32_t datain_pdus; 80462306a36Sopenharmony_ci uint32_t logoutrsp_pdus; 80562306a36Sopenharmony_ci uint32_t r2t_pdus; 80662306a36Sopenharmony_ci uint32_t async_pdus; 80762306a36Sopenharmony_ci uint32_t rjt_pdus; 80862306a36Sopenharmony_ci 80962306a36Sopenharmony_ci /* errors */ 81062306a36Sopenharmony_ci uint32_t digest_err; 81162306a36Sopenharmony_ci uint32_t timeout_err; 81262306a36Sopenharmony_ci 81362306a36Sopenharmony_ci /* 81462306a36Sopenharmony_ci * iSCSI Custom Statistics support, i.e. Transport could 81562306a36Sopenharmony_ci * extend existing MIB statistics with its own specific statistics 81662306a36Sopenharmony_ci * up to ISCSI_STATS_CUSTOM_MAX 81762306a36Sopenharmony_ci */ 81862306a36Sopenharmony_ci uint32_t custom_length; 81962306a36Sopenharmony_ci struct iscsi_stats_custom custom[] 82062306a36Sopenharmony_ci __attribute__ ((aligned (sizeof(uint64_t)))); 82162306a36Sopenharmony_ci}; 82262306a36Sopenharmony_ci 82362306a36Sopenharmony_cienum chap_type_e { 82462306a36Sopenharmony_ci CHAP_TYPE_OUT, 82562306a36Sopenharmony_ci CHAP_TYPE_IN, 82662306a36Sopenharmony_ci}; 82762306a36Sopenharmony_ci 82862306a36Sopenharmony_cienum iscsi_chap_param { 82962306a36Sopenharmony_ci ISCSI_CHAP_PARAM_INDEX, 83062306a36Sopenharmony_ci ISCSI_CHAP_PARAM_CHAP_TYPE, 83162306a36Sopenharmony_ci ISCSI_CHAP_PARAM_USERNAME, 83262306a36Sopenharmony_ci ISCSI_CHAP_PARAM_PASSWORD, 83362306a36Sopenharmony_ci ISCSI_CHAP_PARAM_PASSWORD_LEN 83462306a36Sopenharmony_ci}; 83562306a36Sopenharmony_ci 83662306a36Sopenharmony_ci#define ISCSI_CHAP_AUTH_NAME_MAX_LEN 256 83762306a36Sopenharmony_ci#define ISCSI_CHAP_AUTH_SECRET_MAX_LEN 256 83862306a36Sopenharmony_cistruct iscsi_chap_rec { 83962306a36Sopenharmony_ci uint16_t chap_tbl_idx; 84062306a36Sopenharmony_ci enum chap_type_e chap_type; 84162306a36Sopenharmony_ci char username[ISCSI_CHAP_AUTH_NAME_MAX_LEN]; 84262306a36Sopenharmony_ci uint8_t password[ISCSI_CHAP_AUTH_SECRET_MAX_LEN]; 84362306a36Sopenharmony_ci uint8_t password_length; 84462306a36Sopenharmony_ci}; 84562306a36Sopenharmony_ci 84662306a36Sopenharmony_ci#define ISCSI_HOST_STATS_CUSTOM_MAX 32 84762306a36Sopenharmony_ci#define ISCSI_HOST_STATS_CUSTOM_DESC_MAX 64 84862306a36Sopenharmony_cistruct iscsi_host_stats_custom { 84962306a36Sopenharmony_ci char desc[ISCSI_HOST_STATS_CUSTOM_DESC_MAX]; 85062306a36Sopenharmony_ci uint64_t value; 85162306a36Sopenharmony_ci}; 85262306a36Sopenharmony_ci 85362306a36Sopenharmony_ci/* struct iscsi_offload_host_stats: Host statistics, 85462306a36Sopenharmony_ci * Include statistics for MAC, IP, TCP & iSCSI. 85562306a36Sopenharmony_ci */ 85662306a36Sopenharmony_cistruct iscsi_offload_host_stats { 85762306a36Sopenharmony_ci /* MAC */ 85862306a36Sopenharmony_ci uint64_t mactx_frames; 85962306a36Sopenharmony_ci uint64_t mactx_bytes; 86062306a36Sopenharmony_ci uint64_t mactx_multicast_frames; 86162306a36Sopenharmony_ci uint64_t mactx_broadcast_frames; 86262306a36Sopenharmony_ci uint64_t mactx_pause_frames; 86362306a36Sopenharmony_ci uint64_t mactx_control_frames; 86462306a36Sopenharmony_ci uint64_t mactx_deferral; 86562306a36Sopenharmony_ci uint64_t mactx_excess_deferral; 86662306a36Sopenharmony_ci uint64_t mactx_late_collision; 86762306a36Sopenharmony_ci uint64_t mactx_abort; 86862306a36Sopenharmony_ci uint64_t mactx_single_collision; 86962306a36Sopenharmony_ci uint64_t mactx_multiple_collision; 87062306a36Sopenharmony_ci uint64_t mactx_collision; 87162306a36Sopenharmony_ci uint64_t mactx_frames_dropped; 87262306a36Sopenharmony_ci uint64_t mactx_jumbo_frames; 87362306a36Sopenharmony_ci uint64_t macrx_frames; 87462306a36Sopenharmony_ci uint64_t macrx_bytes; 87562306a36Sopenharmony_ci uint64_t macrx_unknown_control_frames; 87662306a36Sopenharmony_ci uint64_t macrx_pause_frames; 87762306a36Sopenharmony_ci uint64_t macrx_control_frames; 87862306a36Sopenharmony_ci uint64_t macrx_dribble; 87962306a36Sopenharmony_ci uint64_t macrx_frame_length_error; 88062306a36Sopenharmony_ci uint64_t macrx_jabber; 88162306a36Sopenharmony_ci uint64_t macrx_carrier_sense_error; 88262306a36Sopenharmony_ci uint64_t macrx_frame_discarded; 88362306a36Sopenharmony_ci uint64_t macrx_frames_dropped; 88462306a36Sopenharmony_ci uint64_t mac_crc_error; 88562306a36Sopenharmony_ci uint64_t mac_encoding_error; 88662306a36Sopenharmony_ci uint64_t macrx_length_error_large; 88762306a36Sopenharmony_ci uint64_t macrx_length_error_small; 88862306a36Sopenharmony_ci uint64_t macrx_multicast_frames; 88962306a36Sopenharmony_ci uint64_t macrx_broadcast_frames; 89062306a36Sopenharmony_ci /* IP */ 89162306a36Sopenharmony_ci uint64_t iptx_packets; 89262306a36Sopenharmony_ci uint64_t iptx_bytes; 89362306a36Sopenharmony_ci uint64_t iptx_fragments; 89462306a36Sopenharmony_ci uint64_t iprx_packets; 89562306a36Sopenharmony_ci uint64_t iprx_bytes; 89662306a36Sopenharmony_ci uint64_t iprx_fragments; 89762306a36Sopenharmony_ci uint64_t ip_datagram_reassembly; 89862306a36Sopenharmony_ci uint64_t ip_invalid_address_error; 89962306a36Sopenharmony_ci uint64_t ip_error_packets; 90062306a36Sopenharmony_ci uint64_t ip_fragrx_overlap; 90162306a36Sopenharmony_ci uint64_t ip_fragrx_outoforder; 90262306a36Sopenharmony_ci uint64_t ip_datagram_reassembly_timeout; 90362306a36Sopenharmony_ci uint64_t ipv6tx_packets; 90462306a36Sopenharmony_ci uint64_t ipv6tx_bytes; 90562306a36Sopenharmony_ci uint64_t ipv6tx_fragments; 90662306a36Sopenharmony_ci uint64_t ipv6rx_packets; 90762306a36Sopenharmony_ci uint64_t ipv6rx_bytes; 90862306a36Sopenharmony_ci uint64_t ipv6rx_fragments; 90962306a36Sopenharmony_ci uint64_t ipv6_datagram_reassembly; 91062306a36Sopenharmony_ci uint64_t ipv6_invalid_address_error; 91162306a36Sopenharmony_ci uint64_t ipv6_error_packets; 91262306a36Sopenharmony_ci uint64_t ipv6_fragrx_overlap; 91362306a36Sopenharmony_ci uint64_t ipv6_fragrx_outoforder; 91462306a36Sopenharmony_ci uint64_t ipv6_datagram_reassembly_timeout; 91562306a36Sopenharmony_ci /* TCP */ 91662306a36Sopenharmony_ci uint64_t tcptx_segments; 91762306a36Sopenharmony_ci uint64_t tcptx_bytes; 91862306a36Sopenharmony_ci uint64_t tcprx_segments; 91962306a36Sopenharmony_ci uint64_t tcprx_byte; 92062306a36Sopenharmony_ci uint64_t tcp_duplicate_ack_retx; 92162306a36Sopenharmony_ci uint64_t tcp_retx_timer_expired; 92262306a36Sopenharmony_ci uint64_t tcprx_duplicate_ack; 92362306a36Sopenharmony_ci uint64_t tcprx_pure_ackr; 92462306a36Sopenharmony_ci uint64_t tcptx_delayed_ack; 92562306a36Sopenharmony_ci uint64_t tcptx_pure_ack; 92662306a36Sopenharmony_ci uint64_t tcprx_segment_error; 92762306a36Sopenharmony_ci uint64_t tcprx_segment_outoforder; 92862306a36Sopenharmony_ci uint64_t tcprx_window_probe; 92962306a36Sopenharmony_ci uint64_t tcprx_window_update; 93062306a36Sopenharmony_ci uint64_t tcptx_window_probe_persist; 93162306a36Sopenharmony_ci /* ECC */ 93262306a36Sopenharmony_ci uint64_t ecc_error_correction; 93362306a36Sopenharmony_ci /* iSCSI */ 93462306a36Sopenharmony_ci uint64_t iscsi_pdu_tx; 93562306a36Sopenharmony_ci uint64_t iscsi_data_bytes_tx; 93662306a36Sopenharmony_ci uint64_t iscsi_pdu_rx; 93762306a36Sopenharmony_ci uint64_t iscsi_data_bytes_rx; 93862306a36Sopenharmony_ci uint64_t iscsi_io_completed; 93962306a36Sopenharmony_ci uint64_t iscsi_unexpected_io_rx; 94062306a36Sopenharmony_ci uint64_t iscsi_format_error; 94162306a36Sopenharmony_ci uint64_t iscsi_hdr_digest_error; 94262306a36Sopenharmony_ci uint64_t iscsi_data_digest_error; 94362306a36Sopenharmony_ci uint64_t iscsi_sequence_error; 94462306a36Sopenharmony_ci /* 94562306a36Sopenharmony_ci * iSCSI Custom Host Statistics support, i.e. Transport could 94662306a36Sopenharmony_ci * extend existing host statistics with its own specific statistics 94762306a36Sopenharmony_ci * up to ISCSI_HOST_STATS_CUSTOM_MAX 94862306a36Sopenharmony_ci */ 94962306a36Sopenharmony_ci uint32_t custom_length; 95062306a36Sopenharmony_ci struct iscsi_host_stats_custom custom[] 95162306a36Sopenharmony_ci __aligned(sizeof(uint64_t)); 95262306a36Sopenharmony_ci}; 95362306a36Sopenharmony_ci 95462306a36Sopenharmony_ci#endif 955