aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-06-15 06:02:23 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-15 06:02:23 -0400
commit9cbc1cb8cd46ce1f7645b9de249b2ce8460129bb (patch)
tree8d104ec2a459346b99413b0b77421ca7b9936c1a /include/linux/ide.h
parentca44d6e60f9de26281fda203f58b570e1748c015 (diff)
parent45e3e1935e2857c54783291107d33323b3ef33c8 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: Documentation/feature-removal-schedule.txt drivers/scsi/fcoe/fcoe.c net/core/drop_monitor.c net/core/net-traces.c
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h75
1 files changed, 33 insertions, 42 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index ff65fffb078f..a6c6a2fad7c8 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -26,6 +26,9 @@
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/mutex.h> 27#include <asm/mutex.h>
28 28
29/* for request_sense */
30#include <linux/cdrom.h>
31
29#if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300) 32#if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300)
30# define SUPPORT_VLB_SYNC 0 33# define SUPPORT_VLB_SYNC 0
31#else 34#else
@@ -175,7 +178,7 @@ typedef u8 hwif_chipset_t;
175/* 178/*
176 * Structure to hold all information about the location of this port 179 * Structure to hold all information about the location of this port
177 */ 180 */
178typedef struct hw_regs_s { 181struct ide_hw {
179 union { 182 union {
180 struct ide_io_ports io_ports; 183 struct ide_io_ports io_ports;
181 unsigned long io_ports_array[IDE_NR_PORTS]; 184 unsigned long io_ports_array[IDE_NR_PORTS];
@@ -183,12 +186,11 @@ typedef struct hw_regs_s {
183 186
184 int irq; /* our irq number */ 187 int irq; /* our irq number */
185 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ 188 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
186 hwif_chipset_t chipset;
187 struct device *dev, *parent; 189 struct device *dev, *parent;
188 unsigned long config; 190 unsigned long config;
189} hw_regs_t; 191};
190 192
191static inline void ide_std_init_ports(hw_regs_t *hw, 193static inline void ide_std_init_ports(struct ide_hw *hw,
192 unsigned long io_addr, 194 unsigned long io_addr,
193 unsigned long ctl_addr) 195 unsigned long ctl_addr)
194{ 196{
@@ -215,21 +217,12 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
215 217
216/* 218/*
217 * Special Driver Flags 219 * Special Driver Flags
218 *
219 * set_geometry : respecify drive geometry
220 * recalibrate : seek to cyl 0
221 * set_multmode : set multmode count
222 * reserved : unused
223 */ 220 */
224typedef union { 221enum {
225 unsigned all : 8; 222 IDE_SFLAG_SET_GEOMETRY = (1 << 0),
226 struct { 223 IDE_SFLAG_RECALIBRATE = (1 << 1),
227 unsigned set_geometry : 1; 224 IDE_SFLAG_SET_MULTMODE = (1 << 2),
228 unsigned recalibrate : 1; 225};
229 unsigned set_multmode : 1;
230 unsigned reserved : 5;
231 } b;
232} special_t;
233 226
234/* 227/*
235 * Status returned from various ide_ functions 228 * Status returned from various ide_ functions
@@ -324,7 +317,6 @@ struct ide_cmd {
324 unsigned int cursg_ofs; 317 unsigned int cursg_ofs;
325 318
326 struct request *rq; /* copy of request */ 319 struct request *rq; /* copy of request */
327 void *special; /* valid_t generally */
328}; 320};
329 321
330/* ATAPI packet command flags */ 322/* ATAPI packet command flags */
@@ -360,11 +352,7 @@ struct ide_atapi_pc {
360 352
361 /* data buffer */ 353 /* data buffer */
362 u8 *buf; 354 u8 *buf;
363 /* current buffer position */
364 u8 *cur_pos;
365 int buf_size; 355 int buf_size;
366 /* missing/available data on the current buffer */
367 int b_count;
368 356
369 /* the corresponding request */ 357 /* the corresponding request */
370 struct request *rq; 358 struct request *rq;
@@ -377,10 +365,6 @@ struct ide_atapi_pc {
377 */ 365 */
378 u8 pc_buf[IDE_PC_BUFFER_SIZE]; 366 u8 pc_buf[IDE_PC_BUFFER_SIZE];
379 367
380 /* idetape only */
381 struct idetape_bh *bh;
382 char *b_data;
383
384 unsigned long timeout; 368 unsigned long timeout;
385}; 369};
386 370
@@ -397,6 +381,7 @@ struct ide_drive_s;
397struct ide_disk_ops { 381struct ide_disk_ops {
398 int (*check)(struct ide_drive_s *, const char *); 382 int (*check)(struct ide_drive_s *, const char *);
399 int (*get_capacity)(struct ide_drive_s *); 383 int (*get_capacity)(struct ide_drive_s *);
384 u64 (*set_capacity)(struct ide_drive_s *, u64);
400 void (*setup)(struct ide_drive_s *); 385 void (*setup)(struct ide_drive_s *);
401 void (*flush)(struct ide_drive_s *); 386 void (*flush)(struct ide_drive_s *);
402 int (*init_media)(struct ide_drive_s *, struct gendisk *); 387 int (*init_media)(struct ide_drive_s *, struct gendisk *);
@@ -474,6 +459,8 @@ enum {
474 IDE_DFLAG_NICE1 = (1 << 5), 459 IDE_DFLAG_NICE1 = (1 << 5),
475 /* device is physically present */ 460 /* device is physically present */
476 IDE_DFLAG_PRESENT = (1 << 6), 461 IDE_DFLAG_PRESENT = (1 << 6),
462 /* disable Host Protected Area */
463 IDE_DFLAG_NOHPA = (1 << 7),
477 /* id read from device (synthetic if not set) */ 464 /* id read from device (synthetic if not set) */
478 IDE_DFLAG_ID_READ = (1 << 8), 465 IDE_DFLAG_ID_READ = (1 << 8),
479 IDE_DFLAG_NOPROBE = (1 << 9), 466 IDE_DFLAG_NOPROBE = (1 << 9),
@@ -512,6 +499,7 @@ enum {
512 /* write protect */ 499 /* write protect */
513 IDE_DFLAG_WP = (1 << 29), 500 IDE_DFLAG_WP = (1 << 29),
514 IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30), 501 IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30),
502 IDE_DFLAG_NIEN_QUIRK = (1 << 31),
515}; 503};
516 504
517struct ide_drive_s { 505struct ide_drive_s {
@@ -536,14 +524,13 @@ struct ide_drive_s {
536 unsigned long sleep; /* sleep until this time */ 524 unsigned long sleep; /* sleep until this time */
537 unsigned long timeout; /* max time to wait for irq */ 525 unsigned long timeout; /* max time to wait for irq */
538 526
539 special_t special; /* special action flags */ 527 u8 special_flags; /* special action flags */
540 528
541 u8 select; /* basic drive/head select reg value */ 529 u8 select; /* basic drive/head select reg value */
542 u8 retry_pio; /* retrying dma capable host in pio */ 530 u8 retry_pio; /* retrying dma capable host in pio */
543 u8 waiting_for_dma; /* dma currently in progress */ 531 u8 waiting_for_dma; /* dma currently in progress */
544 u8 dma; /* atapi dma flag */ 532 u8 dma; /* atapi dma flag */
545 533
546 u8 quirk_list; /* considered quirky, set for a specific host */
547 u8 init_speed; /* transfer rate set at boot */ 534 u8 init_speed; /* transfer rate set at boot */
548 u8 current_speed; /* current transfer rate set */ 535 u8 current_speed; /* current transfer rate set */
549 u8 desired_speed; /* desired transfer rate set */ 536 u8 desired_speed; /* desired transfer rate set */
@@ -568,8 +555,7 @@ struct ide_drive_s {
568 unsigned int drive_data; /* used by set_pio_mode/dev_select() */ 555 unsigned int drive_data; /* used by set_pio_mode/dev_select() */
569 unsigned int failures; /* current failure count */ 556 unsigned int failures; /* current failure count */
570 unsigned int max_failures; /* maximum allowed failure count */ 557 unsigned int max_failures; /* maximum allowed failure count */
571 u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ 558 u64 probed_capacity;/* initial/native media capacity */
572
573 u64 capacity64; /* total number of sectors */ 559 u64 capacity64; /* total number of sectors */
574 560
575 int lun; /* logical unit */ 561 int lun; /* logical unit */
@@ -593,16 +579,16 @@ struct ide_drive_s {
593 /* callback for packet commands */ 579 /* callback for packet commands */
594 int (*pc_callback)(struct ide_drive_s *, int); 580 int (*pc_callback)(struct ide_drive_s *, int);
595 581
596 void (*pc_update_buffers)(struct ide_drive_s *, struct ide_atapi_pc *);
597 int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *,
598 unsigned int, int);
599
600 ide_startstop_t (*irq_handler)(struct ide_drive_s *); 582 ide_startstop_t (*irq_handler)(struct ide_drive_s *);
601 583
602 unsigned long atapi_flags; 584 unsigned long atapi_flags;
603 585
604 struct ide_atapi_pc request_sense_pc; 586 struct ide_atapi_pc request_sense_pc;
605 struct request request_sense_rq; 587
588 /* current sense rq and buffer */
589 bool sense_rq_armed;
590 struct request sense_rq;
591 struct request_sense sense_data;
606}; 592};
607 593
608typedef struct ide_drive_s ide_drive_t; 594typedef struct ide_drive_s ide_drive_t;
@@ -1109,7 +1095,7 @@ void ide_fix_driveid(u16 *);
1109 1095
1110extern void ide_fixstring(u8 *, const int, const int); 1096extern void ide_fixstring(u8 *, const int, const int);
1111 1097
1112int ide_busy_sleep(ide_hwif_t *, unsigned long, int); 1098int ide_busy_sleep(ide_drive_t *, unsigned long, int);
1113 1099
1114int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); 1100int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
1115 1101
@@ -1174,7 +1160,10 @@ int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *);
1174int ide_do_start_stop(ide_drive_t *, struct gendisk *, int); 1160int ide_do_start_stop(ide_drive_t *, struct gendisk *, int);
1175int ide_set_media_lock(ide_drive_t *, struct gendisk *, int); 1161int ide_set_media_lock(ide_drive_t *, struct gendisk *, int);
1176void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *); 1162void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *);
1177void ide_retry_pc(ide_drive_t *, struct gendisk *); 1163void ide_retry_pc(ide_drive_t *drive);
1164
1165void ide_prep_sense(ide_drive_t *drive, struct request *rq);
1166int ide_queue_sense_rq(ide_drive_t *drive, void *special);
1178 1167
1179int ide_cd_expiry(ide_drive_t *); 1168int ide_cd_expiry(ide_drive_t *);
1180 1169
@@ -1225,7 +1214,7 @@ static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev)
1225} 1214}
1226 1215
1227void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, 1216void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *,
1228 hw_regs_t *, hw_regs_t **); 1217 struct ide_hw *, struct ide_hw **);
1229void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); 1218void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
1230 1219
1231#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 1220#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
@@ -1464,16 +1453,18 @@ static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {}
1464void ide_register_region(struct gendisk *); 1453void ide_register_region(struct gendisk *);
1465void ide_unregister_region(struct gendisk *); 1454void ide_unregister_region(struct gendisk *);
1466 1455
1456void ide_check_nien_quirk_list(ide_drive_t *);
1467void ide_undecoded_slave(ide_drive_t *); 1457void ide_undecoded_slave(ide_drive_t *);
1468 1458
1469void ide_port_apply_params(ide_hwif_t *); 1459void ide_port_apply_params(ide_hwif_t *);
1470int ide_sysfs_register_port(ide_hwif_t *); 1460int ide_sysfs_register_port(ide_hwif_t *);
1471 1461
1472struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); 1462struct ide_host *ide_host_alloc(const struct ide_port_info *, struct ide_hw **,
1463 unsigned int);
1473void ide_host_free(struct ide_host *); 1464void ide_host_free(struct ide_host *);
1474int ide_host_register(struct ide_host *, const struct ide_port_info *, 1465int ide_host_register(struct ide_host *, const struct ide_port_info *,
1475 hw_regs_t **); 1466 struct ide_hw **);
1476int ide_host_add(const struct ide_port_info *, hw_regs_t **, 1467int ide_host_add(const struct ide_port_info *, struct ide_hw **, unsigned int,
1477 struct ide_host **); 1468 struct ide_host **);
1478void ide_host_remove(struct ide_host *); 1469void ide_host_remove(struct ide_host *);
1479int ide_legacy_device_add(const struct ide_port_info *, unsigned long); 1470int ide_legacy_device_add(const struct ide_port_info *, unsigned long);