linux/drivers/target/iscsi/iscsi_target_util.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*******************************************************************************
 * This file contains the iSCSI Target specific utility functions.
 *
 * (c) Copyright 2007-2013 Datera, Inc.
 *
 * Author: Nicholas A. Bellinger <[email protected]>
 *
 ******************************************************************************/

#include <linux/list.h>
#include <linux/sched/signal.h>
#include <net/ipv6.h>         /* ipv6_addr_equal() */
#include <scsi/scsi_tcq.h>
#include <scsi/iscsi_proto.h>
#include <target/target_core_base.h>
#include <target/target_core_fabric.h>
#include <target/iscsi/iscsi_transport.h>

#include <target/iscsi/iscsi_target_core.h>
#include "iscsi_target_parameters.h"
#include "iscsi_target_seq_pdu_list.h"
#include "iscsi_target_datain_values.h"
#include "iscsi_target_erl0.h"
#include "iscsi_target_erl1.h"
#include "iscsi_target_erl2.h"
#include "iscsi_target_tpg.h"
#include "iscsi_target_util.h"
#include "iscsi_target.h"

extern struct list_head g_tiqn_list;
extern spinlock_t tiqn_lock;

int iscsit_add_r2t_to_list(
	struct iscsit_cmd *cmd,
	u32 offset,
	u32 xfer_len,
	int recovery,
	u32 r2t_sn)
{}

struct iscsi_r2t *iscsit_get_r2t_for_eos(
	struct iscsit_cmd *cmd,
	u32 offset,
	u32 length)
{}

struct iscsi_r2t *iscsit_get_r2t_from_list(struct iscsit_cmd *cmd)
{}

void iscsit_free_r2t(struct iscsi_r2t *r2t, struct iscsit_cmd *cmd)
{}

void iscsit_free_r2ts_from_list(struct iscsit_cmd *cmd)
{}

static int iscsit_wait_for_tag(struct se_session *se_sess, int state, int *cpup)
{}

/*
 * May be called from software interrupt (timer) context for allocating
 * iSCSI NopINs.
 */
struct iscsit_cmd *iscsit_allocate_cmd(struct iscsit_conn *conn, int state)
{}
EXPORT_SYMBOL();

struct iscsi_seq *iscsit_get_seq_holder_for_datain(
	struct iscsit_cmd *cmd,
	u32 seq_send_order)
{}

struct iscsi_seq *iscsit_get_seq_holder_for_r2t(struct iscsit_cmd *cmd)
{}

struct iscsi_r2t *iscsit_get_holder_for_r2tsn(
	struct iscsit_cmd *cmd,
	u32 r2t_sn)
{}

static inline int iscsit_check_received_cmdsn(struct iscsit_session *sess, u32 cmdsn)
{}

/*
 * Commands may be received out of order if MC/S is in use.
 * Ensure they are executed in CmdSN order.
 */
int iscsit_sequence_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd,
			unsigned char *buf, __be32 cmdsn)
{}
EXPORT_SYMBOL();

int iscsit_check_unsolicited_dataout(struct iscsit_cmd *cmd, unsigned char *buf)
{}

struct iscsit_cmd *iscsit_find_cmd_from_itt(
	struct iscsit_conn *conn,
	itt_t init_task_tag)
{}
EXPORT_SYMBOL();

struct iscsit_cmd *iscsit_find_cmd_from_itt_or_dump(
	struct iscsit_conn *conn,
	itt_t init_task_tag,
	u32 length)
{}
EXPORT_SYMBOL();

struct iscsit_cmd *iscsit_find_cmd_from_ttt(
	struct iscsit_conn *conn,
	u32 targ_xfer_tag)
{}

int iscsit_find_cmd_for_recovery(
	struct iscsit_session *sess,
	struct iscsit_cmd **cmd_ptr,
	struct iscsi_conn_recovery **cr_ptr,
	itt_t init_task_tag)
{}

void iscsit_add_cmd_to_immediate_queue(
	struct iscsit_cmd *cmd,
	struct iscsit_conn *conn,
	u8 state)
{}
EXPORT_SYMBOL();

struct iscsi_queue_req *iscsit_get_cmd_from_immediate_queue(struct iscsit_conn *conn)
{}

