diff options
author | Michael Chan <mchan@broadcom.com> | 2012-06-29 11:32:45 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-30 00:33:28 +0200 |
commit | ae0eef66088777cf252c6b91d3eb5ef2f30a67c5 (patch) | |
tree | 4743bd257ceefb4e53931392baaedc8de8cb8a8e /drivers/net/ethernet/broadcom/cnic.c | |
parent | ipv4: Elide fib_validate_source() completely when possible. (diff) | |
download | linux-ae0eef66088777cf252c6b91d3eb5ef2f30a67c5.tar.xz linux-ae0eef66088777cf252c6b91d3eb5ef2f30a67c5.zip |
cnic: Fix mmap regression.
commit 1f85d58cdf15354a7120fc9ccc9bb9c45b53af88
cnic: Remove uio mem[0].
introduced a regression as older versions of userspace app still rely
on this mmap. Restore the mmap functionality and get the base address
from pci_resource_start() as the nedev->base_addr has been deprecated for
PCI devices.
Update version to 2.5.12.
Signed-off-by: Michael Chan <mchan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/cnic.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/cnic.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index f897306b0eb7..22ad7b6d9048 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c @@ -1063,9 +1063,13 @@ static int cnic_init_uio(struct cnic_dev *dev) uinfo = &udev->cnic_uinfo; - uinfo->mem[0].memtype = UIO_MEM_NONE; + uinfo->mem[0].addr = pci_resource_start(dev->pcidev, 0); + uinfo->mem[0].internal_addr = dev->regview; + uinfo->mem[0].memtype = UIO_MEM_PHYS; if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) { + uinfo->mem[0].size = MB_GET_CID_ADDR(TX_TSS_CID + + TX_MAX_TSS_RINGS + 1); uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen & PAGE_MASK; if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) @@ -1075,6 +1079,8 @@ static int cnic_init_uio(struct cnic_dev *dev) uinfo->name = "bnx2_cnic"; } else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) { + uinfo->mem[0].size = pci_resource_len(dev->pcidev, 0); + uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk & PAGE_MASK; uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk); |