aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x/bnx2x.h
diff options
context:
space:
mode:
authorDmitry Kravkov <dmitry@broadcom.com>2011-08-29 20:08:42 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-15 14:49:29 -0400
commit3395a033a7c2f1a089fae7e89bf108764b59529c (patch)
tree7f8498c152969675f0a7d47a61869d75c037ca8c /drivers/net/bnx2x/bnx2x.h
parentc2188952fc7d2ca54bb8aca1bc502618a7488baf (diff)
bnx2x: fix MF for 4-port devices
Number of VNs for 4-port devices is 2 instead of 4 Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x/bnx2x.h')
-rw-r--r--drivers/net/bnx2x/bnx2x.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 85297326506c..2621a1c56358 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -1166,11 +1166,12 @@ struct bnx2x {
1166#define BP_PORT(bp) (bp->pfid & 1) 1166#define BP_PORT(bp) (bp->pfid & 1)
1167#define BP_FUNC(bp) (bp->pfid) 1167#define BP_FUNC(bp) (bp->pfid)
1168#define BP_ABS_FUNC(bp) (bp->pf_num) 1168#define BP_ABS_FUNC(bp) (bp->pf_num)
1169#define BP_E1HVN(bp) (bp->pfid >> 1) 1169#define BP_VN(bp) ((bp)->pfid >> 1)
1170#define BP_VN(bp) (BP_E1HVN(bp)) /*remove when approved*/ 1170#define BP_MAX_VN_NUM(bp) (CHIP_MODE_IS_4_PORT(bp) ? 2 : 4)
1171#define BP_L_ID(bp) (BP_E1HVN(bp) << 2) 1171#define BP_L_ID(bp) (BP_VN(bp) << 2)
1172#define BP_FW_MB_IDX(bp) (BP_PORT(bp) +\ 1172#define BP_FW_MB_IDX_VN(bp, vn) (BP_PORT(bp) +\
1173 BP_VN(bp) * ((CHIP_IS_E1x(bp) || (CHIP_MODE_IS_4_PORT(bp))) ? 2 : 1)) 1173 (vn) * ((CHIP_IS_E1x(bp) || (CHIP_MODE_IS_4_PORT(bp))) ? 2 : 1))
1174#define BP_FW_MB_IDX(bp) BP_FW_MB_IDX_VN(bp, BP_VN(bp))
1174 1175
1175 struct net_device *dev; 1176 struct net_device *dev;
1176 struct pci_dev *pdev; 1177 struct pci_dev *pdev;
@@ -1833,7 +1834,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
1833 1834
1834#define MAX_DMAE_C_PER_PORT 8 1835#define MAX_DMAE_C_PER_PORT 8
1835#define INIT_DMAE_C(bp) (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \ 1836#define INIT_DMAE_C(bp) (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \
1836 BP_E1HVN(bp)) 1837 BP_VN(bp))
1837#define PMF_DMAE_C(bp) (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \ 1838#define PMF_DMAE_C(bp) (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \
1838 E1HVN_MAX) 1839 E1HVN_MAX)
1839 1840
@@ -1859,7 +1860,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms,
1859 1860
1860/* must be used on a CID before placing it on a HW ring */ 1861/* must be used on a CID before placing it on a HW ring */
1861#define HW_CID(bp, x) ((BP_PORT(bp) << 23) | \ 1862#define HW_CID(bp, x) ((BP_PORT(bp) << 23) | \
1862 (BP_E1HVN(bp) << BNX2X_SWCID_SHIFT) | \ 1863 (BP_VN(bp) << BNX2X_SWCID_SHIFT) | \
1863 (x)) 1864 (x))
1864 1865
1865#define SP_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_spe)) 1866#define SP_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_spe))