aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/cxgb3/adapter.h3
-rw-r--r--drivers/net/cxgb3/common.h18
-rw-r--r--drivers/net/cxgb3/cxgb3_defs.h3
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c9
-rw-r--r--drivers/net/cxgb3/mc5.c38
-rw-r--r--drivers/net/cxgb3/sge.c39
-rw-r--r--drivers/net/cxgb3/t3_hw.c197
7 files changed, 18 insertions, 289 deletions
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index 4cd7f420766a..ef67be59680f 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -336,9 +336,6 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,
336 int irq_vec_idx, const struct qset_params *p, 336 int irq_vec_idx, const struct qset_params *p,
337 int ntxq, struct net_device *dev, 337 int ntxq, struct net_device *dev,
338 struct netdev_queue *netdevq); 338 struct netdev_queue *netdevq);
339int t3_get_desc(const struct sge_qset *qs, unsigned int qnum, unsigned int idx,
340 unsigned char *data);
341irqreturn_t t3_sge_intr_msix(int irq, void *cookie);
342extern struct workqueue_struct *cxgb3_wq; 339extern struct workqueue_struct *cxgb3_wq;
343 340
344int t3_get_edc_fw(struct cphy *phy, int edc_idx, int size); 341int t3_get_edc_fw(struct cphy *phy, int edc_idx, int size);
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index fe08a004b0dd..5ccb77d078aa 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -673,7 +673,6 @@ void t3_xgm_intr_enable(struct adapter *adapter, int idx);
673void t3_xgm_intr_disable(struct adapter *adapter, int idx); 673void t3_xgm_intr_disable(struct adapter *adapter, int idx);
674void t3_port_intr_enable(struct adapter *adapter, int idx); 674void t3_port_intr_enable(struct adapter *adapter, int idx);
675void t3_port_intr_disable(struct adapter *adapter, int idx); 675void t3_port_intr_disable(struct adapter *adapter, int idx);
676void t3_port_intr_clear(struct adapter *adapter, int idx);
677int t3_slow_intr_handler(struct adapter *adapter); 676int t3_slow_intr_handler(struct adapter *adapter);
678int t3_phy_intr_handler(struct adapter *adapter); 677int t3_phy_intr_handler(struct adapter *adapter);
679 678
@@ -689,14 +688,10 @@ int t3_check_tpsram_version(struct adapter *adapter);
689int t3_check_tpsram(struct adapter *adapter, const u8 *tp_ram, 688int t3_check_tpsram(struct adapter *adapter, const u8 *tp_ram,
690 unsigned int size); 689 unsigned int size);
691int t3_set_proto_sram(struct adapter *adap, const u8 *data); 690int t3_set_proto_sram(struct adapter *adap, const u8 *data);
692int t3_read_flash(struct adapter *adapter, unsigned int addr,
693 unsigned int nwords, u32 *data, int byte_oriented);
694int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size); 691int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size);
695int t3_get_fw_version(struct adapter *adapter, u32 *vers); 692int t3_get_fw_version(struct adapter *adapter, u32 *vers);
696int t3_check_fw_version(struct adapter *adapter); 693int t3_check_fw_version(struct adapter *adapter);
697int t3_init_hw(struct adapter *adapter, u32 fw_params); 694int t3_init_hw(struct adapter *adapter, u32 fw_params);
698void mac_prep(struct cmac *mac, struct adapter *adapter, int index);
699void early_hw_init(struct adapter *adapter, const struct adapter_info *ai);
700int t3_reset_adapter(struct adapter *adapter); 695int t3_reset_adapter(struct adapter *adapter);
701int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai, 696int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,
702 int reset); 697 int reset);
@@ -706,8 +701,6 @@ void t3_fatal_err(struct adapter *adapter);
706void t3_set_vlan_accel(struct adapter *adapter, unsigned int ports, int on); 701void t3_set_vlan_accel(struct adapter *adapter, unsigned int ports, int on);
707void t3_config_rss(struct adapter *adapter, unsigned int rss_config, 702void t3_config_rss(struct adapter *adapter, unsigned int rss_config,
708 const u8 * cpus, const u16 *rspq); 703 const u8 * cpus, const u16 *rspq);
709int t3_read_rss(struct adapter *adapter, u8 * lkup, u16 *map);
710int t3_mps_set_active_ports(struct adapter *adap, unsigned int port_mask);
711int t3_cim_ctl_blk_read(struct adapter *adap, unsigned int addr, 704int t3_cim_ctl_blk_read(struct adapter *adap, unsigned int addr,
712 unsigned int n, unsigned int *valp); 705 unsigned int n, unsigned int *valp);
713int t3_mc7_bd_read(struct mc7 *mc7, unsigned int start, unsigned int n, 706int t3_mc7_bd_read(struct mc7 *mc7, unsigned int start, unsigned int n,
@@ -731,19 +724,12 @@ void t3_mc5_prep(struct adapter *adapter, struct mc5 *mc5, int mode);
731int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters, 724int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters,
732 unsigned int nroutes); 725 unsigned int nroutes);
733void t3_mc5_intr_handler(struct mc5 *mc5); 726void t3_mc5_intr_handler(struct mc5 *mc5);
734int t3_read_mc5_range(const struct mc5 *mc5, unsigned int start, unsigned int n,
735 u32 *buf);
736 727
737int t3_tp_set_coalescing_size(struct adapter *adap, unsigned int size, int psh);
738void t3_tp_set_max_rxsize(struct adapter *adap, unsigned int size);
739void t3_tp_set_offload_mode(struct adapter *adap, int enable); 728void t3_tp_set_offload_mode(struct adapter *adap, int enable);
740void t3_tp_get_mib_stats(struct adapter *adap, struct tp_mib_stats *tps); 729void t3_tp_get_mib_stats(struct adapter *adap, struct tp_mib_stats *tps);
741void t3_load_mtus(struct adapter *adap, unsigned short mtus[NMTUS], 730void t3_load_mtus(struct adapter *adap, unsigned short mtus[NMTUS],
742 unsigned short alpha[NCCTRL_WIN], 731 unsigned short alpha[NCCTRL_WIN],
743 unsigned short beta[NCCTRL_WIN], unsigned short mtu_cap); 732 unsigned short beta[NCCTRL_WIN], unsigned short mtu_cap);
744void t3_read_hw_mtus(struct adapter *adap, unsigned short mtus[NMTUS]);
745void t3_get_cong_cntl_tab(struct adapter *adap,
746 unsigned short incr[NMTUS][NCCTRL_WIN]);
747void t3_config_trace_filter(struct adapter *adapter, 733void t3_config_trace_filter(struct adapter *adapter,
748 const struct trace_params *tp, int filter_index, 734 const struct trace_params *tp, int filter_index,
749 int invert, int enable); 735 int invert, int enable);
@@ -769,10 +755,6 @@ int t3_sge_enable_ecntxt(struct adapter *adapter, unsigned int id, int enable);
769int t3_sge_disable_fl(struct adapter *adapter, unsigned int id); 755int t3_sge_disable_fl(struct adapter *adapter, unsigned int id);
770int t3_sge_disable_rspcntxt(struct adapter *adapter, unsigned int id); 756int t3_sge_disable_rspcntxt(struct adapter *adapter, unsigned int id);
771int t3_sge_disable_cqcntxt(struct adapter *adapter, unsigned int id); 757int t3_sge_disable_cqcntxt(struct adapter *adapter, unsigned int id);
772int t3_sge_read_ecntxt(struct adapter *adapter, unsigned int id, u32 data[4]);
773int t3_sge_read_fl(struct adapter *adapter, unsigned int id, u32 data[4]);
774int t3_sge_read_cq(struct adapter *adapter, unsigned int id, u32 data[4]);
775int t3_sge_read_rspq(struct adapter *adapter, unsigned int id, u32 data[4]);
776int t3_sge_cqcntxt_op(struct adapter *adapter, unsigned int id, unsigned int op, 758int t3_sge_cqcntxt_op(struct adapter *adapter, unsigned int id, unsigned int op,
777 unsigned int credits); 759 unsigned int credits);
778 760
diff --git a/drivers/net/cxgb3/cxgb3_defs.h b/drivers/net/cxgb3/cxgb3_defs.h
index 47e53769af5b..920d918ed193 100644
--- a/drivers/net/cxgb3/cxgb3_defs.h
+++ b/drivers/net/cxgb3/cxgb3_defs.h
@@ -43,8 +43,6 @@
43 43
44void *cxgb_alloc_mem(unsigned long size); 44void *cxgb_alloc_mem(unsigned long size);
45void cxgb_free_mem(void *addr); 45void cxgb_free_mem(void *addr);
46void cxgb_neigh_update(struct neighbour *neigh);
47void cxgb_redirect(struct dst_entry *old, struct dst_entry *new);
48 46
49/* 47/*
50 * Map an ATID or STID to their entries in the corresponding TID tables. 48 * Map an ATID or STID to their entries in the corresponding TID tables.
@@ -111,7 +109,6 @@ static inline struct t3c_tid_entry *lookup_atid(const struct tid_info *t,
111 return &e->t3c_tid; 109 return &e->t3c_tid;
112} 110}
113 111
114int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n);
115int attach_t3cdev(struct t3cdev *dev); 112int attach_t3cdev(struct t3cdev *dev);
116void detach_t3cdev(struct t3cdev *dev); 113void detach_t3cdev(struct t3cdev *dev);
117#endif 114#endif
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index 21db7491f613..bcf07532953d 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -60,6 +60,9 @@ static LIST_HEAD(adapter_list);
60static const unsigned int MAX_ATIDS = 64 * 1024; 60static const unsigned int MAX_ATIDS = 64 * 1024;
61static const unsigned int ATID_BASE = 0x10000; 61static const unsigned int ATID_BASE = 0x10000;
62 62
63static void cxgb_neigh_update(struct neighbour *neigh);
64static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new);
65
63static inline int offload_activated(struct t3cdev *tdev) 66static inline int offload_activated(struct t3cdev *tdev)
64{ 67{
65 const struct adapter *adapter = tdev2adap(tdev); 68 const struct adapter *adapter = tdev2adap(tdev);
@@ -1015,7 +1018,7 @@ EXPORT_SYMBOL(t3_register_cpl_handler);
1015/* 1018/*
1016 * T3CDEV's receive method. 1019 * T3CDEV's receive method.
1017 */ 1020 */
1018int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n) 1021static int process_rx(struct t3cdev *dev, struct sk_buff **skbs, int n)
1019{ 1022{
1020 while (n--) { 1023 while (n--) {
1021 struct sk_buff *skb = *skbs++; 1024 struct sk_buff *skb = *skbs++;
@@ -1070,7 +1073,7 @@ static int is_offloading(struct net_device *dev)
1070 return 0; 1073 return 0;
1071} 1074}
1072 1075
1073void cxgb_neigh_update(struct neighbour *neigh) 1076static void cxgb_neigh_update(struct neighbour *neigh)
1074{ 1077{
1075 struct net_device *dev = neigh->dev; 1078 struct net_device *dev = neigh->dev;
1076 1079
@@ -1104,7 +1107,7 @@ static void set_l2t_ix(struct t3cdev *tdev, u32 tid, struct l2t_entry *e)
1104 tdev->send(tdev, skb); 1107 tdev->send(tdev, skb);
1105} 1108}
1106 1109
1107void cxgb_redirect(struct dst_entry *old, struct dst_entry *new) 1110static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
1108{ 1111{
1109 struct net_device *olddev, *newdev; 1112 struct net_device *olddev, *newdev;
1110 struct tid_info *ti; 1113 struct tid_info *ti;
diff --git a/drivers/net/cxgb3/mc5.c b/drivers/net/cxgb3/mc5.c
index 3b5517b8fbde..a8766fb2f9ab 100644
--- a/drivers/net/cxgb3/mc5.c
+++ b/drivers/net/cxgb3/mc5.c
@@ -374,44 +374,6 @@ int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters,
374 return err; 374 return err;
375} 375}
376 376
377/*
378 * read_mc5_range - dump a part of the memory managed by MC5
379 * @mc5: the MC5 handle
380 * @start: the start address for the dump
381 * @n: number of 72-bit words to read
382 * @buf: result buffer
383 *
384 * Read n 72-bit words from MC5 memory from the given start location.
385 */
386int t3_read_mc5_range(const struct mc5 *mc5, unsigned int start,
387 unsigned int n, u32 *buf)
388{
389 u32 read_cmd;
390 int err = 0;
391 struct adapter *adap = mc5->adapter;
392
393 if (mc5->part_type == IDT75P52100)
394 read_cmd = IDT_CMD_READ;
395 else if (mc5->part_type == IDT75N43102)
396 read_cmd = IDT4_CMD_READ;
397 else
398 return -EINVAL;
399
400 mc5_dbgi_mode_enable(mc5);
401
402 while (n--) {
403 t3_write_reg(adap, A_MC5_DB_DBGI_REQ_ADDR0, start++);
404 if (mc5_cmd_write(adap, read_cmd)) {
405 err = -EIO;
406 break;
407 }
408 dbgi_rd_rsp3(adap, buf + 2, buf + 1, buf);
409 buf += 3;
410 }
411
412 mc5_dbgi_mode_disable(mc5);
413 return 0;
414}
415 377
416#define MC5_INT_FATAL (F_PARITYERR | F_REQQPARERR | F_DISPQPARERR) 378#define MC5_INT_FATAL (F_PARITYERR | F_REQQPARERR | F_DISPQPARERR)
417 379
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 7ad4625dac62..5d72bda54389 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -2554,7 +2554,7 @@ static inline int handle_responses(struct adapter *adap, struct sge_rspq *q)
2554 * The MSI-X interrupt handler for an SGE response queue for the non-NAPI case 2554 * The MSI-X interrupt handler for an SGE response queue for the non-NAPI case
2555 * (i.e., response queue serviced in hard interrupt). 2555 * (i.e., response queue serviced in hard interrupt).
2556 */ 2556 */
2557irqreturn_t t3_sge_intr_msix(int irq, void *cookie) 2557static irqreturn_t t3_sge_intr_msix(int irq, void *cookie)
2558{ 2558{
2559 struct sge_qset *qs = cookie; 2559 struct sge_qset *qs = cookie;
2560 struct adapter *adap = qs->adap; 2560 struct adapter *adap = qs->adap;
@@ -3320,40 +3320,3 @@ void t3_sge_prep(struct adapter *adap, struct sge_params *p)
3320 3320
3321 spin_lock_init(&adap->sge.reg_lock); 3321 spin_lock_init(&adap->sge.reg_lock);
3322} 3322}
3323
3324/**
3325 * t3_get_desc - dump an SGE descriptor for debugging purposes
3326 * @qs: the queue set
3327 * @qnum: identifies the specific queue (0..2: Tx, 3:response, 4..5: Rx)
3328 * @idx: the descriptor index in the queue
3329 * @data: where to dump the descriptor contents
3330 *
3331 * Dumps the contents of a HW descriptor of an SGE queue. Returns the
3332 * size of the descriptor.
3333 */
3334int t3_get_desc(const struct sge_qset *qs, unsigned int qnum, unsigned int idx,
3335 unsigned char *data)
3336{
3337 if (qnum >= 6)
3338 return -EINVAL;
3339
3340 if (qnum < 3) {
3341 if (!qs->txq[qnum].desc || idx >= qs->txq[qnum].size)
3342 return -EINVAL;
3343 memcpy(data, &qs->txq[qnum].desc[idx], sizeof(struct tx_desc));
3344 return sizeof(struct tx_desc);
3345 }
3346
3347 if (qnum == 3) {
3348 if (!qs->rspq.desc || idx >= qs->rspq.size)
3349 return -EINVAL;
3350 memcpy(data, &qs->rspq.desc[idx], sizeof(struct rsp_desc));
3351 return sizeof(struct rsp_desc);
3352 }
3353
3354 qnum -= 4;
3355 if (!qs->fl[qnum].desc || idx >= qs->fl[qnum].size)
3356 return -EINVAL;
3357 memcpy(data, &qs->fl[qnum].desc[idx], sizeof(struct rx_desc));
3358 return sizeof(struct rx_desc);
3359}
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 421d5589cecd..3a6adf0b3e9d 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -34,6 +34,8 @@
34#include "sge_defs.h" 34#include "sge_defs.h"
35#include "firmware_exports.h" 35#include "firmware_exports.h"
36 36
37static void t3_port_intr_clear(struct adapter *adapter, int idx);
38
37/** 39/**
38 * t3_wait_op_done_val - wait until an operation is completed 40 * t3_wait_op_done_val - wait until an operation is completed
39 * @adapter: the adapter performing the operation 41 * @adapter: the adapter performing the operation
@@ -840,8 +842,8 @@ static int flash_wait_op(struct adapter *adapter, int attempts, int delay)
840 * (i.e., big-endian), otherwise as 32-bit words in the platform's 842 * (i.e., big-endian), otherwise as 32-bit words in the platform's
841 * natural endianess. 843 * natural endianess.
842 */ 844 */
843int t3_read_flash(struct adapter *adapter, unsigned int addr, 845static int t3_read_flash(struct adapter *adapter, unsigned int addr,
844 unsigned int nwords, u32 *data, int byte_oriented) 846 unsigned int nwords, u32 *data, int byte_oriented)
845{ 847{
846 int ret; 848 int ret;
847 849
@@ -2111,7 +2113,7 @@ void t3_port_intr_disable(struct adapter *adapter, int idx)
2111 * Clear port-specific (i.e., MAC and PHY) interrupts for the given 2113 * Clear port-specific (i.e., MAC and PHY) interrupts for the given
2112 * adapter port. 2114 * adapter port.
2113 */ 2115 */
2114void t3_port_intr_clear(struct adapter *adapter, int idx) 2116static void t3_port_intr_clear(struct adapter *adapter, int idx)
2115{ 2117{
2116 struct cphy *phy = &adap2pinfo(adapter, idx)->phy; 2118 struct cphy *phy = &adap2pinfo(adapter, idx)->phy;
2117 2119
@@ -2484,98 +2486,6 @@ int t3_sge_cqcntxt_op(struct adapter *adapter, unsigned int id, unsigned int op,
2484} 2486}
2485 2487
2486/** 2488/**
2487 * t3_sge_read_context - read an SGE context
2488 * @type: the context type
2489 * @adapter: the adapter
2490 * @id: the context id
2491 * @data: holds the retrieved context
2492 *
2493 * Read an SGE egress context. The caller is responsible for ensuring
2494 * only one context operation occurs at a time.
2495 */
2496static int t3_sge_read_context(unsigned int type, struct adapter *adapter,
2497 unsigned int id, u32 data[4])
2498{
2499 if (t3_read_reg(adapter, A_SG_CONTEXT_CMD) & F_CONTEXT_CMD_BUSY)
2500 return -EBUSY;
2501
2502 t3_write_reg(adapter, A_SG_CONTEXT_CMD,
2503 V_CONTEXT_CMD_OPCODE(0) | type | V_CONTEXT(id));
2504 if (t3_wait_op_done(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY, 0,
2505 SG_CONTEXT_CMD_ATTEMPTS, 1))
2506 return -EIO;
2507 data[0] = t3_read_reg(adapter, A_SG_CONTEXT_DATA0);
2508 data[1] = t3_read_reg(adapter, A_SG_CONTEXT_DATA1);
2509 data[2] = t3_read_reg(adapter, A_SG_CONTEXT_DATA2);
2510 data[3] = t3_read_reg(adapter, A_SG_CONTEXT_DATA3);
2511 return 0;
2512}
2513
2514/**
2515 * t3_sge_read_ecntxt - read an SGE egress context
2516 * @adapter: the adapter
2517 * @id: the context id
2518 * @data: holds the retrieved context
2519 *
2520 * Read an SGE egress context. The caller is responsible for ensuring
2521 * only one context operation occurs at a time.
2522 */
2523int t3_sge_read_ecntxt(struct adapter *adapter, unsigned int id, u32 data[4])
2524{
2525 if (id >= 65536)
2526 return -EINVAL;
2527 return t3_sge_read_context(F_EGRESS, adapter, id, data);
2528}
2529
2530/**
2531 * t3_sge_read_cq - read an SGE CQ context
2532 * @adapter: the adapter
2533 * @id: the context id
2534 * @data: holds the retrieved context
2535 *
2536 * Read an SGE CQ context. The caller is responsible for ensuring
2537 * only one context operation occurs at a time.
2538 */
2539int t3_sge_read_cq(struct adapter *adapter, unsigned int id, u32 data[4])
2540{
2541 if (id >= 65536)
2542 return -EINVAL;
2543 return t3_sge_read_context(F_CQ, adapter, id, data);
2544}
2545
2546/**
2547 * t3_sge_read_fl - read an SGE free-list context
2548 * @adapter: the adapter
2549 * @id: the context id
2550 * @data: holds the retrieved context
2551 *
2552 * Read an SGE free-list context. The caller is responsible for ensuring
2553 * only one context operation occurs at a time.
2554 */
2555int t3_sge_read_fl(struct adapter *adapter, unsigned int id, u32 data[4])
2556{
2557 if (id >= SGE_QSETS * 2)
2558 return -EINVAL;
2559 return t3_sge_read_context(F_FREELIST, adapter, id, data);
2560}
2561
2562/**
2563 * t3_sge_read_rspq - read an SGE response queue context
2564 * @adapter: the adapter
2565 * @id: the context id
2566 * @data: holds the retrieved context
2567 *
2568 * Read an SGE response queue context. The caller is responsible for
2569 * ensuring only one context operation occurs at a time.
2570 */
2571int t3_sge_read_rspq(struct adapter *adapter, unsigned int id, u32 data[4])
2572{
2573 if (id >= SGE_QSETS)
2574 return -EINVAL;
2575 return t3_sge_read_context(F_RESPONSEQ, adapter, id, data);
2576}
2577
2578/**
2579 * t3_config_rss - configure Rx packet steering 2489 * t3_config_rss - configure Rx packet steering
2580 * @adapter: the adapter 2490 * @adapter: the adapter
2581 * @rss_config: RSS settings (written to TP_RSS_CONFIG) 2491 * @rss_config: RSS settings (written to TP_RSS_CONFIG)
@@ -2616,42 +2526,6 @@ void t3_config_rss(struct adapter *adapter, unsigned int rss_config,
2616} 2526}
2617 2527
2618/** 2528/**
2619 * t3_read_rss - read the contents of the RSS tables
2620 * @adapter: the adapter
2621 * @lkup: holds the contents of the RSS lookup table
2622 * @map: holds the contents of the RSS map table
2623 *
2624 * Reads the contents of the receive packet steering tables.
2625 */
2626int t3_read_rss(struct adapter *adapter, u8 * lkup, u16 *map)
2627{
2628 int i;
2629 u32 val;
2630
2631 if (lkup)
2632 for (i = 0; i < RSS_TABLE_SIZE; ++i) {
2633 t3_write_reg(adapter, A_TP_RSS_LKP_TABLE,
2634 0xffff0000 | i);
2635 val = t3_read_reg(adapter, A_TP_RSS_LKP_TABLE);
2636 if (!(val & 0x80000000))
2637 return -EAGAIN;
2638 *lkup++ = val;
2639 *lkup++ = (val >> 8);
2640 }
2641
2642 if (map)
2643 for (i = 0; i < RSS_TABLE_SIZE; ++i) {
2644 t3_write_reg(adapter, A_TP_RSS_MAP_TABLE,
2645 0xffff0000 | i);
2646 val = t3_read_reg(adapter, A_TP_RSS_MAP_TABLE);
2647 if (!(val & 0x80000000))
2648 return -EAGAIN;
2649 *map++ = val;
2650 }
2651 return 0;
2652}
2653
2654/**
2655 * t3_tp_set_offload_mode - put TP in NIC/offload mode 2529 * t3_tp_set_offload_mode - put TP in NIC/offload mode
2656 * @adap: the adapter 2530 * @adap: the adapter
2657 * @enable: 1 to select offload mode, 0 for regular NIC 2531 * @enable: 1 to select offload mode, 0 for regular NIC
@@ -2868,7 +2742,8 @@ static void tp_set_timers(struct adapter *adap, unsigned int core_clk)
2868 * 2742 *
2869 * Set the receive coalescing size and PSH bit handling. 2743 * Set the receive coalescing size and PSH bit handling.
2870 */ 2744 */
2871int t3_tp_set_coalescing_size(struct adapter *adap, unsigned int size, int psh) 2745static int t3_tp_set_coalescing_size(struct adapter *adap,
2746 unsigned int size, int psh)
2872{ 2747{
2873 u32 val; 2748 u32 val;
2874 2749
@@ -2898,7 +2773,7 @@ int t3_tp_set_coalescing_size(struct adapter *adap, unsigned int size, int psh)
2898 * Set TP's max receive size. This is the limit that applies when 2773 * Set TP's max receive size. This is the limit that applies when
2899 * receive coalescing is disabled. 2774 * receive coalescing is disabled.
2900 */ 2775 */
2901void t3_tp_set_max_rxsize(struct adapter *adap, unsigned int size) 2776static void t3_tp_set_max_rxsize(struct adapter *adap, unsigned int size)
2902{ 2777{
2903 t3_write_reg(adap, A_TP_PARA_REG7, 2778 t3_write_reg(adap, A_TP_PARA_REG7,
2904 V_PMMAXXFERLEN0(size) | V_PMMAXXFERLEN1(size)); 2779 V_PMMAXXFERLEN0(size) | V_PMMAXXFERLEN1(size));
@@ -3018,48 +2893,6 @@ void t3_load_mtus(struct adapter *adap, unsigned short mtus[NMTUS],
3018} 2893}
3019 2894
3020/** 2895/**
3021 * t3_read_hw_mtus - returns the values in the HW MTU table
3022 * @adap: the adapter
3023 * @mtus: where to store the HW MTU values
3024 *
3025 * Reads the HW MTU table.
3026 */
3027void t3_read_hw_mtus(struct adapter *adap, unsigned short mtus[NMTUS])
3028{
3029 int i;
3030
3031 for (i = 0; i < NMTUS; ++i) {
3032 unsigned int val;
3033
3034 t3_write_reg(adap, A_TP_MTU_TABLE, 0xff000000 | i);
3035 val = t3_read_reg(adap, A_TP_MTU_TABLE);
3036 mtus[i] = val & 0x3fff;
3037 }
3038}
3039
3040/**
3041 * t3_get_cong_cntl_tab - reads the congestion control table
3042 * @adap: the adapter
3043 * @incr: where to store the alpha values
3044 *
3045 * Reads the additive increments programmed into the HW congestion
3046 * control table.
3047 */
3048void t3_get_cong_cntl_tab(struct adapter *adap,
3049 unsigned short incr[NMTUS][NCCTRL_WIN])
3050{
3051 unsigned int mtu, w;
3052
3053 for (mtu = 0; mtu < NMTUS; ++mtu)
3054 for (w = 0; w < NCCTRL_WIN; ++w) {
3055 t3_write_reg(adap, A_TP_CCTRL_TABLE,
3056 0xffff0000 | (mtu << 5) | w);
3057 incr[mtu][w] = t3_read_reg(adap, A_TP_CCTRL_TABLE) &
3058 0x1fff;
3059 }
3060}
3061
3062/**
3063 * t3_tp_get_mib_stats - read TP's MIB counters 2896 * t3_tp_get_mib_stats - read TP's MIB counters
3064 * @adap: the adapter 2897 * @adap: the adapter
3065 * @tps: holds the returned counter values 2898 * @tps: holds the returned counter values
@@ -3223,15 +3056,6 @@ static int tp_init(struct adapter *adap, const struct tp_params *p)
3223 return busy; 3056 return busy;
3224} 3057}
3225 3058
3226int t3_mps_set_active_ports(struct adapter *adap, unsigned int port_mask)
3227{
3228 if (port_mask & ~((1 << adap->params.nports) - 1))
3229 return -EINVAL;
3230 t3_set_reg_field(adap, A_MPS_CFG, F_PORT1ACTIVE | F_PORT0ACTIVE,
3231 port_mask << S_PORT0ACTIVE);
3232 return 0;
3233}
3234
3235/* 3059/*
3236 * Perform the bits of HW initialization that are dependent on the Tx 3060 * Perform the bits of HW initialization that are dependent on the Tx
3237 * channels being used. 3061 * channels being used.
@@ -3687,7 +3511,7 @@ static void mc7_prep(struct adapter *adapter, struct mc7 *mc7,
3687 mc7->width = G_WIDTH(cfg); 3511 mc7->width = G_WIDTH(cfg);
3688} 3512}
3689 3513
3690void mac_prep(struct cmac *mac, struct adapter *adapter, int index) 3514static void mac_prep(struct cmac *mac, struct adapter *adapter, int index)
3691{ 3515{
3692 u16 devid; 3516 u16 devid;
3693 3517
@@ -3707,7 +3531,8 @@ void mac_prep(struct cmac *mac, struct adapter *adapter, int index)
3707 } 3531 }
3708} 3532}
3709 3533
3710void early_hw_init(struct adapter *adapter, const struct adapter_info *ai) 3534static void early_hw_init(struct adapter *adapter,
3535 const struct adapter_info *ai)
3711{ 3536{
3712 u32 val = V_PORTSPEED(is_10G(adapter) ? 3 : 2); 3537 u32 val = V_PORTSPEED(is_10G(adapter) ? 3 : 2);
3713 3538