Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_hal.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 the Hardware Abstraction Layer (HAL) interface functions
36  */
37 
38 #ifndef _OCS_HAL_H
39 #define _OCS_HAL_H
40 
41 #include "sli4.h"
42 #include "ocs_hal_config.h"
43 #include "ocs_stats.h"
44 
45 #if defined(OCS_INCLUDE_DEBUG)
46 #include "ocs_debug.h"
47 #else
48 #define ocs_queue_history_wq(...)
49 #define ocs_queue_history_cqe(...)
50 #define ocs_queue_history_init(...)
51 #define ocs_queue_history_free(...)
52 #endif
53 
54 struct ocs_hal_s;
55 
56 #include "ocs_hal_workaround.h"
57 
58 /*
59  * HAL completion loop control parameters.
60  *
61  * The HAL completion loop must terminate periodically to keep the OS happy. The
62  * loop terminates when a predefined time has elapsed, but to keep the overhead of
63  * computing time down, the time is only checked after a number of loop iterations
64  * has completed.
65  *
66  * OCS_HAL_TIMECHECK_ITERATIONS number of loop iterations between time checks
67  *
68  */
69 
70 #define OCS_HAL_TIMECHECK_ITERATIONS 100
71 #define OCS_HAL_MAX_NUM_EQ 3
72 #define OCS_HAL_MAX_NUM_RQ 4
73 
74 #define OCS_DEFAULT_SGL_COUNT 64
75 /**
76  * @brief defines common HAL return statuses.
77  */
78 typedef enum {
84 
85 /**
86  * @brief defines the types of resets.
87  */
88 typedef enum {
93 
94 /**
95  * @brief enum identifying the HAL properties.
96  */
97 typedef enum {
130 
131 enum {
136 };
137 
138 /**
139  * @brief Port protocols
140  */
141 
142 typedef enum {
149 
150 /**
151  * @brief Defines DIF operation modes
152  */
153 enum {
156 };
157 
158 /**
159  * @brief T10 DIF operations
160  */
161 typedef enum {
167 
168 /**
169  * @brief T10 DIF block sizes
170  */
171 typedef enum {
180 
181 /**
182  * @brief Link configurations.
183  */
184 typedef enum {
192 
193  /* must be last */
196 
197 
198 /**
199  * @brief T10 DIF information passed to the transport
200  */
201 typedef struct ocs_hal_dif_info_s {
204  uint32_t ref_tag_cmp;
205  uint32_t ref_tag_repl;
206  uint32_t app_tag_cmp:16,
207  app_tag_repl:16;
208  uint32_t check_ref_tag:1,
209  check_app_tag:1,
210  check_guard:1,
211  auto_incr_ref_tag:1,
212  repl_app_tag:1,
213  repl_ref_tag:1,
214  dif:2,
215  dif_separate:1,
216  /* If the APP TAG is 0xFFFF, disable checking the REF TAG and CRC fields */
217  disable_app_ffff:1,
218 
219  /* if the APP TAG is 0xFFFF and REF TAG is 0xFFFF_FFFF, disable checking the received CRC field. */
220  disable_app_ref_ffff:1,
221  :21;
223 
224 /**
225  * @brief enum identifying IO types.
226  */
227 typedef enum {
240 
241 /**
242  * @brief enum identifying the types of IP addresses.
243  */
244 typedef enum {
245  /* Valid for requesting addresses */
250 
251  /* Only used to report what kind of address was received */
255 
256 /**
257  * @brief structure wrapping an IP address together with it's type.
258  */
259 typedef struct {
261  uint8_t ip_address[16];
263 
264 /**
265  * @brief structure wrapping an IP address and subnet together with their type.
266  */
267 typedef struct {
269  uint8_t ip_address[16];
270  uint8_t subnet[16];
272 
273 /**
274  * @brief enum identifying the DHCP states.
275  */
276 typedef enum {
285 
286 /**
287  * @brief Used for returning IP information in return from
288  * ocs_hal_portal_ip_get()
289  */
290 typedef struct {
292  uint32_t vlan_priority;
294  uint32_t ip_count;
297 
298 #define OCS_HAL_MAX_PROFILES 40
299 /**
300  * @brief A Profile Descriptor
301  */
302 typedef struct {
303  uint32_t profile_index;
304  uint32_t profile_id;
305  char profile_description[512];
307 
308 /**
309  * @brief A Profile List
310  */
311 typedef struct {
312  uint32_t num_descriptors;
315 
316 /**
317  * @brief TARGET_LOGIN_OPTIONS
318  *
319  * Structure to represent an the iSCSI login parameters on a connection.
320  */
321 typedef struct ocs_hal_target_login_options_s {
323  uint8_t data_digest:1;
324  uint8_t hdr_digest:1;
325  uint32_t max_rcv_dsl;
326  uint32_t max_send_dsl;
328 
329 /**
330  * @brief Portal callback function prototype.
331  */
332 typedef void portal_cb_t(void *ul_arg,
333  int32_t status,
334  uint32_t ext_status,
335  void * params);
336 
337 /**
338  * @brief connection callback function prototype.
339  */
340 typedef void cxn_cb_t(void *ul_arg,
341  int32_t status,
342  uint32_t ext_status,
343  void * params);
344 
345 /**
346  * @brief management callback function prototype.
347  */
348 typedef void mgmt_cb_t(void *ul_arg,
349  int32_t status,
350  uint32_t ext_status,
351  void * params);
352 
353 typedef int32_t (*ocs_hal_async_cb_t)(struct ocs_hal_s *hal, int32_t status, void *arg);
354 
355 /**
356  * @brief HAL command context
357  *
358  * This stores the state for asynchronous commands sent to the hardware
359  */
360 typedef struct ocs_command_ctx_s {
361  /* The following fields are handled by the HAL internals */
363  struct ocs_hal_s *hal;
364  uint32_t use_cnt;
365 
366  /*
367  * The remaining fields are filled in by the caller to
368  * ocs_hal_command_get_ctx()
369  */
370  uint8_t cmd[SLI4_BMBX_SIZE];
371 
372  /**< Callback function */
373  int32_t (*cb)(struct ocs_hal_s *, int32_t, struct ocs_command_ctx_s *);
374  void *cb_arg; /**< Argument for callback */
375 
376  /* Used to allocate/free DMA memory - Caller must allocate/free */
377  ocs_dma_t non_emdedded_mem;
378 
379  /* Fields used for stateless IP */
381  ocs_cxn_t *cxn;
382  uint32_t ip_type;
383 
387  void* mgmt_cb_arg;
388  void* upper_arg;
389 
390  /* Used by ocs_hal_async_call() */
394 
395 /**
396  * @brief defines the HAL scatter gather list element.
397  */
398 typedef struct ocs_hal_sgl_s {
399  uintptr_t addr;
400  size_t len;
401 } ocs_hal_sgl_t;
402 
403 /*
404  * Note: It appears that we need to use exactly 322 bytes for the BHS on the
405  * initiator side for the data to be placed properly in the SGL. This
406  * number appears to have been derived from 64 bytes header + 2 bytes
407  * for sense length and 256 bytes sense data. Other sizes appear to work
408  * properly on the target side.
409  */
410 #define HAL_BHS_ALLOC_SIZE 322
411 
412 /**
413  * @brief defines a structure to contain the fields specific to an initiator IO
414  * completion.
415  */
416 typedef struct ocs_ini_cmpl_fields_s {
417  uint32_t residual_cnt;
418  uint32_t exp_cmdsn;
419  uint8_t hw_status;
420  uint8_t status;
421  uint8_t response;
422  uint8_t flags;
423  uint8_t cmd_window;
424  uint16_t sense_len;
425  void* sense_data;
427 
428 struct ocs_hal_io_s;
429 /**
430  * @brief IO Completion function prototype.
431  */
432 typedef int32_t io_cb_t (struct ocs_hal_io_s *io,
433  ocs_cxn_t *cxn,
434  int32_t status,
435  ocs_ini_cmpl_fields_t *ini_fields,
436  void *ul_arg);
437 
438 /**
439  * @brief defines the types of SGL lists.
440  */
441 typedef enum {
445 
446 /**
447  * @brief SGL information structure
448  *
449  * Tracks SGL information for both normal and chained SGLs
450  */
451 typedef struct ocs_hal_sgl_info_s {
454  uint16_t icd;
455  uint8_t frag_offset;
456  uint32_t num_entries;
457  void * sgl;
458 
459  uint32_t n_sge;
460 
461  /* TODO: temporary until chain only ICDs are provided by FW */
462  struct ocs_hal_io_s *io;
464 
465 /**
466  * @brief HAL IO object
467  *
468  * Stores per-IO information necessary for both the lower (SLI) and upper
469  * layers (ocs)
470  */
471 typedef struct ocs_hal_io_s {
472  // Owned by HAL
474  uint16_t icd;
475  ocs_cxn_t *node; /* Must be called node for the ramdisk */
476  ocs_dma_t bhs; /* 128 bytes that may be used for cmnds, R2T, etc */
477  uint16_t type;
478 
479  uint32_t busy:1,
480  chained:1,
481  aborted:1,
482  uses_dif:1,
483  was_tgt_write:1;
484 
485  // Owned by SLI layer
486  uint16_t tag;
487  uint16_t instance_index;
488  ocs_list_t sgl_list; /**< Scatter-Gather List */
489  uint32_t n_sge;
490  uint32_t sge_offset;
491  uint32_t itt;
492  uint32_t ttt;
493  io_cb_t *done; /** Function called on IO completion */
494  void *arg; /**< Argument passed to "IO done" callback */
496 } ocs_hal_io_t;
497 
498 /**
499  * @brief defines the parameters for an IO based on the IO type.
500  */
501 typedef union ocs_hal_io_param_u {
502  /* Required for IO type:
503  * OCS_HAL_IO_INITIATOR_READ,
504  * OCS_HAL_IO_INITIATOR_NODATA,
505  * OCS_HAL_IO_INITIATOR_WRITE
506  */
507  struct {
508  uint16_t lun;
509  uint32_t cmdsn;
511  } ini_io;
512 
513  /* Required for IO type OCS_HAL_IO_INITIATOR_TMF */
514  struct {
515  uint16_t lun;
516  uint32_t cmdsn;
517  } ini_tmf;
518 
519  /* Required for IO type OCS_HAL_IO_INITIATOR_NOP */
520  struct {
521  ocs_dma_t *bhs;
522  ocs_dma_t *payload1;
523  ocs_dma_t *payload2;
524  uint32_t cmdsn;
525  } ini_nop;
526 
527  /* Required for IO type OCS_HAL_IO_TARGET_READ */
528  struct {
529  uint32_t data_sn;
531  uint8_t underrun;
532  uint8_t overrun;
533  ocs_hal_dif_info_t* dif_info;
534  } tgt_read;
535 
536  /* Required for IO type OCS_HAL_IO_TARGET_WRITE */
537  struct {
538  uint16_t lun;
539  uint32_t exp_data_sn;
540  uint32_t itt;
541  uint32_t r2t_offset;
542  ocs_hal_dif_info_t* dif_info;
543  } tgt_write;
544 
545  /* Required for IO type OCS_HAL_IO_TARGET_RSP */
546  struct {
547  ocs_dma_t *payload1;
548  ocs_dma_t *payload2;
549  } tgt_rsp;
550 
551  /* Required for IO type OCS_HAL_IO_UNASSISTED */
552  struct {
553  uint8_t set_dm;
554  uint8_t is_login;
555  uint8_t incr_statsn;
556  ocs_dma_t *bhs;
557  ocs_dma_t *payload1;
558  ocs_dma_t *payload2;
559  } unassisted;
560 
561  /* Required for IO type OCS_HAL_IO_CONTEXT_UPDATE */
562  struct {
564  uint32_t statsn;
565  } context_upd;
566 
568 
569 /**
570  * @brief enum identifying the port operations.
571  */
572 typedef enum {
576 
577 /**
578  * @brief enum identifying the port event types.
579  */
580 typedef enum {
590 
591 /**
592  * @brief enum identifying the connection event types.
593  */
594 typedef enum {
595  OCS_HAL_CXN_NEW, /* Incoming connection on a target listen port */
596  OCS_HAL_CXN_INVALID, /* Invalidated in FW, close this connection */
597  OCS_HAL_CXN_TGT_DATA_DIGEST, /* Data Digest error on connection */
598  OCS_HAL_CXN_MAX /**< must be last */
600 
601 /*
602  * Structures used for the connection callback.
603  */
604 
605 /**
606  * @brief Structure to hold the fields returned on a target data digest error event.
607  */
608 typedef struct {
609  uint32_t buffer_offset;
610  uint32_t exp_statsn;
611  uint16_t datasn;
612  uint8_t fin;
613  uint32_t data_seg_length;
614  ocs_cxn_t *cxn;
616  void *arg;
618 
619 /**
620  * @brief Structure to hold the fields returned on a connection invalidation event.
621  */
622 typedef struct {
623  ocs_cxn_t *cxn;
624  uint32_t code;
626 
627 /**
628  * @brief Structure to hold the fields returned on a new connection event.
629  */
630 typedef struct {
631  uint32_t cid;
633 
634 /**
635  * @brief Structure to define what connection event occurred and it's parameters.
636  */
637 typedef struct {
639  union {
643  } params;
645 
646 /*
647  * Callback functions
648  */
649 
650 /**
651  * @brief enum identifying the types of callbacks that can be registered.
652  */
653 typedef enum {
658  OCS_HAL_CB_MAX /**< must be last */
660 
661 /**
662  * @brief HAL abort types
663  */
664 typedef enum {
669  OCS_HAL_IO_ABORT_SCOPE_MAX, /**< must be last */
671 
672 /**
673  * @brief HAL abort types
674  */
675 typedef enum {
678  OCS_HAL_IO_ABORT_TYPE_MAX, /**< must be last */
680 
681 /**
682  * @brief Defines the type of RQ buffer
683  */
684 typedef enum {
689 
690 /**
691  * @brief Defines a wrapper for the RQ payload buffers so that we can place it
692  * back on the proper queue.
693  */
694 typedef struct ocs_hal_rq_buffer_s {
695  uint16_t rqindex;
696  ocs_dma_t dma;
698 
699 /**
700  * @brief Structure to track RQ buffers submitted to the chip.
701  */
702 typedef struct {
704  uint32_t list_cnt;
706 
707 /**
708  * @brief Structure to track RQ buffers submitted to the chip.
709  */
710 typedef struct {
713  uint32_t index;
715 
716 /**
717  * @brief HAL unsolicited callback
718  */
719 typedef int32_t (*ocs_hal_unsol_cb_t)(void *, ocs_cxn_t*, ocs_hal_rq_buffer_t*, uint32_t, ocs_hal_rq_buffer_t*, uint32_t, uint8_t);
720 
721 /**
722  * @brief HAL object
723  */
724 typedef struct ocs_hal_s {
725  ocs_os_handle_t os;
727  ocs_domain_t *domain; /* Only support a single domain */
728  uint8_t is_jumbo_set;
731  uint8_t has_fw_ue;
732  uint16_t ulp_start;
733  uint16_t ulp_max;
734 
735  /** Number of SLI objects HAL has allocated and configured */
736  struct {
737  uint32_t n_eq; /**< The number of event queues */
738  uint32_t n_cq; /**< The number of completion queues */
739  uint32_t n_mq; /**< The number of mailbox queues */
740  uint32_t n_rq; /**< The number of receive queues */
741  uint32_t n_wq; /**< The number of work queues */
742  uint32_t n_io; /**< The number of IO objects */
743  uint32_t rq_pl_size; /**< The size of the RQ payload buffers */
744  bool enable_sgl_chaining; /**< Enable SGL chaining feature */
745  uint8_t dif_mode; /**< DIF mode to use */
746  } config;
747 
748  /* Storage for SLI queue objects */
754 
755  /* Starting CQ indexes for the WQ, RQ and MQ */
756  uint32_t cq_index_wq_tgt;
757  uint32_t cq_index_wq_ini;
758  uint32_t cq_index_mq;
759  uint32_t num_wq_per_cq;
760 
761  /* Used in the interrupt handler to empty the EQ and track the CQs */
763 
764  /** Maintain an ordered, linked list of outstanding HAL commands. */
765  ocs_lock_t cmd_lock;
766  ocs_list_t cmd_head;
767  ocs_list_t cmd_pending;
768  ocs_list_t cmd_async;
769  uint32_t cmd_head_count;
770 
771  /* Fields used to track RQ buffers in the chip - uses rq lock to protect*/
774  ocs_list_t rq_list_busy[OCS_HAL_MAX_NUM_RQ];
775  ocs_list_t rq_list_free[OCS_HAL_MAX_NUM_RQ];
776 
777  /* Used to allocate/free RQ buffers */
778  uint32_t rq_buf_cnts[OCS_HAL_RQ_BUFFER_TYPE_MAX]; /*>> number of RQ buffer to allocate */
779  uint32_t rq_buf_size[OCS_HAL_RQ_BUFFER_TYPE_MAX]; /*>> size of RQ buffer to allocate */
781 
783 
784  struct {
785  /** Function + argument used to notify upper layer of link events */
786  int32_t (*link)(void *, uint8_t isLinkUp);
787 
788  /** Function + argument used to notify upper layer of connection events */
789  int32_t (*cxn)(void *, ocs_hal_cxn_event_t*);
790  /** Function + argument used to announce arrival of unsolicited frames */
792  /** Function for HAL bounce callback */
793  int32_t (*bounce)(void (*)(void *arg), void *arg, uint32_t cpu);
794  } callback;
795  struct {
796  void *link;
797  void *cxn;
798  void *unsolicited;
799  void *bounce;
800  } args;
801 
802  ocs_hal_io_t *io; /**< Array of IO objects */
803  ocs_hal_sgl_info_t *sgl_info; /**< Array of SGL Info objects */
804 
805  ocs_lock_t io_lock;
806  ocs_list_t io_free;/**< List of IO objects available for allocation */
807 
808  /*
809  * BZ 160124 - Driver must quarantine ICDs for target writes and
810  * initiator read when using DIF separates. Throw them on the following
811  * queues until another 4 similar requests are completed to ensure they
812  * are flushed from the internal chip cache before being re-used.
813  */
818 
819  ocs_lock_t cxn_lock;
820  ocs_list_t cxn_free;/**< List of connection objects available for allocation */
821 
822  ocs_dma_t bhs_mem;
823  ocs_dma_t dataout_tmpl_mem;
824  ocs_dma_t cxn_mem;
825  ocs_dma_t isns_mem;
826 
829 
830  ocs_atomic_t io_alloc_failed_count;
831 
832 #if defined(OCS_DEBUG_QUEUE_HISTORY)
833  ocs_hal_q_hist_t q_hist;
834 #endif
835 } ocs_hal_t;
836 
837 /* Initialization and Configuration */
838 extern ocs_hal_rtn_e ocs_hal_setup(ocs_hal_t *, ocs_os_handle_t, sli4_port_type_e);
847 extern int32_t ocs_hal_get_num_eq(ocs_hal_t *);
848 
849 void ocs_hal_cxn_req_invalidate(ocs_list_t *list_cxn);
850 void ocs_tgt_cxn_invalidate(ocs_cxn_t *cxn);
851 
852 /* Domains - Once the chip is initialized */
853 extern ocs_hal_rtn_e ocs_hal_domain_add(ocs_hal_t *, ocs_sli_port_t *, ocs_domain_t *);
854 extern ocs_hal_rtn_e ocs_hal_domain_free(ocs_hal_t *, ocs_domain_t *);
855 
856 /* Network configuration - Once the chip is initialized */
858  portal_cb_t portal_cb,
859  void *ul_arg);
860 extern int32_t
861 ocs_hal_portal_get_route_table_cb(ocs_hal_t *hal, int32_t status,
862  ocs_command_ctx_t *ctx);
865  ocs_hal_ip_address_subnet_t *hal_ipsub,
866  ocs_hal_ip_address_t *hal_gateway,
867  int32_t add,
868  portal_cb_t portal_cb, void *ul_arg);
869 extern int32_t
870 ocs_hal_portal_set_route_table_cb(ocs_hal_t *hal, int32_t status,
871  ocs_command_ctx_t *ctx);
872 
873 extern ocs_hal_rtn_e ocs_hal_portal_set_mac(ocs_hal_t *, uint8_t *mac_address,
874  portal_cb_t, void* ul_arg);
875 extern ocs_hal_rtn_e ocs_hal_portal_set_mtu(ocs_hal_t *, uint8_t is_jumbo,
876  portal_cb_t, void* ul_arg);
878 extern ocs_hal_rtn_e ocs_hal_portal_create(ocs_hal_t *, unsigned int vlan_tag,
879  portal_cb_t, void* ul_arg);
881  portal_cb_t, void* ul_arg);
884  portal_cb_t, void* ul_arg);
887  portal_cb_t, void* ul_arg);
889  ocs_hal_ip_type_e ip_type,
890  portal_cb_t, void* ul_arg);
892  portal_cb_t, void* ul_arg);
894  portal_cb_t, void* ul_arg);
896  portal_cb_t, void* ul_arg);
898  uint32_t tcp_port,
899  portal_cb_t, void* ul_arg);
901  uint32_t tcp_port,
902  portal_cb_t, void* ul_arg);
904  portal_cb_t, void* ul_arg);
907  uint32_t tcp_port,
908  void *packet, uint32_t pkt_len,
909  portal_cb_t, void* ul_arg);
911  uint32_t tcp_port,
912  portal_cb_t, void* ul_arg);
914  uint32_t tcp_port,
915  portal_cb_t, void* ul_arg);
916 
917 /* interrupt Handling */
918 extern int32_t ocs_hal_event_check(ocs_hal_t *, uint32_t);
919 extern int32_t ocs_hal_process(ocs_hal_t *, uint32_t, uint32_t);
920 
921 /* Issue mailbox commands - intended to be used internally */
922 extern ocs_hal_rtn_e ocs_hal_command_bootstrap(ocs_hal_t *hal, uint8_t *cmd);
926 typedef void (*ocs_hal_fw_cb_t)(int32_t status, uint32_t bytes_written, void *arg);
927 extern ocs_hal_rtn_e ocs_hal_firmware_write(ocs_hal_t *, ocs_dma_t *, uint32_t, uint32_t, int, ocs_hal_fw_cb_t, void*);
928 extern ocs_hal_rtn_e ocs_hal_get_active_profile(ocs_hal_t *hal, mgmt_cb_t mgmt_cb, void* ul_arg);
929 extern ocs_hal_rtn_e ocs_hal_set_active_profile(ocs_hal_t *hal, mgmt_cb_t mgmt_cb, uint32_t profile_id, void* ul_arg);
930 extern ocs_hal_rtn_e ocs_hal_get_profile_list(ocs_hal_t *hal, mgmt_cb_t mgmt_cb, void* ul_arg);
931 extern ocs_hal_rtn_e ocs_hal_get_port_protocol(ocs_hal_t *hal, uint32_t pci_func, mgmt_cb_t mgmt_cb, void* ul_arg);
932 extern ocs_hal_rtn_e ocs_hal_set_port_protocol(ocs_hal_t *hal, uint32_t pci_func, ocs_hal_port_protocol_e profile, mgmt_cb_t mgmt_cb, void* ul_arg);
933 extern ocs_hal_rtn_e ocs_hal_set_linkcfg(ocs_hal_t *hal, mgmt_cb_t mgmt_cb, uint32_t config_id, void* ul_arg);
934 extern ocs_hal_rtn_e ocs_hal_get_linkcfg(ocs_hal_t *hal, mgmt_cb_t mgmt_cb, void* ul_arg);
935 
936 /* Post unsolicited iSCSI header and data buffers */
938 
939 /* connection */
940 extern ocs_cxn_t * ocs_hal_cxn_alloc(ocs_hal_t *, uint32_t conn_hdl);
941 extern ocs_hal_rtn_e ocs_hal_cxn_connect(ocs_hal_t *, ocs_cxn_t *, ocs_hal_ip_address_t *, uint32_t tcp_port, uint16_t window_size, uint8_t window_scale, cxn_cb_t, void *ul_arg);
942 extern ocs_hal_rtn_e ocs_hal_cxn_reject(ocs_hal_t *hal, uint32_t conn_hdl,
943  cxn_cb_t cxn_cb, void *ul_arg);
944 extern ocs_hal_rtn_e ocs_hal_cxn_get_info(ocs_hal_t *hal, ocs_cxn_t *cxn,
945  cxn_cb_t cxn_cb, void *ul_arg);
946 extern ocs_hal_rtn_e ocs_hal_cxn_offload(ocs_hal_t *hal, ocs_cxn_t *cxn,
947  uint32_t tcp_window_size,
948  uint8_t data_digest,
949  uint8_t hdr_digest,
950  uint32_t max_rcv_dsl,
951  cxn_cb_t cxn_cb, void *ul_arg);
952 extern uint32_t ocs_hal_cxn_get_free_wq_cnt(ocs_hal_t *, ocs_cxn_t *);
953 extern ocs_hal_rtn_e ocs_hal_cxn_close(ocs_hal_t *, ocs_cxn_t *, uint8_t invalidate, cxn_cb_t, void *ul_arg);
954 extern ocs_hal_rtn_e ocs_hal_cxn_upload(ocs_hal_t *hal, ocs_cxn_t *cxn,
955  uint8_t graceful,
956  cxn_cb_t cxn_cb, void *ul_arg);
957 extern ocs_hal_rtn_e ocs_hal_cxn_free(ocs_hal_t *, ocs_cxn_t *);
958 
960 extern void ocs_hal_io_free(ocs_hal_t *, ocs_hal_io_t *);
961 extern ocs_hal_rtn_e ocs_hal_io_send(ocs_hal_t *, ocs_hal_io_type_e, ocs_hal_io_t *, uint32_t, ocs_hal_io_param_t *, ocs_cxn_t *, io_cb_t, void *);
963 extern ocs_hal_rtn_e ocs_hal_io_add_sge(ocs_hal_t *, ocs_hal_io_t *, uintptr_t, uint32_t);
965 extern ocs_hal_rtn_e ocs_hal_io_add_dif_sge(ocs_hal_t *hal, ocs_hal_io_t *io, uintptr_t addr);
967 extern ocs_hal_io_t *ocs_hal_io_find_itt(ocs_hal_t *hal, uint32_t itt);
968 extern uint32_t tcmd_thread_id(void);
969 extern int ocs_hal_fw_valid(ocs_hal_t *hal);
970 
971 extern int32_t ocs_hal_async_call(ocs_hal_t *hal, ocs_hal_async_cb_t callback, void *arg);
972 
973 #endif /* !_OCS_HAL_H */
974 
975 /* vim: set noexpandtab textwidth=120: */
ocs_sgl_type_e sgl_type
Definition: ocs_hal.h:453
char * hal_war_version
Definition: ocs_hal.h:827
ocs_dma_t cxn_mem
Definition: ocs_hal.h:824
ocs_hal_io_t * io
Definition: ocs_hal.h:615
int ocs_hal_fw_valid(ocs_hal_t *hal)
Check that firmware version meets minimum requirements.
Definition: ocs_hal.c:624
ocs_hal_rq_buffer_t * rq_buf
Definition: ocs_hal.h:712
sli4_wqe_context_t * wq_ctx
Definition: ocs_hal.h:495
uint32_t cq_index_mq
Definition: ocs_hal.h:758
ocs_hal_ip_type_e ip_type
Definition: ocs_hal.h:268
ocs_lock_t io_lock
Definition: ocs_hal.h:805
void * link
Definition: ocs_hal.h:796
Structure to track RQ buffers submitted to the chip.
Definition: ocs_hal.h:710
void * upper_arg
Definition: ocs_hal.h:388
ocs_os_handle_t os
Definition: ocs_hal.h:725
ocs_hal_rtn_e ocs_hal_portal_gateway_add(ocs_hal_t *hal, ocs_hal_ip_address_t *gateway, portal_cb_t portal_cb, void *ul_arg)
adds the default gateway on an interface.
Definition: ocs_hal.c:4057
SGL information structure.
Definition: ocs_hal.h:451
uint32_t ocs_hal_cxn_get_free_wq_cnt(ocs_hal_t *hal, ocs_cxn_t *cxn)
Returns the number of free entries on the work queue for this connection.
Definition: ocs_hal.c:5013
uint32_t n_sge
Definition: ocs_hal.h:489
ocs_hal_rtn_e ocs_hal_cxn_connect(ocs_hal_t *hal, ocs_cxn_t *cxn, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, uint16_t window_size, uint8_t window_scale, cxn_cb_t cxn_cb, void *ul_arg)
Establish a TCP connection from an initiator to a target.
Definition: ocs_hal.c:4551
ocs_list_t io_ini_read_quarantine
Definition: ocs_hal.h:817
ocs_list_t ocs_list_link_t
Definition: ocs_list.h:84
uint16_t tag
Definition: ocs_hal.h:486
int32_t ocs_hal_get_active_profile(ocs_hal_t *hal, mgmt_cb_t cb, void *ul_arg)
Get the currently active profile.
Definition: ocs_hal.c:6398
uint32_t ref_tag_repl
Definition: ocs_hal.h:205
ocs_hal_rtn_e ocs_hal_cxn_close(ocs_hal_t *hal, ocs_cxn_t *cxn, uint8_t sendRst, cxn_cb_t cxn_cb, void *ul_arg)
Invalidates a connection and optionally sends a TCP Reset.
Definition: ocs_hal.c:5038
ocs_list_t io_free
Definition: ocs_hal.h:806
uint8_t is_jumbo_set
Definition: ocs_hal.h:728
ocs_hal_rtn_e ocs_hal_portal_isns_send_packet(ocs_hal_t *hal, ocs_hal_ip_address_t *isns_server, uint32_t tcp_port, void *packet, uint32_t pkt_len, portal_cb_t portal_cb, void *ul_arg)
Sends an iSNS packet to the requested server.
Definition: ocs_hal.c:4324
ocs_hal_sgl_info_t * sgl_info
Definition: ocs_hal.h:803
ocs_hal_rtn_e ocs_hal_init(ocs_hal_t *hal)
Set up Hardware Abstraction Layer module.
Definition: ocs_hal.c:201
ocs_hal_property_e
enum identifying the HAL properties.
Definition: ocs_hal.h:97
ocs_hal_rtn_e ocs_hal_command_queue(ocs_hal_t *hal, ocs_command_ctx_t *ctx)
Issue a SLI command.
Definition: ocs_hal.c:2164
ocs_hal_portal_event_e
enum identifying the port event types.
Definition: ocs_hal.h:580
cxn_cb_t * cxn_cb
Definition: ocs_hal.h:385
uint32_t n_cq
Definition: ocs_hal.h:738
int32_t ocs_hal_portal_get_route_table_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of Get Route table command.
Definition: ocs_hal.c:3518
ocs_hal_io_t * io
Definition: ocs_hal.h:802
ocs_dma_t * payload2
Definition: ocs_hal.h:523
ocs_list_t io_tgt_write_quarantine
Definition: ocs_hal.h:815
ocs_dma_t non_emdedded_mem
Definition: ocs_hal.h:377
ocs_hal_rtn_e ocs_hal_domain_add(ocs_hal_t *hal, ocs_sli_port_t *sport, ocs_domain_t *domain)
Adds a domain object.
Definition: ocs_hal.c:3037
T10 DIF information passed to the transport.
Definition: ocs_hal.h:201
ocs_hal_rtn_e ocs_hal_portal_gateway_remove(ocs_hal_t *hal, ocs_hal_ip_address_t *gateway, portal_cb_t portal_cb, void *ul_arg)
removes a default gateway on an interface.
Definition: ocs_hal.c:4101
ocs_dma_t bhs_mem
Definition: ocs_hal.h:822
int32_t ocs_hal_get_num_eq(ocs_hal_t *hal)
Definition: ocs_hal.c:2660
uint32_t n_sge
Definition: ocs_hal.h:459
void * mgmt_cb_arg
Definition: ocs_hal.h:387
int32_t ocs_hal_get_linkcfg(ocs_hal_t *hal, mgmt_cb_t cb, void *ul_arg)
Get the current link configuration.
Definition: ocs_hal.c:6628
ocs_hal_rtn_e ocs_hal_teardown(ocs_hal_t *hal)
Tear down Hardware Abstraction Layer module.
Definition: ocs_hal.c:2409
uint32_t rq_pl_size
Definition: ocs_hal.h:743
ocs_cxn_t * ocs_hal_cxn_alloc(ocs_hal_t *hal, uint32_t conn_hdl)
Gets a free connection structure.
Definition: ocs_hal.c:4468
mgmt_cb_t * mgmt_cb
Definition: ocs_hal.h:386
ocs_hal_rtn_e ocs_hal_set_linkcfg(ocs_hal_t *hal, mgmt_cb_t cb, ocs_hal_linkcfg_e value, void *ul_arg)
Set the link configuration (Skyhawk only).
Definition: ocs_hal.c:6716
ocs_list_link_t link
Definition: ocs_hal.h:473
structure wrapping an IP address and subnet together with their type.
Definition: ocs_hal.h:267
ocs_list_link_t link
Definition: ocs_hal.h:452
uint32_t list_cnt
Definition: ocs_hal.h:704
ocs_lock_t cmd_lock
Definition: ocs_hal.h:765
Structure to hold the fields returned on a target data digest error event.
Definition: ocs_hal.h:608
ocs_dma_t * bhs
Definition: ocs_hal.h:521
#define OCS_HAL_MAX_NUM_RQ
Definition: ocs_hal.h:72
ocs_command_ctx_t * ocs_hal_command_get_ctx(ocs_hal_t *hal)
Issue a SLI command.
Definition: ocs_hal.c:2065
ocs_hal_rtn_e ocs_hal_cxn_reject(ocs_hal_t *hal, uint32_t conn_hdl, cxn_cb_t cxn_cb, void *ul_arg)
Rejects an incoming connection on a target.
Definition: ocs_hal.c:4685
ocs_dma_t isns_mem
Definition: ocs_hal.h:825
ocs_hal_ip_type_e
enum identifying the types of IP addresses.
Definition: ocs_hal.h:244
ocs_hal_rtn_e ocs_hal_portal_esi_listen_stop(ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
Stops listening on an iSNS ESI TCP port.
Definition: ocs_hal.c:4425
uint16_t sense_len
Definition: ocs_hal.h:424
ocs_hal_target_login_options_t lgn_options
Definition: ocs_hal.h:563
ocs_hal_dhcp_state_t dhcp_state
Definition: ocs_hal.h:293
ocs_hal_rq_buffer_type_e
Defines the type of RQ buffer.
Definition: ocs_hal.h:684
ocs_hal_rtn_e ocs_hal_set_active_profile(ocs_hal_t *hal, mgmt_cb_t cb, uint32_t profile_id, void *ul_arg)
Set the currently active profile.
Definition: ocs_hal.c:6479
ocs_hal_rtn_e ocs_hal_io_add_seed_sge(ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_dif_info_t *dif_info)
Add a T10 PI seed scatter gather list entry.
Definition: ocs_hal.c:5793
ocs_hal_rtn_e ocs_hal_portal_listen_start(ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
Starts listening on a TCP port.
Definition: ocs_hal.c:4147
ocs_hal_rtn_e
defines common HAL return statuses.
Definition: ocs_hal.h:78
ocs_hal_portal_t portal
Definition: ocs_hal.h:291
ocs_hal_rtn_e ocs_hal_portal_ip_add(ocs_hal_t *hal, ocs_hal_portal_t portal, ocs_hal_ip_address_subnet_t *ipaddr, portal_cb_t portal_cb, void *ul_arg)
Add an IP address to an interface.
Definition: ocs_hal.c:3727
ocs_hal_rtn_e ocs_hal_io_init_sges(ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_io_type_e type, uint32_t offset)
Initialize the Scatter Gather List entries of an IO.
Definition: ocs_hal.c:5562
sli4_t sli
Definition: ocs_hal.h:726
ocs_hal_abort_type_e
HAL abort types.
Definition: ocs_hal.h:675
ocs_hal_rtn_e ocs_hal_command_bootstrap(ocs_hal_t *hal, uint8_t *cmd)
Issue a SLI command to the bootstrap mailbox.
Definition: ocs_hal.c:2018
ocs_cxn_t * cxn
Definition: ocs_hal.h:381
ocs_hal_reset_e
defines the types of resets.
Definition: ocs_hal.h:88
#define OCS_HAL_MAX_NUM_EQ
Definition: ocs_hal.h:71
uint8_t is_login
Definition: ocs_hal.h:554
uint32_t itt
Definition: ocs_hal.h:491
ocs_domain_t * domain
Definition: ocs_hal.h:727
Structure to define what connection event occurred and it&#39;s parameters.
Definition: ocs_hal.h:637
bool enable_sgl_chaining
Definition: ocs_hal.h:744
HAL object.
Definition: ocs_hal.h:724
uint16_t lun
Definition: ocs_hal.h:508
uint16_t icd
Definition: ocs_hal.h:474
ocs_list_t cmd_pending
Definition: ocs_hal.h:767
ocs_hal_rtn_e ocs_hal_io_add_sge(ocs_hal_t *hal, ocs_hal_io_t *io, uintptr_t addr, uint32_t length)
Add a Scatter Gather list Entry to an IO.
Definition: ocs_hal.c:5732
uint32_t vlan_priority
Definition: ocs_hal.h:292
void ocs_hal_cxn_req_invalidate(ocs_list_t *list_cxn)
Definition: ocs_hal.c:7547
uint8_t dif_mode
Definition: ocs_hal.h:745
ocs_hal_rtn_e ocs_hal_portal_set_mac(ocs_hal_t *hal, uint8_t *mac_address, portal_cb_t portal_cb, void *ul_arg)
Set the MAC address on the portal.
Definition: ocs_hal.c:3122
ocs_hal_rtn_e ocs_hal_callback(ocs_hal_t *hal, ocs_hal_callback_e which, void *func, void *arg)
register a callback for the given event.
Definition: ocs_hal.c:2203
ocs_cxn_t * cxn
Definition: ocs_hal.h:623
Structure to hold the fields returned on a new connection event.
Definition: ocs_hal.h:630
sli4_link_event_t link
Definition: ocs_hal.h:782
defines the parameters for an IO based on the IO type.
Definition: ocs_hal.h:501
A Profile Descriptor.
Definition: ocs_hal.h:302
uint32_t ocs_hal_portal_t
Definition: ocs_common.h:204
HAL command context.
Definition: ocs_hal.h:360
void * cxn
Definition: ocs_hal.h:797
uint16_t instance_index
Definition: ocs_hal.h:487
ocs_dma_t * payload1
Definition: ocs_hal.h:522
ocs_hal_async_cb_t async_cb
Definition: ocs_hal.h:391
ocs_lock_t cxn_lock
Definition: ocs_hal.h:819
void ocs_hal_command_free_ctx(ocs_hal_t *hal, ocs_command_ctx_t *ctx)
Issue a SLI command.
Definition: ocs_hal.c:2089
uint32_t ttt
Definition: ocs_hal.h:492
ocs_hal_port_protocol_e
Port protocols.
Definition: ocs_hal.h:142
uintptr_t addr
Definition: ocs_hal.h:399
uint32_t n_mq
Definition: ocs_hal.h:739
uint32_t itt
Definition: ocs_hal.h:540
defines the HAL scatter gather list element.
Definition: ocs_hal.h:398
uint32_t io_tgt_write_quarantine_cnt
Definition: ocs_hal.h:814
ocs_hal_rtn_e ocs_hal_portal_ip_remove(ocs_hal_t *hal, ocs_hal_portal_t portal, ocs_hal_ip_address_subnet_t *ipaddr, portal_cb_t portal_cb, void *ul_arg)
Removes an IP address from an interface.
Definition: ocs_hal.c:3802
ocs_hal_callback_e
enum identifying the types of callbacks that can be registered.
Definition: ocs_hal.h:653
Definition: sli4.h:2201
ocs_hal_io_t * ocs_hal_io_alloc(ocs_hal_t *hal)
Allocate a HAL IO object.
Definition: ocs_hal.c:5170
#define SLI4_BMBX_SIZE
Definition: sli4.h:128
ocs_hal_io_type_e
enum identifying IO types.
Definition: ocs_hal.h:227
uint8_t underrun
Definition: ocs_hal.h:531
ocs_hal_io_t * ocs_hal_io_find_itt(ocs_hal_t *hal, uint32_t itt)
Find an IO based on the initiator task tag.
Definition: ocs_hal.c:7191
uint16_t ulp_max
Definition: ocs_hal.h:733
uint32_t num_descriptors
Definition: ocs_hal.h:312
int32_t(* ocs_hal_async_cb_t)(struct ocs_hal_s *hal, int32_t status, void *arg)
Definition: ocs_hal.h:353
ocs_hal_rtn_e ocs_hal_reset(ocs_hal_t *hal, ocs_hal_reset_e reset)
Definition: ocs_hal.c:2558
uint32_t num_entries
Definition: ocs_hal.h:456
int32_t ocs_hal_portal_set_route_table_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of Set Route table command.
Definition: ocs_hal.c:3479
uint16_t rqindex
Definition: ocs_hal.h:695
uint8_t frag_offset
Definition: ocs_hal.h:455
ocs_hal_rtn_e ocs_hal_io_abort(ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_abort_scope_e abort_scope, ocs_hal_abort_type_e abort_type)
Abort a currently running IO.
Definition: ocs_hal.c:6148
ocs_hal_rtn_e ocs_hal_portal_delete(ocs_hal_t *hal, ocs_hal_portal_t portal, portal_cb_t portal_cb, void *ul_arg)
Delete a VLAN interface handle.
Definition: ocs_hal.c:3307
portal_cb_t * portal_cb
Definition: ocs_hal.h:384
uint32_t ip_type
Definition: ocs_hal.h:382
uint8_t piggy_back_status
Definition: ocs_hal.h:530
int32_t ocs_hal_process(ocs_hal_t *hal, uint32_t vector, uint32_t max_isr_time_msec)
Process events associated with the interrupt vector.
Definition: ocs_hal.c:2971
io_cb_t * done
Definition: ocs_hal.h:493
ocs_list_link_t link
Definition: ocs_hal.h:711
ocs_hal_rtn_e ocs_hal_io_send(ocs_hal_t *hal, ocs_hal_io_type_e type, ocs_hal_io_t *io, uint32_t len, ocs_hal_io_param_t *iparam, ocs_cxn_t *cxn, io_cb_t cb, void *arg)
Send a read, write, or response IO.
Definition: ocs_hal.c:5370
int32_t(* ocs_hal_unsol_cb_t)(void *, ocs_cxn_t *, ocs_hal_rq_buffer_t *, uint32_t, ocs_hal_rq_buffer_t *, uint32_t, uint8_t)
HAL unsolicited callback.
Definition: ocs_hal.h:719
ocs_hal_linkcfg_e
Link configurations.
Definition: ocs_hal.h:184
ocs_hal_rtn_e ocs_hal_io_add_dif_sge(ocs_hal_t *hal, ocs_hal_io_t *io, uintptr_t addr)
Add a T10 DIF scatter gather list entry to an IO.
Definition: ocs_hal.c:5880
ocs_hal_rtn_e ocs_hal_get(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t *value)
Definition: ocs_hal.c:2666
uint8_t has_fw_ue
Definition: ocs_hal.h:731
void * bounce
Definition: ocs_hal.h:799
ocs_hal_cxn_new_t cxn_new
Definition: ocs_hal.h:642
uint16_t ulp_start
Definition: ocs_hal.h:732
ocs_hal_rtn_e ocs_hal_set_ptr(ocs_hal_t *hal, ocs_hal_property_e prop, void *value)
Definition: ocs_hal.c:2897
uint32_t n_wq
Definition: ocs_hal.h:741
ocs_hal_ip_type_e ip_type
Definition: ocs_hal.h:260
uint8_t use_v1_multi_protocol
Definition: ocs_hal.h:730
Defines a wrapper for the RQ payload buffers so that we can place it back on the proper queue...
Definition: ocs_hal.h:694
HAL IO object.
Definition: ocs_hal.h:471
This structure is used to track the WQEs for iSCSI.
Definition: sli4.h:2034
A Profile List.
Definition: ocs_hal.h:311
void * async_cb_arg
Definition: ocs_hal.h:392
ocs_dma_t dataout_tmpl_mem
Definition: ocs_hal.h:823
int32_t ocs_hal_event_check(ocs_hal_t *hal, uint32_t vector)
Check for events associated with the interrupt vector.
Definition: ocs_hal.c:2924
uint32_t sge_offset
Definition: ocs_hal.h:490
ocs_list_t sgl_list
Definition: ocs_hal.h:488
Used for returning IP information in return from ocs_hal_portal_ip_get()
Definition: ocs_hal.h:290
ocs_cxn_t * node
Definition: ocs_hal.h:475
ocs_hal_rtn_e ocs_hal_cxn_offload(ocs_hal_t *hal, ocs_cxn_t *cxn, uint32_t tcp_window_size, uint8_t data_digest, uint8_t hdr_digest, uint32_t max_rcv_dsl, cxn_cb_t cxn_cb, void *ul_arg)
Offloads an incoming connection on a target.
Definition: ocs_hal.c:4919
ocs_hal_rtn_e ocs_hal_cxn_free(ocs_hal_t *hal, ocs_cxn_t *cxn)
Frees a connection object for re-use.
Definition: ocs_hal.c:5141
uint32_t cq_index_wq_ini
Definition: ocs_hal.h:757
Structure to track RQ buffers submitted to the chip.
Definition: ocs_hal.h:702
ocs_hal_dif_blk_size_e
T10 DIF block sizes.
Definition: ocs_hal.h:171
uint32_t residual_cnt
Definition: ocs_hal.h:417
ocs_list_t cxn_free
Definition: ocs_hal.h:820
uint8_t is_hal_initialized
Definition: ocs_hal.h:729
ocs_hal_rtn_e ocs_hal_portal_esi_listen_start(ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
Starts listening for iSNS ESI messages on a TCP port.
Definition: ocs_hal.c:4380
ocs_hal_rtn_e ocs_hal_get_profile_list(ocs_hal_t *hal, mgmt_cb_t mgmt_cb, void *ul_arg)
Get a list of available profiles.
Definition: ocs_hal.c:6304
ocs_hal_abort_scope_e
HAL abort types.
Definition: ocs_hal.h:664
ocs_hal_rtn_e ocs_hal_set(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t value)
Definition: ocs_hal.c:2790
uint16_t icd
Definition: ocs_hal.h:454
void ocs_hal_io_free(ocs_hal_t *hal, ocs_hal_io_t *io)
Free a previously allocated HAL IO object.
Definition: ocs_hal.c:5231
ocs_hal_rtn_e ocs_hal_portal_gateway_get(ocs_hal_t *hal, ocs_hal_ip_type_e ip_type, portal_cb_t portal_cb, void *ul_arg)
Retrieves the default gateway on an interface.
Definition: ocs_hal.c:4012
SESSION_LOGIN_OPTIONS.
Definition: ocs_common.h:211
uint32_t ref_tag_cmp
Definition: ocs_hal.h:204
ocs_hal_dif_oper_e dif_oper
Definition: ocs_hal.h:202
This structure is used to track the SLI4 queues.
Definition: sli4.h:2046
sli4_queue_t * cq
Definition: ocs_hal.h:752
uint32_t cmd_head_count
Definition: ocs_hal.h:769
TARGET_LOGIN_OPTIONS.
Definition: ocs_hal.h:321
ocs_hal_cxn_event_e
enum identifying the connection event types.
Definition: ocs_hal.h:594
size_t len
Definition: ocs_hal.h:400
void * unsolicited
Definition: ocs_hal.h:798
ocs_hal_rtn_e ocs_hal_domain_free(ocs_hal_t *hal, ocs_domain_t *domain)
Free a domain object.
Definition: ocs_hal.c:3061
structure wrapping an IP address together with it&#39;s type.
Definition: ocs_hal.h:259
uint32_t num_wq_per_cq
Definition: ocs_hal.h:759
void cxn_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
connection callback function prototype.
Definition: ocs_hal.h:340
uint32_t index
Definition: ocs_hal.h:713
uint8_t set_dm
Definition: ocs_hal.h:553
ocs_hal_dif_info_t * dif_info
Definition: ocs_hal.h:510
ocs_hal_rtn_e ocs_hal_portal_listen_stop(ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
Stops listening on a TCP port.
Definition: ocs_hal.c:4201
defines a structure to contain the fields specific to an initiator IO completion. ...
Definition: ocs_hal.h:416
ocs_hal_workaround_t workaround
Definition: ocs_hal.h:828
ocs_list_link_t link
Definition: ocs_hal.h:362
ocs_hal_rtn_e ocs_hal_cxn_get_info(ocs_hal_t *hal, ocs_cxn_t *cxn, cxn_cb_t cxn_cb, void *ul_arg)
Retrieves information about an incoming context.
Definition: ocs_hal.c:4795
struct ocs_hal_s * hal
Definition: ocs_hal.h:363
ocs_list_t cmd_async
Definition: ocs_hal.h:768
ocs_hal_port_e
enum identifying the port operations.
Definition: ocs_hal.h:572
ocs_hal_rtn_e ocs_hal_portal_isns_discover(ocs_hal_t *hal, ocs_hal_portal_t portal, portal_cb_t portal_cb, void *ul_arg)
Discovers iSNS servers via DHCP.
Definition: ocs_hal.c:4245
void(* ocs_hal_fw_cb_t)(int32_t status, uint32_t bytes_written, void *arg)
Definition: ocs_hal.h:926
uint32_t statsn
Definition: ocs_hal.h:564
uint32_t n_eq
Definition: ocs_hal.h:737
uint32_t tcmd_thread_id(void)
Definition: ocs_hal.c:7209
Structure to hold the fields returned on a connection invalidation event.
Definition: ocs_hal.h:622
uint32_t n_rq
Definition: ocs_hal.h:740
ocs_hal_rtn_e ocs_hal_portal_get_route_table(ocs_hal_t *hal, portal_cb_t portal_cb, void *ul_arg)
Read routing table.
Definition: ocs_hal.c:3661
ocs_dma_t dma
Definition: ocs_hal.h:696
ocs_hal_rtn_e ocs_hal_set_port_protocol(ocs_hal_t *hal, uint32_t pci_func, ocs_hal_port_protocol_e new_protocol, mgmt_cb_t cb, void *ul_arg)
Set the port protocol.
Definition: ocs_hal.c:7116
ocs_hal_unsol_cb_t unsolicited
Definition: ocs_hal.h:791
sli4_queue_t * wq
Definition: ocs_hal.h:749
uint32_t ip_count
Definition: ocs_hal.h:294
uint32_t data_sn
Definition: ocs_hal.h:529
int32_t ocs_hal_async_call(ocs_hal_t *hal, ocs_hal_async_cb_t callback, void *arg)
Make an async callback using NOP mailbox command.
Definition: ocs_hal.c:7518
ocs_hal_rtn_e ocs_hal_portal_set_route_table(ocs_hal_t *hal, ocs_hal_ip_address_subnet_t *hal_ipsub, ocs_hal_ip_address_t *hal_gateway, int32_t add, portal_cb_t portal_cb, void *ul_arg)
Add/Remove an entry to routing table.
Definition: ocs_hal.c:3593
ocs_hal_cxn_event_e event
Definition: ocs_hal.h:638
int32_t ocs_hal_get_port_protocol(ocs_hal_t *hal, uint32_t pci_func, mgmt_cb_t cb, void *ul_arg)
Get the current port protocol.
Definition: ocs_hal.c:6846
ocs_hal_rtn_e ocs_hal_setup(ocs_hal_t *hal, ocs_os_handle_t os, sli4_port_type_e port_type)
Set up the Hardware Abstraction Layer module.
Definition: ocs_hal.c:100
int32_t io_cb_t(struct ocs_hal_io_s *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg)
IO Completion function prototype.
Definition: ocs_hal.h:432
ocs_hal_dif_oper_e
T10 DIF operations.
Definition: ocs_hal.h:161
uint32_t r2t_offset
Definition: ocs_hal.h:541
uint32_t cmdsn
Definition: ocs_hal.h:509
void portal_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
Portal callback function prototype.
Definition: ocs_hal.h:332
uint32_t exp_data_sn
Definition: ocs_hal.h:539
uint8_t overrun
Definition: ocs_hal.h:532
uint32_t cq_index_wq_tgt
Definition: ocs_hal.h:756
ocs_hal_rtn_e ocs_hal_rxbuffer(ocs_hal_t *hal, ocs_hal_rq_buffer_t *header, ocs_hal_rq_buffer_t *payload)
Add a receive buffer pair to the Receive Queue.
Definition: ocs_hal.c:2254
ocs_list_t cmd_head
Definition: ocs_hal.h:766
uint16_t type
Definition: ocs_hal.h:477
void * ocs_hal_get_ptr(ocs_hal_t *hal, ocs_hal_property_e prop)
Definition: ocs_hal.c:2753
ocs_dma_t bhs
Definition: ocs_hal.h:476
uint8_t incr_statsn
Definition: ocs_hal.h:555
ocs_hal_cxn_invalid_t cxn_invalid
Definition: ocs_hal.h:641
void mgmt_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
management callback function prototype.
Definition: ocs_hal.h:348
ocs_hal_dif_blk_size_e blk_size
Definition: ocs_hal.h:203
uint32_t io_ini_read_quarantine_cnt
Definition: ocs_hal.h:816
ocs_hal_portal_t portal
Definition: ocs_hal.h:380
ocs_atomic_t io_alloc_failed_count
Definition: ocs_hal.h:830
uint32_t exp_cmdsn
Definition: ocs_hal.h:418
ocs_hal_dhcp_state_t
enum identifying the DHCP states.
Definition: ocs_hal.h:276
ocs_hal_rq_buffer_t * rq_buf
Definition: ocs_hal.h:703
uint32_t cid
Definition: ocs_hal.h:631
ocs_hal_tgt_data_digest_t tgt_digest
Definition: ocs_hal.h:640
ocs_hal_rtn_e ocs_hal_portal_create(ocs_hal_t *hal, unsigned int vlan_tag, portal_cb_t portal_cb, void *ul_arg)
Create a new VLAN interface handle.
Definition: ocs_hal.c:3263
ocs_hal_rtn_e ocs_hal_portal_set_mtu(ocs_hal_t *hal, uint8_t is_jumbo, portal_cb_t portal_cb, void *ul_arg)
Enable Jumbo frame support on the portal.
Definition: ocs_hal.c:3171
uint32_t n_io
Definition: ocs_hal.h:742
ocs_session_login_options_t session_options
Definition: ocs_hal.h:322
sli4_port_type_e
Definition: sli4.h:2156
ocs_hal_rtn_e ocs_hal_firmware_write(ocs_hal_t *hal, ocs_dma_t *dma, uint32_t size, uint32_t offset, int last, ocs_hal_fw_cb_t cb, void *arg)
Write a portion of a firmware image to the device.
Definition: ocs_hal.c:6229
uint32_t use_cnt
Definition: ocs_hal.h:364
ocs_hal_rtn_e ocs_hal_portal_ip_get(ocs_hal_t *hal, ocs_hal_portal_t portal, ocs_hal_ip_type_e ip_type, portal_cb_t portal_cb, void *ul_arg)
Retrieves the IP addresses on an interface.
Definition: ocs_hal.c:3925
ocs_hal_rtn_e ocs_hal_cxn_upload(ocs_hal_t *hal, ocs_cxn_t *cxn, uint8_t graceful, cxn_cb_t cxn_cb, void *ul_arg)
uploads an incoming connection on a target.
Definition: ocs_hal.c:5096
ocs_hal_portal_t ocs_hal_portal_get_default(ocs_hal_t *hal)
Return the default portal.
Definition: ocs_hal.c:3215
struct ocs_hal_io_s * io
Definition: ocs_hal.h:462
void * arg
Definition: ocs_hal.h:494
void ocs_tgt_cxn_invalidate(ocs_cxn_t *cxn)
Definition: ocs_cxn.c:1617
#define OCS_HAL_MAX_PROFILES
Definition: ocs_hal.h:298
ocs_sgl_type_e
defines the types of SGL lists.
Definition: ocs_hal.h:441