static void iscsit_remove_cmd_from_immediate_queue(
	struct iscsit_cmd *cmd,
	struct iscsit_conn *conn)
{}

int iscsit_add_cmd_to_response_queue(
	struct iscsit_cmd *cmd,
	struct iscsit_conn *conn,
	u8 state)
{}

struct iscsi_queue_req *iscsit_get_cmd_from_response_queue(struct iscsit_conn *conn)
{}

static void iscsit_remove_cmd_from_response_queue(
	struct iscsit_cmd *cmd,
	struct iscsit_conn *conn)
{}

bool iscsit_conn_all_queues_empty(struct iscsit_conn *conn)
{}

void iscsit_free_queue_reqs_for_conn(struct iscsit_conn *conn)
{}

void iscsit_release_cmd(struct iscsit_cmd *cmd)
{}
EXPORT_SYMBOL();

void __iscsit_free_cmd(struct iscsit_cmd *cmd, bool check_queues)
{}

void iscsit_free_cmd(struct iscsit_cmd *cmd, bool shutdown)
{}
EXPORT_SYMBOL();

bool iscsit_check_session_usage_count(struct iscsit_session *sess,
				      bool can_sleep)
{}

void iscsit_dec_session_usage_count(struct iscsit_session *sess)
{}

void iscsit_inc_session_usage_count(struct iscsit_session *sess)
{}

struct iscsit_conn *iscsit_get_conn_from_cid(struct iscsit_session *sess, u16 cid)
{}

struct iscsit_conn *iscsit_get_conn_from_cid_rcfr(struct iscsit_session *sess, u16 cid)
{}

void iscsit_check_conn_usage_count(struct iscsit_conn *conn)
{}

void iscsit_dec_conn_usage_count(struct iscsit_conn *conn)
{}

void iscsit_inc_conn_usage_count(struct iscsit_conn *conn)
{}

static int iscsit_add_nopin(struct iscsit_conn *conn, int want_response)
{}

void iscsit_handle_nopin_response_timeout(struct timer_list *t)
{}

void iscsit_mod_nopin_response_timer(struct iscsit_conn *conn)
{}

void iscsit_start_nopin_response_timer(struct iscsit_conn *conn)
{}

void iscsit_stop_nopin_response_timer(struct iscsit_conn *conn)
{}

void iscsit_handle_nopin_timeout(struct timer_list *t)
{}

void __iscsit_start_nopin_timer(struct iscsit_conn *conn)
{}

void iscsit_start_nopin_timer(struct iscsit_conn *conn)
{}

void iscsit_stop_nopin_timer(struct iscsit_conn *conn)
{}

void iscsit_login_timeout(struct timer_list *t)
{}

void iscsit_start_login_timer(struct iscsit_conn *conn, struct task_struct *kthr)
{}

int iscsit_set_login_timer_kworker(struct iscsit_conn *conn, struct task_struct *kthr)
{}

void iscsit_stop_login_timer(struct iscsit_conn *conn)
{}

int iscsit_send_tx_data(
	struct iscsit_cmd *cmd,
	struct iscsit_conn *conn,
	int use_misc)
{}

int iscsit_fe_sendpage_sg(
	struct iscsit_cmd *cmd,
	struct iscsit_conn *conn)
{}

/*
 *      This function is used for mainly sending a ISCSI_TARG_LOGIN_RSP PDU
 *      back to the Initiator when an expection condition occurs with the
 *      errors set in status_class and status_detail.
 *
 *      Parameters:     iSCSI Connection, Status Class, Status Detail.
 *      Returns:        0 on success, -1 on error.
 */
int iscsit_tx_login_rsp(struct iscsit_conn *conn, u8 status_class, u8 status_detail)
{}

void iscsit_print_session_params(struct iscsit_session *sess)
{}

int rx_data(
	struct iscsit_conn *conn,
	struct kvec *iov,
	int iov_count,
	int data)
{}

int tx_data(
	struct iscsit_conn *conn,
	struct kvec *iov,
	int iov_count,
	int data)
{}

void iscsit_collect_login_stats(
	struct iscsit_conn *conn,
	u8 status_class,
	u8 status_detail)
{}

struct iscsi_tiqn *iscsit_snmp_get_tiqn(struct iscsit_conn *conn)
{}

void iscsit_fill_cxn_timeout_err_stats(struct iscsit_session *sess)
{}