diff options
Diffstat (limited to 'include/scsi/libiscsi.h')
| -rw-r--r-- | include/scsi/libiscsi.h | 76 | 
1 files changed, 61 insertions, 15 deletions
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index ae5196aae1a..728c9ad9feb 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h @@ -62,6 +62,8 @@ enum {  	TMF_NOT_FOUND,  }; +#define ISID_SIZE			6 +  /* Connection suspend "bit" */  #define ISCSI_SUSPEND_BIT		1 @@ -89,6 +91,7 @@ enum {  	ISCSI_TASK_RUNNING,  	ISCSI_TASK_ABRT_TMF,		/* aborted due to TMF */  	ISCSI_TASK_ABRT_SESS_RECOV,	/* aborted due to session recovery */ +	ISCSI_TASK_REQUEUE_SCSIQ,	/* qcmd requeueing to scsi-ml */  };  struct iscsi_r2t_info { @@ -114,7 +117,7 @@ struct iscsi_task {  	/* copied values in case we need to send tmfs */  	itt_t			hdr_itt;  	__be32			cmdsn; -	uint8_t			lun[8]; +	struct scsi_lun		lun;  	int			itt;		/* this ITT */ @@ -130,6 +133,10 @@ struct iscsi_task {  	unsigned long		last_xfer;  	unsigned long		last_timeout;  	bool			have_checked_conn; + +	/* T10 protection information */ +	bool			protected; +  	/* state set/tested under session->lock */  	int			state;  	atomic_t		refcount; @@ -172,6 +179,7 @@ struct iscsi_conn {  	/* iSCSI connection-wide sequencing */  	uint32_t		exp_statsn; +	uint32_t		statsn;  	/* control data */  	int			id;		/* CID */ @@ -211,9 +219,23 @@ struct iscsi_conn {  	/* values userspace uses to id a conn */  	int			persistent_port;  	char			*persistent_address; -	/* remote portal currently connected to */ -	int			portal_port; -	char			portal_address[ISCSI_ADDRESS_BUF_LEN]; + +	unsigned		max_segment_size; +	unsigned		tcp_xmit_wsf; +	unsigned		tcp_recv_wsf; +	uint16_t		keepalive_tmo; +	uint16_t		local_port; +	uint8_t			tcp_timestamp_stat; +	uint8_t			tcp_nagle_disable; +	uint8_t			tcp_wsf_disable; +	uint8_t			tcp_timer_scale; +	uint8_t			tcp_timestamp_en; +	uint8_t			fragment_disable; +	uint8_t			ipv4_tos; +	uint8_t			ipv6_traffic_class; +	uint8_t			ipv6_flow_label; +	uint8_t			is_fw_assigned_ipv6; +	char			*local_ipaddr;  	/* MIB-statistics */  	uint64_t		txdata_octets; @@ -270,7 +292,7 @@ struct iscsi_session {  	int			lu_reset_timeout;  	int			tgt_reset_timeout;  	int			initial_r2t_en; -	unsigned		max_r2t; +	unsigned short		max_r2t;  	int			imm_data_en;  	unsigned		first_burst;  	unsigned		max_burst; @@ -286,18 +308,42 @@ struct iscsi_session {  	char			*password;  	char			*password_in;  	char			*targetname; +	char			*targetalias;  	char			*ifacename;  	char			*initiatorname; +	char			*boot_root; +	char			*boot_nic; +	char			*boot_target; +	char			*portal_type; +	char			*discovery_parent_type; +	uint16_t		discovery_parent_idx; +	uint16_t		def_taskmgmt_tmo; +	uint16_t		tsid; +	uint8_t			auto_snd_tgt_disable; +	uint8_t			discovery_sess; +	uint8_t			chap_auth_en; +	uint8_t			discovery_logout_en; +	uint8_t			bidi_chap_en; +	uint8_t			discovery_auth_optional; +	uint8_t			isid[ISID_SIZE]; +  	/* control data */  	struct iscsi_transport	*tt;  	struct Scsi_Host	*host;  	struct iscsi_conn	*leadconn;	/* leading connection */ -	spinlock_t		lock;		/* protects session state, * -						 * sequence numbers,       * +	/* Between the forward and the backward locks exists a strict locking +	 * hierarchy. The mutual exclusion zone protected by the forward lock +	 * can enclose the mutual exclusion zone protected by the backward lock +	 * but not vice versa. +	 */ +	spinlock_t		frwd_lock;	/* protects session state, * +						 * cmdsn, queued_cmdsn     *  						 * session resources:      * -						 * - cmdpool,		   * -						 * - mgmtpool,		   * -						 * - r2tpool		   */ +						 * - cmdpool kfifo_out ,   * +						 * - mgmtpool,		   */ +	spinlock_t		back_lock;	/* protects cmdsn_exp      * +						 * cmdsn_max,              * +						 * cmdpool kfifo_in        */  	int			state;		/* session state           */  	int			age;		/* counts session re-opens */ @@ -318,9 +364,6 @@ struct iscsi_host {  	/* hw address or netdev iscsi connection is bound to */  	char			*hwaddress;  	char			*netdev; -	/* local address */ -	int			local_port; -	char			local_address[ISCSI_ADDRESS_BUF_LEN];  	wait_queue_head_t	session_removal_wq;  	/* protects sessions and state */ @@ -341,8 +384,7 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc);  extern int iscsi_eh_recover_target(struct scsi_cmnd *sc);  extern int iscsi_eh_session_reset(struct scsi_cmnd *sc);  extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); -extern int iscsi_queuecommand(struct scsi_cmnd *sc, -			      void (*done)(struct scsi_cmnd *)); +extern int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc);  /*   * iSCSI host helpers. @@ -394,6 +436,8 @@ extern void iscsi_session_failure(struct iscsi_session *session,  				  enum iscsi_err err);  extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,  				enum iscsi_param param, char *buf); +extern int iscsi_conn_get_addr_param(struct sockaddr_storage *addr, +				     enum iscsi_param param, char *buf);  extern void iscsi_suspend_tx(struct iscsi_conn *conn);  extern void iscsi_suspend_queue(struct iscsi_conn *conn);  extern void iscsi_conn_queue_work(struct iscsi_conn *conn); @@ -420,6 +464,7 @@ extern struct iscsi_task *iscsi_itt_to_ctask(struct iscsi_conn *, itt_t);  extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t);  extern void iscsi_requeue_task(struct iscsi_task *task);  extern void iscsi_put_task(struct iscsi_task *task); +extern void __iscsi_put_task(struct iscsi_task *task);  extern void __iscsi_get_task(struct iscsi_task *task);  extern void iscsi_complete_scsi_task(struct iscsi_task *task,  				     uint32_t exp_cmdsn, uint32_t max_cmdsn); @@ -429,6 +474,7 @@ extern void iscsi_complete_scsi_task(struct iscsi_task *task,   */  extern void iscsi_pool_free(struct iscsi_pool *);  extern int iscsi_pool_init(struct iscsi_pool *, int, void ***, int); +extern int iscsi_switch_str_param(char **, char *);  /*   * inline functions to deal with padding.  | 
