linux/drivers/scsi/elx/efct/efct_scsi.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2021 Broadcom. All Rights Reserved. The term
 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
 */

#if !defined(__EFCT_SCSI_H__)
#define __EFCT_SCSI_H__
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport_fc.h>

/* efct_scsi_rcv_cmd() efct_scsi_rcv_tmf() flags */
#define EFCT_SCSI_CMD_DIR_IN
#define EFCT_SCSI_CMD_DIR_OUT
#define EFCT_SCSI_CMD_SIMPLE
#define EFCT_SCSI_CMD_HEAD_OF_QUEUE
#define EFCT_SCSI_CMD_ORDERED
#define EFCT_SCSI_CMD_UNTAGGED
#define EFCT_SCSI_CMD_ACA
#define EFCT_SCSI_FIRST_BURST_ERR
#define EFCT_SCSI_FIRST_BURST_ABORTED

/* efct_scsi_send_rd_data/recv_wr_data/send_resp flags */
#define EFCT_SCSI_LAST_DATAPHASE
#define EFCT_SCSI_NO_AUTO_RESPONSE
#define EFCT_SCSI_LOW_LATENCY

#define EFCT_SCSI_SNS_BUF_VALID(sense)

#define EFCT_SCSI_WQ_STEERING_SHIFT
#define EFCT_SCSI_WQ_STEERING_MASK
#define EFCT_SCSI_WQ_STEERING_CLASS
#define EFCT_SCSI_WQ_STEERING_REQUEST
#define EFCT_SCSI_WQ_STEERING_CPU

#define EFCT_SCSI_WQ_CLASS_SHIFT
#define EFCT_SCSI_WQ_CLASS_MASK
#define EFCT_SCSI_WQ_CLASS(x)

#define EFCT_SCSI_WQ_CLASS_LOW_LATENCY

struct efct_scsi_cmd_resp {};

struct efct_vport {};

/* Status values returned by IO callbacks */
enum efct_scsi_io_status {};

struct efct_node;
struct efct_io;
struct efc_node;
struct efc_nport;

/* Callback used by send_rd_data(), recv_wr_data(), send_resp() */
efct_scsi_io_cb_t;

/* Callback used by send_rd_io(), send_wr_io() */
efct_scsi_rsp_io_cb_t;

/* efct_scsi_cb_t flags */
#define EFCT_SCSI_IO_CMPL
/* IO completed, response sent */
#define EFCT_SCSI_IO_CMPL_RSP_SENT
#define EFCT_SCSI_IO_ABORTED

/* efct_scsi_recv_tmf() request values */
enum efct_scsi_tmf_cmd {};

/* efct_scsi_send_tmf_resp() response values */
enum efct_scsi_tmf_resp {};

struct efct_scsi_sgl {};

enum efct_scsi_io_role {};

struct efct_io *
efct_scsi_io_alloc(struct efct_node *node);
void efct_scsi_io_free(struct efct_io *io);
struct efct_io *efct_io_get_instance(struct efct *efct, u32 index);

int efct_scsi_tgt_driver_init(void);
int efct_scsi_tgt_driver_exit(void);
int efct_scsi_tgt_new_device(struct efct *efct);
int efct_scsi_tgt_del_device(struct efct *efct);
int
efct_scsi_tgt_new_nport(struct efc *efc, struct efc_nport *nport);
void
efct_scsi_tgt_del_nport(struct efc *efc, struct efc_nport *nport);

int
efct_scsi_new_initiator(struct efc *efc, struct efc_node *node);

enum efct_scsi_del_initiator_reason {};

int
efct_scsi_del_initiator(struct efc *efc, struct efc_node *node,	int reason);
void
efct_scsi_recv_cmd(struct efct_io *io, uint64_t lun, u8 *cdb, u32 cdb_len,
		   u32 flags);
int
efct_scsi_recv_tmf(struct efct_io *tmfio, u32 lun, enum efct_scsi_tmf_cmd cmd,
		   struct efct_io *abortio, u32 flags);
int
efct_scsi_send_rd_data(struct efct_io *io, u32 flags, struct efct_scsi_sgl *sgl,
		u32 sgl_count, u64 wire_len, efct_scsi_io_cb_t cb, void *arg);
int
efct_scsi_recv_wr_data(struct efct_io *io, u32 flags, struct efct_scsi_sgl *sgl,
		u32 sgl_count, u64 wire_len, efct_scsi_io_cb_t cb, void *arg);
int
efct_scsi_send_resp(struct efct_io *io, u32 flags,
		struct efct_scsi_cmd_resp *rsp, efct_scsi_io_cb_t cb, void *arg);
int
efct_scsi_send_tmf_resp(struct efct_io *io, enum efct_scsi_tmf_resp rspcode,
			u8 addl_rsp_info[3], efct_scsi_io_cb_t cb, void *arg);
int
efct_scsi_tgt_abort_io(struct efct_io *io, efct_scsi_io_cb_t cb, void *arg);

void efct_scsi_io_complete(struct efct_io *io);

int efct_scsi_reg_fc_transport(void);
void efct_scsi_release_fc_transport(void);
int efct_scsi_new_device(struct efct *efct);
void efct_scsi_del_device(struct efct *efct);
void _efct_scsi_io_free(struct kref *arg);

int
efct_scsi_del_vport(struct efct *efct, struct Scsi_Host *shost);
struct efct_vport *
efct_scsi_new_vport(struct efct *efct, struct device *dev);

int efct_scsi_io_dispatch(struct efct_io *io, void *cb);
int efct_scsi_io_dispatch_abort(struct efct_io *io, void *cb);
void efct_scsi_check_pending(struct efct *efct);
struct efct_io *
efct_bls_send_rjt(struct efct_io *io, struct fc_frame_header *hdr);

#endif /* __EFCT_SCSI_H__ */