linux/drivers/target/tcm_fc/tcm_fc.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2010 Cisco Systems, Inc.
 */
#ifndef __TCM_FC_H__
#define __TCM_FC_H__

#include <linux/types.h>
#include <target/target_core_base.h>

#define FT_VERSION

#define FT_NAMELEN
#define FT_TPG_NAMELEN
#define FT_LUN_NAMELEN
#define TCM_FC_DEFAULT_TAGS

struct ft_transport_id {} __attribute__((packed));

/*
 * Session (remote port).
 */
struct ft_sess {};

/*
 * Hash table of sessions per local port.
 * Hash lookup by remote port FC_ID.
 */
#define FT_SESS_HASH_BITS
#define FT_SESS_HASH_SIZE

/*
 * Per local port data.
 * This is created only after a TPG exists that allows target function
 * for the local port.  If the TPG exists, this is allocated when
 * we're notified that the local port has been created, or when
 * the first PRLI provider callback is received.
 */
struct ft_tport {};

/*
 * Node ID and authentication.
 */
struct ft_node_auth {};

/*
 * Node ACL for FC remote port session.
 */
struct ft_node_acl {};

struct ft_lun {};

/*
 * Target portal group (local port).
 */
struct ft_tpg {};

struct ft_lport_wwn {};

/*
 * Commands
 */
struct ft_cmd {};

extern struct mutex ft_lport_lock;
extern struct fc4_prov ft_prov;
extern unsigned int ft_debug_logging;

/*
 * Fabric methods.
 */

/*
 * Session ops.
 */
void ft_sess_put(struct ft_sess *);
void ft_sess_close(struct se_session *);
u32 ft_sess_get_index(struct se_session *);
u32 ft_sess_get_port_name(struct se_session *, unsigned char *, u32);

void ft_lport_add(struct fc_lport *, void *);
void ft_lport_del(struct fc_lport *, void *);
int ft_lport_notify(struct notifier_block *, unsigned long, void *);

/*
 * IO methods.
 */
int ft_check_stop_free(struct se_cmd *);
void ft_release_cmd(struct se_cmd *);
int ft_queue_status(struct se_cmd *);
int ft_queue_data_in(struct se_cmd *);
int ft_write_pending(struct se_cmd *);
void ft_queue_tm_resp(struct se_cmd *);
void ft_aborted_task(struct se_cmd *);

/*
 * other internal functions.
 */
void ft_recv_req(struct ft_sess *, struct fc_frame *);
struct ft_tpg *ft_lport_find_tpg(struct fc_lport *);

void ft_recv_write_data(struct ft_cmd *, struct fc_frame *);
void ft_dump_cmd(struct ft_cmd *, const char *caller);

ssize_t ft_format_wwn(char *, size_t, u64);

/*
 * Underlying HW specific helper function
 */
void ft_invl_hw_context(struct ft_cmd *);

#endif /* __TCM_FC_H__ */