aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/iscsi_if.h20
-rw-r--r--include/scsi/iscsi_proto.h14
-rw-r--r--include/scsi/libiscsi.h82
-rw-r--r--include/scsi/libsas.h28
-rw-r--r--include/scsi/sas.h13
-rw-r--r--include/scsi/scsi.h20
-rw-r--r--include/scsi/scsi_cmnd.h62
-rw-r--r--include/scsi/scsi_device.h16
-rw-r--r--include/scsi/scsi_eh.h9
-rw-r--r--include/scsi/scsi_host.h17
-rw-r--r--include/scsi/scsi_transport_fc.h2
-rw-r--r--include/scsi/scsi_transport_iscsi.h10
-rw-r--r--include/scsi/scsi_transport_sas.h16
-rw-r--r--include/scsi/sd.h1
14 files changed, 213 insertions, 97 deletions
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 50e907f42048..e19e58423166 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -49,12 +49,15 @@ enum iscsi_uevent_e {
49 49
50 ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15, 50 ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15,
51 ISCSI_UEVENT_SET_HOST_PARAM = UEVENT_BASE + 16, 51 ISCSI_UEVENT_SET_HOST_PARAM = UEVENT_BASE + 16,
52 ISCSI_UEVENT_UNBIND_SESSION = UEVENT_BASE + 17,
52 53
53 /* up events */ 54 /* up events */
54 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, 55 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1,
55 ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2, 56 ISCSI_KEVENT_CONN_ERROR = KEVENT_BASE + 2,
56 ISCSI_KEVENT_IF_ERROR = KEVENT_BASE + 3, 57 ISCSI_KEVENT_IF_ERROR = KEVENT_BASE + 3,
57 ISCSI_KEVENT_DESTROY_SESSION = KEVENT_BASE + 4, 58 ISCSI_KEVENT_DESTROY_SESSION = KEVENT_BASE + 4,
59 ISCSI_KEVENT_UNBIND_SESSION = KEVENT_BASE + 5,
60 ISCSI_KEVENT_CREATE_SESSION = KEVENT_BASE + 6,
58}; 61};
59 62
60enum iscsi_tgt_dscvr { 63enum iscsi_tgt_dscvr {
@@ -156,6 +159,10 @@ struct iscsi_uevent {
156 uint32_t sid; 159 uint32_t sid;
157 uint32_t cid; 160 uint32_t cid;
158 } c_conn_ret; 161 } c_conn_ret;
162 struct msg_unbind_session {
163 uint32_t sid;
164 uint32_t host_no;
165 } unbind_session;
159 struct msg_recv_req { 166 struct msg_recv_req {
160 uint32_t sid; 167 uint32_t sid;
161 uint32_t cid; 168 uint32_t cid;
@@ -236,6 +243,13 @@ enum iscsi_param {
236 ISCSI_PARAM_PASSWORD, 243 ISCSI_PARAM_PASSWORD,
237 ISCSI_PARAM_PASSWORD_IN, 244 ISCSI_PARAM_PASSWORD_IN,
238 245
246 ISCSI_PARAM_FAST_ABORT,
247 ISCSI_PARAM_ABORT_TMO,
248 ISCSI_PARAM_LU_RESET_TMO,
249 ISCSI_PARAM_HOST_RESET_TMO,
250
251 ISCSI_PARAM_PING_TMO,
252 ISCSI_PARAM_RECV_TMO,
239 /* must always be last */ 253 /* must always be last */
240 ISCSI_PARAM_MAX, 254 ISCSI_PARAM_MAX,
241}; 255};
@@ -266,6 +280,12 @@ enum iscsi_param {
266#define ISCSI_USERNAME_IN (1 << ISCSI_PARAM_USERNAME_IN) 280#define ISCSI_USERNAME_IN (1 << ISCSI_PARAM_USERNAME_IN)
267#define ISCSI_PASSWORD (1 << ISCSI_PARAM_PASSWORD) 281#define ISCSI_PASSWORD (1 << ISCSI_PARAM_PASSWORD)
268#define ISCSI_PASSWORD_IN (1 << ISCSI_PARAM_PASSWORD_IN) 282#define ISCSI_PASSWORD_IN (1 << ISCSI_PARAM_PASSWORD_IN)
283#define ISCSI_FAST_ABORT (1 << ISCSI_PARAM_FAST_ABORT)
284#define ISCSI_ABORT_TMO (1 << ISCSI_PARAM_ABORT_TMO)
285#define ISCSI_LU_RESET_TMO (1 << ISCSI_PARAM_LU_RESET_TMO)
286#define ISCSI_HOST_RESET_TMO (1 << ISCSI_PARAM_HOST_RESET_TMO)
287#define ISCSI_PING_TMO (1 << ISCSI_PARAM_PING_TMO)
288#define ISCSI_RECV_TMO (1 << ISCSI_PARAM_RECV_TMO)
269 289
270/* iSCSI HBA params */ 290/* iSCSI HBA params */
271enum iscsi_host_param { 291enum iscsi_host_param {
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index 8d1e4e8026fe..318a909e7ae1 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -21,13 +21,15 @@
21#ifndef ISCSI_PROTO_H 21#ifndef ISCSI_PROTO_H
22#define ISCSI_PROTO_H 22#define ISCSI_PROTO_H
23 23
24#include <linux/types.h>
25
24#define ISCSI_DRAFT20_VERSION 0x00 26#define ISCSI_DRAFT20_VERSION 0x00
25 27
26/* default iSCSI listen port for incoming connections */ 28/* default iSCSI listen port for incoming connections */
27#define ISCSI_LISTEN_PORT 3260 29#define ISCSI_LISTEN_PORT 3260
28 30
29/* Padding word length */ 31/* Padding word length */
30#define PAD_WORD_LEN 4 32#define ISCSI_PAD_LEN 4
31 33
32/* 34/*
33 * useful common(control and data pathes) macro 35 * useful common(control and data pathes) macro
@@ -147,6 +149,14 @@ struct iscsi_rlength_ahdr {
147 __be32 read_length; 149 __be32 read_length;
148}; 150};
149 151
152/* Extended CDB AHS */
153struct iscsi_ecdb_ahdr {
154 __be16 ahslength; /* CDB length - 15, including reserved byte */
155 uint8_t ahstype;
156 uint8_t reserved;
157 uint8_t ecdb[260 - 16]; /* 4-byte aligned extended CDB spillover */
158};
159
150/* SCSI Response Header */ 160/* SCSI Response Header */
151struct iscsi_cmd_rsp { 161struct iscsi_cmd_rsp {
152 uint8_t opcode; 162 uint8_t opcode;
@@ -600,6 +610,8 @@ struct iscsi_reject {
600#define ISCSI_MIN_MAX_BURST_LEN 512 610#define ISCSI_MIN_MAX_BURST_LEN 512
601#define ISCSI_MAX_MAX_BURST_LEN 16777215 611#define ISCSI_MAX_MAX_BURST_LEN 16777215
602 612
613#define ISCSI_DEF_TIME2WAIT 2
614
603/************************* RFC 3720 End *****************************/ 615/************************* RFC 3720 End *****************************/
604 616
605#endif /* ISCSI_PROTO_H */ 617#endif /* ISCSI_PROTO_H */
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index b4b31132618b..889f51fabab9 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -57,11 +57,14 @@ struct iscsi_nopin;
57#define ISCSI_MAX_CMD_PER_LUN 128 57#define ISCSI_MAX_CMD_PER_LUN 128
58 58
59/* Task Mgmt states */ 59/* Task Mgmt states */
60#define TMABORT_INITIAL 0x0 60enum {
61#define TMABORT_SUCCESS 0x1 61 TMF_INITIAL,
62#define TMABORT_FAILED 0x2 62 TMF_QUEUED,
63#define TMABORT_TIMEDOUT 0x3 63 TMF_SUCCESS,
64#define TMABORT_NOT_FOUND 0x4 64 TMF_FAILED,
65 TMF_TIMEDOUT,
66 TMF_NOT_FOUND,
67};
65 68
66/* Connection suspend "bit" */ 69/* Connection suspend "bit" */
67#define ISCSI_SUSPEND_BIT 1 70#define ISCSI_SUSPEND_BIT 1
@@ -74,6 +77,13 @@ struct iscsi_nopin;
74 77
75#define ISCSI_ADDRESS_BUF_LEN 64 78#define ISCSI_ADDRESS_BUF_LEN 64
76 79
80enum {
81 /* this is the maximum possible storage for AHSs */
82 ISCSI_MAX_AHS_SIZE = sizeof(struct iscsi_ecdb_ahdr) +
83 sizeof(struct iscsi_rlength_ahdr),
84 ISCSI_DIGEST_SIZE = sizeof(__u32),
85};
86
77struct iscsi_mgmt_task { 87struct iscsi_mgmt_task {
78 /* 88 /*
79 * Becuae LLDs allocate their hdr differently, this is a pointer to 89 * Becuae LLDs allocate their hdr differently, this is a pointer to
@@ -91,15 +101,17 @@ enum {
91 ISCSI_TASK_COMPLETED, 101 ISCSI_TASK_COMPLETED,
92 ISCSI_TASK_PENDING, 102 ISCSI_TASK_PENDING,
93 ISCSI_TASK_RUNNING, 103 ISCSI_TASK_RUNNING,
94 ISCSI_TASK_ABORTING,
95}; 104};
96 105
97struct iscsi_cmd_task { 106struct iscsi_cmd_task {
98 /* 107 /*
99 * Becuae LLDs allocate their hdr differently, this is a pointer to 108 * Because LLDs allocate their hdr differently, this is a pointer
100 * that storage. It must be setup at session creation time. 109 * and length to that storage. It must be setup at session
110 * creation time.
101 */ 111 */
102 struct iscsi_cmd *hdr; 112 struct iscsi_cmd *hdr;
113 unsigned short hdr_max;
114 unsigned short hdr_len; /* accumulated size of hdr used */
103 int itt; /* this ITT */ 115 int itt; /* this ITT */
104 116
105 uint32_t unsol_datasn; 117 uint32_t unsol_datasn;
@@ -110,7 +122,6 @@ struct iscsi_cmd_task {
110 unsigned data_count; /* remaining Data-Out */ 122 unsigned data_count; /* remaining Data-Out */
111 struct scsi_cmnd *sc; /* associated SCSI cmd*/ 123 struct scsi_cmnd *sc; /* associated SCSI cmd*/
112 struct iscsi_conn *conn; /* used connection */ 124 struct iscsi_conn *conn; /* used connection */
113 struct iscsi_mgmt_task *mtask; /* tmf mtask in progr */
114 125
115 /* state set/tested under session->lock */ 126 /* state set/tested under session->lock */
116 int state; 127 int state;
@@ -119,6 +130,11 @@ struct iscsi_cmd_task {
119 void *dd_data; /* driver/transport data */ 130 void *dd_data; /* driver/transport data */
120}; 131};
121 132
133static inline void* iscsi_next_hdr(struct iscsi_cmd_task *ctask)
134{
135 return (void*)ctask->hdr + ctask->hdr_len;
136}
137
122struct iscsi_conn { 138struct iscsi_conn {
123 struct iscsi_cls_conn *cls_conn; /* ptr to class connection */ 139 struct iscsi_cls_conn *cls_conn; /* ptr to class connection */
124 void *dd_data; /* iscsi_transport data */ 140 void *dd_data; /* iscsi_transport data */
@@ -132,6 +148,12 @@ struct iscsi_conn {
132 * conn_stop() flag: stop to recover, stop to terminate 148 * conn_stop() flag: stop to recover, stop to terminate
133 */ 149 */
134 int stop_stage; 150 int stop_stage;
151 struct timer_list transport_timer;
152 unsigned long last_recv;
153 unsigned long last_ping;
154 int ping_timeout;
155 int recv_timeout;
156 struct iscsi_mgmt_task *ping_mtask;
135 157
136 /* iSCSI connection-wide sequencing */ 158 /* iSCSI connection-wide sequencing */
137 uint32_t exp_statsn; 159 uint32_t exp_statsn;
@@ -152,10 +174,11 @@ struct iscsi_conn {
152 struct iscsi_cmd_task *ctask; /* xmit ctask in progress */ 174 struct iscsi_cmd_task *ctask; /* xmit ctask in progress */
153 175
154 /* xmit */ 176 /* xmit */
155 struct kfifo *mgmtqueue; /* mgmt (control) xmit queue */ 177 struct list_head mgmtqueue; /* mgmt (control) xmit queue */
156 struct list_head mgmt_run_list; /* list of control tasks */ 178 struct list_head mgmt_run_list; /* list of control tasks */
157 struct list_head xmitqueue; /* data-path cmd queue */ 179 struct list_head xmitqueue; /* data-path cmd queue */
158 struct list_head run_list; /* list of cmds in progress */ 180 struct list_head run_list; /* list of cmds in progress */
181 struct list_head requeue; /* tasks needing another run */
159 struct work_struct xmitwork; /* per-conn. xmit workqueue */ 182 struct work_struct xmitwork; /* per-conn. xmit workqueue */
160 unsigned long suspend_tx; /* suspend Tx */ 183 unsigned long suspend_tx; /* suspend Tx */
161 unsigned long suspend_rx; /* suspend Rx */ 184 unsigned long suspend_rx; /* suspend Rx */
@@ -163,8 +186,8 @@ struct iscsi_conn {
163 /* abort */ 186 /* abort */
164 wait_queue_head_t ehwait; /* used in eh_abort() */ 187 wait_queue_head_t ehwait; /* used in eh_abort() */
165 struct iscsi_tm tmhdr; 188 struct iscsi_tm tmhdr;
166 struct timer_list tmabort_timer; 189 struct timer_list tmf_timer;
167 int tmabort_state; /* see TMABORT_INITIAL, etc.*/ 190 int tmf_state; /* see TMF_INITIAL, etc.*/
168 191
169 /* negotiated params */ 192 /* negotiated params */
170 unsigned max_recv_dlength; /* initiator_max_recv_dsl*/ 193 unsigned max_recv_dlength; /* initiator_max_recv_dsl*/
@@ -198,7 +221,7 @@ struct iscsi_conn {
198 uint32_t eh_abort_cnt; 221 uint32_t eh_abort_cnt;
199}; 222};
200 223
201struct iscsi_queue { 224struct iscsi_pool {
202 struct kfifo *queue; /* FIFO Queue */ 225 struct kfifo *queue; /* FIFO Queue */
203 void **pool; /* Pool of elements */ 226 void **pool; /* Pool of elements */
204 int max; /* Max number of elements */ 227 int max; /* Max number of elements */
@@ -221,6 +244,8 @@ struct iscsi_session {
221 uint32_t queued_cmdsn; 244 uint32_t queued_cmdsn;
222 245
223 /* configuration */ 246 /* configuration */
247 int abort_timeout;
248 int lu_reset_timeout;
224 int initial_r2t_en; 249 int initial_r2t_en;
225 unsigned max_r2t; 250 unsigned max_r2t;
226 int imm_data_en; 251 int imm_data_en;
@@ -231,6 +256,7 @@ struct iscsi_session {
231 int pdu_inorder_en; 256 int pdu_inorder_en;
232 int dataseq_inorder_en; 257 int dataseq_inorder_en;
233 int erl; 258 int erl;
259 int fast_abort;
234 int tpgt; 260 int tpgt;
235 char *username; 261 char *username;
236 char *username_in; 262 char *username_in;
@@ -256,10 +282,10 @@ struct iscsi_session {
256 282
257 int cmds_max; /* size of cmds array */ 283 int cmds_max; /* size of cmds array */
258 struct iscsi_cmd_task **cmds; /* Original Cmds arr */ 284 struct iscsi_cmd_task **cmds; /* Original Cmds arr */
259 struct iscsi_queue cmdpool; /* PDU's pool */ 285 struct iscsi_pool cmdpool; /* PDU's pool */
260 int mgmtpool_max; /* size of mgmt array */ 286 int mgmtpool_max; /* size of mgmt array */
261 struct iscsi_mgmt_task **mgmt_cmds; /* Original mgmt arr */ 287 struct iscsi_mgmt_task **mgmt_cmds; /* Original mgmt arr */
262 struct iscsi_queue mgmtpool; /* Mgmt PDU's pool */ 288 struct iscsi_pool mgmtpool; /* Mgmt PDU's pool */
263}; 289};
264 290
265/* 291/*
@@ -268,6 +294,7 @@ struct iscsi_session {
268extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth); 294extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth);
269extern int iscsi_eh_abort(struct scsi_cmnd *sc); 295extern int iscsi_eh_abort(struct scsi_cmnd *sc);
270extern int iscsi_eh_host_reset(struct scsi_cmnd *sc); 296extern int iscsi_eh_host_reset(struct scsi_cmnd *sc);
297extern int iscsi_eh_device_reset(struct scsi_cmnd *sc);
271extern int iscsi_queuecommand(struct scsi_cmnd *sc, 298extern int iscsi_queuecommand(struct scsi_cmnd *sc,
272 void (*done)(struct scsi_cmnd *)); 299 void (*done)(struct scsi_cmnd *));
273 300
@@ -326,11 +353,32 @@ extern int __iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *,
326 char *, int); 353 char *, int);
327extern int iscsi_verify_itt(struct iscsi_conn *, struct iscsi_hdr *, 354extern int iscsi_verify_itt(struct iscsi_conn *, struct iscsi_hdr *,
328 uint32_t *); 355 uint32_t *);
356extern void iscsi_requeue_ctask(struct iscsi_cmd_task *ctask);
357extern void iscsi_free_mgmt_task(struct iscsi_conn *conn,
358 struct iscsi_mgmt_task *mtask);
329 359
330/* 360/*
331 * generic helpers 361 * generic helpers
332 */ 362 */
333extern void iscsi_pool_free(struct iscsi_queue *, void **); 363extern void iscsi_pool_free(struct iscsi_pool *);
334extern int iscsi_pool_init(struct iscsi_queue *, int, void ***, int); 364extern int iscsi_pool_init(struct iscsi_pool *, int, void ***, int);
365
366/*
367 * inline functions to deal with padding.
368 */
369static inline unsigned int
370iscsi_padded(unsigned int len)
371{
372 return (len + ISCSI_PAD_LEN - 1) & ~(ISCSI_PAD_LEN - 1);
373}
374
375static inline unsigned int
376iscsi_padding(unsigned int len)
377{
378 len &= (ISCSI_PAD_LEN - 1);
379 if (len)
380 len = ISCSI_PAD_LEN - len;
381 return len;
382}
335 383
336#endif 384#endif
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index a466c2cb8955..3ffd6b582a97 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -91,8 +91,6 @@ enum discover_event {
91 91
92/* ---------- Expander Devices ---------- */ 92/* ---------- Expander Devices ---------- */
93 93
94#define ETASK 0xFA
95
96#define to_dom_device(_obj) container_of(_obj, struct domain_device, dev_obj) 94#define to_dom_device(_obj) container_of(_obj, struct domain_device, dev_obj)
97#define to_dev_attr(_attr) container_of(_attr, struct domain_dev_attribute,\ 95#define to_dev_attr(_attr) container_of(_attr, struct domain_dev_attribute,\
98 attr) 96 attr)
@@ -122,8 +120,8 @@ struct ex_phy {
122 u8 attached_sata_dev:1; 120 u8 attached_sata_dev:1;
123 u8 attached_sata_ps:1; 121 u8 attached_sata_ps:1;
124 122
125 enum sas_proto attached_tproto; 123 enum sas_protocol attached_tproto;
126 enum sas_proto attached_iproto; 124 enum sas_protocol attached_iproto;
127 125
128 u8 attached_sas_addr[SAS_ADDR_SIZE]; 126 u8 attached_sas_addr[SAS_ADDR_SIZE];
129 u8 attached_phy_id; 127 u8 attached_phy_id;
@@ -191,8 +189,8 @@ struct domain_device {
191 189
192 struct list_head dev_list_node; 190 struct list_head dev_list_node;
193 191
194 enum sas_proto iproto; 192 enum sas_protocol iproto;
195 enum sas_proto tproto; 193 enum sas_protocol tproto;
196 194
197 struct sas_rphy *rphy; 195 struct sas_rphy *rphy;
198 196
@@ -245,8 +243,8 @@ struct asd_sas_port {
245 enum sas_class class; 243 enum sas_class class;
246 u8 sas_addr[SAS_ADDR_SIZE]; 244 u8 sas_addr[SAS_ADDR_SIZE];
247 u8 attached_sas_addr[SAS_ADDR_SIZE]; 245 u8 attached_sas_addr[SAS_ADDR_SIZE];
248 enum sas_proto iproto; 246 enum sas_protocol iproto;
249 enum sas_proto tproto; 247 enum sas_protocol tproto;
250 248
251 enum sas_oob_mode oob_mode; 249 enum sas_oob_mode oob_mode;
252 250
@@ -289,8 +287,8 @@ struct asd_sas_phy {
289 287
290 int id; /* must be set */ 288 int id; /* must be set */
291 enum sas_class class; 289 enum sas_class class;
292 enum sas_proto iproto; 290 enum sas_protocol iproto;
293 enum sas_proto tproto; 291 enum sas_protocol tproto;
294 292
295 enum sas_phy_type type; 293 enum sas_phy_type type;
296 enum sas_phy_role role; 294 enum sas_phy_role role;
@@ -537,7 +535,7 @@ struct sas_task {
537 spinlock_t task_state_lock; 535 spinlock_t task_state_lock;
538 unsigned task_state_flags; 536 unsigned task_state_flags;
539 537
540 enum sas_proto task_proto; 538 enum sas_protocol task_proto;
541 539
542 /* Used by the discovery code. */ 540 /* Used by the discovery code. */
543 struct timer_list timer; 541 struct timer_list timer;
@@ -563,7 +561,7 @@ struct sas_task {
563 struct work_struct abort_work; 561 struct work_struct abort_work;
564}; 562};
565 563
566 564extern struct kmem_cache *sas_task_cache;
567 565
568#define SAS_TASK_STATE_PENDING 1 566#define SAS_TASK_STATE_PENDING 1
569#define SAS_TASK_STATE_DONE 2 567#define SAS_TASK_STATE_DONE 2
@@ -573,7 +571,6 @@ struct sas_task {
573 571
574static inline struct sas_task *sas_alloc_task(gfp_t flags) 572static inline struct sas_task *sas_alloc_task(gfp_t flags)
575{ 573{
576 extern struct kmem_cache *sas_task_cache;
577 struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags); 574 struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags);
578 575
579 if (task) { 576 if (task) {
@@ -590,7 +587,6 @@ static inline struct sas_task *sas_alloc_task(gfp_t flags)
590static inline void sas_free_task(struct sas_task *task) 587static inline void sas_free_task(struct sas_task *task)
591{ 588{
592 if (task) { 589 if (task) {
593 extern struct kmem_cache *sas_task_cache;
594 BUG_ON(!list_empty(&task->list)); 590 BUG_ON(!list_empty(&task->list));
595 kmem_cache_free(sas_task_cache, task); 591 kmem_cache_free(sas_task_cache, task);
596 } 592 }
@@ -676,4 +672,8 @@ extern int sas_ioctl(struct scsi_device *sdev, int cmd, void __user *arg);
676 672
677extern int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, 673extern int sas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
678 struct request *req); 674 struct request *req);
675
676extern void sas_ssp_task_response(struct device *dev, struct sas_task *task,
677 struct ssp_response_iu *iu);
678
679#endif /* _SASLIB_H_ */ 679#endif /* _SASLIB_H_ */
diff --git a/include/scsi/sas.h b/include/scsi/sas.h
index 2f4b6afa34fc..e9fd02281381 100644
--- a/include/scsi/sas.h
+++ b/include/scsi/sas.h
@@ -102,13 +102,12 @@ enum sas_dev_type {
102 SATA_PM_PORT= 8, 102 SATA_PM_PORT= 8,
103}; 103};
104 104
105/* Partly from IDENTIFY address frame. */ 105enum sas_protocol {
106enum sas_proto { 106 SAS_PROTOCOL_SATA = 0x01,
107 SATA_PROTO = 1, 107 SAS_PROTOCOL_SMP = 0x02,
108 SAS_PROTO_SMP = 2, /* protocol */ 108 SAS_PROTOCOL_STP = 0x04,
109 SAS_PROTO_STP = 4, /* protocol */ 109 SAS_PROTOCOL_SSP = 0x08,
110 SAS_PROTO_SSP = 8, /* protocol */ 110 SAS_PROTOCOL_ALL = 0x0E,
111 SAS_PROTO_ALL = 0xE,
112}; 111};
113 112
114/* From the spec; local phys only */ 113/* From the spec; local phys only */
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 702fcfeb37f1..82251575a9b4 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -11,6 +11,25 @@
11#include <linux/types.h> 11#include <linux/types.h>
12 12
13/* 13/*
14 * The maximum number of SG segments that we will put inside a
15 * scatterlist (unless chaining is used). Should ideally fit inside a
16 * single page, to avoid a higher order allocation. We could define this
17 * to SG_MAX_SINGLE_ALLOC to pack correctly at the highest order. The
18 * minimum value is 32
19 */
20#define SCSI_MAX_SG_SEGMENTS 128
21
22/*
23 * Like SCSI_MAX_SG_SEGMENTS, but for archs that have sg chaining. This limit
24 * is totally arbitrary, a setting of 2048 will get you at least 8mb ios.
25 */
26#ifdef ARCH_HAS_SG_CHAIN
27#define SCSI_MAX_SG_CHAIN_SEGMENTS 2048
28#else
29#define SCSI_MAX_SG_CHAIN_SEGMENTS SCSI_MAX_SG_SEGMENTS
30#endif
31
32/*
14 * SCSI command lengths 33 * SCSI command lengths
15 */ 34 */
16 35
@@ -83,6 +102,7 @@ extern const unsigned char scsi_command_size[8];
83#define READ_TOC 0x43 102#define READ_TOC 0x43
84#define LOG_SELECT 0x4c 103#define LOG_SELECT 0x4c
85#define LOG_SENSE 0x4d 104#define LOG_SENSE 0x4d
105#define XDWRITEREAD_10 0x53
86#define MODE_SELECT_10 0x55 106#define MODE_SELECT_10 0x55
87#define RESERVE_10 0x56 107#define RESERVE_10 0x56
88#define RELEASE_10 0x57 108#define RELEASE_10 0x57
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 3f47e522a1ec..de28aab820b0 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -2,16 +2,20 @@
2#define _SCSI_SCSI_CMND_H 2#define _SCSI_SCSI_CMND_H
3 3
4#include <linux/dma-mapping.h> 4#include <linux/dma-mapping.h>
5#include <linux/blkdev.h>
5#include <linux/list.h> 6#include <linux/list.h>
6#include <linux/types.h> 7#include <linux/types.h>
7#include <linux/timer.h> 8#include <linux/timer.h>
8#include <linux/scatterlist.h> 9#include <linux/scatterlist.h>
9 10
10struct request;
11struct scatterlist;
12struct Scsi_Host; 11struct Scsi_Host;
13struct scsi_device; 12struct scsi_device;
14 13
14struct scsi_data_buffer {
15 struct sg_table table;
16 unsigned length;
17 int resid;
18};
15 19
16/* embedded in scsi_cmnd */ 20/* embedded in scsi_cmnd */
17struct scsi_pointer { 21struct scsi_pointer {
@@ -62,15 +66,11 @@ struct scsi_cmnd {
62 /* These elements define the operation we are about to perform */ 66 /* These elements define the operation we are about to perform */
63#define MAX_COMMAND_SIZE 16 67#define MAX_COMMAND_SIZE 16
64 unsigned char cmnd[MAX_COMMAND_SIZE]; 68 unsigned char cmnd[MAX_COMMAND_SIZE];
65 unsigned request_bufflen; /* Actual request size */
66 69
67 struct timer_list eh_timeout; /* Used to time out the command. */ 70 struct timer_list eh_timeout; /* Used to time out the command. */
68 void *request_buffer; /* Actual requested buffer */
69 71
70 /* These elements define the operation we ultimately want to perform */ 72 /* These elements define the operation we ultimately want to perform */
71 unsigned short use_sg; /* Number of pieces of scatter-gather */ 73 struct scsi_data_buffer sdb;
72 unsigned short __use_sg;
73
74 unsigned underflow; /* Return error if less than 74 unsigned underflow; /* Return error if less than
75 this amount is transferred */ 75 this amount is transferred */
76 76
@@ -80,15 +80,11 @@ struct scsi_cmnd {
80 reconnects. Probably == sector 80 reconnects. Probably == sector
81 size */ 81 size */
82 82
83 int resid; /* Number of bytes requested to be
84 transferred less actual number
85 transferred (0 if not supported) */
86
87 struct request *request; /* The command we are 83 struct request *request; /* The command we are
88 working on */ 84 working on */
89 85
90#define SCSI_SENSE_BUFFERSIZE 96 86#define SCSI_SENSE_BUFFERSIZE 96
91 unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; 87 unsigned char *sense_buffer;
92 /* obtained by REQUEST SENSE when 88 /* obtained by REQUEST SENSE when
93 * CHECK CONDITION is received on original 89 * CHECK CONDITION is received on original
94 * command (auto-sense) */ 90 * command (auto-sense) */
@@ -128,27 +124,55 @@ extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
128 size_t *offset, size_t *len); 124 size_t *offset, size_t *len);
129extern void scsi_kunmap_atomic_sg(void *virt); 125extern void scsi_kunmap_atomic_sg(void *virt);
130 126
131extern struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *, gfp_t); 127extern int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask);
132extern void scsi_free_sgtable(struct scsi_cmnd *); 128extern void scsi_release_buffers(struct scsi_cmnd *cmd);
133 129
134extern int scsi_dma_map(struct scsi_cmnd *cmd); 130extern int scsi_dma_map(struct scsi_cmnd *cmd);
135extern void scsi_dma_unmap(struct scsi_cmnd *cmd); 131extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
136 132
137#define scsi_sg_count(cmd) ((cmd)->use_sg) 133static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd)
138#define scsi_sglist(cmd) ((struct scatterlist *)(cmd)->request_buffer) 134{
139#define scsi_bufflen(cmd) ((cmd)->request_bufflen) 135 return cmd->sdb.table.nents;
136}
137
138static inline struct scatterlist *scsi_sglist(struct scsi_cmnd *cmd)
139{
140 return cmd->sdb.table.sgl;
141}
142
143static inline unsigned scsi_bufflen(struct scsi_cmnd *cmd)
144{
145 return cmd->sdb.length;
146}
140 147
141static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid) 148static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid)
142{ 149{
143 cmd->resid = resid; 150 cmd->sdb.resid = resid;
144} 151}
145 152
146static inline int scsi_get_resid(struct scsi_cmnd *cmd) 153static inline int scsi_get_resid(struct scsi_cmnd *cmd)
147{ 154{
148 return cmd->resid; 155 return cmd->sdb.resid;
149} 156}
150 157
151#define scsi_for_each_sg(cmd, sg, nseg, __i) \ 158#define scsi_for_each_sg(cmd, sg, nseg, __i) \
152 for_each_sg(scsi_sglist(cmd), sg, nseg, __i) 159 for_each_sg(scsi_sglist(cmd), sg, nseg, __i)
153 160
161static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd)
162{
163 return blk_bidi_rq(cmd->request) &&
164 (cmd->request->next_rq->special != NULL);
165}
166
167static inline struct scsi_data_buffer *scsi_in(struct scsi_cmnd *cmd)
168{
169 return scsi_bidi_cmnd(cmd) ?
170 cmd->request->next_rq->special : &cmd->sdb;
171}
172
173static inline struct scsi_data_buffer *scsi_out(struct scsi_cmnd *cmd)
174{
175 return &cmd->sdb;
176}
177
154#endif /* _SCSI_SCSI_CMND_H */ 178#endif /* _SCSI_SCSI_CMND_H */
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 66e9058357e0..ab7acbe80960 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -122,9 +122,6 @@ struct scsi_device {
122 unsigned tagged_supported:1; /* Supports SCSI-II tagged queuing */ 122 unsigned tagged_supported:1; /* Supports SCSI-II tagged queuing */
123 unsigned simple_tags:1; /* simple queue tag messages are enabled */ 123 unsigned simple_tags:1; /* simple queue tag messages are enabled */
124 unsigned ordered_tags:1;/* ordered queue tag messages are enabled */ 124 unsigned ordered_tags:1;/* ordered queue tag messages are enabled */
125 unsigned single_lun:1; /* Indicates we should only allow I/O to
126 * one of the luns for the device at a
127 * time. */
128 unsigned was_reset:1; /* There was a bus reset on the bus for 125 unsigned was_reset:1; /* There was a bus reset on the bus for
129 * this device */ 126 * this device */
130 unsigned expecting_cc_ua:1; /* Expecting a CHECK_CONDITION/UNIT_ATTN 127 unsigned expecting_cc_ua:1; /* Expecting a CHECK_CONDITION/UNIT_ATTN
@@ -142,6 +139,7 @@ struct scsi_device {
142 unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */ 139 unsigned fix_capacity:1; /* READ_CAPACITY is too high by 1 */
143 unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */ 140 unsigned guess_capacity:1; /* READ_CAPACITY might be too high by 1 */
144 unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ 141 unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */
142 unsigned last_sector_bug:1; /* Always read last sector in a 1 sector read */
145 143
146 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ 144 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
147 struct list_head event_list; /* asserted events */ 145 struct list_head event_list; /* asserted events */
@@ -202,6 +200,9 @@ struct scsi_target {
202 unsigned int id; /* target id ... replace 200 unsigned int id; /* target id ... replace
203 * scsi_device.id eventually */ 201 * scsi_device.id eventually */
204 unsigned int create:1; /* signal that it needs to be added */ 202 unsigned int create:1; /* signal that it needs to be added */
203 unsigned int single_lun:1; /* Indicates we should only
204 * allow I/O to one of the luns
205 * for the device at a time. */
205 unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */ 206 unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */
206 /* means no lun present */ 207 /* means no lun present */
207 208
@@ -242,6 +243,9 @@ extern struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *,
242 uint); 243 uint);
243extern void starget_for_each_device(struct scsi_target *, void *, 244extern void starget_for_each_device(struct scsi_target *, void *,
244 void (*fn)(struct scsi_device *, void *)); 245 void (*fn)(struct scsi_device *, void *));
246extern void __starget_for_each_device(struct scsi_target *, void *,
247 void (*fn)(struct scsi_device *,
248 void *));
245 249
246/* only exposed to implement shost_for_each_device */ 250/* only exposed to implement shost_for_each_device */
247extern struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *, 251extern struct scsi_device *__scsi_iterate_devices(struct Scsi_Host *,
@@ -292,7 +296,7 @@ extern int scsi_mode_select(struct scsi_device *sdev, int pf, int sp,
292 struct scsi_mode_data *data, 296 struct scsi_mode_data *data,
293 struct scsi_sense_hdr *); 297 struct scsi_sense_hdr *);
294extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, 298extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout,
295 int retries); 299 int retries, struct scsi_sense_hdr *sshdr);
296extern int scsi_device_set_state(struct scsi_device *sdev, 300extern int scsi_device_set_state(struct scsi_device *sdev,
297 enum scsi_device_state state); 301 enum scsi_device_state state);
298extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, 302extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type,
@@ -383,6 +387,10 @@ static inline int scsi_device_qas(struct scsi_device *sdev)
383 return 0; 387 return 0;
384 return sdev->inquiry[56] & 0x02; 388 return sdev->inquiry[56] & 0x02;
385} 389}
390static inline int scsi_device_enclosure(struct scsi_device *sdev)
391{
392 return sdev->inquiry[6] & (1<<6);
393}
386 394
387#define MODULE_ALIAS_SCSI_DEVICE(type) \ 395#define MODULE_ALIAS_SCSI_DEVICE(type) \
388 MODULE_ALIAS("scsi:t-" __stringify(type) "*") 396 MODULE_ALIAS("scsi:t-" __stringify(type) "*")
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index d21b8913ceb3..25071d5d9bf8 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -68,16 +68,15 @@ extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len,
68extern int scsi_reset_provider(struct scsi_device *, int); 68extern int scsi_reset_provider(struct scsi_device *, int);
69 69
70struct scsi_eh_save { 70struct scsi_eh_save {
71 /* saved state */
71 int result; 72 int result;
72 enum dma_data_direction data_direction; 73 enum dma_data_direction data_direction;
73 unsigned char cmd_len; 74 unsigned char cmd_len;
74 unsigned char cmnd[MAX_COMMAND_SIZE]; 75 unsigned char cmnd[MAX_COMMAND_SIZE];
76 struct scsi_data_buffer sdb;
77 struct request *next_rq;
75 78
76 void *buffer; 79 /* new command support */
77 unsigned bufflen;
78 unsigned short use_sg;
79 int resid;
80
81 struct scatterlist sense_sgl; 80 struct scatterlist sense_sgl;
82}; 81};
83 82
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 0fd4746ee39d..5c58d594126a 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -39,9 +39,6 @@ struct blk_queue_tags;
39#define DISABLE_CLUSTERING 0 39#define DISABLE_CLUSTERING 0
40#define ENABLE_CLUSTERING 1 40#define ENABLE_CLUSTERING 1
41 41
42#define DISABLE_SG_CHAINING 0
43#define ENABLE_SG_CHAINING 1
44
45enum scsi_eh_timer_return { 42enum scsi_eh_timer_return {
46 EH_NOT_HANDLED, 43 EH_NOT_HANDLED,
47 EH_HANDLED, 44 EH_HANDLED,
@@ -136,9 +133,9 @@ struct scsi_host_template {
136 * the done callback is invoked. 133 * the done callback is invoked.
137 * 134 *
138 * This is called to inform the LLD to transfer 135 * This is called to inform the LLD to transfer
139 * cmd->request_bufflen bytes. The cmd->use_sg speciefies the 136 * scsi_bufflen(cmd) bytes. scsi_sg_count(cmd) speciefies the
140 * number of scatterlist entried in the command and 137 * number of scatterlist entried in the command and
141 * cmd->request_buffer contains the scatterlist. 138 * scsi_sglist(cmd) returns the scatterlist.
142 * 139 *
143 * return values: see queuecommand 140 * return values: see queuecommand
144 * 141 *
@@ -446,15 +443,6 @@ struct scsi_host_template {
446 unsigned ordered_tag:1; 443 unsigned ordered_tag:1;
447 444
448 /* 445 /*
449 * true if the low-level driver can support sg chaining. this
450 * will be removed eventually when all the drivers are
451 * converted to support sg chaining.
452 *
453 * Status: OBSOLETE
454 */
455 unsigned use_sg_chaining:1;
456
457 /*
458 * Countdown for host blocking with no commands outstanding 446 * Countdown for host blocking with no commands outstanding
459 */ 447 */
460 unsigned int max_host_blocked; 448 unsigned int max_host_blocked;
@@ -598,7 +586,6 @@ struct Scsi_Host {
598 unsigned unchecked_isa_dma:1; 586 unsigned unchecked_isa_dma:1;
599 unsigned use_clustering:1; 587 unsigned use_clustering:1;
600 unsigned use_blk_tcq:1; 588 unsigned use_blk_tcq:1;
601 unsigned use_sg_chaining:1;
602 589
603 /* 590 /*
604 * Host has requested that no further requests come through for the 591 * Host has requested that no further requests come through for the
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index e466d886e192..4769efd4db24 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -176,7 +176,7 @@ struct class_device_attribute class_device_attr_vport_##_name = \
176 * ports has a unique presense on the SAN, and may be instantiated via 176 * ports has a unique presense on the SAN, and may be instantiated via
177 * NPIV, Virtual Fabrics, or via additional ALPAs. As the vport is a 177 * NPIV, Virtual Fabrics, or via additional ALPAs. As the vport is a
178 * unique presense, each vport has it's own view of the fabric, 178 * unique presense, each vport has it's own view of the fabric,
179 * authentication priviledge, and priorities. 179 * authentication privilege, and priorities.
180 * 180 *
181 * A virtual port may support 1 or more FC4 roles. Typically it is a 181 * A virtual port may support 1 or more FC4 roles. Typically it is a
182 * FCP Initiator. It could be a FCP Target, or exist sole for an IP over FC 182 * FCP Initiator. It could be a FCP Target, or exist sole for an IP over FC
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index 7ff6199cbd55..404f11d331d6 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -118,7 +118,7 @@ struct iscsi_transport {
118 char *data, uint32_t data_size); 118 char *data, uint32_t data_size);
119 void (*get_stats) (struct iscsi_cls_conn *conn, 119 void (*get_stats) (struct iscsi_cls_conn *conn,
120 struct iscsi_stats *stats); 120 struct iscsi_stats *stats);
121 void (*init_cmd_task) (struct iscsi_cmd_task *ctask); 121 int (*init_cmd_task) (struct iscsi_cmd_task *ctask);
122 void (*init_mgmt_task) (struct iscsi_conn *conn, 122 void (*init_mgmt_task) (struct iscsi_conn *conn,
123 struct iscsi_mgmt_task *mtask); 123 struct iscsi_mgmt_task *mtask);
124 int (*xmit_cmd_task) (struct iscsi_conn *conn, 124 int (*xmit_cmd_task) (struct iscsi_conn *conn,
@@ -176,6 +176,7 @@ struct iscsi_cls_conn {
176#define ISCSI_STATE_TERMINATE 4 176#define ISCSI_STATE_TERMINATE 4
177#define ISCSI_STATE_IN_RECOVERY 5 177#define ISCSI_STATE_IN_RECOVERY 5
178#define ISCSI_STATE_RECOVERY_FAILED 6 178#define ISCSI_STATE_RECOVERY_FAILED 6
179#define ISCSI_STATE_LOGGING_OUT 7
179 180
180struct iscsi_cls_session { 181struct iscsi_cls_session {
181 struct list_head sess_list; /* item in session_list */ 182 struct list_head sess_list; /* item in session_list */
@@ -185,6 +186,7 @@ struct iscsi_cls_session {
185 /* recovery fields */ 186 /* recovery fields */
186 int recovery_tmo; 187 int recovery_tmo;
187 struct delayed_work recovery_work; 188 struct delayed_work recovery_work;
189 struct work_struct unbind_work;
188 190
189 int target_id; 191 int target_id;
190 192
@@ -205,6 +207,8 @@ struct iscsi_cls_session {
205struct iscsi_host { 207struct iscsi_host {
206 struct list_head sessions; 208 struct list_head sessions;
207 struct mutex mutex; 209 struct mutex mutex;
210 struct workqueue_struct *unbind_workq;
211 char unbind_workq_name[KOBJ_NAME_LEN];
208}; 212};
209 213
210/* 214/*
@@ -214,8 +218,8 @@ extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost,
214 struct iscsi_transport *transport); 218 struct iscsi_transport *transport);
215extern int iscsi_add_session(struct iscsi_cls_session *session, 219extern int iscsi_add_session(struct iscsi_cls_session *session,
216 unsigned int target_id); 220 unsigned int target_id);
217extern int iscsi_if_create_session_done(struct iscsi_cls_conn *conn); 221extern int iscsi_session_event(struct iscsi_cls_session *session,
218extern int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn); 222 enum iscsi_uevent_e event);
219extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost, 223extern struct iscsi_cls_session *iscsi_create_session(struct Scsi_Host *shost,
220 struct iscsi_transport *t, 224 struct iscsi_transport *t,
221 unsigned int target_id); 225 unsigned int target_id);
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index abdfd2e27dd7..09125fa95b93 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -4,23 +4,17 @@
4#include <linux/transport_class.h> 4#include <linux/transport_class.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/mutex.h> 6#include <linux/mutex.h>
7#include <scsi/sas.h>
7 8
8struct scsi_transport_template; 9struct scsi_transport_template;
9struct sas_rphy; 10struct sas_rphy;
10struct request; 11struct request;
11 12
12enum sas_device_type { 13enum sas_device_type {
13 SAS_PHY_UNUSED, 14 SAS_PHY_UNUSED = 0,
14 SAS_END_DEVICE, 15 SAS_END_DEVICE = 1,
15 SAS_EDGE_EXPANDER_DEVICE, 16 SAS_EDGE_EXPANDER_DEVICE = 2,
16 SAS_FANOUT_EXPANDER_DEVICE, 17 SAS_FANOUT_EXPANDER_DEVICE = 3,
17};
18
19enum sas_protocol {
20 SAS_PROTOCOL_SATA = 0x01,
21 SAS_PROTOCOL_SMP = 0x02,
22 SAS_PROTOCOL_STP = 0x04,
23 SAS_PROTOCOL_SSP = 0x08,
24}; 18};
25 19
26static inline int sas_protocol_ata(enum sas_protocol proto) 20static inline int sas_protocol_ata(enum sas_protocol proto)
diff --git a/include/scsi/sd.h b/include/scsi/sd.h
index f7513313ef0d..8ea9f7358ac1 100644
--- a/include/scsi/sd.h
+++ b/include/scsi/sd.h
@@ -41,6 +41,7 @@ struct scsi_disk {
41 u32 index; 41 u32 index;
42 u8 media_present; 42 u8 media_present;
43 u8 write_prot; 43 u8 write_prot;
44 unsigned previous_state : 1;
44 unsigned WCE : 1; /* state of disk WCE bit */ 45 unsigned WCE : 1; /* state of disk WCE bit */
45 unsigned RCD : 1; /* state of disk RCD bit, unused */ 46 unsigned RCD : 1; /* state of disk RCD bit, unused */
46 unsigned DPOFUA : 1; /* state of disk DPOFUA bit */ 47 unsigned DPOFUA : 1; /* state of disk DPOFUA bit */