Commit 1c5afdf7 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

libata-sff: separate out BMDMA init

Separate out ata_pci_bmdma_prepare_host() and ata_pci_bmdma_init_one()
from their SFF counterparts.  SFF ones no longer try to initialize
BMDMA or set PCI master.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent c3b28894
...@@ -155,7 +155,7 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id ...@@ -155,7 +155,7 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id
return rc; return rc;
pcim_pin_device(dev); pcim_pin_device(dev);
} }
return ata_pci_sff_init_one(dev, ppi, &generic_sht, NULL, 0); return ata_pci_bmdma_init_one(dev, ppi, &generic_sht, NULL, 0);
} }
static struct pci_device_id ata_generic[] = { static struct pci_device_id ata_generic[] = {
......
...@@ -1589,7 +1589,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev, ...@@ -1589,7 +1589,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
hpriv->map = piix_init_sata_map(pdev, port_info, hpriv->map = piix_init_sata_map(pdev, port_info,
piix_map_db_table[ent->driver_data]); piix_map_db_table[ent->driver_data]);
rc = ata_pci_sff_prepare_host(pdev, ppi, &host); rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
if (rc) if (rc)
return rc; return rc;
host->private_data = hpriv; host->private_data = hpriv;
......
...@@ -2315,13 +2315,13 @@ int ata_pci_sff_init_host(struct ata_host *host) ...@@ -2315,13 +2315,13 @@ int ata_pci_sff_init_host(struct ata_host *host)
EXPORT_SYMBOL_GPL(ata_pci_sff_init_host); EXPORT_SYMBOL_GPL(ata_pci_sff_init_host);
/** /**
* ata_pci_sff_prepare_host - helper to prepare native PCI ATA host * ata_pci_sff_prepare_host - helper to prepare PCI PIO-only SFF ATA host
* @pdev: target PCI device * @pdev: target PCI device
* @ppi: array of port_info, must be enough for two ports * @ppi: array of port_info, must be enough for two ports
* @r_host: out argument for the initialized ATA host * @r_host: out argument for the initialized ATA host
* *
* Helper to allocate ATA host for @pdev, acquire all native PCI * Helper to allocate PIO-only SFF ATA host for @pdev, acquire
* resources and initialize it accordingly in one go. * all PCI resources and initialize it accordingly in one go.
* *
* LOCKING: * LOCKING:
* Inherited from calling layer (may sleep). * Inherited from calling layer (may sleep).
...@@ -2351,9 +2351,6 @@ int ata_pci_sff_prepare_host(struct pci_dev *pdev, ...@@ -2351,9 +2351,6 @@ int ata_pci_sff_prepare_host(struct pci_dev *pdev,
if (rc) if (rc)
goto err_out; goto err_out;
/* init DMA related stuff */
ata_pci_bmdma_init(host);
devres_remove_group(&pdev->dev, NULL); devres_remove_group(&pdev->dev, NULL);
*r_host = host; *r_host = host;
return 0; return 0;
...@@ -2458,8 +2455,21 @@ int ata_pci_sff_activate_host(struct ata_host *host, ...@@ -2458,8 +2455,21 @@ int ata_pci_sff_activate_host(struct ata_host *host,
} }
EXPORT_SYMBOL_GPL(ata_pci_sff_activate_host); EXPORT_SYMBOL_GPL(ata_pci_sff_activate_host);
static const struct ata_port_info *ata_sff_find_valid_pi(
const struct ata_port_info * const *ppi)
{
int i;
/* look up the first valid port_info */
for (i = 0; i < 2 && ppi[i]; i++)
if (ppi[i]->port_ops != &ata_dummy_port_ops)
return ppi[i];
return NULL;
}
/** /**
* ata_pci_sff_init_one - Initialize/register PCI IDE host controller * ata_pci_sff_init_one - Initialize/register PIO-only PCI IDE controller
* @pdev: Controller to be initialized * @pdev: Controller to be initialized
* @ppi: array of port_info, must be enough for two ports * @ppi: array of port_info, must be enough for two ports
* @sht: scsi_host_template to use when registering the host * @sht: scsi_host_template to use when registering the host
...@@ -2468,11 +2478,7 @@ EXPORT_SYMBOL_GPL(ata_pci_sff_activate_host); ...@@ -2468,11 +2478,7 @@ EXPORT_SYMBOL_GPL(ata_pci_sff_activate_host);
* *
* This is a helper function which can be called from a driver's * This is a helper function which can be called from a driver's
* xxx_init_one() probe function if the hardware uses traditional * xxx_init_one() probe function if the hardware uses traditional
* IDE taskfile registers. * IDE taskfile registers and is PIO only.
*
* This function calls pci_enable_device(), reserves its register
* regions, sets the dma mask, enables bus master mode, and calls
* ata_device_add()
* *
* ASSUMPTION: * ASSUMPTION:
* Nobody makes a single channel controller that appears solely as * Nobody makes a single channel controller that appears solely as
...@@ -2489,20 +2495,13 @@ int ata_pci_sff_init_one(struct pci_dev *pdev, ...@@ -2489,20 +2495,13 @@ int ata_pci_sff_init_one(struct pci_dev *pdev,
struct scsi_host_template *sht, void *host_priv, int hflag) struct scsi_host_template *sht, void *host_priv, int hflag)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
const struct ata_port_info *pi = NULL; const struct ata_port_info *pi;
struct ata_host *host = NULL; struct ata_host *host = NULL;
int i, rc; int rc;
DPRINTK("ENTER\n"); DPRINTK("ENTER\n");
/* look up the first valid port_info */ pi = ata_sff_find_valid_pi(ppi);
for (i = 0; i < 2 && ppi[i]; i++) {
if (ppi[i]->port_ops != &ata_dummy_port_ops) {
pi = ppi[i];
break;
}
}
if (!pi) { if (!pi) {
dev_printk(KERN_ERR, &pdev->dev, dev_printk(KERN_ERR, &pdev->dev,
"no valid port_info specified\n"); "no valid port_info specified\n");
...@@ -2523,8 +2522,7 @@ int ata_pci_sff_init_one(struct pci_dev *pdev, ...@@ -2523,8 +2522,7 @@ int ata_pci_sff_init_one(struct pci_dev *pdev,
host->private_data = host_priv; host->private_data = host_priv;
host->flags |= hflag; host->flags |= hflag;
pci_set_master(pdev); rc = ata_pci_sff_activate_host(host, ata_sff_interrupt, sht);
rc = ata_pci_sff_activate_host(host, ata_bmdma_interrupt, sht);
out: out:
if (rc == 0) if (rc == 0)
devres_remove_group(&pdev->dev, NULL); devres_remove_group(&pdev->dev, NULL);
...@@ -3196,6 +3194,98 @@ void ata_pci_bmdma_init(struct ata_host *host) ...@@ -3196,6 +3194,98 @@ void ata_pci_bmdma_init(struct ata_host *host)
} }
EXPORT_SYMBOL_GPL(ata_pci_bmdma_init); EXPORT_SYMBOL_GPL(ata_pci_bmdma_init);
/**
* ata_pci_bmdma_prepare_host - helper to prepare PCI BMDMA ATA host
* @pdev: target PCI device
* @ppi: array of port_info, must be enough for two ports
* @r_host: out argument for the initialized ATA host
*
* Helper to allocate BMDMA ATA host for @pdev, acquire all PCI
* resources and initialize it accordingly in one go.
*
* LOCKING:
* Inherited from calling layer (may sleep).
*
* RETURNS:
* 0 on success, -errno otherwise.
*/
int ata_pci_bmdma_prepare_host(struct pci_dev *pdev,
const struct ata_port_info * const * ppi,
struct ata_host **r_host)
{
int rc;
rc = ata_pci_sff_prepare_host(pdev, ppi, r_host);
if (rc)
return rc;
ata_pci_bmdma_init(*r_host);
return 0;
}
EXPORT_SYMBOL_GPL(ata_pci_bmdma_prepare_host);
/**
* ata_pci_bmdma_init_one - Initialize/register BMDMA PCI IDE controller
* @pdev: Controller to be initialized
* @ppi: array of port_info, must be enough for two ports
* @sht: scsi_host_template to use when registering the host
* @host_priv: host private_data
* @hflags: host flags
*
* This function is similar to ata_pci_sff_init_one() but also
* takes care of BMDMA initialization.
*
* LOCKING:
* Inherited from PCI layer (may sleep).
*
* RETURNS:
* Zero on success, negative on errno-based value on error.
*/
int ata_pci_bmdma_init_one(struct pci_dev *pdev,
const struct ata_port_info * const * ppi,
struct scsi_host_template *sht, void *host_priv,
int hflags)
{
struct device *dev = &pdev->dev;
const struct ata_port_info *pi;
struct ata_host *host = NULL;
int rc;
DPRINTK("ENTER\n");
pi = ata_sff_find_valid_pi(ppi);
if (!pi) {
dev_printk(KERN_ERR, &pdev->dev,
"no valid port_info specified\n");
return -EINVAL;
}
if (!devres_open_group(dev, NULL, GFP_KERNEL))
return -ENOMEM;
rc = pcim_enable_device(pdev);
if (rc)
goto out;
/* prepare and activate BMDMA host */
rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
if (rc)
goto out;
host->private_data = host_priv;
host->flags |= hflags;
pci_set_master(pdev);
rc = ata_pci_sff_activate_host(host, ata_bmdma_interrupt, sht);
out:
if (rc == 0)
devres_remove_group(&pdev->dev, NULL);
else
devres_release_group(&pdev->dev, NULL);
return rc;
}
EXPORT_SYMBOL_GPL(ata_pci_bmdma_init_one);
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
/** /**
......
...@@ -260,7 +260,7 @@ static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -260,7 +260,7 @@ static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
return rc; return rc;
pcim_pin_device(pdev); pcim_pin_device(pdev);
} }
return ata_pci_sff_init_one(pdev, ppi, &pacpi_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &pacpi_sht, NULL, 0);
} }
static const struct pci_device_id pacpi_pci_tbl[] = { static const struct pci_device_id pacpi_pci_tbl[] = {
......
...@@ -583,7 +583,10 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -583,7 +583,10 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
ppi[0] = &info_20_udma; ppi[0] = &info_20_udma;
} }
return ata_pci_sff_init_one(pdev, ppi, &ali_sht, NULL, 0); if (!ppi[0]->mwdma_mask && !ppi[0]->udma_mask)
return ata_pci_sff_init_one(pdev, ppi, &ali_sht, NULL, 0);
else
return ata_pci_bmdma_init_one(pdev, ppi, &ali_sht, NULL, 0);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -574,7 +574,7 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -574,7 +574,7 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
} }
/* And fire it up */ /* And fire it up */
return ata_pci_sff_init_one(pdev, ppi, &amd_sht, hpriv, 0); return ata_pci_bmdma_init_one(pdev, ppi, &amd_sht, hpriv, 0);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -421,7 +421,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -421,7 +421,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
BUG_ON(ppi[0] == NULL); BUG_ON(ppi[0] == NULL);
return ata_pci_sff_init_one(pdev, ppi, &artop_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &artop_sht, NULL, 0);
} }
static const struct pci_device_id artop_pci_tbl[] = { static const struct pci_device_id artop_pci_tbl[] = {
......
...@@ -246,8 +246,8 @@ static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -246,8 +246,8 @@ static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i])) if (!pci_test_config_bits(pdev, &atiixp_enable_bits[i]))
ppi[i] = &ata_dummy_port_info; ppi[i] = &ata_dummy_port_info;
return ata_pci_sff_init_one(pdev, ppi, &atiixp_sht, NULL, return ata_pci_bmdma_init_one(pdev, ppi, &atiixp_sht, NULL,
ATA_HOST_PARALLEL_SCAN); ATA_HOST_PARALLEL_SCAN);
} }
static const struct pci_device_id atiixp[] = { static const struct pci_device_id atiixp[] = {
......
...@@ -367,7 +367,7 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -367,7 +367,7 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
pci_write_config_byte(pdev, UDIDETCR0, 0xF0); pci_write_config_byte(pdev, UDIDETCR0, 0xF0);
#endif #endif
return ata_pci_sff_init_one(pdev, ppi, &cmd64x_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &cmd64x_sht, NULL, 0);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -324,7 +324,7 @@ static int cs5530_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -324,7 +324,7 @@ static int cs5530_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
ppi[1] = &info_palmax_secondary; ppi[1] = &info_palmax_secondary;
/* Now kick off ATA set up */ /* Now kick off ATA set up */
return ata_pci_sff_init_one(pdev, ppi, &cs5530_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &cs5530_sht, NULL, 0);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -198,7 +198,7 @@ static int cs5535_init_one(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -198,7 +198,7 @@ static int cs5535_init_one(struct pci_dev *dev, const struct pci_device_id *id)
rdmsr(ATAC_CH0D1_PIO, timings, dummy); rdmsr(ATAC_CH0D1_PIO, timings, dummy);
if (CS5535_BAD_PIO(timings)) if (CS5535_BAD_PIO(timings))
wrmsr(ATAC_CH0D1_PIO, 0xF7F4F7F4UL, 0); wrmsr(ATAC_CH0D1_PIO, 0xF7F4F7F4UL, 0);
return ata_pci_sff_init_one(dev, ppi, &cs5535_sht, NULL, 0); return ata_pci_bmdma_init_one(dev, ppi, &cs5535_sht, NULL, 0);
} }
static const struct pci_device_id cs5535[] = { static const struct pci_device_id cs5535[] = {
......
...@@ -260,7 +260,7 @@ static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -260,7 +260,7 @@ static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id)
return -ENODEV; return -ENODEV;
} }
return ata_pci_sff_init_one(dev, ppi, &cs5536_sht, NULL, 0); return ata_pci_bmdma_init_one(dev, ppi, &cs5536_sht, NULL, 0);
} }
static const struct pci_device_id cs5536[] = { static const struct pci_device_id cs5536[] = {
......
...@@ -138,7 +138,7 @@ static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *i ...@@ -138,7 +138,7 @@ static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *i
if (PCI_FUNC(pdev->devfn) != 1) if (PCI_FUNC(pdev->devfn) != 1)
return -ENODEV; return -ENODEV;
return ata_pci_sff_init_one(pdev, ppi, &cy82c693_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &cy82c693_sht, NULL, 0);
} }
static const struct pci_device_id cy82c693[] = { static const struct pci_device_id cy82c693[] = {
......
...@@ -277,8 +277,8 @@ static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -277,8 +277,8 @@ static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
dev_printk(KERN_DEBUG, &pdev->dev, dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n"); "version " DRV_VERSION "\n");
return ata_pci_sff_init_one(pdev, ppi, &efar_sht, NULL, return ata_pci_bmdma_init_one(pdev, ppi, &efar_sht, NULL,
ATA_HOST_PARALLEL_SCAN); ATA_HOST_PARALLEL_SCAN);
} }
static const struct pci_device_id efar_pci_tbl[] = { static const struct pci_device_id efar_pci_tbl[] = {
......
...@@ -361,7 +361,7 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -361,7 +361,7 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
break; break;
} }
/* Now kick off ATA set up */ /* Now kick off ATA set up */
return ata_pci_sff_init_one(dev, ppi, &hpt36x_sht, hpriv, 0); return ata_pci_bmdma_init_one(dev, ppi, &hpt36x_sht, hpriv, 0);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -987,7 +987,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -987,7 +987,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
} }
/* Now kick off ATA set up */ /* Now kick off ATA set up */
return ata_pci_sff_init_one(dev, ppi, &hpt37x_sht, private_data, 0); return ata_pci_bmdma_init_one(dev, ppi, &hpt37x_sht, private_data, 0);
} }
static const struct pci_device_id hpt37x[] = { static const struct pci_device_id hpt37x[] = {
......
...@@ -548,7 +548,7 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -548,7 +548,7 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
outb(inb(iobase + 0x9c) | 0x04, iobase + 0x9c); outb(inb(iobase + 0x9c) | 0x04, iobase + 0x9c);
/* Now kick off ATA set up */ /* Now kick off ATA set up */
return ata_pci_sff_init_one(dev, ppi, &hpt3x2n_sht, hpriv, 0); return ata_pci_bmdma_init_one(dev, ppi, &hpt3x2n_sht, hpriv, 0);
} }
static const struct pci_device_id hpt3x2n[] = { static const struct pci_device_id hpt3x2n[] = {
......
...@@ -273,7 +273,7 @@ static int it8213_init_one (struct pci_dev *pdev, const struct pci_device_id *en ...@@ -273,7 +273,7 @@ static int it8213_init_one (struct pci_dev *pdev, const struct pci_device_id *en
dev_printk(KERN_DEBUG, &pdev->dev, dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n"); "version " DRV_VERSION "\n");
return ata_pci_sff_init_one(pdev, ppi, &it8213_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &it8213_sht, NULL, 0);
} }
static const struct pci_device_id it8213_pci_tbl[] = { static const struct pci_device_id it8213_pci_tbl[] = {
......
...@@ -933,7 +933,7 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -933,7 +933,7 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
else else
ppi[0] = &info_smart; ppi[0] = &info_smart;
} }
return ata_pci_sff_init_one(pdev, ppi, &it821x_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &it821x_sht, NULL, 0);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -144,7 +144,7 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i ...@@ -144,7 +144,7 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i
}; };
const struct ata_port_info *ppi[] = { &info, NULL }; const struct ata_port_info *ppi[] = { &info, NULL };
return ata_pci_sff_init_one(pdev, ppi, &jmicron_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &jmicron_sht, NULL, 0);
} }
static const struct pci_device_id jmicron_pci_tbl[] = { static const struct pci_device_id jmicron_pci_tbl[] = {
......
...@@ -153,7 +153,7 @@ static int marvell_init_one (struct pci_dev *pdev, const struct pci_device_id *i ...@@ -153,7 +153,7 @@ static int marvell_init_one (struct pci_dev *pdev, const struct pci_device_id *i
return -ENODEV; return -ENODEV;
} }
#endif #endif
return ata_pci_sff_init_one(pdev, ppi, &marvell_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &marvell_sht, NULL, 0);
} }
static const struct pci_device_id marvell_pci_tbl[] = { static const struct pci_device_id marvell_pci_tbl[] = {
......
...@@ -82,7 +82,7 @@ static int netcell_init_one (struct pci_dev *pdev, const struct pci_device_id *e ...@@ -82,7 +82,7 @@ static int netcell_init_one (struct pci_dev *pdev, const struct pci_device_id *e
ata_pci_bmdma_clear_simplex(pdev); ata_pci_bmdma_clear_simplex(pdev);
/* And let the library code do the work */ /* And let the library code do the work */
return ata_pci_sff_init_one(pdev, port_info, &netcell_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, port_info, &netcell_sht, NULL, 0);
} }
static const struct pci_device_id netcell_pci_tbl[] = { static const struct pci_device_id netcell_pci_tbl[] = {
......
...@@ -380,7 +380,7 @@ static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e ...@@ -380,7 +380,7 @@ static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e
ns87415_fixup(pdev); ns87415_fixup(pdev);
return ata_pci_sff_init_one(pdev, ppi, &ns87415_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &ns87415_sht, NULL, 0);
} }
static const struct pci_device_id ns87415_pci_tbl[] = { static const struct pci_device_id ns87415_pci_tbl[] = {
......
...@@ -248,7 +248,7 @@ static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *e ...@@ -248,7 +248,7 @@ static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *e
dev_printk(KERN_DEBUG, &pdev->dev, dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n"); "version " DRV_VERSION "\n");
return ata_pci_sff_init_one(pdev, ppi, &oldpiix_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &oldpiix_sht, NULL, 0);
} }
static const struct pci_device_id oldpiix_pci_tbl[] = { static const struct pci_device_id oldpiix_pci_tbl[] = {
......
...@@ -429,7 +429,7 @@ static int optidma_init_one(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -429,7 +429,7 @@ static int optidma_init_one(struct pci_dev *dev, const struct pci_device_id *id)
if (optiplus_with_udma(dev)) if (optiplus_with_udma(dev))
ppi[0] = &info_82c700_udma; ppi[0] = &info_82c700_udma;
return ata_pci_sff_init_one(dev, ppi, &optidma_sht, NULL, 0); return ata_pci_bmdma_init_one(dev, ppi, &optidma_sht, NULL, 0);
} }
static const struct pci_device_id optidma[] = { static const struct pci_device_id optidma[] = {
......
...@@ -337,7 +337,7 @@ static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id ...@@ -337,7 +337,7 @@ static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id
return -ENODEV; return -ENODEV;
} }
} }
return ata_pci_sff_init_one(dev, ppi, &pdc202xx_sht, NULL, 0); return ata_pci_bmdma_init_one(dev, ppi, &pdc202xx_sht, NULL, 0);
} }
static const struct pci_device_id pdc202xx[] = { static const struct pci_device_id pdc202xx[] = {
......
...@@ -95,7 +95,7 @@ static int ata_tosh_init_one(struct pci_dev *dev, const struct pci_device_id *id ...@@ -95,7 +95,7 @@ static int ata_tosh_init_one(struct pci_dev *dev, const struct pci_device_id *id
}; };
const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info }; const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info };
/* Just one port for the moment */ /* Just one port for the moment */
return ata_pci_sff_init_one(dev, ppi, &tosh_sht, NULL, 0); return ata_pci_bmdma_init_one(dev, ppi, &tosh_sht, NULL, 0);
} }
static struct pci_device_id ata_tosh[] = { static struct pci_device_id ata_tosh[] = {
......
...@@ -227,7 +227,7 @@ static int radisys_init_one (struct pci_dev *pdev, const struct pci_device_id *e ...@@ -227,7 +227,7 @@ static int radisys_init_one (struct pci_dev *pdev, const struct pci_device_id *e
dev_printk(KERN_DEBUG, &pdev->dev, dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n"); "version " DRV_VERSION "\n");
return ata_pci_sff_init_one(pdev, ppi, &radisys_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &radisys_sht, NULL, 0);
} }
static const struct pci_device_id radisys_pci_tbl[] = { static const struct pci_device_id radisys_pci_tbl[] = {
......
...@@ -344,7 +344,7 @@ static int __devinit rdc_init_one(struct pci_dev *pdev, ...@@ -344,7 +344,7 @@ static int __devinit rdc_init_one(struct pci_dev *pdev,
*/ */
pci_read_config_dword(pdev, 0x54, &hpriv->saved_iocfg); pci_read_config_dword(pdev, 0x54, &hpriv->saved_iocfg);
rc = ata_pci_sff_prepare_host(pdev, ppi, &host); rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
if (rc) if (rc)
return rc; return rc;
host->private_data = hpriv; host->private_data = hpriv;
......
...@@ -237,7 +237,7 @@ static int sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -237,7 +237,7 @@ static int sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id)
}; };
const struct ata_port_info *ppi[] = { &info, NULL }; const struct ata_port_info *ppi[] = { &info, NULL };
return ata_pci_sff_init_one(dev, ppi, &sc1200_sht, NULL, 0); return ata_pci_bmdma_init_one(dev, ppi, &sc1200_sht, NULL, 0);
} }
static const struct pci_device_id sc1200[] = { static const struct pci_device_id sc1200[] = {
......
...@@ -179,7 +179,7 @@ static int __devinit sch_init_one(struct pci_dev *pdev, ...@@ -179,7 +179,7 @@ static int __devinit sch_init_one(struct pci_dev *pdev,
dev_printk(KERN_DEBUG, &pdev->dev, dev_printk(KERN_DEBUG, &pdev->dev,
"version " DRV_VERSION "\n"); "version " DRV_VERSION "\n");
return ata_pci_sff_init_one(pdev, ppi, &sch_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &sch_sht, NULL, 0);
} }
static int __init sch_init(void) static int __init sch_init(void)
......
...@@ -460,7 +460,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id ...@@ -460,7 +460,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE)
ata_pci_bmdma_clear_simplex(pdev); ata_pci_bmdma_clear_simplex(pdev);
return ata_pci_sff_init_one(pdev, ppi, &serverworks_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &serverworks_sht, NULL, 0);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -378,7 +378,7 @@ static int __devinit sil680_init_one(struct pci_dev *pdev, ...@@ -378,7 +378,7 @@ static int __devinit sil680_init_one(struct pci_dev *pdev,
IRQF_SHARED, &sil680_sht); IRQF_SHARED, &sil680_sht);
use_ioports: use_ioports:
return ata_pci_sff_init_one(pdev, ppi, &sil680_sht, NULL, 0); return ata_pci_bmdma_init_one(pdev, ppi, &sil680_sht, NULL, 0);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -826,7 +826,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -826,7 +826,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
sis_fixup(pdev, chipset); sis_fixup(pdev, chipset);
return ata_pci_sff_init_one(pdev, ppi, &sis_sht, chipset, 0); return ata_pci_bmdma_init_one(pdev, ppi, &sis_sht, chipset, 0);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -316,7 +316,7 @@ static int sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id ...@@ -316,7 +316,7 @@ static int sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id
val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1F16; val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1F16;
pci_write_config_dword(dev, 0x40, val); pci_write_config_dword(dev, 0x40, val);
return ata_pci_sff_init_one(dev, ppi, &sl82c105_sht, NULL, 0); return ata_pci_bmdma_init_one(dev, ppi, &sl82c105_sht, NULL, 0);
} }
static const struct pci_device_id sl82c105[] = { static const struct pci_device_id sl82c105[] = {
......
...@@ -201,7 +201,7 @@ static int triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -201,7 +201,7 @@ static int triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id)
if (!printed_version++) if (!printed_version++)
dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n");
return ata_pci_sff_init_one(dev, ppi, &triflex_sht, NULL, 0); return ata_pci_bmdma_init_one(dev, ppi, &triflex_sht, NULL, 0);
} }
static const struct pci_device_id triflex[] = { static const struct pci_device_id triflex[] = {
......
...@@ -627,7 +627,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -627,7 +627,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
} }
/* We have established the device type, now fire it up */ /* We have established the device type, now fire it up */
return ata_pci_sff_init_one(pdev, ppi, &via_sht, (void *)config, 0); return ata_pci_bmdma_init_one(pdev, ppi, &via_sht, (void *)config, 0);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -2430,7 +2430,7 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2430,7 +2430,7 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
ppi[0] = &nv_port_info[type]; ppi[0] = &nv_port_info[type];
ipriv = ppi[0]->private_data; ipriv = ppi[0]->private_data;
rc = ata_pci_sff_prepare_host(pdev, ppi, &host); rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
if (rc) if (rc)
return rc; return rc;
......
...@@ -279,7 +279,7 @@ static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -279,7 +279,7 @@ static int sis_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
break; break;
} }
rc = ata_pci_sff_prepare_host(pdev, ppi, &host); rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
if (rc) if (rc)
return rc; return rc;
......
...@@ -463,7 +463,7 @@ static int vt6420_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) ...@@ -463,7 +463,7 @@ static int vt6420_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
struct ata_host *host; struct ata_host *host;
int rc; int rc;
rc = ata_pci_sff_prepare_host(pdev, ppi, &host); rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
if (rc) if (rc)
return rc; return rc;
*r_host = host; *r_host = host;
...@@ -520,7 +520,7 @@ static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) ...@@ -520,7 +520,7 @@ static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
struct ata_host *host; struct ata_host *host;
int i, rc; int i, rc;
rc = ata_pci_sff_prepare_host(pdev, ppi, &host); rc = ata_pci_bmdma_prepare_host(pdev, ppi, &host);
if (rc) if (rc)
return rc; return rc;
*r_host = host; *r_host = host;
......
...@@ -1644,6 +1644,13 @@ extern int ata_bmdma_port_start32(struct ata_port *ap); ...@@ -1644,6 +1644,13 @@ extern int ata_bmdma_port_start32(struct ata_port *ap);
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev); extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev);
extern void ata_pci_bmdma_init(struct ata_host *host); extern void ata_pci_bmdma_init(struct ata_host *host);
extern int ata_pci_bmdma_prepare_host(struct pci_dev *pdev,
const struct ata_port_info * const * ppi,
struct ata_host **r_host);
extern int ata_pci_bmdma_init_one(struct pci_dev *pdev,
const struct ata_port_info * const * ppi,
struct scsi_host_template *sht,
void *host_priv, int hflags);
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment