aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/iscsi_if.h1
-rw-r--r--include/scsi/libfc.h13
-rw-r--r--include/scsi/libfcoe.h8
-rw-r--r--include/scsi/libiscsi.h5
-rw-r--r--include/scsi/libsas.h5
-rw-r--r--include/scsi/scsi.h28
-rw-r--r--include/scsi/scsi_host.h23
7 files changed, 69 insertions, 14 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index a8631acd37c3..c3e1cbcc2ad2 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -263,6 +263,7 @@ enum iscsi_err {
263 ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, 263 ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18,
264 ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, 264 ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19,
265 ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, 265 ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20,
266 ISCSI_ERR_SCSI_EH_SESSION_RST = ISCSI_ERR_BASE + 21,
266}; 267};
267 268
268/* 269/*
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index f986ab7ffe6f..f53c8e31d5fb 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -221,8 +221,8 @@ struct fc_rport_priv {
221 * @InputRequests: Number of input requests 221 * @InputRequests: Number of input requests
222 * @OutputRequests: Number of output requests 222 * @OutputRequests: Number of output requests
223 * @ControlRequests: Number of control requests 223 * @ControlRequests: Number of control requests
224 * @InputMegabytes: Number of received megabytes 224 * @InputBytes: Number of received bytes
225 * @OutputMegabytes: Number of transmitted megabytes 225 * @OutputBytes: Number of transmitted bytes
226 * @VLinkFailureCount: Number of virtual link failures 226 * @VLinkFailureCount: Number of virtual link failures
227 * @MissDiscAdvCount: Number of missing FIP discovery advertisement 227 * @MissDiscAdvCount: Number of missing FIP discovery advertisement
228 */ 228 */
@@ -241,8 +241,8 @@ struct fcoe_dev_stats {
241 u64 InputRequests; 241 u64 InputRequests;
242 u64 OutputRequests; 242 u64 OutputRequests;
243 u64 ControlRequests; 243 u64 ControlRequests;
244 u64 InputMegabytes; 244 u64 InputBytes;
245 u64 OutputMegabytes; 245 u64 OutputBytes;
246 u64 VLinkFailureCount; 246 u64 VLinkFailureCount;
247 u64 MissDiscAdvCount; 247 u64 MissDiscAdvCount;
248}; 248};
@@ -263,7 +263,6 @@ struct fc_seq_els_data {
263 * struct fc_fcp_pkt - FCP request structure (one for each scsi_cmnd request) 263 * struct fc_fcp_pkt - FCP request structure (one for each scsi_cmnd request)
264 * @lp: The associated local port 264 * @lp: The associated local port
265 * @state: The state of the I/O 265 * @state: The state of the I/O
266 * @tgt_flags: Target's flags
267 * @ref_cnt: Reference count 266 * @ref_cnt: Reference count
268 * @scsi_pkt_lock: Lock to protect the SCSI packet (must be taken before the 267 * @scsi_pkt_lock: Lock to protect the SCSI packet (must be taken before the
269 * host_lock if both are to be held at the same time) 268 * host_lock if both are to be held at the same time)
@@ -298,7 +297,6 @@ struct fc_fcp_pkt {
298 /* Housekeeping information */ 297 /* Housekeeping information */
299 struct fc_lport *lp; 298 struct fc_lport *lp;
300 u16 state; 299 u16 state;
301 u16 tgt_flags;
302 atomic_t ref_cnt; 300 atomic_t ref_cnt;
303 spinlock_t scsi_pkt_lock; 301 spinlock_t scsi_pkt_lock;
304 302
@@ -1006,8 +1004,7 @@ void fc_fcp_destroy(struct fc_lport *);
1006/* 1004/*
1007 * SCSI INTERACTION LAYER 1005 * SCSI INTERACTION LAYER
1008 *****************************/ 1006 *****************************/
1009int fc_queuecommand(struct scsi_cmnd *, 1007int fc_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
1010 void (*done)(struct scsi_cmnd *));
1011int fc_eh_abort(struct scsi_cmnd *); 1008int fc_eh_abort(struct scsi_cmnd *);
1012int fc_eh_device_reset(struct scsi_cmnd *); 1009int fc_eh_device_reset(struct scsi_cmnd *);
1013int fc_eh_host_reset(struct scsi_cmnd *); 1010int fc_eh_host_reset(struct scsi_cmnd *);
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 06f1b5a8ed19..feb6a94c90ea 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -92,10 +92,12 @@ enum fip_state {
92 * @timer_work: &work_struct for doing keep-alives and resets. 92 * @timer_work: &work_struct for doing keep-alives and resets.
93 * @recv_work: &work_struct for receiving FIP frames. 93 * @recv_work: &work_struct for receiving FIP frames.
94 * @fip_recv_list: list of received FIP frames. 94 * @fip_recv_list: list of received FIP frames.
95 * @flogi_req: clone of FLOGI request sent
95 * @rnd_state: state for pseudo-random number generator. 96 * @rnd_state: state for pseudo-random number generator.
96 * @port_id: proposed or selected local-port ID. 97 * @port_id: proposed or selected local-port ID.
97 * @user_mfs: configured maximum FC frame size, including FC header. 98 * @user_mfs: configured maximum FC frame size, including FC header.
98 * @flogi_oxid: exchange ID of most recent fabric login. 99 * @flogi_oxid: exchange ID of most recent fabric login.
100 * @flogi_req_send: send of FLOGI requested
99 * @flogi_count: number of FLOGI attempts in AUTO mode. 101 * @flogi_count: number of FLOGI attempts in AUTO mode.
100 * @map_dest: use the FC_MAP mode for destination MAC addresses. 102 * @map_dest: use the FC_MAP mode for destination MAC addresses.
101 * @spma: supports SPMA server-provided MACs mode 103 * @spma: supports SPMA server-provided MACs mode
@@ -106,6 +108,7 @@ enum fip_state {
106 * @update_mac: LLD-supplied function to handle changes to MAC addresses. 108 * @update_mac: LLD-supplied function to handle changes to MAC addresses.
107 * @get_src_addr: LLD-supplied function to supply a source MAC address. 109 * @get_src_addr: LLD-supplied function to supply a source MAC address.
108 * @ctlr_mutex: lock protecting this structure. 110 * @ctlr_mutex: lock protecting this structure.
111 * @ctlr_lock: spinlock covering flogi_req
109 * 112 *
110 * This structure is used by all FCoE drivers. It contains information 113 * This structure is used by all FCoE drivers. It contains information
111 * needed by all FCoE low-level drivers (LLDs) as well as internal state 114 * needed by all FCoE low-level drivers (LLDs) as well as internal state
@@ -126,12 +129,14 @@ struct fcoe_ctlr {
126 struct work_struct timer_work; 129 struct work_struct timer_work;
127 struct work_struct recv_work; 130 struct work_struct recv_work;
128 struct sk_buff_head fip_recv_list; 131 struct sk_buff_head fip_recv_list;
132 struct sk_buff *flogi_req;
129 133
130 struct rnd_state rnd_state; 134 struct rnd_state rnd_state;
131 u32 port_id; 135 u32 port_id;
132 136
133 u16 user_mfs; 137 u16 user_mfs;
134 u16 flogi_oxid; 138 u16 flogi_oxid;
139 u8 flogi_req_send;
135 u8 flogi_count; 140 u8 flogi_count;
136 u8 map_dest; 141 u8 map_dest;
137 u8 spma; 142 u8 spma;
@@ -143,6 +148,7 @@ struct fcoe_ctlr {
143 void (*update_mac)(struct fc_lport *, u8 *addr); 148 void (*update_mac)(struct fc_lport *, u8 *addr);
144 u8 * (*get_src_addr)(struct fc_lport *); 149 u8 * (*get_src_addr)(struct fc_lport *);
145 struct mutex ctlr_mutex; 150 struct mutex ctlr_mutex;
151 spinlock_t ctlr_lock;
146}; 152};
147 153
148/** 154/**
@@ -155,6 +161,7 @@ struct fcoe_ctlr {
155 * @fcf_mac: Ethernet address of the FCF 161 * @fcf_mac: Ethernet address of the FCF
156 * @vfid: virtual fabric ID 162 * @vfid: virtual fabric ID
157 * @pri: selection priority, smaller values are better 163 * @pri: selection priority, smaller values are better
164 * @flogi_sent: current FLOGI sent to this FCF
158 * @flags: flags received from advertisement 165 * @flags: flags received from advertisement
159 * @fka_period: keep-alive period, in jiffies 166 * @fka_period: keep-alive period, in jiffies
160 * 167 *
@@ -176,6 +183,7 @@ struct fcoe_fcf {
176 u8 fcf_mac[ETH_ALEN]; 183 u8 fcf_mac[ETH_ALEN];
177 184
178 u8 pri; 185 u8 pri;
186 u8 flogi_sent;
179 u16 flags; 187 u16 flags;
180 u32 fka_period; 188 u32 fka_period;
181 u8 fd_flags:1; 189 u8 fd_flags:1;
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index ae5196aae1a5..748382b32b52 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -89,6 +89,7 @@ enum {
89 ISCSI_TASK_RUNNING, 89 ISCSI_TASK_RUNNING,
90 ISCSI_TASK_ABRT_TMF, /* aborted due to TMF */ 90 ISCSI_TASK_ABRT_TMF, /* aborted due to TMF */
91 ISCSI_TASK_ABRT_SESS_RECOV, /* aborted due to session recovery */ 91 ISCSI_TASK_ABRT_SESS_RECOV, /* aborted due to session recovery */
92 ISCSI_TASK_REQUEUE_SCSIQ, /* qcmd requeueing to scsi-ml */
92}; 93};
93 94
94struct iscsi_r2t_info { 95struct iscsi_r2t_info {
@@ -341,8 +342,7 @@ extern int iscsi_eh_abort(struct scsi_cmnd *sc);
341extern int iscsi_eh_recover_target(struct scsi_cmnd *sc); 342extern int iscsi_eh_recover_target(struct scsi_cmnd *sc);
342extern int iscsi_eh_session_reset(struct scsi_cmnd *sc); 343extern int iscsi_eh_session_reset(struct scsi_cmnd *sc);
343extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); 344extern int iscsi_eh_device_reset(struct scsi_cmnd *sc);
344extern int iscsi_queuecommand(struct scsi_cmnd *sc, 345extern int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc);
345 void (*done)(struct scsi_cmnd *));
346 346
347/* 347/*
348 * iSCSI host helpers. 348 * iSCSI host helpers.
@@ -420,6 +420,7 @@ extern struct iscsi_task *iscsi_itt_to_ctask(struct iscsi_conn *, itt_t);
420extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t); 420extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t);
421extern void iscsi_requeue_task(struct iscsi_task *task); 421extern void iscsi_requeue_task(struct iscsi_task *task);
422extern void iscsi_put_task(struct iscsi_task *task); 422extern void iscsi_put_task(struct iscsi_task *task);
423extern void __iscsi_put_task(struct iscsi_task *task);
423extern void __iscsi_get_task(struct iscsi_task *task); 424extern void __iscsi_get_task(struct iscsi_task *task);
424extern void iscsi_complete_scsi_task(struct iscsi_task *task, 425extern void iscsi_complete_scsi_task(struct iscsi_task *task,
425 uint32_t exp_cmdsn, uint32_t max_cmdsn); 426 uint32_t exp_cmdsn, uint32_t max_cmdsn);
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 3dec1949f69c..8f6bb9c7f3eb 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -361,6 +361,8 @@ struct sas_ha_struct {
361 /* The class calls this to send a task for execution. */ 361 /* The class calls this to send a task for execution. */
362 int lldd_max_execute_num; 362 int lldd_max_execute_num;
363 int lldd_queue_size; 363 int lldd_queue_size;
364 int strict_wide_ports; /* both sas_addr and attached_sas_addr must match
365 * their siblings when forming wide ports */
364 366
365 /* LLDD calls these to notify the class of an event. */ 367 /* LLDD calls these to notify the class of an event. */
366 void (*notify_ha_event)(struct sas_ha_struct *, enum ha_event); 368 void (*notify_ha_event)(struct sas_ha_struct *, enum ha_event);
@@ -621,8 +623,7 @@ int sas_set_phy_speed(struct sas_phy *phy,
621int sas_phy_enable(struct sas_phy *phy, int enabled); 623int sas_phy_enable(struct sas_phy *phy, int enabled);
622int sas_phy_reset(struct sas_phy *phy, int hard_reset); 624int sas_phy_reset(struct sas_phy *phy, int hard_reset);
623int sas_queue_up(struct sas_task *task); 625int sas_queue_up(struct sas_task *task);
624extern int sas_queuecommand(struct scsi_cmnd *, 626extern int sas_queuecommand(struct Scsi_Host * ,struct scsi_cmnd *);
625 void (*scsi_done)(struct scsi_cmnd *));
626extern int sas_target_alloc(struct scsi_target *); 627extern int sas_target_alloc(struct scsi_target *);
627extern int sas_slave_alloc(struct scsi_device *); 628extern int sas_slave_alloc(struct scsi_device *);
628extern int sas_slave_configure(struct scsi_device *); 629extern int sas_slave_configure(struct scsi_device *);
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 216af8538cc9..1651fef18831 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -115,33 +115,61 @@ struct scsi_cmnd;
115#define PERSISTENT_RESERVE_OUT 0x5f 115#define PERSISTENT_RESERVE_OUT 0x5f
116#define VARIABLE_LENGTH_CMD 0x7f 116#define VARIABLE_LENGTH_CMD 0x7f
117#define REPORT_LUNS 0xa0 117#define REPORT_LUNS 0xa0
118#define SECURITY_PROTOCOL_IN 0xa2
118#define MAINTENANCE_IN 0xa3 119#define MAINTENANCE_IN 0xa3
119#define MAINTENANCE_OUT 0xa4 120#define MAINTENANCE_OUT 0xa4
120#define MOVE_MEDIUM 0xa5 121#define MOVE_MEDIUM 0xa5
121#define EXCHANGE_MEDIUM 0xa6 122#define EXCHANGE_MEDIUM 0xa6
122#define READ_12 0xa8 123#define READ_12 0xa8
123#define WRITE_12 0xaa 124#define WRITE_12 0xaa
125#define READ_MEDIA_SERIAL_NUMBER 0xab
124#define WRITE_VERIFY_12 0xae 126#define WRITE_VERIFY_12 0xae
125#define VERIFY_12 0xaf 127#define VERIFY_12 0xaf
126#define SEARCH_HIGH_12 0xb0 128#define SEARCH_HIGH_12 0xb0
127#define SEARCH_EQUAL_12 0xb1 129#define SEARCH_EQUAL_12 0xb1
128#define SEARCH_LOW_12 0xb2 130#define SEARCH_LOW_12 0xb2
131#define SECURITY_PROTOCOL_OUT 0xb5
129#define READ_ELEMENT_STATUS 0xb8 132#define READ_ELEMENT_STATUS 0xb8
130#define SEND_VOLUME_TAG 0xb6 133#define SEND_VOLUME_TAG 0xb6
131#define WRITE_LONG_2 0xea 134#define WRITE_LONG_2 0xea
135#define EXTENDED_COPY 0x83
136#define RECEIVE_COPY_RESULTS 0x84
137#define ACCESS_CONTROL_IN 0x86
138#define ACCESS_CONTROL_OUT 0x87
132#define READ_16 0x88 139#define READ_16 0x88
133#define WRITE_16 0x8a 140#define WRITE_16 0x8a
141#define READ_ATTRIBUTE 0x8c
142#define WRITE_ATTRIBUTE 0x8d
134#define VERIFY_16 0x8f 143#define VERIFY_16 0x8f
135#define WRITE_SAME_16 0x93 144#define WRITE_SAME_16 0x93
136#define SERVICE_ACTION_IN 0x9e 145#define SERVICE_ACTION_IN 0x9e
137/* values for service action in */ 146/* values for service action in */
138#define SAI_READ_CAPACITY_16 0x10 147#define SAI_READ_CAPACITY_16 0x10
139#define SAI_GET_LBA_STATUS 0x12 148#define SAI_GET_LBA_STATUS 0x12
149/* values for VARIABLE_LENGTH_CMD service action codes
150 * see spc4r17 Section D.3.5, table D.7 and D.8 */
151#define VLC_SA_RECEIVE_CREDENTIAL 0x1800
140/* values for maintenance in */ 152/* values for maintenance in */
153#define MI_REPORT_IDENTIFYING_INFORMATION 0x05
141#define MI_REPORT_TARGET_PGS 0x0a 154#define MI_REPORT_TARGET_PGS 0x0a
155#define MI_REPORT_ALIASES 0x0b
156#define MI_REPORT_SUPPORTED_OPERATION_CODES 0x0c
157#define MI_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0d
158#define MI_REPORT_PRIORITY 0x0e
159#define MI_REPORT_TIMESTAMP 0x0f
160#define MI_MANAGEMENT_PROTOCOL_IN 0x10
142/* values for maintenance out */ 161/* values for maintenance out */
162#define MO_SET_IDENTIFYING_INFORMATION 0x06
143#define MO_SET_TARGET_PGS 0x0a 163#define MO_SET_TARGET_PGS 0x0a
164#define MO_CHANGE_ALIASES 0x0b
165#define MO_SET_PRIORITY 0x0e
166#define MO_SET_TIMESTAMP 0x0f
167#define MO_MANAGEMENT_PROTOCOL_OUT 0x10
144/* values for variable length command */ 168/* values for variable length command */
169#define XDREAD_32 0x03
170#define XDWRITE_32 0x04
171#define XPWRITE_32 0x06
172#define XDWRITEREAD_32 0x07
145#define READ_32 0x09 173#define READ_32 0x09
146#define VERIFY_32 0x0a 174#define VERIFY_32 0x0a
147#define WRITE_32 0x0b 175#define WRITE_32 0x0b
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index d0a6a845f204..e7e385842a38 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -127,8 +127,7 @@ struct scsi_host_template {
127 * 127 *
128 * STATUS: REQUIRED 128 * STATUS: REQUIRED
129 */ 129 */
130 int (* queuecommand)(struct scsi_cmnd *, 130 int (* queuecommand)(struct Scsi_Host *, struct scsi_cmnd *);
131 void (*done)(struct scsi_cmnd *));
132 131
133 /* 132 /*
134 * The transfer functions are used to queue a scsi command to 133 * The transfer functions are used to queue a scsi command to
@@ -505,6 +504,25 @@ struct scsi_host_template {
505}; 504};
506 505
507/* 506/*
507 * Temporary #define for host lock push down. Can be removed when all
508 * drivers have been updated to take advantage of unlocked
509 * queuecommand.
510 *
511 */
512#define DEF_SCSI_QCMD(func_name) \
513 int func_name(struct Scsi_Host *shost, struct scsi_cmnd *cmd) \
514 { \
515 unsigned long irq_flags; \
516 int rc; \
517 spin_lock_irqsave(shost->host_lock, irq_flags); \
518 scsi_cmd_get_serial(shost, cmd); \
519 rc = func_name##_lck (cmd, cmd->scsi_done); \
520 spin_unlock_irqrestore(shost->host_lock, irq_flags); \
521 return rc; \
522 }
523
524
525/*
508 * shost state: If you alter this, you also need to alter scsi_sysfs.c 526 * shost state: If you alter this, you also need to alter scsi_sysfs.c
509 * (for the ascii descriptions) and the state model enforcer: 527 * (for the ascii descriptions) and the state model enforcer:
510 * scsi_host_set_state() 528 * scsi_host_set_state()
@@ -752,6 +770,7 @@ extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);
752extern void scsi_host_put(struct Scsi_Host *t); 770extern void scsi_host_put(struct Scsi_Host *t);
753extern struct Scsi_Host *scsi_host_lookup(unsigned short); 771extern struct Scsi_Host *scsi_host_lookup(unsigned short);
754extern const char *scsi_host_state_name(enum scsi_host_state); 772extern const char *scsi_host_state_name(enum scsi_host_state);
773extern void scsi_cmd_get_serial(struct Scsi_Host *, struct scsi_cmnd *);
755 774
756extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); 775extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
757 776