iscsi_if.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * iSCSI User/Kernel Shares (Defines, Constants, Protocol definitions, etc)
  4. *
  5. * Copyright (C) 2005 Dmitry Yusupov
  6. * Copyright (C) 2005 Alex Aizman
  7. * maintained by open-iscsi@googlegroups.com
  8. */
  9. #ifndef ISCSI_IF_H
  10. #define ISCSI_IF_H
  11. #include <scsi/iscsi_proto.h>
  12. #include <linux/in.h>
  13. #include <linux/in6.h>
  14. #define ISCSI_NL_GRP_ISCSID 1
  15. #define ISCSI_NL_GRP_UIP 2
  16. #define UEVENT_BASE 10
  17. #define KEVENT_BASE 100
  18. #define ISCSI_ERR_BASE 1000
  19. enum iscsi_uevent_e {
  20. ISCSI_UEVENT_UNKNOWN = 0,
  21. /* down events */
  22. ISCSI_UEVENT_CREATE_SESSION = UEVENT_BASE + 1,
  23. ISCSI_UEVENT_DESTROY_SESSION = UEVENT_BASE + 2,
  24. ISCSI_UEVENT_CREATE_CONN = UEVENT_BASE + 3,
  25. ISCSI_UEVENT_DESTROY_CONN = UEVENT_BASE + 4,
  26. ISCSI_UEVENT_BIND_CONN = UEVENT_BASE + 5,
  27. ISCSI_UEVENT_SET_PARAM = UEVENT_BASE + 6,
  28. ISCSI_UEVENT_START_CONN = UEVENT_BASE + 7,
  29. ISCSI_UEVENT_STOP_CONN = UEVENT_BASE + 8,
  30. ISCSI_UEVENT_SEND_PDU = UEVENT_BASE + 9,
  31. ISCSI_UEVENT_GET_STATS = UEVENT_BASE + 10,
  32. ISCSI_UEVENT_GET_PARAM = UEVENT_BASE + 11,
  33. ISCSI_UEVENT_TRANSPORT_EP_CONNECT = UEVENT_BASE + 12,
  34. ISCSI_UEVENT_TRANSPORT_EP_POLL = UEVENT_BASE + 13,
  35. ISCSI_UEVENT_TRANSPORT_EP_DISCONNECT = UEVENT_BASE + 14,
  36. ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15,
  37. ISCSI_UEVENT_SET_HOST_PARAM = UEVENT_BASE + 16,
  38. ISCSI_UEVENT_UNBIND_SESSION = UEVENT_BASE + 17,
  39. ISCSI_UEVENT_CREATE_BOUND_SESSION = UEVENT_BASE + 18,
  40. ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19,
  41. ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20,
  42. ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21,
  43. ISCSI_UEVENT_PING = UEVENT_BASE + 22,
  44. ISCSI_UEVENT_GET_CHAP = UEVENT_BASE + 23,
  45. ISCSI_UEVENT_DELETE_CHAP = UEVENT_BASE + 24,
  46. ISCSI_UEVENT_SET_FLASHNODE_PARAMS = UEVENT_BASE + 25,
  47. ISCSI_UEVENT_NEW_FLASHNODE = UEVENT_BASE + 26,
  48. ISCSI_UEVENT_DEL_FLASHNODE = UEVENT_BASE + 27,
  49. ISCSI_UEVENT_LOGIN_FLASHNODE = UEVENT_BASE + 28,
  50. ISCSI_UEVENT_LOGOUT_FLASHNODE = UEVENT_BASE + 29,
  51. ISCSI_UEVENT_LOGOUT_FLASHNODE_SID = UEVENT_BASE + 30,
  52. ISCSI_UEVENT_SET_CHAP = UEVENT_BASE + 31,
  53. ISCSI_UEVENT_GET_HOST_STATS = UEVENT_BASE + 32,
  54. ISCSI_UEVENT_DESTROY_SESSION_ASYNC = UEVENT_BASE + 33,
  55. /* up events */
  56. ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1,
  57. ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2,
  58. ISCSI_KEVENT_IF_ERROR = KEVENT_BASE + 3,
  59. ISCSI_KEVENT_DESTROY_SESSION = KEVENT_BASE + 4,
  60. ISCSI_KEVENT_UNBIND_SESSION = KEVENT_BASE + 5,
  61. ISCSI_KEVENT_CREATE_SESSION = KEVENT_BASE + 6,
  62. ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7,
  63. ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8,
  64. ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9,
  65. ISCSI_KEVENT_HOST_EVENT = KEVENT_BASE + 10,
  66. ISCSI_KEVENT_PING_COMP = KEVENT_BASE + 11,
  67. };
  68. enum iscsi_tgt_dscvr {
  69. ISCSI_TGT_DSCVR_SEND_TARGETS = 1,
  70. ISCSI_TGT_DSCVR_ISNS = 2,
  71. ISCSI_TGT_DSCVR_SLP = 3,
  72. };
  73. enum iscsi_host_event_code {
  74. ISCSI_EVENT_LINKUP = 1,
  75. ISCSI_EVENT_LINKDOWN,
  76. /* must always be last */
  77. ISCSI_EVENT_MAX,
  78. };
  79. struct iscsi_uevent {
  80. uint32_t type; /* k/u events type */
  81. uint32_t iferror; /* carries interface or resource errors */
  82. uint64_t transport_handle;
  83. union {
  84. /* messages u -> k */
  85. struct msg_create_session {
  86. uint32_t initial_cmdsn;
  87. uint16_t cmds_max;
  88. uint16_t queue_depth;
  89. } c_session;
  90. struct msg_create_bound_session {
  91. uint64_t ep_handle;
  92. uint32_t initial_cmdsn;
  93. uint16_t cmds_max;
  94. uint16_t queue_depth;
  95. } c_bound_session;
  96. struct msg_destroy_session {
  97. uint32_t sid;
  98. } d_session;
  99. struct msg_create_conn {
  100. uint32_t sid;
  101. uint32_t cid;
  102. } c_conn;
  103. struct msg_bind_conn {
  104. uint32_t sid;
  105. uint32_t cid;
  106. uint64_t transport_eph;
  107. uint32_t is_leading;
  108. } b_conn;
  109. struct msg_destroy_conn {
  110. uint32_t sid;
  111. uint32_t cid;
  112. } d_conn;
  113. struct msg_send_pdu {
  114. uint32_t sid;
  115. uint32_t cid;
  116. uint32_t hdr_size;
  117. uint32_t data_size;
  118. } send_pdu;
  119. struct msg_set_param {
  120. uint32_t sid;
  121. uint32_t cid;
  122. uint32_t param; /* enum iscsi_param */
  123. uint32_t len;
  124. } set_param;
  125. struct msg_start_conn {
  126. uint32_t sid;
  127. uint32_t cid;
  128. } start_conn;
  129. struct msg_stop_conn {
  130. uint32_t sid;
  131. uint32_t cid;
  132. uint64_t conn_handle;
  133. uint32_t flag;
  134. } stop_conn;
  135. struct msg_get_stats {
  136. uint32_t sid;
  137. uint32_t cid;
  138. } get_stats;
  139. struct msg_transport_connect {
  140. uint32_t non_blocking;
  141. } ep_connect;
  142. struct msg_transport_connect_through_host {
  143. uint32_t host_no;
  144. uint32_t non_blocking;
  145. } ep_connect_through_host;
  146. struct msg_transport_poll {
  147. uint64_t ep_handle;
  148. uint32_t timeout_ms;
  149. } ep_poll;
  150. struct msg_transport_disconnect {
  151. uint64_t ep_handle;
  152. } ep_disconnect;
  153. struct msg_tgt_dscvr {
  154. enum iscsi_tgt_dscvr type;
  155. uint32_t host_no;
  156. /*
  157. * enable = 1 to establish a new connection
  158. * with the server. enable = 0 to disconnect
  159. * from the server. Used primarily to switch
  160. * from one iSNS server to another.
  161. */
  162. uint32_t enable;
  163. } tgt_dscvr;
  164. struct msg_set_host_param {
  165. uint32_t host_no;
  166. uint32_t param; /* enum iscsi_host_param */
  167. uint32_t len;
  168. } set_host_param;
  169. struct msg_set_path {
  170. uint32_t host_no;
  171. } set_path;
  172. struct msg_set_iface_params {
  173. uint32_t host_no;
  174. uint32_t count;
  175. } set_iface_params;
  176. struct msg_iscsi_ping {
  177. uint32_t host_no;
  178. uint32_t iface_num;
  179. uint32_t iface_type;
  180. uint32_t payload_size;
  181. uint32_t pid; /* unique ping id associated
  182. with each ping request */
  183. } iscsi_ping;
  184. struct msg_get_chap {
  185. uint32_t host_no;
  186. uint32_t num_entries; /* number of CHAP entries
  187. * on request, number of
  188. * valid CHAP entries on
  189. * response */
  190. uint16_t chap_tbl_idx;
  191. } get_chap;
  192. struct msg_delete_chap {
  193. uint32_t host_no;
  194. uint16_t chap_tbl_idx;
  195. } delete_chap;
  196. struct msg_set_flashnode_param {
  197. uint32_t host_no;
  198. uint32_t flashnode_idx;
  199. uint32_t count;
  200. } set_flashnode;
  201. struct msg_new_flashnode {
  202. uint32_t host_no;
  203. uint32_t len;
  204. } new_flashnode;
  205. struct msg_del_flashnode {
  206. uint32_t host_no;
  207. uint32_t flashnode_idx;
  208. } del_flashnode;
  209. struct msg_login_flashnode {
  210. uint32_t host_no;
  211. uint32_t flashnode_idx;
  212. } login_flashnode;
  213. struct msg_logout_flashnode {
  214. uint32_t host_no;
  215. uint32_t flashnode_idx;
  216. } logout_flashnode;
  217. struct msg_logout_flashnode_sid {
  218. uint32_t host_no;
  219. uint32_t sid;
  220. } logout_flashnode_sid;
  221. struct msg_get_host_stats {
  222. uint32_t host_no;
  223. } get_host_stats;
  224. } u;
  225. union {
  226. /* messages k -> u */
  227. int retcode;
  228. struct msg_create_session_ret {
  229. uint32_t sid;
  230. uint32_t host_no;
  231. } c_session_ret;
  232. struct msg_create_conn_ret {
  233. uint32_t sid;
  234. uint32_t cid;
  235. } c_conn_ret;
  236. struct msg_unbind_session {
  237. uint32_t sid;
  238. uint32_t host_no;
  239. } unbind_session;
  240. struct msg_recv_req {
  241. uint32_t sid;
  242. uint32_t cid;
  243. uint64_t recv_handle;
  244. } recv_req;
  245. struct msg_conn_login {
  246. uint32_t sid;
  247. uint32_t cid;
  248. uint32_t state; /* enum iscsi_conn_state */
  249. } conn_login;
  250. struct msg_conn_error {
  251. uint32_t sid;
  252. uint32_t cid;
  253. uint32_t error; /* enum iscsi_err */
  254. } connerror;
  255. struct msg_session_destroyed {
  256. uint32_t host_no;
  257. uint32_t sid;
  258. } d_session;
  259. struct msg_transport_connect_ret {
  260. uint64_t handle;
  261. } ep_connect_ret;
  262. struct msg_req_path {
  263. uint32_t host_no;
  264. } req_path;
  265. struct msg_notify_if_down {
  266. uint32_t host_no;
  267. } notify_if_down;
  268. struct msg_host_event {
  269. uint32_t host_no;
  270. uint32_t data_size;
  271. enum iscsi_host_event_code code;
  272. } host_event;
  273. struct msg_ping_comp {
  274. uint32_t host_no;
  275. uint32_t status; /* enum
  276. * iscsi_ping_status_code */
  277. uint32_t pid; /* unique ping id associated
  278. with each ping request */
  279. uint32_t data_size;
  280. } ping_comp;
  281. struct msg_new_flashnode_ret {
  282. uint32_t flashnode_idx;
  283. } new_flashnode_ret;
  284. } r;
  285. } __attribute__ ((aligned (sizeof(uint64_t))));
  286. enum iscsi_param_type {
  287. ISCSI_PARAM, /* iscsi_param (session, conn, target, LU) */
  288. ISCSI_HOST_PARAM, /* iscsi_host_param */
  289. ISCSI_NET_PARAM, /* iscsi_net_param */
  290. ISCSI_FLASHNODE_PARAM, /* iscsi_flashnode_param */
  291. ISCSI_CHAP_PARAM, /* iscsi_chap_param */
  292. ISCSI_IFACE_PARAM, /* iscsi_iface_param */
  293. };
  294. /* structure for minimalist usecase */
  295. struct iscsi_param_info {
  296. uint32_t len; /* Actual length of the param value */
  297. uint16_t param; /* iscsi param */
  298. uint8_t value[]; /* length sized value follows */
  299. } __packed;
  300. struct iscsi_iface_param_info {
  301. uint32_t iface_num; /* iface number, 0 - n */
  302. uint32_t len; /* Actual length of the param */
  303. uint16_t param; /* iscsi param value */
  304. uint8_t iface_type; /* IPv4 or IPv6 */
  305. uint8_t param_type; /* iscsi_param_type */
  306. uint8_t value[]; /* length sized value follows */
  307. } __packed;
  308. /*
  309. * To keep the struct iscsi_uevent size the same for userspace code
  310. * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and
  311. * ISCSI_KEVENT_PATH_REQ is defined separately and comes after the
  312. * struct iscsi_uevent in the NETLINK_ISCSI message.
  313. */
  314. struct iscsi_path {
  315. uint64_t handle;
  316. uint8_t mac_addr[6];
  317. uint8_t mac_addr_old[6];
  318. uint32_t ip_addr_len; /* 4 or 16 */
  319. union {
  320. struct in_addr v4_addr;
  321. struct in6_addr v6_addr;
  322. } src;
  323. union {
  324. struct in_addr v4_addr;
  325. struct in6_addr v6_addr;
  326. } dst;
  327. uint16_t vlan_id;
  328. uint16_t pmtu;
  329. } __attribute__ ((aligned (sizeof(uint64_t))));
  330. /* iscsi iface enabled/disabled setting */
  331. #define ISCSI_IFACE_DISABLE 0x01
  332. #define ISCSI_IFACE_ENABLE 0x02
  333. /* ipv4 bootproto */
  334. #define ISCSI_BOOTPROTO_STATIC 0x01
  335. #define ISCSI_BOOTPROTO_DHCP 0x02
  336. /* ipv6 addr autoconfig type */
  337. #define ISCSI_IPV6_AUTOCFG_DISABLE 0x01
  338. #define ISCSI_IPV6_AUTOCFG_ND_ENABLE 0x02
  339. #define ISCSI_IPV6_AUTOCFG_DHCPV6_ENABLE 0x03
  340. /* ipv6 link local addr type */
  341. #define ISCSI_IPV6_LINKLOCAL_AUTOCFG_ENABLE 0x01
  342. #define ISCSI_IPV6_LINKLOCAL_AUTOCFG_DISABLE 0x02
  343. /* ipv6 router addr type */
  344. #define ISCSI_IPV6_ROUTER_AUTOCFG_ENABLE 0x01
  345. #define ISCSI_IPV6_ROUTER_AUTOCFG_DISABLE 0x02
  346. #define ISCSI_IFACE_TYPE_IPV4 0x01
  347. #define ISCSI_IFACE_TYPE_IPV6 0x02
  348. #define ISCSI_MAX_VLAN_ID 4095
  349. #define ISCSI_MAX_VLAN_PRIORITY 7
  350. /* iscsi vlan enable/disabled setting */
  351. #define ISCSI_VLAN_DISABLE 0x01
  352. #define ISCSI_VLAN_ENABLE 0x02
  353. /* iscsi generic enable/disabled setting for various features */
  354. #define ISCSI_NET_PARAM_DISABLE 0x01
  355. #define ISCSI_NET_PARAM_ENABLE 0x02
  356. /* iSCSI network params */
  357. enum iscsi_net_param {
  358. ISCSI_NET_PARAM_IPV4_ADDR = 1,
  359. ISCSI_NET_PARAM_IPV4_SUBNET,
  360. ISCSI_NET_PARAM_IPV4_GW,
  361. ISCSI_NET_PARAM_IPV4_BOOTPROTO,
  362. ISCSI_NET_PARAM_MAC,
  363. ISCSI_NET_PARAM_IPV6_LINKLOCAL,
  364. ISCSI_NET_PARAM_IPV6_ADDR,
  365. ISCSI_NET_PARAM_IPV6_ROUTER,
  366. ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG,
  367. ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG,
  368. ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG,
  369. ISCSI_NET_PARAM_IFACE_ENABLE,
  370. ISCSI_NET_PARAM_VLAN_ID,
  371. ISCSI_NET_PARAM_VLAN_PRIORITY,
  372. ISCSI_NET_PARAM_VLAN_ENABLED,
  373. ISCSI_NET_PARAM_VLAN_TAG,
  374. ISCSI_NET_PARAM_IFACE_TYPE,
  375. ISCSI_NET_PARAM_IFACE_NAME,
  376. ISCSI_NET_PARAM_MTU,
  377. ISCSI_NET_PARAM_PORT,
  378. ISCSI_NET_PARAM_IPADDR_STATE,
  379. ISCSI_NET_PARAM_IPV6_LINKLOCAL_STATE,
  380. ISCSI_NET_PARAM_IPV6_ROUTER_STATE,
  381. ISCSI_NET_PARAM_DELAYED_ACK_EN,
  382. ISCSI_NET_PARAM_TCP_NAGLE_DISABLE,
  383. ISCSI_NET_PARAM_TCP_WSF_DISABLE,
  384. ISCSI_NET_PARAM_TCP_WSF,
  385. ISCSI_NET_PARAM_TCP_TIMER_SCALE,
  386. ISCSI_NET_PARAM_TCP_TIMESTAMP_EN,
  387. ISCSI_NET_PARAM_CACHE_ID,
  388. ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN,
  389. ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN,
  390. ISCSI_NET_PARAM_IPV4_TOS_EN,
  391. ISCSI_NET_PARAM_IPV4_TOS,
  392. ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN,
  393. ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN,
  394. ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID,
  395. ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN,
  396. ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN,
  397. ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID,
  398. ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN,
  399. ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE,
  400. ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN,
  401. ISCSI_NET_PARAM_IPV4_TTL,
  402. ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN,
  403. ISCSI_NET_PARAM_IPV6_MLD_EN,
  404. ISCSI_NET_PARAM_IPV6_FLOW_LABEL,
  405. ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS,
  406. ISCSI_NET_PARAM_IPV6_HOP_LIMIT,
  407. ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO,
  408. ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME,
  409. ISCSI_NET_PARAM_IPV6_ND_STALE_TMO,
  410. ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT,
  411. ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU,
  412. ISCSI_NET_PARAM_REDIRECT_EN,
  413. };
  414. enum iscsi_ipaddress_state {
  415. ISCSI_IPDDRESS_STATE_UNCONFIGURED,
  416. ISCSI_IPDDRESS_STATE_ACQUIRING,
  417. ISCSI_IPDDRESS_STATE_TENTATIVE,
  418. ISCSI_IPDDRESS_STATE_VALID,
  419. ISCSI_IPDDRESS_STATE_DISABLING,
  420. ISCSI_IPDDRESS_STATE_INVALID,
  421. ISCSI_IPDDRESS_STATE_DEPRECATED,
  422. };
  423. enum iscsi_router_state {
  424. ISCSI_ROUTER_STATE_UNKNOWN,
  425. ISCSI_ROUTER_STATE_ADVERTISED,
  426. ISCSI_ROUTER_STATE_MANUAL,
  427. ISCSI_ROUTER_STATE_STALE,
  428. };
  429. /* iSCSI specific settings params for iface */
  430. enum iscsi_iface_param {
  431. ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO,
  432. ISCSI_IFACE_PARAM_HDRDGST_EN,
  433. ISCSI_IFACE_PARAM_DATADGST_EN,
  434. ISCSI_IFACE_PARAM_IMM_DATA_EN,
  435. ISCSI_IFACE_PARAM_INITIAL_R2T_EN,
  436. ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN,
  437. ISCSI_IFACE_PARAM_PDU_INORDER_EN,
  438. ISCSI_IFACE_PARAM_ERL,
  439. ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH,
  440. ISCSI_IFACE_PARAM_FIRST_BURST,
  441. ISCSI_IFACE_PARAM_MAX_R2T,
  442. ISCSI_IFACE_PARAM_MAX_BURST,
  443. ISCSI_IFACE_PARAM_CHAP_AUTH_EN,
  444. ISCSI_IFACE_PARAM_BIDI_CHAP_EN,
  445. ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL,
  446. ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN,
  447. ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN,
  448. ISCSI_IFACE_PARAM_INITIATOR_NAME,
  449. };
  450. enum iscsi_conn_state {
  451. ISCSI_CONN_STATE_FREE,
  452. ISCSI_CONN_STATE_XPT_WAIT,
  453. ISCSI_CONN_STATE_IN_LOGIN,
  454. ISCSI_CONN_STATE_LOGGED_IN,
  455. ISCSI_CONN_STATE_IN_LOGOUT,
  456. ISCSI_CONN_STATE_LOGOUT_REQUESTED,
  457. ISCSI_CONN_STATE_CLEANUP_WAIT,
  458. };
  459. /*
  460. * Common error codes
  461. */
  462. enum iscsi_err {
  463. ISCSI_OK = 0,
  464. ISCSI_ERR_DATASN = ISCSI_ERR_BASE + 1,
  465. ISCSI_ERR_DATA_OFFSET = ISCSI_ERR_BASE + 2,
  466. ISCSI_ERR_MAX_CMDSN = ISCSI_ERR_BASE + 3,
  467. ISCSI_ERR_EXP_CMDSN = ISCSI_ERR_BASE + 4,
  468. ISCSI_ERR_BAD_OPCODE = ISCSI_ERR_BASE + 5,
  469. ISCSI_ERR_DATALEN = ISCSI_ERR_BASE + 6,
  470. ISCSI_ERR_AHSLEN = ISCSI_ERR_BASE + 7,
  471. ISCSI_ERR_PROTO = ISCSI_ERR_BASE + 8,
  472. ISCSI_ERR_LUN = ISCSI_ERR_BASE + 9,
  473. ISCSI_ERR_BAD_ITT = ISCSI_ERR_BASE + 10,
  474. ISCSI_ERR_CONN_FAILED = ISCSI_ERR_BASE + 11,
  475. ISCSI_ERR_R2TSN = ISCSI_ERR_BASE + 12,
  476. ISCSI_ERR_SESSION_FAILED = ISCSI_ERR_BASE + 13,
  477. ISCSI_ERR_HDR_DGST = ISCSI_ERR_BASE + 14,
  478. ISCSI_ERR_DATA_DGST = ISCSI_ERR_BASE + 15,
  479. ISCSI_ERR_PARAM_NOT_FOUND = ISCSI_ERR_BASE + 16,
  480. ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17,
  481. ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18,
  482. ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19,
  483. ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20,
  484. ISCSI_ERR_SCSI_EH_SESSION_RST = ISCSI_ERR_BASE + 21,
  485. ISCSI_ERR_NOP_TIMEDOUT = ISCSI_ERR_BASE + 22,
  486. };
  487. /*
  488. * iSCSI Parameters (RFC3720)
  489. */
  490. enum iscsi_param {
  491. /* passed in using netlink set param */
  492. ISCSI_PARAM_MAX_RECV_DLENGTH,
  493. ISCSI_PARAM_MAX_XMIT_DLENGTH,
  494. ISCSI_PARAM_HDRDGST_EN,
  495. ISCSI_PARAM_DATADGST_EN,
  496. ISCSI_PARAM_INITIAL_R2T_EN,
  497. ISCSI_PARAM_MAX_R2T,
  498. ISCSI_PARAM_IMM_DATA_EN,
  499. ISCSI_PARAM_FIRST_BURST,
  500. ISCSI_PARAM_MAX_BURST,
  501. ISCSI_PARAM_PDU_INORDER_EN,
  502. ISCSI_PARAM_DATASEQ_INORDER_EN,
  503. ISCSI_PARAM_ERL,
  504. ISCSI_PARAM_IFMARKER_EN,
  505. ISCSI_PARAM_OFMARKER_EN,
  506. ISCSI_PARAM_EXP_STATSN,
  507. ISCSI_PARAM_TARGET_NAME,
  508. ISCSI_PARAM_TPGT,
  509. ISCSI_PARAM_PERSISTENT_ADDRESS,
  510. ISCSI_PARAM_PERSISTENT_PORT,
  511. ISCSI_PARAM_SESS_RECOVERY_TMO,
  512. /* passed in through bind conn using transport_fd */
  513. ISCSI_PARAM_CONN_PORT,
  514. ISCSI_PARAM_CONN_ADDRESS,
  515. ISCSI_PARAM_USERNAME,
  516. ISCSI_PARAM_USERNAME_IN,
  517. ISCSI_PARAM_PASSWORD,
  518. ISCSI_PARAM_PASSWORD_IN,
  519. ISCSI_PARAM_FAST_ABORT,
  520. ISCSI_PARAM_ABORT_TMO,
  521. ISCSI_PARAM_LU_RESET_TMO,
  522. ISCSI_PARAM_HOST_RESET_TMO,
  523. ISCSI_PARAM_PING_TMO,
  524. ISCSI_PARAM_RECV_TMO,
  525. ISCSI_PARAM_IFACE_NAME,
  526. ISCSI_PARAM_ISID,
  527. ISCSI_PARAM_INITIATOR_NAME,
  528. ISCSI_PARAM_TGT_RESET_TMO,
  529. ISCSI_PARAM_TARGET_ALIAS,
  530. ISCSI_PARAM_CHAP_IN_IDX,
  531. ISCSI_PARAM_CHAP_OUT_IDX,
  532. ISCSI_PARAM_BOOT_ROOT,
  533. ISCSI_PARAM_BOOT_NIC,
  534. ISCSI_PARAM_BOOT_TARGET,
  535. ISCSI_PARAM_AUTO_SND_TGT_DISABLE,
  536. ISCSI_PARAM_DISCOVERY_SESS,
  537. ISCSI_PARAM_PORTAL_TYPE,
  538. ISCSI_PARAM_CHAP_AUTH_EN,
  539. ISCSI_PARAM_DISCOVERY_LOGOUT_EN,
  540. ISCSI_PARAM_BIDI_CHAP_EN,
  541. ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL,
  542. ISCSI_PARAM_DEF_TIME2WAIT,
  543. ISCSI_PARAM_DEF_TIME2RETAIN,
  544. ISCSI_PARAM_MAX_SEGMENT_SIZE,
  545. ISCSI_PARAM_STATSN,
  546. ISCSI_PARAM_KEEPALIVE_TMO,
  547. ISCSI_PARAM_LOCAL_PORT,
  548. ISCSI_PARAM_TSID,
  549. ISCSI_PARAM_DEF_TASKMGMT_TMO,
  550. ISCSI_PARAM_TCP_TIMESTAMP_STAT,
  551. ISCSI_PARAM_TCP_WSF_DISABLE,
  552. ISCSI_PARAM_TCP_NAGLE_DISABLE,
  553. ISCSI_PARAM_TCP_TIMER_SCALE,
  554. ISCSI_PARAM_TCP_TIMESTAMP_EN,
  555. ISCSI_PARAM_TCP_XMIT_WSF,
  556. ISCSI_PARAM_TCP_RECV_WSF,
  557. ISCSI_PARAM_IP_FRAGMENT_DISABLE,
  558. ISCSI_PARAM_IPV4_TOS,
  559. ISCSI_PARAM_IPV6_TC,
  560. ISCSI_PARAM_IPV6_FLOW_LABEL,
  561. ISCSI_PARAM_IS_FW_ASSIGNED_IPV6,
  562. ISCSI_PARAM_DISCOVERY_PARENT_IDX,
  563. ISCSI_PARAM_DISCOVERY_PARENT_TYPE,
  564. ISCSI_PARAM_LOCAL_IPADDR,
  565. /* must always be last */
  566. ISCSI_PARAM_MAX,
  567. };
  568. /* iSCSI HBA params */
  569. enum iscsi_host_param {
  570. ISCSI_HOST_PARAM_HWADDRESS,
  571. ISCSI_HOST_PARAM_INITIATOR_NAME,
  572. ISCSI_HOST_PARAM_NETDEV_NAME,
  573. ISCSI_HOST_PARAM_IPADDRESS,
  574. ISCSI_HOST_PARAM_PORT_STATE,
  575. ISCSI_HOST_PARAM_PORT_SPEED,
  576. ISCSI_HOST_PARAM_MAX,
  577. };
  578. /* portal type */
  579. #define PORTAL_TYPE_IPV4 "ipv4"
  580. #define PORTAL_TYPE_IPV6 "ipv6"
  581. /* iSCSI Flash Target params */
  582. enum iscsi_flashnode_param {
  583. ISCSI_FLASHNODE_IS_FW_ASSIGNED_IPV6,
  584. ISCSI_FLASHNODE_PORTAL_TYPE,
  585. ISCSI_FLASHNODE_AUTO_SND_TGT_DISABLE,
  586. ISCSI_FLASHNODE_DISCOVERY_SESS,
  587. ISCSI_FLASHNODE_ENTRY_EN,
  588. ISCSI_FLASHNODE_HDR_DGST_EN,
  589. ISCSI_FLASHNODE_DATA_DGST_EN,
  590. ISCSI_FLASHNODE_IMM_DATA_EN,
  591. ISCSI_FLASHNODE_INITIAL_R2T_EN,
  592. ISCSI_FLASHNODE_DATASEQ_INORDER,
  593. ISCSI_FLASHNODE_PDU_INORDER,
  594. ISCSI_FLASHNODE_CHAP_AUTH_EN,
  595. ISCSI_FLASHNODE_SNACK_REQ_EN,
  596. ISCSI_FLASHNODE_DISCOVERY_LOGOUT_EN,
  597. ISCSI_FLASHNODE_BIDI_CHAP_EN,
  598. /* make authentication for discovery sessions optional */
  599. ISCSI_FLASHNODE_DISCOVERY_AUTH_OPTIONAL,
  600. ISCSI_FLASHNODE_ERL,
  601. ISCSI_FLASHNODE_TCP_TIMESTAMP_STAT,
  602. ISCSI_FLASHNODE_TCP_NAGLE_DISABLE,
  603. ISCSI_FLASHNODE_TCP_WSF_DISABLE,
  604. ISCSI_FLASHNODE_TCP_TIMER_SCALE,
  605. ISCSI_FLASHNODE_TCP_TIMESTAMP_EN,
  606. ISCSI_FLASHNODE_IP_FRAG_DISABLE,
  607. ISCSI_FLASHNODE_MAX_RECV_DLENGTH,
  608. ISCSI_FLASHNODE_MAX_XMIT_DLENGTH,
  609. ISCSI_FLASHNODE_FIRST_BURST,
  610. ISCSI_FLASHNODE_DEF_TIME2WAIT,
  611. ISCSI_FLASHNODE_DEF_TIME2RETAIN,
  612. ISCSI_FLASHNODE_MAX_R2T,
  613. ISCSI_FLASHNODE_KEEPALIVE_TMO,
  614. ISCSI_FLASHNODE_ISID,
  615. ISCSI_FLASHNODE_TSID,
  616. ISCSI_FLASHNODE_PORT,
  617. ISCSI_FLASHNODE_MAX_BURST,
  618. ISCSI_FLASHNODE_DEF_TASKMGMT_TMO,
  619. ISCSI_FLASHNODE_IPADDR,
  620. ISCSI_FLASHNODE_ALIAS,
  621. ISCSI_FLASHNODE_REDIRECT_IPADDR,
  622. ISCSI_FLASHNODE_MAX_SEGMENT_SIZE,
  623. ISCSI_FLASHNODE_LOCAL_PORT,
  624. ISCSI_FLASHNODE_IPV4_TOS,
  625. ISCSI_FLASHNODE_IPV6_TC,
  626. ISCSI_FLASHNODE_IPV6_FLOW_LABEL,
  627. ISCSI_FLASHNODE_NAME,
  628. ISCSI_FLASHNODE_TPGT,
  629. ISCSI_FLASHNODE_LINK_LOCAL_IPV6,
  630. ISCSI_FLASHNODE_DISCOVERY_PARENT_IDX,
  631. ISCSI_FLASHNODE_DISCOVERY_PARENT_TYPE,
  632. ISCSI_FLASHNODE_TCP_XMIT_WSF,
  633. ISCSI_FLASHNODE_TCP_RECV_WSF,
  634. ISCSI_FLASHNODE_CHAP_IN_IDX,
  635. ISCSI_FLASHNODE_CHAP_OUT_IDX,
  636. ISCSI_FLASHNODE_USERNAME,
  637. ISCSI_FLASHNODE_USERNAME_IN,
  638. ISCSI_FLASHNODE_PASSWORD,
  639. ISCSI_FLASHNODE_PASSWORD_IN,
  640. ISCSI_FLASHNODE_STATSN,
  641. ISCSI_FLASHNODE_EXP_STATSN,
  642. ISCSI_FLASHNODE_IS_BOOT_TGT,
  643. ISCSI_FLASHNODE_MAX,
  644. };
  645. struct iscsi_flashnode_param_info {
  646. uint32_t len; /* Actual length of the param */
  647. uint16_t param; /* iscsi param value */
  648. uint8_t value[]; /* length sized value follows */
  649. } __packed;
  650. enum iscsi_discovery_parent_type {
  651. ISCSI_DISC_PARENT_UNKNOWN = 0x1,
  652. ISCSI_DISC_PARENT_SENDTGT = 0x2,
  653. ISCSI_DISC_PARENT_ISNS = 0x3,
  654. };
  655. /* iSCSI port Speed */
  656. enum iscsi_port_speed {
  657. ISCSI_PORT_SPEED_UNKNOWN = 0x1,
  658. ISCSI_PORT_SPEED_10MBPS = 0x2,
  659. ISCSI_PORT_SPEED_100MBPS = 0x4,
  660. ISCSI_PORT_SPEED_1GBPS = 0x8,
  661. ISCSI_PORT_SPEED_10GBPS = 0x10,
  662. ISCSI_PORT_SPEED_25GBPS = 0x20,
  663. ISCSI_PORT_SPEED_40GBPS = 0x40,
  664. };
  665. /* iSCSI port state */
  666. enum iscsi_port_state {
  667. ISCSI_PORT_STATE_DOWN = 0x1,
  668. ISCSI_PORT_STATE_UP = 0x2,
  669. };
  670. /* iSCSI PING status/error code */
  671. enum iscsi_ping_status_code {
  672. ISCSI_PING_SUCCESS = 0,
  673. ISCSI_PING_FW_DISABLED = 0x1,
  674. ISCSI_PING_IPADDR_INVALID = 0x2,
  675. ISCSI_PING_LINKLOCAL_IPV6_ADDR_INVALID = 0x3,
  676. ISCSI_PING_TIMEOUT = 0x4,
  677. ISCSI_PING_INVALID_DEST_ADDR = 0x5,
  678. ISCSI_PING_OVERSIZE_PACKET = 0x6,
  679. ISCSI_PING_ICMP_ERROR = 0x7,
  680. ISCSI_PING_MAX_REQ_EXCEEDED = 0x8,
  681. ISCSI_PING_NO_ARP_RECEIVED = 0x9,
  682. };
  683. #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle)
  684. #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr)
  685. /*
  686. * These flags presents iSCSI Data-Path capabilities.
  687. */
  688. #define CAP_RECOVERY_L0 0x1
  689. #define CAP_RECOVERY_L1 0x2
  690. #define CAP_RECOVERY_L2 0x4
  691. #define CAP_MULTI_R2T 0x8
  692. #define CAP_HDRDGST 0x10
  693. #define CAP_DATADGST 0x20
  694. #define CAP_MULTI_CONN 0x40
  695. #define CAP_TEXT_NEGO 0x80
  696. #define CAP_MARKERS 0x100
  697. #define CAP_FW_DB 0x200
  698. #define CAP_SENDTARGETS_OFFLOAD 0x400 /* offload discovery process */
  699. #define CAP_DATA_PATH_OFFLOAD 0x800 /* offload entire IO path */
  700. #define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */
  701. #define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal,
  702. and verification */
  703. #define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */
  704. /*
  705. * These flags describes reason of stop_conn() call
  706. */
  707. #define STOP_CONN_TERM 0x1
  708. #define STOP_CONN_SUSPEND 0x2
  709. #define STOP_CONN_RECOVER 0x3
  710. #define ISCSI_STATS_CUSTOM_MAX 32
  711. #define ISCSI_STATS_CUSTOM_DESC_MAX 64
  712. struct iscsi_stats_custom {
  713. char desc[ISCSI_STATS_CUSTOM_DESC_MAX];
  714. uint64_t value;
  715. };
  716. /*
  717. * struct iscsi_stats - iSCSI Statistics (iSCSI MIB)
  718. *
  719. * Note: this structure contains counters collected on per-connection basis.
  720. */
  721. struct iscsi_stats {
  722. /* octets */
  723. uint64_t txdata_octets;
  724. uint64_t rxdata_octets;
  725. /* xmit pdus */
  726. uint32_t noptx_pdus;
  727. uint32_t scsicmd_pdus;
  728. uint32_t tmfcmd_pdus;
  729. uint32_t login_pdus;
  730. uint32_t text_pdus;
  731. uint32_t dataout_pdus;
  732. uint32_t logout_pdus;
  733. uint32_t snack_pdus;
  734. /* recv pdus */
  735. uint32_t noprx_pdus;
  736. uint32_t scsirsp_pdus;
  737. uint32_t tmfrsp_pdus;
  738. uint32_t textrsp_pdus;
  739. uint32_t datain_pdus;
  740. uint32_t logoutrsp_pdus;
  741. uint32_t r2t_pdus;
  742. uint32_t async_pdus;
  743. uint32_t rjt_pdus;
  744. /* errors */
  745. uint32_t digest_err;
  746. uint32_t timeout_err;
  747. /*
  748. * iSCSI Custom Statistics support, i.e. Transport could
  749. * extend existing MIB statistics with its own specific statistics
  750. * up to ISCSI_STATS_CUSTOM_MAX
  751. */
  752. uint32_t custom_length;
  753. struct iscsi_stats_custom custom[]
  754. __attribute__ ((aligned (sizeof(uint64_t))));
  755. };
  756. enum chap_type_e {
  757. CHAP_TYPE_OUT,
  758. CHAP_TYPE_IN,
  759. };
  760. enum iscsi_chap_param {
  761. ISCSI_CHAP_PARAM_INDEX,
  762. ISCSI_CHAP_PARAM_CHAP_TYPE,
  763. ISCSI_CHAP_PARAM_USERNAME,
  764. ISCSI_CHAP_PARAM_PASSWORD,
  765. ISCSI_CHAP_PARAM_PASSWORD_LEN
  766. };
  767. #define ISCSI_CHAP_AUTH_NAME_MAX_LEN 256
  768. #define ISCSI_CHAP_AUTH_SECRET_MAX_LEN 256
  769. struct iscsi_chap_rec {
  770. uint16_t chap_tbl_idx;
  771. enum chap_type_e chap_type;
  772. char username[ISCSI_CHAP_AUTH_NAME_MAX_LEN];
  773. uint8_t password[ISCSI_CHAP_AUTH_SECRET_MAX_LEN];
  774. uint8_t password_length;
  775. };
  776. #define ISCSI_HOST_STATS_CUSTOM_MAX 32
  777. #define ISCSI_HOST_STATS_CUSTOM_DESC_MAX 64
  778. struct iscsi_host_stats_custom {
  779. char desc[ISCSI_HOST_STATS_CUSTOM_DESC_MAX];
  780. uint64_t value;
  781. };
  782. /* struct iscsi_offload_host_stats: Host statistics,
  783. * Include statistics for MAC, IP, TCP & iSCSI.
  784. */
  785. struct iscsi_offload_host_stats {
  786. /* MAC */
  787. uint64_t mactx_frames;
  788. uint64_t mactx_bytes;
  789. uint64_t mactx_multicast_frames;
  790. uint64_t mactx_broadcast_frames;
  791. uint64_t mactx_pause_frames;
  792. uint64_t mactx_control_frames;
  793. uint64_t mactx_deferral;
  794. uint64_t mactx_excess_deferral;
  795. uint64_t mactx_late_collision;
  796. uint64_t mactx_abort;
  797. uint64_t mactx_single_collision;
  798. uint64_t mactx_multiple_collision;
  799. uint64_t mactx_collision;
  800. uint64_t mactx_frames_dropped;
  801. uint64_t mactx_jumbo_frames;
  802. uint64_t macrx_frames;
  803. uint64_t macrx_bytes;
  804. uint64_t macrx_unknown_control_frames;
  805. uint64_t macrx_pause_frames;
  806. uint64_t macrx_control_frames;
  807. uint64_t macrx_dribble;
  808. uint64_t macrx_frame_length_error;
  809. uint64_t macrx_jabber;
  810. uint64_t macrx_carrier_sense_error;
  811. uint64_t macrx_frame_discarded;
  812. uint64_t macrx_frames_dropped;
  813. uint64_t mac_crc_error;
  814. uint64_t mac_encoding_error;
  815. uint64_t macrx_length_error_large;
  816. uint64_t macrx_length_error_small;
  817. uint64_t macrx_multicast_frames;
  818. uint64_t macrx_broadcast_frames;
  819. /* IP */
  820. uint64_t iptx_packets;
  821. uint64_t iptx_bytes;
  822. uint64_t iptx_fragments;
  823. uint64_t iprx_packets;
  824. uint64_t iprx_bytes;
  825. uint64_t iprx_fragments;
  826. uint64_t ip_datagram_reassembly;
  827. uint64_t ip_invalid_address_error;
  828. uint64_t ip_error_packets;
  829. uint64_t ip_fragrx_overlap;
  830. uint64_t ip_fragrx_outoforder;
  831. uint64_t ip_datagram_reassembly_timeout;
  832. uint64_t ipv6tx_packets;
  833. uint64_t ipv6tx_bytes;
  834. uint64_t ipv6tx_fragments;
  835. uint64_t ipv6rx_packets;
  836. uint64_t ipv6rx_bytes;
  837. uint64_t ipv6rx_fragments;
  838. uint64_t ipv6_datagram_reassembly;
  839. uint64_t ipv6_invalid_address_error;
  840. uint64_t ipv6_error_packets;
  841. uint64_t ipv6_fragrx_overlap;
  842. uint64_t ipv6_fragrx_outoforder;
  843. uint64_t ipv6_datagram_reassembly_timeout;
  844. /* TCP */
  845. uint64_t tcptx_segments;
  846. uint64_t tcptx_bytes;
  847. uint64_t tcprx_segments;
  848. uint64_t tcprx_byte;
  849. uint64_t tcp_duplicate_ack_retx;
  850. uint64_t tcp_retx_timer_expired;
  851. uint64_t tcprx_duplicate_ack;
  852. uint64_t tcprx_pure_ackr;
  853. uint64_t tcptx_delayed_ack;
  854. uint64_t tcptx_pure_ack;
  855. uint64_t tcprx_segment_error;
  856. uint64_t tcprx_segment_outoforder;
  857. uint64_t tcprx_window_probe;
  858. uint64_t tcprx_window_update;
  859. uint64_t tcptx_window_probe_persist;
  860. /* ECC */
  861. uint64_t ecc_error_correction;
  862. /* iSCSI */
  863. uint64_t iscsi_pdu_tx;
  864. uint64_t iscsi_data_bytes_tx;
  865. uint64_t iscsi_pdu_rx;
  866. uint64_t iscsi_data_bytes_rx;
  867. uint64_t iscsi_io_completed;
  868. uint64_t iscsi_unexpected_io_rx;
  869. uint64_t iscsi_format_error;
  870. uint64_t iscsi_hdr_digest_error;
  871. uint64_t iscsi_data_digest_error;
  872. uint64_t iscsi_sequence_error;
  873. /*
  874. * iSCSI Custom Host Statistics support, i.e. Transport could
  875. * extend existing host statistics with its own specific statistics
  876. * up to ISCSI_HOST_STATS_CUSTOM_MAX
  877. */
  878. uint32_t custom_length;
  879. struct iscsi_host_stats_custom custom[]
  880. __aligned(sizeof(uint64_t));
  881. };
  882. #endif