aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2012-07-25 15:58:48 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-07-25 15:58:48 -0400
commit8407884dd9164ec18ed2afc00f56b87e36c51fcf (patch)
treeb6ea42c231d7d39f454de28a068d78ce11709770 /include/scsi
parentdc7f71f486f4f5fa96f6dcf86833da020cde8a11 (diff)
parentbdc0077af574800d24318b6945cf2344e8dbb050 (diff)
Merge branch 'master' [vanilla Linus master] into libata-dev.git/upstream
Two bits were appended to the end of the bitfield list in struct scsi_device. Resolve that conflict by including both bits. Conflicts: include/scsi/scsi_device.h
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libfc.h24
-rw-r--r--include/scsi/libsas.h36
-rw-r--r--include/scsi/sas_ata.h5
-rw-r--r--include/scsi/scsi.h2
-rw-r--r--include/scsi/scsi_cmnd.h8
-rw-r--r--include/scsi/scsi_device.h5
-rw-r--r--include/scsi/scsi_dh.h6
-rw-r--r--include/scsi/scsi_scan.h11
-rw-r--r--include/scsi/scsi_transport_fc.h12
9 files changed, 78 insertions, 31 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 8f9dfba3fcf..399162b50a8 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -224,7 +224,7 @@ struct fc_rport_priv {
224}; 224};
225 225
226/** 226/**
227 * struct fcoe_dev_stats - fcoe stats structure 227 * struct fc_stats - fc stats structure
228 * @SecondsSinceLastReset: Seconds since the last reset 228 * @SecondsSinceLastReset: Seconds since the last reset
229 * @TxFrames: Number of transmitted frames 229 * @TxFrames: Number of transmitted frames
230 * @TxWords: Number of transmitted words 230 * @TxWords: Number of transmitted words
@@ -232,6 +232,9 @@ struct fc_rport_priv {
232 * @RxWords: Number of received words 232 * @RxWords: Number of received words
233 * @ErrorFrames: Number of received error frames 233 * @ErrorFrames: Number of received error frames
234 * @DumpedFrames: Number of dumped frames 234 * @DumpedFrames: Number of dumped frames
235 * @FcpPktAllocFails: Number of fcp packet allocation failures
236 * @FcpPktAborts: Number of fcp packet aborts
237 * @FcpFrameAllocFails: Number of fcp frame allocation failures
235 * @LinkFailureCount: Number of link failures 238 * @LinkFailureCount: Number of link failures
236 * @LossOfSignalCount: Number for signal losses 239 * @LossOfSignalCount: Number for signal losses
237 * @InvalidTxWordCount: Number of invalid transmitted words 240 * @InvalidTxWordCount: Number of invalid transmitted words
@@ -244,7 +247,7 @@ struct fc_rport_priv {
244 * @VLinkFailureCount: Number of virtual link failures 247 * @VLinkFailureCount: Number of virtual link failures
245 * @MissDiscAdvCount: Number of missing FIP discovery advertisement 248 * @MissDiscAdvCount: Number of missing FIP discovery advertisement
246 */ 249 */
247struct fcoe_dev_stats { 250struct fc_stats {
248 u64 SecondsSinceLastReset; 251 u64 SecondsSinceLastReset;
249 u64 TxFrames; 252 u64 TxFrames;
250 u64 TxWords; 253 u64 TxWords;
@@ -252,6 +255,9 @@ struct fcoe_dev_stats {
252 u64 RxWords; 255 u64 RxWords;
253 u64 ErrorFrames; 256 u64 ErrorFrames;
254 u64 DumpedFrames; 257 u64 DumpedFrames;
258 u64 FcpPktAllocFails;
259 u64 FcpPktAborts;
260 u64 FcpFrameAllocFails;
255 u64 LinkFailureCount; 261 u64 LinkFailureCount;
256 u64 LossOfSignalCount; 262 u64 LossOfSignalCount;
257 u64 InvalidTxWordCount; 263 u64 InvalidTxWordCount;
@@ -510,7 +516,7 @@ struct libfc_function_template {
510 int (*ddp_done)(struct fc_lport *, u16); 516 int (*ddp_done)(struct fc_lport *, u16);
511 /* 517 /*
512 * Sets up the DDP context for a given exchange id on the given 518 * Sets up the DDP context for a given exchange id on the given
513 * scatterlist if LLD supports DDP for FCoE target. 519 * scatterlist if LLD supports DDP for target.
514 * 520 *
515 * STATUS: OPTIONAL 521 * STATUS: OPTIONAL
516 */ 522 */
@@ -817,8 +823,7 @@ enum fc_lport_event {
817 * @state: Identifies the state 823 * @state: Identifies the state
818 * @boot_time: Timestamp indicating when the local port came online 824 * @boot_time: Timestamp indicating when the local port came online
819 * @host_stats: SCSI host statistics 825 * @host_stats: SCSI host statistics
820 * @dev_stats: FCoE device stats (TODO: libfc should not be 826 * @stats: FC local port stats (TODO separate libfc LLD stats)
821 * FCoE aware)
822 * @retry_count: Number of retries in the current state 827 * @retry_count: Number of retries in the current state
823 * @port_id: FC Port ID 828 * @port_id: FC Port ID
824 * @wwpn: World Wide Port Name 829 * @wwpn: World Wide Port Name
@@ -867,7 +872,7 @@ struct fc_lport {
867 enum fc_lport_state state; 872 enum fc_lport_state state;
868 unsigned long boot_time; 873 unsigned long boot_time;
869 struct fc_host_statistics host_stats; 874 struct fc_host_statistics host_stats;
870 struct fcoe_dev_stats __percpu *dev_stats; 875 struct fc_stats __percpu *stats;
871 u8 retry_count; 876 u8 retry_count;
872 877
873 /* Fabric information */ 878 /* Fabric information */
@@ -980,8 +985,8 @@ static inline void fc_lport_state_enter(struct fc_lport *lport,
980 */ 985 */
981static inline int fc_lport_init_stats(struct fc_lport *lport) 986static inline int fc_lport_init_stats(struct fc_lport *lport)
982{ 987{
983 lport->dev_stats = alloc_percpu(struct fcoe_dev_stats); 988 lport->stats = alloc_percpu(struct fc_stats);
984 if (!lport->dev_stats) 989 if (!lport->stats)
985 return -ENOMEM; 990 return -ENOMEM;
986 return 0; 991 return 0;
987} 992}
@@ -992,7 +997,7 @@ static inline int fc_lport_init_stats(struct fc_lport *lport)
992 */ 997 */
993static inline void fc_lport_free_stats(struct fc_lport *lport) 998static inline void fc_lport_free_stats(struct fc_lport *lport)
994{ 999{
995 free_percpu(lport->dev_stats); 1000 free_percpu(lport->stats);
996} 1001}
997 1002
998/** 1003/**
@@ -1116,6 +1121,7 @@ void fc_fill_hdr(struct fc_frame *, const struct fc_frame *,
1116 * EXCHANGE MANAGER LAYER 1121 * EXCHANGE MANAGER LAYER
1117 *****************************/ 1122 *****************************/
1118int fc_exch_init(struct fc_lport *); 1123int fc_exch_init(struct fc_lport *);
1124void fc_exch_update_stats(struct fc_lport *lport);
1119struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *, 1125struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *,
1120 struct fc_exch_mgr *, 1126 struct fc_exch_mgr *,
1121 bool (*match)(struct fc_frame *)); 1127 bool (*match)(struct fc_frame *));
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index f4f1c96dca7..ae33706afeb 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -163,20 +163,29 @@ enum ata_command_set {
163 ATAPI_COMMAND_SET = 1, 163 ATAPI_COMMAND_SET = 1,
164}; 164};
165 165
166#define ATA_RESP_FIS_SIZE 24
167
166struct sata_device { 168struct sata_device {
167 enum ata_command_set command_set; 169 enum ata_command_set command_set;
168 struct smp_resp rps_resp; /* report_phy_sata_resp */ 170 struct smp_resp rps_resp; /* report_phy_sata_resp */
169 u8 port_no; /* port number, if this is a PM (Port) */ 171 u8 port_no; /* port number, if this is a PM (Port) */
170 struct list_head children; /* PM Ports if this is a PM */
171 172
172 struct ata_port *ap; 173 struct ata_port *ap;
173 struct ata_host ata_host; 174 struct ata_host ata_host;
174 struct ata_taskfile tf; 175 u8 fis[ATA_RESP_FIS_SIZE];
176};
177
178struct ssp_device {
179 struct list_head eh_list_node; /* pending a user requested eh action */
180 struct scsi_lun reset_lun;
175}; 181};
176 182
177enum { 183enum {
178 SAS_DEV_GONE, 184 SAS_DEV_GONE,
179 SAS_DEV_DESTROY, 185 SAS_DEV_DESTROY,
186 SAS_DEV_EH_PENDING,
187 SAS_DEV_LU_RESET,
188 SAS_DEV_RESET,
180}; 189};
181 190
182struct domain_device { 191struct domain_device {
@@ -210,6 +219,7 @@ struct domain_device {
210 union { 219 union {
211 struct expander_device ex_dev; 220 struct expander_device ex_dev;
212 struct sata_device sata_dev; /* STP & directly attached */ 221 struct sata_device sata_dev; /* STP & directly attached */
222 struct ssp_device ssp_dev;
213 }; 223 };
214 224
215 void *lldd_dev; 225 void *lldd_dev;
@@ -384,7 +394,10 @@ struct sas_ha_struct {
384 struct list_head defer_q; /* work queued while draining */ 394 struct list_head defer_q; /* work queued while draining */
385 struct mutex drain_mutex; 395 struct mutex drain_mutex;
386 unsigned long state; 396 unsigned long state;
387 spinlock_t state_lock; 397 spinlock_t lock;
398 int eh_active;
399 wait_queue_head_t eh_wait_q;
400 struct list_head eh_dev_q;
388 401
389 struct mutex disco_mutex; 402 struct mutex disco_mutex;
390 403
@@ -537,7 +550,7 @@ enum exec_status {
537 */ 550 */
538struct ata_task_resp { 551struct ata_task_resp {
539 u16 frame_len; 552 u16 frame_len;
540 u8 ending_fis[24]; /* dev to host or data-in */ 553 u8 ending_fis[ATA_RESP_FIS_SIZE]; /* dev to host or data-in */
541}; 554};
542 555
543#define SAS_STATUS_BUF_SIZE 96 556#define SAS_STATUS_BUF_SIZE 96
@@ -600,10 +613,6 @@ struct sas_task {
600 613
601 enum sas_protocol task_proto; 614 enum sas_protocol task_proto;
602 615
603 /* Used by the discovery code. */
604 struct timer_list timer;
605 struct completion completion;
606
607 union { 616 union {
608 struct sas_ata_task ata_task; 617 struct sas_ata_task ata_task;
609 struct sas_smp_task smp_task; 618 struct sas_smp_task smp_task;
@@ -620,8 +629,15 @@ struct sas_task {
620 629
621 void *lldd_task; /* for use by LLDDs */ 630 void *lldd_task; /* for use by LLDDs */
622 void *uldd_task; 631 void *uldd_task;
632 struct sas_task_slow *slow_task;
633};
623 634
624 struct work_struct abort_work; 635struct sas_task_slow {
636 /* standard/extra infrastructure for slow path commands (SMP and
637 * internal lldd commands
638 */
639 struct timer_list timer;
640 struct completion completion;
625}; 641};
626 642
627#define SAS_TASK_STATE_PENDING 1 643#define SAS_TASK_STATE_PENDING 1
@@ -631,6 +647,7 @@ struct sas_task {
631#define SAS_TASK_AT_INITIATOR 16 647#define SAS_TASK_AT_INITIATOR 16
632 648
633extern struct sas_task *sas_alloc_task(gfp_t flags); 649extern struct sas_task *sas_alloc_task(gfp_t flags);
650extern struct sas_task *sas_alloc_slow_task(gfp_t flags);
634extern void sas_free_task(struct sas_task *task); 651extern void sas_free_task(struct sas_task *task);
635 652
636struct sas_domain_function_template { 653struct sas_domain_function_template {
@@ -706,6 +723,7 @@ void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *);
706void sas_init_dev(struct domain_device *); 723void sas_init_dev(struct domain_device *);
707 724
708void sas_task_abort(struct sas_task *); 725void sas_task_abort(struct sas_task *);
726int sas_eh_abort_handler(struct scsi_cmnd *cmd);
709int sas_eh_device_reset_handler(struct scsi_cmnd *cmd); 727int sas_eh_device_reset_handler(struct scsi_cmnd *cmd);
710int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd); 728int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd);
711 729
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h
index 77670e823ed..2dfbdaa0b34 100644
--- a/include/scsi/sas_ata.h
+++ b/include/scsi/sas_ata.h
@@ -45,6 +45,7 @@ void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q,
45void sas_ata_schedule_reset(struct domain_device *dev); 45void sas_ata_schedule_reset(struct domain_device *dev);
46void sas_ata_wait_eh(struct domain_device *dev); 46void sas_ata_wait_eh(struct domain_device *dev);
47void sas_probe_sata(struct asd_sas_port *port); 47void sas_probe_sata(struct asd_sas_port *port);
48void sas_ata_end_eh(struct ata_port *ap);
48#else 49#else
49 50
50 51
@@ -85,6 +86,10 @@ static inline int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy
85{ 86{
86 return 0; 87 return 0;
87} 88}
89
90static inline void sas_ata_end_eh(struct ata_port *ap)
91{
92}
88#endif 93#endif
89 94
90#endif /* _SAS_ATA_H_ */ 95#endif /* _SAS_ATA_H_ */
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 4527b3a1332..66216c1acb4 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -161,6 +161,8 @@ struct scsi_cmnd;
161#define MI_REPORT_PRIORITY 0x0e 161#define MI_REPORT_PRIORITY 0x0e
162#define MI_REPORT_TIMESTAMP 0x0f 162#define MI_REPORT_TIMESTAMP 0x0f
163#define MI_MANAGEMENT_PROTOCOL_IN 0x10 163#define MI_MANAGEMENT_PROTOCOL_IN 0x10
164/* value for MI_REPORT_TARGET_PGS ext header */
165#define MI_EXT_HDR_PARAM_FMT 0x20
164/* values for maintenance out */ 166/* values for maintenance out */
165#define MO_SET_IDENTIFYING_INFORMATION 0x06 167#define MO_SET_IDENTIFYING_INFORMATION 0x06
166#define MO_SET_TARGET_PGS 0x0a 168#define MO_SET_TARGET_PGS 0x0a
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 1e1198546c7..ac06cc59589 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -134,10 +134,16 @@ struct scsi_cmnd {
134 134
135static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd) 135static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd)
136{ 136{
137 struct scsi_driver **sdp;
138
137 if (!cmd->request->rq_disk) 139 if (!cmd->request->rq_disk)
138 return NULL; 140 return NULL;
139 141
140 return *(struct scsi_driver **)cmd->request->rq_disk->private_data; 142 sdp = (struct scsi_driver **)cmd->request->rq_disk->private_data;
143 if (!sdp)
144 return NULL;
145
146 return *sdp;
141} 147}
142 148
143extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); 149extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index aff7525de19..9895f69294f 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -42,6 +42,7 @@ enum scsi_device_state {
42 * originate in the mid-layer) */ 42 * originate in the mid-layer) */
43 SDEV_OFFLINE, /* Device offlined (by error handling or 43 SDEV_OFFLINE, /* Device offlined (by error handling or
44 * user request */ 44 * user request */
45 SDEV_TRANSPORT_OFFLINE, /* Offlined by transport class error handler */
45 SDEV_BLOCK, /* Device blocked by scsi lld. No 46 SDEV_BLOCK, /* Device blocked by scsi lld. No
46 * scsi commands from user or midlayer 47 * scsi commands from user or midlayer
47 * should be issued to the scsi 48 * should be issued to the scsi
@@ -154,6 +155,7 @@ struct scsi_device {
154 unsigned try_rc_10_first:1; /* Try READ_CAPACACITY_10 first */ 155 unsigned try_rc_10_first:1; /* Try READ_CAPACACITY_10 first */
155 unsigned is_visible:1; /* is the device visible in sysfs */ 156 unsigned is_visible:1; /* is the device visible in sysfs */
156 unsigned can_power_off:1; /* Device supports runtime power off */ 157 unsigned can_power_off:1; /* Device supports runtime power off */
158 unsigned wce_default_on:1; /* Cache is ON by default */
157 159
158 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ 160 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
159 struct list_head event_list; /* asserted events */ 161 struct list_head event_list; /* asserted events */
@@ -374,7 +376,7 @@ extern void scsi_scan_target(struct device *parent, unsigned int channel,
374 unsigned int id, unsigned int lun, int rescan); 376 unsigned int id, unsigned int lun, int rescan);
375extern void scsi_target_reap(struct scsi_target *); 377extern void scsi_target_reap(struct scsi_target *);
376extern void scsi_target_block(struct device *); 378extern void scsi_target_block(struct device *);
377extern void scsi_target_unblock(struct device *); 379extern void scsi_target_unblock(struct device *, enum scsi_device_state);
378extern void scsi_remove_target(struct device *); 380extern void scsi_remove_target(struct device *);
379extern void int_to_scsilun(unsigned int, struct scsi_lun *); 381extern void int_to_scsilun(unsigned int, struct scsi_lun *);
380extern int scsilun_to_int(struct scsi_lun *); 382extern int scsilun_to_int(struct scsi_lun *);
@@ -422,6 +424,7 @@ static inline unsigned int sdev_id(struct scsi_device *sdev)
422static inline int scsi_device_online(struct scsi_device *sdev) 424static inline int scsi_device_online(struct scsi_device *sdev)
423{ 425{
424 return (sdev->sdev_state != SDEV_OFFLINE && 426 return (sdev->sdev_state != SDEV_OFFLINE &&
427 sdev->sdev_state != SDEV_TRANSPORT_OFFLINE &&
425 sdev->sdev_state != SDEV_DEL); 428 sdev->sdev_state != SDEV_DEL);
426} 429}
427static inline int scsi_device_blocked(struct scsi_device *sdev) 430static inline int scsi_device_blocked(struct scsi_device *sdev)
diff --git a/include/scsi/scsi_dh.h b/include/scsi/scsi_dh.h
index e3f2db212dd..620c723ee8e 100644
--- a/include/scsi/scsi_dh.h
+++ b/include/scsi/scsi_dh.h
@@ -60,6 +60,7 @@ extern int scsi_dh_activate(struct request_queue *, activate_complete, void *);
60extern int scsi_dh_handler_exist(const char *); 60extern int scsi_dh_handler_exist(const char *);
61extern int scsi_dh_attach(struct request_queue *, const char *); 61extern int scsi_dh_attach(struct request_queue *, const char *);
62extern void scsi_dh_detach(struct request_queue *); 62extern void scsi_dh_detach(struct request_queue *);
63extern const char *scsi_dh_attached_handler_name(struct request_queue *, gfp_t);
63extern int scsi_dh_set_params(struct request_queue *, const char *); 64extern int scsi_dh_set_params(struct request_queue *, const char *);
64#else 65#else
65static inline int scsi_dh_activate(struct request_queue *req, 66static inline int scsi_dh_activate(struct request_queue *req,
@@ -80,6 +81,11 @@ static inline void scsi_dh_detach(struct request_queue *q)
80{ 81{
81 return; 82 return;
82} 83}
84static inline const char *scsi_dh_attached_handler_name(struct request_queue *q,
85 gfp_t gfp)
86{
87 return NULL;
88}
83static inline int scsi_dh_set_params(struct request_queue *req, const char *params) 89static inline int scsi_dh_set_params(struct request_queue *req, const char *params)
84{ 90{
85 return -SCSI_DH_NOSYS; 91 return -SCSI_DH_NOSYS;
diff --git a/include/scsi/scsi_scan.h b/include/scsi/scsi_scan.h
deleted file mode 100644
index 78898889243..00000000000
--- a/include/scsi/scsi_scan.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef _SCSI_SCSI_SCAN_H
2#define _SCSI_SCSI_SCAN_H
3
4#ifdef CONFIG_SCSI
5/* drivers/scsi/scsi_scan.c */
6extern int scsi_complete_async_scans(void);
7#else
8static inline int scsi_complete_async_scans(void) { return 0; }
9#endif
10
11#endif /* _SCSI_SCSI_SCAN_H */
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 719faf1863a..b797e8fad66 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -426,6 +426,18 @@ struct fc_host_statistics {
426 u64 fcp_control_requests; 426 u64 fcp_control_requests;
427 u64 fcp_input_megabytes; 427 u64 fcp_input_megabytes;
428 u64 fcp_output_megabytes; 428 u64 fcp_output_megabytes;
429 u64 fcp_packet_alloc_failures; /* fcp packet allocation failures */
430 u64 fcp_packet_aborts; /* fcp packet aborted */
431 u64 fcp_frame_alloc_failures; /* fcp frame allocation failures */
432
433 /* fc exches statistics */
434 u64 fc_no_free_exch; /* no free exch memory */
435 u64 fc_no_free_exch_xid; /* no free exch id */
436 u64 fc_xid_not_found; /* exch not found for a response */
437 u64 fc_xid_busy; /* exch exist for new a request */
438 u64 fc_seq_not_found; /* seq is not found for exchange */
439 u64 fc_non_bls_resp; /* a non BLS response frame with
440 a sequence responder in new exch */
429}; 441};
430 442
431 443