Skip to content

Commit ae0eef6

Browse files
Michael Chandavem330
authored andcommitted
cnic: Fix mmap regression.
commit 1f85d58 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>
1 parent 7a9bc9b commit ae0eef6

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎drivers/net/ethernet/broadcom/cnic.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,9 +1063,13 @@ static int cnic_init_uio(struct cnic_dev *dev)
10631063

10641064
uinfo = &udev->cnic_uinfo;
10651065

1066-
uinfo->mem[0].memtype = UIO_MEM_NONE;
1066+
uinfo->mem[0].addr = pci_resource_start(dev->pcidev, 0);
1067+
uinfo->mem[0].internal_addr = dev->regview;
1068+
uinfo->mem[0].memtype = UIO_MEM_PHYS;
10671069

10681070
if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) {
1071+
uinfo->mem[0].size = MB_GET_CID_ADDR(TX_TSS_CID +
1072+
TX_MAX_TSS_RINGS + 1);
10691073
uinfo->mem[1].addr = (unsigned long) cp->status_blk.gen &
10701074
PAGE_MASK;
10711075
if (cp->ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX)
@@ -1075,6 +1079,8 @@ static int cnic_init_uio(struct cnic_dev *dev)
10751079

10761080
uinfo->name = "bnx2_cnic";
10771081
} else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) {
1082+
uinfo->mem[0].size = pci_resource_len(dev->pcidev, 0);
1083+
10781084
uinfo->mem[1].addr = (unsigned long) cp->bnx2x_def_status_blk &
10791085
PAGE_MASK;
10801086
uinfo->mem[1].size = sizeof(*cp->bnx2x_def_status_blk);

‎drivers/net/ethernet/broadcom/cnic_if.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
#include "bnx2x/bnx2x_mfw_req.h"
1616

17-
#define CNIC_MODULE_VERSION "2.5.11"
18-
#define CNIC_MODULE_RELDATE "June 27, 2012"
17+
#define CNIC_MODULE_VERSION "2.5.12"
18+
#define CNIC_MODULE_RELDATE "June 29, 2012"
1919

2020
#define CNIC_ULP_RDMA 0
2121
#define CNIC_ULP_ISCSI 1

0 commit comments

Comments
 (0)