[pci] Update drivers to use pci_ioremap()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/146/head
Michael Brown 2020-09-24 21:45:03 +01:00
parent 371af4eef2
commit eecb75ba48
47 changed files with 85 additions and 71 deletions

View File

@ -175,7 +175,7 @@ static void * hvm_ioremap ( struct hvm_device *hvm, unsigned int space,
}
/* Map this space */
mmio = ioremap ( ( hvm->mmio + hvm->mmio_offset ), len );
mmio = pci_ioremap ( hvm->pci, ( hvm->mmio + hvm->mmio_offset ), len );
if ( ! mmio ) {
DBGC ( hvm, "HVM could not map MMIO space [%08lx,%08lx)\n",
( hvm->mmio + hvm->mmio_offset ),
@ -371,7 +371,8 @@ static int hvm_map_xenstore ( struct hvm_device *hvm ) {
xenstore_phys = ( xenstore_pfn * PAGE_SIZE );
/* Map XenStore */
hvm->xen.store.intf = ioremap ( xenstore_phys, PAGE_SIZE );
hvm->xen.store.intf = pci_ioremap ( hvm->pci, xenstore_phys,
PAGE_SIZE );
if ( ! hvm->xen.store.intf ) {
DBGC ( hvm, "HVM could not map XenStore at [%08lx,%08lx)\n",
xenstore_phys, ( xenstore_phys + PAGE_SIZE ) );
@ -420,6 +421,7 @@ static int hvm_probe ( struct pci_device *pci ) {
rc = -ENOMEM;
goto err_alloc;
}
hvm->pci = pci;
hvm->mmio = pci_bar_start ( pci, HVM_MMIO_BAR );
hvm->mmio_len = pci_bar_size ( pci, HVM_MMIO_BAR );
DBGC2 ( hvm, "HVM has MMIO space [%08lx,%08lx)\n",

View File

@ -39,6 +39,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
struct hvm_device {
/** Xen hypervisor */
struct xen_hypervisor xen;
/** PCI device */
struct pci_device *pci;
/** CPUID base */
uint32_t cpuid_base;
/** Length of hypercall table */

View File

@ -84,7 +84,7 @@ static void * pci_msix_ioremap ( struct pci_device *pci, struct pci_msix *msix,
msix, pci_msix_name ( cfg ), base, bar, offset );
/* Map BAR portion */
io = ioremap ( ( start + offset ), PCI_MSIX_LEN );
io = pci_ioremap ( pci, ( start + offset ), PCI_MSIX_LEN );
if ( ! io ) {
DBGC ( msix, "MSI-X %p %s could not map %#08lx\n",
msix, pci_msix_name ( cfg ), base );

View File

@ -321,7 +321,7 @@ int virtio_pci_map_capability(struct pci_device *pci, int cap, size_t minlen,
region->flags = VIRTIO_PCI_REGION_PORT;
} else {
/* Region mapped into memory space */
region->base = ioremap(base + offset, length);
region->base = pci_ioremap(pci, base + offset, length);
region->flags = VIRTIO_PCI_REGION_MEMORY;
}
}

View File

@ -2059,7 +2059,8 @@ static int arbel_start_firmware ( struct arbel *arbel ) {
eq_set_ci_base_addr =
( ( (uint64_t) MLX_GET ( &fw, eq_set_ci_base_addr_h ) << 32 ) |
( (uint64_t) MLX_GET ( &fw, eq_set_ci_base_addr_l ) ) );
arbel->eq_ci_doorbells = ioremap ( eq_set_ci_base_addr, 0x200 );
arbel->eq_ci_doorbells = pci_ioremap ( arbel->pci, eq_set_ci_base_addr,
0x200 );
/* Enable locally-attached memory. Ignore failure; there may
* be no attached memory.
@ -3025,6 +3026,8 @@ static void arbel_free ( struct arbel *arbel ) {
static int arbel_probe ( struct pci_device *pci ) {
struct arbel *arbel;
struct ib_device *ibdev;
unsigned long config;
unsigned long uar;
int i;
int rc;
@ -3041,11 +3044,11 @@ static int arbel_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map PCI BARs */
arbel->config = ioremap ( pci_bar_start ( pci, ARBEL_PCI_CONFIG_BAR ),
ARBEL_PCI_CONFIG_BAR_SIZE );
arbel->uar = ioremap ( ( pci_bar_start ( pci, ARBEL_PCI_UAR_BAR ) +
ARBEL_PCI_UAR_IDX * ARBEL_PCI_UAR_SIZE ),
ARBEL_PCI_UAR_SIZE );
config = pci_bar_start ( pci, ARBEL_PCI_CONFIG_BAR );
arbel->config = pci_ioremap ( pci, config, ARBEL_PCI_CONFIG_BAR_SIZE );
uar = ( pci_bar_start ( pci, ARBEL_PCI_UAR_BAR ) +
ARBEL_PCI_UAR_IDX * ARBEL_PCI_UAR_SIZE );
arbel->uar = pci_ioremap ( pci, uar, ARBEL_PCI_UAR_SIZE );
/* Allocate Infiniband devices */
for ( i = 0 ; i < ARBEL_NUM_PORTS ; i++ ) {

View File

@ -1461,7 +1461,7 @@ static int flexboot_nodnic_alloc_uar ( struct flexboot_nodnic *flexboot_nodnic )
return -EINVAL;
}
uar->phys = ( pci_bar_start ( pci, FLEXBOOT_NODNIC_HCA_BAR ) + (mlx_uint32)uar->offset );
uar->virt = ( void * )( ioremap ( uar->phys, FLEXBOOT_NODNIC_PAGE_SIZE ) );
uar->virt = ( void * )( pci_ioremap ( pci, uar->phys, FLEXBOOT_NODNIC_PAGE_SIZE ) );
return status;
}

View File

@ -693,7 +693,7 @@ static inline int golan_alloc_uar(struct golan *golan)
uar->index = be32_to_cpu(out->uarn) & 0xffffff;
uar->phys = (pci_bar_start(golan->pci, GOLAN_HCA_BAR) + (uar->index << GOLAN_PAGE_SHIFT));
uar->virt = (void *)(ioremap(uar->phys, GOLAN_PAGE_SIZE));
uar->virt = (void *)(pci_ioremap(golan->pci, uar->phys, GOLAN_PAGE_SIZE));
DBGC( golan , "%s: UAR allocated with index 0x%x\n", __FUNCTION__, uar->index);
return 0;
@ -922,8 +922,8 @@ static inline void golan_pci_init(struct golan *golan)
adjust_pci_device ( pci );
/* Get HCA BAR */
golan->iseg = ioremap ( pci_bar_start ( pci, GOLAN_HCA_BAR),
GOLAN_PCI_CONFIG_BAR_SIZE );
golan->iseg = pci_ioremap ( pci, pci_bar_start ( pci, GOLAN_HCA_BAR),
GOLAN_PCI_CONFIG_BAR_SIZE );
}
static inline struct golan *golan_alloc()

View File

@ -3782,6 +3782,8 @@ static int hermon_probe ( struct pci_device *pci ) {
struct ib_device *ibdev;
struct net_device *netdev;
struct hermon_port *port;
unsigned long config;
unsigned long uar;
unsigned int i;
int rc;
@ -3798,10 +3800,12 @@ static int hermon_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map PCI BARs */
hermon->config = ioremap ( pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR ),
HERMON_PCI_CONFIG_BAR_SIZE );
hermon->uar = ioremap ( pci_bar_start ( pci, HERMON_PCI_UAR_BAR ),
HERMON_UAR_NON_EQ_PAGE * HERMON_PAGE_SIZE );
config = pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR );
hermon->config = pci_ioremap ( pci, config,
HERMON_PCI_CONFIG_BAR_SIZE );
uar = pci_bar_start ( pci, HERMON_PCI_UAR_BAR );
hermon->uar = pci_ioremap ( pci, uar,
HERMON_UAR_NON_EQ_PAGE * HERMON_PAGE_SIZE );
/* Reset device */
hermon_reset ( hermon );
@ -3937,6 +3941,7 @@ static void hermon_remove ( struct pci_device *pci ) {
*/
static int hermon_bofm_probe ( struct pci_device *pci ) {
struct hermon *hermon;
unsigned long config;
int rc;
/* Allocate Hermon device */
@ -3952,8 +3957,9 @@ static int hermon_bofm_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map PCI BAR */
hermon->config = ioremap ( pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR ),
HERMON_PCI_CONFIG_BAR_SIZE );
config = pci_bar_start ( pci, HERMON_PCI_CONFIG_BAR );
hermon->config = pci_ioremap ( pci, config,
HERMON_PCI_CONFIG_BAR_SIZE );
/* Initialise BOFM device */
bofm_init ( &hermon->bofm, pci, &hermon_bofm_operations );

View File

@ -2335,7 +2335,7 @@ static int linda_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map PCI BARs */
linda->regs = ioremap ( pci->membase, LINDA_BAR0_SIZE );
linda->regs = pci_ioremap ( pci, pci->membase, LINDA_BAR0_SIZE );
DBGC2 ( linda, "Linda %p has BAR at %08lx\n", linda, pci->membase );
/* Print some general data */

View File

@ -115,7 +115,7 @@ mlx_pci_init_priv(
mlx_status status = MLX_SUCCESS;
adjust_pci_device ( utils->pci );
#ifdef DEVICE_CX3
utils->config = ioremap ( pci_bar_start ( utils->pci, PCI_BASE_ADDRESS_0),
utils->config = pci_ioremap ( utils->pci, pci_bar_start ( utils->pci, PCI_BASE_ADDRESS_0),
0x100000 );
#endif
return status;

View File

@ -2297,7 +2297,7 @@ static int qib7322_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map PCI BARs */
qib7322->regs = ioremap ( pci->membase, QIB7322_BAR0_SIZE );
qib7322->regs = pci_ioremap ( pci, pci->membase, QIB7322_BAR0_SIZE );
DBGC2 ( qib7322, "QIB7322 %p has BAR at %08lx\n",
qib7322, pci->membase );

View File

@ -664,7 +664,7 @@ static int amd8111e_probe(struct nic *nic, struct pci_device *pdev)
memset(lp, 0, sizeof(*lp));
lp->pdev = pdev;
lp->nic = nic;
lp->mmio = ioremap(mmio_start, mmio_len);
lp->mmio = pci_ioremap(pdev, mmio_start, mmio_len);
lp->opened = 1;
adjust_pci_device(pdev);

View File

@ -280,7 +280,7 @@ static int ath5k_probe(struct pci_device *pdev)
*/
pci_write_config_byte(pdev, 0x41, 0);
mem = ioremap(pdev->membase, 0x10000);
mem = pci_ioremap(pdev, pdev->membase, 0x10000);
if (!mem) {
DBG("ath5k: cannot remap PCI memory region\n");
ret = -EIO;

View File

@ -138,7 +138,7 @@ static int ath_pci_probe(struct pci_device *pdev)
if ((val & 0x0000ff00) != 0)
pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
mem = ioremap(pdev->membase, 0x10000);
mem = pci_ioremap(pdev, pdev->membase, 0x10000);
if (!mem) {
DBG("ath9K: PCI memory map error\n") ;
ret = -EIO;

View File

@ -673,7 +673,7 @@ static int b44_probe(struct pci_device *pci)
bp->pci = pci;
/* Map device registers */
bp->regs = ioremap(pci->membase, B44_REGS_SIZE);
bp->regs = pci_ioremap(pci, pci->membase, B44_REGS_SIZE);
if (!bp->regs) {
netdev_put(netdev);
return -ENOMEM;

View File

@ -2152,7 +2152,7 @@ bnx2_init_board(struct pci_device *pdev, struct nic *nic)
bnx2reg_base = pci_bar_start(pdev, PCI_BASE_ADDRESS_0);
bnx2reg_len = MB_GET_CID_ADDR(17);
bp->regview = ioremap(bnx2reg_base, bnx2reg_len);
bp->regview = pci_ioremap(pdev, bnx2reg_base, bnx2reg_len);
if (!bp->regview) {
printf("Cannot map register space, aborting.\n");

View File

@ -60,7 +60,7 @@ static void *bnxt_pci_base ( struct pci_device *pdev, unsigned int reg )
reg_base = pci_bar_start ( pdev, reg );
reg_size = pci_bar_size ( pdev, reg );
return ioremap ( reg_base, reg_size );
return pci_ioremap ( pdev, reg_base, reg_size );
}
static int bnxt_get_pci_info ( struct bnxt *bp )

View File

@ -933,7 +933,7 @@ static int ena_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
ena->regs = ioremap ( pci->membase, ENA_BAR_SIZE );
ena->regs = pci_ioremap ( pci, pci->membase, ENA_BAR_SIZE );
if ( ! ena->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -4150,7 +4150,7 @@ efab_probe ( struct pci_device *pci )
/* Get iobase/membase */
mmio_start = pci_bar_start ( pci, PCI_BASE_ADDRESS_2 );
mmio_len = pci_bar_size ( pci, PCI_BASE_ADDRESS_2 );
efab->membase = ioremap ( mmio_start, mmio_len );
efab->membase = pci_ioremap ( pci, mmio_start, mmio_len );
EFAB_TRACE ( "BAR of %lx bytes at phys %lx mapped at %p\n",
mmio_len, mmio_start, efab->membase );

View File

@ -800,7 +800,7 @@ static int exanic_probe ( struct pci_device *pci ) {
/* Map registers */
regs_bar_start = pci_bar_start ( pci, EXANIC_REGS_BAR );
exanic->regs = ioremap ( regs_bar_start, EXANIC_REGS_LEN );
exanic->regs = pci_ioremap ( pci, regs_bar_start, EXANIC_REGS_LEN );
if ( ! exanic->regs ) {
rc = -ENODEV;
goto err_ioremap_regs;
@ -824,7 +824,7 @@ static int exanic_probe ( struct pci_device *pci ) {
/* Map transmit region */
tx_bar_start = pci_bar_start ( pci, EXANIC_TX_BAR );
tx_bar_len = pci_bar_size ( pci, EXANIC_TX_BAR );
exanic->tx = ioremap ( tx_bar_start, tx_bar_len );
exanic->tx = pci_ioremap ( pci, tx_bar_start, tx_bar_len );
if ( ! exanic->tx ) {
rc = -ENODEV;
goto err_ioremap_tx;

View File

@ -1762,7 +1762,7 @@ forcedeth_map_regs ( struct forcedeth_private *priv )
}
rc = -ENOMEM;
ioaddr = ioremap ( addr, register_size );
ioaddr = pci_ioremap ( priv->pci_dev, addr, register_size );
if ( ! ioaddr ) {
DBG ( "Cannot remap MMIO\n" );
goto err_ioremap;

View File

@ -726,7 +726,7 @@ static int icplus_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
icp->regs = ioremap ( pci->membase, ICP_BAR_SIZE );
icp->regs = pci_ioremap ( pci, pci->membase, ICP_BAR_SIZE );
if ( ! icp->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -843,7 +843,7 @@ int igbvf_probe ( struct pci_device *pdev )
DBG ( "mmio_start: %#08lx\n", mmio_start );
DBG ( "mmio_len: %#08lx\n", mmio_len );
adapter->hw.hw_addr = ioremap ( mmio_start, mmio_len );
adapter->hw.hw_addr = pci_ioremap ( pdev, mmio_start, mmio_len );
DBG ( "adapter->hw.hw_addr: %p\n", adapter->hw.hw_addr );
if ( ! adapter->hw.hw_addr ) {

View File

@ -959,7 +959,7 @@ static int intel_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
intel->regs = ioremap ( pci->membase, INTEL_BAR_SIZE );
intel->regs = pci_ioremap ( pci, pci->membase, INTEL_BAR_SIZE );
if ( ! intel->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -405,7 +405,7 @@ static int intelx_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
intel->regs = ioremap ( pci->membase, INTEL_BAR_SIZE );
intel->regs = pci_ioremap ( pci, pci->membase, INTEL_BAR_SIZE );
if ( ! intel->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -1673,7 +1673,7 @@ static int intelxl_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
intelxl->regs = ioremap ( pci->membase, INTELXL_BAR_SIZE );
intelxl->regs = pci_ioremap ( pci, pci->membase, INTELXL_BAR_SIZE );
if ( ! intelxl->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -612,7 +612,7 @@ static int intelxlvf_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
intelxl->regs = ioremap ( pci->membase, INTELXLVF_BAR_SIZE );
intelxl->regs = pci_ioremap ( pci, pci->membase, INTELXLVF_BAR_SIZE );
if ( ! intelxl->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -456,7 +456,7 @@ static int intelxvf_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
intel->regs = ioremap ( pci->membase, INTELVF_BAR_SIZE );
intel->regs = pci_ioremap ( pci, pci->membase, INTELVF_BAR_SIZE );
if ( ! intel->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -1191,7 +1191,7 @@ jme_probe(struct pci_device *pci)
jme = netdev->priv;
pci_set_drvdata(pci, netdev);
netdev->dev = &pci->dev;
jme->regs = ioremap(pci->membase, JME_REGS_SIZE);
jme->regs = pci_ioremap(pci, pci->membase, JME_REGS_SIZE);
if (!(jme->regs)) {
DBG("Mapping PCI resource region error.\n");
rc = -ENOMEM;

View File

@ -606,7 +606,7 @@ static int myson_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
myson->regs = ioremap ( pci->membase, MYSON_BAR_SIZE );
myson->regs = pci_ioremap ( pci, pci->membase, MYSON_BAR_SIZE );
if ( ! myson->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -853,7 +853,7 @@ static int natsemi_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
natsemi->regs = ioremap ( pci->membase, NATSEMI_BAR_SIZE );
natsemi->regs = pci_ioremap ( pci, pci->membase, NATSEMI_BAR_SIZE );
if ( ! natsemi->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -1837,7 +1837,7 @@ static int phantom_map_crb ( struct phantom_nic *phantom,
return -EINVAL;
}
phantom->bar0 = ioremap ( bar0_start, bar0_size );
phantom->bar0 = pci_ioremap ( pci, bar0_start, bar0_size );
if ( ! phantom->bar0 ) {
DBGC ( phantom, "Phantom %p could not map BAR0\n", phantom );
return -EIO;

View File

@ -36,7 +36,7 @@ static int prism2_pci_probe ( struct nic *nic, struct pci_device *pci ) {
hfa384x_t *hw = &hw_global;
printf ( "Prism2.5 has registers at %#lx\n", pci->membase );
hw->membase = ioremap ( pci->membase, 0x100 );
hw->membase = pci_ioremap ( pci, pci->membase, 0x100 );
nic->ioaddr = pci->membase;
nic->irqno = 0;

View File

@ -1128,7 +1128,7 @@ static int realtek_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
rtl->regs = ioremap ( pci->membase, RTL_BAR_SIZE );
rtl->regs = pci_ioremap ( pci, pci->membase, RTL_BAR_SIZE );
if ( ! rtl->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -700,7 +700,7 @@ static int rhine_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
rhn->regs = ioremap ( pci->membase, RHINE_BAR_SIZE );
rhn->regs = pci_ioremap ( pci, pci->membase, RHINE_BAR_SIZE );
rhn->ioaddr = pci->ioaddr;
DBGC ( rhn, "RHINE %p regs at %08lx, I/O at %04lx\n", rhn,
pci->membase, pci->ioaddr );

View File

@ -85,7 +85,7 @@ void efx_probe(struct net_device *netdev, enum efx_revision revision)
efx->mmio_start = pci_bar_start(pci, reg);
efx->mmio_len = pci_bar_size(pci, reg);
efx->membase = ioremap(efx->mmio_start, efx->mmio_len);
efx->membase = pci_ioremap(pci, efx->mmio_start, efx->mmio_len);
DBGCP(efx, "BAR of %lx bytes at phys %lx mapped at %p\n",
efx->mmio_len, efx->mmio_start, efx->membase);

View File

@ -886,7 +886,7 @@ static int sis190_init_board(struct pci_device *pdev, struct net_device **netdev
adjust_pci_device(pdev);
ioaddr = ioremap(pdev->membase, SIS190_REGS_SIZE);
ioaddr = pci_ioremap(pdev, pdev->membase, SIS190_REGS_SIZE);
if (!ioaddr) {
DBG("sis190: cannot remap MMIO, aborting\n");
rc = -EIO;

View File

@ -195,7 +195,7 @@ static int skeleton_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
skel->regs = ioremap ( pci->membase, SKELETON_BAR_SIZE );
skel->regs = pci_ioremap ( pci, pci->membase, SKELETON_BAR_SIZE );
if ( ! skel->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -2346,8 +2346,9 @@ static int skge_probe(struct pci_device *pdev)
hw->pdev = pdev;
hw->regs = (unsigned long)ioremap(pci_bar_start(pdev, PCI_BASE_ADDRESS_0),
SKGE_REG_SIZE);
hw->regs = (unsigned long)pci_ioremap(pdev,
pci_bar_start(pdev, PCI_BASE_ADDRESS_0),
SKGE_REG_SIZE);
if (!hw->regs) {
DBG(PFX "cannot map device registers\n");
goto err_out_free_hw;

View File

@ -2278,7 +2278,7 @@ static int sky2_probe(struct pci_device *pdev)
hw->pdev = pdev;
hw->regs = (unsigned long)ioremap(pci_bar_start(pdev, PCI_BASE_ADDRESS_0), 0x4000);
hw->regs = (unsigned long)pci_ioremap(pdev, pci_bar_start(pdev, PCI_BASE_ADDRESS_0), 0x4000);
if (!hw->regs) {
DBG(PFX "cannot map device registers\n");
goto err_out_free_hw;

View File

@ -771,7 +771,7 @@ static int tg3_init_one(struct pci_device *pdev)
reg_base = pci_bar_start(pdev, PCI_BASE_ADDRESS_0);
reg_size = pci_bar_size(pdev, PCI_BASE_ADDRESS_0);
tp->regs = ioremap(reg_base, reg_size);
tp->regs = pci_ioremap(pdev, reg_base, reg_size);
if (!tp->regs) {
DBGC(&pdev->dev, "Failed to remap device registers\n");
errno = -ENOENT;

View File

@ -645,11 +645,11 @@ static void txnic_poll ( struct txnic *vnic ) {
/**
* Allocate virtual NIC
*
* @v dev Underlying device
* @v pci Underlying PCI device
* @v membase Register base address
* @ret vnic Virtual NIC, or NULL on failure
*/
static struct txnic * txnic_alloc ( struct device *dev,
static struct txnic * txnic_alloc ( struct pci_device *pci,
unsigned long membase ) {
struct net_device *netdev;
struct txnic *vnic;
@ -658,10 +658,10 @@ static struct txnic * txnic_alloc ( struct device *dev,
netdev = alloc_etherdev ( sizeof ( *vnic ) );
if ( ! netdev )
goto err_alloc_netdev;
netdev->dev = dev;
netdev->dev = &pci->dev;
vnic = netdev->priv;
vnic->netdev = netdev;
vnic->name = dev->name;
vnic->name = pci->dev.name;
/* Allow caller to reuse netdev->priv. (The generic virtual
* NIC code never assumes that netdev->priv==vnic.)
@ -684,7 +684,7 @@ static struct txnic * txnic_alloc ( struct device *dev,
goto err_alloc_rq;
/* Map registers */
vnic->regs = ioremap ( membase, TXNIC_VF_BAR_SIZE );
vnic->regs = pci_ioremap ( pci, membase, TXNIC_VF_BAR_SIZE );
if ( ! vnic->regs )
goto err_ioremap;
@ -1103,7 +1103,7 @@ static int txnic_lmac_probe ( struct txnic_lmac *lmac ) {
membase = ( pf->vf_membase + ( lmac->idx * pf->vf_stride ) );
/* Allocate and initialise network device */
vnic = txnic_alloc ( &bgx->pci->dev, membase );
vnic = txnic_alloc ( bgx->pci, membase );
if ( ! vnic ) {
rc = -ENOMEM;
goto err_alloc;
@ -1275,7 +1275,7 @@ static int txnic_pf_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
pf->regs = ioremap ( membase, TXNIC_PF_BAR_SIZE );
pf->regs = pci_ioremap ( pci, membase, TXNIC_PF_BAR_SIZE );
if ( ! pf->regs ) {
rc = -ENODEV;
goto err_ioremap;
@ -1633,7 +1633,7 @@ static int txnic_bgx_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
bgx->regs = ioremap ( membase, TXNIC_BGX_BAR_SIZE );
bgx->regs = pci_ioremap ( pci, membase, TXNIC_BGX_BAR_SIZE );
if ( ! bgx->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -731,7 +731,7 @@ static int velocity_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
vlc->regs = ioremap ( pci->membase, VELOCITY_BAR_SIZE );
vlc->regs = pci_ioremap ( pci, pci->membase, VELOCITY_BAR_SIZE );
vlc->netdev = netdev;
/* Reset the NIC */

View File

@ -641,14 +641,14 @@ static int vmxnet3_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map PCI BARs */
vmxnet->pt = ioremap ( pci_bar_start ( pci, VMXNET3_PT_BAR ),
VMXNET3_PT_LEN );
vmxnet->pt = pci_ioremap ( pci, pci_bar_start ( pci, VMXNET3_PT_BAR ),
VMXNET3_PT_LEN );
if ( ! vmxnet->pt ) {
rc = -ENODEV;
goto err_ioremap_pt;
}
vmxnet->vd = ioremap ( pci_bar_start ( pci, VMXNET3_VD_BAR ),
VMXNET3_VD_LEN );
vmxnet->vd = pci_ioremap ( pci, pci_bar_start ( pci, VMXNET3_VD_BAR ),
VMXNET3_VD_LEN );
if ( ! vmxnet->vd ) {
rc = -ENODEV;
goto err_ioremap_vd;

View File

@ -520,7 +520,7 @@ vxge_probe(struct pci_device *pdev)
/* sets the bus master */
adjust_pci_device(pdev);
bar0 = ioremap(mmio_start, mmio_len);
bar0 = pci_ioremap(pdev, mmio_start, mmio_len);
if (!bar0) {
vxge_debug(VXGE_ERR,
"%s : cannot remap io memory bar0\n", __func__);

View File

@ -1989,7 +1989,7 @@ static int ehci_probe ( struct pci_device *pci ) {
/* Map registers */
bar_start = pci_bar_start ( pci, EHCI_BAR );
bar_size = pci_bar_size ( pci, EHCI_BAR );
ehci->regs = ioremap ( bar_start, bar_size );
ehci->regs = pci_ioremap ( pci, bar_start, bar_size );
if ( ! ehci->regs ) {
rc = -ENODEV;
goto err_ioremap;

View File

@ -3261,7 +3261,7 @@ static int xhci_probe ( struct pci_device *pci ) {
/* Map registers */
bar_start = pci_bar_start ( pci, XHCI_BAR );
bar_size = pci_bar_size ( pci, XHCI_BAR );
xhci->regs = ioremap ( bar_start, bar_size );
xhci->regs = pci_ioremap ( pci, bar_start, bar_size );
if ( ! xhci->regs ) {
rc = -ENODEV;
goto err_ioremap;