aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x
diff options
context:
space:
mode:
authorYuval Mintz <yuvalmin@broadcom.com>2012-12-01 23:05:50 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-02 20:22:59 -0500
commit7964211d3891d0271c5fc8087cd49c018b30476d (patch)
tree5ad794185d65be12b12e2a28b2229901dea0e8d6 /drivers/net/ethernet/broadcom/bnx2x
parent59694f0087b6a31893719eb396be8698735b66d3 (diff)
bnx2x: nvram enables dropless flow control
It is now possible to enable dropless flow control via nvram. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x.h2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h13
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c20
3 files changed, 31 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index 641d8847c326..03647bf3ddb9 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -1488,7 +1488,7 @@ struct bnx2x {
1488 1488
1489 int qm_cid_count; 1489 int qm_cid_count;
1490 1490
1491 int dropless_fc; 1491 bool dropless_fc;
1492 1492
1493 void *t2; 1493 void *t2;
1494 dma_addr_t t2_mapping; 1494 dma_addr_t t2_mapping;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
index 9a51d4970ad5..3369a50ac6b4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
@@ -500,7 +500,15 @@ struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */
500 u32 e3_cmn_pin_cfg1; /* 0x170 */ 500 u32 e3_cmn_pin_cfg1; /* 0x170 */
501 #define PORT_HW_CFG_E3_OVER_CURRENT_MASK 0x000000FF 501 #define PORT_HW_CFG_E3_OVER_CURRENT_MASK 0x000000FF
502 #define PORT_HW_CFG_E3_OVER_CURRENT_SHIFT 0 502 #define PORT_HW_CFG_E3_OVER_CURRENT_SHIFT 0
503 u32 reserved0[7]; /* 0x174 */ 503
504 /* pause on host ring */
505 u32 generic_features; /* 0x174 */
506 #define PORT_HW_CFG_PAUSE_ON_HOST_RING_MASK 0x00000001
507 #define PORT_HW_CFG_PAUSE_ON_HOST_RING_SHIFT 0
508 #define PORT_HW_CFG_PAUSE_ON_HOST_RING_DISABLED 0x00000000
509 #define PORT_HW_CFG_PAUSE_ON_HOST_RING_ENABLED 0x00000001
510
511 u32 reserved0[6]; /* 0x178 */
504 512
505 u32 aeu_int_mask; /* 0x190 */ 513 u32 aeu_int_mask; /* 0x190 */
506 514
@@ -1518,12 +1526,13 @@ enum mf_cfg_afex_vlan_mode {
1518/* This structure is not applicable and should not be accessed on 57711 */ 1526/* This structure is not applicable and should not be accessed on 57711 */
1519struct func_ext_cfg { 1527struct func_ext_cfg {
1520 u32 func_cfg; 1528 u32 func_cfg;
1521 #define MACP_FUNC_CFG_FLAGS_MASK 0x000000FF 1529 #define MACP_FUNC_CFG_FLAGS_MASK 0x0000007F
1522 #define MACP_FUNC_CFG_FLAGS_SHIFT 0 1530 #define MACP_FUNC_CFG_FLAGS_SHIFT 0
1523 #define MACP_FUNC_CFG_FLAGS_ENABLED 0x00000001 1531 #define MACP_FUNC_CFG_FLAGS_ENABLED 0x00000001
1524 #define MACP_FUNC_CFG_FLAGS_ETHERNET 0x00000002 1532 #define MACP_FUNC_CFG_FLAGS_ETHERNET 0x00000002
1525 #define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x00000004 1533 #define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x00000004
1526 #define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x00000008 1534 #define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x00000008
1535 #define MACP_FUNC_CFG_PAUSE_ON_HOST_RING 0x00000080
1527 1536
1528 u32 iscsi_mac_addr_upper; 1537 u32 iscsi_mac_addr_upper;
1529 u32 iscsi_mac_addr_lower; 1538 u32 iscsi_mac_addr_lower;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 62fcf0f0e72a..89b3d10e1575 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -10641,8 +10641,26 @@ static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)
10641 "bad Ethernet MAC address configuration: %pM\n" 10641 "bad Ethernet MAC address configuration: %pM\n"
10642 "change it manually before bringing up the appropriate network interface\n", 10642 "change it manually before bringing up the appropriate network interface\n",
10643 bp->dev->dev_addr); 10643 bp->dev->dev_addr);
10644}
10644 10645
10646static bool __devinit bnx2x_get_dropless_info(struct bnx2x *bp)
10647{
10648 int tmp;
10649 u32 cfg;
10645 10650
10651 if (IS_MF(bp) && !CHIP_IS_E1x(bp)) {
10652 /* Take function: tmp = func */
10653 tmp = BP_ABS_FUNC(bp);
10654 cfg = MF_CFG_RD(bp, func_ext_config[tmp].func_cfg);
10655 cfg = !!(cfg & MACP_FUNC_CFG_PAUSE_ON_HOST_RING);
10656 } else {
10657 /* Take port: tmp = port */
10658 tmp = BP_PORT(bp);
10659 cfg = SHMEM_RD(bp,
10660 dev_info.port_hw_config[tmp].generic_features);
10661 cfg = !!(cfg & PORT_HW_CFG_PAUSE_ON_HOST_RING_ENABLED);
10662 }
10663 return cfg;
10646} 10664}
10647 10665
10648static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp) 10666static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp)
@@ -11063,7 +11081,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
11063 if (CHIP_IS_E1(bp)) 11081 if (CHIP_IS_E1(bp))
11064 bp->dropless_fc = 0; 11082 bp->dropless_fc = 0;
11065 else 11083 else
11066 bp->dropless_fc = dropless_fc; 11084 bp->dropless_fc = dropless_fc | bnx2x_get_dropless_info(bp);
11067 11085
11068 bp->mrrs = mrrs; 11086 bp->mrrs = mrrs;
11069 11087