|
@@ -34,6 +34,8 @@
|
|
|
#include "sge_defs.h"
|
|
|
#include "firmware_exports.h"
|
|
|
|
|
|
+static void t3_port_intr_clear(struct adapter *adapter, int idx);
|
|
|
+
|
|
|
/**
|
|
|
* t3_wait_op_done_val - wait until an operation is completed
|
|
|
* @adapter: the adapter performing the operation
|
|
@@ -840,8 +842,8 @@ static int flash_wait_op(struct adapter *adapter, int attempts, int delay)
|
|
|
* (i.e., big-endian), otherwise as 32-bit words in the platform's
|
|
|
* natural endianess.
|
|
|
*/
|
|
|
-int t3_read_flash(struct adapter *adapter, unsigned int addr,
|
|
|
- unsigned int nwords, u32 *data, int byte_oriented)
|
|
|
+static int t3_read_flash(struct adapter *adapter, unsigned int addr,
|
|
|
+ unsigned int nwords, u32 *data, int byte_oriented)
|
|
|
{
|
|
|
int ret;
|
|
|
|
|
@@ -2111,7 +2113,7 @@ void t3_port_intr_disable(struct adapter *adapter, int idx)
|
|
|
* Clear port-specific (i.e., MAC and PHY) interrupts for the given
|
|
|
* adapter port.
|
|
|
*/
|
|
|
-void t3_port_intr_clear(struct adapter *adapter, int idx)
|
|
|
+static void t3_port_intr_clear(struct adapter *adapter, int idx)
|
|
|
{
|
|
|
struct cphy *phy = &adap2pinfo(adapter, idx)->phy;
|
|
|
|
|
@@ -2483,98 +2485,6 @@ int t3_sge_cqcntxt_op(struct adapter *adapter, unsigned int id, unsigned int op,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * t3_sge_read_context - read an SGE context
|
|
|
- * @type: the context type
|
|
|
- * @adapter: the adapter
|
|
|
- * @id: the context id
|
|
|
- * @data: holds the retrieved context
|
|
|
- *
|
|
|
- * Read an SGE egress context. The caller is responsible for ensuring
|
|
|
- * only one context operation occurs at a time.
|
|
|
- */
|
|
|
-static int t3_sge_read_context(unsigned int type, struct adapter *adapter,
|
|
|
- unsigned int id, u32 data[4])
|
|
|
-{
|
|
|
- if (t3_read_reg(adapter, A_SG_CONTEXT_CMD) & F_CONTEXT_CMD_BUSY)
|
|
|
- return -EBUSY;
|
|
|
-
|
|
|
- t3_write_reg(adapter, A_SG_CONTEXT_CMD,
|
|
|
- V_CONTEXT_CMD_OPCODE(0) | type | V_CONTEXT(id));
|
|
|
- if (t3_wait_op_done(adapter, A_SG_CONTEXT_CMD, F_CONTEXT_CMD_BUSY, 0,
|
|
|
- SG_CONTEXT_CMD_ATTEMPTS, 1))
|
|
|
- return -EIO;
|
|
|
- data[0] = t3_read_reg(adapter, A_SG_CONTEXT_DATA0);
|
|
|
- data[1] = t3_read_reg(adapter, A_SG_CONTEXT_DATA1);
|
|
|
- data[2] = t3_read_reg(adapter, A_SG_CONTEXT_DATA2);
|
|
|
- data[3] = t3_read_reg(adapter, A_SG_CONTEXT_DATA3);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * t3_sge_read_ecntxt - read an SGE egress context
|
|
|
- * @adapter: the adapter
|
|
|
- * @id: the context id
|
|
|
- * @data: holds the retrieved context
|
|
|
- *
|
|
|
- * Read an SGE egress context. The caller is responsible for ensuring
|
|
|
- * only one context operation occurs at a time.
|
|
|
- */
|
|
|
-int t3_sge_read_ecntxt(struct adapter *adapter, unsigned int id, u32 data[4])
|
|
|
-{
|
|
|
- if (id >= 65536)
|
|
|
- return -EINVAL;
|
|
|
- return t3_sge_read_context(F_EGRESS, adapter, id, data);
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * t3_sge_read_cq - read an SGE CQ context
|
|
|
- * @adapter: the adapter
|
|
|
- * @id: the context id
|
|
|
- * @data: holds the retrieved context
|
|
|
- *
|
|
|
- * Read an SGE CQ context. The caller is responsible for ensuring
|
|
|
- * only one context operation occurs at a time.
|
|
|
- */
|
|
|
-int t3_sge_read_cq(struct adapter *adapter, unsigned int id, u32 data[4])
|
|
|
-{
|
|
|
- if (id >= 65536)
|
|
|
- return -EINVAL;
|
|
|
- return t3_sge_read_context(F_CQ, adapter, id, data);
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * t3_sge_read_fl - read an SGE free-list context
|
|
|
- * @adapter: the adapter
|
|
|
- * @id: the context id
|
|
|
- * @data: holds the retrieved context
|
|
|
- *
|
|
|
- * Read an SGE free-list context. The caller is responsible for ensuring
|
|
|
- * only one context operation occurs at a time.
|
|
|
- */
|
|
|
-int t3_sge_read_fl(struct adapter *adapter, unsigned int id, u32 data[4])
|
|
|
-{
|
|
|
- if (id >= SGE_QSETS * 2)
|
|
|
- return -EINVAL;
|
|
|
- return t3_sge_read_context(F_FREELIST, adapter, id, data);
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * t3_sge_read_rspq - read an SGE response queue context
|
|
|
- * @adapter: the adapter
|
|
|
- * @id: the context id
|
|
|
- * @data: holds the retrieved context
|
|
|
- *
|
|
|
- * Read an SGE response queue context. The caller is responsible for
|
|
|
- * ensuring only one context operation occurs at a time.
|
|
|
- */
|
|
|
-int t3_sge_read_rspq(struct adapter *adapter, unsigned int id, u32 data[4])
|
|
|
-{
|
|
|
- if (id >= SGE_QSETS)
|
|
|
- return -EINVAL;
|
|
|
- return t3_sge_read_context(F_RESPONSEQ, adapter, id, data);
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* t3_config_rss - configure Rx packet steering
|
|
|
* @adapter: the adapter
|
|
@@ -2615,42 +2525,6 @@ void t3_config_rss(struct adapter *adapter, unsigned int rss_config,
|
|
|
t3_write_reg(adapter, A_TP_RSS_CONFIG, rss_config);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * t3_read_rss - read the contents of the RSS tables
|
|
|
- * @adapter: the adapter
|
|
|
- * @lkup: holds the contents of the RSS lookup table
|
|
|
- * @map: holds the contents of the RSS map table
|
|
|
- *
|
|
|
- * Reads the contents of the receive packet steering tables.
|
|
|
- */
|
|
|
-int t3_read_rss(struct adapter *adapter, u8 * lkup, u16 *map)
|
|
|
-{
|
|
|
- int i;
|
|
|
- u32 val;
|
|
|
-
|
|
|
- if (lkup)
|
|
|
- for (i = 0; i < RSS_TABLE_SIZE; ++i) {
|
|
|
- t3_write_reg(adapter, A_TP_RSS_LKP_TABLE,
|
|
|
- 0xffff0000 | i);
|
|
|
- val = t3_read_reg(adapter, A_TP_RSS_LKP_TABLE);
|
|
|
- if (!(val & 0x80000000))
|
|
|
- return -EAGAIN;
|
|
|
- *lkup++ = val;
|
|
|
- *lkup++ = (val >> 8);
|
|
|
- }
|
|
|
-
|
|
|
- if (map)
|
|
|
- for (i = 0; i < RSS_TABLE_SIZE; ++i) {
|
|
|
- t3_write_reg(adapter, A_TP_RSS_MAP_TABLE,
|
|
|
- 0xffff0000 | i);
|
|
|
- val = t3_read_reg(adapter, A_TP_RSS_MAP_TABLE);
|
|
|
- if (!(val & 0x80000000))
|
|
|
- return -EAGAIN;
|
|
|
- *map++ = val;
|
|
|
- }
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* t3_tp_set_offload_mode - put TP in NIC/offload mode
|
|
|
* @adap: the adapter
|
|
@@ -2868,7 +2742,8 @@ static void tp_set_timers(struct adapter *adap, unsigned int core_clk)
|
|
|
*
|
|
|
* Set the receive coalescing size and PSH bit handling.
|
|
|
*/
|
|
|
-int t3_tp_set_coalescing_size(struct adapter *adap, unsigned int size, int psh)
|
|
|
+static int t3_tp_set_coalescing_size(struct adapter *adap,
|
|
|
+ unsigned int size, int psh)
|
|
|
{
|
|
|
u32 val;
|
|
|
|
|
@@ -2898,7 +2773,7 @@ int t3_tp_set_coalescing_size(struct adapter *adap, unsigned int size, int psh)
|
|
|
* Set TP's max receive size. This is the limit that applies when
|
|
|
* receive coalescing is disabled.
|
|
|
*/
|
|
|
-void t3_tp_set_max_rxsize(struct adapter *adap, unsigned int size)
|
|
|
+static void t3_tp_set_max_rxsize(struct adapter *adap, unsigned int size)
|
|
|
{
|
|
|
t3_write_reg(adap, A_TP_PARA_REG7,
|
|
|
V_PMMAXXFERLEN0(size) | V_PMMAXXFERLEN1(size));
|
|
@@ -3017,48 +2892,6 @@ void t3_load_mtus(struct adapter *adap, unsigned short mtus[NMTUS],
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * t3_read_hw_mtus - returns the values in the HW MTU table
|
|
|
- * @adap: the adapter
|
|
|
- * @mtus: where to store the HW MTU values
|
|
|
- *
|
|
|
- * Reads the HW MTU table.
|
|
|
- */
|
|
|
-void t3_read_hw_mtus(struct adapter *adap, unsigned short mtus[NMTUS])
|
|
|
-{
|
|
|
- int i;
|
|
|
-
|
|
|
- for (i = 0; i < NMTUS; ++i) {
|
|
|
- unsigned int val;
|
|
|
-
|
|
|
- t3_write_reg(adap, A_TP_MTU_TABLE, 0xff000000 | i);
|
|
|
- val = t3_read_reg(adap, A_TP_MTU_TABLE);
|
|
|
- mtus[i] = val & 0x3fff;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * t3_get_cong_cntl_tab - reads the congestion control table
|
|
|
- * @adap: the adapter
|
|
|
- * @incr: where to store the alpha values
|
|
|
- *
|
|
|
- * Reads the additive increments programmed into the HW congestion
|
|
|
- * control table.
|
|
|
- */
|
|
|
-void t3_get_cong_cntl_tab(struct adapter *adap,
|
|
|
- unsigned short incr[NMTUS][NCCTRL_WIN])
|
|
|
-{
|
|
|
- unsigned int mtu, w;
|
|
|
-
|
|
|
- for (mtu = 0; mtu < NMTUS; ++mtu)
|
|
|
- for (w = 0; w < NCCTRL_WIN; ++w) {
|
|
|
- t3_write_reg(adap, A_TP_CCTRL_TABLE,
|
|
|
- 0xffff0000 | (mtu << 5) | w);
|
|
|
- incr[mtu][w] = t3_read_reg(adap, A_TP_CCTRL_TABLE) &
|
|
|
- 0x1fff;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* t3_tp_get_mib_stats - read TP's MIB counters
|
|
|
* @adap: the adapter
|
|
@@ -3223,15 +3056,6 @@ static int tp_init(struct adapter *adap, const struct tp_params *p)
|
|
|
return busy;
|
|
|
}
|
|
|
|
|
|
-int t3_mps_set_active_ports(struct adapter *adap, unsigned int port_mask)
|
|
|
-{
|
|
|
- if (port_mask & ~((1 << adap->params.nports) - 1))
|
|
|
- return -EINVAL;
|
|
|
- t3_set_reg_field(adap, A_MPS_CFG, F_PORT1ACTIVE | F_PORT0ACTIVE,
|
|
|
- port_mask << S_PORT0ACTIVE);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* Perform the bits of HW initialization that are dependent on the Tx
|
|
|
* channels being used.
|
|
@@ -3687,7 +3511,7 @@ static void mc7_prep(struct adapter *adapter, struct mc7 *mc7,
|
|
|
mc7->width = G_WIDTH(cfg);
|
|
|
}
|
|
|
|
|
|
-void mac_prep(struct cmac *mac, struct adapter *adapter, int index)
|
|
|
+static void mac_prep(struct cmac *mac, struct adapter *adapter, int index)
|
|
|
{
|
|
|
u16 devid;
|
|
|
|
|
@@ -3707,7 +3531,8 @@ void mac_prep(struct cmac *mac, struct adapter *adapter, int index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void early_hw_init(struct adapter *adapter, const struct adapter_info *ai)
|
|
|
+static void early_hw_init(struct adapter *adapter,
|
|
|
+ const struct adapter_info *ai)
|
|
|
{
|
|
|
u32 val = V_PORTSPEED(is_10G(adapter) ? 3 : 2);
|
|
|
|