aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-03-18 04:40:14 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-03-21 14:07:05 -0500
commit30afc84cf7325e88fb9746340eba3c161080ff49 (patch)
tree829ea31d6ab095bd7a35651cd6018205a2b21d11
parentd04cdb64212eb5ae6a98026a97dda626e40e8e9a (diff)
[SCSI] libata: implement minimal transport template for ->eh_timed_out
SCSI midlayer has moved hostt->eh_timed_out to transport template. As libata doesn't need full-blown transport support yet, implement minimal transport for libata. No transport class or whatsoever, just empty transport template with ->eh_timed_out hook. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r--drivers/scsi/ahci.c1
-rw-r--r--drivers/scsi/ata_piix.c1
-rw-r--r--drivers/scsi/libata-core.c3
-rw-r--r--drivers/scsi/libata-scsi.c10
-rw-r--r--drivers/scsi/libata.h2
-rw-r--r--drivers/scsi/pdc_adma.c1
-rw-r--r--drivers/scsi/sata_mv.c1
-rw-r--r--drivers/scsi/sata_nv.c1
-rw-r--r--drivers/scsi/sata_promise.c1
-rw-r--r--drivers/scsi/sata_qstor.c1
-rw-r--r--drivers/scsi/sata_sil.c1
-rw-r--r--drivers/scsi/sata_sil24.c1
-rw-r--r--drivers/scsi/sata_sis.c1
-rw-r--r--drivers/scsi/sata_svw.c1
-rw-r--r--drivers/scsi/sata_sx4.c1
-rw-r--r--drivers/scsi/sata_uli.c1
-rw-r--r--drivers/scsi/sata_via.c1
-rw-r--r--drivers/scsi/sata_vsc.c1
-rw-r--r--include/linux/libata.h1
19 files changed, 14 insertions, 17 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index e97ab3e6de4..a1ddbba2cbd 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -207,7 +207,6 @@ static struct scsi_host_template ahci_sht = {
207 .name = DRV_NAME, 207 .name = DRV_NAME,
208 .ioctl = ata_scsi_ioctl, 208 .ioctl = ata_scsi_ioctl,
209 .queuecommand = ata_scsi_queuecmd, 209 .queuecommand = ata_scsi_queuecmd,
210 .eh_timed_out = ata_scsi_timed_out,
211 .eh_strategy_handler = ata_scsi_error, 210 .eh_strategy_handler = ata_scsi_error,
212 .can_queue = ATA_DEF_QUEUE, 211 .can_queue = ATA_DEF_QUEUE,
213 .this_id = ATA_SHT_THIS_ID, 212 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 9327b62f97d..a74e23d39ba 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -209,7 +209,6 @@ static struct scsi_host_template piix_sht = {
209 .name = DRV_NAME, 209 .name = DRV_NAME,
210 .ioctl = ata_scsi_ioctl, 210 .ioctl = ata_scsi_ioctl,
211 .queuecommand = ata_scsi_queuecmd, 211 .queuecommand = ata_scsi_queuecmd,
212 .eh_timed_out = ata_scsi_timed_out,
213 .eh_strategy_handler = ata_scsi_error, 212 .eh_strategy_handler = ata_scsi_error,
214 .can_queue = ATA_DEF_QUEUE, 213 .can_queue = ATA_DEF_QUEUE,
215 .this_id = ATA_SHT_THIS_ID, 214 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 714b42bad93..64dce00e9c4 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4653,6 +4653,8 @@ static struct ata_port * ata_host_add(const struct ata_probe_ent *ent,
4653 if (!host) 4653 if (!host)
4654 return NULL; 4654 return NULL;
4655 4655
4656 host->transportt = &ata_scsi_transport_template;
4657
4656 ap = (struct ata_port *) &host->hostdata[0]; 4658 ap = (struct ata_port *) &host->hostdata[0];
4657 4659
4658 ata_host_init(ap, host, host_set, ent, port_no); 4660 ata_host_init(ap, host, host_set, ent, port_no);
@@ -5084,7 +5086,6 @@ EXPORT_SYMBOL_GPL(ata_busy_sleep);
5084EXPORT_SYMBOL_GPL(ata_port_queue_task); 5086EXPORT_SYMBOL_GPL(ata_port_queue_task);
5085EXPORT_SYMBOL_GPL(ata_scsi_ioctl); 5087EXPORT_SYMBOL_GPL(ata_scsi_ioctl);
5086EXPORT_SYMBOL_GPL(ata_scsi_queuecmd); 5088EXPORT_SYMBOL_GPL(ata_scsi_queuecmd);
5087EXPORT_SYMBOL_GPL(ata_scsi_timed_out);
5088EXPORT_SYMBOL_GPL(ata_scsi_error); 5089EXPORT_SYMBOL_GPL(ata_scsi_error);
5089EXPORT_SYMBOL_GPL(ata_scsi_slave_config); 5090EXPORT_SYMBOL_GPL(ata_scsi_slave_config);
5090EXPORT_SYMBOL_GPL(ata_scsi_release); 5091EXPORT_SYMBOL_GPL(ata_scsi_release);
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index ccedb453697..bd9f2176f79 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -41,6 +41,7 @@
41#include <scsi/scsi_eh.h> 41#include <scsi/scsi_eh.h>
42#include <scsi/scsi_device.h> 42#include <scsi/scsi_device.h>
43#include <scsi/scsi_request.h> 43#include <scsi/scsi_request.h>
44#include <scsi/scsi_transport.h>
44#include <linux/libata.h> 45#include <linux/libata.h>
45#include <linux/hdreg.h> 46#include <linux/hdreg.h>
46#include <asm/uaccess.h> 47#include <asm/uaccess.h>
@@ -52,6 +53,7 @@
52typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, const u8 *scsicmd); 53typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc, const u8 *scsicmd);
53static struct ata_device * 54static struct ata_device *
54ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev); 55ata_scsi_find_dev(struct ata_port *ap, const struct scsi_device *scsidev);
56enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd);
55 57
56#define RW_RECOVERY_MPAGE 0x1 58#define RW_RECOVERY_MPAGE 0x1
57#define RW_RECOVERY_MPAGE_LEN 12 59#define RW_RECOVERY_MPAGE_LEN 12
@@ -92,6 +94,14 @@ static const u8 def_control_mpage[CONTROL_MPAGE_LEN] = {
92 0, 30 /* extended self test time, see 05-359r1 */ 94 0, 30 /* extended self test time, see 05-359r1 */
93}; 95};
94 96
97/*
98 * libata transport template. libata doesn't do real transport stuff.
99 * It just needs the eh_timed_out hook.
100 */
101struct scsi_transport_template ata_scsi_transport_template = {
102 .eh_timed_out = ata_scsi_timed_out,
103};
104
95 105
96static void ata_scsi_invalid_field(struct scsi_cmnd *cmd, 106static void ata_scsi_invalid_field(struct scsi_cmnd *cmd,
97 void (*done)(struct scsi_cmnd *)) 107 void (*done)(struct scsi_cmnd *))
diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h
index f4c48c91b63..65f52beea88 100644
--- a/drivers/scsi/libata.h
+++ b/drivers/scsi/libata.h
@@ -57,6 +57,8 @@ extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
57 57
58 58
59/* libata-scsi.c */ 59/* libata-scsi.c */
60extern struct scsi_transport_template ata_scsi_transport_template;
61
60extern void ata_scsi_scan_host(struct ata_port *ap); 62extern void ata_scsi_scan_host(struct ata_port *ap);
61extern int ata_scsi_error(struct Scsi_Host *host); 63extern int ata_scsi_error(struct Scsi_Host *host);
62extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf, 64extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf,
diff --git a/drivers/scsi/pdc_adma.c b/drivers/scsi/pdc_adma.c
index 5f33cc932e7..b3dc5f85ae0 100644
--- a/drivers/scsi/pdc_adma.c
+++ b/drivers/scsi/pdc_adma.c
@@ -143,7 +143,6 @@ static struct scsi_host_template adma_ata_sht = {
143 .name = DRV_NAME, 143 .name = DRV_NAME,
144 .ioctl = ata_scsi_ioctl, 144 .ioctl = ata_scsi_ioctl,
145 .queuecommand = ata_scsi_queuecmd, 145 .queuecommand = ata_scsi_queuecmd,
146 .eh_timed_out = ata_scsi_timed_out,
147 .eh_strategy_handler = ata_scsi_error, 146 .eh_strategy_handler = ata_scsi_error,
148 .can_queue = ATA_DEF_QUEUE, 147 .can_queue = ATA_DEF_QUEUE,
149 .this_id = ATA_SHT_THIS_ID, 148 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
index e561281967d..874c5be0843 100644
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -378,7 +378,6 @@ static struct scsi_host_template mv_sht = {
378 .name = DRV_NAME, 378 .name = DRV_NAME,
379 .ioctl = ata_scsi_ioctl, 379 .ioctl = ata_scsi_ioctl,
380 .queuecommand = ata_scsi_queuecmd, 380 .queuecommand = ata_scsi_queuecmd,
381 .eh_timed_out = ata_scsi_timed_out,
382 .eh_strategy_handler = ata_scsi_error, 381 .eh_strategy_handler = ata_scsi_error,
383 .can_queue = MV_USE_Q_DEPTH, 382 .can_queue = MV_USE_Q_DEPTH,
384 .this_id = ATA_SHT_THIS_ID, 383 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c
index caffadc2e0a..e5b20c6afc1 100644
--- a/drivers/scsi/sata_nv.c
+++ b/drivers/scsi/sata_nv.c
@@ -229,7 +229,6 @@ static struct scsi_host_template nv_sht = {
229 .name = DRV_NAME, 229 .name = DRV_NAME,
230 .ioctl = ata_scsi_ioctl, 230 .ioctl = ata_scsi_ioctl,
231 .queuecommand = ata_scsi_queuecmd, 231 .queuecommand = ata_scsi_queuecmd,
232 .eh_timed_out = ata_scsi_timed_out,
233 .eh_strategy_handler = ata_scsi_error, 232 .eh_strategy_handler = ata_scsi_error,
234 .can_queue = ATA_DEF_QUEUE, 233 .can_queue = ATA_DEF_QUEUE,
235 .this_id = ATA_SHT_THIS_ID, 234 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c
index 84cb3940ad8..cc928c68a47 100644
--- a/drivers/scsi/sata_promise.c
+++ b/drivers/scsi/sata_promise.c
@@ -111,7 +111,6 @@ static struct scsi_host_template pdc_ata_sht = {
111 .name = DRV_NAME, 111 .name = DRV_NAME,
112 .ioctl = ata_scsi_ioctl, 112 .ioctl = ata_scsi_ioctl,
113 .queuecommand = ata_scsi_queuecmd, 113 .queuecommand = ata_scsi_queuecmd,
114 .eh_timed_out = ata_scsi_timed_out,
115 .eh_strategy_handler = ata_scsi_error, 114 .eh_strategy_handler = ata_scsi_error,
116 .can_queue = ATA_DEF_QUEUE, 115 .can_queue = ATA_DEF_QUEUE,
117 .this_id = ATA_SHT_THIS_ID, 116 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c
index 9602f43a298..9ffe1ef0d20 100644
--- a/drivers/scsi/sata_qstor.c
+++ b/drivers/scsi/sata_qstor.c
@@ -132,7 +132,6 @@ static struct scsi_host_template qs_ata_sht = {
132 .name = DRV_NAME, 132 .name = DRV_NAME,
133 .ioctl = ata_scsi_ioctl, 133 .ioctl = ata_scsi_ioctl,
134 .queuecommand = ata_scsi_queuecmd, 134 .queuecommand = ata_scsi_queuecmd,
135 .eh_timed_out = ata_scsi_timed_out,
136 .eh_strategy_handler = ata_scsi_error, 135 .eh_strategy_handler = ata_scsi_error,
137 .can_queue = ATA_DEF_QUEUE, 136 .can_queue = ATA_DEF_QUEUE,
138 .this_id = ATA_SHT_THIS_ID, 137 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
index 4f2a67ed39d..3e75d673323 100644
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -146,7 +146,6 @@ static struct scsi_host_template sil_sht = {
146 .name = DRV_NAME, 146 .name = DRV_NAME,
147 .ioctl = ata_scsi_ioctl, 147 .ioctl = ata_scsi_ioctl,
148 .queuecommand = ata_scsi_queuecmd, 148 .queuecommand = ata_scsi_queuecmd,
149 .eh_timed_out = ata_scsi_timed_out,
150 .eh_strategy_handler = ata_scsi_error, 149 .eh_strategy_handler = ata_scsi_error,
151 .can_queue = ATA_DEF_QUEUE, 150 .can_queue = ATA_DEF_QUEUE,
152 .this_id = ATA_SHT_THIS_ID, 151 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index 9a53a5ed38c..5d01e5ce5ac 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -281,7 +281,6 @@ static struct scsi_host_template sil24_sht = {
281 .name = DRV_NAME, 281 .name = DRV_NAME,
282 .ioctl = ata_scsi_ioctl, 282 .ioctl = ata_scsi_ioctl,
283 .queuecommand = ata_scsi_queuecmd, 283 .queuecommand = ata_scsi_queuecmd,
284 .eh_timed_out = ata_scsi_timed_out,
285 .eh_strategy_handler = ata_scsi_error, 284 .eh_strategy_handler = ata_scsi_error,
286 .can_queue = ATA_DEF_QUEUE, 285 .can_queue = ATA_DEF_QUEUE,
287 .this_id = ATA_SHT_THIS_ID, 286 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c
index 7fd45f86de9..acc8439dea2 100644
--- a/drivers/scsi/sata_sis.c
+++ b/drivers/scsi/sata_sis.c
@@ -87,7 +87,6 @@ static struct scsi_host_template sis_sht = {
87 .name = DRV_NAME, 87 .name = DRV_NAME,
88 .ioctl = ata_scsi_ioctl, 88 .ioctl = ata_scsi_ioctl,
89 .queuecommand = ata_scsi_queuecmd, 89 .queuecommand = ata_scsi_queuecmd,
90 .eh_timed_out = ata_scsi_timed_out,
91 .eh_strategy_handler = ata_scsi_error, 90 .eh_strategy_handler = ata_scsi_error,
92 .can_queue = ATA_DEF_QUEUE, 91 .can_queue = ATA_DEF_QUEUE,
93 .this_id = ATA_SHT_THIS_ID, 92 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c
index 4aaccd53e73..051e47d975c 100644
--- a/drivers/scsi/sata_svw.c
+++ b/drivers/scsi/sata_svw.c
@@ -288,7 +288,6 @@ static struct scsi_host_template k2_sata_sht = {
288 .name = DRV_NAME, 288 .name = DRV_NAME,
289 .ioctl = ata_scsi_ioctl, 289 .ioctl = ata_scsi_ioctl,
290 .queuecommand = ata_scsi_queuecmd, 290 .queuecommand = ata_scsi_queuecmd,
291 .eh_timed_out = ata_scsi_timed_out,
292 .eh_strategy_handler = ata_scsi_error, 291 .eh_strategy_handler = ata_scsi_error,
293 .can_queue = ATA_DEF_QUEUE, 292 .can_queue = ATA_DEF_QUEUE,
294 .this_id = ATA_SHT_THIS_ID, 293 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c
index 9f8a7681540..ae70f60c7c0 100644
--- a/drivers/scsi/sata_sx4.c
+++ b/drivers/scsi/sata_sx4.c
@@ -182,7 +182,6 @@ static struct scsi_host_template pdc_sata_sht = {
182 .name = DRV_NAME, 182 .name = DRV_NAME,
183 .ioctl = ata_scsi_ioctl, 183 .ioctl = ata_scsi_ioctl,
184 .queuecommand = ata_scsi_queuecmd, 184 .queuecommand = ata_scsi_queuecmd,
185 .eh_timed_out = ata_scsi_timed_out,
186 .eh_strategy_handler = ata_scsi_error, 185 .eh_strategy_handler = ata_scsi_error,
187 .can_queue = ATA_DEF_QUEUE, 186 .can_queue = ATA_DEF_QUEUE,
188 .this_id = ATA_SHT_THIS_ID, 187 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_uli.c b/drivers/scsi/sata_uli.c
index 37a487b7d65..8f5025733de 100644
--- a/drivers/scsi/sata_uli.c
+++ b/drivers/scsi/sata_uli.c
@@ -75,7 +75,6 @@ static struct scsi_host_template uli_sht = {
75 .name = DRV_NAME, 75 .name = DRV_NAME,
76 .ioctl = ata_scsi_ioctl, 76 .ioctl = ata_scsi_ioctl,
77 .queuecommand = ata_scsi_queuecmd, 77 .queuecommand = ata_scsi_queuecmd,
78 .eh_timed_out = ata_scsi_timed_out,
79 .eh_strategy_handler = ata_scsi_error, 78 .eh_strategy_handler = ata_scsi_error,
80 .can_queue = ATA_DEF_QUEUE, 79 .can_queue = ATA_DEF_QUEUE,
81 .this_id = ATA_SHT_THIS_ID, 80 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_via.c b/drivers/scsi/sata_via.c
index ff65a0b0457..791bf652ba6 100644
--- a/drivers/scsi/sata_via.c
+++ b/drivers/scsi/sata_via.c
@@ -94,7 +94,6 @@ static struct scsi_host_template svia_sht = {
94 .name = DRV_NAME, 94 .name = DRV_NAME,
95 .ioctl = ata_scsi_ioctl, 95 .ioctl = ata_scsi_ioctl,
96 .queuecommand = ata_scsi_queuecmd, 96 .queuecommand = ata_scsi_queuecmd,
97 .eh_timed_out = ata_scsi_timed_out,
98 .eh_strategy_handler = ata_scsi_error, 97 .eh_strategy_handler = ata_scsi_error,
99 .can_queue = ATA_DEF_QUEUE, 98 .can_queue = ATA_DEF_QUEUE,
100 .this_id = ATA_SHT_THIS_ID, 99 .this_id = ATA_SHT_THIS_ID,
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c
index b574379a7a8..ee75b9b38ae 100644
--- a/drivers/scsi/sata_vsc.c
+++ b/drivers/scsi/sata_vsc.c
@@ -251,7 +251,6 @@ static struct scsi_host_template vsc_sata_sht = {
251 .name = DRV_NAME, 251 .name = DRV_NAME,
252 .ioctl = ata_scsi_ioctl, 252 .ioctl = ata_scsi_ioctl,
253 .queuecommand = ata_scsi_queuecmd, 253 .queuecommand = ata_scsi_queuecmd,
254 .eh_timed_out = ata_scsi_timed_out,
255 .eh_strategy_handler = ata_scsi_error, 254 .eh_strategy_handler = ata_scsi_error,
256 .can_queue = ATA_DEF_QUEUE, 255 .can_queue = ATA_DEF_QUEUE,
257 .this_id = ATA_SHT_THIS_ID, 256 .this_id = ATA_SHT_THIS_ID,
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 239408ecfdd..204c37a55f0 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -508,7 +508,6 @@ extern void ata_host_set_remove(struct ata_host_set *host_set);
508extern int ata_scsi_detect(struct scsi_host_template *sht); 508extern int ata_scsi_detect(struct scsi_host_template *sht);
509extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 509extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
510extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 510extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
511extern enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd);
512extern int ata_scsi_error(struct Scsi_Host *host); 511extern int ata_scsi_error(struct Scsi_Host *host);
513extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); 512extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
514extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); 513extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);