#ifndef _EFCT_HW_H
#define _EFCT_HW_H
#include "../libefc_sli/sli4.h"
#define EFCT_VENDOR_ID …
#define EFCT_DEVICE_LANCER_G6 …
#define EFCT_DEVICE_LANCER_G7 …
#define EFCT_HW_RQ_ENTRIES_MIN …
#define EFCT_HW_RQ_ENTRIES_DEF …
#define EFCT_HW_RQ_ENTRIES_MAX …
#define EFCT_HW_RQ_SIZE_HDR …
#define EFCT_HW_RQ_SIZE_PAYLOAD …
#define EFCT_HW_MAX_MRQS …
#define EFCT_HW_WQEC_SET_COUNT …
#define EFCT_HW_SEND_FRAME_TIMEOUT …
#define EFCT_HW_FDT_XFER_HINT …
#define EFCT_HW_TIMECHECK_ITERATIONS …
#define EFCT_HW_MAX_NUM_MQ …
#define EFCT_HW_MAX_NUM_RQ …
#define EFCT_HW_MAX_NUM_EQ …
#define EFCT_HW_MAX_NUM_WQ …
#define EFCT_HW_DEF_NUM_EQ …
#define OCE_HW_MAX_NUM_MRQ_PAIRS …
#define EFCT_HW_MQ_DEPTH …
#define EFCT_HW_EQ_DEPTH …
#define EFCT_HW_MAX_NUM_CQ …
#define EFCT_HW_Q_HASH_SIZE …
#define EFCT_HW_RQ_HEADER_SIZE …
#define EFCT_HW_RQ_HEADER_INDEX …
#define EFCT_HW_REQUE_XRI_REGTAG …
enum efct_cmd_opts { … };
enum efct_hw_reset { … };
enum efct_hw_topo { … };
#define HW_FWREV(a, b, c, d) …
#define EFCT_FW_VER_STR(a, b, c, d) …
enum efct_hw_io_type { … };
enum efct_hw_io_state { … };
#define EFCT_TARGET_WRITE_SKIPS …
#define EFCT_TARGET_READ_SKIPS …
struct efct_hw;
struct efct_io;
#define EFCT_CMD_CTX_POOL_SZ …
struct efct_command_ctx { … };
struct efct_hw_sgl { … };
efct_hw_io_param_u;
enum efct_hw_wq_steering { … };
struct efct_hw_wqe { … };
struct efct_hw_io;
efct_hw_done_t;
struct efct_hw_io { … };
enum efct_hw_port { … };
struct efct_hw_rpi_ref { … };
enum efct_hw_link_stat { … };
enum efct_hw_host_stat { … };
enum efct_hw_state { … };
struct efct_hw_link_stat_counts { … };
struct efct_hw_host_stat_counts { … };
struct efct_queue_hash { … };
struct hw_wq_callback { … };
struct reqtag_pool { … };
struct efct_hw_config { … };
struct efct_hw { … };
enum efct_hw_io_count_type { … };
struct hw_eq { … };
struct hw_cq { … };
struct hw_q { … };
struct hw_mq { … };
struct hw_wq { … };
struct hw_rq { … };
struct efct_hw_send_frame_context { … };
struct efct_hw_grp_hdr { … };
static inline int
efct_hw_get_link_speed(struct efct_hw *hw) { … }
int
efct_hw_setup(struct efct_hw *hw, void *os, struct pci_dev *pdev);
int efct_hw_init(struct efct_hw *hw);
int
efct_hw_parse_filter(struct efct_hw *hw, void *value);
int
efct_hw_init_queues(struct efct_hw *hw);
int
efct_hw_map_wq_cpu(struct efct_hw *hw);
uint64_t
efct_get_wwnn(struct efct_hw *hw);
uint64_t
efct_get_wwpn(struct efct_hw *hw);
int efct_hw_rx_allocate(struct efct_hw *hw);
int efct_hw_rx_post(struct efct_hw *hw);
void efct_hw_rx_free(struct efct_hw *hw);
int
efct_hw_command(struct efct_hw *hw, u8 *cmd, u32 opts, void *cb,
void *arg);
int
efct_issue_mbox_rqst(void *base, void *cmd, void *cb, void *arg);
struct efct_hw_io *efct_hw_io_alloc(struct efct_hw *hw);
int efct_hw_io_free(struct efct_hw *hw, struct efct_hw_io *io);
u8 efct_hw_io_inuse(struct efct_hw *hw, struct efct_hw_io *io);
int
efct_hw_io_send(struct efct_hw *hw, enum efct_hw_io_type type,
struct efct_hw_io *io, union efct_hw_io_param_u *iparam,
void *cb, void *arg);
int
efct_hw_io_register_sgl(struct efct_hw *hw, struct efct_hw_io *io,
struct efc_dma *sgl,
u32 sgl_count);
int
efct_hw_io_init_sges(struct efct_hw *hw,
struct efct_hw_io *io, enum efct_hw_io_type type);
int
efct_hw_io_add_sge(struct efct_hw *hw, struct efct_hw_io *io,
uintptr_t addr, u32 length);
int
efct_hw_io_abort(struct efct_hw *hw, struct efct_hw_io *io_to_abort,
bool send_abts, void *cb, void *arg);
u32
efct_hw_io_get_count(struct efct_hw *hw,
enum efct_hw_io_count_type io_count_type);
struct efct_hw_io
*efct_hw_io_lookup(struct efct_hw *hw, u32 indicator);
void efct_hw_io_abort_all(struct efct_hw *hw);
void efct_hw_io_free_internal(struct kref *arg);
struct reqtag_pool *efct_hw_reqtag_pool_alloc(struct efct_hw *hw);
void efct_hw_reqtag_pool_free(struct efct_hw *hw);
struct hw_wq_callback
*efct_hw_reqtag_alloc(struct efct_hw *hw,
void (*callback)(void *arg, u8 *cqe,
int status), void *arg);
void
efct_hw_reqtag_free(struct efct_hw *hw, struct hw_wq_callback *wqcb);
struct hw_wq_callback
*efct_hw_reqtag_get_instance(struct efct_hw *hw, u32 instance_index);
int
efct_hw_rqpair_process_rq(struct efct_hw *hw,
struct hw_cq *cq, u8 *cqe);
int
efct_hw_rqpair_sequence_free(struct efct_hw *hw, struct efc_hw_sequence *seq);
static inline void
efct_hw_sequence_copy(struct efc_hw_sequence *dst,
struct efc_hw_sequence *src)
{ … }
int
efct_efc_hw_sequence_free(struct efc *efc, struct efc_hw_sequence *seq);
static inline int
efct_hw_sequence_free(struct efct_hw *hw, struct efc_hw_sequence *seq)
{ … }
int
efct_hw_eq_process(struct efct_hw *hw, struct hw_eq *eq,
u32 max_isr_time_msec);
void efct_hw_cq_process(struct efct_hw *hw, struct hw_cq *cq);
void
efct_hw_wq_process(struct efct_hw *hw, struct hw_cq *cq,
u8 *cqe, int status, u16 rid);
void
efct_hw_xabt_process(struct efct_hw *hw, struct hw_cq *cq,
u8 *cqe, u16 rid);
int
efct_hw_process(struct efct_hw *hw, u32 vector, u32 max_isr_time_msec);
int
efct_hw_queue_hash_find(struct efct_queue_hash *hash, u16 id);
int efct_hw_wq_write(struct hw_wq *wq, struct efct_hw_wqe *wqe);
int
efct_hw_send_frame(struct efct_hw *hw, struct fc_frame_header *hdr,
u8 sof, u8 eof, struct efc_dma *payload,
struct efct_hw_send_frame_context *ctx,
void (*callback)(void *arg, u8 *cqe, int status),
void *arg);
int
efct_els_hw_srrs_send(struct efc *efc, struct efc_disc_io *io);
int
efct_efc_bls_send(struct efc *efc, u32 type, struct sli_bls_params *bls);
int
efct_hw_bls_send(struct efct *efct, u32 type, struct sli_bls_params *bls_params,
void *cb, void *arg);
int
efct_hw_get_link_stats(struct efct_hw *hw,
u8 req_ext_counters,
u8 clear_overflow_flags,
u8 clear_all_counters,
void (*efct_hw_link_stat_cb_t)(int status,
u32 num_counters,
struct efct_hw_link_stat_counts *counters, void *arg),
void *arg);
int
efct_hw_get_host_stats(struct efct_hw *hw,
u8 cc,
void (*efct_hw_host_stat_cb_t)(int status,
u32 num_counters,
struct efct_hw_host_stat_counts *counters, void *arg),
void *arg);
int
efct_hw_firmware_write(struct efct_hw *hw, struct efc_dma *dma,
u32 size, u32 offset, int last,
void (*cb)(int status, u32 bytes_written,
u32 change_status, void *arg),
void *arg);
efct_hw_async_cb_t;
int
efct_hw_async_call(struct efct_hw *hw, efct_hw_async_cb_t callback, void *arg);
struct hw_eq *efct_hw_new_eq(struct efct_hw *hw, u32 entry_count);
struct hw_cq *efct_hw_new_cq(struct hw_eq *eq, u32 entry_count);
u32
efct_hw_new_cq_set(struct hw_eq *eqs[], struct hw_cq *cqs[],
u32 num_cqs, u32 entry_count);
struct hw_mq *efct_hw_new_mq(struct hw_cq *cq, u32 entry_count);
struct hw_wq
*efct_hw_new_wq(struct hw_cq *cq, u32 entry_count);
u32
efct_hw_new_rq_set(struct hw_cq *cqs[], struct hw_rq *rqs[],
u32 num_rq_pairs, u32 entry_count);
void efct_hw_del_eq(struct hw_eq *eq);
void efct_hw_del_cq(struct hw_cq *cq);
void efct_hw_del_mq(struct hw_mq *mq);
void efct_hw_del_wq(struct hw_wq *wq);
void efct_hw_del_rq(struct hw_rq *rq);
void efct_hw_queue_teardown(struct efct_hw *hw);
void efct_hw_teardown(struct efct_hw *hw);
int
efct_hw_reset(struct efct_hw *hw, enum efct_hw_reset reset);
int
efct_hw_port_control(struct efct_hw *hw, enum efct_hw_port ctrl,
uintptr_t value,
void (*cb)(int status, uintptr_t value, void *arg),
void *arg);
#endif