2 * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
3 * By downloading, copying, installing or using the software you agree
4 * to this license. If you do not agree to this license, do not
5 * download, install, copy or use the software.
7 * Intel License Agreement
9 * Copyright (c) 2000, Intel Corporation
10 * All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
16 * -Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
19 * -Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the
24 * -The name of Intel Corporation may not be used to endorse or
25 * promote products derived from this software without specific prior
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
35 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
38 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44 #include "iscsiprotocol.h"
45 #include "iscsiutil.h"
46 #include "parameters.h"
50 /* Default configuration */
51 #define DEFAULT_TARGET_MAX_SESSIONS 16 /* n+1 */
52 #define DEFAULT_TARGET_NUM_LUNS 1
53 #define DEFAULT_TARGET_BLOCK_LEN 512
54 #define DEFAULT_TARGET_NUM_BLOCKS 204800
55 #define DEFAULT_TARGET_NAME "iqn.1994-04.org.netbsd.iscsi-target"
56 #define DEFAULT_TARGET_QUEUE_DEPTH 8
57 #define DEFAULT_TARGET_TCQ 0
60 MAX_INITIATOR_ADDRESS_SIZE
= 256
64 /* session parameters */
65 typedef struct target_session_t
{
74 int UsePhaseCollapsedRead
;
80 iscsi_target_t
*target
;
81 iscsi_worker_t worker
;
82 iscsi_parameter_t
*params
;
83 iscsi_sess_param_t sess_params
;
84 char initiator
[MAX_INITIATOR_ADDRESS_SIZE
];
89 typedef struct target_cmd_t
{
90 iscsi_scsi_cmd_args_t
*scsi_cmd
;
91 int (*callback
) (void *);
95 int target_transfer_data(target_session_t
*, iscsi_scsi_cmd_args_t
*, struct iovec
*, int);
97 int find_target_tsih(iscsi_target_t
*, int);
98 int find_target_iqn(target_session_t
*);
100 #endif /* _TARGET_H_ */