aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2010-10-12 18:20:34 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-14 13:49:42 -0400
commitf32f837b75233588cd4f8542214a30915ab7847b (patch)
tree564ca1eafbfb777eeb3be8d67fbd74e2b01446c9
parentee87a82a28cddbb9267a294172ecb3d3d3bdaa6c (diff)
ixgbe: remove unused functions
Remove functions that are declared, but not used in the driver. This patch fixes warnings reported by `make namespacecheck` Reported by Stephen Hemminger CC: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ixgbe/ixgbe_82599.c147
-rw-r--r--drivers/net/ixgbe/ixgbe_common.c45
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb.c219
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb.h18
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82598.c59
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82598.h4
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82599.c57
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_82599.h6
8 files changed, 0 insertions, 555 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index e80657c75506..344c5d6ae02a 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -1415,92 +1415,6 @@ s32 ixgbe_atr_set_dst_ipv4_82599(struct ixgbe_atr_input *input, u32 dst_addr)
1415} 1415}
1416 1416
1417/** 1417/**
1418 * ixgbe_atr_set_src_ipv6_82599 - Sets the source IPv6 address
1419 * @input: input stream to modify
1420 * @src_addr_1: the first 4 bytes of the IP address to load
1421 * @src_addr_2: the second 4 bytes of the IP address to load
1422 * @src_addr_3: the third 4 bytes of the IP address to load
1423 * @src_addr_4: the fourth 4 bytes of the IP address to load
1424 **/
1425s32 ixgbe_atr_set_src_ipv6_82599(struct ixgbe_atr_input *input,
1426 u32 src_addr_1, u32 src_addr_2,
1427 u32 src_addr_3, u32 src_addr_4)
1428{
1429 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET] = src_addr_4 & 0xff;
1430 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 1] =
1431 (src_addr_4 >> 8) & 0xff;
1432 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 2] =
1433 (src_addr_4 >> 16) & 0xff;
1434 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 3] = src_addr_4 >> 24;
1435
1436 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 4] = src_addr_3 & 0xff;
1437 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 5] =
1438 (src_addr_3 >> 8) & 0xff;
1439 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 6] =
1440 (src_addr_3 >> 16) & 0xff;
1441 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 7] = src_addr_3 >> 24;
1442
1443 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 8] = src_addr_2 & 0xff;
1444 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 9] =
1445 (src_addr_2 >> 8) & 0xff;
1446 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 10] =
1447 (src_addr_2 >> 16) & 0xff;
1448 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 11] = src_addr_2 >> 24;
1449
1450 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 12] = src_addr_1 & 0xff;
1451 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 13] =
1452 (src_addr_1 >> 8) & 0xff;
1453 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 14] =
1454 (src_addr_1 >> 16) & 0xff;
1455 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 15] = src_addr_1 >> 24;
1456
1457 return 0;
1458}
1459
1460/**
1461 * ixgbe_atr_set_dst_ipv6_82599 - Sets the destination IPv6 address
1462 * @input: input stream to modify
1463 * @dst_addr_1: the first 4 bytes of the IP address to load
1464 * @dst_addr_2: the second 4 bytes of the IP address to load
1465 * @dst_addr_3: the third 4 bytes of the IP address to load
1466 * @dst_addr_4: the fourth 4 bytes of the IP address to load
1467 **/
1468s32 ixgbe_atr_set_dst_ipv6_82599(struct ixgbe_atr_input *input,
1469 u32 dst_addr_1, u32 dst_addr_2,
1470 u32 dst_addr_3, u32 dst_addr_4)
1471{
1472 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET] = dst_addr_4 & 0xff;
1473 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 1] =
1474 (dst_addr_4 >> 8) & 0xff;
1475 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 2] =
1476 (dst_addr_4 >> 16) & 0xff;
1477 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 3] = dst_addr_4 >> 24;
1478
1479 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 4] = dst_addr_3 & 0xff;
1480 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 5] =
1481 (dst_addr_3 >> 8) & 0xff;
1482 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 6] =
1483 (dst_addr_3 >> 16) & 0xff;
1484 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 7] = dst_addr_3 >> 24;
1485
1486 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 8] = dst_addr_2 & 0xff;
1487 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 9] =
1488 (dst_addr_2 >> 8) & 0xff;
1489 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 10] =
1490 (dst_addr_2 >> 16) & 0xff;
1491 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 11] = dst_addr_2 >> 24;
1492
1493 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 12] = dst_addr_1 & 0xff;
1494 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 13] =
1495 (dst_addr_1 >> 8) & 0xff;
1496 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 14] =
1497 (dst_addr_1 >> 16) & 0xff;
1498 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 15] = dst_addr_1 >> 24;
1499
1500 return 0;
1501}
1502
1503/**
1504 * ixgbe_atr_set_src_port_82599 - Sets the source port 1418 * ixgbe_atr_set_src_port_82599 - Sets the source port
1505 * @input: input stream to modify 1419 * @input: input stream to modify
1506 * @src_port: the source port to load 1420 * @src_port: the source port to load
@@ -1540,19 +1454,6 @@ s32 ixgbe_atr_set_flex_byte_82599(struct ixgbe_atr_input *input, u16 flex_byte)
1540} 1454}
1541 1455
1542/** 1456/**
1543 * ixgbe_atr_set_vm_pool_82599 - Sets the Virtual Machine pool
1544 * @input: input stream to modify
1545 * @vm_pool: the Virtual Machine pool to load
1546 **/
1547s32 ixgbe_atr_set_vm_pool_82599(struct ixgbe_atr_input *input,
1548 u8 vm_pool)
1549{
1550 input->byte_stream[IXGBE_ATR_VM_POOL_OFFSET] = vm_pool;
1551
1552 return 0;
1553}
1554
1555/**
1556 * ixgbe_atr_set_l4type_82599 - Sets the layer 4 packet type 1457 * ixgbe_atr_set_l4type_82599 - Sets the layer 4 packet type
1557 * @input: input stream to modify 1458 * @input: input stream to modify
1558 * @l4type: the layer 4 type value to load 1459 * @l4type: the layer 4 type value to load
@@ -1645,41 +1546,6 @@ static s32 ixgbe_atr_get_src_ipv6_82599(struct ixgbe_atr_input *input,
1645} 1546}
1646 1547
1647/** 1548/**
1648 * ixgbe_atr_get_dst_ipv6_82599 - Gets the destination IPv6 address
1649 * @input: input stream to search
1650 * @dst_addr_1: the first 4 bytes of the IP address to load
1651 * @dst_addr_2: the second 4 bytes of the IP address to load
1652 * @dst_addr_3: the third 4 bytes of the IP address to load
1653 * @dst_addr_4: the fourth 4 bytes of the IP address to load
1654 **/
1655s32 ixgbe_atr_get_dst_ipv6_82599(struct ixgbe_atr_input *input,
1656 u32 *dst_addr_1, u32 *dst_addr_2,
1657 u32 *dst_addr_3, u32 *dst_addr_4)
1658{
1659 *dst_addr_1 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 12];
1660 *dst_addr_1 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 13] << 8;
1661 *dst_addr_1 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 14] << 16;
1662 *dst_addr_1 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 15] << 24;
1663
1664 *dst_addr_2 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 8];
1665 *dst_addr_2 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 9] << 8;
1666 *dst_addr_2 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 10] << 16;
1667 *dst_addr_2 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 11] << 24;
1668
1669 *dst_addr_3 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 4];
1670 *dst_addr_3 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 5] << 8;
1671 *dst_addr_3 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 6] << 16;
1672 *dst_addr_3 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 7] << 24;
1673
1674 *dst_addr_4 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET];
1675 *dst_addr_4 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 1] << 8;
1676 *dst_addr_4 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 2] << 16;
1677 *dst_addr_4 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 3] << 24;
1678
1679 return 0;
1680}
1681
1682/**
1683 * ixgbe_atr_get_src_port_82599 - Gets the source port 1549 * ixgbe_atr_get_src_port_82599 - Gets the source port
1684 * @input: input stream to modify 1550 * @input: input stream to modify
1685 * @src_port: the source port to load 1551 * @src_port: the source port to load
@@ -1732,19 +1598,6 @@ static s32 ixgbe_atr_get_flex_byte_82599(struct ixgbe_atr_input *input,
1732} 1598}
1733 1599
1734/** 1600/**
1735 * ixgbe_atr_get_vm_pool_82599 - Gets the Virtual Machine pool
1736 * @input: input stream to modify
1737 * @vm_pool: the Virtual Machine pool to load
1738 **/
1739s32 ixgbe_atr_get_vm_pool_82599(struct ixgbe_atr_input *input,
1740 u8 *vm_pool)
1741{
1742 *vm_pool = input->byte_stream[IXGBE_ATR_VM_POOL_OFFSET];
1743
1744 return 0;
1745}
1746
1747/**
1748 * ixgbe_atr_get_l4type_82599 - Gets the layer 4 packet type 1601 * ixgbe_atr_get_l4type_82599 - Gets the layer 4 packet type
1749 * @input: input stream to modify 1602 * @input: input stream to modify
1750 * @l4type: the layer 4 type value to load 1603 * @l4type: the layer 4 type value to load
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index 9595b1bfb8dd..939e60f43fb9 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -2704,48 +2704,3 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
2704 2704
2705 return 0; 2705 return 0;
2706} 2706}
2707
2708/**
2709 * ixgbe_get_wwn_prefix_generic - Get alternative WWNN/WWPN prefix from
2710 * the EEPROM
2711 * @hw: pointer to hardware structure
2712 * @wwnn_prefix: the alternative WWNN prefix
2713 * @wwpn_prefix: the alternative WWPN prefix
2714 *
2715 * This function will read the EEPROM from the alternative SAN MAC address
2716 * block to check the support for the alternative WWNN/WWPN prefix support.
2717 **/
2718s32 ixgbe_get_wwn_prefix_generic(struct ixgbe_hw *hw, u16 *wwnn_prefix,
2719 u16 *wwpn_prefix)
2720{
2721 u16 offset, caps;
2722 u16 alt_san_mac_blk_offset;
2723
2724 /* clear output first */
2725 *wwnn_prefix = 0xFFFF;
2726 *wwpn_prefix = 0xFFFF;
2727
2728 /* check if alternative SAN MAC is supported */
2729 hw->eeprom.ops.read(hw, IXGBE_ALT_SAN_MAC_ADDR_BLK_PTR,
2730 &alt_san_mac_blk_offset);
2731
2732 if ((alt_san_mac_blk_offset == 0) ||
2733 (alt_san_mac_blk_offset == 0xFFFF))
2734 goto wwn_prefix_out;
2735
2736 /* check capability in alternative san mac address block */
2737 offset = alt_san_mac_blk_offset + IXGBE_ALT_SAN_MAC_ADDR_CAPS_OFFSET;
2738 hw->eeprom.ops.read(hw, offset, &caps);
2739 if (!(caps & IXGBE_ALT_SAN_MAC_ADDR_CAPS_ALTWWN))
2740 goto wwn_prefix_out;
2741
2742 /* get the corresponding prefix for WWNN/WWPN */
2743 offset = alt_san_mac_blk_offset + IXGBE_ALT_SAN_MAC_ADDR_WWNN_OFFSET;
2744 hw->eeprom.ops.read(hw, offset, wwnn_prefix);
2745
2746 offset = alt_san_mac_blk_offset + IXGBE_ALT_SAN_MAC_ADDR_WWPN_OFFSET;
2747 hw->eeprom.ops.read(hw, offset, wwpn_prefix);
2748
2749wwn_prefix_out:
2750 return 0;
2751}
diff --git a/drivers/net/ixgbe/ixgbe_dcb.c b/drivers/net/ixgbe/ixgbe_dcb.c
index 9aea4f04bbd2..8bb9ddb6dffe 100644
--- a/drivers/net/ixgbe/ixgbe_dcb.c
+++ b/drivers/net/ixgbe/ixgbe_dcb.c
@@ -34,98 +34,6 @@
34#include "ixgbe_dcb_82599.h" 34#include "ixgbe_dcb_82599.h"
35 35
36/** 36/**
37 * ixgbe_dcb_config - Struct containing DCB settings.
38 * @dcb_config: Pointer to DCB config structure
39 *
40 * This function checks DCB rules for DCB settings.
41 * The following rules are checked:
42 * 1. The sum of bandwidth percentages of all Bandwidth Groups must total 100%.
43 * 2. The sum of bandwidth percentages of all Traffic Classes within a Bandwidth
44 * Group must total 100.
45 * 3. A Traffic Class should not be set to both Link Strict Priority
46 * and Group Strict Priority.
47 * 4. Link strict Bandwidth Groups can only have link strict traffic classes
48 * with zero bandwidth.
49 */
50s32 ixgbe_dcb_check_config(struct ixgbe_dcb_config *dcb_config)
51{
52 struct tc_bw_alloc *p;
53 s32 ret_val = 0;
54 u8 i, j, bw = 0, bw_id;
55 u8 bw_sum[2][MAX_BW_GROUP];
56 bool link_strict[2][MAX_BW_GROUP];
57
58 memset(bw_sum, 0, sizeof(bw_sum));
59 memset(link_strict, 0, sizeof(link_strict));
60
61 /* First Tx, then Rx */
62 for (i = 0; i < 2; i++) {
63 /* Check each traffic class for rule violation */
64 for (j = 0; j < MAX_TRAFFIC_CLASS; j++) {
65 p = &dcb_config->tc_config[j].path[i];
66
67 bw = p->bwg_percent;
68 bw_id = p->bwg_id;
69
70 if (bw_id >= MAX_BW_GROUP) {
71 ret_val = DCB_ERR_CONFIG;
72 goto err_config;
73 }
74 if (p->prio_type == prio_link) {
75 link_strict[i][bw_id] = true;
76 /* Link strict should have zero bandwidth */
77 if (bw) {
78 ret_val = DCB_ERR_LS_BW_NONZERO;
79 goto err_config;
80 }
81 } else if (!bw) {
82 /*
83 * Traffic classes without link strict
84 * should have non-zero bandwidth.
85 */
86 ret_val = DCB_ERR_TC_BW_ZERO;
87 goto err_config;
88 }
89 bw_sum[i][bw_id] += bw;
90 }
91
92 bw = 0;
93
94 /* Check each bandwidth group for rule violation */
95 for (j = 0; j < MAX_BW_GROUP; j++) {
96 bw += dcb_config->bw_percentage[i][j];
97 /*
98 * Sum of bandwidth percentages of all traffic classes
99 * within a Bandwidth Group must total 100 except for
100 * link strict group (zero bandwidth).
101 */
102 if (link_strict[i][j]) {
103 if (bw_sum[i][j]) {
104 /*
105 * Link strict group should have zero
106 * bandwidth.
107 */
108 ret_val = DCB_ERR_LS_BWG_NONZERO;
109 goto err_config;
110 }
111 } else if (bw_sum[i][j] != BW_PERCENT &&
112 bw_sum[i][j] != 0) {
113 ret_val = DCB_ERR_TC_BW;
114 goto err_config;
115 }
116 }
117
118 if (bw != BW_PERCENT) {
119 ret_val = DCB_ERR_BW_GROUP;
120 goto err_config;
121 }
122 }
123
124err_config:
125 return ret_val;
126}
127
128/**
129 * ixgbe_dcb_calculate_tc_credits - Calculates traffic class credits 37 * ixgbe_dcb_calculate_tc_credits - Calculates traffic class credits
130 * @ixgbe_dcb_config: Struct containing DCB settings. 38 * @ixgbe_dcb_config: Struct containing DCB settings.
131 * @direction: Configuring either Tx or Rx. 39 * @direction: Configuring either Tx or Rx.
@@ -203,133 +111,6 @@ out:
203} 111}
204 112
205/** 113/**
206 * ixgbe_dcb_get_tc_stats - Returns status of each traffic class
207 * @hw: pointer to hardware structure
208 * @stats: pointer to statistics structure
209 * @tc_count: Number of elements in bwg_array.
210 *
211 * This function returns the status data for each of the Traffic Classes in use.
212 */
213s32 ixgbe_dcb_get_tc_stats(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats,
214 u8 tc_count)
215{
216 s32 ret = 0;
217 if (hw->mac.type == ixgbe_mac_82598EB)
218 ret = ixgbe_dcb_get_tc_stats_82598(hw, stats, tc_count);
219 else if (hw->mac.type == ixgbe_mac_82599EB)
220 ret = ixgbe_dcb_get_tc_stats_82599(hw, stats, tc_count);
221 return ret;
222}
223
224/**
225 * ixgbe_dcb_get_pfc_stats - Returns CBFC status of each traffic class
226 * hw - pointer to hardware structure
227 * stats - pointer to statistics structure
228 * tc_count - Number of elements in bwg_array.
229 *
230 * This function returns the CBFC status data for each of the Traffic Classes.
231 */
232s32 ixgbe_dcb_get_pfc_stats(struct ixgbe_hw *hw, struct ixgbe_hw_stats *stats,
233 u8 tc_count)
234{
235 s32 ret = 0;
236 if (hw->mac.type == ixgbe_mac_82598EB)
237 ret = ixgbe_dcb_get_pfc_stats_82598(hw, stats, tc_count);
238 else if (hw->mac.type == ixgbe_mac_82599EB)
239 ret = ixgbe_dcb_get_pfc_stats_82599(hw, stats, tc_count);
240 return ret;
241}
242
243/**
244 * ixgbe_dcb_config_rx_arbiter - Config Rx arbiter
245 * @hw: pointer to hardware structure
246 * @dcb_config: pointer to ixgbe_dcb_config structure
247 *
248 * Configure Rx Data Arbiter and credits for each traffic class.
249 */
250s32 ixgbe_dcb_config_rx_arbiter(struct ixgbe_hw *hw,
251 struct ixgbe_dcb_config *dcb_config)
252{
253 s32 ret = 0;
254 if (hw->mac.type == ixgbe_mac_82598EB)
255 ret = ixgbe_dcb_config_rx_arbiter_82598(hw, dcb_config);
256 else if (hw->mac.type == ixgbe_mac_82599EB)
257 ret = ixgbe_dcb_config_rx_arbiter_82599(hw, dcb_config);
258 return ret;
259}
260
261/**
262 * ixgbe_dcb_config_tx_desc_arbiter - Config Tx Desc arbiter
263 * @hw: pointer to hardware structure
264 * @dcb_config: pointer to ixgbe_dcb_config structure
265 *
266 * Configure Tx Descriptor Arbiter and credits for each traffic class.
267 */
268s32 ixgbe_dcb_config_tx_desc_arbiter(struct ixgbe_hw *hw,
269 struct ixgbe_dcb_config *dcb_config)
270{
271 s32 ret = 0;
272 if (hw->mac.type == ixgbe_mac_82598EB)
273 ret = ixgbe_dcb_config_tx_desc_arbiter_82598(hw, dcb_config);
274 else if (hw->mac.type == ixgbe_mac_82599EB)
275 ret = ixgbe_dcb_config_tx_desc_arbiter_82599(hw, dcb_config);
276 return ret;
277}
278
279/**
280 * ixgbe_dcb_config_tx_data_arbiter - Config Tx data arbiter
281 * @hw: pointer to hardware structure
282 * @dcb_config: pointer to ixgbe_dcb_config structure
283 *
284 * Configure Tx Data Arbiter and credits for each traffic class.
285 */
286s32 ixgbe_dcb_config_tx_data_arbiter(struct ixgbe_hw *hw,
287 struct ixgbe_dcb_config *dcb_config)
288{
289 s32 ret = 0;
290 if (hw->mac.type == ixgbe_mac_82598EB)
291 ret = ixgbe_dcb_config_tx_data_arbiter_82598(hw, dcb_config);
292 else if (hw->mac.type == ixgbe_mac_82599EB)
293 ret = ixgbe_dcb_config_tx_data_arbiter_82599(hw, dcb_config);
294 return ret;
295}
296
297/**
298 * ixgbe_dcb_config_pfc - Config priority flow control
299 * @hw: pointer to hardware structure
300 * @dcb_config: pointer to ixgbe_dcb_config structure
301 *
302 * Configure Priority Flow Control for each traffic class.
303 */
304s32 ixgbe_dcb_config_pfc(struct ixgbe_hw *hw,
305 struct ixgbe_dcb_config *dcb_config)
306{
307 s32 ret = 0;
308 if (hw->mac.type == ixgbe_mac_82598EB)
309 ret = ixgbe_dcb_config_pfc_82598(hw, dcb_config);
310 else if (hw->mac.type == ixgbe_mac_82599EB)
311 ret = ixgbe_dcb_config_pfc_82599(hw, dcb_config);
312 return ret;
313}
314
315/**
316 * ixgbe_dcb_config_tc_stats - Config traffic class statistics
317 * @hw: pointer to hardware structure
318 *
319 * Configure queue statistics registers, all queues belonging to same traffic
320 * class uses a single set of queue statistics counters.
321 */
322s32 ixgbe_dcb_config_tc_stats(struct ixgbe_hw *hw)
323{
324 s32 ret = 0;
325 if (hw->mac.type == ixgbe_mac_82598EB)
326 ret = ixgbe_dcb_config_tc_stats_82598(hw);
327 else if (hw->mac.type == ixgbe_mac_82599EB)
328 ret = ixgbe_dcb_config_tc_stats_82599(hw);
329 return ret;
330}
331
332/**
333 * ixgbe_dcb_hw_config - Config and enable DCB 114 * ixgbe_dcb_hw_config - Config and enable DCB
334 * @hw: pointer to hardware structure 115 * @hw: pointer to hardware structure
335 * @dcb_config: pointer to ixgbe_dcb_config structure 116 * @dcb_config: pointer to ixgbe_dcb_config structure
diff --git a/drivers/net/ixgbe/ixgbe_dcb.h b/drivers/net/ixgbe/ixgbe_dcb.h
index 5caafd4afbc3..eb1059f09da0 100644
--- a/drivers/net/ixgbe/ixgbe_dcb.h
+++ b/drivers/net/ixgbe/ixgbe_dcb.h
@@ -149,27 +149,9 @@ struct ixgbe_dcb_config {
149 149
150/* DCB driver APIs */ 150/* DCB driver APIs */
151 151
152/* DCB rule checking function.*/
153s32 ixgbe_dcb_check_config(struct ixgbe_dcb_config *config);
154
155/* DCB credits calculation */ 152/* DCB credits calculation */
156s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_dcb_config *, u8); 153s32 ixgbe_dcb_calculate_tc_credits(struct ixgbe_dcb_config *, u8);
157 154
158/* DCB PFC functions */
159s32 ixgbe_dcb_config_pfc(struct ixgbe_hw *, struct ixgbe_dcb_config *g);
160s32 ixgbe_dcb_get_pfc_stats(struct ixgbe_hw *, struct ixgbe_hw_stats *, u8);
161
162/* DCB traffic class stats */
163s32 ixgbe_dcb_config_tc_stats(struct ixgbe_hw *);
164s32 ixgbe_dcb_get_tc_stats(struct ixgbe_hw *, struct ixgbe_hw_stats *, u8);
165
166/* DCB config arbiters */
167s32 ixgbe_dcb_config_tx_desc_arbiter(struct ixgbe_hw *,
168 struct ixgbe_dcb_config *);
169s32 ixgbe_dcb_config_tx_data_arbiter(struct ixgbe_hw *,
170 struct ixgbe_dcb_config *);
171s32 ixgbe_dcb_config_rx_arbiter(struct ixgbe_hw *, struct ixgbe_dcb_config *);
172
173/* DCB hw initialization */ 155/* DCB hw initialization */
174s32 ixgbe_dcb_hw_config(struct ixgbe_hw *, struct ixgbe_dcb_config *); 156s32 ixgbe_dcb_hw_config(struct ixgbe_hw *, struct ixgbe_dcb_config *);
175 157
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82598.c b/drivers/net/ixgbe/ixgbe_dcb_82598.c
index f0e9279d4669..6e9c8bb16dde 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_82598.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_82598.c
@@ -32,65 +32,6 @@
32#include "ixgbe_dcb_82598.h" 32#include "ixgbe_dcb_82598.h"
33 33
34/** 34/**
35 * ixgbe_dcb_get_tc_stats_82598 - Return status data for each traffic class
36 * @hw: pointer to hardware structure
37 * @stats: pointer to statistics structure
38 * @tc_count: Number of elements in bwg_array.
39 *
40 * This function returns the status data for each of the Traffic Classes in use.
41 */
42s32 ixgbe_dcb_get_tc_stats_82598(struct ixgbe_hw *hw,
43 struct ixgbe_hw_stats *stats,
44 u8 tc_count)
45{
46 int tc;
47
48 if (tc_count > MAX_TRAFFIC_CLASS)
49 return DCB_ERR_PARAM;
50
51 /* Statistics pertaining to each traffic class */
52 for (tc = 0; tc < tc_count; tc++) {
53 /* Transmitted Packets */
54 stats->qptc[tc] += IXGBE_READ_REG(hw, IXGBE_QPTC(tc));
55 /* Transmitted Bytes */
56 stats->qbtc[tc] += IXGBE_READ_REG(hw, IXGBE_QBTC(tc));
57 /* Received Packets */
58 stats->qprc[tc] += IXGBE_READ_REG(hw, IXGBE_QPRC(tc));
59 /* Received Bytes */
60 stats->qbrc[tc] += IXGBE_READ_REG(hw, IXGBE_QBRC(tc));
61 }
62
63 return 0;
64}
65
66/**
67 * ixgbe_dcb_get_pfc_stats_82598 - Returns CBFC status data
68 * @hw: pointer to hardware structure
69 * @stats: pointer to statistics structure
70 * @tc_count: Number of elements in bwg_array.
71 *
72 * This function returns the CBFC status data for each of the Traffic Classes.
73 */
74s32 ixgbe_dcb_get_pfc_stats_82598(struct ixgbe_hw *hw,
75 struct ixgbe_hw_stats *stats,
76 u8 tc_count)
77{
78 int tc;
79
80 if (tc_count > MAX_TRAFFIC_CLASS)
81 return DCB_ERR_PARAM;
82
83 for (tc = 0; tc < tc_count; tc++) {
84 /* Priority XOFF Transmitted */
85 stats->pxofftxc[tc] += IXGBE_READ_REG(hw, IXGBE_PXOFFTXC(tc));
86 /* Priority XOFF Received */
87 stats->pxoffrxc[tc] += IXGBE_READ_REG(hw, IXGBE_PXOFFRXC(tc));
88 }
89
90 return 0;
91}
92
93/**
94 * ixgbe_dcb_config_packet_buffers_82598 - Configure packet buffers 35 * ixgbe_dcb_config_packet_buffers_82598 - Configure packet buffers
95 * @hw: pointer to hardware structure 36 * @hw: pointer to hardware structure
96 * @dcb_config: pointer to ixgbe_dcb_config structure 37 * @dcb_config: pointer to ixgbe_dcb_config structure
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82598.h b/drivers/net/ixgbe/ixgbe_dcb_82598.h
index cc728fa092e2..def907f6cf20 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_82598.h
+++ b/drivers/net/ixgbe/ixgbe_dcb_82598.h
@@ -72,13 +72,9 @@
72 72
73/* DCB PFC functions */ 73/* DCB PFC functions */
74s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *, struct ixgbe_dcb_config *); 74s32 ixgbe_dcb_config_pfc_82598(struct ixgbe_hw *, struct ixgbe_dcb_config *);
75s32 ixgbe_dcb_get_pfc_stats_82598(struct ixgbe_hw *, struct ixgbe_hw_stats *,
76 u8);
77 75
78/* DCB traffic class stats */ 76/* DCB traffic class stats */
79s32 ixgbe_dcb_config_tc_stats_82598(struct ixgbe_hw *); 77s32 ixgbe_dcb_config_tc_stats_82598(struct ixgbe_hw *);
80s32 ixgbe_dcb_get_tc_stats_82598(struct ixgbe_hw *, struct ixgbe_hw_stats *,
81 u8);
82 78
83/* DCB config arbiters */ 79/* DCB config arbiters */
84s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *, 80s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *,
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.c b/drivers/net/ixgbe/ixgbe_dcb_82599.c
index 25b02fb425ac..13647186a406 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_82599.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_82599.c
@@ -31,63 +31,6 @@
31#include "ixgbe_dcb_82599.h" 31#include "ixgbe_dcb_82599.h"
32 32
33/** 33/**
34 * ixgbe_dcb_get_tc_stats_82599 - Returns status for each traffic class
35 * @hw: pointer to hardware structure
36 * @stats: pointer to statistics structure
37 * @tc_count: Number of elements in bwg_array.
38 *
39 * This function returns the status data for each of the Traffic Classes in use.
40 */
41s32 ixgbe_dcb_get_tc_stats_82599(struct ixgbe_hw *hw,
42 struct ixgbe_hw_stats *stats,
43 u8 tc_count)
44{
45 int tc;
46
47 if (tc_count > MAX_TRAFFIC_CLASS)
48 return DCB_ERR_PARAM;
49 /* Statistics pertaining to each traffic class */
50 for (tc = 0; tc < tc_count; tc++) {
51 /* Transmitted Packets */
52 stats->qptc[tc] += IXGBE_READ_REG(hw, IXGBE_QPTC(tc));
53 /* Transmitted Bytes */
54 stats->qbtc[tc] += IXGBE_READ_REG(hw, IXGBE_QBTC(tc));
55 /* Received Packets */
56 stats->qprc[tc] += IXGBE_READ_REG(hw, IXGBE_QPRC(tc));
57 /* Received Bytes */
58 stats->qbrc[tc] += IXGBE_READ_REG(hw, IXGBE_QBRC(tc));
59 }
60
61 return 0;
62}
63
64/**
65 * ixgbe_dcb_get_pfc_stats_82599 - Return CBFC status data
66 * @hw: pointer to hardware structure
67 * @stats: pointer to statistics structure
68 * @tc_count: Number of elements in bwg_array.
69 *
70 * This function returns the CBFC status data for each of the Traffic Classes.
71 */
72s32 ixgbe_dcb_get_pfc_stats_82599(struct ixgbe_hw *hw,
73 struct ixgbe_hw_stats *stats,
74 u8 tc_count)
75{
76 int tc;
77
78 if (tc_count > MAX_TRAFFIC_CLASS)
79 return DCB_ERR_PARAM;
80 for (tc = 0; tc < tc_count; tc++) {
81 /* Priority XOFF Transmitted */
82 stats->pxofftxc[tc] += IXGBE_READ_REG(hw, IXGBE_PXOFFTXC(tc));
83 /* Priority XOFF Received */
84 stats->pxoffrxc[tc] += IXGBE_READ_REG(hw, IXGBE_PXOFFRXCNT(tc));
85 }
86
87 return 0;
88}
89
90/**
91 * ixgbe_dcb_config_packet_buffers_82599 - Configure DCB packet buffers 34 * ixgbe_dcb_config_packet_buffers_82599 - Configure DCB packet buffers
92 * @hw: pointer to hardware structure 35 * @hw: pointer to hardware structure
93 * @dcb_config: pointer to ixgbe_dcb_config structure 36 * @dcb_config: pointer to ixgbe_dcb_config structure
diff --git a/drivers/net/ixgbe/ixgbe_dcb_82599.h b/drivers/net/ixgbe/ixgbe_dcb_82599.h
index 0f3f791e1e1d..88819b2e562e 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_82599.h
+++ b/drivers/net/ixgbe/ixgbe_dcb_82599.h
@@ -101,15 +101,9 @@
101/* DCB PFC functions */ 101/* DCB PFC functions */
102s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw, 102s32 ixgbe_dcb_config_pfc_82599(struct ixgbe_hw *hw,
103 struct ixgbe_dcb_config *dcb_config); 103 struct ixgbe_dcb_config *dcb_config);
104s32 ixgbe_dcb_get_pfc_stats_82599(struct ixgbe_hw *hw,
105 struct ixgbe_hw_stats *stats,
106 u8 tc_count);
107 104
108/* DCB traffic class stats */ 105/* DCB traffic class stats */
109s32 ixgbe_dcb_config_tc_stats_82599(struct ixgbe_hw *hw); 106s32 ixgbe_dcb_config_tc_stats_82599(struct ixgbe_hw *hw);
110s32 ixgbe_dcb_get_tc_stats_82599(struct ixgbe_hw *hw,
111 struct ixgbe_hw_stats *stats,
112 u8 tc_count);
113 107
114/* DCB config arbiters */ 108/* DCB config arbiters */
115s32 ixgbe_dcb_config_tx_desc_arbiter_82599(struct ixgbe_hw *hw, 109s32 ixgbe_dcb_config_tx_desc_arbiter_82599(struct ixgbe_hw *hw,