diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 16:57:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 16:57:26 -0500 |
commit | f31c338675872875e24f124af0689131b0c72600 (patch) | |
tree | cf12b28d52da1675ab32871abd2db455ffbfe920 /include/linux | |
parent | 0008bf54408d4c0637c24d34642f1038c299be95 (diff) | |
parent | 61a368c216897aa3bbee35b3f2e6db76ec73fad0 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (67 commits)
ide: remove redundant DMA blacklist check from __ide_dma_on()
ide: cleanup ide_set_dma()
ide: remove redundant ->ide_dma_on call from set_using_dma()
sc1200: move DMA timings to timing tables
ide: add IDE_HFLAG_ABUSE_SET_DMA_MODE host flag
sis5513: factor out UDMA programming code
pdc202xx_new: move PIO programming code to pdcnew_set_pio_mode()
ide: make 'extra' field in struct ide_port_info u8
ide: kill duplicate code in ide_dump_{ata,atapi}_status()
ide-disk: use ide_get_lba_addr()
ide: printk fix
ide: add ide_tf_read() helper
ide: fix registers loading order in ide_dump_ata_status()
ide-disk: use do_rw_taskfile() (take 2)
ide-disk: add ide_tf_set_cmd() helper
ide-disk: extend timeout for PIO-in commands
ide: remove 'handler' field from ide_task_t (take 2)
ide: use ->data_phase to set ->handler in do_rw_taskfile()
ide: convert do_rw_taskfile() to use ->data_phase
ide: merge flagged_taskfile() into do_rw_taskfile()
...
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/blkdev.h | 1 | ||||
-rw-r--r-- | include/linux/hdreg.h | 64 | ||||
-rw-r--r-- | include/linux/ide.h | 322 |
3 files changed, 138 insertions, 249 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d18ee67b40f8..40ee1706caa3 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -144,7 +144,6 @@ enum rq_cmd_type_bits { | |||
144 | * private REQ_LB opcodes to differentiate what type of request this is | 144 | * private REQ_LB opcodes to differentiate what type of request this is |
145 | */ | 145 | */ |
146 | REQ_TYPE_ATA_CMD, | 146 | REQ_TYPE_ATA_CMD, |
147 | REQ_TYPE_ATA_TASK, | ||
148 | REQ_TYPE_ATA_TASKFILE, | 147 | REQ_TYPE_ATA_TASKFILE, |
149 | REQ_TYPE_ATA_PC, | 148 | REQ_TYPE_ATA_PC, |
150 | }; | 149 | }; |
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h index 818c6afc1091..ff43f8d6b5b3 100644 --- a/include/linux/hdreg.h +++ b/include/linux/hdreg.h | |||
@@ -44,7 +44,9 @@ | |||
44 | 44 | ||
45 | /* Bits for HD_ERROR */ | 45 | /* Bits for HD_ERROR */ |
46 | #define MARK_ERR 0x01 /* Bad address mark */ | 46 | #define MARK_ERR 0x01 /* Bad address mark */ |
47 | #define ILI_ERR 0x01 /* Illegal Length Indication (ATAPI) */ | ||
47 | #define TRK0_ERR 0x02 /* couldn't find track 0 */ | 48 | #define TRK0_ERR 0x02 /* couldn't find track 0 */ |
49 | #define EOM_ERR 0x02 /* End Of Media (ATAPI) */ | ||
48 | #define ABRT_ERR 0x04 /* Command aborted */ | 50 | #define ABRT_ERR 0x04 /* Command aborted */ |
49 | #define MCR_ERR 0x08 /* media change request */ | 51 | #define MCR_ERR 0x08 /* media change request */ |
50 | #define ID_ERR 0x10 /* ID field not found */ | 52 | #define ID_ERR 0x10 /* ID field not found */ |
@@ -52,6 +54,7 @@ | |||
52 | #define ECC_ERR 0x40 /* Uncorrectable ECC error */ | 54 | #define ECC_ERR 0x40 /* Uncorrectable ECC error */ |
53 | #define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */ | 55 | #define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */ |
54 | #define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */ | 56 | #define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */ |
57 | #define LFS_ERR 0xf0 /* Last Failed Sense (ATAPI) */ | ||
55 | 58 | ||
56 | /* Bits of HD_NSECTOR */ | 59 | /* Bits of HD_NSECTOR */ |
57 | #define CD 0x01 | 60 | #define CD 0x01 |
@@ -70,13 +73,13 @@ | |||
70 | #define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8)) | 73 | #define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8)) |
71 | #define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8)) | 74 | #define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8)) |
72 | 75 | ||
73 | #define IDE_DRIVE_TASK_INVALID -1 | ||
74 | #define IDE_DRIVE_TASK_NO_DATA 0 | 76 | #define IDE_DRIVE_TASK_NO_DATA 0 |
77 | #ifndef __KERNEL__ | ||
78 | #define IDE_DRIVE_TASK_INVALID -1 | ||
75 | #define IDE_DRIVE_TASK_SET_XFER 1 | 79 | #define IDE_DRIVE_TASK_SET_XFER 1 |
76 | |||
77 | #define IDE_DRIVE_TASK_IN 2 | 80 | #define IDE_DRIVE_TASK_IN 2 |
78 | |||
79 | #define IDE_DRIVE_TASK_OUT 3 | 81 | #define IDE_DRIVE_TASK_OUT 3 |
82 | #endif | ||
80 | #define IDE_DRIVE_TASK_RAW_WRITE 4 | 83 | #define IDE_DRIVE_TASK_RAW_WRITE 4 |
81 | 84 | ||
82 | /* | 85 | /* |
@@ -87,10 +90,10 @@ | |||
87 | #ifndef __KERNEL__ | 90 | #ifndef __KERNEL__ |
88 | #define IDE_TASKFILE_STD_OUT_FLAGS 0xFE | 91 | #define IDE_TASKFILE_STD_OUT_FLAGS 0xFE |
89 | #define IDE_HOB_STD_OUT_FLAGS 0x3C | 92 | #define IDE_HOB_STD_OUT_FLAGS 0x3C |
90 | #endif | ||
91 | 93 | ||
92 | typedef unsigned char task_ioreg_t; | 94 | typedef unsigned char task_ioreg_t; |
93 | typedef unsigned long sata_ioreg_t; | 95 | typedef unsigned long sata_ioreg_t; |
96 | #endif | ||
94 | 97 | ||
95 | typedef union ide_reg_valid_s { | 98 | typedef union ide_reg_valid_s { |
96 | unsigned all : 16; | 99 | unsigned all : 16; |
@@ -116,8 +119,8 @@ typedef union ide_reg_valid_s { | |||
116 | } ide_reg_valid_t; | 119 | } ide_reg_valid_t; |
117 | 120 | ||
118 | typedef struct ide_task_request_s { | 121 | typedef struct ide_task_request_s { |
119 | task_ioreg_t io_ports[8]; | 122 | __u8 io_ports[8]; |
120 | task_ioreg_t hob_ports[8]; | 123 | __u8 hob_ports[8]; /* bytes 6 and 7 are unused */ |
121 | ide_reg_valid_t out_flags; | 124 | ide_reg_valid_t out_flags; |
122 | ide_reg_valid_t in_flags; | 125 | ide_reg_valid_t in_flags; |
123 | int data_phase; | 126 | int data_phase; |
@@ -133,36 +136,35 @@ typedef struct ide_ioctl_request_s { | |||
133 | } ide_ioctl_request_t; | 136 | } ide_ioctl_request_t; |
134 | 137 | ||
135 | struct hd_drive_cmd_hdr { | 138 | struct hd_drive_cmd_hdr { |
136 | task_ioreg_t command; | 139 | __u8 command; |
137 | task_ioreg_t sector_number; | 140 | __u8 sector_number; |
138 | task_ioreg_t feature; | 141 | __u8 feature; |
139 | task_ioreg_t sector_count; | 142 | __u8 sector_count; |
140 | }; | 143 | }; |
141 | 144 | ||
145 | #ifndef __KERNEL__ | ||
142 | typedef struct hd_drive_task_hdr { | 146 | typedef struct hd_drive_task_hdr { |
143 | task_ioreg_t data; | 147 | __u8 data; |
144 | task_ioreg_t feature; | 148 | __u8 feature; |
145 | task_ioreg_t sector_count; | 149 | __u8 sector_count; |
146 | task_ioreg_t sector_number; | 150 | __u8 sector_number; |
147 | task_ioreg_t low_cylinder; | 151 | __u8 low_cylinder; |
148 | task_ioreg_t high_cylinder; | 152 | __u8 high_cylinder; |
149 | task_ioreg_t device_head; | 153 | __u8 device_head; |
150 | task_ioreg_t command; | 154 | __u8 command; |
151 | } task_struct_t; | 155 | } task_struct_t; |
152 | 156 | ||
153 | typedef struct hd_drive_hob_hdr { | 157 | typedef struct hd_drive_hob_hdr { |
154 | task_ioreg_t data; | 158 | __u8 data; |
155 | task_ioreg_t feature; | 159 | __u8 feature; |
156 | task_ioreg_t sector_count; | 160 | __u8 sector_count; |
157 | task_ioreg_t sector_number; | 161 | __u8 sector_number; |
158 | task_ioreg_t low_cylinder; | 162 | __u8 low_cylinder; |
159 | task_ioreg_t high_cylinder; | 163 | __u8 high_cylinder; |
160 | task_ioreg_t device_head; | 164 | __u8 device_head; |
161 | task_ioreg_t control; | 165 | __u8 control; |
162 | } hob_struct_t; | 166 | } hob_struct_t; |
163 | 167 | #endif | |
164 | #define TASKFILE_INVALID 0x7fff | ||
165 | #define TASKFILE_48 0x8000 | ||
166 | 168 | ||
167 | #define TASKFILE_NO_DATA 0x0000 | 169 | #define TASKFILE_NO_DATA 0x0000 |
168 | 170 | ||
@@ -178,12 +180,16 @@ typedef struct hd_drive_hob_hdr { | |||
178 | #define TASKFILE_IN_DMAQ 0x0080 | 180 | #define TASKFILE_IN_DMAQ 0x0080 |
179 | #define TASKFILE_OUT_DMAQ 0x0100 | 181 | #define TASKFILE_OUT_DMAQ 0x0100 |
180 | 182 | ||
183 | #ifndef __KERNEL__ | ||
181 | #define TASKFILE_P_IN 0x0200 | 184 | #define TASKFILE_P_IN 0x0200 |
182 | #define TASKFILE_P_OUT 0x0400 | 185 | #define TASKFILE_P_OUT 0x0400 |
183 | #define TASKFILE_P_IN_DMA 0x0800 | 186 | #define TASKFILE_P_IN_DMA 0x0800 |
184 | #define TASKFILE_P_OUT_DMA 0x1000 | 187 | #define TASKFILE_P_OUT_DMA 0x1000 |
185 | #define TASKFILE_P_IN_DMAQ 0x2000 | 188 | #define TASKFILE_P_IN_DMAQ 0x2000 |
186 | #define TASKFILE_P_OUT_DMAQ 0x4000 | 189 | #define TASKFILE_P_OUT_DMAQ 0x4000 |
190 | #define TASKFILE_48 0x8000 | ||
191 | #define TASKFILE_INVALID 0x7fff | ||
192 | #endif | ||
187 | 193 | ||
188 | /* ATA/ATAPI Commands pre T13 Spec */ | 194 | /* ATA/ATAPI Commands pre T13 Spec */ |
189 | #define WIN_NOP 0x00 | 195 | #define WIN_NOP 0x00 |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 9a6a41e7079f..1e4409937ec3 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -27,25 +27,10 @@ | |||
27 | #include <asm/semaphore.h> | 27 | #include <asm/semaphore.h> |
28 | #include <asm/mutex.h> | 28 | #include <asm/mutex.h> |
29 | 29 | ||
30 | /****************************************************************************** | 30 | #if defined(CRIS) || defined(FRV) |
31 | * IDE driver configuration options (play with these as desired): | 31 | # define SUPPORT_VLB_SYNC 0 |
32 | * | 32 | #else |
33 | * REALLY_SLOW_IO can be defined in ide.c and ide-cd.c, if necessary | 33 | # define SUPPORT_VLB_SYNC 1 |
34 | */ | ||
35 | #define INITIAL_MULT_COUNT 0 /* off=0; on=2,4,8,16,32, etc.. */ | ||
36 | |||
37 | #ifndef SUPPORT_SLOW_DATA_PORTS /* 1 to support slow data ports */ | ||
38 | #define SUPPORT_SLOW_DATA_PORTS 1 /* 0 to reduce kernel size */ | ||
39 | #endif | ||
40 | #ifndef SUPPORT_VLB_SYNC /* 1 to support weird 32-bit chips */ | ||
41 | #define SUPPORT_VLB_SYNC 1 /* 0 to reduce kernel size */ | ||
42 | #endif | ||
43 | #ifndef OK_TO_RESET_CONTROLLER /* 1 needed for good error recovery */ | ||
44 | #define OK_TO_RESET_CONTROLLER 1 /* 0 for use with AH2372A/B interface */ | ||
45 | #endif | ||
46 | |||
47 | #ifndef DISABLE_IRQ_NOSYNC | ||
48 | #define DISABLE_IRQ_NOSYNC 0 | ||
49 | #endif | 34 | #endif |
50 | 35 | ||
51 | /* | 36 | /* |
@@ -55,10 +40,6 @@ | |||
55 | 40 | ||
56 | #define IDE_NO_IRQ (-1) | 41 | #define IDE_NO_IRQ (-1) |
57 | 42 | ||
58 | /* | ||
59 | * "No user-serviceable parts" beyond this point :) | ||
60 | *****************************************************************************/ | ||
61 | |||
62 | typedef unsigned char byte; /* used everywhere */ | 43 | typedef unsigned char byte; /* used everywhere */ |
63 | 44 | ||
64 | /* | 45 | /* |
@@ -103,8 +84,6 @@ typedef unsigned char byte; /* used everywhere */ | |||
103 | #define IDE_FEATURE_OFFSET IDE_ERROR_OFFSET | 84 | #define IDE_FEATURE_OFFSET IDE_ERROR_OFFSET |
104 | #define IDE_COMMAND_OFFSET IDE_STATUS_OFFSET | 85 | #define IDE_COMMAND_OFFSET IDE_STATUS_OFFSET |
105 | 86 | ||
106 | #define IDE_CONTROL_OFFSET_HOB (7) | ||
107 | |||
108 | #define IDE_DATA_REG (HWIF(drive)->io_ports[IDE_DATA_OFFSET]) | 87 | #define IDE_DATA_REG (HWIF(drive)->io_ports[IDE_DATA_OFFSET]) |
109 | #define IDE_ERROR_REG (HWIF(drive)->io_ports[IDE_ERROR_OFFSET]) | 88 | #define IDE_ERROR_REG (HWIF(drive)->io_ports[IDE_ERROR_OFFSET]) |
110 | #define IDE_NSECTOR_REG (HWIF(drive)->io_ports[IDE_NSECTOR_OFFSET]) | 89 | #define IDE_NSECTOR_REG (HWIF(drive)->io_ports[IDE_NSECTOR_OFFSET]) |
@@ -327,47 +306,16 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, | |||
327 | typedef union { | 306 | typedef union { |
328 | unsigned all : 8; | 307 | unsigned all : 8; |
329 | struct { | 308 | struct { |
330 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
331 | unsigned set_geometry : 1; | 309 | unsigned set_geometry : 1; |
332 | unsigned recalibrate : 1; | 310 | unsigned recalibrate : 1; |
333 | unsigned set_multmode : 1; | 311 | unsigned set_multmode : 1; |
334 | unsigned set_tune : 1; | 312 | unsigned set_tune : 1; |
335 | unsigned serviced : 1; | 313 | unsigned serviced : 1; |
336 | unsigned reserved : 3; | 314 | unsigned reserved : 3; |
337 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
338 | unsigned reserved : 3; | ||
339 | unsigned serviced : 1; | ||
340 | unsigned set_tune : 1; | ||
341 | unsigned set_multmode : 1; | ||
342 | unsigned recalibrate : 1; | ||
343 | unsigned set_geometry : 1; | ||
344 | #else | ||
345 | #error "Please fix <asm/byteorder.h>" | ||
346 | #endif | ||
347 | } b; | 315 | } b; |
348 | } special_t; | 316 | } special_t; |
349 | 317 | ||
350 | /* | 318 | /* |
351 | * ATA DATA Register Special. | ||
352 | * ATA NSECTOR Count Register(). | ||
353 | * ATAPI Byte Count Register. | ||
354 | */ | ||
355 | typedef union { | ||
356 | unsigned all :16; | ||
357 | struct { | ||
358 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
359 | unsigned low :8; /* LSB */ | ||
360 | unsigned high :8; /* MSB */ | ||
361 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
362 | unsigned high :8; /* MSB */ | ||
363 | unsigned low :8; /* LSB */ | ||
364 | #else | ||
365 | #error "Please fix <asm/byteorder.h>" | ||
366 | #endif | ||
367 | } b; | ||
368 | } ata_nsector_t, ata_data_t, atapi_bcount_t; | ||
369 | |||
370 | /* | ||
371 | * ATA-IDE Select Register, aka Device-Head | 319 | * ATA-IDE Select Register, aka Device-Head |
372 | * | 320 | * |
373 | * head : always zeros here | 321 | * head : always zeros here |
@@ -398,131 +346,6 @@ typedef union { | |||
398 | } select_t, ata_select_t; | 346 | } select_t, ata_select_t; |
399 | 347 | ||
400 | /* | 348 | /* |
401 | * The ATA-IDE Status Register. | ||
402 | * The ATAPI Status Register. | ||
403 | * | ||
404 | * check : Error occurred | ||
405 | * idx : Index Error | ||
406 | * corr : Correctable error occurred | ||
407 | * drq : Data is request by the device | ||
408 | * dsc : Disk Seek Complete : ata | ||
409 | * : Media access command finished : atapi | ||
410 | * df : Device Fault : ata | ||
411 | * : Reserved : atapi | ||
412 | * drdy : Ready, Command Mode Capable : ata | ||
413 | * : Ignored for ATAPI commands : atapi | ||
414 | * bsy : Disk is Busy | ||
415 | * : The device has access to the command block | ||
416 | */ | ||
417 | typedef union { | ||
418 | unsigned all :8; | ||
419 | struct { | ||
420 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
421 | unsigned check :1; | ||
422 | unsigned idx :1; | ||
423 | unsigned corr :1; | ||
424 | unsigned drq :1; | ||
425 | unsigned dsc :1; | ||
426 | unsigned df :1; | ||
427 | unsigned drdy :1; | ||
428 | unsigned bsy :1; | ||
429 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
430 | unsigned bsy :1; | ||
431 | unsigned drdy :1; | ||
432 | unsigned df :1; | ||
433 | unsigned dsc :1; | ||
434 | unsigned drq :1; | ||
435 | unsigned corr :1; | ||
436 | unsigned idx :1; | ||
437 | unsigned check :1; | ||
438 | #else | ||
439 | #error "Please fix <asm/byteorder.h>" | ||
440 | #endif | ||
441 | } b; | ||
442 | } ata_status_t, atapi_status_t; | ||
443 | |||
444 | /* | ||
445 | * ATAPI Feature Register | ||
446 | * | ||
447 | * dma : Using DMA or PIO | ||
448 | * reserved321 : Reserved | ||
449 | * reserved654 : Reserved (Tag Type) | ||
450 | * reserved7 : Reserved | ||
451 | */ | ||
452 | typedef union { | ||
453 | unsigned all :8; | ||
454 | struct { | ||
455 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
456 | unsigned dma :1; | ||
457 | unsigned reserved321 :3; | ||
458 | unsigned reserved654 :3; | ||
459 | unsigned reserved7 :1; | ||
460 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
461 | unsigned reserved7 :1; | ||
462 | unsigned reserved654 :3; | ||
463 | unsigned reserved321 :3; | ||
464 | unsigned dma :1; | ||
465 | #else | ||
466 | #error "Please fix <asm/byteorder.h>" | ||
467 | #endif | ||
468 | } b; | ||
469 | } atapi_feature_t; | ||
470 | |||
471 | /* | ||
472 | * ATAPI Interrupt Reason Register. | ||
473 | * | ||
474 | * cod : Information transferred is command (1) or data (0) | ||
475 | * io : The device requests us to read (1) or write (0) | ||
476 | * reserved : Reserved | ||
477 | */ | ||
478 | typedef union { | ||
479 | unsigned all :8; | ||
480 | struct { | ||
481 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
482 | unsigned cod :1; | ||
483 | unsigned io :1; | ||
484 | unsigned reserved :6; | ||
485 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
486 | unsigned reserved :6; | ||
487 | unsigned io :1; | ||
488 | unsigned cod :1; | ||
489 | #else | ||
490 | #error "Please fix <asm/byteorder.h>" | ||
491 | #endif | ||
492 | } b; | ||
493 | } atapi_ireason_t; | ||
494 | |||
495 | /* | ||
496 | * The ATAPI error register. | ||
497 | * | ||
498 | * ili : Illegal Length Indication | ||
499 | * eom : End Of Media Detected | ||
500 | * abrt : Aborted command - As defined by ATA | ||
501 | * mcr : Media Change Requested - As defined by ATA | ||
502 | * sense_key : Sense key of the last failed packet command | ||
503 | */ | ||
504 | typedef union { | ||
505 | unsigned all :8; | ||
506 | struct { | ||
507 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
508 | unsigned ili :1; | ||
509 | unsigned eom :1; | ||
510 | unsigned abrt :1; | ||
511 | unsigned mcr :1; | ||
512 | unsigned sense_key :4; | ||
513 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
514 | unsigned sense_key :4; | ||
515 | unsigned mcr :1; | ||
516 | unsigned abrt :1; | ||
517 | unsigned eom :1; | ||
518 | unsigned ili :1; | ||
519 | #else | ||
520 | #error "Please fix <asm/byteorder.h>" | ||
521 | #endif | ||
522 | } b; | ||
523 | } atapi_error_t; | ||
524 | |||
525 | /* | ||
526 | * Status returned from various ide_ functions | 349 | * Status returned from various ide_ functions |
527 | */ | 350 | */ |
528 | typedef enum { | 351 | typedef enum { |
@@ -701,8 +524,6 @@ typedef struct hwif_s { | |||
701 | void (*pre_reset)(ide_drive_t *); | 524 | void (*pre_reset)(ide_drive_t *); |
702 | /* routine to reset controller after a disk reset */ | 525 | /* routine to reset controller after a disk reset */ |
703 | void (*resetproc)(ide_drive_t *); | 526 | void (*resetproc)(ide_drive_t *); |
704 | /* special interrupt handling for shared pci interrupts */ | ||
705 | void (*intrproc)(ide_drive_t *); | ||
706 | /* special host masking for drive selection */ | 527 | /* special host masking for drive selection */ |
707 | void (*maskproc)(ide_drive_t *, int); | 528 | void (*maskproc)(ide_drive_t *, int); |
708 | /* check host's drive quirk list */ | 529 | /* check host's drive quirk list */ |
@@ -766,7 +587,6 @@ typedef struct hwif_s { | |||
766 | int rqsize; /* max sectors per request */ | 587 | int rqsize; /* max sectors per request */ |
767 | int irq; /* our irq number */ | 588 | int irq; /* our irq number */ |
768 | 589 | ||
769 | unsigned long dma_master; /* reference base addr dmabase */ | ||
770 | unsigned long dma_base; /* base addr for dma ports */ | 590 | unsigned long dma_base; /* base addr for dma ports */ |
771 | unsigned long dma_command; /* dma command register */ | 591 | unsigned long dma_command; /* dma command register */ |
772 | unsigned long dma_vendor1; /* dma vendor 1 register */ | 592 | unsigned long dma_vendor1; /* dma vendor 1 register */ |
@@ -806,7 +626,6 @@ typedef struct hwif_s { | |||
806 | /* | 626 | /* |
807 | * internal ide interrupt handler type | 627 | * internal ide interrupt handler type |
808 | */ | 628 | */ |
809 | typedef ide_startstop_t (ide_pre_handler_t)(ide_drive_t *, struct request *); | ||
810 | typedef ide_startstop_t (ide_handler_t)(ide_drive_t *); | 629 | typedef ide_startstop_t (ide_handler_t)(ide_drive_t *); |
811 | typedef int (ide_expiry_t)(ide_drive_t *); | 630 | typedef int (ide_expiry_t)(ide_drive_t *); |
812 | 631 | ||
@@ -1020,7 +839,8 @@ int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, | |||
1020 | 839 | ||
1021 | extern void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry); | 840 | extern void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry); |
1022 | 841 | ||
1023 | extern void ide_execute_command(ide_drive_t *, task_ioreg_t cmd, ide_handler_t *, unsigned int, ide_expiry_t *); | 842 | void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int, |
843 | ide_expiry_t *); | ||
1024 | 844 | ||
1025 | ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); | 845 | ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); |
1026 | 846 | ||
@@ -1062,52 +882,114 @@ extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); | |||
1062 | */ | 882 | */ |
1063 | extern int ide_wait_cmd(ide_drive_t *, u8, u8, u8, u8, u8 *); | 883 | extern int ide_wait_cmd(ide_drive_t *, u8, u8, u8, u8, u8 *); |
1064 | 884 | ||
885 | enum { | ||
886 | IDE_TFLAG_LBA48 = (1 << 0), | ||
887 | IDE_TFLAG_NO_SELECT_MASK = (1 << 1), | ||
888 | IDE_TFLAG_FLAGGED = (1 << 2), | ||
889 | IDE_TFLAG_OUT_DATA = (1 << 3), | ||
890 | IDE_TFLAG_OUT_HOB_FEATURE = (1 << 4), | ||
891 | IDE_TFLAG_OUT_HOB_NSECT = (1 << 5), | ||
892 | IDE_TFLAG_OUT_HOB_LBAL = (1 << 6), | ||
893 | IDE_TFLAG_OUT_HOB_LBAM = (1 << 7), | ||
894 | IDE_TFLAG_OUT_HOB_LBAH = (1 << 8), | ||
895 | IDE_TFLAG_OUT_HOB = IDE_TFLAG_OUT_HOB_FEATURE | | ||
896 | IDE_TFLAG_OUT_HOB_NSECT | | ||
897 | IDE_TFLAG_OUT_HOB_LBAL | | ||
898 | IDE_TFLAG_OUT_HOB_LBAM | | ||
899 | IDE_TFLAG_OUT_HOB_LBAH, | ||
900 | IDE_TFLAG_OUT_FEATURE = (1 << 9), | ||
901 | IDE_TFLAG_OUT_NSECT = (1 << 10), | ||
902 | IDE_TFLAG_OUT_LBAL = (1 << 11), | ||
903 | IDE_TFLAG_OUT_LBAM = (1 << 12), | ||
904 | IDE_TFLAG_OUT_LBAH = (1 << 13), | ||
905 | IDE_TFLAG_OUT_TF = IDE_TFLAG_OUT_FEATURE | | ||
906 | IDE_TFLAG_OUT_NSECT | | ||
907 | IDE_TFLAG_OUT_LBAL | | ||
908 | IDE_TFLAG_OUT_LBAM | | ||
909 | IDE_TFLAG_OUT_LBAH, | ||
910 | IDE_TFLAG_OUT_DEVICE = (1 << 14), | ||
911 | IDE_TFLAG_WRITE = (1 << 15), | ||
912 | IDE_TFLAG_FLAGGED_SET_IN_FLAGS = (1 << 16), | ||
913 | IDE_TFLAG_IN_DATA = (1 << 17), | ||
914 | IDE_TFLAG_CUSTOM_HANDLER = (1 << 18), | ||
915 | IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 19), | ||
916 | IDE_TFLAG_IN_HOB_FEATURE = (1 << 20), | ||
917 | IDE_TFLAG_IN_HOB_NSECT = (1 << 21), | ||
918 | IDE_TFLAG_IN_HOB_LBAL = (1 << 22), | ||
919 | IDE_TFLAG_IN_HOB_LBAM = (1 << 23), | ||
920 | IDE_TFLAG_IN_HOB_LBAH = (1 << 24), | ||
921 | IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL | | ||
922 | IDE_TFLAG_IN_HOB_LBAM | | ||
923 | IDE_TFLAG_IN_HOB_LBAH, | ||
924 | IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE | | ||
925 | IDE_TFLAG_IN_HOB_NSECT | | ||
926 | IDE_TFLAG_IN_HOB_LBA, | ||
927 | IDE_TFLAG_IN_NSECT = (1 << 25), | ||
928 | IDE_TFLAG_IN_LBAL = (1 << 26), | ||
929 | IDE_TFLAG_IN_LBAM = (1 << 27), | ||
930 | IDE_TFLAG_IN_LBAH = (1 << 28), | ||
931 | IDE_TFLAG_IN_LBA = IDE_TFLAG_IN_LBAL | | ||
932 | IDE_TFLAG_IN_LBAM | | ||
933 | IDE_TFLAG_IN_LBAH, | ||
934 | IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT | | ||
935 | IDE_TFLAG_IN_LBA, | ||
936 | IDE_TFLAG_IN_DEVICE = (1 << 29), | ||
937 | }; | ||
938 | |||
939 | struct ide_taskfile { | ||
940 | u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */ | ||
941 | |||
942 | u8 hob_feature; /* 1-5: additional data to support LBA48 */ | ||
943 | u8 hob_nsect; | ||
944 | u8 hob_lbal; | ||
945 | u8 hob_lbam; | ||
946 | u8 hob_lbah; | ||
947 | |||
948 | u8 data; /* 6: low data byte (for TASKFILE IOCTL) */ | ||
949 | |||
950 | union { /* 7: */ | ||
951 | u8 error; /* read: error */ | ||
952 | u8 feature; /* write: feature */ | ||
953 | }; | ||
954 | |||
955 | u8 nsect; /* 8: number of sectors */ | ||
956 | u8 lbal; /* 9: LBA low */ | ||
957 | u8 lbam; /* 10: LBA mid */ | ||
958 | u8 lbah; /* 11: LBA high */ | ||
959 | |||
960 | u8 device; /* 12: device select */ | ||
961 | |||
962 | union { /* 13: */ | ||
963 | u8 status; /* read: status */ | ||
964 | u8 command; /* write: command */ | ||
965 | }; | ||
966 | }; | ||
967 | |||
1065 | typedef struct ide_task_s { | 968 | typedef struct ide_task_s { |
1066 | /* | 969 | union { |
1067 | * struct hd_drive_task_hdr tf; | 970 | struct ide_taskfile tf; |
1068 | * task_struct_t tf; | 971 | u8 tf_array[14]; |
1069 | * struct hd_drive_hob_hdr hobf; | 972 | }; |
1070 | * hob_struct_t hobf; | 973 | u32 tf_flags; |
1071 | */ | ||
1072 | task_ioreg_t tfRegister[8]; | ||
1073 | task_ioreg_t hobRegister[8]; | ||
1074 | ide_reg_valid_t tf_out_flags; | ||
1075 | ide_reg_valid_t tf_in_flags; | ||
1076 | int data_phase; | 974 | int data_phase; |
1077 | int command_type; | ||
1078 | ide_pre_handler_t *prehandler; | ||
1079 | ide_handler_t *handler; | ||
1080 | struct request *rq; /* copy of request */ | 975 | struct request *rq; /* copy of request */ |
1081 | void *special; /* valid_t generally */ | 976 | void *special; /* valid_t generally */ |
1082 | } ide_task_t; | 977 | } ide_task_t; |
1083 | 978 | ||
1084 | extern u32 ide_read_24(ide_drive_t *); | 979 | void ide_tf_load(ide_drive_t *, ide_task_t *); |
980 | void ide_tf_read(ide_drive_t *, ide_task_t *); | ||
1085 | 981 | ||
1086 | extern void SELECT_DRIVE(ide_drive_t *); | 982 | extern void SELECT_DRIVE(ide_drive_t *); |
1087 | extern void SELECT_INTERRUPT(ide_drive_t *); | ||
1088 | extern void SELECT_MASK(ide_drive_t *, int); | 983 | extern void SELECT_MASK(ide_drive_t *, int); |
1089 | extern void QUIRK_LIST(ide_drive_t *); | ||
1090 | 984 | ||
1091 | extern int drive_is_ready(ide_drive_t *); | 985 | extern int drive_is_ready(ide_drive_t *); |
1092 | 986 | ||
1093 | /* | 987 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); |
1094 | * taskfile io for disks for now...and builds request from ide_ioctl | ||
1095 | */ | ||
1096 | extern ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); | ||
1097 | |||
1098 | /* | ||
1099 | * Special Flagged Register Validation Caller | ||
1100 | */ | ||
1101 | extern ide_startstop_t flagged_taskfile(ide_drive_t *, ide_task_t *); | ||
1102 | 988 | ||
1103 | extern ide_startstop_t set_multmode_intr(ide_drive_t *); | 989 | ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); |
1104 | extern ide_startstop_t set_geometry_intr(ide_drive_t *); | ||
1105 | extern ide_startstop_t recal_intr(ide_drive_t *); | ||
1106 | extern ide_startstop_t task_no_data_intr(ide_drive_t *); | ||
1107 | extern ide_startstop_t task_in_intr(ide_drive_t *); | ||
1108 | extern ide_startstop_t pre_task_out_intr(ide_drive_t *, struct request *); | ||
1109 | 990 | ||
1110 | extern int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *); | 991 | int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16); |
992 | int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); | ||
1111 | 993 | ||
1112 | int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); | 994 | int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); |
1113 | int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long); | 995 | int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long); |
@@ -1212,6 +1094,7 @@ enum { | |||
1212 | IDE_HFLAG_IO_32BIT = (1 << 24), | 1094 | IDE_HFLAG_IO_32BIT = (1 << 24), |
1213 | /* unmask IRQs */ | 1095 | /* unmask IRQs */ |
1214 | IDE_HFLAG_UNMASK_IRQS = (1 << 25), | 1096 | IDE_HFLAG_UNMASK_IRQS = (1 << 25), |
1097 | IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26), | ||
1215 | }; | 1098 | }; |
1216 | 1099 | ||
1217 | #ifdef CONFIG_BLK_DEV_OFFBOARD | 1100 | #ifdef CONFIG_BLK_DEV_OFFBOARD |
@@ -1229,7 +1112,7 @@ struct ide_port_info { | |||
1229 | void (*fixup)(ide_hwif_t *); | 1112 | void (*fixup)(ide_hwif_t *); |
1230 | ide_pci_enablebit_t enablebits[2]; | 1113 | ide_pci_enablebit_t enablebits[2]; |
1231 | hwif_chipset_t chipset; | 1114 | hwif_chipset_t chipset; |
1232 | unsigned int extra; | 1115 | u8 extra; |
1233 | u32 host_flags; | 1116 | u32 host_flags; |
1234 | u8 pio_mask; | 1117 | u8 pio_mask; |
1235 | u8 swdma_mask; | 1118 | u8 swdma_mask; |
@@ -1356,6 +1239,7 @@ static inline int ide_dev_is_sata(struct hd_driveid *id) | |||
1356 | return 0; | 1239 | return 0; |
1357 | } | 1240 | } |
1358 | 1241 | ||
1242 | u64 ide_get_lba_addr(struct ide_taskfile *, int); | ||
1359 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1243 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
1360 | 1244 | ||
1361 | typedef struct ide_pio_timings_s { | 1245 | typedef struct ide_pio_timings_s { |