linux/drivers/target/target_core_sbc.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * SCSI Block Commands (SBC) parsing and emulation.
 *
 * (c) Copyright 2002-2013 Datera, Inc.
 *
 * Nicholas A. Bellinger <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/ratelimit.h>
#include <linux/crc-t10dif.h>
#include <linux/t10-pi.h>
#include <asm/unaligned.h>
#include <scsi/scsi_proto.h>
#include <scsi/scsi_tcq.h>

#include <target/target_core_base.h>
#include <target/target_core_backend.h>
#include <target/target_core_fabric.h>

#include "target_core_internal.h"
#include "target_core_ua.h"
#include "target_core_alua.h"

static sense_reason_t
sbc_check_prot(struct se_device *, struct se_cmd *, unsigned char, u32, bool);
static sense_reason_t sbc_execute_unmap(struct se_cmd *cmd);

static sense_reason_t
sbc_emulate_readcapacity(struct se_cmd *cmd)
{}

static sense_reason_t
sbc_emulate_readcapacity_16(struct se_cmd *cmd)
{}

static sense_reason_t
sbc_emulate_startstop(struct se_cmd *cmd)
{}

sector_t sbc_get_write_same_sectors(struct se_cmd *cmd)
{}
EXPORT_SYMBOL();

static sense_reason_t
sbc_execute_write_same_unmap(struct se_cmd *cmd)
{}

static sense_reason_t
sbc_emulate_noop(struct se_cmd *cmd)
{}

static inline u32 sbc_get_size(struct se_cmd *cmd, u32 sectors)
{}

static inline u32 transport_get_sectors_6(unsigned char *cdb)
{}

static inline u32 transport_get_sectors_10(unsigned char *cdb)
{}

static inline u32 transport_get_sectors_12(unsigned char *cdb)
{}

static inline u32 transport_get_sectors_16(unsigned char *cdb)
{}

/*
 * Used for VARIABLE_LENGTH_CDB WRITE_32 and READ_32 variants
 */
static inline u32 transport_get_sectors_32(unsigned char *cdb)
{}

static inline u32 transport_lba_21(unsigned char *cdb)
{}

static inline u32 transport_lba_32(unsigned char *cdb)
{}

static inline unsigned long long transport_lba_64(unsigned char *cdb)
{}

static sense_reason_t
sbc_setup_write_same(struct se_cmd *cmd, unsigned char flags,
		     struct exec_cmd_ops *ops)
{}

static sense_reason_t
sbc_execute_rw(struct se_cmd *cmd)
{}

static sense_reason_t compare_and_write_post(struct se_cmd *cmd, bool success,
					     int *post_ret)
{}

/*
 * compare @cmp_len bytes of @read_sgl with @cmp_sgl. On miscompare, fill
 * @miscmp_off and return TCM_MISCOMPARE_VERIFY.
 */
static sense_reason_t
compare_and_write_do_cmp(struct scatterlist *read_sgl, unsigned int read_nents,
			 struct scatterlist *cmp_sgl, unsigned int cmp_nents,
			 unsigned int cmp_len, unsigned int *miscmp_off)
{}

static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool success,
						 int *post_ret)
{}

static sense_reason_t
sbc_compare_and_write(struct se_cmd *cmd)
{}

static int
sbc_set_prot_op_checks(u8 protect, bool fabric_prot, enum target_prot_type prot_type,
		       bool is_write, struct se_cmd *cmd)
{}

static sense_reason_t
sbc_check_prot(struct se_device *dev, struct se_cmd *cmd, unsigned char protect,
	       u32 sectors, bool is_write)
{}

static int
sbc_check_dpofua(struct se_device *dev, struct se_cmd *cmd, unsigned char *cdb)
{}

sense_reason_t
sbc_parse_cdb(struct se_cmd *cmd, struct exec_cmd_ops *ops)
{}
EXPORT_SYMBOL();

u32 sbc_get_device_type(struct se_device *dev)
{}
EXPORT_SYMBOL();

static sense_reason_t
sbc_execute_unmap(struct se_cmd *cmd)
{}

void
sbc_dif_generate(struct se_cmd *cmd)
{}

static sense_reason_t
sbc_dif_v1_verify(struct se_cmd *cmd, struct t10_pi_tuple *sdt,
		  __u16 crc, sector_t sector, unsigned int ei_lba)
{}

void sbc_dif_copy_prot(struct se_cmd *cmd, unsigned int sectors, bool read,
		       struct scatterlist *sg, int sg_off)
{}
EXPORT_SYMBOL();

sense_reason_t
sbc_dif_verify(struct se_cmd *cmd, sector_t start, unsigned int sectors,
	       unsigned int ei_lba, struct scatterlist *psg, int psg_off)
{}
EXPORT_SYMBOL();