linux/drivers/target/loopback/tcm_loop.h
Andy Grover 6708bb27bb target: Follow up core updates from AGrover and HCH (round 4)
This patch contains the squashed version of forth round series cleanups
from Andy and Christoph following the post heavy lifting in the preceeding:
'Eliminate usage of struct se_mem' and 'Make all control CDBs scatter-gather'
changes.  This also includes a conversion of target core and the v3.0
mainline fabric modules (loopback and tcm_fc) to use pr_debug and the
CONFIG_DYNAMIC_DEBUG infrastructure!

These have been squashed into this third and final round for v3.1.

target: Remove ifdeffed code in t_g_process_write
target: Remove direct ramdisk code
target: Rename task_sg_num to task_sg_nents
target: Remove custom debug macros for pr_debug. Use pr_err().
target: Remove custom debug macros in mainline fabrics
target: Set WSNZ=1 in block limits VPD. Abort if WRITE_SAME sectors = 0
target: Remove transport do_se_mem_map callback
target: Further simplify transport_free_pages
target: Redo task allocation return value handling
target: Remove extra parentheses
target: change alloc_task call to take *cdb, not *cmd

(nab: Fix bogus struct file assignments in fd_do_readv and fd_do_writev)

Signed-off-by: Andy Grover <agrover@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-07-22 09:37:48 +00:00

71 lines
1.8 KiB
C

#define TCM_LOOP_VERSION "v2.1-rc1"
#define TL_WWN_ADDR_LEN 256
#define TL_TPGS_PER_HBA 32
/*
* Defaults for struct scsi_host_template tcm_loop_driver_template
*
* We use large can_queue and cmd_per_lun here and let TCM enforce
* the underlying se_device_t->queue_depth.
*/
#define TL_SCSI_CAN_QUEUE 1024
#define TL_SCSI_CMD_PER_LUN 1024
#define TL_SCSI_MAX_SECTORS 1024
#define TL_SCSI_SG_TABLESIZE 256
/*
* Used in tcm_loop_driver_probe() for struct Scsi_Host->max_cmd_len
*/
#define TL_SCSI_MAX_CMD_LEN 32
struct tcm_loop_cmd {
/* State of Linux/SCSI CDB+Data descriptor */
u32 sc_cmd_state;
/* Pointer to the CDB+Data descriptor from Linux/SCSI subsystem */
struct scsi_cmnd *sc;
struct list_head *tl_cmd_list;
/* The TCM I/O descriptor that is accessed via container_of() */
struct se_cmd tl_se_cmd;
/* Sense buffer that will be mapped into outgoing status */
unsigned char tl_sense_buf[TRANSPORT_SENSE_BUFFER];
};
struct tcm_loop_tmr {
atomic_t tmr_complete;
wait_queue_head_t tl_tmr_wait;
};
struct tcm_loop_nexus {
int it_nexus_active;
/*
* Pointer to Linux/SCSI HBA from linux/include/scsi_host.h
*/
struct scsi_host *sh;
/*
* Pointer to TCM session for I_T Nexus
*/
struct se_session *se_sess;
};
struct tcm_loop_nacl {
struct se_node_acl se_node_acl;
};
struct tcm_loop_tpg {
unsigned short tl_tpgt;
atomic_t tl_tpg_port_count;
struct se_portal_group tl_se_tpg;
struct tcm_loop_hba *tl_hba;
};
struct tcm_loop_hba {
u8 tl_proto_id;
unsigned char tl_wwn_address[TL_WWN_ADDR_LEN];
struct se_hba_s *se_hba;
struct se_lun *tl_hba_lun;
struct se_port *tl_hba_lun_sep;
struct se_device_s *se_dev_hba_ptr;
struct tcm_loop_nexus *tl_nexus;
struct device dev;
struct Scsi_Host *sh;
struct tcm_loop_tpg tl_hba_tpgs[TL_TPGS_PER_HBA];
struct se_wwn tl_hba_wwn;
};