Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sli4_iscsi.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015, Emulex
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 /**
34  * @file
35  * Define iSCSI SLI-4 structures and function prototypes.
36  */
37 
38 #ifndef _SLI4_ISCSI_H
39 #define _SLI4_ISCSI_H
40 
41 #include "sli4.h"
42 #include "ocs_ioctl.h"
43 
44 #define HW_MAX_SGLE_SIZE (64*1024)
45 
46 typedef enum {
54 
55 /**
56  * @brief IP_ADDRESS_FORMAT
57  *
58  * Structure to represent an IP address.
59  */
60 typedef struct sli4_ip_addr_s {
61 #if BYTE_ORDER == LITTLE_ENDIAN
62  uint32_t struct_size:16,
63  :8,
64  ip_type:8;
65  uint8_t ip_addr[16];
66  uint32_t rsvd;
67 #else
68 #error big endian version not defined
69 #endif
71 
72 typedef struct sli4_isns_ip_addr_s {
73 #if BYTE_ORDER == LITTLE_ENDIAN
74  uint32_t struct_size:16,
75  :8,
76  ip_type:8;
77  uint8_t ip_addr[16];
78  uint32_t rsvd0;
79  uint32_t tcp_port:16,
80  udp_port:16;
81 #else
82 #error big endian version not defined
83 #endif
85 
86 /**
87  * @brief IP_ADDRESS_SUBNET_FORMAT
88  *
89  * Structure to represent an IP address with a subnet.
90  */
91 typedef struct sli4_ip_addr_subnet_s {
92 #if BYTE_ORDER == LITTLE_ENDIAN
93  uint32_t struct_size:16,
94  ip_type:8,
95  ipv6_prefix_len:8;
96  uint8_t ip_addr[16];
97  uint8_t subnet[16];
98  uint32_t rsvd;
99 #else
100 #error big endian version not defined
101 #endif
103 
104 /**
105  * @brief ROUTE_TABLE_ENTRY_FORMAT
106  *
107  * Structure to represent an entry in route table
108  */
109 typedef struct sli4_route_table_entry_s {
113 
114 /**
115  * @brief SESSION_LOGIN_OPTIONS
116  *
117  * Structure to represent an iSCSI login parameters shared in a session.
118  */
119 typedef struct sli4_session_login_options_s {
120 #if BYTE_ORDER == LITTLE_ENDIAN
121  uint32_t flags:8,
122  error_recovery_level:8,
123  :16;
124  uint32_t first_burst;
125  uint32_t max_burst;
126  uint32_t max_connections:16,
127  max_r2t:16;
128  uint32_t def_time_to_wait:16,
129  def_time_to_retain:16;
130 #else
131 #error big endian version not defined
132 #endif
134 
135 #define SLI_LOGIN_FLAG_INITIAL_R2T 0x01
136 #define SLI_LOGIN_FLAG_IMMEDIATE_DATA 0x02
137 #define SLI_LOGIN_FLAG_DATA_PDU_IN_ORDER 0x04
138 #define SLI_LOGIN_FLAG_DATA_SEQUENCE_IN_ORDER 0x08
139 
140 /**
141  * @brief TARGET_LOGIN_OPTIONS
142  *
143  * Structure to represent an the iSCSI login parameters on a connection.
144  */
145 typedef struct sli4_target_login_options_s {
147 #if BYTE_ORDER == LITTLE_ENDIAN
148  uint32_t connection_flags:8,
149  data_digest:8,
150  hdr_digest:8,
151  :8;
152  uint32_t max_rcv_dsl;
153 #else
154 #error big endian version not defined
155 #endif
157 
158 /*************************************************************************
159  * SLI-4 iSCSI mailbox command formats and definitions
160  */
161 
162 /**
163  * iSCSI Common opcode (OPC) values
164  */
165 #define SLI4_OPC_ISCSI_ERROR_RECOVERY_INVALIDATE_CMDS 0x01
166 #define SLI4_OPC_ISCSI_CFG_POST_SGL_PAGES 0x02
167 #define SLI4_OPC_ISCSI_CFG_REMOVE_SGL_PAGES 0x03
168 #define SLI4_OPC_ISCSI_NTWK_GET_ROUTE_TABLE 0x0A
169 #define SLI4_OPC_ISCSI_NTWK_SET_ROUTE_TABLE 0x0B
170 #define SLI4_OPC_ISCSI_NTWK_IFACE_CREATE 0x0C
171 #define SLI4_OPC_ISCSI_NTWK_IFACE_DELETE 0x0D
172 #define SLI4_OPC_ISCSI_NTWK_CONFIGURE_STATELESS_IP_ADDR 0x11
173 #define SLI4_OPC_ISCSI_NTWK_RELEASE_STATELESS_IP_ADDR 0x12
174 #define SLI4_OPC_ISCSI_NTWK_DISCOVER_ISNS_SERVER 0x13
175 #define SLI4_OPC_ISCSI_NTWK_DISCOVERED_ISNS_SERVERS 0x14
176 #define SLI4_OPC_ISCSI_NTWK_MODIFY_IP_ADDR 0x15
177 #define SLI4_OPC_ISCSI_NTWK_GET_DEFAULT_GATEWAY 0x16
178 #define SLI4_OPC_ISCSI_NTWK_MODIFY_DEFAULT_GATEWAY 0x17
179 #define SLI4_OPC_ISCSI_NTWK_GET_ALL_IF_ID 0x18
180 #define SLI4_OPC_ISCSI_NTWK_GET_IF_INFO 0x19
181 #define SLI4_OPC_ISCSI_CLEANUP 0x3B
182 #define SLI4_OPC_ISCSI_SET_FRAGNUM_BITS 0x3D
183 #define SLI4_OPC_ISCSI_DEFQ_CREATE 0x40
184 #define SLI4_OPC_ISCSI_DEFQ_DESTROY 0x41
185 #define SLI4_OPC_ISCSI_WQ_CREATE 0x42
186 #define SLI4_OPC_ISCSI_WQ_DESTROY 0x43
187 #define SLI4_OPC_ISCSI_NTWK_SET_MTU 0x44
188 #define SLI4_OPC_ISCSI_TCP_CONNECT_AND_OFFLOAD 0x46
189 #define SLI4_OPC_ISCSI_TCP_DISCONNECT 0x47
190 #define SLI4_OPC_ISCSI_GET_CONNECTION_INFO 0x4a
191 
192 /**
193  * @brief COMMON_ISCSI_ERROR_RECOVERY_INVALIDATE_CMDS
194  *
195  * Invalidate one or more iSCSI Commands
196  */
197 typedef struct sli4_req_common_iscsi_invalidate_cmds_s {
199 #if BYTE_ORDER == LITTLE_ENDIAN
200  uint32_t ref_handle;
201  uint32_t icd_count;
202  struct {
203  uint32_t icd:16,
204  cid:16;
205  } icds[128];
206  uint32_t cleanup_type:16,
207  :16;
208 #else
209 #error big endian version not defined
210 #endif
212 
213 #define SLI4_ISCSI_INVALIDATE_CMDS_STATUS_SUCCESS 0x01
214 #define SLI4_ISCSI_INVALIDATE_CMDS_STATUS_ICD_NOT_FOUND 0x02
215 #define SLI4_ISCSI_INVALIDATE_CMDS_STATUS_UNKNOWN_ERROR 0x04
216 
217 typedef struct sli4_res_common_iscsi_invalidate_cmds_s {
219 #if BYTE_ORDER == LITTLE_ENDIAN
220  uint32_t ref_handle;
221  uint32_t icd_count;
222  uint32_t status[128];
223 #else
224 #error big endian version not defined
225 #endif
227 
228 
229 /**
230  * @brief COMMON_ISCSI_CFG_POST_SGL_PAGES (v0)
231  *
232  * Register Scatter-Gather List (SGL) memory
233  */
234 typedef struct sli4_req_common_iscsi_cfg_post_sgl_pages_v0_s {
236 #if BYTE_ORDER == LITTLE_ENDIAN
237  uint32_t numPages:16,
238  page_offset:16;
239  uint32_t rsvd0;
240  struct {
241  uint32_t low;
242  uint32_t high;
243  } page_physical_address[26];
244  uint32_t rsvd1;
245 #else
246 #error big endian version not defined
247 #endif
249 
250 
251 /**
252  * @brief COMMON_ISCSI_CFG_POST_SGL_PAGES (v1)
253  *
254  * Register Scatter-Gather List (SGL) memory
255  */
256 typedef struct sli4_req_common_iscsi_cfg_post_sgl_pages_v1_s {
258 #if BYTE_ORDER == LITTLE_ENDIAN
259  uint32_t icd_start:16,
260  icd_count:16;
261  struct {
262  uint32_t page0_low;
263  uint32_t page0_high;
264  } page_set[20];
265 #else
266 #error big endian version not defined
267 #endif
269 
270 
271 /**
272  * @brief COMMON_ISCSI_CFG_REMOVE_SGL_PAGES
273  *
274  * Register Scatter-Gather List (SGL) memory
275  */
276 typedef struct sli4_req_common_iscsi_cfg_remove_sgl_pages_s {
278 #if BYTE_ORDER == LITTLE_ENDIAN
279  uint32_t rsvd;
280 #else
281 #error big endian version not defined
282 #endif
284 
285 /**
286  * @brief COMMON_ISCSI_NTWK_IFACE_CREATE
287  *
288  * Create an interface for a new VLAN
289  */
290 typedef struct sli4_req_common_iscsi_ntwk_iface_create_s {
292 #if BYTE_ORDER == LITTLE_ENDIAN
293  uint32_t vlan;
294 #else
295 #error big endian version not defined
296 #endif
298 
299 typedef struct sli4_res_common_iscsi_ntwk_iface_create_s {
301 #if BYTE_ORDER == LITTLE_ENDIAN
302  uint32_t iface;
303 #else
304 #error big endian version not defined
305 #endif
307 
308 /**
309  * @brief COMMON_ISCSI_NTWK_IFACE_DELETE
310  *
311  * Delete a VLAN interface
312  */
313 typedef struct sli4_req_common_iscsi_ntwk_iface_delete_s {
315 #if BYTE_ORDER == LITTLE_ENDIAN
316  uint32_t iface;
317 #else
318 #error big endian version not defined
319 #endif
321 
322 typedef struct sli4_res_common_iscsi_ntwk_iface_delete_s {
325 
326 /**
327  * @brief COMMON_ISCSI_NTWK_CONFIGURE_STATELESS_IP_ADDR
328  *
329  * Configures a stateless IP address for an interface
330  */
331 typedef struct sli4_req_common_iscsi_ntwk_configure_stateless_ip_addr_s {
333 #if BYTE_ORDER == LITTLE_ENDIAN
334  uint32_t iface;
335  uint32_t ip_type;
336  uint32_t flags;
337  uint32_t retry_count;
338 #else
339 #error big endian version not defined
340 #endif
342 
343 /**
344  * @brief COMMON_ISCSI_NTWK_RELEASE_STATELESS_IP_ADDR
345  *
346  * Releases a stateless IP address for an interface
347  */
348 typedef struct sli4_req_common_iscsi_ntwk_release_stateless_ip_addr_s {
350 #if BYTE_ORDER == LITTLE_ENDIAN
351  uint32_t iface;
352  uint32_t ip_type;
353 #else
354 #error big endian version not defined
355 #endif
357 
358 /**
359  * @brief COMMON_ISCSI_NTWK_DISCOVER_ISNS_SERVER
360  *
361  * Discovers the iSNS server via DHCP
362  */
363 typedef struct sli4_req_common_iscsi_ntwk_discover_isns_server_s {
365 #if BYTE_ORDER == LITTLE_ENDIAN
366  uint32_t iface;
367  uint32_t retry_count;
368  uint32_t flags;
369 #else
370 #error big endian version not defined
371 #endif
373 
374 /**
375  * @brief COMMON_ISCSI_NTWK_DISCOVERED_ISNS_SERVERS
376  *
377  * Retrieves the list of iSNS servers discovered via DHCP
378  */
379 typedef struct sli4_req_common_iscsi_ntwk_discovered_isns_servers_s {
381 #if BYTE_ORDER == LITTLE_ENDIAN
382  uint32_t iface;
383 #else
384 #error big endian version not defined
385 #endif
387 
388 typedef struct sli4_res_common_iscsi_ntwk_discovered_isns_servers_s {
390  uint32_t ip_count;
393 
394 /**
395  * @brief COMMON_ISCSI_NTWK_MODIFY_IP_ADDR
396  *
397  * Releases a stateless IP address for an interface
398  */
399 typedef struct sli4_req_common_iscsi_ntwk_modify_ip_addr_s {
401 #if BYTE_ORDER == LITTLE_ENDIAN
402  uint32_t record_count;
403  uint32_t action;
404  uint32_t iface;
406  uint32_t status;
407 #else
408 #error big endian version not defined
409 #endif
411 
412 #define SLI4_ISCSI_ROUTE_TABLE_ENTRIES_MAX OCS_ISCSI_ROUTE_TABLE_ENTRIES_MAX
413 #define SLI4_ISCSI_ROUTE_TABLE_ENTRY_ADD 0x01
414 #define SLI4_ISCSI_ROUTE_TABLE_ENTRY_DEL 0x02
415 
416 /**
417  * @brief COMMON_ISCSI_NTWK_SET_ROUTE_TABLE
418  *
419  * Set an entry in route table
420  */
421 typedef struct sli4_req_common_iscsi_ntwk_set_route_table_s {
423 #if BYTE_ORDER == LITTLE_ENDIAN
424  uint32_t entry_type;
425  uint32_t resvd;
427 #else
428 #error big endian version not defined
429 #endif
431 
432 typedef struct sli4_res_common_iscsi_ntwk_set_route_table_s {
434 #if BYTE_ORDER == LITTLE_ENDIAN
435  uint32_t entry_count;
436  uint32_t resvd;
438 #else
439 #error big endian version not defined
440 #endif
442 
443 /**
444  * @brief COMMON_ISCSI_NTWK_GET_ROUTE_TABLE
445  *
446  * Set an entry in route table
447  */
448 typedef struct sli4_req_common_iscsi_ntwk_get_route_table_s {
450 #if BYTE_ORDER == LITTLE_ENDIAN
451  uint32_t entry_type;
452  uint32_t resvd;
454 #else
455 #error big endian version not defined
456 #endif
458 
459 typedef struct sli4_res_common_iscsi_ntwk_get_route_table_s {
461 #if BYTE_ORDER == LITTLE_ENDIAN
462  uint32_t entry_count;
463  uint32_t resvd;
465 #else
466 #error big endian version not defined
467 #endif
469 
470 /**
471  * @brief COMMON_ISCSI_NTWK_SET_VLAN
472  *
473  * Set VLAN ID for an interface
474  *
475  */
476 typedef struct sli4_req_common_iscsi_ntwk_set_vlan_s {
478 #if BYTE_ORDER == LITTLE_ENDIAN
479  uint32_t iface;
480  uint32_t vlan_id;
481 #else
482 #error big endia version not defined
483 #endif
485 
486 /**
487  * @brief COMMON_ISCSI_NTWK_GET_DEFAULT_GATEWAY
488  *
489  * retrieves the default gateway for an IP type
490  */
491 typedef struct sli4_req_common_iscsi_ntwk_get_default_gateway_s {
493 #if BYTE_ORDER == LITTLE_ENDIAN
494  uint32_t ip_type;
495  uint32_t resv[5];
496 #else
497 #error big endian version not defined
498 #endif
500 
501 typedef struct sli4_res_iscsi_ntwk_get_default_gateway_s {
505 
506 /**
507  * @brief COMMON_ISCSI_NTWK_MODIFY_DEFAULT_GATEWAY
508  *
509  * adds or delete a default gateway
510  */
511 typedef struct sli4_req_common_iscsi_ntwk_modify_default_gateway_s {
513 #if BYTE_ORDER == LITTLE_ENDIAN
514  uint32_t action;
516 #else
517 #error big endian version not defined
518 #endif
520 
521 /**
522  * @brief COMMON_ISCSI_NTWK_GET_ALL_IF_ID
523  *
524  * Retrieves a list of all interfaces.
525  */
526 typedef struct sli4_req_iscsi_ntwk_get_all_if_id_s {
529 
530 typedef struct sli4_res_iscsi_ntwk_get_all_if_id_s {
532  uint32_t iface_count;
533  uint32_t iface[32];
535 
536 /**
537  * @brief COMMON_ISCSI_NTWK_GET_IF_INFO
538  *
539  * Retrieves the IP Addresses and VLAN information for an interface.
540  */
541 typedef struct sli4_req_iscsi_ntwk_get_if_info_s {
543 #if BYTE_ORDER == LITTLE_ENDIAN
544  uint32_t iface;
545  uint32_t ip_type;
546 #else
547 #error big endian version not defined
548 #endif
550 
551 typedef struct sli4_res_iscsi_ntwk_get_if_info_s {
553 #if BYTE_ORDER == LITTLE_ENDIAN
554  uint32_t iface;
555  uint32_t vlan_priority;
556  uint32_t ip_count;
557  uint32_t dhcp_state;
559 #else
560 #error big endian version not defined
561 #endif
563 
564 /**
565  * @brief COMMON_ISCSI_CLEANUP
566  *
567  * Sent before an unload to allow the SLI port to clean up.
568  */
569 typedef struct sli4_req_iscsi_cleanup_v0_s {
571 #if BYTE_ORDER == LITTLE_ENDIAN
572  uint32_t ulp:16,
573  hdr_ring_id:8,
574  data_ring_id:8;
575 #else
576 #error big endian version not defined
577 #endif
579 
580 typedef struct sli4_req_iscsi_cleanup_v1_s {
582 #if BYTE_ORDER == LITTLE_ENDIAN
583  uint32_t ulp:16,
584  :16;
585  uint32_t hdr_ring_id:16,
586  :16;
587  uint32_t data_ring_id:16,
588  :16;
589 #else
590 #error big endian version not defined
591 #endif
593 
594 /**
595  * @brief COMMON_ISCSI_SET_FRAGNUM_BITS
596  *
597  * Allows the host to set the number of SGEs per ICD.
598  */
599 typedef struct sli4_req_iscsi_set_frag_bits_s {
601 #if BYTE_ORDER == LITTLE_ENDIAN
602  uint32_t num_bits;
603 #else
604 #error big endian version not defined
605 #endif
607 
608 /**
609  * @brief ISCSI_WQ_CREATE
610  *
611  * Create a Work Queue for iSCSI use
612  */
613 typedef struct sli4_req_iscsi_wq_create_s {
615 #if BYTE_ORDER == LITTLE_ENDIAN
616  uint32_t num_pages:16,
617  ulp:8,
618  dua:1,
619  bqu:1,
620  rsvd:6;
621  struct {
622  uint32_t low;
623  uint32_t high;
624  } page_physical_address[8];
625 #else
626 #error big endian version not defined
627 #endif
629 
630 #define SLI4_ISCSI_WQ_CREATE_V0_MAX_PAGES 4
631 
632 /**
633  * @brief ISCSI_WQ_DESTROY
634  *
635  * Destroy a iSCSI Work Queue
636  */
637 typedef struct sli4_req_iscsi_wq_destroy_s {
639 #if BYTE_ORDER == LITTLE_ENDIAN
640  uint32_t wq_id;
641 #else
642 #error big endian version not defined
643 #endif
645 
646 /**
647  * @brief ISCSI_NTWK_SET_MTU
648  *
649  * Sets the maximum transmission unit
650  */
651 typedef struct sli4_req_iscsi_ntwk_set_mtu_s {
653 #if BYTE_ORDER == LITTLE_ENDIAN
654  uint32_t mtu;
655 #else
656 #error big endian version not defined
657 #endif
659 
660 /**
661  * @brief ISCSI_TCP_CONNECT_AND_OFFLOAD
662  *
663  * Open a TCP connection to the specified IP address and TCP port.
664  */
665 typedef struct sli4_req_iscsi_tcp_connect_v0_s {
667 #if BYTE_ORDER == LITTLE_ENDIAN
669  uint32_t tcp_port:16,
670  cid:16;
671  uint32_t cq_id:16,
672  defq_id:16;
675  uint32_t hdr_ring_id:16,
676  data_ring_id:16;
677  uint32_t do_offload:8,
678  :24;
679 #else
680 #error big endian version not defined
681 #endif
683 
684 typedef struct sli4_req_iscsi_tcp_connect_v1_s {
686 #if BYTE_ORDER == LITTLE_ENDIAN
688  uint32_t tcp_port:16,
689  cid:16;
690  uint32_t cq_id:16,
691  defq_id:16;
694  uint32_t hdr_ring_id:16,
695  data_ring_id:16;
696  uint32_t do_offload:8,
697  :24;
698  uint32_t window_size:16,
699  window_shift:8,
700  :8;
701  uint32_t tcp_mss:24,
702  :8;
703 #else
704 #error big endian version not defined
705 #endif
707 
708 typedef struct sli4_res_iscsi_tcp_connect_s {
710 #if BYTE_ORDER == LITTLE_ENDIAN
711  uint32_t conn_handle;
712  uint32_t cid:16,
713  :16;
714 #else
715 #error big endian version not defined
716 #endif
718 
719 
720 /**
721  * @brief ISCSI_TCP_DISCONNECT
722  *
723  * Open a TCP connection to the specified IP address and TCP port.
724  */
725 typedef struct sli4_req_iscsi_tcp_disconnect_s {
727 #if BYTE_ORDER == LITTLE_ENDIAN
728  uint32_t conn_handle;
729 #else
730 #error big endian version not defined
731 #endif
733 
734 /**
735  * @brief ISCSI_GET_CONNECTION_INFO
736  *
737  * Retrieves the source/destination IP addresses, ports and MSS
738  */
739 typedef struct sli4_req_iscsi_get_connection_info_s {
741 #if BYTE_ORDER == LITTLE_ENDIAN
742  uint32_t conn_handle;
743 #else
744 #error big endian version not defined
745 #endif
747 
748 typedef struct sli4_res_iscsi_get_connection_info_s {
750 #if BYTE_ORDER == LITTLE_ENDIAN
753  uint32_t src_port:16,
754  dest_port:16;
755  uint32_t tcp_mss;
756  uint32_t iface;
757  uint32_t wscale:8,
758  :24;
759 #else
760 #error big endian version not defined
761 #endif
763 
764 /**
765  * @brief ISCSI_DEFQ_CREATE
766  *
767  * Create a Receive Queue for iSCSI use
768  */
769 typedef struct sli4_req_iscsi_defq_create_s {
771 #if BYTE_ORDER == LITTLE_ENDIAN
772  uint32_t num_pages:16,
773  ulp:8,
774  dua:1,
775  bqu:1,
776  rsvd:6;
777  uint32_t :16,
778  ring_size:4,
779  :12;
780  uint32_t rsvd0;
781  uint32_t buffer_size:16,
782  cq_id:10,
783  :6;
784  uint32_t rsvd1;
785  struct {
786  uint32_t low;
787  uint32_t high;
788  } page_physical_address[8];
789 #else
790 #error big endian version not defined
791 #endif
793 
794 #define SLI4_ISCSI_DEFQ_CREATE_V0_MAX_PAGES 8
795 #define SLI4_ISCSI_DEFQ_CREATE_V0_MIN_BUF_SIZE 64
796 #define SLI4_ISCSI_DEFQ_CREATE_V0_MAX_BUF_SIZE 8192
797 #define SLI4_ISCSI_DEFQE_SIZE 8
798 
799 /**
800  * @brief ISCSI_DEFQ_DESTROY
801  *
802  * Destroy a iSCSI Receive Queue
803  */
804 typedef struct sli4_req_iscsi_defq_destroy_s {
806 #if BYTE_ORDER == LITTLE_ENDIAN
807  uint32_t id;
808 #else
809 #error big endian version not defined
810 #endif
812 
813 /**
814  * iSCSI Initiator opcode (OPC) values
815  */
816 #define SLI4_OPC_ISCSI_INI_INVALIDATE_CONNECTION 0x2A
817 /**
818  * @brief ISCSI_INI_INVALIDATE_CONNECTION
819  *
820  * Invalidate a connection and optionally send a TCP RST
821  */
822 typedef struct sli4_req_iscsi_ini_invalidate_connection_s {
824 #if BYTE_ORDER == LITTLE_ENDIAN
825  uint32_t session_handle;
826  uint32_t cid:16,
827  :16;
828  uint32_t cleanup_type:16,
829  save_config:16;
830 #else
831 #error big endian version not defined
832 #endif
834 
835 
836 /**
837  * iSCSI Target opcode (OPC) values
838  */
839 #define SLI4_OPC_ISCSI_TGT_START_LISTEN_SERVER 0x01
840 #define SLI4_OPC_ISCSI_TGT_STOP_LISTEN_SERVER 0x02
841 #define SLI4_OPC_ISCSI_TGT_GET_CONNECTION_INFO 0x03
842 #define SLI4_OPC_ISCSI_TGT_CONNECTION_REJECT 0x04
843 #define SLI4_OPC_ISCSI_TGT_OFFLOAD_CONNECTION 0x05
844 #define SLI4_OPC_ISCSI_TGT_ISNS_SEND_PACKET 0x06
845 #define SLI4_OPC_ISCSI_TGT_INVALIDATE_CONNECTION 0x07
846 #define SLI4_OPC_ISCSI_TGT_START_ESI_LISTEN 0x0B
847 #define SLI4_OPC_ISCSI_TGT_STOP_ESI_LISTEN 0x0C
848 
849 /**
850  * @brief ISCSI_TGT_START_LISTEN_SERVER
851  *
852  * Starts a listen server at the specified IP and port
853  */
854 typedef struct sli4_req_iscsi_tgt_start_listen_server_s {
856 #if BYTE_ORDER == LITTLE_ENDIAN
858  uint32_t tcp_port;
859  uint32_t rsvd;
860 #else
861 #error big endian version not defined
862 #endif
864 
865 /**
866  * @brief ISCSI_TGT_STOP_LISTEN_SERVER
867  *
868  * Stops a listen server at the specified IP and port
869  */
870 typedef struct sli4_req_iscsi_tgt_stop_listen_server_s {
872 #if BYTE_ORDER == LITTLE_ENDIAN
874  uint32_t tcp_port;
875  uint32_t rsvd;
876 #else
877 #error big endian version not defined
878 #endif
880 
881 /**
882  * @brief ISCSI_TGT_GET_CONNECTION_INFO
883  *
884  * Retrieves the source/destination IP addresses, ports and MSS
885  */
886 typedef struct sli4_req_iscsi_tgt_get_connection_info_s {
888 #if BYTE_ORDER == LITTLE_ENDIAN
889  uint32_t conn_handle;
890 #else
891 #error big endian version not defined
892 #endif
894 
895 typedef struct sli4_res_iscsi_tgt_get_connection_info_s {
897 #if BYTE_ORDER == LITTLE_ENDIAN
900  uint32_t src_port:16,
901  dest_port:16;
902  uint32_t tcp_mss;
903 #else
904 #error big endian version not defined
905 #endif
907 
908 /**
909  * @brief ISCSI_TGT_CONNECTION_REJECT
910  *
911  * Inform the SLI port to close and free the connection.
912  */
913 typedef struct sli4_req_iscsi_tgt_connection_reject_s {
915 #if BYTE_ORDER == LITTLE_ENDIAN
916  uint32_t conn_handle;
917 #else
918 #error big endian version not defined
919 #endif
921 
922 /**
923  * @brief ISCSI_TGT_OFFLOAD_CONNECTION
924  *
925  * Offloads a new connection and updates the TCP window size.
926  */
927 typedef struct sli4_req_iscsi_tgt_offload_connection_v0_s {
929 #if BYTE_ORDER == LITTLE_ENDIAN
930  uint32_t conn_handle;
931  uint32_t cid:16,
932  cq_id:16;
933  uint32_t hdr_id:8,
934  data_id:8,
935  ulp_number:16;
936  uint32_t tcp_window;
937  uint32_t nrs:1,
938  :31;
939  uint32_t rsvd;
941 #else
942 #error big endian version not defined
943 #endif
945 
946 typedef struct sli4_req_iscsi_tgt_offload_connection_v1_s {
948 #if BYTE_ORDER == LITTLE_ENDIAN
949  uint32_t conn_handle;
950  uint32_t cid:16,
951  cq_id:16;
952  uint32_t hdr_id:16,
953  :16;
954  uint32_t data_id:16,
955  :16;
956  uint32_t ulp_number:16,
957  :16;
958  uint32_t tcp_window;
959  uint32_t nrs:1,
960  :31;
961  uint32_t rsvd;
963 #else
964 #error big endian version not defined
965 #endif
967 
968 /**
969  * @brief ISCSI_TGT_ISNS_SEND_PACKET
970  *
971  * Stops a listen server at the specified IP and port
972  */
973 typedef struct sli4_req_iscsi_tgt_isns_send_packet_s {
975 #if BYTE_ORDER == LITTLE_ENDIAN
977  uint32_t pkt_size;
978 #else
979 #error big endian version not defined
980 #endif
982 
983 /**
984  * @brief ISCSI_TGT_INVALIDATE_CONNECTION
985  *
986  * Invalidate a connection and optionally send a TCP RST
987  */
988 typedef struct sli4_req_iscsi_tgt_invalidate_connection_s {
990 #if BYTE_ORDER == LITTLE_ENDIAN
991  uint32_t conn_handle;
992  uint32_t cid:16,
993  cleanup_type:16;
994 #else
995 #error big endian version not defined
996 #endif
998 
999 /**
1000  * @brief ISCSI_TGT_START_ESI_LISTEN
1001  *
1002  * Starts an ESI listen server at the specified IP and port
1003  */
1004 typedef struct sli4_req_iscsi_tgt_start_esi_listen_s {
1006 #if BYTE_ORDER == LITTLE_ENDIAN
1008  uint32_t tcp_port;
1009  uint32_t rsvd;
1010 #else
1011 #error big endian version not defined
1012 #endif
1014 
1015 /**
1016  * @brief ISCSI_TGT_STOP_ESI_LISTEN
1017  *
1018  * Stops an ESI listen server at the specified IP and port
1019  */
1020 typedef struct sli4_req_iscsi_tgt_stop_esi_listen_s {
1022 #if BYTE_ORDER == LITTLE_ENDIAN
1024  uint32_t tcp_port;
1025  uint32_t rsvd;
1026 #else
1027 #error big endian version not defined
1028 #endif
1030 
1031 
1032 /**
1033  * Work Queue Entry (WQE) types
1034  */
1035 #define SLI4_WQE_INI_WRITE 0x01
1036 #define SLI4_WQE_INI_TMF 0x02
1037 #define SLI4_WQE_INI_NOP 0x03
1038 #define SLI4_WQE_INI_READ 0x05
1039 #define SLI4_WQE_CONTEXT_UPDATE 0x07
1040 #define SLI4_WQE_TGT_STS 0x08
1041 #define SLI4_WQE_TGT_DATAIN 0x09
1042 #define SLI4_WQE_TGT_SOS 0x0A
1043 #define SLI4_WQE_UNASSISTED 0x0B
1044 
1045 #define SLI4_ISCSI_WQE_SIZE 64
1046 /* WQE DIF Modes */
1047 #define SLI4_WQE_DIF_MODE_DISABLED 0x00
1048 #define SLI4_WQE_DIF_MODE_PASS_THRU 0x01
1049 #define SLI4_WQE_DIF_MODE_REMOVE 0x02
1050 #define SLI4_WQE_DIF_MODE_INSERT 0x03
1051 
1052 /* WQE DIF block sizes */
1053 #define SLI4_WQE_DIF_BLK_SIZE_512 0x00
1054 #define SLI4_WQE_DIF_BLK_SIZE_1024 0x01
1055 #define SLI4_WQE_DIF_BLK_SIZE_2048 0x02
1056 #define SLI4_WQE_DIF_BLK_SIZE_4096 0x03
1057 #define SLI4_WQE_DIF_BLK_SIZE_520 0x04
1058 #define SLI4_WQE_DIF_BLK_SIZE_4104 0x05
1059 
1060 /**
1061  * @brief Asynchronouse Event : Link State ACQE
1062  */
1063 typedef struct sli4_link_state_s {
1064 #if BYTE_ORDER == LITTLE_ENDIAN
1065  uint32_t link_number:8,
1066  attn_type:8,
1067  port_duplex:8,
1068  port_speed:8;
1069  uint32_t port_fault:8,
1070  :8,
1071  logical_link_speed:16;
1072  uint32_t event_tag;
1073 uint32_t :8,
1074  event_code:8,
1075  event_type:8, /** values are protocol specific */
1076  :6,
1077  ae:1, /** async event - this is an ACQE */
1078  val:1; /** valid - contents of CQE are valid */
1079 #else
1080 #error big endian version not defined
1081 #endif
1083 
1084 #define ISCSI_CQE_CODE_NORMAL 0x01
1085 #define ISCSI_CQE_CODE_CMD_DIGEST_ERROR 0x02
1086 #define ISCSI_CQE_CODE_RECV_PDU_DSL_ERROR 0x03
1087 #define ISCSI_CQE_CODE_RECV_SEQ_BURST_ERROR 0x04
1088 #define ISCSI_CQE_CODE_RECV_AHS_NOT_SUPPORTED 0x05
1089 #define ISCSI_CQE_CODE_HDR_DIGEST_ERROR 0x06
1090 #define ISCSI_CQE_CODE_OPCODE_ERROR 0x07
1091 #define ISCSI_CQE_CODE_ITT_TTT_WRONG_CXN 0x08
1092 #define ISCSI_CQE_CODE_ITT_TTT_TOO_BIG 0x09
1093 #define ISCSI_CQE_CODE_TCP_RECV_RST 0x0A
1094 #define ISCSI_CQE_CODE_TCP_TIMEOUT 0x0B
1095 #define ISCSI_CQE_CODE_TCP_SENT_RST 0x0C
1096 #define ISCSI_CQE_CODE_TCP_RECV_FIN 0x0D
1097 #define ISCSI_CQE_CODE_BAD_UNSOL_PDU 0x0E
1098 #define ISCSI_CQE_CODE_BAD_WQE_INDEX 0x0F
1099 #define ISCSI_CQE_CODE_RESIDUAL_OVERRUN 0x10
1100 #define ISCSI_CQE_CODE_RESIDUAL_UNDERRUN 0x11
1101 #define ISCSI_CQE_CODE_INVALID_STATSN 0x12
1102 #define ISCSI_CQE_CODE_R2T_INVALID_FIELDS 0x13
1103 #define ISCSI_CQE_CODE_INVALID_LUN 0x14
1104 #define ISCSI_CQE_CODE_INVALID_ICD_STATE 0x15
1105 #define ISCSI_CQE_CODE_RECV_PDU_INVALID_ITT 0x16
1106 #define ISCSI_CQE_CODE_RECV_SEQ_BUF_OUT_OF_ORDER 0x17
1107 #define ISCSI_CQE_CODE_RECV_PDU_INVALID_DATASN 0x18
1108 #define ISCSI_CQE_CODE_HOST_CXN_INVALIDATION 0x19
1109 #define ISCSI_CQE_CODE_HOST_CXN_INVL_WITH_PDU 0x1A
1110 #define ISCSI_CQE_CODE_HOST_CMD_INVALIDATION 0x1B
1111 #define ISCSI_CQE_CODE_UNSOL_HDR_NOTIFY 0x1C
1112 #define ISCSI_CQE_CODE_UNSOL_DATA_NOTIFY 0x1D
1113 #define ISCSI_CQE_CODE_UNSOL_DATA_DIGEST_ERROR 0x1E
1114 #define ISCSI_CQE_CODE_TCP_ACK 0x1F
1115 #define ISCSI_CQE_CODE_CMD_DATA_DIFF_CXN 0x20
1116 #define ISCSI_CQE_CODE_DIF_ERROR 0x21
1117 #define ISCSI_CQE_CODE_RECV_UNSOL_PDU_ERROR 0x22
1118 #define ISCSI_CQE_CODE_TX_DIF_ERR_CQE 0x23
1119 #define ISCSI_CQE_CODE_MAX 0x23
1120 
1121 #define SLI4_ISCSI_ACQE_NEW_TCP_CONNECTION 0x10
1122 #define SLI4_ISCSI_ACQE_STATELESS_OPERATION_COMPLETE_IPV4 0x20
1123 #define SLI4_ISCSI_ACQE_STATELESS_OPERATION_COMPLETE_IPV6 0x40
1124 #define SLI4_ISCSI_ACQE_DHCP_OPERATION_COMPLETE 0x80
1125 #define SLI4_ISCSI_ACQE_ICMPV6_ERROR_PKT_RECVD 0x83
1126 #define SLI4_ISCSI_ACQE_IPV6_DEFAULT_PORT_MTU_CHANGED 0x86
1127 
1128 /**
1129  * @brief Asynchronouse Event : iSCSI Event
1130  */
1131 typedef struct sli4_iscsi_s {
1132 #if BYTE_ORDER == LITTLE_ENDIAN
1133  uint32_t rsvd0[3];
1134 uint32_t :8,
1135  event_code:8,
1136  event_type:8, /** values are protocol specific */
1137  :6,
1138  ae:1, /** async event - this is an ACQE */
1139  val:1; /** valid - contents of CQE are valid */
1140 #else
1141 #error big endian version not defined
1142 #endif
1143 } sli4_iscsi_t;
1144 
1145 /**
1146  * @brief Asynchronouse Event : iSCSI Event - New TCP Connection
1147  */
1148 typedef struct sli4_iscsi_new_tcp_cnx_accepted_s {
1149 #if BYTE_ORDER == LITTLE_ENDIAN
1150  uint32_t cid;
1151  uint32_t rsvd0[2];
1152 uint32_t :8,
1153  event_code:8,
1154  event_type:8, /** values are protocol specific */
1155  :6,
1156  ae:1, /** async event - this is an ACQE */
1157  val:1; /** valid - contents of CQE are valid */
1158 #else
1159 #error big endian version not defined
1160 #endif
1162 
1163 /**
1164  * @brief Asynchronouse Event : iSCSI Event - stateless operation complete
1165  */
1166 typedef struct sli4_iscsi_stateless_op_cmpl_s {
1167 #if BYTE_ORDER == LITTLE_ENDIAN
1168  uint32_t status:8,
1169  additional_status:8,
1170  :16;
1171  uint32_t iface;
1172  uint32_t rsvd0;
1173 uint32_t :8,
1174  event_code:8,
1175  event_type:8, /** values are protocol specific */
1176  :6,
1177  ae:1, /** async event - this is an ACQE */
1178  val:1; /** valid - contents of CQE are valid */
1179 #else
1180 #error big endian version not defined
1181 #endif
1183 
1184 /**
1185  * @brief Asynchronouse Event : iSCSI Event - DHCP operation complete
1186  */
1187 typedef struct sli4_iscsi_dhcp_op_cmpl_s {
1188 #if BYTE_ORDER == LITTLE_ENDIAN
1189  uint32_t status:8,
1190  additional_status:8,
1191  :16;
1192  uint32_t iface;
1193  uint32_t rsvd0;
1194 uint32_t :8,
1195  event_code:8,
1196  event_type:8, /** values are protocol specific */
1197  :6,
1198  ae:1, /** async event - this is an ACQE */
1199  val:1; /** valid - contents of CQE are valid */
1200 #else
1201 #error big endian version not defined
1202 #endif
1204 
1205 /**
1206  * @brief Asynchronouse Event : iSCSI Event - iCMPv6 Error
1207  */
1208 typedef struct sli4_iscsi_icmpv6_error_s {
1209 #if BYTE_ORDER == LITTLE_ENDIAN
1210  uint32_t iface;
1211  uint32_t error_code:8,
1212  :24;
1213  uint32_t rsvd0;
1214 uint32_t :8,
1215  event_code:8,
1216  event_type:8, /** values are protocol specific */
1217  :6,
1218  ae:1, /** async event - this is an ACQE */
1219  val:1; /** valid - contents of CQE are valid */
1220 #else
1221 #error big endian version not defined
1222 #endif
1224 
1225 /**
1226  * @brief Asynchronouse Event : iSCSI Event - iCMPv6 Error
1227  */
1228 typedef struct sli4_iscsi_port_mtu_changed_s {
1229 #if BYTE_ORDER == LITTLE_ENDIAN
1230  uint32_t new_mtu;
1231  uint32_t rsvd0[2];
1232 uint32_t :8,
1233  event_code:8,
1234  event_type:8, /** values are protocol specific */
1235  :6,
1236  ae:1, /** async event - this is an ACQE */
1237  val:1; /** valid - contents of CQE are valid */
1238 #else
1239 #error big endian version not defined
1240 #endif
1242 
1243 typedef struct sli4_iscsi_common_cqe_s {
1244  uint32_t rsvd1;
1245  uint32_t rsvd2;
1246  uint32_t code:6,
1247  :26;
1248  uint32_t rsvd3;
1250 /**
1251  * @brief iSCSI Event Types
1252  */
1253 #define SLI4_LINK_STATE_PHYSICAL 0x00
1254 #define SLI4_LINK_STATE_LOGICAL 0x01
1255 
1256 #define SLI4_GRP5_QOS_SPEED 0x01
1257 
1258 #define SLI4_PORT_SPEED_NO_LINK 0x0
1259 #define SLI4_PORT_SPEED_10_MBPS 0x1
1260 #define SLI4_PORT_SPEED_100_MBPS 0x2
1261 #define SLI4_PORT_SPEED_1_GBPS 0x3
1262 #define SLI4_PORT_SPEED_10_GBPS 0x4
1263 
1264 #define SLI4_PORT_DUPLEX_NONE 0x0
1265 #define SLI4_PORT_DUPLEX_HALF 0x1
1266 #define SLI4_PORT_DUPLEX_FULL 0x2
1267 
1268 #define SLI4_PORT_LINK_STATUS_DOWN 0x0
1269 #define SLI4_PORT_LINK_STATUS_UP 0x1
1270 
1271 
1272 /**
1273  * Code definitions applicable to all FC/FCoE CQE types
1274  */
1275 #define SLI4_CQE_CODE_OFFSET 14
1276 
1277 #define SLI4_CQE_CODE_WORK_REQUEST_COMPLETION 0x01
1278 #define SLI4_CQE_CODE_RQ_ASYNC 0x04
1279 typedef int32_t cqe_handler_t(sli4_t *, uint8_t *cqe,
1280  sli4_qentry_fields_t *fields);
1281 
1282 typedef struct sli_wqe_handlers {
1283  int32_t (*wqe_update_context)(sli4_t *sli4, void *buf, size_t size,
1284  ocs_hal_target_login_options_t *lgn_options,
1285  uint32_t statsn);
1286 
1287  int32_t (*wqe_ini_read)(sli4_t *sli4, void *buf, size_t size,
1288  uint16_t lun, uint32_t exp_xfer_len,
1289  uint32_t cmdsn, uint16_t icd_index,
1290  ocs_hal_dif_info_t* dif_info,
1291  sli4_sge_t *sgl, uint32_t n_sge);
1292 
1293  int32_t (*wqe_ini_write)(sli4_t *sli4, void *buf, size_t size,
1294  uint16_t lun, uint32_t exp_xfer_len,
1295  uint32_t cmdsn, uint16_t icd_index,
1296  ocs_hal_dif_info_t* dif_info,
1297  sli4_sge_t *sgl, uint32_t n_sge);
1298 
1299  int32_t (*wqe_ini_nop)(sli4_t *sli4, void *buf, size_t size,
1300  uint8_t dm, uint32_t cmdsn, ocs_dma_t *bhs,
1301  ocs_dma_t *payload1, ocs_dma_t *payload2,
1302  uint32_t exp_xfer_len, uint16_t icd_index);
1303 
1304  int32_t (*wqe_ini_tmf)(sli4_t *sli4, void *buf, size_t size,
1305  uint16_t lun, uint32_t cmdsn, uint16_t icd_index,
1306  sli4_sge_t *sgl, uint32_t n_sge);
1307 
1308  int32_t (*wqe_tgt_datain)(sli4_t *sli4, void *buf, size_t size,
1309  ocs_dma_t *bhs, uint16_t lun, uint8_t dm,
1310  uint8_t underrun, uint8_t overrun,
1311  uint32_t exp_xfer_len, uint16_t icd_index,
1312  uint16_t ref_icd_index, uint32_t data_sn,
1313  uint8_t piggy_back_status,
1314  ocs_hal_dif_info_t* dif_info,
1315  sli4_sge_t *sgl, uint32_t n_sge);
1316 
1317  int32_t (*wqe_tgt_sts)(sli4_t *sli4, void *buf, size_t size,
1318  ocs_dma_t *bhs, uint16_t lun,
1319  uint32_t exp_xfer_len, uint32_t exp_data_sn,
1320  uint32_t itt, uint16_t icd_index,
1321  uint16_t ref_icd_index,
1322  ocs_hal_dif_info_t* dif_info,
1323  uint32_t r2t_offset, sli4_sge_t *sgl, uint32_t n_sge);
1324 
1325  int32_t (*wqe_tgt_sos)(sli4_t *sli4, void *buf, size_t size,
1326  ocs_dma_t *bhs, ocs_dma_t *payload1,
1327  ocs_dma_t *payload2, uint16_t lun, uint8_t dm,
1328  uint32_t exp_xfer_len, uint16_t icd_index);
1329 
1330  int32_t (*wqe_unassisted)(sli4_t *sli4, void *buf, size_t size,
1331  uint8_t set_dm, uint8_t incr_statsn,
1332  uint8_t is_login, ocs_dma_t *bhs,
1333  ocs_dma_t *payload1, ocs_dma_t *payload2,
1334  uint32_t exp_xfer_len, uint16_t icd_index);
1335 
1336  int32_t (*queue_iscsi_wq_write)(sli4_t *sli4, sli4_queue_t *q,
1337  uint8_t *entry, void *io);
1338 
1339  int32_t (*queue_iscsi_wqe_invalidate)(sli4_t *sli4, sli4_queue_t *q,
1340  void *io, uint8_t is_for_tm);
1342 
1343 int32_t sli_cmd_iscsi_common_get_route_table(sli4_t *sli4, void *buf, size_t size,
1344  uint64_t tag, ocs_dma_t *dma);
1345 int32_t sli_cmd_iscsi_common_set_route_table(sli4_t *sli4, void *buf, size_t size,
1346  uint64_t tag, uint8_t isadd,
1347  ocs_hal_ip_address_subnet_t *hal_ipsub,
1348  ocs_hal_ip_address_t *hal_gateway,
1349  ocs_dma_t *dma);
1350 extern int32_t sli_iscsi_process_link_state(sli4_t *, void *);
1351 extern int32_t sli_iscsi_process_iscsi(sli4_t *, void *);
1352 extern int32_t sli_iscsi_cqe_parse(sli4_t *, sli4_queue_t *, uint8_t *, sli4_qentry_fields_t *);
1353 extern uint32_t sli_iscsi_response_length(sli4_t *, uint8_t *);
1354 extern int32_t sli_iscsi_set_frag_bits(sli4_t *);
1355 extern int32_t sli_iscsi_post_sgl_pages(sli4_t *);
1356 extern int32_t sli_iscsi_io_get_icd_and_sgl(sli4_t *, uint32_t, uint16_t*, void**);
1357 extern uint32_t sli_iscsi_io_length(sli4_t *, uint8_t *);
1358 extern uint8_t sli_iscsi_conv_hal_ip_addr_type(ocs_hal_ip_type_e ip_type);
1359 extern ocs_hal_ip_type_e sli_iscsi_conv_sli4_ip_addr_type(uint8_t ip_type);
1360 extern int32_t sli_cmd_iscsi_common_iface_create(sli4_t *, void *, size_t, uint64_t, uint32_t);
1361 extern int32_t sli_cmd_iscsi_common_iface_delete(sli4_t *, void *, size_t, uint64_t, uint32_t);
1362 extern int32_t sli_cmd_iscsi_common_configure_stateless_ip_addr(sli4_t *sli4, void *buf,
1363  size_t size, uint64_t tag,
1364  uint32_t iface, uint8_t isv4,
1365  uint32_t retries);
1366 extern int32_t sli_cmd_iscsi_common_release_stateless_ip_addr(sli4_t *sli4, void *buf,
1367  size_t size, uint64_t tag,
1368  uint32_t iface, uint8_t isv4);
1369 extern int32_t sli_cmd_iscsi_common_discover_isns_server(sli4_t *sli4, void *buf,
1370  size_t size, uint64_t tag,
1371  uint32_t iface, uint32_t retries);
1372 extern int32_t sli_cmd_iscsi_common_discovered_isns_servers(sli4_t *sli4, void *buf,
1373  size_t size, uint64_t tag,
1374  uint32_t iface);
1375 extern int32_t sli_cmd_iscsi_common_modify_ip_addr(sli4_t *sli4, void *buf,
1376  size_t size, uint64_t tag,
1377  uint32_t iface, uint8_t isadd,
1378  ocs_hal_ip_address_subnet_t *ipaddr);
1379 extern int32_t sli_cmd_iscsi_common_get_default_gateway(sli4_t *sli4, void *buf,
1380  size_t size, uint64_t tag,
1381  uint8_t isv4);
1382 extern int32_t sli_cmd_iscsi_common_modify_default_gateway(sli4_t *sli4, void *buf,
1383  size_t size, uint64_t tag,
1384  uint8_t isadd,
1385  ocs_hal_ip_address_t *gateway);
1386 extern int32_t sli_cmd_iscsi_common_get_all_if_id(sli4_t *, void *, size_t, uint64_t);
1387 extern int32_t sli_cmd_iscsi_common_get_if_info(sli4_t *, void *, size_t, uint64_t, uint32_t, uint8_t);
1388 extern int32_t sli_cmd_iscsi_cleanup_v0(sli4_t *sli4, void *buf,
1389  size_t size, uint64_t tag,
1390  uint16_t ulp_no,
1391  uint8_t hdrq_id,
1392  uint8_t dataq_id);
1393 extern int32_t sli_cmd_iscsi_cleanup_v1(sli4_t *sli4, void *buf,
1394  size_t size, uint64_t tag,
1395  uint16_t ulp_no,
1396  uint16_t hdrq_id,
1397  uint16_t dataq_id);
1398 extern int32_t sli_cmd_iscsi_tgt_start_listen_server(sli4_t *sli4, void *buf,
1399  size_t size, uint64_t tag,
1400  ocs_hal_ip_address_t *ipaddr,
1401  uint32_t tcp_port);
1402 extern int32_t sli_cmd_iscsi_tgt_stop_listen_server(sli4_t *sli4, void *buf,
1403  size_t size, uint64_t tag,
1404  ocs_hal_ip_address_t *ipaddr,
1405  uint32_t tcp_port);
1406 extern int32_t sli_cmd_iscsi_tgt_get_connection_info(sli4_t *sli4, void *buf,
1407  size_t size, uint64_t tag,
1408  uint32_t conn_hdl);
1409 
1410 extern int32_t sli_cmd_iscsi_tcp_connect_v0(sli4_t *sli4, void *buf,
1411  size_t size, uint64_t tag,
1412  ocs_hal_ip_address_t *ipaddr,
1413  uint32_t tcp_port,
1414  uint16_t cid,
1415  uint16_t cq_id,
1416  ocs_dma_t *data_out,
1417  uint16_t hdr_ring_id,
1418  uint16_t data_ring_id,
1419  uint8_t do_offload);
1420 
1421 extern int32_t sli_cmd_iscsi_tcp_connect_v1(sli4_t *sli4, void *buf,
1422  size_t size, uint64_t tag,
1423  ocs_hal_ip_address_t *ipaddr,
1424  uint32_t tcp_port,
1425  uint16_t cid,
1426  uint16_t cq_id,
1427  ocs_dma_t *data_out,
1428  uint16_t hdr_ring_id,
1429  uint16_t data_ring_id,
1430  uint8_t do_offload,
1431  uint16_t window_size,
1432  uint8_t window_scale,
1433  uint32_t tcp_mss);
1434 
1435 extern int32_t sli_cmd_iscsi_tcp_disconnect(sli4_t *sli4, void *buf,
1436  size_t size, uint64_t tag,
1437  uint32_t conn_handle);
1438 
1439 extern int32_t sli_cmd_iscsi_get_connection_info(sli4_t *sli4, void *buf,
1440  size_t size, uint64_t tag,
1441  uint32_t conn_hdl);
1442 
1443 extern int32_t sli_cmd_iscsi_tgt_connection_reject(sli4_t *sli4, void *buf,
1444  size_t size, uint64_t tag,
1445  uint32_t conn_hdl);
1446 
1447 extern int32_t sli_cmd_iscsi_tgt_offload_connection_v0(sli4_t *sli4, void *buf,
1448  size_t size, uint64_t tag,
1449  uint32_t conn_hdl,
1450  uint32_t tcp_window_size,
1451  uint16_t ulp_no,
1452  uint16_t wq_id,
1453  uint16_t cq_id,
1454  uint8_t hdrq_id,
1455  uint8_t dataq_id,
1456  uint8_t nrs,
1457  ocs_hal_target_login_options_t *lgn_options);
1458 extern int32_t sli_cmd_iscsi_tgt_offload_connection_v1(sli4_t *sli4, void *buf,
1459  size_t size, uint64_t tag,
1460  uint32_t conn_hdl,
1461  uint32_t tcp_window_size,
1462  uint16_t ulp_no,
1463  uint16_t wq_id,
1464  uint16_t cq_id,
1465  uint16_t hdrq_id,
1466  uint16_t dataq_id,
1467  uint8_t nrs,
1468  ocs_hal_target_login_options_t *lgn_options);
1469 extern int32_t sli_cmd_iscsi_tgt_invalidate_connection(sli4_t *sli4, void *buf,
1470  size_t size, uint64_t tag,
1471  uint32_t conn_hdl,
1472  uint16_t cid,
1473  uint8_t sendRst);
1474 extern int32_t sli_cmd_iscsi_tgt_start_esi_listen(sli4_t *sli4, void *buf,
1475  size_t size, uint64_t tag,
1476  ocs_hal_ip_address_t *ipaddr,
1477  uint32_t tcp_port);
1478 extern int32_t sli_cmd_iscsi_tgt_stop_esi_listen(sli4_t *sli4, void *buf,
1479  size_t size, uint64_t tag,
1480  ocs_hal_ip_address_t *ipaddr,
1481  uint32_t tcp_port);
1482 extern int32_t sli_cmd_iscsi_ini_invalidate_connection(sli4_t *sli4, void *buf,
1483  size_t size, uint64_t tag,
1484  uint32_t conn_hdl,
1485  uint16_t cid,
1486  uint8_t sendRst);
1487 extern int32_t sli_cmd_iscsi_tgt_isns_send_packet(sli4_t *sli4, void *buf,
1488  size_t size, uint64_t tag,
1489  ocs_hal_ip_address_t *isns_server,
1490  uint32_t tcp_port,
1491  void *packet,
1492  uint32_t pkt_length,
1493  ocs_dma_t *pkt_mem);
1494 extern int32_t sli_cmd_iscsi_wq_create(sli4_t *, void *, size_t, uint64_t, ocs_dma_t *, uint16_t, uint16_t);
1495 extern int32_t sli_cmd_iscsi_wq_destroy(sli4_t *, void *, size_t, uint64_t, uint16_t);
1496 extern int32_t sli_cmd_iscsi_ntwk_set_mtu(sli4_t *sli4, void *buf, size_t size, uint64_t tag,
1497  uint32_t mtu);
1498 extern int32_t sli_cmd_iscsi_invalidate_cmds(sli4_t *sli4, void *buf,
1499  size_t size, uint64_t tag,
1500  ocs_dma_t *msg_mem,
1501  ocs_hal_io_t **ios,
1502  uint16_t num_ios,
1503  ocs_hal_abort_type_e abort_type);
1504 extern int32_t sli_cmd_iscsi_remove_sgl_pages(sli4_t *, void *, size_t, uint64_t);
1505 extern int32_t sli_cmd_iscsi_defq_create(sli4_t *, void *, size_t, uint64_t, ocs_dma_t *, uint32_t, uint16_t, uint16_t, uint16_t);
1506 extern int32_t sli_cmd_iscsi_defq_destroy(sli4_t *, void *, size_t, uint64_t, uint16_t);
1507 extern int32_t sli_iscsi_defq_alloc(sli4_t *, sli4_queue_t *, sli4_queue_t *, uint32_t, uint32_t, uint32_t, sli4_queue_t *, uint16_t);
1508 
1509 extern int32_t sli_wqe_ini_write(sli4_t *sli4, void *buf, size_t size,
1510  uint16_t lun,
1511  uint32_t exp_xfer_len,
1512  uint32_t cmdsn,
1513  uint16_t icd_index,
1514  ocs_hal_dif_info_t* dif_info,
1515  sli4_sge_t *sgl,
1516  uint32_t n_sge);
1517 
1518 extern int32_t sli_wqe_ini_tmf(sli4_t *sli4, void *buf, size_t size,
1519  uint16_t lun,
1520  uint32_t cmdsn,
1521  uint16_t icd_index,
1522  sli4_sge_t *sgl,
1523  uint32_t n_sge);
1524 
1525 extern int32_t sli_wqe_ini_nop(sli4_t *sli4, void *buf, size_t size,
1526  uint8_t dm,
1527  uint32_t cmdsn,
1528  ocs_dma_t *bhs,
1529  ocs_dma_t *payload1,
1530  ocs_dma_t *payload2,
1531  uint32_t exp_xfer_len,
1532  uint16_t icd_index);
1533 
1534 extern int32_t sli_wqe_ini_read(sli4_t *sli4, void *buf, size_t size,
1535  uint16_t lun,
1536  uint32_t exp_xfer_len,
1537  uint32_t cmdsn,
1538  uint16_t icd_index,
1539  ocs_hal_dif_info_t* dif_info,
1540  sli4_sge_t *sgl,
1541  uint32_t n_sge);
1542 
1543 extern int32_t sli_wqe_update_context(sli4_t *sli4, void *buf, size_t size,
1544  ocs_hal_target_login_options_t *lgn_options,
1545  uint32_t statsn);
1546 
1547 extern int32_t sli_wqe_tgt_sts(sli4_t *sli4, void *buf, size_t size,
1548  ocs_dma_t *bhs,
1549  uint16_t lun,
1550  uint32_t exp_xfer_len,
1551  uint32_t exp_data_sn,
1552  uint32_t itt,
1553  uint16_t icd_index,
1554  uint16_t ref_icd_index,
1555  ocs_hal_dif_info_t* dif_info,
1556  uint32_t r2t_offset);
1557 
1558 extern int32_t sli_wqe_tgt_datain(sli4_t *sli4, void *buf, size_t size,
1559  ocs_dma_t *bhs,
1560  uint16_t lun,
1561  uint8_t dm,
1562  uint8_t underrun,
1563  uint8_t overrun,
1564  uint32_t exp_xfer_len,
1565  uint16_t icd_index,
1566  uint16_t ref_icd_index,
1567  uint32_t data_sn,
1568  uint8_t piggy_back_status,
1569  ocs_hal_dif_info_t* dif_info,
1570  sli4_sge_t *sgl,
1571  uint32_t n_sge);
1572 
1573 extern int32_t sli_wqe_tgt_sos(sli4_t *sli4, void *buf, size_t size,
1574  ocs_dma_t *bhs,
1575  ocs_dma_t *payload1,
1576  ocs_dma_t *payload2,
1577  uint16_t lun,
1578  uint8_t dm,
1579  uint32_t exp_xfer_len,
1580  uint16_t icd_index);
1581 
1582 extern int32_t sli_wqe_unassisted(sli4_t *sli4, void *buf, size_t size,
1583  uint8_t set_dm,
1584  uint8_t incr_statsn,
1585  uint8_t is_login,
1586  ocs_dma_t *bhs,
1587  ocs_dma_t *payload1,
1588  ocs_dma_t *payload2,
1589  uint32_t exp_xfer_len,
1590  uint16_t icd_index);
1591 
1592 #include "sli4_skh_iscsi.h"
1593 #include "sli4_be3_iscsi.h"
1594 
1595 #endif /* !_SLI4_ISCSI_H */
1596 
1597 /* vim: set noexpandtab textwidth=120: */
1598 
1599  /**
1600  * @page iscsi_sli4_api_overview SLI-4 APIs
1601  * - @ref sli
1602  * - @ref sli_iscsi
1603  * - @ref sli_be3_iscsi
1604  *
1605  * <div class="overview">
1606  * <img src="elx_iscsi_sli4.jpg" alt="iSCSI SLI-4" title="iSCSI SLI-4" align="right"/>
1607  *
1608  * <h2>iSCSI SLI-4</h2>
1609  *
1610  * The iSCSI SLI-4 component implements the commands and processing defined by
1611  * the <i>SLI-4 Architecture Specification</i> and the <i>SLI-4 iSCSI Command Reference</i>
1612  * through a lightly-abstracted API. The primary objective of this component is to provide
1613  * a mechanism to access the Emulex SLI-4 hardware without enforcing a
1614  * specific policy.<br><br>
1615  *
1616  * All meaningful communication between the driver and hardware occurs via queues. To
1617  * issue commands and work requests to the hardware, the driver writes work queue
1618  * entries (WQEs). Conversely, to get information about asynchronous events (for
1619  * example, link events or previously submitted commands), the driver reads queue
1620  * entries created by the hardware. The SLI component defines a set of common queue
1621  * operations used to interact with the hardware, simplifying some of the underlying
1622  * interface complexities. You can use the queue API to perform the following operations:
1623  *
1624  * <ul><li>Allocating a queue type with the given number of entries. Since most queues
1625  * are closely coupled to an associated queue (for example, a completion queue is
1626  * tied to an event queue), this interface allows specifying the associated queue.
1627  * <li>Freeing a previously-allocated queue.</li>
1628  * <li>Determining if the next queue entry is valid (that is, the hardware has written a
1629  * new entry).</li>
1630  * <li>Reading the next valid entry from the queue to a supplied buffer.</li>
1631  * <li>Writing an entry from a supplied buffer to the next
1632  * available queue location.</li></ul>
1633  *
1634  * The SLI-4 documentation defines registers that are predominantly used in conjunction
1635  * with the previously mentioned queue operations. One exception to this
1636  * characterization of SLI-4 registers is the bootstrap mailbox register (bmbx). The
1637  * bootstrap mailbox register allows the driver to send commands before any of the other
1638  * queues exist. Similar to the standard queue operations, the SLI component encapsulates
1639  * the standard mechanism used to communicate via the bootstrap mailbox.<br><br>
1640  *
1641  * The OneCore Storage driver writes two types of queue entries: commands and I/O
1642  * work requests. In both cases, the SLI-4 component provides helper functions to
1643  * correctly format these queue entries.<br><br>
1644  *
1645  * The basic format of the command helper functions includes:
1646  *
1647  * <ul><li>A name corresponding to the SLI-4 documentation. For example, the helper
1648  * function for the FW_INITIALIZE mailbox command is sli_cmd_fw_initialize().</li>
1649  * <li>A buffer to hold the formatted queue entry.</li>
1650  * <li>The size of the allocated buffer.</li>
1651  * <li>Parameter options, where appropriate. For example, the ISCSI_TCP_DISCONNECT
1652  * command requires a value for the connection handle. Therefore, the
1653  * sli_cmd_iscsi_tcp_disconnect function provides an additional parameter
1654  * to supply the value.</li></ul>
1655  *
1656  * The basic format of the I/O work request helper functions follow a similar format, and
1657  * includes:
1658  *
1659  * <ul><li>A name corresponding to the SLI-4 documentation. For example, the helper
1660  * function to create an INITIATOR_WRITE_COMMAND WQE is sli_be3_wqe_ini_write().</li>
1661  * <li>A buffer to hold the formatted queue entry.</li>
1662  * <li>The size of the allocated buffer.</li>
1663  * <li>Parameterized command options where appropriate. For example, the
1664  * INITIATOR_WRITE_COMMAND WQE requires values for the LUN, expected
1665  * transfer length, and so on. Therefore, the sli_be3_wqe_ini_write function has
1666  * additional parameters for these fields.</li></ul>
1667  *
1668  * Once formatted with a helper function, the queue entry can be passed to
1669  * sli_queue_write() to post it to the hardware.<br><br>
1670  *
1671  * @b Note: The formatted command buffers may also be passed to the hardware through
1672  * the bootstrap mailbox interface (sli_bmbx_command()).<br><br>
1673  *
1674  * The SLI-4 component provides assistance in decoding entries created by the hardware
1675  * and read by the driver. In some cases, a SLI-4 function receives the raw buffer as input,
1676  * and then returns more relevant values. For example, the sli_cq_parse() function
1677  * receives the completion queue entry as input, and then returns the completion type and
1678  * queue ID. In other cases, the parsing function decodes the queue entry, and then
1679  * returns the results through registered callback functions. For example, the
1680  * sli_cqe_async() helper function decodes asynchronous events, such as link events
1681  * The drivers can register callback functions for each of these
1682  * events using the SLI component.<br><br>
1683  *
1684  * In contrast to SLI-2 and SLI-3 drivers, SLI-4 drivers play a greater role in the allocation
1685  * and assignment of hardware resources (for example, XRI, RPI, and VPI). However, the
1686  * inner workings of these resources differ between different hardware. The SLI-4
1687  * component encapsulates these differences and presents a common interface to upper
1688  * layers. The API presents a simple allocate or free interface.<br><br>
1689  *
1690  * The <i>SLI-4 Architecture Specification</i> covers a range of hardware,
1691  * each with different capabilities. The SLI
1692  * component API provides functions to manage these differences. These functions allow
1693  * drivers to query hardware capabilities (for example, the maximum SGL length), as well
1694  * as configure capabilities (for example, setting the maximum number of connections
1695  * or I/O objects).
1696  * <br><br>
1697  * </div><!-- overview -->
1698  */
This structure contains the type and associated fields for a CQE completion.
Definition: sli4.h:2017
uint32_t uint32_t rsvd1
Definition: sli4_iscsi.h:781
ISCSI_WQ_CREATE.
Definition: sli4_iscsi.h:613
ISCSI_DEFQ_DESTROY.
Definition: sli4_iscsi.h:804
ISCSI_TGT_OFFLOAD_CONNECTION.
Definition: sli4_iscsi.h:927
int32_t sli_iscsi_set_frag_bits(sli4_t *sli4)
Allocate the SGL pages assigned to the ICD table and post them to the chip.
Definition: sli4_iscsi.c:2253
int32_t sli_wqe_tgt_sts(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *bhs, uint16_t lun, uint32_t exp_xfer_len, uint32_t exp_data_sn, uint32_t itt, uint16_t icd_index, uint16_t ref_icd_index, ocs_hal_dif_info_t *dif_info, uint32_t r2t_offset)
sli4_session_login_options_t session_options
Definition: sli4_iscsi.h:146
int32_t cqe_handler_t(sli4_t *, uint8_t *cqe, sli4_qentry_fields_t *fields)
Definition: sli4_iscsi.h:1279
ISCSI_INI_INVALIDATE_CONNECTION.
Definition: sli4_iscsi.h:822
COMMON_ISCSI_NTWK_IFACE_CREATE.
Definition: sli4_iscsi.h:290
COMMON_ISCSI_CFG_REMOVE_SGL_PAGES.
Definition: sli4_iscsi.h:276
int32_t sli_cmd_iscsi_tgt_invalidate_connection(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl, uint16_t cid, uint8_t sendRst)
write a ISCSI_TGT_INVALIDATE_CONNECTION command
Definition: sli4_iscsi.c:1152
int32_t sli_cmd_iscsi_common_get_default_gateway(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint8_t isv4)
write a COMMON_ISCSI_NTWK_GET_DEFAULT_GATEWAY command
Definition: sli4_iscsi.c:509
int32_t sli_cmd_iscsi_common_modify_default_gateway(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint8_t isadd, ocs_hal_ip_address_t *gateway)
write a COMMON_ISCSI_NTWK_MODIFY_DEFAULT_GATEWAY command
Definition: sli4_iscsi.c:549
ISCSI_TGT_ISNS_SEND_PACKET.
Definition: sli4_iscsi.h:973
int32_t sli_cmd_iscsi_tcp_disconnect(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl)
write a ISCSI_TCP_DISCONNECT command
Definition: sli4_iscsi.c:1658
#define SLI4_ISCSI_ROUTE_TABLE_ENTRIES_MAX
Definition: sli4_iscsi.h:412
TARGET_LOGIN_OPTIONS.
Definition: sli4_iscsi.h:145
uint32_t uint32_t max_rcv_dsl
Definition: sli4_iscsi.h:148
int32_t sli_cmd_iscsi_cleanup_v0(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t ulp_no, uint8_t hdrq_id, uint8_t dataq_id)
write a COMMON_ISCSI_CLEANUP (version 0) command
Definition: sli4_iscsi.c:671
COMMON_ISCSI_NTWK_SET_VLAN.
Definition: sli4_iscsi.h:476
T10 DIF information passed to the transport.
Definition: ocs_hal.h:201
sli4_req_hdr_t hdr
Definition: sli4_iscsi.h:235
int32_t sli_cmd_iscsi_common_get_if_info(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface, uint8_t isv4)
write a COMMON_ISCSI_NTWK_GET_IF_INFO command
Definition: sli4_iscsi.c:629
COMMON_ISCSI_CFG_POST_SGL_PAGES (v1)
Definition: sli4_iscsi.h:256
uint32_t page0_high
Definition: sli4_iscsi.h:263
ISCSI_TCP_DISCONNECT.
Definition: sli4_iscsi.h:725
COMMON_ISCSI_NTWK_IFACE_DELETE.
Definition: sli4_iscsi.h:313
int32_t sli_cmd_iscsi_common_discovered_isns_servers(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface)
write a COMMON_ISCSI_NTWK_DISCOVERED_ISNS_SERVERS command
Definition: sli4_iscsi.c:269
int32_t sli_cmd_iscsi_tgt_offload_connection_v1(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl, uint32_t tcp_window_size, uint16_t ulp_no, uint16_t wq_id, uint16_t cq_id, uint16_t hdrq_id, uint16_t dataq_id, uint8_t nrs, ocs_hal_target_login_options_t *lgn_options)
write a ISCSI_TGT_OFFLOAD_CONNECTION command (version 1)
Definition: sli4_iscsi.c:1069
COMMON_ISCSI_NTWK_GET_ROUTE_TABLE.
Definition: sli4_iscsi.h:448
structure wrapping an IP address and subnet together with their type.
Definition: ocs_hal.h:267
uint32_t rsvd0
Definition: sli4_iscsi.h:239
int32_t sli_wqe_ini_nop(sli4_t *sli4, void *buf, size_t size, uint8_t dm, uint32_t cmdsn, ocs_dma_t *bhs, ocs_dma_t *payload1, ocs_dma_t *payload2, uint32_t exp_xfer_len, uint16_t icd_index)
uint32_t sli_iscsi_response_length(sli4_t *, uint8_t *)
ocs_hal_ip_type_e
enum identifying the types of IP addresses.
Definition: ocs_hal.h:244
ISCSI_DEFQ_CREATE.
Definition: sli4_iscsi.h:769
ISCSI_WQ_DESTROY.
Definition: sli4_iscsi.h:637
COMMON_ISCSI_SET_FRAGNUM_BITS.
Definition: sli4_iscsi.h:599
int32_t sli_iscsi_io_get_icd_and_sgl(sli4_t *sli4, uint32_t io_offset, uint16_t *icd, void **sgl)
return the ICD and virtual SGL pointer for an IO at the specified offset into the ICD table...
Definition: sli4_iscsi.c:2609
Asynchronouse Event : iSCSI Event - iCMPv6 Error.
Definition: sli4_iscsi.h:1228
ocs_hal_abort_type_e
HAL abort types.
Definition: ocs_hal.h:675
COMMON_ISCSI_NTWK_RELEASE_STATELESS_IP_ADDR.
Definition: sli4_iscsi.h:348
COMMON_ISCSI_ERROR_RECOVERY_INVALIDATE_CMDS.
Definition: sli4_iscsi.h:197
COMMON_ISCSI_NTWK_GET_DEFAULT_GATEWAY.
Definition: sli4_iscsi.h:491
int32_t sli_iscsi_process_iscsi(sli4_t *sli4, void *acqe)
Process an asynchronous iSCSI event entry.
Definition: sli4_iscsi.c:2032
int32_t sli_wqe_update_context(sli4_t *sli4, void *buf, size_t size, ocs_hal_target_login_options_t *lgn_options, uint32_t statsn)
int32_t sli_cmd_iscsi_common_discover_isns_server(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface, uint32_t retries)
write a COMMON_ISCSI_NTWK_DISCOVER_ISNS_SERVER command
Definition: sli4_iscsi.c:228
int32_t sli_cmd_iscsi_tcp_connect_v0(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, uint16_t cid, uint16_t cq_id, ocs_dma_t *data_out, uint16_t hdr_ring_id, uint16_t data_ring_id, uint8_t do_offload)
write a ISCSI_TCP_CONNECT_AND_OFFLOAD V0 command
Definition: sli4_iscsi.c:1549
COMMON_ISCSI_CLEANUP.
Definition: sli4_iscsi.h:569
int32_t sli_cmd_iscsi_tgt_stop_listen_server(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port)
write a ISCSI_TGT_STOP_LISTEN_SERVER command
Definition: sli4_iscsi.c:845
uint8_t sli_iscsi_conv_hal_ip_addr_type(ocs_hal_ip_type_e ip_type)
Converts the IP address type field to the SLI4 equivalent value.
Definition: sli4_iscsi.c:305
int32_t sli_cmd_iscsi_common_iface_delete(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface)
write a COMMON_ISCSI_NTWK_IFACE_CREATE command
Definition: sli4_iscsi.c:103
IP_ADDRESS_FORMAT.
Definition: sli4_iscsi.h:60
int32_t sli_cmd_iscsi_wq_create(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ulp)
write a ISCSI_WQ_CREATE command
Definition: sli4_iscsi.c:1409
int32_t sli_cmd_iscsi_tgt_get_connection_info(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl)
write a ISCSI_TGT_GET_CONNECTION_INFO command
Definition: sli4_iscsi.c:889
Asynchronouse Event : iSCSI Event - iCMPv6 Error.
Definition: sli4_iscsi.h:1208
COMMON_ISCSI_NTWK_SET_ROUTE_TABLE.
Definition: sli4_iscsi.h:421
int32_t sli_cmd_iscsi_remove_sgl_pages(sli4_t *sli4, void *buf, size_t size, uint64_t tag)
write a COMMON_ISCSI_CFG_REMOVE_SGL_PAGES command
Definition: sli4_iscsi.c:1794
sli4_req_hdr_t hdr
Definition: sli4_iscsi.h:257
sli4_ip_type_type_e
Definition: sli4_iscsi.h:46
ISCSI_TGT_START_ESI_LISTEN.
Definition: sli4_iscsi.h:1004
Definition: sli4.h:2201
int32_t sli_cmd_iscsi_get_connection_info(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl)
write a ISCSI_GET_CONNECTION_INFO command
Definition: sli4_iscsi.c:1695
int32_t sli_cmd_iscsi_tgt_start_esi_listen(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port)
write a ISCSI_TGT_START_ESI_LISTEN command
Definition: sli4_iscsi.c:1197
int32_t sli_iscsi_process_link_state(sli4_t *sli4, void *acqe)
Process an asynchronous Link State event entry.
Definition: sli4_iscsi.c:1947
int32_t sli_wqe_unassisted(sli4_t *sli4, void *buf, size_t size, uint8_t set_dm, uint8_t incr_statsn, uint8_t is_login, ocs_dma_t *bhs, ocs_dma_t *payload1, ocs_dma_t *payload2, uint32_t exp_xfer_len, uint16_t icd_index)
int32_t sli_cmd_iscsi_defq_destroy(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t rq_id)
write a ISCSI_DEFQ_DESTROY command
Definition: sli4_iscsi.c:1910
COMMON_ISCSI_CFG_POST_SGL_PAGES (v0)
Definition: sli4_iscsi.h:234
int32_t sli_cmd_iscsi_common_configure_stateless_ip_addr(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface, uint8_t isv4, uint32_t retries)
write a COMMON_ISCSI_NTWK_CONFIGURE_STATELESS_IP_ADDR command
Definition: sli4_iscsi.c:142
int32_t sli_wqe_ini_read(sli4_t *sli4, void *buf, size_t size, uint16_t lun, uint32_t exp_xfer_len, uint32_t cmdsn, uint16_t icd_index, ocs_hal_dif_info_t *dif_info, sli4_sge_t *sgl, uint32_t n_sge)
int32_t sli_wqe_tgt_datain(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *bhs, uint16_t lun, uint8_t dm, uint8_t underrun, uint8_t overrun, uint32_t exp_xfer_len, uint16_t icd_index, uint16_t ref_icd_index, uint32_t data_sn, uint8_t piggy_back_status, ocs_hal_dif_info_t *dif_info, sli4_sge_t *sgl, uint32_t n_sge)
uint32_t uint32_t rsvd0
Definition: sli4_iscsi.h:777
int32_t sli_cmd_iscsi_ntwk_set_mtu(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t mtu)
write a ISCSI_NTWK_SET_MTU command
Definition: sli4_iscsi.c:1504
int32_t sli_cmd_iscsi_wq_destroy(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t wq_id)
write a ISCSI_WQ_DESTROY command
Definition: sli4_iscsi.c:1466
uint32_t rsvd
Definition: sli4_iscsi.h:66
int32_t sli_cmd_iscsi_invalidate_cmds(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *msg_mem, ocs_hal_io_t **ios, uint16_t num_ios, ocs_hal_abort_type_e abort_type)
write a COMMON_ISCSI_INVALIDATE_COMMANDS command
Definition: sli4_iscsi.c:1739
COMMON_ISCSI_NTWK_DISCOVERED_ISNS_SERVERS.
Definition: sli4_iscsi.h:379
int32_t sli_cmd_iscsi_common_modify_ip_addr(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface, uint8_t isadd, ocs_hal_ip_address_subnet_t *ipaddr)
write a COMMON_ISCSI_NTWK_MODIFY_IP_ADDR command
Definition: sli4_iscsi.c:462
HAL IO object.
Definition: ocs_hal.h:471
sli4_ip_addr_subnet_t ip_sub
Definition: sli4_iscsi.h:110
uint32_t page0_low
Definition: sli4_iscsi.h:262
COMMON_ISCSI_NTWK_DISCOVER_ISNS_SERVER.
Definition: sli4_iscsi.h:363
int32_t sli_iscsi_post_sgl_pages(sli4_t *sli4)
Allocate the SGL pages assigned to the ICD table and post them to the chip.
Definition: sli4_iscsi.c:2545
SESSION_LOGIN_OPTIONS.
Definition: sli4_iscsi.h:119
int32_t sli_cmd_iscsi_common_set_route_table(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint8_t isadd, ocs_hal_ip_address_subnet_t *hal_ipsub, ocs_hal_ip_address_t *hal_gateway, ocs_dma_t *dma)
write a COMMON_ISCSI_NTWK_SET_ROUTE_TABLE command
Definition: sli4_iscsi.c:385
int32_t sli_cmd_iscsi_tcp_connect_v1(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, uint16_t cid, uint16_t cq_id, ocs_dma_t *data_out, uint16_t hdr_ring_id, uint16_t data_ring_id, uint8_t do_offload, uint16_t window_size, uint8_t window_scale, uint32_t tcp_mss)
Definition: sli4_iscsi.c:1593
int32_t sli_cmd_iscsi_tgt_isns_send_packet(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *isns_server, uint32_t tcp_port, void *packet, uint32_t pkt_length, ocs_dma_t *pkt_mem)
write a ISCSI_TGT_ISNS_SEND_PACKET command
Definition: sli4_iscsi.c:1344
Asynchronouse Event : iSCSI Event - New TCP Connection.
Definition: sli4_iscsi.h:1148
int32_t sli_iscsi_defq_alloc(sli4_t *sli4, sli4_queue_t *header, sli4_queue_t *payload, uint32_t n_entries, uint32_t hsize, uint32_t psize, sli4_queue_t *cq, uint16_t ulp)
allocate a receive queue
Definition: sli4_iscsi.c:2173
COMMON_ISCSI_NTWK_MODIFY_IP_ADDR.
Definition: sli4_iscsi.h:399
ISCSI_TGT_INVALIDATE_CONNECTION.
Definition: sli4_iscsi.h:988
uint32_t low
Definition: sli4_iscsi.h:241
int32_t sli_cmd_iscsi_common_get_all_if_id(sli4_t *sli4, void *buf, size_t size, uint64_t tag)
write a COMMON_ISCSI_NTWK_GET_ALL_IF_ID command
Definition: sli4_iscsi.c:591
Asynchronouse Event : iSCSI Event - stateless operation complete.
Definition: sli4_iscsi.h:1166
COMMON_ISCSI_NTWK_GET_IF_INFO.
Definition: sli4_iscsi.h:541
sli4_ip_addr_t gateway
Definition: sli4_iscsi.h:111
int32_t sli_cmd_iscsi_cleanup_v1(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t ulp_no, uint16_t hdrq_id, uint16_t dataq_id)
write a COMMON_ISCSI_CLEANUP (version 1) command
Definition: sli4_iscsi.c:716
This structure is used to track the SLI4 queues.
Definition: sli4.h:2046
TARGET_LOGIN_OPTIONS.
Definition: ocs_hal.h:321
uint32_t uint32_t rsvd0
Definition: sli4_iscsi.h:1211
int32_t sli_iscsi_cqe_parse(sli4_t *sli4, sli4_queue_t *cq, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse a iSCSI work queue CQ entry.
Definition: sli4_iscsi.c:2120
structure wrapping an IP address together with it&#39;s type.
Definition: ocs_hal.h:259
uint32_t sli_iscsi_io_length(sli4_t *, uint8_t *)
sli4_target_login_options_t login_options
Definition: sli4_iscsi.h:940
Asynchronouse Event : iSCSI Event.
Definition: sli4_iscsi.h:1131
ISCSI_TGT_STOP_ESI_LISTEN.
Definition: sli4_iscsi.h:1020
int32_t sli_cmd_iscsi_ini_invalidate_connection(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl, uint16_t cid, uint8_t sendRst)
write a ISCSI_INI_INVALIDATE_CONNECTION command
Definition: sli4_iscsi.c:1288
sli4_target_login_options_t login_options
Definition: sli4_iscsi.h:962
int32_t sli_wqe_tgt_sos(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *bhs, ocs_dma_t *payload1, ocs_dma_t *payload2, uint16_t lun, uint8_t dm, uint32_t exp_xfer_len, uint16_t icd_index)
COMMON_ISCSI_NTWK_CONFIGURE_STATELESS_IP_ADDR.
Definition: sli4_iscsi.h:331
ISCSI_NTWK_SET_MTU.
Definition: sli4_iscsi.h:651
ISCSI_TGT_CONNECTION_REJECT.
Definition: sli4_iscsi.h:913
Asynchronouse Event : iSCSI Event - DHCP operation complete.
Definition: sli4_iscsi.h:1187
int32_t sli_cmd_iscsi_tgt_stop_esi_listen(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port)
write a ISCSI_TGT_STOP_ESI_LISTEN command
Definition: sli4_iscsi.c:1242
ROUTE_TABLE_ENTRY_FORMAT.
Definition: sli4_iscsi.h:109
int32_t sli_cmd_iscsi_tgt_offload_connection_v0(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl, uint32_t tcp_window_size, uint16_t ulp_no, uint16_t wq_id, uint16_t cq_id, uint8_t hdrq_id, uint8_t dataq_id, uint8_t nrs, ocs_hal_target_login_options_t *lgn_options)
write a ISCSI_TGT_OFFLOAD_CONNECTION command (version 0)
Definition: sli4_iscsi.c:979
IP_ADDRESS_SUBNET_FORMAT.
Definition: sli4_iscsi.h:91
Scatter-Gather Entry (SGE)
Definition: sli4.h:379
ISCSI_GET_CONNECTION_INFO.
Definition: sli4_iscsi.h:739
ocs_hal_ip_type_e sli_iscsi_conv_sli4_ip_addr_type(uint8_t ip_type)
Converts the SLI4 IP address type field to the HAL equivalent value.
Definition: sli4_iscsi.c:342
COMMON_ISCSI_NTWK_MODIFY_DEFAULT_GATEWAY.
Definition: sli4_iscsi.h:511
int32_t sli_cmd_iscsi_defq_create(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *qmem, uint32_t num_entries, uint16_t cq_id, uint16_t buffer_size, uint16_t ulp)
write a ISCSI_DEFQ_CREATE command
Definition: sli4_iscsi.c:1836
uint32_t high
Definition: sli4_iscsi.h:242
int32_t sli_cmd_iscsi_common_get_route_table(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma)
write a COMMON_ISCSI_NTWK_GET_ROUTE_TABLE command
Definition: sli4_iscsi.c:427
Generic Command Request header.
Definition: sli4.h:582
Generic Command Response header.
Definition: sli4.h:600
uint32_t rsvd1
Definition: sli4_iscsi.h:244
ISCSI_TGT_GET_CONNECTION_INFO.
Definition: sli4_iscsi.h:886
int32_t sli_wqe_ini_write(sli4_t *sli4, void *buf, size_t size, uint16_t lun, uint32_t exp_xfer_len, uint32_t cmdsn, uint16_t icd_index, ocs_hal_dif_info_t *dif_info, sli4_sge_t *sgl, uint32_t n_sge)
int32_t sli_cmd_iscsi_tgt_start_listen_server(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port)
write a ISCSI_TGT_START_LISTEN_SERVER command
Definition: sli4_iscsi.c:800
ISCSI_TGT_STOP_LISTEN_SERVER.
Definition: sli4_iscsi.h:870
uint32_t uint32_t rsvd3
Definition: sli4_iscsi.h:1246
int32_t sli_cmd_iscsi_common_iface_create(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t vlan)
write a COMMON_ISCSI_NTWK_IFACE_CREATE command
Definition: sli4_iscsi.c:65
COMMON_ISCSI_NTWK_GET_ALL_IF_ID.
Definition: sli4_iscsi.h:526
int32_t sli_cmd_iscsi_tgt_connection_reject(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl)
write a ISCSI_TGT_CONNECTION_REJECT command
Definition: sli4_iscsi.c:929
int32_t sli_wqe_ini_tmf(sli4_t *sli4, void *buf, size_t size, uint16_t lun, uint32_t cmdsn, uint16_t icd_index, sli4_sge_t *sgl, uint32_t n_sge)
ISCSI_TGT_START_LISTEN_SERVER.
Definition: sli4_iscsi.h:854
ISCSI_TCP_CONNECT_AND_OFFLOAD.
Definition: sli4_iscsi.h:665
int32_t sli_cmd_iscsi_common_release_stateless_ip_addr(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface, uint8_t isv4)
write a COMMON_ISCSI_NTWK_RELEASE_STATELESS_IP_ADDR command
Definition: sli4_iscsi.c:187