aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:14 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:14 -0400
commitac95beedf8bc97b24f9540d4da9952f07221c023 (patch)
treec29837142c8083b6fcaf1767abcb0a4533676cd1 /include/linux/ide.h
parent4a27214d7be31e122db4102166f49ec15958e8e9 (diff)
ide: add struct ide_port_ops (take 2)
* Move hooks for port/host specific methods from ide_hwif_t to 'struct ide_port_ops'. * Add 'const struct ide_port_ops *port_ops' to 'struct ide_port_info' and ide_hwif_t. * Update host drivers and core code accordingly. While at it: * Rename ata66_*() cable detect functions to *_cable_detect() to match the standard naming. (Suggested by Sergei Shtylyov) v2: * Fix build for bast-ide. (Noticed by Andrew Morton) Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h56
1 files changed, 30 insertions, 26 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index f20410dd4482..b594f04a67f4 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -387,6 +387,32 @@ typedef struct ide_drive_s {
387 387
388struct ide_port_info; 388struct ide_port_info;
389 389
390struct ide_port_ops {
391 /* host specific initialization of devices on a port */
392 void (*port_init_devs)(struct hwif_s *);
393 /* routine to program host for PIO mode */
394 void (*set_pio_mode)(ide_drive_t *, const u8);
395 /* routine to program host for DMA mode */
396 void (*set_dma_mode)(ide_drive_t *, const u8);
397 /* tweaks hardware to select drive */
398 void (*selectproc)(ide_drive_t *);
399 /* chipset polling based on hba specifics */
400 int (*reset_poll)(ide_drive_t *);
401 /* chipset specific changes to default for device-hba resets */
402 void (*pre_reset)(ide_drive_t *);
403 /* routine to reset controller after a disk reset */
404 void (*resetproc)(ide_drive_t *);
405 /* special host masking for drive selection */
406 void (*maskproc)(ide_drive_t *, int);
407 /* check host's drive quirk list */
408 void (*quirkproc)(ide_drive_t *);
409
410 u8 (*mdma_filter)(ide_drive_t *);
411 u8 (*udma_filter)(ide_drive_t *);
412
413 u8 (*cable_detect)(struct hwif_s *);
414};
415
390typedef struct hwif_s { 416typedef struct hwif_s {
391 struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ 417 struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
392 struct hwif_s *mate; /* other hwif from same PCI chip */ 418 struct hwif_s *mate; /* other hwif from same PCI chip */
@@ -426,32 +452,7 @@ typedef struct hwif_s {
426 452
427 void (*rw_disk)(ide_drive_t *, struct request *); 453 void (*rw_disk)(ide_drive_t *, struct request *);
428 454
429#if 0 455 const struct ide_port_ops *port_ops;
430 ide_hwif_ops_t *hwifops;
431#else
432 /* host specific initialization of devices on a port */
433 void (*port_init_devs)(struct hwif_s *);
434 /* routine to program host for PIO mode */
435 void (*set_pio_mode)(ide_drive_t *, const u8);
436 /* routine to program host for DMA mode */
437 void (*set_dma_mode)(ide_drive_t *, const u8);
438 /* tweaks hardware to select drive */
439 void (*selectproc)(ide_drive_t *);
440 /* chipset polling based on hba specifics */
441 int (*reset_poll)(ide_drive_t *);
442 /* chipset specific changes to default for device-hba resets */
443 void (*pre_reset)(ide_drive_t *);
444 /* routine to reset controller after a disk reset */
445 void (*resetproc)(ide_drive_t *);
446 /* special host masking for drive selection */
447 void (*maskproc)(ide_drive_t *, int);
448 /* check host's drive quirk list */
449 void (*quirkproc)(ide_drive_t *);
450#endif
451 u8 (*mdma_filter)(ide_drive_t *);
452 u8 (*udma_filter)(ide_drive_t *);
453
454 u8 (*cable_detect)(struct hwif_s *);
455 456
456 void (*ata_input_data)(ide_drive_t *, void *, u32); 457 void (*ata_input_data)(ide_drive_t *, void *, u32);
457 void (*ata_output_data)(ide_drive_t *, void *, u32); 458 void (*ata_output_data)(ide_drive_t *, void *, u32);
@@ -1106,6 +1107,9 @@ struct ide_port_info {
1106 void (*init_iops)(ide_hwif_t *); 1107 void (*init_iops)(ide_hwif_t *);
1107 void (*init_hwif)(ide_hwif_t *); 1108 void (*init_hwif)(ide_hwif_t *);
1108 void (*init_dma)(ide_hwif_t *, unsigned long); 1109 void (*init_dma)(ide_hwif_t *, unsigned long);
1110
1111 const struct ide_port_ops *port_ops;
1112
1109 ide_pci_enablebit_t enablebits[2]; 1113 ide_pci_enablebit_t enablebits[2];
1110 hwif_chipset_t chipset; 1114 hwif_chipset_t chipset;
1111 u8 extra; 1115 u8 extra;