libata: implement and use ops inheritance
authorTejun Heo <htejun@gmail.com>
Tue, 25 Mar 2008 03:22:49 +0000 (12:22 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 17 Apr 2008 19:44:17 +0000 (15:44 -0400)
libata lets low level drivers build ata_port_operations table and
register it with libata core layer.  This allows low level drivers
high level of flexibility but also burdens them with lots of
boilerplate entries.

This becomes worse for drivers which support related similar
controllers which differ slightly.  They share most of the operations
except for a few.  However, the driver still needs to list all
operations for each variant.  This results in large number of
duplicate entries, which is not only inefficient but also error-prone
as it becomes very difficult to tell what the actual differences are.

This duplicate boilerplates all over the low level drivers also make
updating the core layer exteremely difficult and error-prone.  When
compounded with multi-branched development model, it ends up
accumulating inconsistencies over time.  Some of those inconsistencies
cause immediate problems and fixed.  Others just remain there dormant
making maintenance increasingly difficult.

To rectify the problem, this patch implements ata_port_operations
inheritance.  To allow LLDs to easily re-use their own ops tables
overriding only specific methods, this patch implements poor man's
class inheritance.  An ops table has ->inherits field which can be set
to any ops table as long as it doesn't create a loop.  When the host
is started, the inheritance chain is followed and any operation which
isn't specified is taken from the nearest ancestor which has it
specified.  This operation is called finalization and done only once
per an ops table and the LLD doesn't have to do anything special about
it other than making the ops table non-const such that libata can
update it.

libata provides four base ops tables lower drivers can inherit from -
base, sata, pmp, sff and bmdma.  To avoid overriding these ops
accidentaly, these ops are declared const and LLDs should always
inherit these instead of using them directly.

After finalization, all the ops table are identical before and after
the patch except for setting .irq_handler to ata_interrupt in drivers
which didn't use to.  The .irq_handler doesn't have any actual effect
and the field will soon be removed by later patch.

* sata_sx4 is still using old style EH and currently doesn't take
  advantage of ops inheritance.

Signed-off-by: Tejun Heo <htejun@gmail.com>
73 files changed:
drivers/ata/ahci.c
drivers/ata/ata_generic.c
drivers/ata/ata_piix.c
drivers/ata/libata-core.c
drivers/ata/pata_acpi.c
drivers/ata/pata_ali.c
drivers/ata/pata_amd.c
drivers/ata/pata_artop.c
drivers/ata/pata_at32.c
drivers/ata/pata_atiixp.c
drivers/ata/pata_bf54x.c
drivers/ata/pata_cmd640.c
drivers/ata/pata_cmd64x.c
drivers/ata/pata_cs5520.c
drivers/ata/pata_cs5530.c
drivers/ata/pata_cs5535.c
drivers/ata/pata_cs5536.c
drivers/ata/pata_cypress.c
drivers/ata/pata_efar.c
drivers/ata/pata_hpt366.c
drivers/ata/pata_hpt37x.c
drivers/ata/pata_hpt3x2n.c
drivers/ata/pata_hpt3x3.c
drivers/ata/pata_icside.c
drivers/ata/pata_isapnp.c
drivers/ata/pata_it8213.c
drivers/ata/pata_it821x.c
drivers/ata/pata_ixp4xx_cf.c
drivers/ata/pata_jmicron.c
drivers/ata/pata_legacy.c
drivers/ata/pata_marvell.c
drivers/ata/pata_mpc52xx.c
drivers/ata/pata_mpiix.c
drivers/ata/pata_netcell.c
drivers/ata/pata_ninja32.c
drivers/ata/pata_ns87410.c
drivers/ata/pata_ns87415.c
drivers/ata/pata_oldpiix.c
drivers/ata/pata_opti.c
drivers/ata/pata_optidma.c
drivers/ata/pata_pcmcia.c
drivers/ata/pata_pdc2027x.c
drivers/ata/pata_pdc202xx_old.c
drivers/ata/pata_platform.c
drivers/ata/pata_qdi.c
drivers/ata/pata_radisys.c
drivers/ata/pata_rb500_cf.c
drivers/ata/pata_rz1000.c
drivers/ata/pata_sc1200.c
drivers/ata/pata_scc.c
drivers/ata/pata_serverworks.c
drivers/ata/pata_sil680.c
drivers/ata/pata_sis.c
drivers/ata/pata_sl82c105.c
drivers/ata/pata_triflex.c
drivers/ata/pata_via.c
drivers/ata/pata_winbond.c
drivers/ata/pdc_adma.c
drivers/ata/sata_fsl.c
drivers/ata/sata_inic162x.c
drivers/ata/sata_mv.c
drivers/ata/sata_nv.c
drivers/ata/sata_promise.c
drivers/ata/sata_qstor.c
drivers/ata/sata_sil.c
drivers/ata/sata_sil24.c
drivers/ata/sata_sis.c
drivers/ata/sata_svw.c
drivers/ata/sata_sx4.c
drivers/ata/sata_uli.c
drivers/ata/sata_via.c
drivers/ata/sata_vsc.c
include/linux/libata.h

index 8862595cb2cf67ceb363410ecc1430d69f960e27..dacb3ef0c3e61b0a2e3bbade235ffa64f34c3f88 100644 (file)
@@ -280,118 +280,46 @@ static struct scsi_host_template ahci_sht = {
        .shost_attrs            = ahci_shost_attrs,
 };
 
-static const struct ata_port_operations ahci_ops = {
+static struct ata_port_operations ahci_ops = {
+       .inherits               = &sata_pmp_port_ops,
+
        .check_status           = ahci_check_status,
        .check_altstatus        = ahci_check_status,
-       .dev_select             = ata_noop_dev_select,
-
-       .dev_config             = ahci_dev_config,
 
        .tf_read                = ahci_tf_read,
-
        .qc_defer               = sata_pmp_qc_defer_cmd_switch,
        .qc_prep                = ahci_qc_prep,
        .qc_issue               = ahci_qc_issue,
 
-       .irq_clear              = ata_noop_irq_clear,
-
-       .scr_read               = ahci_scr_read,
-       .scr_write              = ahci_scr_write,
-
        .freeze                 = ahci_freeze,
        .thaw                   = ahci_thaw,
-
        .error_handler          = ahci_error_handler,
        .post_internal_cmd      = ahci_post_internal_cmd,
-
-       .pmp_attach             = ahci_pmp_attach,
-       .pmp_detach             = ahci_pmp_detach,
-
-#ifdef CONFIG_PM
-       .port_suspend           = ahci_port_suspend,
-       .port_resume            = ahci_port_resume,
-#endif
-       .enable_pm              = ahci_enable_alpm,
-       .disable_pm             = ahci_disable_alpm,
-
-       .port_start             = ahci_port_start,
-       .port_stop              = ahci_port_stop,
-};
-
-static const struct ata_port_operations ahci_vt8251_ops = {
-       .check_status           = ahci_check_status,
-       .check_altstatus        = ahci_check_status,
-       .dev_select             = ata_noop_dev_select,
-
        .dev_config             = ahci_dev_config,
 
-       .tf_read                = ahci_tf_read,
-
-       .qc_defer               = sata_pmp_qc_defer_cmd_switch,
-       .qc_prep                = ahci_qc_prep,
-       .qc_issue               = ahci_qc_issue,
-
-       .irq_clear              = ata_noop_irq_clear,
-
        .scr_read               = ahci_scr_read,
        .scr_write              = ahci_scr_write,
-
-       .freeze                 = ahci_freeze,
-       .thaw                   = ahci_thaw,
-
-       .error_handler          = ahci_vt8251_error_handler,
-       .post_internal_cmd      = ahci_post_internal_cmd,
-
        .pmp_attach             = ahci_pmp_attach,
        .pmp_detach             = ahci_pmp_detach,
 
+       .enable_pm              = ahci_enable_alpm,
+       .disable_pm             = ahci_disable_alpm,
 #ifdef CONFIG_PM
        .port_suspend           = ahci_port_suspend,
        .port_resume            = ahci_port_resume,
 #endif
-       .enable_pm              = ahci_enable_alpm,
-       .disable_pm             = ahci_disable_alpm,
-
        .port_start             = ahci_port_start,
        .port_stop              = ahci_port_stop,
 };
 
-static const struct ata_port_operations ahci_p5wdh_ops = {
-       .check_status           = ahci_check_status,
-       .check_altstatus        = ahci_check_status,
-       .dev_select             = ata_noop_dev_select,
-
-       .dev_config             = ahci_dev_config,
-
-       .tf_read                = ahci_tf_read,
-
-       .qc_defer               = sata_pmp_qc_defer_cmd_switch,
-       .qc_prep                = ahci_qc_prep,
-       .qc_issue               = ahci_qc_issue,
-
-       .irq_clear              = ata_noop_irq_clear,
-
-       .scr_read               = ahci_scr_read,
-       .scr_write              = ahci_scr_write,
-
-       .freeze                 = ahci_freeze,
-       .thaw                   = ahci_thaw,
+static struct ata_port_operations ahci_vt8251_ops = {
+       .inherits               = &ahci_ops,
+       .error_handler          = ahci_vt8251_error_handler,
+};
 
+static struct ata_port_operations ahci_p5wdh_ops = {
+       .inherits               = &ahci_ops,
        .error_handler          = ahci_p5wdh_error_handler,
-       .post_internal_cmd      = ahci_post_internal_cmd,
-
-       .pmp_attach             = ahci_pmp_attach,
-       .pmp_detach             = ahci_pmp_detach,
-
-#ifdef CONFIG_PM
-       .port_suspend           = ahci_port_suspend,
-       .port_resume            = ahci_port_resume,
-#endif
-       .enable_pm              = ahci_enable_alpm,
-       .disable_pm             = ahci_disable_alpm,
-
-       .port_start             = ahci_port_start,
-       .port_stop              = ahci_port_stop,
 };
 
 #define AHCI_HFLAGS(flags)     .private_data   = (void *)(flags)
index 5c64ce134c6c22089965d2be18f0d5a6af050566..0b5b515ae159854337c61e285fa865decd1e36b0 100644 (file)
@@ -99,36 +99,9 @@ static struct scsi_host_template generic_sht = {
 };
 
 static struct ata_port_operations generic_port_ops = {
-       .set_mode       = generic_set_mode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .data_xfer      = ata_data_xfer,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
+       .inherits       = &ata_bmdma_port_ops,
        .cable_detect   = ata_cable_unknown,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .set_mode       = generic_set_mode,
 };
 
 static int all_generic_ide;            /* Set to claim all devices */
index 9f887b2c92df1c1efc04538a6c8c3846cd954db6..bb46b61a7c6b329a47be3274114f4ad65a6a808e 100644 (file)
@@ -294,155 +294,34 @@ static struct scsi_host_template piix_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations piix_pata_ops = {
+static struct ata_port_operations piix_pata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .cable_detect           = ata_cable_40wire,
        .set_piomode            = piix_set_piomode,
        .set_dmamode            = piix_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
        .error_handler          = piix_pata_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = ata_cable_40wire,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
+};
 
-       .port_start             = ata_sff_port_start,
+static struct ata_port_operations piix_vmw_ops = {
+       .inherits               = &piix_pata_ops,
+       .bmdma_status           = piix_vmw_bmdma_status,
 };
 
-static const struct ata_port_operations ich_pata_ops = {
-       .set_piomode            = piix_set_piomode,
-       .set_dmamode            = ich_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = piix_pata_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
+static struct ata_port_operations ich_pata_ops = {
+       .inherits               = &piix_pata_ops,
        .cable_detect           = ich_pata_cable_detect,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
+       .set_dmamode            = ich_set_dmamode,
 };
 
-static const struct ata_port_operations piix_sata_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .mode_filter            = ata_pci_default_filter,
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
+static struct ata_port_operations piix_sata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
 };
 
-static const struct ata_port_operations piix_vmw_ops = {
-       .set_piomode            = piix_set_piomode,
-       .set_dmamode            = piix_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = piix_vmw_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = piix_pata_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = ata_cable_40wire,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
-};
-
-static const struct ata_port_operations piix_sidpr_sata_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
+static struct ata_port_operations piix_sidpr_sata_ops = {
+       .inherits               = &piix_sata_ops,
        .scr_read               = piix_sidpr_scr_read,
        .scr_write              = piix_sidpr_scr_write,
-
-       .mode_filter            = ata_pci_default_filter,
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
        .error_handler          = piix_sidpr_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
 static const struct piix_map_db ich5_map_db = {
index 394edf937cf229d6d92ab51fea2b33b841ab9f29..32fa9ee397b6e85b108872c1204c7d21d9dcd8ce 100644 (file)
@@ -74,6 +74,56 @@ const unsigned long sata_deb_timing_normal[]         = {   5,  100, 2000 };
 const unsigned long sata_deb_timing_hotplug[]          = {  25,  500, 2000 };
 const unsigned long sata_deb_timing_long[]             = { 100, 2000, 5000 };
 
+const struct ata_port_operations ata_base_port_ops = {
+       .irq_clear              = ata_noop_irq_clear,
+};
+
+const struct ata_port_operations sata_port_ops = {
+       .inherits               = &ata_base_port_ops,
+
+       .qc_defer               = ata_std_qc_defer,
+       .dev_select             = ata_noop_dev_select,
+};
+
+const struct ata_port_operations sata_pmp_port_ops = {
+       .inherits               = &sata_port_ops,
+};
+
+const struct ata_port_operations ata_sff_port_ops = {
+       .inherits               = &ata_base_port_ops,
+
+       .qc_prep                = ata_qc_prep,
+       .qc_issue               = ata_qc_issue_prot,
+
+       .freeze                 = ata_bmdma_freeze,
+       .thaw                   = ata_bmdma_thaw,
+       .error_handler          = ata_bmdma_error_handler,
+       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
+
+       .dev_select             = ata_std_dev_select,
+       .check_status           = ata_check_status,
+       .tf_load                = ata_tf_load,
+       .tf_read                = ata_tf_read,
+       .exec_command           = ata_exec_command,
+       .data_xfer              = ata_data_xfer,
+       .irq_on                 = ata_irq_on,
+
+       .port_start             = ata_sff_port_start,
+       .irq_handler            = ata_interrupt,
+};
+
+const struct ata_port_operations ata_bmdma_port_ops = {
+       .inherits               = &ata_sff_port_ops,
+
+       .mode_filter            = ata_pci_default_filter,
+
+       .bmdma_setup            = ata_bmdma_setup,
+       .bmdma_start            = ata_bmdma_start,
+       .bmdma_stop             = ata_bmdma_stop,
+       .bmdma_status           = ata_bmdma_status,
+       .irq_clear              = ata_bmdma_irq_clear,
+};
+
 static unsigned int ata_dev_init_params(struct ata_device *dev,
                                        u16 heads, u16 sectors);
 static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
@@ -6971,6 +7021,56 @@ static void ata_host_stop(struct device *gendev, void *res)
                host->ops->host_stop(host);
 }
 
+/**
+ *     ata_finalize_port_ops - finalize ata_port_operations
+ *     @ops: ata_port_operations to finalize
+ *
+ *     An ata_port_operations can inherit from another ops and that
+ *     ops can again inherit from another.  This can go on as many
+ *     times as necessary as long as there is no loop in the
+ *     inheritance chain.
+ *
+ *     Ops tables are finalized when the host is started.  NULL or
+ *     unspecified entries are inherited from the closet ancestor
+ *     which has the method and the entry is populated with it.
+ *     After finalization, the ops table directly points to all the
+ *     methods and ->inherits is no longer necessary and cleared.
+ *
+ *     Using ATA_OP_NULL, inheriting ops can force a method to NULL.
+ *
+ *     LOCKING:
+ *     None.
+ */
+static void ata_finalize_port_ops(struct ata_port_operations *ops)
+{
+       static spinlock_t lock = SPIN_LOCK_UNLOCKED;
+       const struct ata_port_operations *cur;
+       void **begin = (void **)ops;
+       void **end = (void **)&ops->inherits;
+       void **pp;
+
+       if (!ops || !ops->inherits)
+               return;
+
+       spin_lock(&lock);
+
+       for (cur = ops->inherits; cur; cur = cur->inherits) {
+               void **inherit = (void **)cur;
+
+               for (pp = begin; pp < end; pp++, inherit++)
+                       if (!*pp)
+                               *pp = *inherit;
+       }
+
+       for (pp = begin; pp < end; pp++)
+               if (IS_ERR(*pp))
+                       *pp = NULL;
+
+       ops->inherits = NULL;
+
+       spin_unlock(&lock);
+}
+
 /**
  *     ata_host_start - start and freeze ports of an ATA host
  *     @host: ATA host to start ports for
@@ -6996,9 +7096,13 @@ int ata_host_start(struct ata_host *host)
        if (host->flags & ATA_HOST_STARTED)
                return 0;
 
+       ata_finalize_port_ops(host->ops);
+
        for (i = 0; i < host->n_ports; i++) {
                struct ata_port *ap = host->ports[i];
 
+               ata_finalize_port_ops(ap->ops);
+
                if (!host->ops && !ata_port_is_dummy(ap))
                        host->ops = ap->ops;
 
@@ -7060,7 +7164,7 @@ int ata_host_start(struct ata_host *host)
  */
 /* KILLME - the only user left is ipr */
 void ata_host_init(struct ata_host *host, struct device *dev,
-                  unsigned long flags, const struct ata_port_operations *ops)
+                  unsigned long flags, struct ata_port_operations *ops)
 {
        spin_lock_init(&host->lock);
        host->dev = dev;
@@ -7749,7 +7853,7 @@ static unsigned int ata_dummy_qc_issue(struct ata_queued_cmd *qc)
        return AC_ERR_SYSTEM;
 }
 
-const struct ata_port_operations ata_dummy_port_ops = {
+struct ata_port_operations ata_dummy_port_ops = {
        .check_status           = ata_dummy_check_status,
        .check_altstatus        = ata_dummy_check_status,
        .dev_select             = ata_noop_dev_select,
@@ -7777,6 +7881,11 @@ const struct ata_port_info ata_dummy_port_info = {
 EXPORT_SYMBOL_GPL(sata_deb_timing_normal);
 EXPORT_SYMBOL_GPL(sata_deb_timing_hotplug);
 EXPORT_SYMBOL_GPL(sata_deb_timing_long);
+EXPORT_SYMBOL_GPL(ata_base_port_ops);
+EXPORT_SYMBOL_GPL(sata_port_ops);
+EXPORT_SYMBOL_GPL(sata_pmp_port_ops);
+EXPORT_SYMBOL_GPL(ata_sff_port_ops);
+EXPORT_SYMBOL_GPL(ata_bmdma_port_ops);
 EXPORT_SYMBOL_GPL(ata_dummy_port_ops);
 EXPORT_SYMBOL_GPL(ata_dummy_port_info);
 EXPORT_SYMBOL_GPL(ata_std_bios_param);
index 187545c0898a4d93e3d489bd0be34c0367d09c6a..35ad488db6ed0af9c5d3c5beb74edfce5760ba4d 100644 (file)
@@ -235,39 +235,14 @@ static struct scsi_host_template pacpi_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations pacpi_ops = {
+static struct ata_port_operations pacpi_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .qc_issue               = pacpi_qc_issue_prot,
+       .cable_detect           = pacpi_cable_detect,
+       .mode_filter            = pacpi_mode_filter,
        .set_piomode            = pacpi_set_piomode,
        .set_dmamode            = pacpi_set_dmamode,
-       .mode_filter            = pacpi_mode_filter,
-
-       /* Task file is PCI ATA format, use helpers */
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
        .error_handler          = pacpi_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = pacpi_cable_detect,
-
-       /* BMDMA handling is PCI ATA format, use helpers */
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = pacpi_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       /* Timeout handling */
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       /* Generic PATA PCI ATA helpers */
        .port_start             = pacpi_port_start,
 };
 
index f3d6d9b345bafd61517c075868db7a90804a462e..b00a9cf72c31440951acccc2e2a95ad2da31875d 100644 (file)
@@ -347,29 +347,15 @@ static struct scsi_host_template ali_sht = {
  */
 
 static struct ata_port_operations ali_early_port_ops = {
-       .set_piomode    = ali_set_piomode,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
+       .inherits       = &ata_sff_port_ops,
        .cable_detect   = ata_cable_40wire,
+       .set_piomode    = ali_set_piomode,
+};
 
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+static const struct ata_port_operations ali_dma_base_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .set_piomode    = ali_set_piomode,
+       .set_dmamode    = ali_set_dmamode,
 };
 
 /*
@@ -377,115 +363,31 @@ static struct ata_port_operations ali_early_port_ops = {
  *     detect
  */
 static struct ata_port_operations ali_20_port_ops = {
-       .set_piomode    = ali_set_piomode,
-       .set_dmamode    = ali_set_dmamode,
+       .inherits       = &ali_dma_base_ops,
+       .cable_detect   = ata_cable_40wire,
        .mode_filter    = ali_20_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
        .check_atapi_dma = ali_check_atapi_dma,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
        .dev_config     = ali_lock_sectors,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /*
  *     Port operations for DMA capable ALi with cable detect
  */
 static struct ata_port_operations ali_c2_port_ops = {
-       .set_piomode    = ali_set_piomode,
-       .set_dmamode    = ali_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
+       .inherits       = &ali_dma_base_ops,
        .check_atapi_dma = ali_check_atapi_dma,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-       .dev_config     = ali_lock_sectors,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
        .cable_detect   = ali_c2_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .dev_config     = ali_lock_sectors,
 };
 
 /*
  *     Port operations for DMA capable ALi with cable detect and LBA48
  */
 static struct ata_port_operations ali_c5_port_ops = {
-       .set_piomode    = ali_set_piomode,
-       .set_dmamode    = ali_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
+       .inherits       = &ali_dma_base_ops,
        .check_atapi_dma = ali_check_atapi_dma,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
        .dev_config     = ali_warn_atapi_dma,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
        .cable_detect   = ali_c2_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 
index 90d786dfbec340513072cf63a7650f946f7fc0a3..b0cb4eaf273cb593c20d37544ee267997278a712 100644 (file)
@@ -356,204 +356,57 @@ static struct scsi_host_template amd_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
+static const struct ata_port_operations amd_base_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .error_handler  = amd_error_handler,
+};
+
 static struct ata_port_operations amd33_port_ops = {
+       .inherits       = &amd_base_port_ops,
+       .cable_detect   = ata_cable_40wire,
        .set_piomode    = amd33_set_piomode,
        .set_dmamode    = amd33_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = amd_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static struct ata_port_operations amd66_port_ops = {
+       .inherits       = &amd_base_port_ops,
+       .cable_detect   = ata_cable_unknown,
        .set_piomode    = amd66_set_piomode,
        .set_dmamode    = amd66_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = amd_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_unknown,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static struct ata_port_operations amd100_port_ops = {
+       .inherits       = &amd_base_port_ops,
+       .cable_detect   = ata_cable_unknown,
        .set_piomode    = amd100_set_piomode,
        .set_dmamode    = amd100_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = amd_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_unknown,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static struct ata_port_operations amd133_port_ops = {
+       .inherits       = &amd_base_port_ops,
+       .cable_detect   = amd_cable_detect,
        .set_piomode    = amd133_set_piomode,
        .set_dmamode    = amd133_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = amd_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = amd_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
+};
 
-       .port_start     = ata_sff_port_start,
+static const struct ata_port_operations nv_base_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .cable_detect   = ata_cable_ignore,
+       .mode_filter    = nv_mode_filter,
+       .error_handler  = nv_error_handler,
+       .host_stop      = nv_host_stop,
 };
 
 static struct ata_port_operations nv100_port_ops = {
+       .inherits       = &nv_base_port_ops,
        .set_piomode    = nv100_set_piomode,
        .set_dmamode    = nv100_set_dmamode,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = nv_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_ignore,
-       .mode_filter    = nv_mode_filter,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
-       .host_stop      = nv_host_stop,
 };
 
 static struct ata_port_operations nv133_port_ops = {
+       .inherits       = &nv_base_port_ops,
        .set_piomode    = nv133_set_piomode,
        .set_dmamode    = nv133_set_dmamode,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = nv_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_ignore,
-       .mode_filter    = nv_mode_filter,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
-       .host_stop      = nv_host_stop,
 };
 
 static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
index 7bfb7e8bdca26b7831ce0a5df4e0bd6b597fb459..0101e5aef3e05a1c12d9c7b71800334e03d29816 100644 (file)
@@ -317,69 +317,20 @@ static struct scsi_host_template artop_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations artop6210_ops = {
+static struct ata_port_operations artop6210_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .cable_detect           = ata_cable_40wire,
        .set_piomode            = artop6210_set_piomode,
        .set_dmamode            = artop6210_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
        .error_handler          = artop6210_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = ata_cable_40wire,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
-static const struct ata_port_operations artop6260_ops = {
+static struct ata_port_operations artop6260_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .cable_detect           = artop6260_cable_detect,
        .set_piomode            = artop6260_set_piomode,
        .set_dmamode            = artop6260_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
        .error_handler          = artop6260_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = artop6260_cable_detect,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
 
index d7b7b7fde3620a37d11291d7682fe683a496b828..528315587532fa6ee5ede20be56f8a55b0deadba 100644 (file)
@@ -171,28 +171,9 @@ static struct scsi_host_template at32_sht = {
 };
 
 static struct ata_port_operations at32_port_ops = {
-       .set_piomode            = pata_at32_set_piomode,
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .exec_command           = ata_exec_command,
-       .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
+       .inherits               = &ata_sff_port_ops,
        .cable_detect           = ata_cable_40wire,
-
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-
-       .data_xfer              = ata_data_xfer,
-
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
+       .set_piomode            = pata_at32_set_piomode,
 };
 
 static int __init pata_at32_init_one(struct device *dev,
index 645c47271ff5c7888826f365168d5d6d07c75b02..2655f6a17ad3223c5ba9738b94180dd2bef2152d 100644 (file)
@@ -226,36 +226,16 @@ static struct scsi_host_template atiixp_sht = {
 };
 
 static struct ata_port_operations atiixp_port_ops = {
-       .set_piomode    = atiixp_set_piomode,
-       .set_dmamode    = atiixp_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = atiixp_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = atiixp_cable_detect,
+       .inherits       = &ata_bmdma_port_ops,
 
-       .bmdma_setup    = ata_bmdma_setup,
+       .qc_prep        = ata_dumb_qc_prep,
        .bmdma_start    = atiixp_bmdma_start,
        .bmdma_stop     = atiixp_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_dumb_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
 
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = atiixp_cable_detect,
+       .set_piomode    = atiixp_set_piomode,
+       .set_dmamode    = atiixp_set_dmamode,
+       .error_handler  = atiixp_error_handler,
 };
 
 static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index 6c75fcac3cf45abb59929c7949d6a602f95aa189..7a22ef48306120eac0c02e5151c2dd898cf06e7d 100644 (file)
@@ -1363,6 +1363,8 @@ static struct scsi_host_template bfin_sht = {
 };
 
 static const struct ata_port_operations bfin_pata_ops = {
+       .inherits               = &ata_sff_port_ops,
+
        .set_piomode            = bfin_set_piomode,
        .set_dmamode            = bfin_set_dmamode,
 
@@ -1380,14 +1382,12 @@ static const struct ata_port_operations bfin_pata_ops = {
        .data_xfer              = bfin_data_xfer,
 
        .qc_prep                = ata_noop_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
 
        .freeze                 = bfin_bmdma_freeze,
        .thaw                   = bfin_bmdma_thaw,
        .error_handler          = bfin_error_handler,
        .post_internal_cmd      = bfin_bmdma_stop,
 
-       .irq_handler            = ata_interrupt,
        .irq_clear              = bfin_irq_clear,
        .irq_on                 = bfin_irq_on,
 
index 26562b814400fe152103b653b000f216b3b52f4c..061c891c8a66c39f5cce48d21ae428dd7f0238dd 100644 (file)
@@ -170,35 +170,12 @@ static struct scsi_host_template cmd640_sht = {
 };
 
 static struct ata_port_operations cmd640_port_ops = {
-       .set_piomode    = cmd640_set_piomode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = cmd640_qc_issue_prot,
-
-       /* In theory this is not needed once we kill the prefetcher */
+       .inherits       = &ata_bmdma_port_ops,
+       /* In theory xfer_noirq is not needed once we kill the prefetcher */
        .data_xfer      = ata_data_xfer_noirq,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
+       .qc_issue       = cmd640_qc_issue_prot,
+       .cable_detect   = ata_cable_40wire,
+       .set_piomode    = cmd640_set_piomode,
        .port_start     = cmd640_port_start,
 };
 
index 6aea05cc09402c92b8f5040bf3a5faae58b6f122..1ac8ecfb97e2d638d3d54b0e317ba4900f8dfbee 100644 (file)
@@ -269,103 +269,27 @@ static struct scsi_host_template cmd64x_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static struct ata_port_operations cmd64x_port_ops = {
+static const struct ata_port_operations cmd64x_base_ops = {
+       .inherits       = &ata_bmdma_port_ops,
        .set_piomode    = cmd64x_set_piomode,
        .set_dmamode    = cmd64x_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
-static struct ata_port_operations cmd646r1_port_ops = {
-       .set_piomode    = cmd64x_set_piomode,
-       .set_dmamode    = cmd64x_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
+static struct ata_port_operations cmd64x_port_ops = {
+       .inherits       = &cmd64x_base_ops,
        .cable_detect   = ata_cable_40wire,
+};
 
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
+static struct ata_port_operations cmd646r1_port_ops = {
+       .inherits       = &cmd64x_base_ops,
        .bmdma_stop     = cmd646r1_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = ata_cable_40wire,
 };
 
 static struct ata_port_operations cmd648_port_ops = {
-       .set_piomode    = cmd64x_set_piomode,
-       .set_dmamode    = cmd64x_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = cmd648_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
+       .inherits       = &cmd64x_base_ops,
        .bmdma_stop     = cmd648_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = cmd648_cable_detect,
 };
 
 static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
index 7e643099a444b978ed65ba1c603da5cbe895cd4c..46d0ce32ee5a0dde209e0d5ec91c72636c2a11af 100644 (file)
@@ -145,34 +145,11 @@ static struct scsi_host_template cs5520_sht = {
 };
 
 static struct ata_port_operations cs5520_port_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .qc_prep                = ata_dumb_qc_prep,
+       .cable_detect           = ata_cable_40wire,
        .set_piomode            = cs5520_set_piomode,
        .set_dmamode            = cs5520_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = ata_cable_40wire,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_dumb_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
 static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
index 0bb03dabcf18a61a76e7a3493cb1eaf5de7b4494..e4a16a578cac3e754f11c54e1e33a198049004cc 100644 (file)
@@ -166,37 +166,14 @@ static struct scsi_host_template cs5530_sht = {
 };
 
 static struct ata_port_operations cs5530_port_ops = {
-       .set_piomode    = cs5530_set_piomode,
-       .set_dmamode    = cs5530_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
+       .inherits       = &ata_bmdma_port_ops,
 
        .qc_prep        = ata_dumb_qc_prep,
        .qc_issue       = cs5530_qc_issue_prot,
 
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = ata_cable_40wire,
+       .set_piomode    = cs5530_set_piomode,
+       .set_dmamode    = cs5530_set_dmamode,
 };
 
 static const struct dmi_system_id palmax_dmi_table[] = {
index 48a18349c1d8b2dbf031406e5d8bff3bccbf8489..f910a8aa74377548619dbac030b4d5a6fb983d23 100644 (file)
@@ -162,37 +162,10 @@ static struct scsi_host_template cs5535_sht = {
 };
 
 static struct ata_port_operations cs5535_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .cable_detect   = cs5535_cable_detect,
        .set_piomode    = cs5535_set_piomode,
        .set_dmamode    = cs5535_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = cs5535_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /**
index f02d9107ef3b35c34e5a57e7ab7a25f05285fd95..075ee6a7be390094093b9780ccc84cc386bbe06f 100644 (file)
@@ -225,37 +225,10 @@ static struct scsi_host_template cs5536_sht = {
 };
 
 static struct ata_port_operations cs5536_port_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .cable_detect           = cs5536_cable_detect,
        .set_piomode            = cs5536_set_piomode,
        .set_dmamode            = cs5536_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = cs5536_cable_detect,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
 /**
index 07fa1ab363155592a2a6f620642967c7e8f5760f..c459553e7d1e4148eb6b5e85c78d5cc3d67351cb 100644 (file)
@@ -114,37 +114,10 @@ static struct scsi_host_template cy82c693_sht = {
 };
 
 static struct ata_port_operations cy82c693_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .cable_detect   = ata_cable_40wire,
        .set_piomode    = cy82c693_set_piomode,
        .set_dmamode    = cy82c693_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
index 8700d9dcd8c90e357c90266f3166124819d2dabe..ef62fc642c177ea742fd01b8c1db6896d76f1df3 100644 (file)
@@ -236,36 +236,12 @@ static struct scsi_host_template efar_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations efar_ops = {
+static struct ata_port_operations efar_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .cable_detect           = efar_cable_detect,
        .set_piomode            = efar_set_piomode,
        .set_dmamode            = efar_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
        .error_handler          = efar_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = efar_cable_detect,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
 
index a30028de41c014b29e4cae8bba60930d942c78b6..788955f57ff828d32746c015ca4614e3e0d8234e 100644 (file)
@@ -298,37 +298,11 @@ static struct scsi_host_template hpt36x_sht = {
  */
 
 static struct ata_port_operations hpt366_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .cable_detect   = hpt36x_cable_detect,
+       .mode_filter    = hpt366_filter,
        .set_piomode    = hpt366_set_piomode,
        .set_dmamode    = hpt366_set_dmamode,
-       .mode_filter    = hpt366_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = hpt36x_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /**
index 7d6fac43e2f9318294d4a8db2cc65f18415c8fd6..c42eec70d297cc1989b448690ca6ae5e002eb23f 100644 (file)
@@ -627,36 +627,15 @@ static struct scsi_host_template hpt37x_sht = {
  */
 
 static struct ata_port_operations hpt370_port_ops = {
-       .set_piomode    = hpt370_set_piomode,
-       .set_dmamode    = hpt370_set_dmamode,
-       .mode_filter    = hpt370_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = hpt37x_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
+       .inherits       = &ata_bmdma_port_ops,
 
-       .bmdma_setup    = ata_bmdma_setup,
        .bmdma_start    = hpt370_bmdma_start,
        .bmdma_stop     = hpt370_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
 
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .mode_filter    = hpt370_filter,
+       .set_piomode    = hpt370_set_piomode,
+       .set_dmamode    = hpt370_set_dmamode,
+       .error_handler  = hpt37x_error_handler,
 };
 
 /*
@@ -664,36 +643,8 @@ static struct ata_port_operations hpt370_port_ops = {
  */
 
 static struct ata_port_operations hpt370a_port_ops = {
-       .set_piomode    = hpt370_set_piomode,
-       .set_dmamode    = hpt370_set_dmamode,
+       .inherits       = &hpt370_port_ops,
        .mode_filter    = hpt370a_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = hpt37x_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = hpt370_bmdma_start,
-       .bmdma_stop     = hpt370_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /*
@@ -702,36 +653,13 @@ static struct ata_port_operations hpt370a_port_ops = {
  */
 
 static struct ata_port_operations hpt372_port_ops = {
-       .set_piomode    = hpt372_set_piomode,
-       .set_dmamode    = hpt372_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = hpt37x_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
+       .inherits       = &ata_bmdma_port_ops,
 
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
        .bmdma_stop     = hpt37x_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
 
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .set_piomode    = hpt372_set_piomode,
+       .set_dmamode    = hpt372_set_dmamode,
+       .error_handler  = hpt37x_error_handler,
 };
 
 /*
@@ -740,36 +668,8 @@ static struct ata_port_operations hpt372_port_ops = {
  */
 
 static struct ata_port_operations hpt374_port_ops = {
-       .set_piomode    = hpt372_set_piomode,
-       .set_dmamode    = hpt372_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
+       .inherits       = &hpt372_port_ops,
        .error_handler  = hpt374_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = hpt37x_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /**
index aa380c46b1683ff51e8635ce50f9d04a8387f368..b77b1279d7579faf7bf9faeb4557141924989103 100644 (file)
@@ -347,37 +347,15 @@ static struct scsi_host_template hpt3x2n_sht = {
  */
 
 static struct ata_port_operations hpt3x2n_port_ops = {
-       .set_piomode    = hpt3x2n_set_piomode,
-       .set_dmamode    = hpt3x2n_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
+       .inherits       = &ata_bmdma_port_ops,
 
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = hpt3x2n_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = hpt3x2n_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
        .bmdma_stop     = hpt3x2n_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
        .qc_issue       = hpt3x2n_qc_issue_prot,
 
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = hpt3x2n_cable_detect,
+       .set_piomode    = hpt3x2n_set_piomode,
+       .set_dmamode    = hpt3x2n_set_dmamode,
+       .error_handler  = hpt3x2n_error_handler,
 };
 
 /**
index 9837ab0181e85876d3f065bce4aedef9778881d0..8857d029ac2eaf1a99c5c7a97ad29cc233ef83ae 100644 (file)
@@ -106,40 +106,13 @@ static struct scsi_host_template hpt3x3_sht = {
 };
 
 static struct ata_port_operations hpt3x3_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .check_atapi_dma= hpt3x3_atapi_dma,
+       .cable_detect   = ata_cable_40wire,
        .set_piomode    = hpt3x3_set_piomode,
 #if defined(CONFIG_PATA_HPT3X3_DMA)
        .set_dmamode    = hpt3x3_set_dmamode,
 #endif
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-       .check_atapi_dma= hpt3x3_atapi_dma,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /**
index 88a1c7ae0a4d23b58cb29a6088f17460eca5e87f..ff16b0eaa2c27b6614b44803bb5949cdf566e2ac 100644 (file)
@@ -339,35 +339,19 @@ static void pata_icside_error_handler(struct ata_port *ap)
 }
 
 static struct ata_port_operations pata_icside_port_ops = {
-       .set_dmamode            = pata_icside_set_dmamode,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .exec_command           = ata_exec_command,
-       .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-
-       .cable_detect           = ata_cable_40wire,
-
-       .bmdma_setup            = pata_icside_bmdma_setup,
-       .bmdma_start            = pata_icside_bmdma_start,
-
-       .data_xfer              = ata_data_xfer_noirq,
-
+       .inherits               = &ata_sff_port_ops,
        /* no need to build any PRD tables for DMA */
        .qc_prep                = ata_noop_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
+       .data_xfer              = ata_data_xfer_noirq,
+       .bmdma_setup            = pata_icside_bmdma_setup,
+       .bmdma_start            = pata_icside_bmdma_start,
+       .bmdma_stop             = pata_icside_bmdma_stop,
+       .bmdma_status           = pata_icside_bmdma_status,
 
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
+       .cable_detect           = ata_cable_40wire,
+       .set_dmamode            = pata_icside_set_dmamode,
        .error_handler          = pata_icside_error_handler,
        .post_internal_cmd      = pata_icside_bmdma_stop,
-
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .bmdma_stop             = pata_icside_bmdma_stop,
-       .bmdma_status           = pata_icside_bmdma_status,
 };
 
 static void __devinit
index 91ca4d50db042338bcefdff8d66540be76d8909b..085913ec6f68b2d0f8b80ca1c7cf5049874a47ce 100644 (file)
@@ -24,27 +24,8 @@ static struct scsi_host_template isapnp_sht = {
 };
 
 static struct ata_port_operations isapnp_port_ops = {
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
+       .inherits       = &ata_sff_port_ops,
        .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /**
index 678a05b304d8ec6014cb189808da8ea40ae37770..9ce89522e7641a3834fcb0a9c5f5936d288f57e4 100644 (file)
@@ -246,36 +246,13 @@ static struct scsi_host_template it8213_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations it8213_ops = {
+
+static struct ata_port_operations it8213_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .cable_detect           = it8213_cable_detect,
        .set_piomode            = it8213_set_piomode,
        .set_dmamode            = it8213_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
        .error_handler          = it8213_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = it8213_cable_detect,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
 
index 7d969c911731cd5e14e859699792479f0521fc20..669d224d30ca2683b60a07b3715fad19e64dae17 100644 (file)
@@ -636,71 +636,30 @@ static struct scsi_host_template it821x_sht = {
 };
 
 static struct ata_port_operations it821x_smart_port_ops = {
-       .set_mode       = it821x_smart_set_mode,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .mode_filter    = ata_pci_default_filter,
+       .inherits       = &ata_bmdma_port_ops,
 
-       .check_status   = ata_check_status,
        .check_atapi_dma= it821x_check_atapi_dma,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-       .dev_config     = it821x_dev_config,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = it821x_ident_hack,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
        .qc_issue       = it821x_smart_qc_issue_prot,
 
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
+       .cable_detect   = it821x_ident_hack,
+       .set_mode       = it821x_smart_set_mode,
+       .dev_config     = it821x_dev_config,
 
        .port_start     = it821x_port_start,
 };
 
 static struct ata_port_operations it821x_passthru_port_ops = {
-       .set_piomode    = it821x_passthru_set_piomode,
-       .set_dmamode    = it821x_passthru_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
+       .inherits       = &ata_bmdma_port_ops,
 
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
        .check_atapi_dma= it821x_check_atapi_dma,
        .dev_select     = it821x_passthru_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_unknown,
-
-       .bmdma_setup    = ata_bmdma_setup,
        .bmdma_start    = it821x_passthru_bmdma_start,
        .bmdma_stop     = it821x_passthru_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
        .qc_issue       = it821x_passthru_qc_issue_prot,
 
-       .data_xfer      = ata_data_xfer,
-
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_handler    = ata_interrupt,
-       .irq_on         = ata_irq_on,
+       .cable_detect   = ata_cable_unknown,
+       .set_piomode    = it821x_passthru_set_piomode,
+       .set_dmamode    = it821x_passthru_set_dmamode,
 
        .port_start     = it821x_port_start,
 };
index b7e8e825a8691c4fc8e735adee9d5849cb291d06..d02629aa20da9b57fa6cc118dc7769f41ea2c958 100644 (file)
@@ -92,29 +92,10 @@ static struct scsi_host_template ixp4xx_sht = {
 };
 
 static struct ata_port_operations ixp4xx_port_ops = {
-       .set_mode               = ixp4xx_set_mode,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .exec_command           = ata_exec_command,
-       .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
+       .inherits               = &ata_sff_port_ops,
        .data_xfer              = ixp4xx_mmio_data_xfer,
        .cable_detect           = ata_cable_40wire,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
+       .set_mode               = ixp4xx_set_mode,
 };
 
 static void ixp4xx_setup_port(struct ata_port *ap,
index 69781af7b1bb8f5840f3b9d45f7131acbc1a34fa..61ff5c6b4568fa64fd48a0e46d041fbc6cca7cdf 100644 (file)
@@ -125,36 +125,9 @@ static struct scsi_host_template jmicron_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations jmicron_ops = {
-       /* Task file is PCI ATA format, use helpers */
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .mode_filter            = ata_pci_default_filter,
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
+static struct ata_port_operations jmicron_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .error_handler          = jmicron_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-
-       /* BMDMA handling is PCI ATA format, use helpers */
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       /* IRQ-related hooks */
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       /* Generic PATA PCI ATA helpers */
-       .port_start             = ata_sff_port_start,
 };
 
 
index 5329b954c5f2b6fb31bfb16ee3791e0be823a967..2474068596f4ab88e0d4c4414b07e23bf8d9f705 100644 (file)
@@ -211,6 +211,11 @@ static struct scsi_host_template legacy_sht = {
        ATA_PIO_SHT(DRV_NAME),
 };
 
+static const struct ata_port_operations legacy_base_port_ops = {
+       .inherits       = &ata_sff_port_ops,
+       .cable_detect   = ata_cable_40wire,
+};
+
 /*
  *     These ops are used if the user indicates the hardware
  *     snoops the commands to decide on the mode and handles the
@@ -220,55 +225,14 @@ static struct scsi_host_template legacy_sht = {
  */
 
 static struct ata_port_operations simple_port_ops = {
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
+       .inherits       = &legacy_base_port_ops,
        .data_xfer      = ata_data_xfer_noirq,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static struct ata_port_operations legacy_port_ops = {
-       .set_mode       = legacy_set_mode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-       .cable_detect   = ata_cable_40wire,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
+       .inherits       = &legacy_base_port_ops,
        .data_xfer      = ata_data_xfer_noirq,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .set_mode       = legacy_set_mode,
 };
 
 /*
@@ -359,30 +323,9 @@ static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
 }
 
 static struct ata_port_operations pdc20230_port_ops = {
+       .inherits       = &legacy_base_port_ops,
        .set_piomode    = pdc20230_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
        .data_xfer      = pdc_data_xfer_vlb,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /*
@@ -413,30 +356,8 @@ static void ht6560a_set_piomode(struct ata_port *ap, struct ata_device *adev)
 }
 
 static struct ata_port_operations ht6560a_port_ops = {
+       .inherits       = &legacy_base_port_ops,
        .set_piomode    = ht6560a_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,        /* Check vlb/noirq */
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /*
@@ -478,30 +399,8 @@ static void ht6560b_set_piomode(struct ata_port *ap, struct ata_device *adev)
 }
 
 static struct ata_port_operations ht6560b_port_ops = {
+       .inherits       = &legacy_base_port_ops,
        .set_piomode    = ht6560b_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,    /* FIXME: Check 32bit and noirq */
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /*
@@ -599,30 +498,8 @@ static void opti82c611a_set_piomode(struct ata_port *ap,
 
 
 static struct ata_port_operations opti82c611a_port_ops = {
+       .inherits       = &legacy_base_port_ops,
        .set_piomode    = opti82c611a_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /*
@@ -731,30 +608,9 @@ static unsigned int opti82c46x_qc_issue_prot(struct ata_queued_cmd *qc)
 }
 
 static struct ata_port_operations opti82c46x_port_ops = {
+       .inherits       = &legacy_base_port_ops,
        .set_piomode    = opti82c46x_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
        .qc_issue       = opti82c46x_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static void qdi6500_set_piomode(struct ata_port *ap, struct ata_device *adev)
@@ -916,84 +772,22 @@ static int qdi_port(struct platform_device *dev,
 }
 
 static struct ata_port_operations qdi6500_port_ops = {
+       .inherits       = &legacy_base_port_ops,
        .set_piomode    = qdi6500_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
        .qc_issue       = qdi_qc_issue_prot,
-
        .data_xfer      = vlb32_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static struct ata_port_operations qdi6580_port_ops = {
+       .inherits       = &legacy_base_port_ops,
        .set_piomode    = qdi6580_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
        .data_xfer      = vlb32_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static struct ata_port_operations qdi6580dp_port_ops = {
+       .inherits       = &legacy_base_port_ops,
        .set_piomode    = qdi6580dp_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = qdi_qc_issue_prot,
-
        .data_xfer      = vlb32_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static DEFINE_SPINLOCK(winbond_lock);
@@ -1062,29 +856,9 @@ static int winbond_port(struct platform_device *dev,
 }
 
 static struct ata_port_operations winbond_port_ops = {
+       .inherits       = &legacy_base_port_ops,
        .set_piomode    = winbond_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
        .data_xfer      = vlb32_data_xfer,
-
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static struct legacy_controller controllers[] = {
index 9de6e429d0d158f69c4f7778a690ed25be011d05..286310fc59108ded170eaa08bb435187deb68a05 100644 (file)
@@ -95,37 +95,10 @@ static struct scsi_host_template marvell_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations marvell_ops = {
-       /* Task file is PCI ATA format, use helpers */
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .mode_filter            = ata_pci_default_filter,
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = marvell_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
+static struct ata_port_operations marvell_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .cable_detect           = marvell_cable_detect,
-
-       /* BMDMA handling is PCI ATA format, use helpers */
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       /* Timeout handling */
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       /* Generic PATA PCI ATA helpers */
-       .port_start             = ata_sff_port_start,
+       .error_handler          = marvell_error_handler,
 };
 
 
index 4117b618a9d908b9ceaf8670f1d57c28460aaf8a..ac7c0822b1a78fbef7c835624e782205f1908b66 100644 (file)
@@ -269,22 +269,12 @@ static struct scsi_host_template mpc52xx_ata_sht = {
 };
 
 static struct ata_port_operations mpc52xx_ata_port_ops = {
-       .set_piomode            = mpc52xx_ata_set_piomode,
+       .inherits               = &ata_sff_port_ops,
        .dev_select             = mpc52xx_ata_dev_select,
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = mpc52xx_ata_error_handler,
        .cable_detect           = ata_cable_40wire,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
-       .port_start             = ata_sff_port_start,
+       .set_piomode            = mpc52xx_ata_set_piomode,
+       .error_handler          = mpc52xx_ata_error_handler,
+       .post_internal_cmd      = ATA_OP_NULL,
 };
 
 static int __devinit
index e8e6837110b4c3204a5f4bcde5b988aa14e378f3..dab54f8a272d6502d056575f6e4d02106a79aca5 100644 (file)
@@ -155,28 +155,11 @@ static struct scsi_host_template mpiix_sht = {
 };
 
 static struct ata_port_operations mpiix_port_ops = {
+       .inherits       = &ata_sff_port_ops,
+       .qc_issue       = mpiix_qc_issue_prot,
+       .cable_detect   = ata_cable_40wire,
        .set_piomode    = mpiix_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
        .error_handler  = mpiix_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = mpiix_qc_issue_prot,
-       .data_xfer      = ata_data_xfer,
-
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index 11f200a2a156fe69ba02434211f35237db4d855b..65389d1837b3694bdbd2e38875c76f1f51604360 100644 (file)
@@ -24,37 +24,9 @@ static struct scsi_host_template netcell_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations netcell_ops = {
-       /* Task file is PCI ATA format, use helpers */
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .mode_filter            = ata_pci_default_filter,
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
+static struct ata_port_operations netcell_ops = {
+       .inherits       = &ata_bmdma_port_ops,
        .cable_detect           = ata_cable_80wire,
-
-       /* BMDMA handling is PCI ATA format, use helpers */
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       /* IRQ-related hooks */
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       /* Generic PATA PCI ATA helpers */
-       .port_start             = ata_sff_port_start,
 };
 
 
index ce3b07cab8bc4ea65d0e54c8a3441b648bd8be81..8213d081f313c45079ccddd98dc5a6f79be4b035 100644 (file)
@@ -83,36 +83,10 @@ static struct scsi_host_template ninja32_sht = {
 };
 
 static struct ata_port_operations ninja32_port_ops = {
-       .set_piomode    = ninja32_set_piomode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
+       .inherits       = &ata_bmdma_port_ops,
        .dev_select     = ninja32_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
        .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .set_piomode    = ninja32_set_piomode,
 };
 
 static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index d2f85f107d155f17888c44812bca7cf7d75947eb..5b1982fa0be1c1f2c9d5911d2c90c6691cd6beef 100644 (file)
@@ -148,30 +148,11 @@ static struct scsi_host_template ns87410_sht = {
 };
 
 static struct ata_port_operations ns87410_port_ops = {
+       .inherits       = &ata_sff_port_ops,
+       .qc_issue       = ns87410_qc_issue_prot,
+       .cable_detect   = ata_cable_40wire,
        .set_piomode    = ns87410_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
        .error_handler  = ns87410_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ns87410_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static int ns87410_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index 78d634423cbfd66524d11337cf1ee72597e2cc56..38d86a262dbb85eed220e3d3135acd0fba433b4f 100644 (file)
@@ -297,73 +297,29 @@ static u8 ns87560_bmdma_status(struct ata_port *ap)
 {
        return ns87560_read_buggy(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
 }
+#endif         /* 87560 SuperIO Support */
 
-static const struct ata_port_operations ns87560_pata_ops = {
-       .set_piomode            = ns87415_set_piomode,
-       .mode_filter            = ata_pci_default_filter,
+static struct ata_port_operations ns87415_pata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
 
-       .tf_load                = ata_tf_load,
-       .tf_read                = ns87560_tf_read,
-       .check_status           = ns87560_check_status,
        .check_atapi_dma        = ns87415_check_atapi_dma,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = ata_cable_40wire,
-
        .bmdma_setup            = ns87415_bmdma_setup,
        .bmdma_start            = ns87415_bmdma_start,
        .bmdma_stop             = ns87415_bmdma_stop,
-       .bmdma_status           = ns87560_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
        .irq_clear              = ns87415_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
-};
-
-#endif         /* 87560 SuperIO Support */
-
-
-static const struct ata_port_operations ns87415_pata_ops = {
-       .set_piomode            = ns87415_set_piomode,
-       .mode_filter            = ata_pci_default_filter,
 
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .check_atapi_dma        = ns87415_check_atapi_dma,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
        .cable_detect           = ata_cable_40wire,
+       .set_piomode            = ns87415_set_piomode,
+};
 
-       .bmdma_setup            = ns87415_bmdma_setup,
-       .bmdma_start            = ns87415_bmdma_start,
-       .bmdma_stop             = ns87415_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ns87415_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
+#if defined(CONFIG_SUPERIO)
+static struct ata_port_operations ns87560_pata_ops = {
+       .inherits               = &ns87415_pata_ops,
+       .tf_read                = ns87560_tf_read,
+       .check_status           = ns87560_check_status,
+       .bmdma_status           = ns87560_bmdma_status,
 };
+#endif
 
 static struct scsi_host_template ns87415_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
index 45f9b3eb5b45cc8c2f4d839dc6894df59d71101a..f6062b37310d5139cb6b02303d4cb6589be958d9 100644 (file)
@@ -223,36 +223,13 @@ static struct scsi_host_template oldpiix_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations oldpiix_pata_ops = {
+static struct ata_port_operations oldpiix_pata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .qc_issue               = oldpiix_qc_issue_prot,
+       .cable_detect           = ata_cable_40wire,
        .set_piomode            = oldpiix_set_piomode,
        .set_dmamode            = oldpiix_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
        .error_handler          = oldpiix_pata_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = ata_cable_40wire,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = oldpiix_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
 
index 1deacfa0be07735979071102edd53b8bba1a7558..c4a0795c3ff4a561c46a9cd53e210fb7ac7dc997 100644 (file)
@@ -169,29 +169,10 @@ static struct scsi_host_template opti_sht = {
 };
 
 static struct ata_port_operations opti_port_ops = {
+       .inherits       = &ata_sff_port_ops,
+       .cable_detect   = ata_cable_40wire,
        .set_piomode    = opti_set_piomode,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
        .error_handler  = opti_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static int opti_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index 7495758a86fef7b4ac86a0d14a476d558215e0bb..eb4b08190e3ab9c14a053bb905d5de8b0368ab89 100644 (file)
@@ -354,73 +354,18 @@ static struct scsi_host_template optidma_sht = {
 };
 
 static struct ata_port_operations optidma_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .cable_detect   = ata_cable_40wire,
        .set_piomode    = optidma_set_pio_mode,
        .set_dmamode    = optidma_set_dma_mode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .error_handler  = optidma_error_handler,
        .set_mode       = optidma_set_mode,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .error_handler  = optidma_error_handler,
 };
 
 static struct ata_port_operations optiplus_port_ops = {
+       .inherits       = &optidma_port_ops,
        .set_piomode    = optiplus_set_pio_mode,
        .set_dmamode    = optiplus_set_dma_mode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .error_handler  = optidma_error_handler,
-       .set_mode       = optidma_set_mode,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /**
index c05b36c94d5111be1f54737e2f266967248be886..57efbf05c95fe2644d224188f2f8bc35c9102b00 100644 (file)
@@ -132,53 +132,17 @@ static struct scsi_host_template pcmcia_sht = {
 };
 
 static struct ata_port_operations pcmcia_port_ops = {
-       .set_mode       = pcmcia_set_mode,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
+       .inherits       = &ata_sff_port_ops,
        .data_xfer      = ata_data_xfer_noirq,
-
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = ata_cable_40wire,
+       .set_mode       = pcmcia_set_mode,
 };
 
 static struct ata_port_operations pcmcia_8bit_port_ops = {
-       .set_mode       = pcmcia_set_mode_8bit,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
+       .inherits       = &ata_sff_port_ops,
        .data_xfer      = ata_data_xfer_8bit,
-
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = ata_cable_40wire,
+       .set_mode       = pcmcia_set_mode_8bit,
 };
 
 #define CS_CHECK(fn, ret) \
index 229d9acd934a3348ab961f3b93824f2d855f9f37..f619c20dd19299d0a16acc8dacb894d7abf4ca33 100644 (file)
@@ -133,66 +133,18 @@ static struct scsi_host_template pdc2027x_sht = {
 };
 
 static struct ata_port_operations pdc2027x_pata100_ops = {
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
+       .inherits               = &ata_bmdma_port_ops,
        .check_atapi_dma        = pdc2027x_check_atapi_dma,
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = pdc2027x_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
        .cable_detect           = pdc2027x_cable_detect,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
+       .error_handler          = pdc2027x_error_handler,
 };
 
 static struct ata_port_operations pdc2027x_pata133_ops = {
+       .inherits               = &pdc2027x_pata100_ops,
+       .mode_filter            = pdc2027x_mode_filter,
        .set_piomode            = pdc2027x_set_piomode,
        .set_dmamode            = pdc2027x_set_dmamode,
        .set_mode               = pdc2027x_set_mode,
-       .mode_filter            = pdc2027x_mode_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .check_atapi_dma        = pdc2027x_check_atapi_dma,
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = pdc2027x_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = pdc2027x_cable_detect,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
 static struct ata_port_info pdc2027x_port_info[] = {
index 564ee0798ec179517c7ffcc5b2e0641e2b8df219..4daac20df0bc17ba862e6f9c8ccb958c59ebd616 100644 (file)
@@ -266,69 +266,24 @@ static struct scsi_host_template pdc202xx_sht = {
 };
 
 static struct ata_port_operations pdc2024x_port_ops = {
-       .set_piomode    = pdc202xx_set_piomode,
-       .set_dmamode    = pdc202xx_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .inherits               = &ata_bmdma_port_ops,
+
+       .cable_detect           = ata_cable_40wire,
+       .set_piomode            = pdc202xx_set_piomode,
+       .set_dmamode            = pdc202xx_set_dmamode,
 };
 
 static struct ata_port_operations pdc2026x_port_ops = {
-       .set_piomode    = pdc202xx_set_piomode,
-       .set_dmamode    = pdc202xx_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-       .dev_config     = pdc2026x_dev_config,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = pdc2026x_cable_detect,
-
-       .check_atapi_dma= pdc2026x_check_atapi_dma,
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = pdc2026x_bmdma_start,
-       .bmdma_stop     = pdc2026x_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = pdc2026x_port_start,
+       .inherits               = &pdc2024x_port_ops,
+
+       .check_atapi_dma        = pdc2026x_check_atapi_dma,
+       .bmdma_start            = pdc2026x_bmdma_start,
+       .bmdma_stop             = pdc2026x_bmdma_stop,
+
+       .cable_detect           = pdc2026x_cable_detect,
+       .dev_config             = pdc2026x_dev_config,
+
+       .port_start             = pdc2026x_port_start,
 };
 
 static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index cd2d03a4591af7631c12251f1b806d2cdf7181e7..0588c9b7e73e503ee239a17beb5a05fe14305671 100644 (file)
@@ -51,27 +51,11 @@ static struct scsi_host_template pata_platform_sht = {
 };
 
 static struct ata_port_operations pata_platform_port_ops = {
-       .set_mode               = pata_platform_set_mode,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = ata_cable_unknown,
-
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-
+       .inherits               = &ata_sff_port_ops,
        .data_xfer              = ata_data_xfer_noirq,
-
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
+       .cable_detect           = ata_cable_unknown,
+       .set_mode               = pata_platform_set_mode,
+       .port_start             = ATA_OP_NULL,
 };
 
 static void pata_platform_setup_port(struct ata_ioports *ioaddr,
index ccb8682300b842d1c68625865eb20281da83c9c8..d16b343d2a62cc2e801ea51a3eedfcdf8dc2078f 100644 (file)
@@ -158,55 +158,16 @@ static struct scsi_host_template qdi_sht = {
 };
 
 static struct ata_port_operations qdi6500_port_ops = {
-       .set_piomode    = qdi6500_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
+       .inherits       = &ata_sff_port_ops,
        .qc_issue       = qdi_qc_issue_prot,
-
        .data_xfer      = qdi_data_xfer,
-
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = ata_cable_40wire,
+       .set_piomode    = qdi6500_set_piomode,
 };
 
 static struct ata_port_operations qdi6580_port_ops = {
+       .inherits       = &qdi6500_port_ops,
        .set_piomode    = qdi6580_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = qdi_qc_issue_prot,
-
-       .data_xfer      = qdi_data_xfer,
-
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /**
index 3981bf84d093b70bc73b90ffa43f4563553bb631..94e60b3a1ec67ab627c9a4171944362654f36c46 100644 (file)
@@ -188,36 +188,12 @@ static struct scsi_host_template radisys_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations radisys_pata_ops = {
+static struct ata_port_operations radisys_pata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .qc_issue               = radisys_qc_issue_prot,
+       .cable_detect           = ata_cable_unknown,
        .set_piomode            = radisys_set_piomode,
        .set_dmamode            = radisys_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = ata_cable_unknown,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = radisys_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
 
index 4543c980342c3d9aff4dc08e08822ebc154ee40e..7affceec1c298835e238132ead89f3122b1ac0b9 100644 (file)
@@ -118,25 +118,11 @@ static irqreturn_t rb500_pata_irq_handler(int irq, void *dev_instance)
 }
 
 static struct ata_port_operations rb500_pata_port_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-
+       .inherits               = &ata_sff_port_ops,
        .exec_command           = rb500_pata_exec_command,
-       .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-
        .data_xfer              = rb500_pata_data_xfer,
-
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-
        .freeze                 = rb500_pata_freeze,
        .thaw                   = rb500_pata_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
 };
 
 /* ------------------------------------------------------------------------ */
index 80909a607d36c1e0c35d3728f298c93d114c8d76..a2aef7328bfcf71f35f23cd500974d2b0b0b6105 100644 (file)
@@ -57,30 +57,9 @@ static struct scsi_host_template rz1000_sht = {
 };
 
 static struct ata_port_operations rz1000_port_ops = {
-       .set_mode       = rz1000_set_mode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
+       .inherits       = &ata_sff_port_ops,
        .cable_detect   = ata_cable_40wire,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .set_mode       = rz1000_set_mode,
 };
 
 static int rz1000_fifo_disable(struct pci_dev *pdev)
index 38ce6e12ee3d44012d3c3b6aedbd83dbc5d22cfb..362b7f829d8e9cefcd5ec0711b1c32ea7a4ae139 100644 (file)
@@ -184,37 +184,12 @@ static struct scsi_host_template sc1200_sht = {
 };
 
 static struct ata_port_operations sc1200_port_ops = {
-       .set_piomode    = sc1200_set_piomode,
-       .set_dmamode    = sc1200_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
+       .inherits       = &ata_bmdma_port_ops,
        .qc_prep        = ata_dumb_qc_prep,
        .qc_issue       = sc1200_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = ata_cable_40wire,
+       .set_piomode    = sc1200_set_piomode,
+       .set_dmamode    = sc1200_set_dmamode,
 };
 
 /**
index 1833e9ef522ea94e038c1c440b613f1b4d066f68..033d1f3a82deae742e7f6fbee7383d4f100fdb62 100644 (file)
@@ -972,6 +972,8 @@ static struct scsi_host_template scc_sht = {
 };
 
 static const struct ata_port_operations scc_pata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+
        .set_piomode            = scc_set_piomode,
        .set_dmamode            = scc_set_dmamode,
        .mode_filter            = scc_mode_filter,
@@ -989,12 +991,7 @@ static const struct ata_port_operations scc_pata_ops = {
        .bmdma_status           = scc_bmdma_status,
        .data_xfer              = scc_data_xfer,
 
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-
        .freeze                 = scc_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-
        .error_handler          = scc_error_handler,
        .post_internal_cmd      = scc_bmdma_stop,
 
index 318a3698890062414cc8f0f90b629a6f482afa47..627abcf85c6e3c8e673914938e0cb2985a1e3128 100644 (file)
@@ -302,71 +302,16 @@ static struct scsi_host_template serverworks_sht = {
 };
 
 static struct ata_port_operations serverworks_osb4_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .cable_detect   = serverworks_cable_detect,
+       .mode_filter    = serverworks_osb4_filter,
        .set_piomode    = serverworks_set_piomode,
        .set_dmamode    = serverworks_set_dmamode,
-       .mode_filter    = serverworks_osb4_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = serverworks_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static struct ata_port_operations serverworks_csb_port_ops = {
-       .set_piomode    = serverworks_set_piomode,
-       .set_dmamode    = serverworks_set_dmamode,
+       .inherits       = &serverworks_osb4_port_ops,
        .mode_filter    = serverworks_csb_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = serverworks_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static int serverworks_fixup_osb4(struct pci_dev *pdev)
index 7812815a34c35d95818711f804efc534aee5ff67..0936f534d9c73a9245df70a8db908d0089349fd9 100644 (file)
@@ -196,36 +196,10 @@ static struct scsi_host_template sil680_sht = {
 };
 
 static struct ata_port_operations sil680_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .cable_detect   = sil680_cable_detect,
        .set_piomode    = sil680_set_piomode,
        .set_dmamode    = sil680_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = sil680_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /**
index dcd8457a83772cfbb0fae124f7b389be979721bc..3ed628670cd733d275981d0e8d2875b96636c963 100644 (file)
@@ -517,196 +517,51 @@ static struct scsi_host_template sis_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations sis_133_ops = {
+static struct ata_port_operations sis_133_for_sata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .set_piomode            = sis_133_set_piomode,
        .set_dmamode            = sis_133_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = sis_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
        .cable_detect           = sis_133_cable_detect,
+};
 
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
+static struct ata_port_operations sis_base_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .error_handler          = sis_error_handler,
 };
 
-static const struct ata_port_operations sis_133_for_sata_ops = {
+static struct ata_port_operations sis_133_ops = {
+       .inherits               = &sis_base_ops,
        .set_piomode            = sis_133_set_piomode,
        .set_dmamode            = sis_133_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
        .cable_detect           = sis_133_cable_detect,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
-static const struct ata_port_operations sis_133_early_ops = {
+static struct ata_port_operations sis_133_early_ops = {
+       .inherits               = &sis_base_ops,
        .set_piomode            = sis_100_set_piomode,
        .set_dmamode            = sis_133_early_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = sis_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
        .cable_detect           = sis_66_cable_detect,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
-static const struct ata_port_operations sis_100_ops = {
+static struct ata_port_operations sis_100_ops = {
+       .inherits               = &sis_base_ops,
        .set_piomode            = sis_100_set_piomode,
        .set_dmamode            = sis_100_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = sis_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
        .cable_detect           = sis_66_cable_detect,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
-static const struct ata_port_operations sis_66_ops = {
+static struct ata_port_operations sis_66_ops = {
+       .inherits               = &sis_base_ops,
        .set_piomode            = sis_old_set_piomode,
        .set_dmamode            = sis_66_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
        .cable_detect           = sis_66_cable_detect,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = sis_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
-static const struct ata_port_operations sis_old_ops = {
+static struct ata_port_operations sis_old_ops = {
+       .inherits               = &sis_base_ops,
        .set_piomode            = sis_old_set_piomode,
        .set_dmamode            = sis_old_set_dmamode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = sis_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
        .cable_detect           = ata_cable_40wire,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_handler            = ata_interrupt,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
 static const struct ata_port_info sis_info = {
index ece366bced0ce97243212e150d338c62e4a30fa6..0dd8e2f695589b1995707437c5a1b1d1d8cbbfa6 100644 (file)
@@ -239,37 +239,13 @@ static struct scsi_host_template sl82c105_sht = {
 };
 
 static struct ata_port_operations sl82c105_port_ops = {
-       .set_piomode    = sl82c105_set_piomode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = sl82c105_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
+       .inherits       = &ata_bmdma_port_ops,
+       .qc_defer       = sl82c105_qc_defer,
        .bmdma_start    = sl82c105_bmdma_start,
        .bmdma_stop     = sl82c105_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_defer       = sl82c105_qc_defer,
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = ata_cable_40wire,
+       .set_piomode    = sl82c105_set_piomode,
+       .error_handler  = sl82c105_error_handler,
 };
 
 /**
index 510569957d10fdd295cfa553a257040969aa3d96..bc4956ef0931deb1d8376dc8cfff40bfa8a068bc 100644 (file)
@@ -184,36 +184,12 @@ static struct scsi_host_template triflex_sht = {
 };
 
 static struct ata_port_operations triflex_port_ops = {
-       .set_piomode    = triflex_set_piomode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = triflex_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .bmdma_setup    = ata_bmdma_setup,
+       .inherits       = &ata_bmdma_port_ops,
        .bmdma_start    = triflex_bmdma_start,
        .bmdma_stop     = triflex_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = ata_cable_40wire,
+       .set_piomode    = triflex_set_piomode,
+       .error_handler  = triflex_error_handler,
 };
 
 static int triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index a7bc860e131037ed850c63e94644e67e0f6d7cd4..d1edb1b27480cddd21c16a53669fa878903d6852 100644 (file)
@@ -339,71 +339,16 @@ static struct scsi_host_template via_sht = {
 };
 
 static struct ata_port_operations via_port_ops = {
+       .inherits       = &ata_bmdma_port_ops,
+       .cable_detect   = via_cable_detect,
        .set_piomode    = via_set_piomode,
        .set_dmamode    = via_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
        .error_handler  = via_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = via_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
-       .data_xfer      = ata_data_xfer,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 static struct ata_port_operations via_port_ops_noirq = {
-       .set_piomode    = via_set_piomode,
-       .set_dmamode    = via_set_dmamode,
-       .mode_filter    = ata_pci_default_filter,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = via_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = via_cable_detect,
-
-       .bmdma_setup    = ata_bmdma_setup,
-       .bmdma_start    = ata_bmdma_start,
-       .bmdma_stop     = ata_bmdma_stop,
-       .bmdma_status   = ata_bmdma_status,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
+       .inherits       = &via_port_ops,
        .data_xfer      = ata_data_xfer_noirq,
-
-       .irq_handler    = ata_interrupt,
-       .irq_clear      = ata_bmdma_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
 };
 
 /**
index 9bafae9d5fe06e8aa0512f658cb05823abdf656a..f235bb0d6139bc930fc32eb568c223cee56eaa1e 100644 (file)
@@ -126,29 +126,10 @@ static struct scsi_host_template winbond_sht = {
 };
 
 static struct ata_port_operations winbond_port_ops = {
-       .set_piomode    = winbond_set_piomode,
-
-       .tf_load        = ata_tf_load,
-       .tf_read        = ata_tf_read,
-       .check_status   = ata_check_status,
-       .exec_command   = ata_exec_command,
-       .dev_select     = ata_std_dev_select,
-
-       .freeze         = ata_bmdma_freeze,
-       .thaw           = ata_bmdma_thaw,
-       .error_handler  = ata_bmdma_error_handler,
-       .post_internal_cmd = ata_bmdma_post_internal_cmd,
-       .cable_detect   = ata_cable_40wire,
-
-       .qc_prep        = ata_qc_prep,
-       .qc_issue       = ata_qc_issue_prot,
-
+       .inherits       = &ata_sff_port_ops,
        .data_xfer      = winbond_data_xfer,
-
-       .irq_clear      = ata_noop_irq_clear,
-       .irq_on         = ata_irq_on,
-
-       .port_start     = ata_sff_port_start,
+       .cable_detect   = ata_cable_40wire,
+       .set_piomode    = winbond_set_piomode,
 };
 
 /**
index fdf62de57cfcd0cb099101fb35900b9ef80bcdb2..a5706149af6b82733406329725d9c0c92387ec64 100644 (file)
@@ -148,26 +148,29 @@ static struct scsi_host_template adma_ata_sht = {
        .dma_boundary           = ADMA_DMA_BOUNDARY,
 };
 
-static const struct ata_port_operations adma_ata_ops = {
+static struct ata_port_operations adma_ata_ops = {
+       .inherits               = &ata_base_port_ops,
+
+       .dev_select             = ata_std_dev_select,
        .tf_load                = ata_tf_load,
        .tf_read                = ata_tf_read,
-       .exec_command           = ata_exec_command,
        .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-       .check_atapi_dma        = adma_check_atapi_dma,
+       .exec_command           = ata_exec_command,
        .data_xfer              = ata_data_xfer,
+       .check_atapi_dma        = adma_check_atapi_dma,
+       .bmdma_stop             = adma_bmdma_stop,
+       .bmdma_status           = adma_bmdma_status,
        .qc_prep                = adma_qc_prep,
        .qc_issue               = adma_qc_issue,
+       .irq_on                 = ata_irq_on,
+
        .freeze                 = adma_freeze,
        .thaw                   = adma_thaw,
        .error_handler          = adma_error_handler,
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
+
        .port_start             = adma_port_start,
        .port_stop              = adma_port_stop,
        .host_stop              = adma_host_stop,
-       .bmdma_stop             = adma_bmdma_stop,
-       .bmdma_status           = adma_bmdma_status,
 };
 
 static struct ata_port_info adma_port_info[] = {
index f50381b4ba06c6b57ff0f7927176ead07d021532..865030ae8f8a7c26b99d8747771b4c067060921f 100644 (file)
@@ -1198,16 +1198,15 @@ static struct scsi_host_template sata_fsl_sht = {
 };
 
 static const struct ata_port_operations sata_fsl_ops = {
+       .inherits = &sata_port_ops,
+
        .check_status = sata_fsl_check_status,
        .check_altstatus = sata_fsl_check_status,
-       .dev_select = ata_noop_dev_select,
 
        .tf_read = sata_fsl_tf_read,
 
-       .qc_defer = ata_std_qc_defer,
        .qc_prep = sata_fsl_qc_prep,
        .qc_issue = sata_fsl_qc_issue,
-       .irq_clear = ata_noop_irq_clear,
 
        .scr_read = sata_fsl_scr_read,
        .scr_write = sata_fsl_scr_write,
index bb853df865dab81b373163406f524f0c4efcd1df..047f80f5825c15b127c1b87ca24a31748eb9ecb8 100644 (file)
@@ -522,26 +522,13 @@ static int inic_port_start(struct ata_port *ap)
 }
 
 static struct ata_port_operations inic_port_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .scr_read               = inic_scr_read,
-       .scr_write              = inic_scr_write,
+       .inherits               = &ata_sff_port_ops,
 
        .bmdma_setup            = inic_bmdma_setup,
        .bmdma_start            = inic_bmdma_start,
        .bmdma_stop             = inic_bmdma_stop,
        .bmdma_status           = inic_bmdma_status,
-
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .qc_prep                = ata_qc_prep,
        .qc_issue               = inic_qc_issue,
-       .data_xfer              = ata_data_xfer,
 
        .freeze                 = inic_freeze,
        .thaw                   = inic_thaw,
@@ -549,8 +536,10 @@ static struct ata_port_operations inic_port_ops = {
        .post_internal_cmd      = inic_post_internal_cmd,
        .dev_config             = inic_dev_config,
 
-       .port_resume            = inic_port_resume,
+       .scr_read               = inic_scr_read,
+       .scr_write              = inic_scr_write,
 
+       .port_resume            = inic_port_resume,
        .port_start             = inic_port_start,
 };
 
index 52d41edadb72f0791861572af23f13e7552c8380..f341a82d27bf26366e9a4703645da6ab1c70a071 100644 (file)
@@ -526,23 +526,16 @@ static struct scsi_host_template mv6_sht = {
        .dma_boundary           = MV_DMA_BOUNDARY,
 };
 
-static const struct ata_port_operations mv5_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
+static struct ata_port_operations mv5_ops = {
+       .inherits               = &ata_sff_port_ops,
 
        .qc_prep                = mv_qc_prep,
        .qc_issue               = mv_qc_issue,
-       .data_xfer              = ata_data_xfer,
 
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .error_handler          = mv_error_handler,
        .freeze                 = mv_eh_freeze,
        .thaw                   = mv_eh_thaw,
+       .error_handler          = mv_error_handler,
+       .post_internal_cmd      = ATA_OP_NULL,
 
        .scr_read               = mv5_scr_read,
        .scr_write              = mv5_scr_write,
@@ -551,57 +544,18 @@ static const struct ata_port_operations mv5_ops = {
        .port_stop              = mv_port_stop,
 };
 
-static const struct ata_port_operations mv6_ops = {
-       .dev_config             = mv6_dev_config,
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .qc_prep                = mv_qc_prep,
-       .qc_issue               = mv_qc_issue,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .error_handler          = mv_error_handler,
-       .freeze                 = mv_eh_freeze,
-       .thaw                   = mv_eh_thaw,
+static struct ata_port_operations mv6_ops = {
+       .inherits               = &mv5_ops,
        .qc_defer               = ata_std_qc_defer,
-
+       .dev_config             = mv6_dev_config,
        .scr_read               = mv_scr_read,
        .scr_write              = mv_scr_write,
-
-       .port_start             = mv_port_start,
-       .port_stop              = mv_port_stop,
 };
 
-static const struct ata_port_operations mv_iie_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
+static struct ata_port_operations mv_iie_ops = {
+       .inherits               = &mv6_ops,
+       .dev_config             = ATA_OP_NULL,
        .qc_prep                = mv_qc_prep_iie,
-       .qc_issue               = mv_qc_issue,
-       .data_xfer              = ata_data_xfer,
-
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .error_handler          = mv_error_handler,
-       .freeze                 = mv_eh_freeze,
-       .thaw                   = mv_eh_thaw,
-       .qc_defer               = ata_std_qc_defer,
-
-       .scr_read               = mv_scr_read,
-       .scr_write              = mv_scr_write,
-
-       .port_start             = mv_port_start,
-       .port_stop              = mv_port_stop,
 };
 
 static const struct ata_port_info mv_port_info[] = {
index 9e2b4cef48f23805b9d42c4a639fbcbed757dbff..7b7ba0e26903d1ffc9570a56738801adac135397 100644 (file)
@@ -404,106 +404,41 @@ static struct scsi_host_template nv_swncq_sht = {
        .slave_configure        = nv_swncq_slave_config,
 };
 
-static const struct ata_port_operations nv_generic_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .exec_command           = ata_exec_command,
-       .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .mode_filter            = ata_pci_default_filter,
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
+static struct ata_port_operations nv_generic_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .error_handler          = nv_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .data_xfer              = ata_data_xfer,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
        .scr_read               = nv_scr_read,
        .scr_write              = nv_scr_write,
-       .port_start             = ata_sff_port_start,
 };
 
-static const struct ata_port_operations nv_nf2_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .exec_command           = ata_exec_command,
-       .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .mode_filter            = ata_pci_default_filter,
+static struct ata_port_operations nv_nf2_ops = {
+       .inherits               = &nv_generic_ops,
        .freeze                 = nv_nf2_freeze,
        .thaw                   = nv_nf2_thaw,
-       .error_handler          = nv_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .data_xfer              = ata_data_xfer,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-       .scr_read               = nv_scr_read,
-       .scr_write              = nv_scr_write,
-       .port_start             = ata_sff_port_start,
 };
 
-static const struct ata_port_operations nv_ck804_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .exec_command           = ata_exec_command,
-       .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .mode_filter            = ata_pci_default_filter,
+static struct ata_port_operations nv_ck804_ops = {
+       .inherits               = &nv_generic_ops,
        .freeze                 = nv_ck804_freeze,
        .thaw                   = nv_ck804_thaw,
-       .error_handler          = nv_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .data_xfer              = ata_data_xfer,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-       .scr_read               = nv_scr_read,
-       .scr_write              = nv_scr_write,
-       .port_start             = ata_sff_port_start,
        .host_stop              = nv_ck804_host_stop,
 };
 
-static const struct ata_port_operations nv_adma_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = nv_adma_tf_read,
+static struct ata_port_operations nv_adma_ops = {
+       .inherits               = &nv_generic_ops,
+
        .check_atapi_dma        = nv_adma_check_atapi_dma,
-       .exec_command           = ata_exec_command,
-       .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
+       .tf_read                = nv_adma_tf_read,
        .qc_defer               = ata_std_qc_defer,
        .qc_prep                = nv_adma_qc_prep,
        .qc_issue               = nv_adma_qc_issue,
-       .mode_filter            = ata_pci_default_filter,
+       .irq_clear              = nv_adma_irq_clear,
+
        .freeze                 = nv_adma_freeze,
        .thaw                   = nv_adma_thaw,
        .error_handler          = nv_adma_error_handler,
        .post_internal_cmd      = nv_adma_post_internal_cmd,
-       .data_xfer              = ata_data_xfer,
-       .irq_clear              = nv_adma_irq_clear,
-       .irq_on                 = ata_irq_on,
-       .scr_read               = nv_scr_read,
-       .scr_write              = nv_scr_write,
+
        .port_start             = nv_adma_port_start,
        .port_stop              = nv_adma_port_stop,
 #ifdef CONFIG_PM
@@ -513,29 +448,17 @@ static const struct ata_port_operations nv_adma_ops = {
        .host_stop              = nv_adma_host_stop,
 };
 
-static const struct ata_port_operations nv_swncq_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .exec_command           = ata_exec_command,
-       .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
+static struct ata_port_operations nv_swncq_ops = {
+       .inherits               = &nv_generic_ops,
+
        .qc_defer               = ata_std_qc_defer,
        .qc_prep                = nv_swncq_qc_prep,
        .qc_issue               = nv_swncq_qc_issue,
-       .mode_filter            = ata_pci_default_filter,
+
        .freeze                 = nv_mcp55_freeze,
        .thaw                   = nv_mcp55_thaw,
        .error_handler          = nv_swncq_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .data_xfer              = ata_data_xfer,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-       .scr_read               = nv_scr_read,
-       .scr_write              = nv_scr_write,
+
 #ifdef CONFIG_PM
        .port_suspend           = nv_swncq_port_suspend,
        .port_resume            = nv_swncq_port_resume,
index 37c32ab3b23b5d72ade86c385fdd108831fdfb34..e09b975c973df0a6370d188d4880616264d9398b 100644 (file)
@@ -160,74 +160,42 @@ static struct scsi_host_template pdc_ata_sht = {
        .dma_boundary           = ATA_DMA_BOUNDARY,
 };
 
-static const struct ata_port_operations pdc_sata_ops = {
+static const struct ata_port_operations pdc_common_ops = {
+       .inherits               = &ata_sff_port_ops,
+
        .tf_load                = pdc_tf_load_mmio,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
        .exec_command           = pdc_exec_command_mmio,
-       .dev_select             = ata_std_dev_select,
        .check_atapi_dma        = pdc_check_atapi_dma,
-
        .qc_prep                = pdc_qc_prep,
        .qc_issue               = pdc_qc_issue_prot,
-       .freeze                 = pdc_sata_freeze,
-       .thaw                   = pdc_sata_thaw,
-       .error_handler          = pdc_sata_error_handler,
-       .post_internal_cmd      = pdc_post_internal_cmd,
-       .cable_detect           = pdc_sata_cable_detect,
-       .data_xfer              = ata_data_xfer,
        .irq_clear              = pdc_irq_clear,
-       .irq_on                 = ata_irq_on,
 
-       .scr_read               = pdc_sata_scr_read,
-       .scr_write              = pdc_sata_scr_write,
-       .port_start             = pdc_sata_port_start,
+       .post_internal_cmd      = pdc_post_internal_cmd,
 };
 
-/* First-generation chips need a more restrictive ->check_atapi_dma op */
-static const struct ata_port_operations pdc_old_sata_ops = {
-       .tf_load                = pdc_tf_load_mmio,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = pdc_exec_command_mmio,
-       .dev_select             = ata_std_dev_select,
-       .check_atapi_dma        = pdc_old_sata_check_atapi_dma,
-
-       .qc_prep                = pdc_qc_prep,
-       .qc_issue               = pdc_qc_issue_prot,
+static struct ata_port_operations pdc_sata_ops = {
+       .inherits               = &pdc_common_ops,
+       .cable_detect           = pdc_sata_cable_detect,
        .freeze                 = pdc_sata_freeze,
        .thaw                   = pdc_sata_thaw,
        .error_handler          = pdc_sata_error_handler,
-       .post_internal_cmd      = pdc_post_internal_cmd,
-       .cable_detect           = pdc_sata_cable_detect,
-       .data_xfer              = ata_data_xfer,
-       .irq_clear              = pdc_irq_clear,
-       .irq_on                 = ata_irq_on,
-
        .scr_read               = pdc_sata_scr_read,
        .scr_write              = pdc_sata_scr_write,
        .port_start             = pdc_sata_port_start,
 };
 
-static const struct ata_port_operations pdc_pata_ops = {
-       .tf_load                = pdc_tf_load_mmio,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = pdc_exec_command_mmio,
-       .dev_select             = ata_std_dev_select,
-       .check_atapi_dma        = pdc_check_atapi_dma,
+/* First-generation chips need a more restrictive ->check_atapi_dma op */
+static struct ata_port_operations pdc_old_sata_ops = {
+       .inherits               = &pdc_sata_ops,
+       .check_atapi_dma        = pdc_old_sata_check_atapi_dma,
+};
 
-       .qc_prep                = pdc_qc_prep,
-       .qc_issue               = pdc_qc_issue_prot,
+static struct ata_port_operations pdc_pata_ops = {
+       .inherits               = &pdc_common_ops,
+       .cable_detect           = pdc_pata_cable_detect,
        .freeze                 = pdc_freeze,
        .thaw                   = pdc_thaw,
        .error_handler          = pdc_pata_error_handler,
-       .post_internal_cmd      = pdc_post_internal_cmd,
-       .cable_detect           = pdc_pata_cable_detect,
-       .data_xfer              = ata_data_xfer,
-       .irq_clear              = pdc_irq_clear,
-       .irq_on                 = ata_irq_on,
-
        .port_start             = pdc_common_port_start,
 };
 
index 2566d0926aabb289f57df7c24ab12ce35d56e3d3..107ef09814deb2c819aa6c6d44335a35e993954b 100644 (file)
@@ -131,27 +131,25 @@ static struct scsi_host_template qs_ata_sht = {
        .dma_boundary           = QS_DMA_BOUNDARY,
 };
 
-static const struct ata_port_operations qs_ata_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
+static struct ata_port_operations qs_ata_ops = {
+       .inherits               = &ata_sff_port_ops,
+
        .check_atapi_dma        = qs_check_atapi_dma,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
+       .bmdma_stop             = qs_bmdma_stop,
+       .bmdma_status           = qs_bmdma_status,
        .qc_prep                = qs_qc_prep,
        .qc_issue               = qs_qc_issue,
-       .data_xfer              = ata_data_xfer,
+
        .freeze                 = qs_freeze,
        .thaw                   = qs_thaw,
        .error_handler          = qs_error_handler,
-       .irq_clear              = ata_noop_irq_clear,
-       .irq_on                 = ata_irq_on,
+       .post_internal_cmd      = ATA_OP_NULL,
+
        .scr_read               = qs_scr_read,
        .scr_write              = qs_scr_write,
+
        .port_start             = qs_port_start,
        .host_stop              = qs_host_stop,
-       .bmdma_stop             = qs_bmdma_stop,
-       .bmdma_status           = qs_bmdma_status,
 };
 
 static const struct ata_port_info qs_port_info[] = {
index 738c1a8ae3b6e7d5cf4f66f753648e713dc0f869..eac7ca73cfa0ddcefbf8ef10309317d1e864d158 100644 (file)
@@ -170,31 +170,14 @@ static struct scsi_host_template sil_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations sil_ops = {
+static struct ata_port_operations sil_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .dev_config             = sil_dev_config,
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
        .set_mode               = sil_set_mode,
-       .mode_filter            = ata_pci_default_filter,
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
        .freeze                 = sil_freeze,
        .thaw                   = sil_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
        .scr_read               = sil_scr_read,
        .scr_write              = sil_scr_write,
-       .port_start             = ata_sff_port_start,
 };
 
 static const struct ata_port_info sil_port_info[] = {
index 7fa63950d81abcffc6a1a5b2efa8f1d4af5d6063..363fb90e1047bc74ae4aae5b104c353d28485e45 100644 (file)
@@ -390,34 +390,28 @@ static struct scsi_host_template sil24_sht = {
        .dma_boundary           = ATA_DMA_BOUNDARY,
 };
 
-static const struct ata_port_operations sil24_ops = {
-       .dev_config             = sil24_dev_config,
+static struct ata_port_operations sil24_ops = {
+       .inherits               = &sata_pmp_port_ops,
 
        .check_status           = sil24_check_status,
        .check_altstatus        = sil24_check_status,
-       .dev_select             = ata_noop_dev_select,
-
        .tf_read                = sil24_tf_read,
-
        .qc_defer               = sil24_qc_defer,
        .qc_prep                = sil24_qc_prep,
        .qc_issue               = sil24_qc_issue,
 
-       .irq_clear              = ata_noop_irq_clear,
+       .freeze                 = sil24_freeze,
+       .thaw                   = sil24_thaw,
+       .error_handler          = sil24_error_handler,
+       .post_internal_cmd      = sil24_post_internal_cmd,
+       .dev_config             = sil24_dev_config,
 
        .scr_read               = sil24_scr_read,
        .scr_write              = sil24_scr_write,
-
        .pmp_attach             = sil24_pmp_attach,
        .pmp_detach             = sil24_pmp_detach,
 
-       .freeze                 = sil24_freeze,
-       .thaw                   = sil24_thaw,
-       .error_handler          = sil24_error_handler,
-       .post_internal_cmd      = sil24_post_internal_cmd,
-
        .port_start             = sil24_port_start,
-
 #ifdef CONFIG_PM
        .port_resume            = sil24_port_resume,
 #endif
index 4becb7fde5e76b019f1866c9d8a46137bc7dd07d..9089c7ab5000c269093f6fec19cffb4e20ac5f55 100644 (file)
@@ -89,29 +89,10 @@ static struct scsi_host_template sis_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations sis_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-       .mode_filter            = ata_pci_default_filter,
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
+static struct ata_port_operations sis_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .scr_read               = sis_scr_read,
        .scr_write              = sis_scr_write,
-       .port_start             = ata_sff_port_start,
 };
 
 static const struct ata_port_info sis_port_info = {
index c8768396e006caac66743802b54793a42690164f..8636f164256ebb5070273830913bc3841428fb73 100644 (file)
@@ -334,30 +334,16 @@ static struct scsi_host_template k2_sata_sht = {
 };
 
 
-static const struct ata_port_operations k2_sata_ops = {
+static struct ata_port_operations k2_sata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .tf_load                = k2_sata_tf_load,
        .tf_read                = k2_sata_tf_read,
        .check_status           = k2_stat_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
        .check_atapi_dma        = k2_sata_check_atapi_dma,
        .bmdma_setup            = k2_bmdma_setup_mmio,
        .bmdma_start            = k2_bmdma_start_mmio,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-       .mode_filter            = ata_pci_default_filter,
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
        .scr_read               = k2_sata_scr_read,
        .scr_write              = k2_sata_scr_write,
-       .port_start             = ata_sff_port_start,
 };
 
 static const struct ata_port_info k2_port_info[] = {
index 1802f92180e4b2525c68e20634c9b7167ec18c43..8138cda86a66eb83b50fa30ef68ccd2d29640667 100644 (file)
@@ -241,7 +241,8 @@ static struct scsi_host_template pdc_sata_sht = {
        .dma_boundary           = ATA_DMA_BOUNDARY,
 };
 
-static const struct ata_port_operations pdc_20621_ops = {
+/* TODO: inherit from base port_ops after converting to new EH */
+static struct ata_port_operations pdc_20621_ops = {
        .tf_load                = pdc_tf_load_mmio,
        .tf_read                = ata_tf_read,
        .check_status           = ata_check_status,
index 764d7064fa5928c0be95d563e2cef84353fdfafa..6ecd13fefa1a1204e738058cf04e5cac8e6711ed 100644 (file)
@@ -79,34 +79,10 @@ static struct scsi_host_template uli_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations uli_ops = {
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .mode_filter            = ata_pci_default_filter,
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
+static struct ata_port_operations uli_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .scr_read               = uli_scr_read,
        .scr_write              = uli_scr_write,
-
-       .port_start             = ata_sff_port_start,
 };
 
 static const struct ata_port_info uli_port_info = {
index 9be877cb7f571074b46ed003955f7db3751339ea..6326bcf8ea5df715da13991898d66bfd41e452c7 100644 (file)
@@ -103,97 +103,23 @@ static struct scsi_host_template svia_sht = {
        ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static const struct ata_port_operations vt6420_sata_ops = {
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
+static struct ata_port_operations vt6420_sata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .freeze                 = svia_noop_freeze,
-       .thaw                   = ata_bmdma_thaw,
        .error_handler          = vt6420_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
-static const struct ata_port_operations vt6421_pata_ops = {
+static struct ata_port_operations vt6421_pata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
+       .cable_detect           = vt6421_pata_cable_detect,
        .set_piomode            = vt6421_set_pio_mode,
        .set_dmamode            = vt6421_set_dma_mode,
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .cable_detect           = vt6421_pata_cable_detect,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
-       .port_start             = ata_sff_port_start,
 };
 
-static const struct ata_port_operations vt6421_sata_ops = {
-       .mode_filter            = ata_pci_default_filter,
-
-       .tf_load                = ata_tf_load,
-       .tf_read                = ata_tf_read,
-       .check_status           = ata_check_status,
-       .exec_command           = ata_exec_command,
-       .dev_select             = ata_std_dev_select,
-
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-
-       .freeze                 = ata_bmdma_freeze,
-       .thaw                   = ata_bmdma_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
-
+static struct ata_port_operations vt6421_sata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .scr_read               = svia_scr_read,
        .scr_write              = svia_scr_write,
-
-       .port_start             = ata_sff_port_start,
 };
 
 static const struct ata_port_info vt6420_port_info = {
index fd6855f0bf48c005edf76b1be0f9957ffcbeb3a2..8045a72dc55910af066576f1a5751f3f9981fbc8 100644 (file)
@@ -304,29 +304,14 @@ static struct scsi_host_template vsc_sata_sht = {
 };
 
 
-static const struct ata_port_operations vsc_sata_ops = {
+static struct ata_port_operations vsc_sata_ops = {
+       .inherits               = &ata_bmdma_port_ops,
        .tf_load                = vsc_sata_tf_load,
        .tf_read                = vsc_sata_tf_read,
-       .exec_command           = ata_exec_command,
-       .check_status           = ata_check_status,
-       .dev_select             = ata_std_dev_select,
-       .bmdma_setup            = ata_bmdma_setup,
-       .bmdma_start            = ata_bmdma_start,
-       .bmdma_stop             = ata_bmdma_stop,
-       .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
-       .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_data_xfer,
-       .mode_filter            = ata_pci_default_filter,
        .freeze                 = vsc_freeze,
        .thaw                   = vsc_thaw,
-       .error_handler          = ata_bmdma_error_handler,
-       .post_internal_cmd      = ata_bmdma_post_internal_cmd,
-       .irq_clear              = ata_bmdma_irq_clear,
-       .irq_on                 = ata_irq_on,
        .scr_read               = vsc_sata_scr_read,
        .scr_write              = vsc_sata_scr_write,
-       .port_start             = ata_sff_port_start,
 };
 
 static void __devinit vsc_sata_setup_port(struct ata_ioports *port,
index eccc38e175685ae5a2745cba03c6306c68079a18..46aa4ab64891ed22b068a4178fed3edc59773574 100644 (file)
@@ -433,7 +433,7 @@ struct ata_host {
        void __iomem * const    *iomap;
        unsigned int            n_ports;
        void                    *private_data;
-       const struct ata_port_operations *ops;
+       struct ata_port_operations *ops;
        unsigned long           flags;
 #ifdef CONFIG_ATA_ACPI
        acpi_handle             acpi_handle;
@@ -602,7 +602,7 @@ struct ata_link {
 
 struct ata_port {
        struct Scsi_Host        *scsi_host; /* our co-allocated scsi host */
-       const struct ata_port_operations *ops;
+       struct ata_port_operations *ops;
        spinlock_t              *lock;
        unsigned long           flags;  /* ATA_FLAG_xxx */
        unsigned int            pflags; /* ATA_PFLAG_xxx */
@@ -664,6 +664,13 @@ struct ata_port {
        u8                      sector_buf[ATA_SECT_SIZE]; /* owned by EH */
 };
 
+/* The following initializer overrides a method to NULL whether one of
+ * its parent has the method defined or not.  This is equivalent to
+ * ERR_PTR(-ENOENT).  Unfortunately, ERR_PTR doesn't render a constant
+ * expression and thus can't be used as an initializer.
+ */
+#define ATA_OP_NULL            (void *)(unsigned long)(-ENOENT)
+
 struct ata_port_operations {
        /*
         * Command execution
@@ -733,6 +740,12 @@ struct ata_port_operations {
        void (*phy_reset)(struct ata_port *ap);
        void (*eng_timeout)(struct ata_port *ap);
        irq_handler_t irq_handler;
+
+       /*
+        * ->inherits must be the last field and all the preceding
+        * fields must be pointers.
+        */
+       const struct ata_port_operations        *inherits;
 };
 
 struct ata_port_info {
@@ -742,7 +755,7 @@ struct ata_port_info {
        unsigned long           pio_mask;
        unsigned long           mwdma_mask;
        unsigned long           udma_mask;
-       const struct ata_port_operations *port_ops;
+       struct ata_port_operations *port_ops;
        irq_handler_t           irq_handler;
        void                    *private_data;
 };
@@ -765,7 +778,7 @@ extern const unsigned long sata_deb_timing_normal[];
 extern const unsigned long sata_deb_timing_hotplug[];
 extern const unsigned long sata_deb_timing_long[];
 
-extern const struct ata_port_operations ata_dummy_port_ops;
+extern struct ata_port_operations ata_dummy_port_ops;
 extern const struct ata_port_info ata_dummy_port_info;
 
 static inline const unsigned long *
@@ -812,7 +825,7 @@ extern int ata_host_activate(struct ata_host *host, int irq,
                             struct scsi_host_template *sht);
 extern void ata_host_detach(struct ata_host *host);
 extern void ata_host_init(struct ata_host *, struct device *,
-                         unsigned long, const struct ata_port_operations *);
+                         unsigned long, struct ata_port_operations *);
 extern int ata_scsi_detect(struct scsi_host_template *sht);
 extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
 extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));