linux/drivers/target/iscsi/iscsi_target_erl1.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*******************************************************************************
 * This file contains error recovery level one used by the iSCSI Target driver.
 *
 * (c) Copyright 2007-2013 Datera, Inc.
 *
 * Author: Nicholas A. Bellinger <[email protected]>
 *
 ******************************************************************************/

#include <linux/list.h>
#include <linux/slab.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_seq_pdu_list.h"
#include "iscsi_target_datain_values.h"
#include "iscsi_target_device.h"
#include "iscsi_target_tpg.h"
#include "iscsi_target_util.h"
#include "iscsi_target_erl0.h"
#include "iscsi_target_erl1.h"
#include "iscsi_target_erl2.h"
#include "iscsi_target.h"

#define OFFLOAD_BUF_SIZE

/*
 *	Used to dump excess datain payload for certain error recovery
 *	situations.  Receive in OFFLOAD_BUF_SIZE max of datain per rx_data().
 *
 *	dump_padding_digest denotes if padding and data digests need
 *	to be dumped.
 */
int iscsit_dump_data_payload(
	struct iscsit_conn *conn,
	u32 buf_len,
	int dump_padding_digest)
{}

/*
 *	Used for retransmitting R2Ts from a R2T SNACK request.
 */
static int iscsit_send_recovery_r2t_for_snack(
	struct iscsit_cmd *cmd,
	struct iscsi_r2t *r2t)
{}

static int iscsit_handle_r2t_snack(
	struct iscsit_cmd *cmd,
	unsigned char *buf,
	u32 begrun,
	u32 runlength)
{}

/*
 *	Generates Offsets and NextBurstLength based on Begrun and Runlength
 *	carried in a Data SNACK or ExpDataSN in TMR TASK_REASSIGN.
 *
 *	For DataSequenceInOrder=Yes and DataPDUInOrder=[Yes,No] only.
 *
 *	FIXME: How is this handled for a RData SNACK?
 */
int iscsit_create_recovery_datain_values_datasequenceinorder_yes(
	struct iscsit_cmd *cmd,
	struct iscsi_datain_req *dr)
{}

/*
 *	Generates Offsets and NextBurstLength based on Begrun and Runlength
 *	carried in a Data SNACK or ExpDataSN in TMR TASK_REASSIGN.
 *
 *	For DataSequenceInOrder=No and DataPDUInOrder=[Yes,No] only.
 *
 *	FIXME: How is this handled for a RData SNACK?
 */
int iscsit_create_recovery_datain_values_datasequenceinorder_no(
	struct iscsit_cmd *cmd,
	struct iscsi_datain_req *dr)
{}

static int iscsit_handle_recovery_datain(
	struct iscsit_cmd *cmd,
	unsigned char *buf,
	u32 begrun,
	u32 runlength)
{}

int iscsit_handle_recovery_datain_or_r2t(
	struct iscsit_conn *conn,
	unsigned char *buf,
	itt_t init_task_tag,
	u32 targ_xfer_tag,
	u32 begrun,
	u32 runlength)
{}

/* #warning FIXME: Status SNACK needs to be dependent on OPCODE!!! */
int iscsit_handle_status_snack(
	struct iscsit_conn *conn,
	itt_t init_task_tag,
	u32 targ_xfer_tag,
	u32 begrun,
	u32 runlength)
{}

int iscsit_handle_data_ack(
	struct iscsit_conn *conn,
	u32 targ_xfer_tag,
	u32 begrun,
	u32 runlength)
{}

static int iscsit_send_recovery_r2t(
	struct iscsit_cmd *cmd,
	u32 offset,
	u32 xfer_len)
{}

int iscsit_dataout_datapduinorder_no_fbit(
	struct iscsit_cmd *cmd,
	struct iscsi_pdu *pdu)
{}

static int iscsit_recalculate_dataout_values(
	struct iscsit_cmd *cmd,
	u32 pdu_offset,
	u32 pdu_length,
	u32 *r2t_offset,
	u32 *r2t_length)
{}

int iscsit_recover_dataout_sequence(
	struct iscsit_cmd *cmd,
	u32 pdu_offset,
	u32 pdu_length)
{}

static struct iscsi_ooo_cmdsn *iscsit_allocate_ooo_cmdsn(void)
{}

static int iscsit_attach_ooo_cmdsn(
	struct iscsit_session *sess,
	struct iscsi_ooo_cmdsn *ooo_cmdsn)
{}

/*
 *	Removes an struct iscsi_ooo_cmdsn from a session's list,
 *	called with struct iscsit_session->cmdsn_mutex held.
 */
void iscsit_remove_ooo_cmdsn(
	struct iscsit_session *sess,
	struct iscsi_ooo_cmdsn *ooo_cmdsn)
{}

void iscsit_clear_ooo_cmdsns_for_conn(struct iscsit_conn *conn)
{}

int iscsit_execute_ooo_cmdsns(struct iscsit_session *sess)
{}

/*
 *	Called either:
 *
 *	1. With sess->cmdsn_mutex held from iscsi_execute_ooo_cmdsns()
 *	or iscsi_check_received_cmdsn().
 *	2. With no locks held directly from iscsi_handle_XXX_pdu() functions
 *	for immediate commands.
 */
int iscsit_execute_cmd(struct iscsit_cmd *cmd, int ooo)
{}

void iscsit_free_all_ooo_cmdsns(struct iscsit_session *sess)
{}

int iscsit_handle_ooo_cmdsn(
	struct iscsit_session *sess,
	struct iscsit_cmd *cmd,
	u32 cmdsn)
{}

static int iscsit_set_dataout_timeout_values(
	struct iscsit_cmd *cmd,
	u32 *offset,
	u32 *length)
{}

/*
 *	NOTE: Called from interrupt (timer) context.
 */
void iscsit_handle_dataout_timeout(struct timer_list *t)
{}

void iscsit_mod_dataout_timer(struct iscsit_cmd *cmd)
{}

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

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