aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_main.c
diff options
context:
space:
mode:
authorEilon Greenstein <eilong@broadcom.com>2009-02-12 03:38:30 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-16 02:31:57 -0500
commitf53722514242da8346cbed2223bcea9eed744ebd (patch)
treefd2e9b7842c29427b57ba5266d63b3cf8386c197 /drivers/net/bnx2x_main.c
parent9898f86d3927bf3526aef433c8ced0b51178c35c (diff)
bnx2x: Comments and prints
Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r--drivers/net/bnx2x_main.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 0d6015f2af37..ae36bc7b0276 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -1704,7 +1704,7 @@ static irqreturn_t bnx2x_interrupt(int irq, void *dev_instance)
1704 DP(NETIF_MSG_INTR, "not our interrupt!\n"); 1704 DP(NETIF_MSG_INTR, "not our interrupt!\n");
1705 return IRQ_NONE; 1705 return IRQ_NONE;
1706 } 1706 }
1707 DP(NETIF_MSG_INTR, "got an interrupt status %u\n", status); 1707 DP(NETIF_MSG_INTR, "got an interrupt status 0x%x\n", status);
1708 1708
1709 /* Return here if interrupt is disabled */ 1709 /* Return here if interrupt is disabled */
1710 if (unlikely(atomic_read(&bp->intr_sem) != 0)) { 1710 if (unlikely(atomic_read(&bp->intr_sem) != 0)) {
@@ -2115,7 +2115,7 @@ static u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode)
2115 2115
2116 return rc; 2116 return rc;
2117 } 2117 }
2118 BNX2X_ERR("Bootcode is missing -not initializing link\n"); 2118 BNX2X_ERR("Bootcode is missing - can not initialize link\n");
2119 return -EINVAL; 2119 return -EINVAL;
2120} 2120}
2121 2121
@@ -2128,7 +2128,7 @@ static void bnx2x_link_set(struct bnx2x *bp)
2128 2128
2129 bnx2x_calc_fc_adv(bp); 2129 bnx2x_calc_fc_adv(bp);
2130 } else 2130 } else
2131 BNX2X_ERR("Bootcode is missing -not setting link\n"); 2131 BNX2X_ERR("Bootcode is missing - can not set link\n");
2132} 2132}
2133 2133
2134static void bnx2x__link_reset(struct bnx2x *bp) 2134static void bnx2x__link_reset(struct bnx2x *bp)
@@ -2138,7 +2138,7 @@ static void bnx2x__link_reset(struct bnx2x *bp)
2138 bnx2x_link_reset(&bp->link_params, &bp->link_vars, 1); 2138 bnx2x_link_reset(&bp->link_params, &bp->link_vars, 1);
2139 bnx2x_release_phy_lock(bp); 2139 bnx2x_release_phy_lock(bp);
2140 } else 2140 } else
2141 BNX2X_ERR("Bootcode is missing -not resetting link\n"); 2141 BNX2X_ERR("Bootcode is missing - can not reset link\n");
2142} 2142}
2143 2143
2144static u8 bnx2x_link_test(struct bnx2x *bp) 2144static u8 bnx2x_link_test(struct bnx2x *bp)
@@ -5139,8 +5139,8 @@ static void bnx2x_nic_init(struct bnx2x *bp, u32 load_code)
5139 fp->cl_id = BP_L_ID(bp) + i; 5139 fp->cl_id = BP_L_ID(bp) + i;
5140 fp->sb_id = fp->cl_id; 5140 fp->sb_id = fp->cl_id;
5141 DP(NETIF_MSG_IFUP, 5141 DP(NETIF_MSG_IFUP,
5142 "bnx2x_init_sb(%p,%p) index %d cl_id %d sb %d\n", 5142 "queue[%d]: bnx2x_init_sb(%p,%p) cl_id %d sb %d\n",
5143 bp, fp->status_blk, i, fp->cl_id, fp->sb_id); 5143 i, bp, fp->status_blk, fp->cl_id, fp->sb_id);
5144 bnx2x_init_sb(bp, fp->status_blk, fp->status_blk_mapping, 5144 bnx2x_init_sb(bp, fp->status_blk, fp->status_blk_mapping,
5145 fp->sb_id); 5145 fp->sb_id);
5146 bnx2x_update_fpsb_idx(fp); 5146 bnx2x_update_fpsb_idx(fp);
@@ -6904,11 +6904,11 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
6904 } else { 6904 } else {
6905 int port = BP_PORT(bp); 6905 int port = BP_PORT(bp);
6906 6906
6907 DP(NETIF_MSG_IFUP, "NO MCP load counts before us %d, %d, %d\n", 6907 DP(NETIF_MSG_IFUP, "NO MCP - load counts %d, %d, %d\n",
6908 load_count[0], load_count[1], load_count[2]); 6908 load_count[0], load_count[1], load_count[2]);
6909 load_count[0]++; 6909 load_count[0]++;
6910 load_count[1 + port]++; 6910 load_count[1 + port]++;
6911 DP(NETIF_MSG_IFUP, "NO MCP new load counts %d, %d, %d\n", 6911 DP(NETIF_MSG_IFUP, "NO MCP - new load counts %d, %d, %d\n",
6912 load_count[0], load_count[1], load_count[2]); 6912 load_count[0], load_count[1], load_count[2]);
6913 if (load_count[0] == 1) 6913 if (load_count[0] == 1)
6914 load_code = FW_MSG_CODE_DRV_LOAD_COMMON; 6914 load_code = FW_MSG_CODE_DRV_LOAD_COMMON;
@@ -6955,7 +6955,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
6955 6955
6956 if (CHIP_IS_E1H(bp)) 6956 if (CHIP_IS_E1H(bp))
6957 if (bp->mf_config & FUNC_MF_CFG_FUNC_DISABLED) { 6957 if (bp->mf_config & FUNC_MF_CFG_FUNC_DISABLED) {
6958 BNX2X_ERR("!!! mf_cfg function disabled\n"); 6958 DP(NETIF_MSG_IFUP, "mf_cfg function disabled\n");
6959 bp->state = BNX2X_STATE_DISABLED; 6959 bp->state = BNX2X_STATE_DISABLED;
6960 } 6960 }
6961 6961
@@ -7028,8 +7028,6 @@ load_error1:
7028 netif_napi_del(&bnx2x_fp(bp, i, napi)); 7028 netif_napi_del(&bnx2x_fp(bp, i, napi));
7029 bnx2x_free_mem(bp); 7029 bnx2x_free_mem(bp);
7030 7030
7031 /* TBD we really need to reset the chip
7032 if we want to recover from this */
7033 return rc; 7031 return rc;
7034} 7032}
7035 7033
@@ -7303,11 +7301,11 @@ unload_error:
7303 if (!BP_NOMCP(bp)) 7301 if (!BP_NOMCP(bp))
7304 reset_code = bnx2x_fw_command(bp, reset_code); 7302 reset_code = bnx2x_fw_command(bp, reset_code);
7305 else { 7303 else {
7306 DP(NETIF_MSG_IFDOWN, "NO MCP load counts %d, %d, %d\n", 7304 DP(NETIF_MSG_IFDOWN, "NO MCP - load counts %d, %d, %d\n",
7307 load_count[0], load_count[1], load_count[2]); 7305 load_count[0], load_count[1], load_count[2]);
7308 load_count[0]--; 7306 load_count[0]--;
7309 load_count[1 + port]--; 7307 load_count[1 + port]--;
7310 DP(NETIF_MSG_IFDOWN, "NO MCP new load counts %d, %d, %d\n", 7308 DP(NETIF_MSG_IFDOWN, "NO MCP - new load counts %d, %d, %d\n",
7311 load_count[0], load_count[1], load_count[2]); 7309 load_count[0], load_count[1], load_count[2]);
7312 if (load_count[0] == 0) 7310 if (load_count[0] == 0)
7313 reset_code = FW_MSG_CODE_DRV_UNLOAD_COMMON; 7311 reset_code = FW_MSG_CODE_DRV_UNLOAD_COMMON;
@@ -7615,7 +7613,7 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp)
7615 bp->flags |= NO_WOL_FLAG; 7613 bp->flags |= NO_WOL_FLAG;
7616 } 7614 }
7617 BNX2X_DEV_INFO("%sWoL capable\n", 7615 BNX2X_DEV_INFO("%sWoL capable\n",
7618 (bp->flags & NO_WOL_FLAG) ? "Not " : ""); 7616 (bp->flags & NO_WOL_FLAG) ? "not " : "");
7619 7617
7620 val = SHMEM_RD(bp, dev_info.shared_hw_config.part_num); 7618 val = SHMEM_RD(bp, dev_info.shared_hw_config.part_num);
7621 val2 = SHMEM_RD(bp, dev_info.shared_hw_config.part_num[4]); 7619 val2 = SHMEM_RD(bp, dev_info.shared_hw_config.part_num[4]);
@@ -8111,7 +8109,7 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp)
8111 "(0x%04x)\n", 8109 "(0x%04x)\n",
8112 func, bp->e1hov, bp->e1hov); 8110 func, bp->e1hov, bp->e1hov);
8113 } else { 8111 } else {
8114 BNX2X_DEV_INFO("Single function mode\n"); 8112 BNX2X_DEV_INFO("single function mode\n");
8115 if (BP_E1HVN(bp)) { 8113 if (BP_E1HVN(bp)) {
8116 BNX2X_ERR("!!! No valid E1HOV for func %d," 8114 BNX2X_ERR("!!! No valid E1HOV for func %d,"
8117 " aborting\n", func); 8115 " aborting\n", func);
@@ -9519,7 +9517,7 @@ static int bnx2x_test_nvram(struct bnx2x *bp)
9519 9517
9520 rc = bnx2x_nvram_read(bp, 0, data, 4); 9518 rc = bnx2x_nvram_read(bp, 0, data, 4);
9521 if (rc) { 9519 if (rc) {
9522 DP(NETIF_MSG_PROBE, "magic value read (rc -%d)\n", -rc); 9520 DP(NETIF_MSG_PROBE, "magic value read (rc %d)\n", rc);
9523 goto test_nvram_exit; 9521 goto test_nvram_exit;
9524 } 9522 }
9525 9523
@@ -9536,7 +9534,7 @@ static int bnx2x_test_nvram(struct bnx2x *bp)
9536 nvram_tbl[i].size); 9534 nvram_tbl[i].size);
9537 if (rc) { 9535 if (rc) {
9538 DP(NETIF_MSG_PROBE, 9536 DP(NETIF_MSG_PROBE,
9539 "nvram_tbl[%d] read data (rc -%d)\n", i, -rc); 9537 "nvram_tbl[%d] read data (rc %d)\n", i, rc);
9540 goto test_nvram_exit; 9538 goto test_nvram_exit;
9541 } 9539 }
9542 9540
@@ -10173,7 +10171,9 @@ static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
10173} 10171}
10174 10172
10175#if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3) 10173#if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3)
10176/* check if packet requires linearization (packet is too fragmented) */ 10174/* check if packet requires linearization (packet is too fragmented)
10175 no need to check fragmentation if page size > 8K (there will be no
10176 violation to FW restrictions) */
10177static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb, 10177static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb,
10178 u32 xmit_type) 10178 u32 xmit_type)
10179{ 10179{
@@ -10295,8 +10295,9 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
10295 ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type); 10295 ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type);
10296 10296
10297#if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3) 10297#if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3)
10298 /* First, check if we need to linearize the skb 10298 /* First, check if we need to linearize the skb (due to FW
10299 (due to FW restrictions) */ 10299 restrictions). No need to check fragmentation if page size > 8K
10300 (there will be no violation to FW restrictions) */
10300 if (bnx2x_pkt_req_lin(bp, skb, xmit_type)) { 10301 if (bnx2x_pkt_req_lin(bp, skb, xmit_type)) {
10301 /* Statistics of linearization */ 10302 /* Statistics of linearization */
10302 bp->lin_cnt++; 10303 bp->lin_cnt++;
@@ -10557,7 +10558,7 @@ static int bnx2x_close(struct net_device *dev)
10557 return 0; 10558 return 0;
10558} 10559}
10559 10560
10560/* called with netif_tx_lock from set_multicast */ 10561/* called with netif_tx_lock from dev_mcast.c */
10561static void bnx2x_set_rx_mode(struct net_device *dev) 10562static void bnx2x_set_rx_mode(struct net_device *dev)
10562{ 10563{
10563 struct bnx2x *bp = netdev_priv(dev); 10564 struct bnx2x *bp = netdev_priv(dev);