Files
scst/qla_isp/linux/scsi_target.h
Vladislav Bolkhovitin 1213800b2f Patch from Bart Van Assche <bart.vanassche@gmail.com>, except few chuncks from qla2x00t/ obviously not related to the target mode addon:
One of the Linux kernel patch submission requirements is that source files do
not contain trailing whitespace. The patch below removes trailing whitespace
from .c and .h source files.

Note: it might be more convenient to run the script I used to generate this
patch than to review and apply the patch below. This is how I generated and
verified the patch below:

cat <<EOF >./strip-trailing-whitespace
#!/bin/bash
trap "rm -f $t" EXIT
t=/tmp/temporary-file.$$
for f in "$@"
do
  sed 's/[	 ]*$//' <"$f" >"$t" && mv "$t" "$f"
done
EOF
chmod a+x ./strip-trailing-whitespace
find -name '*.[ch]' | xargs ./strip-trailing-whitespace
svn diff -x -w

Signed-off-by: <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-05-19 10:21:41 +00:00

120 lines
4.2 KiB
C

/* $Id: scsi_target.h,v 1.30 2008/02/11 23:59:06 mjacob Exp $ */
/*
* Copyright (c) 1997-2008 by Matthew Jacob
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*
* Alternatively, this software may be distributed under the terms of the
* the GNU Public License ("GPL") with platforms where the prevalant license
* is the GNU Public License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of The Version 2 GNU General Public License as published
* by the Free Software Foundation.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
* Matthew Jacob
* Feral Software
* 421 Laurel Avenue
* Menlo Park, CA 94025
* USA
*
* gplbsd at feral com
*/
/*
* SCSI Target Control Port
*/
#define SCSI_TARGET "scsi_target"
#define SCSI_TARGET_DEV "/proc/" SCSI_TARGET
/*
* SCSI Target Stub Driver for Linux for a memory or user agent disk device.
* Ioctl Definitions File.
*/
#define _SI ('j' << 8)
/*
* Set new debugging level (get previous) (int argument).
*/
#define SC_DEBUG (_SI | 0)
/*
* Enable/Disable lun
*/
typedef struct {
char hba_name_unit[16]; /* e.g., "isp0" */
uint64_t nbytes; /* disk size, in bytes */
uint16_t lun; /* lun to map it to */
uint8_t channel; /* channel */
uint8_t flags;
} sc_enable_t;
#define SC_EF_OVERCOMMIT 0x01 /* allow overcommit */
#define SC_ENABLE_LUN (_SI | 1)
#define SC_DISABLE_LUN (_SI | 2)
/*
* Overcommit disks have to have data written to backing store
* and read from it.
*/
typedef struct {
char hba_name_unit[16]; /* e.g., "isp0" */
uint16_t lun; /* lun */
uint8_t channel;
uint8_t : 6,
sync : 1, /* (implied) sync after write */
read : 1; /* read (from target to initiator) flag */
void * tag; /* id tag for this command */
void * addr; /* user buffer address */
uint32_t len; /* user buffer length */
uint64_t off; /* disk offset */
uint32_t amt; /* this command's actual data length */
int err; /* from user app */
} sc_io_t;
#define SC_GET_IO (_SI | 3)
#define SC_PUT_IO (_SI | 4)
/*
* Inject a UNIT ATTENTION error on the next command for this device
*/
typedef struct {
char hba_name_unit[16];
} sc_inject_ua_t;
#define SC_INJECT_UA (_SI | 21)
/*
* vim:ts=4:sw=4:expandtab
*/