aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/ata.h34
-rw-r--r--include/linux/libata.h386
-rw-r--r--include/linux/pci_ids.h4
-rw-r--r--include/scsi/scsi_cmnd.h1
-rw-r--r--include/scsi/scsi_host.h1
5 files changed, 311 insertions, 115 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 312a2c0c64e6..c494e1c0531e 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -97,6 +97,9 @@ enum {
97 ATA_DRQ = (1 << 3), /* data request i/o */ 97 ATA_DRQ = (1 << 3), /* data request i/o */
98 ATA_ERR = (1 << 0), /* have an error */ 98 ATA_ERR = (1 << 0), /* have an error */
99 ATA_SRST = (1 << 2), /* software reset */ 99 ATA_SRST = (1 << 2), /* software reset */
100 ATA_ICRC = (1 << 7), /* interface CRC error */
101 ATA_UNC = (1 << 6), /* uncorrectable media error */
102 ATA_IDNF = (1 << 4), /* ID not found */
100 ATA_ABORTED = (1 << 2), /* command aborted */ 103 ATA_ABORTED = (1 << 2), /* command aborted */
101 104
102 /* ATA command block registers */ 105 /* ATA command block registers */
@@ -130,6 +133,8 @@ enum {
130 ATA_CMD_WRITE = 0xCA, 133 ATA_CMD_WRITE = 0xCA,
131 ATA_CMD_WRITE_EXT = 0x35, 134 ATA_CMD_WRITE_EXT = 0x35,
132 ATA_CMD_WRITE_FUA_EXT = 0x3D, 135 ATA_CMD_WRITE_FUA_EXT = 0x3D,
136 ATA_CMD_FPDMA_READ = 0x60,
137 ATA_CMD_FPDMA_WRITE = 0x61,
133 ATA_CMD_PIO_READ = 0x20, 138 ATA_CMD_PIO_READ = 0x20,
134 ATA_CMD_PIO_READ_EXT = 0x24, 139 ATA_CMD_PIO_READ_EXT = 0x24,
135 ATA_CMD_PIO_WRITE = 0x30, 140 ATA_CMD_PIO_WRITE = 0x30,
@@ -148,6 +153,10 @@ enum {
148 ATA_CMD_INIT_DEV_PARAMS = 0x91, 153 ATA_CMD_INIT_DEV_PARAMS = 0x91,
149 ATA_CMD_READ_NATIVE_MAX = 0xF8, 154 ATA_CMD_READ_NATIVE_MAX = 0xF8,
150 ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, 155 ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
156 ATA_CMD_READ_LOG_EXT = 0x2f,
157
158 /* READ_LOG_EXT pages */
159 ATA_LOG_SATA_NCQ = 0x10,
151 160
152 /* SETFEATURES stuff */ 161 /* SETFEATURES stuff */
153 SETFEATURES_XFER = 0x03, 162 SETFEATURES_XFER = 0x03,
@@ -192,6 +201,16 @@ enum {
192 SCR_ACTIVE = 3, 201 SCR_ACTIVE = 3,
193 SCR_NOTIFICATION = 4, 202 SCR_NOTIFICATION = 4,
194 203
204 /* SError bits */
205 SERR_DATA_RECOVERED = (1 << 0), /* recovered data error */
206 SERR_COMM_RECOVERED = (1 << 1), /* recovered comm failure */
207 SERR_DATA = (1 << 8), /* unrecovered data error */
208 SERR_PERSISTENT = (1 << 9), /* persistent data/comm error */
209 SERR_PROTOCOL = (1 << 10), /* protocol violation */
210 SERR_INTERNAL = (1 << 11), /* host internal error */
211 SERR_PHYRDY_CHG = (1 << 16), /* PHY RDY changed */
212 SERR_DEV_XCHG = (1 << 26), /* device exchanged */
213
195 /* struct ata_taskfile flags */ 214 /* struct ata_taskfile flags */
196 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */ 215 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */
197 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ 216 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
@@ -199,6 +218,7 @@ enum {
199 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 218 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
200 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ 219 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
201 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */ 220 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
221 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
202}; 222};
203 223
204enum ata_tf_protocols { 224enum ata_tf_protocols {
@@ -207,6 +227,7 @@ enum ata_tf_protocols {
207 ATA_PROT_NODATA, /* no data */ 227 ATA_PROT_NODATA, /* no data */
208 ATA_PROT_PIO, /* PIO single sector */ 228 ATA_PROT_PIO, /* PIO single sector */
209 ATA_PROT_DMA, /* DMA */ 229 ATA_PROT_DMA, /* DMA */
230 ATA_PROT_NCQ, /* NCQ */
210 ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ 231 ATA_PROT_ATAPI, /* packet command, PIO data xfer*/
211 ATA_PROT_ATAPI_NODATA, /* packet command, no data */ 232 ATA_PROT_ATAPI_NODATA, /* packet command, no data */
212 ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */ 233 ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */
@@ -262,6 +283,8 @@ struct ata_taskfile {
262#define ata_id_has_pm(id) ((id)[82] & (1 << 3)) 283#define ata_id_has_pm(id) ((id)[82] & (1 << 3))
263#define ata_id_has_lba(id) ((id)[49] & (1 << 9)) 284#define ata_id_has_lba(id) ((id)[49] & (1 << 9))
264#define ata_id_has_dma(id) ((id)[49] & (1 << 8)) 285#define ata_id_has_dma(id) ((id)[49] & (1 << 8))
286#define ata_id_has_ncq(id) ((id)[76] & (1 << 8))
287#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1)
265#define ata_id_removeable(id) ((id)[0] & (1 << 7)) 288#define ata_id_removeable(id) ((id)[0] & (1 << 7))
266#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) 289#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0))
267#define ata_id_u32(id,n) \ 290#define ata_id_u32(id,n) \
@@ -272,6 +295,8 @@ struct ata_taskfile {
272 ((u64) (id)[(n) + 1] << 16) | \ 295 ((u64) (id)[(n) + 1] << 16) | \
273 ((u64) (id)[(n) + 0]) ) 296 ((u64) (id)[(n) + 0]) )
274 297
298#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
299
275static inline unsigned int ata_id_major_version(const u16 *id) 300static inline unsigned int ata_id_major_version(const u16 *id)
276{ 301{
277 unsigned int mver; 302 unsigned int mver;
@@ -311,6 +336,15 @@ static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
311 (tf->protocol == ATA_PROT_ATAPI_DMA); 336 (tf->protocol == ATA_PROT_ATAPI_DMA);
312} 337}
313 338
339static inline int is_multi_taskfile(struct ata_taskfile *tf)
340{
341 return (tf->command == ATA_CMD_READ_MULTI) ||
342 (tf->command == ATA_CMD_WRITE_MULTI) ||
343 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
344 (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
345 (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
346}
347
314static inline int ata_ok(u8 status) 348static inline int ata_ok(u8 status)
315{ 349{
316 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) 350 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b80d2e7fa6d2..9c60b4a4e2fd 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -33,6 +33,7 @@
33#include <asm/io.h> 33#include <asm/io.h>
34#include <linux/ata.h> 34#include <linux/ata.h>
35#include <linux/workqueue.h> 35#include <linux/workqueue.h>
36#include <scsi/scsi_host.h>
36 37
37/* 38/*
38 * compile-time options: to be removed as soon as all the drivers are 39 * compile-time options: to be removed as soon as all the drivers are
@@ -44,7 +45,6 @@
44#undef ATA_NDEBUG /* define to disable quick runtime checks */ 45#undef ATA_NDEBUG /* define to disable quick runtime checks */
45#undef ATA_ENABLE_PATA /* define to enable PATA support in some 46#undef ATA_ENABLE_PATA /* define to enable PATA support in some
46 * low-level drivers */ 47 * low-level drivers */
47#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
48 48
49 49
50/* note: prints function name for you */ 50/* note: prints function name for you */
@@ -108,8 +108,11 @@ enum {
108 LIBATA_MAX_PRD = ATA_MAX_PRD / 2, 108 LIBATA_MAX_PRD = ATA_MAX_PRD / 2,
109 ATA_MAX_PORTS = 8, 109 ATA_MAX_PORTS = 8,
110 ATA_DEF_QUEUE = 1, 110 ATA_DEF_QUEUE = 1,
111 ATA_MAX_QUEUE = 1, 111 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */
112 ATA_MAX_QUEUE = 32,
113 ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1,
112 ATA_MAX_SECTORS = 200, /* FIXME */ 114 ATA_MAX_SECTORS = 200, /* FIXME */
115 ATA_MAX_SECTORS_LBA48 = 65535,
113 ATA_MAX_BUS = 2, 116 ATA_MAX_BUS = 2,
114 ATA_DEF_BUSY_WAIT = 10000, 117 ATA_DEF_BUSY_WAIT = 10000,
115 ATA_SHORT_PAUSE = (HZ >> 6) + 1, 118 ATA_SHORT_PAUSE = (HZ >> 6) + 1,
@@ -120,9 +123,13 @@ enum {
120 ATA_SHT_USE_CLUSTERING = 1, 123 ATA_SHT_USE_CLUSTERING = 1,
121 124
122 /* struct ata_device stuff */ 125 /* struct ata_device stuff */
123 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ 126 ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */
124 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ 127 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */
125 ATA_DFLAG_LBA = (1 << 2), /* device supports LBA */ 128 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */
129 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */
130 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
131
132 ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */
126 133
127 ATA_DEV_UNKNOWN = 0, /* unknown device */ 134 ATA_DEV_UNKNOWN = 0, /* unknown device */
128 ATA_DEV_ATA = 1, /* ATA device */ 135 ATA_DEV_ATA = 1, /* ATA device */
@@ -132,43 +139,50 @@ enum {
132 ATA_DEV_NONE = 5, /* no device */ 139 ATA_DEV_NONE = 5, /* no device */
133 140
134 /* struct ata_port flags */ 141 /* struct ata_port flags */
135 ATA_FLAG_SLAVE_POSS = (1 << 1), /* host supports slave dev */ 142 ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */
136 /* (doesn't imply presence) */ 143 /* (doesn't imply presence) */
137 ATA_FLAG_PORT_DISABLED = (1 << 2), /* port is disabled, ignore it */ 144 ATA_FLAG_SATA = (1 << 1),
138 ATA_FLAG_SATA = (1 << 3), 145 ATA_FLAG_NO_LEGACY = (1 << 2), /* no legacy mode check */
139 ATA_FLAG_NO_LEGACY = (1 << 4), /* no legacy mode check */ 146 ATA_FLAG_MMIO = (1 << 3), /* use MMIO, not PIO */
140 ATA_FLAG_SRST = (1 << 5), /* (obsolete) use ATA SRST, not E.D.D. */ 147 ATA_FLAG_SRST = (1 << 4), /* (obsolete) use ATA SRST, not E.D.D. */
141 ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ 148 ATA_FLAG_SATA_RESET = (1 << 5), /* (obsolete) use COMRESET */
142 ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */ 149 ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */
143 ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ 150 ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */
144 ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once 151 ATA_FLAG_PIO_LBA48 = (1 << 8), /* Host DMA engine is LBA28 only */
145 * proper HSM is in place. */ 152 ATA_FLAG_PIO_POLLING = (1 << 10), /* use polling PIO if LLD
146 ATA_FLAG_DEBUGMSG = (1 << 10), 153 * doesn't handle PIO interrupts */
147 ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */ 154 ATA_FLAG_NCQ = (1 << 11), /* host supports NCQ */
148 155
149 ATA_FLAG_SUSPENDED = (1 << 12), /* port is suspended */ 156 ATA_FLAG_DEBUGMSG = (1 << 14),
150 157 ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* flush port task */
151 ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ 158
152 ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ 159 ATA_FLAG_EH_PENDING = (1 << 16), /* EH pending */
153 160 ATA_FLAG_FROZEN = (1 << 17), /* port is frozen */
154 ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* Flush port task */ 161 ATA_FLAG_RECOVERED = (1 << 18), /* recovery action performed */
155 ATA_FLAG_IN_EH = (1 << 16), /* EH in progress */ 162
156 163 ATA_FLAG_DISABLED = (1 << 22), /* port is disabled, ignore it */
157 ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ 164 ATA_FLAG_SUSPENDED = (1 << 23), /* port is suspended (power) */
158 ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ 165
159 ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ 166 /* bits 24:31 of ap->flags are reserved for LLDD specific flags */
167
168 /* struct ata_queued_cmd flags */
169 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */
170 ATA_QCFLAG_SG = (1 << 1), /* have s/g table? */
171 ATA_QCFLAG_SINGLE = (1 << 2), /* no s/g, just a single buffer */
160 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, 172 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE,
161 ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ 173 ATA_QCFLAG_IO = (1 << 3), /* standard IO command */
174 ATA_QCFLAG_RESULT_TF = (1 << 4), /* result TF requested */
175
176 ATA_QCFLAG_FAILED = (1 << 16), /* cmd failed and is owned by EH */
177 ATA_QCFLAG_SENSE_VALID = (1 << 17), /* sense data valid */
178 ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */
162 179
163 /* host set flags */ 180 /* host set flags */
164 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ 181 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */
165 182
166 /* various lengths of time */ 183 /* various lengths of time */
167 ATA_TMOUT_PIO = 30 * HZ,
168 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 184 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
169 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ 185 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
170 ATA_TMOUT_CDB = 30 * HZ,
171 ATA_TMOUT_CDB_QUICK = 5 * HZ,
172 ATA_TMOUT_INTERNAL = 30 * HZ, 186 ATA_TMOUT_INTERNAL = 30 * HZ,
173 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ, 187 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ,
174 188
@@ -207,21 +221,44 @@ enum {
207 /* size of buffer to pad xfers ending on unaligned boundaries */ 221 /* size of buffer to pad xfers ending on unaligned boundaries */
208 ATA_DMA_PAD_SZ = 4, 222 ATA_DMA_PAD_SZ = 4,
209 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE, 223 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE,
210 224
211 /* Masks for port functions */ 225 /* masks for port functions */
212 ATA_PORT_PRIMARY = (1 << 0), 226 ATA_PORT_PRIMARY = (1 << 0),
213 ATA_PORT_SECONDARY = (1 << 1), 227 ATA_PORT_SECONDARY = (1 << 1),
228
229 /* ering size */
230 ATA_ERING_SIZE = 32,
231
232 /* desc_len for ata_eh_info and context */
233 ATA_EH_DESC_LEN = 80,
234
235 /* reset / recovery action types */
236 ATA_EH_REVALIDATE = (1 << 0),
237 ATA_EH_SOFTRESET = (1 << 1),
238 ATA_EH_HARDRESET = (1 << 2),
239
240 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
241
242 /* ata_eh_info->flags */
243 ATA_EHI_DID_RESET = (1 << 0), /* already reset this port */
244
245 /* max repeat if error condition is still set after ->error_handler */
246 ATA_EH_MAX_REPEAT = 5,
247
248 /* how hard are we gonna try to probe/recover devices */
249 ATA_PROBE_MAX_TRIES = 3,
250 ATA_EH_RESET_TRIES = 3,
251 ATA_EH_DEV_TRIES = 3,
214}; 252};
215 253
216enum hsm_task_states { 254enum hsm_task_states {
217 HSM_ST_UNKNOWN, 255 HSM_ST_UNKNOWN, /* state unknown */
218 HSM_ST_IDLE, 256 HSM_ST_IDLE, /* no command on going */
219 HSM_ST_POLL, 257 HSM_ST, /* (waiting the device to) transfer data */
220 HSM_ST_TMOUT, 258 HSM_ST_LAST, /* (waiting the device to) complete command */
221 HSM_ST, 259 HSM_ST_ERR, /* error */
222 HSM_ST_LAST, 260 HSM_ST_FIRST, /* (waiting the device to)
223 HSM_ST_LAST_POLL, 261 write CDB or first data block */
224 HSM_ST_ERR,
225}; 262};
226 263
227enum ata_completion_errors { 264enum ata_completion_errors {
@@ -245,7 +282,7 @@ struct ata_queued_cmd;
245/* typedefs */ 282/* typedefs */
246typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc); 283typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
247typedef void (*ata_probeinit_fn_t)(struct ata_port *); 284typedef void (*ata_probeinit_fn_t)(struct ata_port *);
248typedef int (*ata_reset_fn_t)(struct ata_port *, int, unsigned int *); 285typedef int (*ata_reset_fn_t)(struct ata_port *, unsigned int *);
249typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *); 286typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *);
250 287
251struct ata_ioports { 288struct ata_ioports {
@@ -336,7 +373,7 @@ struct ata_queued_cmd {
336 struct scatterlist *__sg; 373 struct scatterlist *__sg;
337 374
338 unsigned int err_mask; 375 unsigned int err_mask;
339 376 struct ata_taskfile result_tf;
340 ata_qc_cb_t complete_fn; 377 ata_qc_cb_t complete_fn;
341 378
342 void *private_data; 379 void *private_data;
@@ -348,12 +385,24 @@ struct ata_host_stats {
348 unsigned long rw_reqbuf; 385 unsigned long rw_reqbuf;
349}; 386};
350 387
388struct ata_ering_entry {
389 int is_io;
390 unsigned int err_mask;
391 u64 timestamp;
392};
393
394struct ata_ering {
395 int cursor;
396 struct ata_ering_entry ring[ATA_ERING_SIZE];
397};
398
351struct ata_device { 399struct ata_device {
400 struct ata_port *ap;
352 u64 n_sectors; /* size of device, if ATA */ 401 u64 n_sectors; /* size of device, if ATA */
353 unsigned long flags; /* ATA_DFLAG_xxx */ 402 unsigned long flags; /* ATA_DFLAG_xxx */
354 unsigned int class; /* ATA_DEV_xxx */ 403 unsigned int class; /* ATA_DEV_xxx */
355 unsigned int devno; /* 0 or 1 */ 404 unsigned int devno; /* 0 or 1 */
356 u16 *id; /* IDENTIFY xxx DEVICE data */ 405 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
357 u8 pio_mode; 406 u8 pio_mode;
358 u8 dma_mode; 407 u8 dma_mode;
359 u8 xfer_mode; 408 u8 xfer_mode;
@@ -373,6 +422,24 @@ struct ata_device {
373 u16 cylinders; /* Number of cylinders */ 422 u16 cylinders; /* Number of cylinders */
374 u16 heads; /* Number of heads */ 423 u16 heads; /* Number of heads */
375 u16 sectors; /* Number of sectors per track */ 424 u16 sectors; /* Number of sectors per track */
425
426 /* error history */
427 struct ata_ering ering;
428};
429
430struct ata_eh_info {
431 struct ata_device *dev; /* offending device */
432 u32 serror; /* SError from LLDD */
433 unsigned int err_mask; /* port-wide err_mask */
434 unsigned int action; /* ATA_EH_* action mask */
435 unsigned int flags; /* ATA_EHI_* flags */
436 char desc[ATA_EH_DESC_LEN];
437 int desc_len;
438};
439
440struct ata_eh_context {
441 struct ata_eh_info i;
442 int tries[ATA_MAX_DEVICES];
376}; 443};
377 444
378struct ata_port { 445struct ata_port {
@@ -397,12 +464,21 @@ struct ata_port {
397 unsigned int mwdma_mask; 464 unsigned int mwdma_mask;
398 unsigned int udma_mask; 465 unsigned int udma_mask;
399 unsigned int cbl; /* cable type; ATA_CBL_xxx */ 466 unsigned int cbl; /* cable type; ATA_CBL_xxx */
467 unsigned int sata_spd_limit; /* SATA PHY speed limit */
468
469 /* record runtime error info, protected by host_set lock */
470 struct ata_eh_info eh_info;
471 /* EH context owned by EH */
472 struct ata_eh_context eh_context;
400 473
401 struct ata_device device[ATA_MAX_DEVICES]; 474 struct ata_device device[ATA_MAX_DEVICES];
402 475
403 struct ata_queued_cmd qcmd[ATA_MAX_QUEUE]; 476 struct ata_queued_cmd qcmd[ATA_MAX_QUEUE];
404 unsigned long qactive; 477 unsigned long qc_allocated;
478 unsigned int qc_active;
479
405 unsigned int active_tag; 480 unsigned int active_tag;
481 u32 sactive;
406 482
407 struct ata_host_stats stats; 483 struct ata_host_stats stats;
408 struct ata_host_set *host_set; 484 struct ata_host_set *host_set;
@@ -411,12 +487,13 @@ struct ata_port {
411 struct work_struct port_task; 487 struct work_struct port_task;
412 488
413 unsigned int hsm_task_state; 489 unsigned int hsm_task_state;
414 unsigned long pio_task_timeout;
415 490
416 u32 msg_enable; 491 u32 msg_enable;
417 struct list_head eh_done_q; 492 struct list_head eh_done_q;
418 493
419 void *private_data; 494 void *private_data;
495
496 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
420}; 497};
421 498
422struct ata_port_operations { 499struct ata_port_operations {
@@ -447,10 +524,20 @@ struct ata_port_operations {
447 void (*bmdma_setup) (struct ata_queued_cmd *qc); 524 void (*bmdma_setup) (struct ata_queued_cmd *qc);
448 void (*bmdma_start) (struct ata_queued_cmd *qc); 525 void (*bmdma_start) (struct ata_queued_cmd *qc);
449 526
527 void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int);
528
450 void (*qc_prep) (struct ata_queued_cmd *qc); 529 void (*qc_prep) (struct ata_queued_cmd *qc);
451 unsigned int (*qc_issue) (struct ata_queued_cmd *qc); 530 unsigned int (*qc_issue) (struct ata_queued_cmd *qc);
452 531
453 void (*eng_timeout) (struct ata_port *ap); 532 /* Error handlers. ->error_handler overrides ->eng_timeout and
533 * indicates that new-style EH is in place.
534 */
535 void (*eng_timeout) (struct ata_port *ap); /* obsolete */
536
537 void (*freeze) (struct ata_port *ap);
538 void (*thaw) (struct ata_port *ap);
539 void (*error_handler) (struct ata_port *ap);
540 void (*post_internal_cmd) (struct ata_queued_cmd *qc);
454 541
455 irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); 542 irqreturn_t (*irq_handler)(int, void *, struct pt_regs *);
456 void (*irq_clear) (struct ata_port *); 543 void (*irq_clear) (struct ata_port *);
@@ -496,18 +583,16 @@ extern void ata_port_probe(struct ata_port *);
496extern void __sata_phy_reset(struct ata_port *ap); 583extern void __sata_phy_reset(struct ata_port *ap);
497extern void sata_phy_reset(struct ata_port *ap); 584extern void sata_phy_reset(struct ata_port *ap);
498extern void ata_bus_reset(struct ata_port *ap); 585extern void ata_bus_reset(struct ata_port *ap);
586extern int sata_set_spd(struct ata_port *ap);
499extern int ata_drive_probe_reset(struct ata_port *ap, 587extern int ata_drive_probe_reset(struct ata_port *ap,
500 ata_probeinit_fn_t probeinit, 588 ata_probeinit_fn_t probeinit,
501 ata_reset_fn_t softreset, ata_reset_fn_t hardreset, 589 ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
502 ata_postreset_fn_t postreset, unsigned int *classes); 590 ata_postreset_fn_t postreset, unsigned int *classes);
503extern void ata_std_probeinit(struct ata_port *ap); 591extern void ata_std_probeinit(struct ata_port *ap);
504extern int ata_std_softreset(struct ata_port *ap, int verbose, 592extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes);
505 unsigned int *classes); 593extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class);
506extern int sata_std_hardreset(struct ata_port *ap, int verbose,
507 unsigned int *class);
508extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 594extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
509extern int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev, 595extern int ata_dev_revalidate(struct ata_device *dev, int post_reset);
510 int post_reset);
511extern void ata_port_disable(struct ata_port *); 596extern void ata_port_disable(struct ata_port *);
512extern void ata_std_ports(struct ata_ioports *ioaddr); 597extern void ata_std_ports(struct ata_ioports *ioaddr);
513#ifdef CONFIG_PCI 598#ifdef CONFIG_PCI
@@ -523,20 +608,27 @@ extern void ata_host_set_remove(struct ata_host_set *host_set);
523extern int ata_scsi_detect(struct scsi_host_template *sht); 608extern int ata_scsi_detect(struct scsi_host_template *sht);
524extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 609extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
525extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 610extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
526extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
527extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
528extern int ata_scsi_release(struct Scsi_Host *host); 611extern int ata_scsi_release(struct Scsi_Host *host);
529extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 612extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
613extern int sata_scr_valid(struct ata_port *ap);
614extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val);
615extern int sata_scr_write(struct ata_port *ap, int reg, u32 val);
616extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val);
617extern int ata_port_online(struct ata_port *ap);
618extern int ata_port_offline(struct ata_port *ap);
530extern int ata_scsi_device_resume(struct scsi_device *); 619extern int ata_scsi_device_resume(struct scsi_device *);
531extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); 620extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
532extern int ata_device_resume(struct ata_port *, struct ata_device *); 621extern int ata_device_resume(struct ata_device *);
533extern int ata_device_suspend(struct ata_port *, struct ata_device *, pm_message_t state); 622extern int ata_device_suspend(struct ata_device *, pm_message_t state);
534extern int ata_ratelimit(void); 623extern int ata_ratelimit(void);
535extern unsigned int ata_busy_sleep(struct ata_port *ap, 624extern unsigned int ata_busy_sleep(struct ata_port *ap,
536 unsigned long timeout_pat, 625 unsigned long timeout_pat,
537 unsigned long timeout); 626 unsigned long timeout);
538extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), 627extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *),
539 void *data, unsigned long delay); 628 void *data, unsigned long delay);
629extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
630 unsigned long interval_msec,
631 unsigned long timeout_msec);
540 632
541/* 633/*
542 * Default driver ops implementations 634 * Default driver ops implementations
@@ -555,6 +647,10 @@ extern int ata_port_start (struct ata_port *ap);
555extern void ata_port_stop (struct ata_port *ap); 647extern void ata_port_stop (struct ata_port *ap);
556extern void ata_host_stop (struct ata_host_set *host_set); 648extern void ata_host_stop (struct ata_host_set *host_set);
557extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); 649extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
650extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf,
651 unsigned int buflen, int write_data);
652extern void ata_pio_data_xfer(struct ata_device *adev, unsigned char *buf,
653 unsigned int buflen, int write_data);
558extern void ata_qc_prep(struct ata_queued_cmd *qc); 654extern void ata_qc_prep(struct ata_queued_cmd *qc);
559extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 655extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
560extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); 656extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc);
@@ -572,17 +668,26 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc);
572extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 668extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
573extern u8 ata_bmdma_status(struct ata_port *ap); 669extern u8 ata_bmdma_status(struct ata_port *ap);
574extern void ata_bmdma_irq_clear(struct ata_port *ap); 670extern void ata_bmdma_irq_clear(struct ata_port *ap);
575extern void __ata_qc_complete(struct ata_queued_cmd *qc); 671extern void ata_bmdma_freeze(struct ata_port *ap);
576extern void ata_eng_timeout(struct ata_port *ap); 672extern void ata_bmdma_thaw(struct ata_port *ap);
577extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, 673extern void ata_bmdma_drive_eh(struct ata_port *ap,
578 struct scsi_cmnd *cmd, 674 ata_reset_fn_t softreset,
675 ata_reset_fn_t hardreset,
676 ata_postreset_fn_t postreset);
677extern void ata_bmdma_error_handler(struct ata_port *ap);
678extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc);
679extern void ata_qc_complete(struct ata_queued_cmd *qc);
680extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active,
681 void (*finish_qc)(struct ata_queued_cmd *));
682extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
579 void (*done)(struct scsi_cmnd *)); 683 void (*done)(struct scsi_cmnd *));
580extern int ata_std_bios_param(struct scsi_device *sdev, 684extern int ata_std_bios_param(struct scsi_device *sdev,
581 struct block_device *bdev, 685 struct block_device *bdev,
582 sector_t capacity, int geom[]); 686 sector_t capacity, int geom[]);
583extern int ata_scsi_slave_config(struct scsi_device *sdev); 687extern int ata_scsi_slave_config(struct scsi_device *sdev);
584extern struct ata_device *ata_dev_pair(struct ata_port *ap, 688extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
585 struct ata_device *adev); 689 int queue_depth);
690extern struct ata_device *ata_dev_pair(struct ata_device *adev);
586 691
587/* 692/*
588 * Timing helpers 693 * Timing helpers
@@ -628,7 +733,50 @@ extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bit
628extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long); 733extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long);
629#endif /* CONFIG_PCI */ 734#endif /* CONFIG_PCI */
630 735
736/*
737 * EH
738 */
739extern void ata_eng_timeout(struct ata_port *ap);
740
741extern void ata_port_schedule_eh(struct ata_port *ap);
742extern int ata_port_abort(struct ata_port *ap);
743extern int ata_port_freeze(struct ata_port *ap);
744
745extern void ata_eh_freeze_port(struct ata_port *ap);
746extern void ata_eh_thaw_port(struct ata_port *ap);
747
748extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
749extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
750
751extern void ata_do_eh(struct ata_port *ap, ata_reset_fn_t softreset,
752 ata_reset_fn_t hardreset, ata_postreset_fn_t postreset);
753
754/*
755 * printk helpers
756 */
757#define ata_port_printk(ap, lv, fmt, args...) \
758 printk(lv"ata%u: "fmt, (ap)->id , ##args)
759
760#define ata_dev_printk(dev, lv, fmt, args...) \
761 printk(lv"ata%u.%02u: "fmt, (dev)->ap->id, (dev)->devno , ##args)
762
763/*
764 * ata_eh_info helpers
765 */
766#define ata_ehi_push_desc(ehi, fmt, args...) do { \
767 (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \
768 ATA_EH_DESC_LEN - (ehi)->desc_len, \
769 fmt , ##args); \
770} while (0)
771
772#define ata_ehi_clear_desc(ehi) do { \
773 (ehi)->desc[0] = '\0'; \
774 (ehi)->desc_len = 0; \
775} while (0)
631 776
777/*
778 * qc helpers
779 */
632static inline int 780static inline int
633ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc) 781ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
634{ 782{
@@ -671,14 +819,39 @@ static inline unsigned int ata_tag_valid(unsigned int tag)
671 return (tag < ATA_MAX_QUEUE) ? 1 : 0; 819 return (tag < ATA_MAX_QUEUE) ? 1 : 0;
672} 820}
673 821
674static inline unsigned int ata_class_present(unsigned int class) 822static inline unsigned int ata_tag_internal(unsigned int tag)
823{
824 return tag == ATA_MAX_QUEUE - 1;
825}
826
827static inline unsigned int ata_class_enabled(unsigned int class)
675{ 828{
676 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; 829 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI;
677} 830}
678 831
679static inline unsigned int ata_dev_present(const struct ata_device *dev) 832static inline unsigned int ata_class_disabled(unsigned int class)
833{
834 return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP;
835}
836
837static inline unsigned int ata_class_absent(unsigned int class)
838{
839 return !ata_class_enabled(class) && !ata_class_disabled(class);
840}
841
842static inline unsigned int ata_dev_enabled(const struct ata_device *dev)
680{ 843{
681 return ata_class_present(dev->class); 844 return ata_class_enabled(dev->class);
845}
846
847static inline unsigned int ata_dev_disabled(const struct ata_device *dev)
848{
849 return ata_class_disabled(dev->class);
850}
851
852static inline unsigned int ata_dev_absent(const struct ata_device *dev)
853{
854 return ata_class_absent(dev->class);
682} 855}
683 856
684static inline u8 ata_chk_status(struct ata_port *ap) 857static inline u8 ata_chk_status(struct ata_port *ap)
@@ -759,20 +932,35 @@ static inline void ata_qc_set_polling(struct ata_queued_cmd *qc)
759 qc->tf.ctl |= ATA_NIEN; 932 qc->tf.ctl |= ATA_NIEN;
760} 933}
761 934
762static inline struct ata_queued_cmd *ata_qc_from_tag (struct ata_port *ap, 935static inline struct ata_queued_cmd *__ata_qc_from_tag(struct ata_port *ap,
763 unsigned int tag) 936 unsigned int tag)
764{ 937{
765 if (likely(ata_tag_valid(tag))) 938 if (likely(ata_tag_valid(tag)))
766 return &ap->qcmd[tag]; 939 return &ap->qcmd[tag];
767 return NULL; 940 return NULL;
768} 941}
769 942
770static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, unsigned int device) 943static inline struct ata_queued_cmd *ata_qc_from_tag(struct ata_port *ap,
944 unsigned int tag)
945{
946 struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
947
948 if (unlikely(!qc) || !ap->ops->error_handler)
949 return qc;
950
951 if ((qc->flags & (ATA_QCFLAG_ACTIVE |
952 ATA_QCFLAG_FAILED)) == ATA_QCFLAG_ACTIVE)
953 return qc;
954
955 return NULL;
956}
957
958static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
771{ 959{
772 memset(tf, 0, sizeof(*tf)); 960 memset(tf, 0, sizeof(*tf));
773 961
774 tf->ctl = ap->ctl; 962 tf->ctl = dev->ap->ctl;
775 if (device == 0) 963 if (dev->devno == 0)
776 tf->device = ATA_DEVICE_OBS; 964 tf->device = ATA_DEVICE_OBS;
777 else 965 else
778 tf->device = ATA_DEVICE_OBS | ATA_DEV1; 966 tf->device = ATA_DEVICE_OBS | ATA_DEV1;
@@ -787,26 +975,11 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
787 qc->nbytes = qc->curbytes = 0; 975 qc->nbytes = qc->curbytes = 0;
788 qc->err_mask = 0; 976 qc->err_mask = 0;
789 977
790 ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); 978 ata_tf_init(qc->dev, &qc->tf);
791}
792
793/**
794 * ata_qc_complete - Complete an active ATA command
795 * @qc: Command to complete
796 * @err_mask: ATA Status register contents
797 *
798 * Indicate to the mid and upper layers that an ATA
799 * command has completed, with either an ok or not-ok status.
800 *
801 * LOCKING:
802 * spin_lock_irqsave(host_set lock)
803 */
804static inline void ata_qc_complete(struct ata_queued_cmd *qc)
805{
806 if (unlikely(qc->flags & ATA_QCFLAG_EH_SCHEDULED))
807 return;
808 979
809 __ata_qc_complete(qc); 980 /* init result_tf such that it indicates normal completion */
981 qc->result_tf.command = ATA_DRDY;
982 qc->result_tf.feature = 0;
810} 983}
811 984
812/** 985/**
@@ -885,28 +1058,6 @@ static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
885 return status; 1058 return status;
886} 1059}
887 1060
888static inline u32 scr_read(struct ata_port *ap, unsigned int reg)
889{
890 return ap->ops->scr_read(ap, reg);
891}
892
893static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val)
894{
895 ap->ops->scr_write(ap, reg, val);
896}
897
898static inline void scr_write_flush(struct ata_port *ap, unsigned int reg,
899 u32 val)
900{
901 ap->ops->scr_write(ap, reg, val);
902 (void) ap->ops->scr_read(ap, reg);
903}
904
905static inline unsigned int sata_dev_present(struct ata_port *ap)
906{
907 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
908}
909
910static inline int ata_try_flush_cache(const struct ata_device *dev) 1061static inline int ata_try_flush_cache(const struct ata_device *dev)
911{ 1062{
912 return ata_id_wcache_enabled(dev->id) || 1063 return ata_id_wcache_enabled(dev->id) ||
@@ -916,7 +1067,7 @@ static inline int ata_try_flush_cache(const struct ata_device *dev)
916 1067
917static inline unsigned int ac_err_mask(u8 status) 1068static inline unsigned int ac_err_mask(u8 status)
918{ 1069{
919 if (status & ATA_BUSY) 1070 if (status & (ATA_BUSY | ATA_DRQ))
920 return AC_ERR_HSM; 1071 return AC_ERR_HSM;
921 if (status & (ATA_ERR | ATA_DF)) 1072 if (status & (ATA_ERR | ATA_DF))
922 return AC_ERR_DEV; 1073 return AC_ERR_DEV;
@@ -944,4 +1095,9 @@ static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
944 dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma); 1095 dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
945} 1096}
946 1097
1098static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
1099{
1100 return (struct ata_port *) &host->hostdata[0];
1101}
1102
947#endif /* __LINUX_LIBATA_H__ */ 1103#endif /* __LINUX_LIBATA_H__ */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index d6fe048376ab..233f60741c82 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1182,6 +1182,10 @@
1182#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E 1182#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E
1183#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372 1183#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372
1184#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 1184#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1185#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7
1186#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE 0x03EC
1187#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6
1188#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7
1185 1189
1186#define PCI_VENDOR_ID_IMS 0x10e0 1190#define PCI_VENDOR_ID_IMS 0x10e0
1187#define PCI_DEVICE_ID_IMS_TT128 0x9128 1191#define PCI_DEVICE_ID_IMS_TT128 0x9128
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 1ace1b9fe537..88c6c4da6c05 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -151,5 +151,6 @@ extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
151extern void scsi_put_command(struct scsi_cmnd *); 151extern void scsi_put_command(struct scsi_cmnd *);
152extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); 152extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int);
153extern void scsi_finish_command(struct scsi_cmnd *cmd); 153extern void scsi_finish_command(struct scsi_cmnd *cmd);
154extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd);
154 155
155#endif /* _SCSI_SCSI_CMND_H */ 156#endif /* _SCSI_SCSI_CMND_H */
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index de6ce541a046..a42efd6e4be8 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -472,6 +472,7 @@ struct Scsi_Host {
472 */ 472 */
473 unsigned int host_busy; /* commands actually active on low-level */ 473 unsigned int host_busy; /* commands actually active on low-level */
474 unsigned int host_failed; /* commands that failed. */ 474 unsigned int host_failed; /* commands that failed. */
475 unsigned int host_eh_scheduled; /* EH scheduled without command */
475 476
476 unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */ 477 unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */
477 int resetting; /* if set, it means that last_reset is a valid value */ 478 int resetting; /* if set, it means that last_reset is a valid value */