aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-10-21 03:50:56 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-24 18:07:13 -0400
commit8d96286ae13a0bf4ec04341c9b25694adff38623 (patch)
tree02705da0cd961cf6c8505cf080c923578bf783a1 /drivers/net
parentfa274cb7e56555e7017050e922b4f14637baa023 (diff)
bnx2x: make local function static and remove dead code
Make many functions that are only used in one file static. Remove dead code for override_led_value. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bnx2x/bnx2x.h5
-rw-r--r--drivers/net/bnx2x/bnx2x_cmn.c3
-rw-r--r--drivers/net/bnx2x/bnx2x_cmn.h55
-rw-r--r--drivers/net/bnx2x/bnx2x_init_ops.h34
-rw-r--r--drivers/net/bnx2x/bnx2x_link.c137
-rw-r--r--drivers/net/bnx2x/bnx2x_link.h15
-rw-r--r--drivers/net/bnx2x/bnx2x_main.c55
7 files changed, 62 insertions, 242 deletions
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 9571ecf48f35..9eea225decaf 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -1288,15 +1288,11 @@ struct bnx2x_func_init_params {
1288 1288
1289#define WAIT_RAMROD_POLL 0x01 1289#define WAIT_RAMROD_POLL 0x01
1290#define WAIT_RAMROD_COMMON 0x02 1290#define WAIT_RAMROD_COMMON 0x02
1291int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx,
1292 int *state_p, int flags);
1293 1291
1294/* dmae */ 1292/* dmae */
1295void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32); 1293void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32);
1296void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr, 1294void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr,
1297 u32 len32); 1295 u32 len32);
1298void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr,
1299 u32 addr, u32 len);
1300void bnx2x_post_dmae(struct bnx2x *bp, struct dmae_command *dmae, int idx); 1296void bnx2x_post_dmae(struct bnx2x *bp, struct dmae_command *dmae, int idx);
1301u32 bnx2x_dmae_opcode_add_comp(u32 opcode, u8 comp_type); 1297u32 bnx2x_dmae_opcode_add_comp(u32 opcode, u8 comp_type);
1302u32 bnx2x_dmae_opcode_clr_src_reset(u32 opcode); 1298u32 bnx2x_dmae_opcode_clr_src_reset(u32 opcode);
@@ -1307,7 +1303,6 @@ int bnx2x_get_gpio(struct bnx2x *bp, int gpio_num, u8 port);
1307int bnx2x_set_gpio(struct bnx2x *bp, int gpio_num, u32 mode, u8 port); 1303int bnx2x_set_gpio(struct bnx2x *bp, int gpio_num, u32 mode, u8 port);
1308int bnx2x_set_gpio_int(struct bnx2x *bp, int gpio_num, u32 mode, u8 port); 1304int bnx2x_set_gpio_int(struct bnx2x *bp, int gpio_num, u32 mode, u8 port);
1309u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param); 1305u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param);
1310void bnx2x_reg_wr_ind(struct bnx2x *bp, u32 addr, u32 val);
1311 1306
1312void bnx2x_calc_fc_adv(struct bnx2x *bp); 1307void bnx2x_calc_fc_adv(struct bnx2x *bp);
1313int bnx2x_sp_post(struct bnx2x *bp, int command, int cid, 1308int bnx2x_sp_post(struct bnx2x *bp, int command, int cid,
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index bc5837514074..459614d2d7bc 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -25,6 +25,7 @@
25 25
26#include "bnx2x_init.h" 26#include "bnx2x_init.h"
27 27
28static int bnx2x_setup_irqs(struct bnx2x *bp);
28 29
29/* free skb in the packet ring at pos idx 30/* free skb in the packet ring at pos idx
30 * return idx of last bd freed 31 * return idx of last bd freed
@@ -2187,7 +2188,7 @@ int bnx2x_change_mac_addr(struct net_device *dev, void *p)
2187} 2188}
2188 2189
2189 2190
2190int bnx2x_setup_irqs(struct bnx2x *bp) 2191static int bnx2x_setup_irqs(struct bnx2x *bp)
2191{ 2192{
2192 int rc = 0; 2193 int rc = 0;
2193 if (bp->flags & USING_MSIX_FLAG) { 2194 if (bp->flags & USING_MSIX_FLAG) {
diff --git a/drivers/net/bnx2x/bnx2x_cmn.h b/drivers/net/bnx2x/bnx2x_cmn.h
index 5bfe0ab1d2d4..6b28739c5302 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/bnx2x/bnx2x_cmn.h
@@ -117,13 +117,6 @@ void bnx2x_setup_cnic_irq_info(struct bnx2x *bp);
117void bnx2x_int_enable(struct bnx2x *bp); 117void bnx2x_int_enable(struct bnx2x *bp);
118 118
119/** 119/**
120 * Disable HW interrupts.
121 *
122 * @param bp
123 */
124void bnx2x_int_disable(struct bnx2x *bp);
125
126/**
127 * Disable interrupts. This function ensures that there are no 120 * Disable interrupts. This function ensures that there are no
128 * ISRs or SP DPCs (sp_task) are running after it returns. 121 * ISRs or SP DPCs (sp_task) are running after it returns.
129 * 122 *
@@ -192,17 +185,6 @@ int bnx2x_setup_client(struct bnx2x *bp, struct bnx2x_fastpath *fp,
192 int is_leading); 185 int is_leading);
193 186
194/** 187/**
195 * Bring down an eth client.
196 *
197 * @param bp
198 * @param p
199 *
200 * @return int
201 */
202int bnx2x_stop_fw_client(struct bnx2x *bp,
203 struct bnx2x_client_ramrod_params *p);
204
205/**
206 * Set number of queues according to mode 188 * Set number of queues according to mode
207 * 189 *
208 * @param bp 190 * @param bp
@@ -250,34 +232,6 @@ int bnx2x_release_hw_lock(struct bnx2x *bp, u32 resource);
250 */ 232 */
251void bnx2x_set_eth_mac(struct bnx2x *bp, int set); 233void bnx2x_set_eth_mac(struct bnx2x *bp, int set);
252 234
253#ifdef BCM_CNIC
254/**
255 * Set iSCSI MAC(s) at the next enties in the CAM after the ETH
256 * MAC(s). The function will wait until the ramrod completion
257 * returns.
258 *
259 * @param bp driver handle
260 * @param set set or clear the CAM entry
261 *
262 * @return 0 if cussess, -ENODEV if ramrod doesn't return.
263 */
264int bnx2x_set_iscsi_eth_mac_addr(struct bnx2x *bp, int set);
265#endif
266
267/**
268 * Initialize status block in FW and HW
269 *
270 * @param bp driver handle
271 * @param dma_addr_t mapping
272 * @param int sb_id
273 * @param int vfid
274 * @param u8 vf_valid
275 * @param int fw_sb_id
276 * @param int igu_sb_id
277 */
278void bnx2x_init_sb(struct bnx2x *bp, dma_addr_t mapping, int vfid,
279 u8 vf_valid, int fw_sb_id, int igu_sb_id);
280
281/** 235/**
282 * Set MAC filtering configurations. 236 * Set MAC filtering configurations.
283 * 237 *
@@ -326,7 +280,6 @@ void bnx2x_sp_event(struct bnx2x_fastpath *fp, union eth_rx_cqe *rr_cqe);
326 * @return int 280 * @return int
327 */ 281 */
328int bnx2x_func_start(struct bnx2x *bp); 282int bnx2x_func_start(struct bnx2x *bp);
329int bnx2x_func_stop(struct bnx2x *bp);
330 283
331/** 284/**
332 * Prepare ILT configurations according to current driver 285 * Prepare ILT configurations according to current driver
@@ -396,14 +349,6 @@ int bnx2x_enable_msix(struct bnx2x *bp);
396int bnx2x_enable_msi(struct bnx2x *bp); 349int bnx2x_enable_msi(struct bnx2x *bp);
397 350
398/** 351/**
399 * Request IRQ vectors from OS.
400 *
401 * @param bp
402 *
403 * @return int
404 */
405int bnx2x_setup_irqs(struct bnx2x *bp);
406/**
407 * NAPI callback 352 * NAPI callback
408 * 353 *
409 * @param napi 354 * @param napi
diff --git a/drivers/net/bnx2x/bnx2x_init_ops.h b/drivers/net/bnx2x/bnx2x_init_ops.h
index e65de784182c..a306b0e46b61 100644
--- a/drivers/net/bnx2x/bnx2x_init_ops.h
+++ b/drivers/net/bnx2x/bnx2x_init_ops.h
@@ -16,7 +16,9 @@
16#define BNX2X_INIT_OPS_H 16#define BNX2X_INIT_OPS_H
17 17
18static int bnx2x_gunzip(struct bnx2x *bp, const u8 *zbuf, int len); 18static int bnx2x_gunzip(struct bnx2x *bp, const u8 *zbuf, int len);
19 19static void bnx2x_reg_wr_ind(struct bnx2x *bp, u32 addr, u32 val);
20static void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr,
21 u32 addr, u32 len);
20 22
21static void bnx2x_init_str_wr(struct bnx2x *bp, u32 addr, const u32 *data, 23static void bnx2x_init_str_wr(struct bnx2x *bp, u32 addr, const u32 *data,
22 u32 len) 24 u32 len)
@@ -589,7 +591,7 @@ static int bnx2x_ilt_client_mem_op(struct bnx2x *bp, int cli_num, u8 memop)
589 return rc; 591 return rc;
590} 592}
591 593
592int bnx2x_ilt_mem_op(struct bnx2x *bp, u8 memop) 594static int bnx2x_ilt_mem_op(struct bnx2x *bp, u8 memop)
593{ 595{
594 int rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_CDU, memop); 596 int rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_CDU, memop);
595 if (!rc) 597 if (!rc)
@@ -635,7 +637,7 @@ static void bnx2x_ilt_line_init_op(struct bnx2x *bp, struct bnx2x_ilt *ilt,
635 } 637 }
636} 638}
637 639
638void bnx2x_ilt_boundry_init_op(struct bnx2x *bp, 640static void bnx2x_ilt_boundry_init_op(struct bnx2x *bp,
639 struct ilt_client_info *ilt_cli, 641 struct ilt_client_info *ilt_cli,
640 u32 ilt_start, u8 initop) 642 u32 ilt_start, u8 initop)
641{ 643{
@@ -688,8 +690,10 @@ void bnx2x_ilt_boundry_init_op(struct bnx2x *bp,
688 } 690 }
689} 691}
690 692
691void bnx2x_ilt_client_init_op_ilt(struct bnx2x *bp, struct bnx2x_ilt *ilt, 693static void bnx2x_ilt_client_init_op_ilt(struct bnx2x *bp,
692 struct ilt_client_info *ilt_cli, u8 initop) 694 struct bnx2x_ilt *ilt,
695 struct ilt_client_info *ilt_cli,
696 u8 initop)
693{ 697{
694 int i; 698 int i;
695 699
@@ -703,8 +707,8 @@ void bnx2x_ilt_client_init_op_ilt(struct bnx2x *bp, struct bnx2x_ilt *ilt,
703 bnx2x_ilt_boundry_init_op(bp, ilt_cli, ilt->start_line, initop); 707 bnx2x_ilt_boundry_init_op(bp, ilt_cli, ilt->start_line, initop);
704} 708}
705 709
706void bnx2x_ilt_client_init_op(struct bnx2x *bp, 710static void bnx2x_ilt_client_init_op(struct bnx2x *bp,
707 struct ilt_client_info *ilt_cli, u8 initop) 711 struct ilt_client_info *ilt_cli, u8 initop)
708{ 712{
709 struct bnx2x_ilt *ilt = BP_ILT(bp); 713 struct bnx2x_ilt *ilt = BP_ILT(bp);
710 714
@@ -720,7 +724,7 @@ static void bnx2x_ilt_client_id_init_op(struct bnx2x *bp,
720 bnx2x_ilt_client_init_op(bp, ilt_cli, initop); 724 bnx2x_ilt_client_init_op(bp, ilt_cli, initop);
721} 725}
722 726
723void bnx2x_ilt_init_op(struct bnx2x *bp, u8 initop) 727static void bnx2x_ilt_init_op(struct bnx2x *bp, u8 initop)
724{ 728{
725 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_CDU, initop); 729 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_CDU, initop);
726 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_QM, initop); 730 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_QM, initop);
@@ -752,7 +756,7 @@ static void bnx2x_ilt_init_client_psz(struct bnx2x *bp, int cli_num,
752 * called during init common stage, ilt clients should be initialized 756 * called during init common stage, ilt clients should be initialized
753 * prioir to calling this function 757 * prioir to calling this function
754 */ 758 */
755void bnx2x_ilt_init_page_size(struct bnx2x *bp, u8 initop) 759static void bnx2x_ilt_init_page_size(struct bnx2x *bp, u8 initop)
756{ 760{
757 bnx2x_ilt_init_client_psz(bp, ILT_CLIENT_CDU, 761 bnx2x_ilt_init_client_psz(bp, ILT_CLIENT_CDU,
758 PXP2_REG_RQ_CDU_P_SIZE, initop); 762 PXP2_REG_RQ_CDU_P_SIZE, initop);
@@ -772,8 +776,8 @@ void bnx2x_ilt_init_page_size(struct bnx2x *bp, u8 initop)
772#define QM_INIT(cid_cnt) (cid_cnt > QM_INIT_MIN_CID_COUNT) 776#define QM_INIT(cid_cnt) (cid_cnt > QM_INIT_MIN_CID_COUNT)
773 777
774/* called during init port stage */ 778/* called during init port stage */
775void bnx2x_qm_init_cid_count(struct bnx2x *bp, int qm_cid_count, 779static void bnx2x_qm_init_cid_count(struct bnx2x *bp, int qm_cid_count,
776 u8 initop) 780 u8 initop)
777{ 781{
778 int port = BP_PORT(bp); 782 int port = BP_PORT(bp);
779 783
@@ -814,8 +818,8 @@ static void bnx2x_qm_set_ptr_table(struct bnx2x *bp, int qm_cid_count)
814} 818}
815 819
816/* called during init common stage */ 820/* called during init common stage */
817void bnx2x_qm_init_ptr_table(struct bnx2x *bp, int qm_cid_count, 821static void bnx2x_qm_init_ptr_table(struct bnx2x *bp, int qm_cid_count,
818 u8 initop) 822 u8 initop)
819{ 823{
820 if (!QM_INIT(qm_cid_count)) 824 if (!QM_INIT(qm_cid_count))
821 return; 825 return;
@@ -836,8 +840,8 @@ void bnx2x_qm_init_ptr_table(struct bnx2x *bp, int qm_cid_count,
836****************************************************************************/ 840****************************************************************************/
837 841
838/* called during init func stage */ 842/* called during init func stage */
839void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2, 843static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2,
840 dma_addr_t t2_mapping, int src_cid_count) 844 dma_addr_t t2_mapping, int src_cid_count)
841{ 845{
842 int i; 846 int i;
843 int port = BP_PORT(bp); 847 int port = BP_PORT(bp);
diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c
index 3e99bf9c42b9..2326774df843 100644
--- a/drivers/net/bnx2x/bnx2x_link.c
+++ b/drivers/net/bnx2x/bnx2x_link.c
@@ -181,6 +181,12 @@
181 (_bank + (_addr & 0xf)), \ 181 (_bank + (_addr & 0xf)), \
182 _val) 182 _val)
183 183
184static u8 bnx2x_cl45_read(struct bnx2x *bp, struct bnx2x_phy *phy,
185 u8 devad, u16 reg, u16 *ret_val);
186
187static u8 bnx2x_cl45_write(struct bnx2x *bp, struct bnx2x_phy *phy,
188 u8 devad, u16 reg, u16 val);
189
184static u32 bnx2x_bits_en(struct bnx2x *bp, u32 reg, u32 bits) 190static u32 bnx2x_bits_en(struct bnx2x *bp, u32 reg, u32 bits)
185{ 191{
186 u32 val = REG_RD(bp, reg); 192 u32 val = REG_RD(bp, reg);
@@ -594,7 +600,7 @@ static u8 bnx2x_bmac2_enable(struct link_params *params,
594 return 0; 600 return 0;
595} 601}
596 602
597u8 bnx2x_bmac_enable(struct link_params *params, 603static u8 bnx2x_bmac_enable(struct link_params *params,
598 struct link_vars *vars, 604 struct link_vars *vars,
599 u8 is_lb) 605 u8 is_lb)
600{ 606{
@@ -2537,122 +2543,6 @@ static void bnx2x_set_xgxs_loopback(struct bnx2x_phy *phy,
2537 } 2543 }
2538} 2544}
2539 2545
2540/*
2541 *------------------------------------------------------------------------
2542 * bnx2x_override_led_value -
2543 *
2544 * Override the led value of the requested led
2545 *
2546 *------------------------------------------------------------------------
2547 */
2548u8 bnx2x_override_led_value(struct bnx2x *bp, u8 port,
2549 u32 led_idx, u32 value)
2550{
2551 u32 reg_val;
2552
2553 /* If port 0 then use EMAC0, else use EMAC1*/
2554 u32 emac_base = (port) ? GRCBASE_EMAC1 : GRCBASE_EMAC0;
2555
2556 DP(NETIF_MSG_LINK,
2557 "bnx2x_override_led_value() port %x led_idx %d value %d\n",
2558 port, led_idx, value);
2559
2560 switch (led_idx) {
2561 case 0: /* 10MB led */
2562 /* Read the current value of the LED register in
2563 the EMAC block */
2564 reg_val = REG_RD(bp, emac_base + EMAC_REG_EMAC_LED);
2565 /* Set the OVERRIDE bit to 1 */
2566 reg_val |= EMAC_LED_OVERRIDE;
2567 /* If value is 1, set the 10M_OVERRIDE bit,
2568 otherwise reset it.*/
2569 reg_val = (value == 1) ? (reg_val | EMAC_LED_10MB_OVERRIDE) :
2570 (reg_val & ~EMAC_LED_10MB_OVERRIDE);
2571 REG_WR(bp, emac_base + EMAC_REG_EMAC_LED, reg_val);
2572 break;
2573 case 1: /*100MB led */
2574 /*Read the current value of the LED register in
2575 the EMAC block */
2576 reg_val = REG_RD(bp, emac_base + EMAC_REG_EMAC_LED);
2577 /* Set the OVERRIDE bit to 1 */
2578 reg_val |= EMAC_LED_OVERRIDE;
2579 /* If value is 1, set the 100M_OVERRIDE bit,
2580 otherwise reset it.*/
2581 reg_val = (value == 1) ? (reg_val | EMAC_LED_100MB_OVERRIDE) :
2582 (reg_val & ~EMAC_LED_100MB_OVERRIDE);
2583 REG_WR(bp, emac_base + EMAC_REG_EMAC_LED, reg_val);
2584 break;
2585 case 2: /* 1000MB led */
2586 /* Read the current value of the LED register in the
2587 EMAC block */
2588 reg_val = REG_RD(bp, emac_base + EMAC_REG_EMAC_LED);
2589 /* Set the OVERRIDE bit to 1 */
2590 reg_val |= EMAC_LED_OVERRIDE;
2591 /* If value is 1, set the 1000M_OVERRIDE bit, otherwise
2592 reset it. */
2593 reg_val = (value == 1) ? (reg_val | EMAC_LED_1000MB_OVERRIDE) :
2594 (reg_val & ~EMAC_LED_1000MB_OVERRIDE);
2595 REG_WR(bp, emac_base + EMAC_REG_EMAC_LED, reg_val);
2596 break;
2597 case 3: /* 2500MB led */
2598 /* Read the current value of the LED register in the
2599 EMAC block*/
2600 reg_val = REG_RD(bp, emac_base + EMAC_REG_EMAC_LED);
2601 /* Set the OVERRIDE bit to 1 */
2602 reg_val |= EMAC_LED_OVERRIDE;
2603 /* If value is 1, set the 2500M_OVERRIDE bit, otherwise
2604 reset it.*/
2605 reg_val = (value == 1) ? (reg_val | EMAC_LED_2500MB_OVERRIDE) :
2606 (reg_val & ~EMAC_LED_2500MB_OVERRIDE);
2607 REG_WR(bp, emac_base + EMAC_REG_EMAC_LED, reg_val);
2608 break;
2609 case 4: /*10G led */
2610 if (port == 0) {
2611 REG_WR(bp, NIG_REG_LED_10G_P0,
2612 value);
2613 } else {
2614 REG_WR(bp, NIG_REG_LED_10G_P1,
2615 value);
2616 }
2617 break;
2618 case 5: /* TRAFFIC led */
2619 /* Find if the traffic control is via BMAC or EMAC */
2620 if (port == 0)
2621 reg_val = REG_RD(bp, NIG_REG_NIG_EMAC0_EN);
2622 else
2623 reg_val = REG_RD(bp, NIG_REG_NIG_EMAC1_EN);
2624
2625 /* Override the traffic led in the EMAC:*/
2626 if (reg_val == 1) {
2627 /* Read the current value of the LED register in
2628 the EMAC block */
2629 reg_val = REG_RD(bp, emac_base +
2630 EMAC_REG_EMAC_LED);
2631 /* Set the TRAFFIC_OVERRIDE bit to 1 */
2632 reg_val |= EMAC_LED_OVERRIDE;
2633 /* If value is 1, set the TRAFFIC bit, otherwise
2634 reset it.*/
2635 reg_val = (value == 1) ? (reg_val | EMAC_LED_TRAFFIC) :
2636 (reg_val & ~EMAC_LED_TRAFFIC);
2637 REG_WR(bp, emac_base + EMAC_REG_EMAC_LED, reg_val);
2638 } else { /* Override the traffic led in the BMAC: */
2639 REG_WR(bp, NIG_REG_LED_CONTROL_OVERRIDE_TRAFFIC_P0
2640 + port*4, 1);
2641 REG_WR(bp, NIG_REG_LED_CONTROL_TRAFFIC_P0 + port*4,
2642 value);
2643 }
2644 break;
2645 default:
2646 DP(NETIF_MSG_LINK,
2647 "bnx2x_override_led_value() unknown led index %d "
2648 "(should be 0-5)\n", led_idx);
2649 return -EINVAL;
2650 }
2651
2652 return 0;
2653}
2654
2655
2656u8 bnx2x_set_led(struct link_params *params, 2546u8 bnx2x_set_led(struct link_params *params,
2657 struct link_vars *vars, u8 mode, u32 speed) 2547 struct link_vars *vars, u8 mode, u32 speed)
2658{ 2548{
@@ -4099,9 +3989,9 @@ static u8 bnx2x_8727_read_sfp_module_eeprom(struct bnx2x_phy *phy,
4099 return -EINVAL; 3989 return -EINVAL;
4100} 3990}
4101 3991
4102u8 bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy, 3992static u8 bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy,
4103 struct link_params *params, u16 addr, 3993 struct link_params *params, u16 addr,
4104 u8 byte_cnt, u8 *o_buf) 3994 u8 byte_cnt, u8 *o_buf)
4105{ 3995{
4106 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726) 3996 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726)
4107 return bnx2x_8726_read_sfp_module_eeprom(phy, params, addr, 3997 return bnx2x_8726_read_sfp_module_eeprom(phy, params, addr,
@@ -6819,13 +6709,6 @@ u8 bnx2x_phy_probe(struct link_params *params)
6819 return 0; 6709 return 0;
6820} 6710}
6821 6711
6822u32 bnx2x_supported_attr(struct link_params *params, u8 phy_idx)
6823{
6824 if (phy_idx < params->num_phys)
6825 return params->phy[phy_idx].supported;
6826 return 0;
6827}
6828
6829static void set_phy_vars(struct link_params *params) 6712static void set_phy_vars(struct link_params *params)
6830{ 6713{
6831 struct bnx2x *bp = params->bp; 6714 struct bnx2x *bp = params->bp;
diff --git a/drivers/net/bnx2x/bnx2x_link.h b/drivers/net/bnx2x/bnx2x_link.h
index 58a4c7199276..171abf8097ee 100644
--- a/drivers/net/bnx2x/bnx2x_link.h
+++ b/drivers/net/bnx2x/bnx2x_link.h
@@ -279,12 +279,6 @@ u8 bnx2x_phy_read(struct link_params *params, u8 phy_addr,
279 279
280u8 bnx2x_phy_write(struct link_params *params, u8 phy_addr, 280u8 bnx2x_phy_write(struct link_params *params, u8 phy_addr,
281 u8 devad, u16 reg, u16 val); 281 u8 devad, u16 reg, u16 val);
282
283u8 bnx2x_cl45_read(struct bnx2x *bp, struct bnx2x_phy *phy,
284 u8 devad, u16 reg, u16 *ret_val);
285
286u8 bnx2x_cl45_write(struct bnx2x *bp, struct bnx2x_phy *phy,
287 u8 devad, u16 reg, u16 val);
288/* Reads the link_status from the shmem, 282/* Reads the link_status from the shmem,
289 and update the link vars accordingly */ 283 and update the link vars accordingly */
290void bnx2x_link_status_update(struct link_params *input, 284void bnx2x_link_status_update(struct link_params *input,
@@ -304,8 +298,6 @@ u8 bnx2x_set_led(struct link_params *params, struct link_vars *vars,
304#define LED_MODE_OPER 2 298#define LED_MODE_OPER 2
305#define LED_MODE_FRONT_PANEL_OFF 3 299#define LED_MODE_FRONT_PANEL_OFF 3
306 300
307u8 bnx2x_override_led_value(struct bnx2x *bp, u8 port, u32 led_idx, u32 value);
308
309/* bnx2x_handle_module_detect_int should be called upon module detection 301/* bnx2x_handle_module_detect_int should be called upon module detection
310 interrupt */ 302 interrupt */
311void bnx2x_handle_module_detect_int(struct link_params *params); 303void bnx2x_handle_module_detect_int(struct link_params *params);
@@ -325,19 +317,12 @@ void bnx2x_ext_phy_hw_reset(struct bnx2x *bp, u8 port);
325/* Reset the external of SFX7101 */ 317/* Reset the external of SFX7101 */
326void bnx2x_sfx7101_sp_sw_reset(struct bnx2x *bp, struct bnx2x_phy *phy); 318void bnx2x_sfx7101_sp_sw_reset(struct bnx2x *bp, struct bnx2x_phy *phy);
327 319
328u8 bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy,
329 struct link_params *params, u16 addr,
330 u8 byte_cnt, u8 *o_buf);
331
332void bnx2x_hw_reset_phy(struct link_params *params); 320void bnx2x_hw_reset_phy(struct link_params *params);
333 321
334/* Checks if HW lock is required for this phy/board type */ 322/* Checks if HW lock is required for this phy/board type */
335u8 bnx2x_hw_lock_required(struct bnx2x *bp, u32 shmem_base, 323u8 bnx2x_hw_lock_required(struct bnx2x *bp, u32 shmem_base,
336 u32 shmem2_base); 324 u32 shmem2_base);
337 325
338/* Returns the aggregative supported attributes of the phys on board */
339u32 bnx2x_supported_attr(struct link_params *params, u8 phy_idx);
340
341/* Check swap bit and adjust PHY order */ 326/* Check swap bit and adjust PHY order */
342u32 bnx2x_phy_selection(struct link_params *params); 327u32 bnx2x_phy_selection(struct link_params *params);
343 328
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index ff99a2fc0426..e9ad16f00b56 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -403,7 +403,7 @@ static inline void storm_memset_hc_disable(struct bnx2x *bp, u8 port,
403/* used only at init 403/* used only at init
404 * locking is done by mcp 404 * locking is done by mcp
405 */ 405 */
406void bnx2x_reg_wr_ind(struct bnx2x *bp, u32 addr, u32 val) 406static void bnx2x_reg_wr_ind(struct bnx2x *bp, u32 addr, u32 val)
407{ 407{
408 pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS, addr); 408 pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS, addr);
409 pci_write_config_dword(bp->pdev, PCICFG_GRC_DATA, val); 409 pci_write_config_dword(bp->pdev, PCICFG_GRC_DATA, val);
@@ -429,7 +429,8 @@ static u32 bnx2x_reg_rd_ind(struct bnx2x *bp, u32 addr)
429#define DMAE_DP_DST_PCI "pci dst_addr [%x:%08x]" 429#define DMAE_DP_DST_PCI "pci dst_addr [%x:%08x]"
430#define DMAE_DP_DST_NONE "dst_addr [none]" 430#define DMAE_DP_DST_NONE "dst_addr [none]"
431 431
432void bnx2x_dp_dmae(struct bnx2x *bp, struct dmae_command *dmae, int msglvl) 432static void bnx2x_dp_dmae(struct bnx2x *bp, struct dmae_command *dmae,
433 int msglvl)
433{ 434{
434 u32 src_type = dmae->opcode & DMAE_COMMAND_SRC; 435 u32 src_type = dmae->opcode & DMAE_COMMAND_SRC;
435 436
@@ -551,8 +552,9 @@ u32 bnx2x_dmae_opcode(struct bnx2x *bp, u8 src_type, u8 dst_type,
551 return opcode; 552 return opcode;
552} 553}
553 554
554void bnx2x_prep_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae, 555static void bnx2x_prep_dmae_with_comp(struct bnx2x *bp,
555 u8 src_type, u8 dst_type) 556 struct dmae_command *dmae,
557 u8 src_type, u8 dst_type)
556{ 558{
557 memset(dmae, 0, sizeof(struct dmae_command)); 559 memset(dmae, 0, sizeof(struct dmae_command));
558 560
@@ -567,7 +569,8 @@ void bnx2x_prep_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae,
567} 569}
568 570
569/* issue a dmae command over the init-channel and wailt for completion */ 571/* issue a dmae command over the init-channel and wailt for completion */
570int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae) 572static int bnx2x_issue_dmae_with_comp(struct bnx2x *bp,
573 struct dmae_command *dmae)
571{ 574{
572 u32 *wb_comp = bnx2x_sp(bp, wb_comp); 575 u32 *wb_comp = bnx2x_sp(bp, wb_comp);
573 int cnt = CHIP_REV_IS_SLOW(bp) ? (400000) : 40; 576 int cnt = CHIP_REV_IS_SLOW(bp) ? (400000) : 40;
@@ -674,8 +677,8 @@ void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32)
674 bnx2x_issue_dmae_with_comp(bp, &dmae); 677 bnx2x_issue_dmae_with_comp(bp, &dmae);
675} 678}
676 679
677void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr, 680static void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr,
678 u32 addr, u32 len) 681 u32 addr, u32 len)
679{ 682{
680 int dmae_wr_max = DMAE_LEN32_WR_MAX(bp); 683 int dmae_wr_max = DMAE_LEN32_WR_MAX(bp);
681 int offset = 0; 684 int offset = 0;
@@ -1267,7 +1270,7 @@ static void bnx2x_igu_int_disable(struct bnx2x *bp)
1267 BNX2X_ERR("BUG! proper val not read from IGU!\n"); 1270 BNX2X_ERR("BUG! proper val not read from IGU!\n");
1268} 1271}
1269 1272
1270void bnx2x_int_disable(struct bnx2x *bp) 1273static void bnx2x_int_disable(struct bnx2x *bp)
1271{ 1274{
1272 if (bp->common.int_block == INT_BLOCK_HC) 1275 if (bp->common.int_block == INT_BLOCK_HC)
1273 bnx2x_hc_int_disable(bp); 1276 bnx2x_hc_int_disable(bp);
@@ -2236,7 +2239,7 @@ u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param)
2236} 2239}
2237 2240
2238/* must be called under rtnl_lock */ 2241/* must be called under rtnl_lock */
2239void bnx2x_rxq_set_mac_filters(struct bnx2x *bp, u16 cl_id, u32 filters) 2242static void bnx2x_rxq_set_mac_filters(struct bnx2x *bp, u16 cl_id, u32 filters)
2240{ 2243{
2241 u32 mask = (1 << cl_id); 2244 u32 mask = (1 << cl_id);
2242 2245
@@ -2303,7 +2306,7 @@ void bnx2x_rxq_set_mac_filters(struct bnx2x *bp, u16 cl_id, u32 filters)
2303 bp->mac_filters.unmatched_unicast & ~mask; 2306 bp->mac_filters.unmatched_unicast & ~mask;
2304} 2307}
2305 2308
2306void bnx2x_func_init(struct bnx2x *bp, struct bnx2x_func_init_params *p) 2309static void bnx2x_func_init(struct bnx2x *bp, struct bnx2x_func_init_params *p)
2307{ 2310{
2308 struct tstorm_eth_function_common_config tcfg = {0}; 2311 struct tstorm_eth_function_common_config tcfg = {0};
2309 u16 rss_flgs; 2312 u16 rss_flgs;
@@ -2460,7 +2463,7 @@ static void bnx2x_pf_tx_cl_prep(struct bnx2x *bp,
2460 txq_init->hc_rate = bp->tx_ticks ? (1000000 / bp->tx_ticks) : 0; 2463 txq_init->hc_rate = bp->tx_ticks ? (1000000 / bp->tx_ticks) : 0;
2461} 2464}
2462 2465
2463void bnx2x_pf_init(struct bnx2x *bp) 2466static void bnx2x_pf_init(struct bnx2x *bp)
2464{ 2467{
2465 struct bnx2x_func_init_params func_init = {0}; 2468 struct bnx2x_func_init_params func_init = {0};
2466 struct bnx2x_rss_params rss = {0}; 2469 struct bnx2x_rss_params rss = {0};
@@ -3928,7 +3931,7 @@ void bnx2x_setup_ndsb_state_machine(struct hc_status_block_sm *hc_sm,
3928 hc_sm->time_to_expire = 0xFFFFFFFF; 3931 hc_sm->time_to_expire = 0xFFFFFFFF;
3929} 3932}
3930 3933
3931void bnx2x_init_sb(struct bnx2x *bp, dma_addr_t mapping, int vfid, 3934static void bnx2x_init_sb(struct bnx2x *bp, dma_addr_t mapping, int vfid,
3932 u8 vf_valid, int fw_sb_id, int igu_sb_id) 3935 u8 vf_valid, int fw_sb_id, int igu_sb_id)
3933{ 3936{
3934 int igu_seg_id; 3937 int igu_seg_id;
@@ -6021,6 +6024,9 @@ alloc_mem_err:
6021/* 6024/*
6022 * Init service functions 6025 * Init service functions
6023 */ 6026 */
6027static int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx,
6028 int *state_p, int flags);
6029
6024int bnx2x_func_start(struct bnx2x *bp) 6030int bnx2x_func_start(struct bnx2x *bp)
6025{ 6031{
6026 bnx2x_sp_post(bp, RAMROD_CMD_ID_COMMON_FUNCTION_START, 0, 0, 0, 1); 6032 bnx2x_sp_post(bp, RAMROD_CMD_ID_COMMON_FUNCTION_START, 0, 0, 0, 1);
@@ -6030,7 +6036,7 @@ int bnx2x_func_start(struct bnx2x *bp)
6030 WAIT_RAMROD_COMMON); 6036 WAIT_RAMROD_COMMON);
6031} 6037}
6032 6038
6033int bnx2x_func_stop(struct bnx2x *bp) 6039static int bnx2x_func_stop(struct bnx2x *bp)
6034{ 6040{
6035 bnx2x_sp_post(bp, RAMROD_CMD_ID_COMMON_FUNCTION_STOP, 0, 0, 0, 1); 6041 bnx2x_sp_post(bp, RAMROD_CMD_ID_COMMON_FUNCTION_STOP, 0, 0, 0, 1);
6036 6042
@@ -6103,8 +6109,8 @@ static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, u8 *mac,
6103 bnx2x_wait_ramrod(bp, 0, 0, &bp->set_mac_pending, ramrod_flags); 6109 bnx2x_wait_ramrod(bp, 0, 0, &bp->set_mac_pending, ramrod_flags);
6104} 6110}
6105 6111
6106int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx, 6112static int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx,
6107 int *state_p, int flags) 6113 int *state_p, int flags)
6108{ 6114{
6109 /* can take a while if any port is running */ 6115 /* can take a while if any port is running */
6110 int cnt = 5000; 6116 int cnt = 5000;
@@ -6154,7 +6160,7 @@ int bnx2x_wait_ramrod(struct bnx2x *bp, int state, int idx,
6154 return -EBUSY; 6160 return -EBUSY;
6155} 6161}
6156 6162
6157u8 bnx2x_e1h_cam_offset(struct bnx2x *bp, u8 rel_offset) 6163static u8 bnx2x_e1h_cam_offset(struct bnx2x *bp, u8 rel_offset)
6158{ 6164{
6159 if (CHIP_IS_E1H(bp)) 6165 if (CHIP_IS_E1H(bp))
6160 return E1H_FUNC_MAX * rel_offset + BP_FUNC(bp); 6166 return E1H_FUNC_MAX * rel_offset + BP_FUNC(bp);
@@ -6273,7 +6279,7 @@ static void bnx2x_invlidate_e1_mc_list(struct bnx2x *bp)
6273 * 6279 *
6274 * @return 0 if cussess, -ENODEV if ramrod doesn't return. 6280 * @return 0 if cussess, -ENODEV if ramrod doesn't return.
6275 */ 6281 */
6276int bnx2x_set_iscsi_eth_mac_addr(struct bnx2x *bp, int set) 6282static int bnx2x_set_iscsi_eth_mac_addr(struct bnx2x *bp, int set)
6277{ 6283{
6278 u8 cam_offset = (CHIP_IS_E1(bp) ? ((BP_PORT(bp) ? 32 : 0) + 2) : 6284 u8 cam_offset = (CHIP_IS_E1(bp) ? ((BP_PORT(bp) ? 32 : 0) + 2) :
6279 bnx2x_e1h_cam_offset(bp, CAM_ISCSI_ETH_LINE)); 6285 bnx2x_e1h_cam_offset(bp, CAM_ISCSI_ETH_LINE));
@@ -6383,11 +6389,11 @@ static inline void bnx2x_set_ctx_validation(struct eth_context *cxt, u32 cid)
6383 ETH_CONNECTION_TYPE); 6389 ETH_CONNECTION_TYPE);
6384} 6390}
6385 6391
6386int bnx2x_setup_fw_client(struct bnx2x *bp, 6392static int bnx2x_setup_fw_client(struct bnx2x *bp,
6387 struct bnx2x_client_init_params *params, 6393 struct bnx2x_client_init_params *params,
6388 u8 activate, 6394 u8 activate,
6389 struct client_init_ramrod_data *data, 6395 struct client_init_ramrod_data *data,
6390 dma_addr_t data_mapping) 6396 dma_addr_t data_mapping)
6391{ 6397{
6392 u16 hc_usec; 6398 u16 hc_usec;
6393 int ramrod = RAMROD_CMD_ID_ETH_CLIENT_SETUP; 6399 int ramrod = RAMROD_CMD_ID_ETH_CLIENT_SETUP;
@@ -6633,7 +6639,8 @@ int bnx2x_setup_client(struct bnx2x *bp, struct bnx2x_fastpath *fp,
6633 return rc; 6639 return rc;
6634} 6640}
6635 6641
6636int bnx2x_stop_fw_client(struct bnx2x *bp, struct bnx2x_client_ramrod_params *p) 6642static int bnx2x_stop_fw_client(struct bnx2x *bp,
6643 struct bnx2x_client_ramrod_params *p)
6637{ 6644{
6638 int rc; 6645 int rc;
6639 6646
@@ -7440,7 +7447,7 @@ reset_task_exit:
7440 * Init service functions 7447 * Init service functions
7441 */ 7448 */
7442 7449
7443u32 bnx2x_get_pretend_reg(struct bnx2x *bp) 7450static u32 bnx2x_get_pretend_reg(struct bnx2x *bp)
7444{ 7451{
7445 u32 base = PXP2_REG_PGL_PRETEND_FUNC_F0; 7452 u32 base = PXP2_REG_PGL_PRETEND_FUNC_F0;
7446 u32 stride = PXP2_REG_PGL_PRETEND_FUNC_F1 - base; 7453 u32 stride = PXP2_REG_PGL_PRETEND_FUNC_F1 - base;