/*******************************************************************************
* This file contains the iSCSI Target specific utility functions.
*
* \u00a9 Copyright 2007-2011 RisingTide Systems LLC.
*
* Licensed to the Linux Foundation under the General Public License (GPL) version 2.
*
* Author: Nicholas A. Bellinger <nab@linux-iscsi.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
******************************************************************************/
#include <linux/list.h>
#include <scsi/scsi_tcq.h>
#include <scsi/iscsi_proto.h>
#include <target/target_core_base.h>
#include <target/target_core_fabric.h>
#include <target/target_core_configfs.h>
#include <target/iscsi/iscsi_transport.h>
#include "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_tq.h"
#include "iscsi_target_util.h"
#include "iscsi_target.h"
#define PRINT_BUFF(buff, len) \
{ \
int zzz; \
\
pr_debug("%d:\n", __LINE__); \
for (zzz = 0; zzz < len; zzz++) { \
if (zzz % 16 == 0) { \
if (zzz) \
pr_debug("\n"); \
pr_debug("%4i: ", zzz); \
} \
pr_debug("%02x ", (unsigned char) (buff)[zzz]); \
} \
if ((len + 1) % 16) \
pr_debug("\n"); \
}
extern struct list_head g_tiqn_list;
extern spinlock_t tiqn_lock;
/*
* Called with cmd->r2t_lock held.
*/
int iscsit_add_r2t_to_list(
struct iscsi_cmd *cmd,
u32 offset,
u32 xfer_len,
int recovery,
u32 r2t_sn)
{
struct iscsi_r2t