iscsi_if.h 26 KB

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