annotate usr/src/uts/common/io/ixgbe/ixgbe_82599.c @ 10998:fa3b21f3b03c

6873301 ixgbe shared code update (version 3.1.9)
author chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
date Sun, 08 Nov 2009 15:49:56 +0800
parents f6df05de8700
children f4f295b632a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2 * CDDL HEADER START
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
3 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
4 * Copyright(c) 2007-2009 Intel Corporation. All rights reserved.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
5 * The contents of this file are subject to the terms of the
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
6 * Common Development and Distribution License (the "License").
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
7 * You may not use this file except in compliance with the License.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
8 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
9 * You can obtain a copy of the license at:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
10 * http://www.opensolaris.org/os/licensing.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
11 * See the License for the specific language governing permissions
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
12 * and limitations under the License.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
13 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
14 * When using or redistributing this file, you may do so under the
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
15 * License only. No other modification of this header is permitted.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
16 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
17 * If applicable, add the following below this CDDL HEADER, with the
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
18 * fields enclosed by brackets "[]" replaced with your own identifying
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
19 * information: Portions Copyright [yyyy] [name of copyright owner]
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
20 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
21 * CDDL HEADER END
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
22 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
23
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
24 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
25 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
26 * Use is subject to license terms.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
27 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
28
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
29 /* IntelVersion: 1.197 scm_100309_002210 */
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
30
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
31 #include "ixgbe_type.h"
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
32 #include "ixgbe_api.h"
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
33 #include "ixgbe_common.h"
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
34 #include "ixgbe_phy.h"
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
35
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
36 s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
37 s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
38 ixgbe_link_speed *speed, bool *autoneg);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
39 enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw);
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
40 s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
41 ixgbe_link_speed speed, bool autoneg, bool autoneg_wait_to_complete);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
42 s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw,
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
43 ixgbe_link_speed speed, bool autoneg, bool autoneg_wait_to_complete);
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
44 s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw,
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
45 bool autoneg_wait_to_complete);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
46 s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
47 ixgbe_link_speed speed, bool autoneg,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
48 bool autoneg_wait_to_complete);
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
49 static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw,
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
50 ixgbe_link_speed speed, bool autoneg,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
51 bool autoneg_wait_to_complete);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
52 s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
53 void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
54 s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
55 s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
56 s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
57 s32 ixgbe_start_hw_rev_1_82599(struct ixgbe_hw *hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
58 s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
59 s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
60 u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
61 s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
62 s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps);
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
63 static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
64
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
65 void
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
66 ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
67 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
68 struct ixgbe_mac_info *mac = &hw->mac;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
69
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
70 DEBUGFUNC("ixgbe_init_mac_link_ops_82599");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
71
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
72 if (hw->phy.multispeed_fiber) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
73 /* Set up dual speed SFP+ support */
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
74 mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
75 } else {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
76 if ((ixgbe_get_media_type(hw) == ixgbe_media_type_backplane) &&
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
77 (hw->phy.smart_speed == ixgbe_smart_speed_auto ||
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
78 hw->phy.smart_speed == ixgbe_smart_speed_on))
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
79 mac->ops.setup_link = &ixgbe_setup_mac_link_smartspeed;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
80 else
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
81 mac->ops.setup_link = &ixgbe_setup_mac_link_82599;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
82 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
83 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
84
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
85 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
86 * ixgbe_init_phy_ops_82599 - PHY/SFP specific init
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
87 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
88 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
89 * Initialize any function pointers that were not able to be
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
90 * set during init_shared_code because the PHY/SFP type was
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
91 * not known. Perform the SFP init if necessary.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
92 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
93 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
94 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
95 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
96 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
97 struct ixgbe_mac_info *mac = &hw->mac;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
98 struct ixgbe_phy_info *phy = &hw->phy;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
99 s32 ret_val = IXGBE_SUCCESS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
100
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
101 DEBUGFUNC("ixgbe_init_phy_ops_82599");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
102
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
103 /* Identify the PHY or SFP module */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
104 ret_val = phy->ops.identify(hw);
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
105 if (ret_val == IXGBE_ERR_SFP_NOT_SUPPORTED)
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
106 goto init_phy_ops_out;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
107
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
108 /* Setup function pointers based on detected SFP module and speeds */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
109 ixgbe_init_mac_link_ops_82599(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
110 if (hw->phy.sfp_type != ixgbe_sfp_type_unknown)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
111 hw->phy.ops.reset = NULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
112
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
113 /* If copper media, overwrite with copper function pointers */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
114 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
115 mac->ops.setup_link = &ixgbe_setup_copper_link_82599;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
116 mac->ops.get_link_capabilities =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
117 &ixgbe_get_copper_link_capabilities_generic;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
118 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
119
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
120 /* Set necessary function pointers based on phy type */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
121 switch (hw->phy.type) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
122 case ixgbe_phy_tn:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
123 phy->ops.check_link = &ixgbe_check_phy_link_tnx;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
124 phy->ops.get_firmware_version =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
125 &ixgbe_get_phy_firmware_version_tnx;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
126 break;
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
127 case ixgbe_phy_aq:
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
128 phy->ops.get_firmware_version =
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
129 &ixgbe_get_phy_firmware_version_generic;
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
130 break;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
131 default:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
132 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
133 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
134
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
135 init_phy_ops_out:
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
136 return (ret_val);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
137 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
138
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
139 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
140 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
141 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
142 s32 ret_val = IXGBE_SUCCESS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
143 u16 list_offset, data_offset, data_value;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
144
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
145 DEBUGFUNC("ixgbe_setup_sfp_modules_82599");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
146
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
147 if (hw->phy.sfp_type != ixgbe_sfp_type_unknown) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
148 ixgbe_init_mac_link_ops_82599(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
149
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
150 hw->phy.ops.reset = NULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
151
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
152 ret_val = ixgbe_get_sfp_init_sequence_offsets(hw, &list_offset,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
153 &data_offset);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
154
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
155 if (ret_val != IXGBE_SUCCESS)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
156 goto setup_sfp_out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
157
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
158 /* PHY config will finish before releasing the semaphore */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
159 ret_val = ixgbe_acquire_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
160 if (ret_val != IXGBE_SUCCESS) {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
161 ret_val = IXGBE_ERR_SWFW_SYNC;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
162 goto setup_sfp_out;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
163 }
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
164
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
165 hw->eeprom.ops.read(hw, ++data_offset, &data_value);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
166 while (data_value != 0xffff) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
167 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, data_value);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
168 IXGBE_WRITE_FLUSH(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
169 hw->eeprom.ops.read(hw, ++data_offset, &data_value);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
170 }
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
171 /* Now restart DSP by setting Restart_AN */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
172 IXGBE_WRITE_REG(hw, IXGBE_AUTOC,
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
173 (IXGBE_READ_REG(hw, IXGBE_AUTOC) | IXGBE_AUTOC_AN_RESTART));
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
174
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
175 /* Release the semaphore */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
176 ixgbe_release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
177 /* Delay obtaining semaphore again to allow FW access */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
178 msec_delay(hw->eeprom.semaphore_delay);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
179 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
180
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
181 setup_sfp_out:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
182 return (ret_val);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
183 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
184
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
185 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
186 * ixgbe_init_ops_82599 - Inits func ptrs and MAC type
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
187 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
188 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
189 * Initialize the function pointers and assign the MAC type for 82599.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
190 * Does not touch the hardware.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
191 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
192
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
193 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
194 ixgbe_init_ops_82599(struct ixgbe_hw *hw)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
195 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
196 struct ixgbe_mac_info *mac = &hw->mac;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
197 struct ixgbe_phy_info *phy = &hw->phy;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
198 s32 ret_val;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
199
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
200 DEBUGFUNC("ixgbe_init_ops_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
201
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
202 ret_val = ixgbe_init_phy_ops_generic(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
203 ret_val = ixgbe_init_ops_generic(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
204
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
205 /* PHY */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
206 phy->ops.identify = &ixgbe_identify_phy_82599;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
207 phy->ops.init = &ixgbe_init_phy_ops_82599;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
208
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
209 /* MAC */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
210 mac->ops.reset_hw = &ixgbe_reset_hw_82599;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
211 mac->ops.get_media_type = &ixgbe_get_media_type_82599;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
212 mac->ops.get_supported_physical_layer =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
213 &ixgbe_get_supported_physical_layer_82599;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
214 mac->ops.enable_rx_dma = &ixgbe_enable_rx_dma_82599;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
215 mac->ops.read_analog_reg8 = &ixgbe_read_analog_reg8_82599;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
216 mac->ops.write_analog_reg8 = &ixgbe_write_analog_reg8_82599;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
217 mac->ops.start_hw = &ixgbe_start_hw_rev_1_82599;
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
218 mac->ops.get_san_mac_addr = &ixgbe_get_san_mac_addr_generic;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
219 mac->ops.set_san_mac_addr = &ixgbe_set_san_mac_addr_generic;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
220 mac->ops.get_device_caps = &ixgbe_get_device_caps_82599;
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
221 mac->ops.get_wwn_prefix = &ixgbe_get_wwn_prefix_generic;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
222
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
223 /* RAR, Multicast, VLAN */
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
224 mac->ops.set_vmdq = &ixgbe_set_vmdq_generic;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
225 mac->ops.clear_vmdq = &ixgbe_clear_vmdq_generic;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
226 mac->ops.insert_mac_addr = &ixgbe_insert_mac_addr_generic;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
227 mac->rar_highwater = 1;
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
228 mac->ops.set_vfta = &ixgbe_set_vfta_generic;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
229 mac->ops.clear_vfta = &ixgbe_clear_vfta_generic;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
230 mac->ops.init_uta_tables = &ixgbe_init_uta_tables_generic;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
231 mac->ops.setup_sfp = &ixgbe_setup_sfp_modules_82599;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
232
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
233 /* Link */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
234 mac->ops.get_link_capabilities = &ixgbe_get_link_capabilities_82599;
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
235 mac->ops.check_link = &ixgbe_check_mac_link_generic;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
236 ixgbe_init_mac_link_ops_82599(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
237
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
238 mac->mcft_size = 128;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
239 mac->vft_size = 128;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
240 mac->num_rar_entries = 128;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
241 mac->max_tx_queues = 128;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
242 mac->max_rx_queues = 128;
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
243 mac->max_msix_vectors = ixgbe_get_pcie_msix_count_generic(hw);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
244
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
245 return (ret_val);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
246 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
247
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
248 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
249 * ixgbe_get_link_capabilities_82599 - Determines link capabilities
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
250 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
251 * @speed: pointer to link speed
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
252 * @negotiation: true when autoneg or autotry is enabled
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
253 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
254 * Determines the link capabilities by reading the AUTOC register.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
255 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
256 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
257 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
258 ixgbe_link_speed *speed, bool *negotiation)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
259 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
260 s32 status = IXGBE_SUCCESS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
261 u32 autoc = 0;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
262
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
263 DEBUGFUNC("ixgbe_get_link_capabilities_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
264
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
265 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
266 * Determine link capabilities based on the stored value of AUTOC,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
267 * which represents EEPROM defaults. If AUTOC value has not
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
268 * been stored, use the current register values.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
269 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
270 if (hw->mac.orig_link_settings_stored)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
271 autoc = hw->mac.orig_autoc;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
272 else
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
273 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
274
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
275 switch (autoc & IXGBE_AUTOC_LMS_MASK) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
276 case IXGBE_AUTOC_LMS_1G_LINK_NO_AN:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
277 *speed = IXGBE_LINK_SPEED_1GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
278 *negotiation = false;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
279 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
280
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
281 case IXGBE_AUTOC_LMS_10G_LINK_NO_AN:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
282 *speed = IXGBE_LINK_SPEED_10GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
283 *negotiation = false;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
284 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
285
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
286 case IXGBE_AUTOC_LMS_1G_AN:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
287 *speed = IXGBE_LINK_SPEED_1GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
288 *negotiation = true;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
289 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
290
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
291 case IXGBE_AUTOC_LMS_10G_SERIAL:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
292 *speed = IXGBE_LINK_SPEED_10GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
293 *negotiation = false;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
294 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
295
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
296 case IXGBE_AUTOC_LMS_KX4_KX_KR:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
297 case IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
298 *speed = IXGBE_LINK_SPEED_UNKNOWN;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
299 if (autoc & IXGBE_AUTOC_KR_SUPP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
300 *speed |= IXGBE_LINK_SPEED_10GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
301 if (autoc & IXGBE_AUTOC_KX4_SUPP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
302 *speed |= IXGBE_LINK_SPEED_10GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
303 if (autoc & IXGBE_AUTOC_KX_SUPP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
304 *speed |= IXGBE_LINK_SPEED_1GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
305 *negotiation = true;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
306 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
307
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
308 case IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
309 *speed = IXGBE_LINK_SPEED_100_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
310 if (autoc & IXGBE_AUTOC_KR_SUPP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
311 *speed |= IXGBE_LINK_SPEED_10GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
312 if (autoc & IXGBE_AUTOC_KX4_SUPP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
313 *speed |= IXGBE_LINK_SPEED_10GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
314 if (autoc & IXGBE_AUTOC_KX_SUPP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
315 *speed |= IXGBE_LINK_SPEED_1GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
316 *negotiation = true;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
317 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
318
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
319 case IXGBE_AUTOC_LMS_SGMII_1G_100M:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
320 *speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_100_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
321 *negotiation = false;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
322 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
323
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
324 default:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
325 status = IXGBE_ERR_LINK_SETUP;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
326 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
327 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
328
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
329 if (hw->phy.multispeed_fiber) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
330 *speed |= IXGBE_LINK_SPEED_10GB_FULL |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
331 IXGBE_LINK_SPEED_1GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
332 *negotiation = true;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
333 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
334
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
335 out:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
336 return (status);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
337 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
338
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
339 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
340 * ixgbe_get_media_type_82599 - Get media type
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
341 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
342 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
343 * Returns the media type (fiber, copper, backplane)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
344 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
345 enum ixgbe_media_type
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
346 ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
347 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
348 enum ixgbe_media_type media_type;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
349
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
350 DEBUGFUNC("ixgbe_get_media_type_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
351
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
352 /* Detect if there is a copper PHY attached. */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
353 if (hw->phy.type == ixgbe_phy_cu_unknown ||
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
354 hw->phy.type == ixgbe_phy_tn ||
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
355 hw->phy.type == ixgbe_phy_aq) {
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
356 media_type = ixgbe_media_type_copper;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
357 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
358 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
359
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
360 switch (hw->device_id) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
361 case IXGBE_DEV_ID_82599_KX4:
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
362 case IXGBE_DEV_ID_82599_KX4_MEZZ:
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
363 case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
364 case IXGBE_DEV_ID_82599_XAUI_LOM:
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
365 /* Default device ID is mezzanine card KX/KX4 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
366 media_type = ixgbe_media_type_backplane;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
367 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
368 case IXGBE_DEV_ID_82599_SFP:
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
369 case IXGBE_DEV_ID_82599_SFP_EM:
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
370 media_type = ixgbe_media_type_fiber;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
371 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
372 case IXGBE_DEV_ID_82599_CX4:
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
373 media_type = ixgbe_media_type_cx4;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
374 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
375 default:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
376 media_type = ixgbe_media_type_unknown;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
377 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
378 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
379 out:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
380 return (media_type);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
381 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
382
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
383 /*
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
384 * ixgbe_start_mac_link_82599 - Setup MAC link settings
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
385 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
386 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
387 * Configures link settings based on values in the ixgbe_hw struct.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
388 * Restarts the link. Performs autonegotiation if needed.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
389 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
390 s32
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
391 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, bool autoneg_wait_to_complete)
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
392 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
393 u32 autoc_reg;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
394 u32 links_reg;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
395 u32 i;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
396 s32 status = IXGBE_SUCCESS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
397
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
398 DEBUGFUNC("ixgbe_start_mac_link_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
399
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
400 /* Restart link */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
401 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
402 autoc_reg |= IXGBE_AUTOC_AN_RESTART;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
403 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
404
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
405 /* Only poll for autoneg to complete if specified to do so */
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
406 if (autoneg_wait_to_complete) {
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
407 if ((autoc_reg & IXGBE_AUTOC_LMS_MASK) ==
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
408 IXGBE_AUTOC_LMS_KX4_KX_KR ||
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
409 (autoc_reg & IXGBE_AUTOC_LMS_MASK) ==
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
410 IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN ||
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
411 (autoc_reg & IXGBE_AUTOC_LMS_MASK) ==
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
412 IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
413 links_reg = 0; /* Just in case Autoneg time = 0 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
414 for (i = 0; i < IXGBE_AUTO_NEG_TIME; i++) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
415 links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
416 if (links_reg & IXGBE_LINKS_KX_AN_COMP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
417 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
418 msec_delay(100);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
419 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
420 if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
421 status = IXGBE_ERR_AUTONEG_NOT_COMPLETE;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
422 DEBUGOUT("Autoneg did not complete.\n");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
423 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
424 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
425 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
426
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
427 /* Add delay to filter out noises during initial link setup */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
428 msec_delay(50);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
429
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
430 return (status);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
431 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
432
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
433 /*
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
434 * ixgbe_setup_mac_link_multispeed_fiber - Set MAC link speed
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
435 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
436 * @speed: new link speed
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
437 * @autoneg: true if autonegotiation enabled
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
438 * @autoneg_wait_to_complete: true when waiting for completion is needed
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
439 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
440 * Set the link speed in the AUTOC register and restarts link.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
441 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
442 s32
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
443 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
444 ixgbe_link_speed speed, bool autoneg, bool autoneg_wait_to_complete)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
445 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
446 s32 status = IXGBE_SUCCESS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
447 ixgbe_link_speed link_speed;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
448 ixgbe_link_speed highest_link_speed = IXGBE_LINK_SPEED_UNKNOWN;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
449 u32 speedcnt = 0;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
450 u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
451 u32 i = 0;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
452 bool link_up = false;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
453 bool negotiation;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
454
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
455 DEBUGFUNC("ixgbe_setup_mac_link_multispeed_fiber");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
456
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
457 /* Mask off requested but non-supported speeds */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
458 status = ixgbe_get_link_capabilities(hw, &link_speed, &negotiation);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
459 if (status != IXGBE_SUCCESS)
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
460 return (status);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
461
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
462 speed &= link_speed;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
463
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
464 /*
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
465 * When the driver changes the link speeds that it can support,
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
466 * it sets autotry_restart to true to indicate that we need to
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
467 * initiate a new autotry session with the link partner. To do
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
468 * so, we set the speed then disable and re-enable the tx laser, to
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
469 * alert the link partner that it also needs to restart autotry on its
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
470 * end. This is consistent with true clause 37 autoneg, which also
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
471 * involves a loss of signal.
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
472 */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
473
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
474 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
475 * Try each speed one by one, highest priority first. We do this in
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
476 * software because 10gb fiber doesn't support speed autonegotiation.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
477 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
478 if (speed & IXGBE_LINK_SPEED_10GB_FULL) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
479 speedcnt++;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
480 highest_link_speed = IXGBE_LINK_SPEED_10GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
481
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
482 /* If we already have link at this speed, just jump out */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
483 status = ixgbe_check_link(hw, &link_speed, &link_up, false);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
484 if (status != IXGBE_SUCCESS)
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
485 return (status);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
486
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
487 if ((link_speed == IXGBE_LINK_SPEED_10GB_FULL) && link_up)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
488 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
489
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
490 /* Set the module link speed */
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
491 esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
492 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
493
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
494 /* Allow module to change analog characteristics (1G->10G) */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
495 msec_delay(40);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
496
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
497 status = ixgbe_setup_mac_link_82599(
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
498 hw, IXGBE_LINK_SPEED_10GB_FULL, autoneg,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
499 autoneg_wait_to_complete);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
500 if (status != IXGBE_SUCCESS)
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
501 return (status);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
502
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
503 /* Flap the tx laser if it has not already been done */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
504 if (hw->mac.autotry_restart) {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
505 /* Disable tx laser; allow 100us to go dark per spec */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
506 esdp_reg |= IXGBE_ESDP_SDP3;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
507 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
508 usec_delay(100);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
509
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
510 /* Enable tx laser; allow 2ms to light up per spec */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
511 esdp_reg &= ~IXGBE_ESDP_SDP3;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
512 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
513 msec_delay(2);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
514
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
515 hw->mac.autotry_restart = false;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
516 }
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
517
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
518 /*
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
519 * Wait for the controller to acquire link. Per IEEE 802.3ap,
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
520 * Section 73.10.2, we may have to wait up to 500ms if KR is
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
521 * attempted. 82599 uses the same timing for 10g SFI.
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
522 */
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
523 for (i = 0; i < 5; i++) {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
524 /* Wait for the link partner to also set speed */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
525 msec_delay(100);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
526
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
527 /* If we have link, just jump out */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
528 status = ixgbe_check_link(hw, &link_speed,
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
529 &link_up, false);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
530 if (status != IXGBE_SUCCESS)
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
531 return (status);
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
532
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
533 if (link_up)
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
534 goto out;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
535 }
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
536 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
537
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
538 if (speed & IXGBE_LINK_SPEED_1GB_FULL) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
539 speedcnt++;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
540 if (highest_link_speed == IXGBE_LINK_SPEED_UNKNOWN)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
541 highest_link_speed = IXGBE_LINK_SPEED_1GB_FULL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
542
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
543 /* If we already have link at this speed, just jump out */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
544 status = ixgbe_check_link(hw, &link_speed, &link_up, false);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
545 if (status != IXGBE_SUCCESS)
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
546 return (status);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
547
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
548 if ((link_speed == IXGBE_LINK_SPEED_1GB_FULL) && link_up)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
549 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
550
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
551 /* Set the module link speed */
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
552 esdp_reg &= ~IXGBE_ESDP_SDP5;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
553 esdp_reg |= IXGBE_ESDP_SDP5_DIR;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
554 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
555
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
556 /* Allow module to change analog characteristics (10G->1G) */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
557 msec_delay(40);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
558
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
559 status = ixgbe_setup_mac_link_82599(
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
560 hw, IXGBE_LINK_SPEED_1GB_FULL, autoneg,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
561 autoneg_wait_to_complete);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
562 if (status != IXGBE_SUCCESS)
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
563 return (status);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
564
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
565 /* Flap the tx laser if it has not already been done */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
566 if (hw->mac.autotry_restart) {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
567 /* Disable tx laser; allow 100us to go dark per spec */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
568 esdp_reg |= IXGBE_ESDP_SDP3;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
569 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
570 usec_delay(100);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
571
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
572 /* Enable tx laser; allow 2ms to light up per spec */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
573 esdp_reg &= ~IXGBE_ESDP_SDP3;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
574 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
575 msec_delay(2);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
576
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
577 hw->mac.autotry_restart = false;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
578 }
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
579
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
580 /* Wait for the link partner to also set speed */
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
581 msec_delay(100);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
582
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
583 /* If we have link, just jump out */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
584 status = ixgbe_check_link(hw, &link_speed, &link_up, false);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
585 if (status != IXGBE_SUCCESS)
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
586 return (status);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
587
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
588 if (link_up)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
589 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
590 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
591
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
592 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
593 * We didn't get link. Configure back to the highest speed we tried,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
594 * (if there was more than one). We call ourselves back with just the
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
595 * single highest speed that the user requested.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
596 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
597 if (speedcnt > 1)
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
598 status = ixgbe_setup_mac_link_multispeed_fiber(hw,
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
599 highest_link_speed, autoneg, autoneg_wait_to_complete);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
600
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
601 out:
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
602 /* Set autoneg_advertised value based on input link speed */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
603 hw->phy.autoneg_advertised = 0;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
604
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
605 if (speed & IXGBE_LINK_SPEED_10GB_FULL)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
606 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_10GB_FULL;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
607
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
608 if (speed & IXGBE_LINK_SPEED_1GB_FULL)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
609 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_1GB_FULL;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
610
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
611 return (status);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
612 }
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
613
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
614 /*
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
615 * ixgbe_setup_mac_link_smartspeed - Set MAC link speed using SmartSpeed
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
616 * @hw: pointer to hardware structure
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
617 * @speed: new link speed
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
618 * @autoneg: true if autonegotiation enabled
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
619 * @autoneg_wait_to_complete: true when waiting for completion is needed
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
620 *
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
621 * Implements the Intel SmartSpeed algorithm.
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
622 */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
623 s32
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
624 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw,
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
625 ixgbe_link_speed speed, bool autoneg, bool autoneg_wait_to_complete)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
626 {
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
627 s32 status = IXGBE_SUCCESS;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
628 ixgbe_link_speed link_speed;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
629 s32 i, j;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
630 bool link_up = false;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
631 u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
632
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
633 DEBUGFUNC("ixgbe_setup_mac_link_smartspeed");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
634
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
635 /* Set autoneg_advertised value based on input link speed */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
636 hw->phy.autoneg_advertised = 0;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
637
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
638 if (speed & IXGBE_LINK_SPEED_10GB_FULL)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
639 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_10GB_FULL;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
640
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
641 if (speed & IXGBE_LINK_SPEED_1GB_FULL)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
642 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_1GB_FULL;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
643
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
644 if (speed & IXGBE_LINK_SPEED_100_FULL)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
645 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_100_FULL;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
646
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
647 /*
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
648 * Implement Intel SmartSpeed algorithm. SmartSpeed will reduce the
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
649 * autoneg advertisement if link is unable to be established at the
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
650 * highest negotiated rate. This can sometimes happen due to integrity
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
651 * issues with the physical media connection.
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
652 */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
653
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
654 /* First, try to get link with full advertisement */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
655 hw->phy.smart_speed_active = false;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
656 for (j = 0; j < IXGBE_SMARTSPEED_MAX_RETRIES; j++) {
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
657 status = ixgbe_setup_mac_link_82599(hw, speed, autoneg,
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
658 autoneg_wait_to_complete);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
659 if (status != IXGBE_SUCCESS)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
660 goto out;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
661
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
662 /*
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
663 * Wait for the controller to acquire link. Per IEEE 802.3ap,
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
664 * Section 73.10.2, we may have to wait up to 500ms if KR is
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
665 * attempted, or 200ms if KX/KX4/BX/BX4 is attempted, per
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
666 * Table 9 in the AN MAS.
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
667 */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
668 for (i = 0; i < 5; i++) {
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
669 msec_delay(100);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
670
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
671 /* If we have link, just jump out */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
672 status = ixgbe_check_link(hw, &link_speed, &link_up,
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
673 false);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
674 if (status != IXGBE_SUCCESS)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
675 goto out;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
676
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
677 if (link_up)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
678 goto out;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
679 }
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
680 }
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
681
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
682 /*
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
683 * We didn't get link. If we advertised KR plus one of KX4/KX
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
684 * (or BX4/BX), then disable KR and try again.
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
685 */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
686 if (((autoc_reg & IXGBE_AUTOC_KR_SUPP) == 0) ||
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
687 ((autoc_reg & IXGBE_AUTOC_KX4_KX_SUPP_MASK) == 0))
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
688 goto out;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
689
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
690 /* Turn SmartSpeed on to disable KR support */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
691 hw->phy.smart_speed_active = true;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
692 status = ixgbe_setup_mac_link_82599(hw, speed, autoneg,
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
693 autoneg_wait_to_complete);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
694 if (status != IXGBE_SUCCESS)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
695 goto out;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
696
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
697 /*
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
698 * Wait for the controller to acquire link. 600ms will allow for
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
699 * the AN link_fail_inhibit_timer as well for multiple cycles of
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
700 * parallel detect, both 10g and 1g. This allows for the maximum
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
701 * connect attempts as defined in the AN MAS table 73-7.
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
702 */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
703 for (i = 0; i < 6; i++) {
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
704 msec_delay(100);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
705
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
706 /* If we have link, just jump out */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
707 status = ixgbe_check_link(hw, &link_speed, &link_up, false);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
708 if (status != IXGBE_SUCCESS)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
709 goto out;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
710
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
711 if (link_up)
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
712 goto out;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
713 }
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
714
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
715 /* We didn't get link. Turn SmartSpeed back off. */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
716 hw->phy.smart_speed_active = false;
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
717 status = ixgbe_setup_mac_link_82599(hw, speed, autoneg,
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
718 autoneg_wait_to_complete);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
719
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
720 out:
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
721 return (status);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
722 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
723
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
724 /*
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
725 * ixgbe_setup_mac_link_82599 - Set MAC link speed
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
726 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
727 * @speed: new link speed
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
728 * @autoneg: true if autonegotiation enabled
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
729 * @autoneg_wait_to_complete: true when waiting for completion is needed
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
730 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
731 * Set the link speed in the AUTOC register and restarts link.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
732 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
733 s32
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
734 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
735 ixgbe_link_speed speed, bool autoneg, bool autoneg_wait_to_complete)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
736 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
737 s32 status = IXGBE_SUCCESS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
738 u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
739 u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
740 u32 start_autoc = autoc;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
741 u32 orig_autoc = 0;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
742 u32 link_mode = autoc & IXGBE_AUTOC_LMS_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
743 u32 pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
744 u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
745 u32 links_reg;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
746 u32 i;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
747 ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
748
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
749 DEBUGFUNC("ixgbe_setup_mac_link_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
750
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
751 /* Check to see if speed passed in is supported. */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
752 status = ixgbe_get_link_capabilities(hw, &link_capabilities, &autoneg);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
753 if (status != IXGBE_SUCCESS)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
754 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
755
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
756 speed &= link_capabilities;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
757
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
758 if (speed == IXGBE_LINK_SPEED_UNKNOWN) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
759 status = IXGBE_ERR_LINK_SETUP;
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
760 goto out;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
761 }
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
762
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
763 /*
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
764 * Use stored value (EEPROM defaults) of AUTOC to find KR/KX4 support
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
765 */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
766 if (hw->mac.orig_link_settings_stored)
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
767 orig_autoc = hw->mac.orig_autoc;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
768 else
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
769 orig_autoc = autoc;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
770
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
771 if (link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR ||
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
772 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN ||
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
773 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
774 /* Set KX4/KX/KR support according to speed requested */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
775 autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | IXGBE_AUTOC_KR_SUPP);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
776 if (speed & IXGBE_LINK_SPEED_10GB_FULL)
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
777 if (orig_autoc & IXGBE_AUTOC_KX4_SUPP)
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
778 autoc |= IXGBE_AUTOC_KX4_SUPP;
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
779 if ((orig_autoc & IXGBE_AUTOC_KR_SUPP) &&
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
780 (hw->phy.smart_speed_active == false))
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
781 autoc |= IXGBE_AUTOC_KR_SUPP;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
782 if (speed & IXGBE_LINK_SPEED_1GB_FULL)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
783 autoc |= IXGBE_AUTOC_KX_SUPP;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
784 } else if ((pma_pmd_1g == IXGBE_AUTOC_1G_SFI) &&
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
785 (link_mode == IXGBE_AUTOC_LMS_1G_LINK_NO_AN ||
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
786 link_mode == IXGBE_AUTOC_LMS_1G_AN)) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
787 /* Switch from 1G SFI to 10G SFI if requested */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
788 if ((speed == IXGBE_LINK_SPEED_10GB_FULL) &&
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
789 (pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI)) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
790 autoc &= ~IXGBE_AUTOC_LMS_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
791 autoc |= IXGBE_AUTOC_LMS_10G_SERIAL;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
792 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
793 } else if ((pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI) &&
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
794 (link_mode == IXGBE_AUTOC_LMS_10G_SERIAL)) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
795 /* Switch from 10G SFI to 1G SFI if requested */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
796 if ((speed == IXGBE_LINK_SPEED_1GB_FULL) &&
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
797 (pma_pmd_1g == IXGBE_AUTOC_1G_SFI)) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
798 autoc &= ~IXGBE_AUTOC_LMS_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
799 if (autoneg)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
800 autoc |= IXGBE_AUTOC_LMS_1G_AN;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
801 else
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
802 autoc |= IXGBE_AUTOC_LMS_1G_LINK_NO_AN;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
803 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
804 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
805
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
806 if (autoc != start_autoc) {
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
807 /* Restart link */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
808 autoc |= IXGBE_AUTOC_AN_RESTART;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
809 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
810
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
811 /* Only poll for autoneg to complete if specified to do so */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
812 if (autoneg_wait_to_complete) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
813 if (link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR ||
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
814 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN ||
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
815 link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
816 links_reg = 0; /* Just in case Autoneg time=0 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
817 for (i = 0; i < IXGBE_AUTO_NEG_TIME; i++) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
818 links_reg =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
819 IXGBE_READ_REG(hw, IXGBE_LINKS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
820 if (links_reg & IXGBE_LINKS_KX_AN_COMP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
821 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
822 msec_delay(100);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
823 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
824 if (!(links_reg & IXGBE_LINKS_KX_AN_COMP)) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
825 status =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
826 IXGBE_ERR_AUTONEG_NOT_COMPLETE;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
827 DEBUGOUT("Autoneg did not complete.\n");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
828 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
829 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
830 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
831
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
832 /* Add delay to filter out noises during initial link setup */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
833 msec_delay(50);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
834 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
835
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
836 out:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
837 return (status);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
838 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
839
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
840 /*
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
841 * ixgbe_setup_copper_link_82599 - Set the PHY autoneg advertised field
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
842 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
843 * @speed: new link speed
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
844 * @autoneg: true if autonegotiation enabled
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
845 * @autoneg_wait_to_complete: true if waiting is needed to complete
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
846 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
847 * Restarts link on PHY and MAC based on settings passed in.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
848 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
849 static s32
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
850 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw,
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
851 ixgbe_link_speed speed, bool autoneg, bool autoneg_wait_to_complete)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
852 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
853 s32 status;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
854
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
855 DEBUGFUNC("ixgbe_setup_copper_link_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
856
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
857 /* Setup the PHY according to input speed */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
858 status = hw->phy.ops.setup_link_speed(hw, speed, autoneg,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
859 autoneg_wait_to_complete);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
860 /* Set up MAC */
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
861 (void) ixgbe_start_mac_link_82599(hw, autoneg_wait_to_complete);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
862
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
863 return (status);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
864 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
865 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
866 * ixgbe_reset_hw_82599 - Perform hardware reset
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
867 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
868 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
869 * Resets the hardware by resetting the transmit and receive units, masks
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
870 * and clears all interrupts, perform a PHY reset, and perform a link (MAC)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
871 * reset.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
872 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
873 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
874 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
875 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
876 s32 status = IXGBE_SUCCESS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
877 u32 ctrl, ctrl_ext;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
878 u32 i;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
879 u32 autoc;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
880 u32 autoc2;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
881
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
882 DEBUGFUNC("ixgbe_reset_hw_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
883
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
884 /* Call adapter stop to disable tx/rx and clear interrupts */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
885 hw->mac.ops.stop_adapter(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
886
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
887 /* PHY ops must be identified and initialized prior to reset */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
888
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
889 /* Identify PHY and related function pointers */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
890 status = hw->phy.ops.init(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
891
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
892 if (status == IXGBE_ERR_SFP_NOT_SUPPORTED)
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
893 goto reset_hw_out;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
894
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
895 /* Setup SFP module if there is one present. */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
896 if (hw->phy.sfp_setup_needed) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
897 status = hw->mac.ops.setup_sfp(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
898 hw->phy.sfp_setup_needed = false;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
899 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
900
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
901 if (status == IXGBE_ERR_SFP_NOT_SUPPORTED)
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
902 goto reset_hw_out;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
903
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
904 /* Reset PHY */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
905 if (hw->phy.reset_disable == false && hw->phy.ops.reset != NULL)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
906 hw->phy.ops.reset(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
907
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
908 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
909 * Prevent the PCI-E bus from from hanging by disabling PCI-E master
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
910 * access and verify no pending requests before reset
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
911 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
912 status = ixgbe_disable_pcie_master(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
913 if (status != IXGBE_SUCCESS) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
914 status = IXGBE_ERR_MASTER_REQUESTS_PENDING;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
915 DEBUGOUT("PCI-E Master disable polling has failed.\n");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
916 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
917
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
918 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
919 * Issue global reset to the MAC. This needs to be a SW reset.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
920 * If link reset is used, it might reset the MAC when mng is using it
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
921 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
922 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
923 IXGBE_WRITE_REG(hw, IXGBE_CTRL, (ctrl | IXGBE_CTRL_RST));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
924 IXGBE_WRITE_FLUSH(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
925
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
926 /* Poll for reset bit to self-clear indicating reset is complete */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
927 for (i = 0; i < 10; i++) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
928 usec_delay(1);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
929 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
930 if (!(ctrl & IXGBE_CTRL_RST)) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
931 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
932 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
933 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
934 if (ctrl & IXGBE_CTRL_RST) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
935 status = IXGBE_ERR_RESET_FAILED;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
936 DEBUGOUT("Reset polling failed to complete.\n");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
937 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
938
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
939 /* Clear PF Reset Done bit so PF/VF Mail Ops can work */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
940 ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
941 ctrl_ext |= IXGBE_CTRL_EXT_PFRSTD;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
942 IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
943
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
944 msec_delay(50);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
945
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
946 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
947 * Store the original AUTOC/AUTOC2 values if they have not been
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
948 * stored off yet. Otherwise restore the stored original
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
949 * values since the reset operation sets back to defaults.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
950 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
951 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
952 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
953 if (hw->mac.orig_link_settings_stored == false) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
954 hw->mac.orig_autoc = autoc;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
955 hw->mac.orig_autoc2 = autoc2;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
956 hw->mac.orig_link_settings_stored = true;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
957 } else {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
958 if (autoc != hw->mac.orig_autoc) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
959 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, (hw->mac.orig_autoc |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
960 IXGBE_AUTOC_AN_RESTART));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
961 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
962
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
963 if ((autoc2 & IXGBE_AUTOC2_UPPER_MASK) !=
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
964 (hw->mac.orig_autoc2 & IXGBE_AUTOC2_UPPER_MASK)) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
965 autoc2 &= ~IXGBE_AUTOC2_UPPER_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
966 autoc2 |= (hw->mac.orig_autoc2 &
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
967 IXGBE_AUTOC2_UPPER_MASK);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
968 IXGBE_WRITE_REG(hw, IXGBE_AUTOC2, autoc2);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
969 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
970 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
971
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
972 /* Store the permanent mac address */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
973 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
974
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
975 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
976 * Store MAC address from RAR0, clear receive address registers, and
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
977 * clear the multicast table. Also reset num_rar_entries to 128,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
978 * since we modify this value when programming the SAN MAC address.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
979 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
980 hw->mac.num_rar_entries = 128;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
981 hw->mac.ops.init_rx_addrs(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
982
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
983 /* Store the permanent SAN mac address */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
984 hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
985
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
986 /* Add the SAN MAC address to the RAR only if it's a valid address */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
987 if (ixgbe_validate_mac_addr(hw->mac.san_addr) == 0) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
988 hw->mac.ops.set_rar(hw, hw->mac.num_rar_entries - 1,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
989 hw->mac.san_addr, 0, IXGBE_RAH_AV);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
990
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
991 /* Reserve the last RAR for the SAN MAC address */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
992 hw->mac.num_rar_entries--;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
993 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
994
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
995 /* Store the alternative WWNN/WWPN prefix */
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
996 hw->mac.ops.get_wwn_prefix(hw, &hw->mac.wwnn_prefix,
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
997 &hw->mac.wwpn_prefix);
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
998
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
999 reset_hw_out:
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1000 return (status);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1001 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1002
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1003 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1004 * ixgbe_reinit_fdir_tables_82599 - Reinitialize Flow Director tables.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1005 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1006 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1007 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1008 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1009 {
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1010 int i;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1011 u32 fdirctrl = IXGBE_READ_REG(hw, IXGBE_FDIRCTRL);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1012 fdirctrl &= ~IXGBE_FDIRCTRL_INIT_DONE;
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1013
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1014 DEBUGFUNC("ixgbe_reinit_fdir_tables_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1015
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1016 /*
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1017 * Before starting reinitialization process,
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1018 * FDIRCMD.CMD must be zero.
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1019 */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1020 for (i = 0; i < IXGBE_FDIRCMD_CMD_POLL; i++) {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1021 if (!(IXGBE_READ_REG(hw, IXGBE_FDIRCMD) &
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1022 IXGBE_FDIRCMD_CMD_MASK))
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1023 break;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1024 usec_delay(10);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1025 }
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1026 if (i >= IXGBE_FDIRCMD_CMD_POLL) {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1027 DEBUGOUT("Flow Director previous command isn't complete, "
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1028 "aborting table re-initialization. \n");
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1029 return (IXGBE_ERR_FDIR_REINIT_FAILED);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1030 }
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1031
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1032 IXGBE_WRITE_REG(hw, IXGBE_FDIRFREE, 0);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1033 IXGBE_WRITE_FLUSH(hw);
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1034 /*
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1035 * 82599 adapters flow director init flow cannot be restarted,
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1036 * Workaround 82599 silicon errata by performing the following steps
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1037 * before re-writing the FDIRCTRL control register with the same value.
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1038 * - write 1 to bit 8 of FDIRCMD register &
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1039 * - write 0 to bit 8 of FDIRCMD register
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1040 */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1041 IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD,
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1042 (IXGBE_READ_REG(hw, IXGBE_FDIRCMD) |
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1043 IXGBE_FDIRCMD_CLEARHT));
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1044 IXGBE_WRITE_FLUSH(hw);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1045 IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD,
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1046 (IXGBE_READ_REG(hw, IXGBE_FDIRCMD) &
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1047 ~IXGBE_FDIRCMD_CLEARHT));
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1048 IXGBE_WRITE_FLUSH(hw);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1049 /*
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1050 * Clear FDIR Hash register to clear any leftover hashes
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1051 * waiting to be programmed.
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1052 */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1053 IXGBE_WRITE_REG(hw, IXGBE_FDIRHASH, 0x00);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1054 IXGBE_WRITE_FLUSH(hw);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1055
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1056 IXGBE_WRITE_REG(hw, IXGBE_FDIRCTRL, fdirctrl);
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1057 IXGBE_WRITE_FLUSH(hw);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1058
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1059 /* Poll init-done after we write FDIRCTRL register */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1060 for (i = 0; i < IXGBE_FDIR_INIT_DONE_POLL; i++) {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1061 if (IXGBE_READ_REG(hw, IXGBE_FDIRCTRL) &
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1062 IXGBE_FDIRCTRL_INIT_DONE)
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1063 break;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1064 usec_delay(10);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1065 }
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1066 if (i >= IXGBE_FDIR_INIT_DONE_POLL) {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1067 DEBUGOUT("Flow Director Signature poll time exceeded!\n");
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1068 return (IXGBE_ERR_FDIR_REINIT_FAILED);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1069 }
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1070
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1071 /* Clear FDIR statistics registers (read to clear) */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1072 (void) IXGBE_READ_REG(hw, IXGBE_FDIRUSTAT);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1073 (void) IXGBE_READ_REG(hw, IXGBE_FDIRFSTAT);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1074 (void) IXGBE_READ_REG(hw, IXGBE_FDIRMATCH);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1075 (void) IXGBE_READ_REG(hw, IXGBE_FDIRMISS);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1076 (void) IXGBE_READ_REG(hw, IXGBE_FDIRLEN);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1077
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1078 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1079 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1080
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1081 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1082 * ixgbe_init_fdir_signature_82599 - Initialize Flow Director signature filters
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1083 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1084 * @pballoc: which mode to allocate filters with
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1085 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1086 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1087 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 pballoc)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1088 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1089 u32 fdirctrl = 0;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1090 u32 pbsize;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1091 int i;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1092
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1093 DEBUGFUNC("ixgbe_init_fdir_signature_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1094
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1095 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1096 * Before enabling Flow Director, the Rx Packet Buffer size
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1097 * must be reduced. The new value is the current size minus
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1098 * flow director memory usage size.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1099 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1100 pbsize = (1 << (IXGBE_FDIR_PBALLOC_SIZE_SHIFT + pballoc));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1101 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(0),
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1102 IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)) - pbsize);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1103
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1104 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1105 * The defaults in the HW for RX PB 1-7 are not zero and so should be
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1106 * intialized to zero for non DCB mode otherwise actual total RX PB
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1107 * would be bigger than programmed and filter space would run into
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1108 * the PB 0 region.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1109 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1110 for (i = 1; i < 8; i++)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1111 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), 0);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1112
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1113 /* Send interrupt when 64 filters are left */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1114 fdirctrl |= 4 << IXGBE_FDIRCTRL_FULL_THRESH_SHIFT;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1115
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1116 /* Set the maximum length per hash bucket to 0xA filters */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1117 fdirctrl |= 0xA << IXGBE_FDIRCTRL_MAX_LENGTH_SHIFT;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1118
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1119 switch (pballoc) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1120 case IXGBE_FDIR_PBALLOC_64K:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1121 /* 8k - 1 signature filters */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1122 fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_64K;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1123 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1124 case IXGBE_FDIR_PBALLOC_128K:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1125 /* 16k - 1 signature filters */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1126 fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_128K;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1127 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1128 case IXGBE_FDIR_PBALLOC_256K:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1129 /* 32k - 1 signature filters */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1130 fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_256K;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1131 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1132 default:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1133 /* bad value */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1134 return (IXGBE_ERR_CONFIG);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1135 };
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1136
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1137 /* Move the flexible bytes to use the ethertype - shift 6 words */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1138 fdirctrl |= (0x6 << IXGBE_FDIRCTRL_FLEX_SHIFT);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1139
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1140 /* Prime the keys for hashing */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1141 IXGBE_WRITE_REG(hw, IXGBE_FDIRHKEY,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1142 IXGBE_HTONL(IXGBE_ATR_BUCKET_HASH_KEY));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1143 IXGBE_WRITE_REG(hw, IXGBE_FDIRSKEY,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1144 IXGBE_HTONL(IXGBE_ATR_SIGNATURE_HASH_KEY));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1145
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1146 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1147 * Poll init-done after we write the register. Estimated times:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1148 * 10G: PBALLOC = 11b, timing is 60us
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1149 * 1G: PBALLOC = 11b, timing is 600us
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1150 * 100M: PBALLOC = 11b, timing is 6ms
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1151 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1152 * Multiple these timings by 4 if under full Rx load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1153 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1154 * So we'll poll for IXGBE_FDIR_INIT_DONE_POLL times, sleeping for
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1155 * 1 msec per poll time. If we're at line rate and drop to 100M, then
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1156 * this might not finish in our poll time, but we can live with that
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1157 * for now.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1158 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1159 IXGBE_WRITE_REG(hw, IXGBE_FDIRCTRL, fdirctrl);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1160 IXGBE_WRITE_FLUSH(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1161 for (i = 0; i < IXGBE_FDIR_INIT_DONE_POLL; i++) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1162 if (IXGBE_READ_REG(hw, IXGBE_FDIRCTRL) &
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1163 IXGBE_FDIRCTRL_INIT_DONE)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1164 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1165
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1166 msec_delay(1);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1167 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1168 if (i >= IXGBE_FDIR_INIT_DONE_POLL) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1169 DEBUGOUT("Flow Director Signature poll time exceeded!\n");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1170 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1171
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1172 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1173 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1174
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1175 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1176 * ixgbe_init_fdir_perfect_82599 - Initialize Flow Director perfect filters
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1177 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1178 * @pballoc: which mode to allocate filters with
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1179 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1180 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1181 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 pballoc)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1182 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1183 u32 fdirctrl = 0;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1184 u32 pbsize;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1185 int i;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1186
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1187 DEBUGFUNC("ixgbe_init_fdir_perfect_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1188
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1189 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1190 * Before enabling Flow Director, the Rx Packet Buffer size
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1191 * must be reduced. The new value is the current size minus
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1192 * flow director memory usage size.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1193 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1194
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1195 pbsize = (1 << (IXGBE_FDIR_PBALLOC_SIZE_SHIFT + pballoc));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1196 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(0),
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1197 IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(0)) - pbsize);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1198
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1199 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1200 * The defaults in the HW for RX PB 1-7 are not zero and so should be
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1201 * intialized to zero for non DCB mode otherwise actual total RX PB
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1202 * would be bigger than programmed and filter space would run into
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1203 * the PB 0 region.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1204 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1205 for (i = 1; i < 8; i++)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1206 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), 0);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1207
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1208 /* Send interrupt when 64 filters are left */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1209 fdirctrl |= 4 << IXGBE_FDIRCTRL_FULL_THRESH_SHIFT;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1210
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1211 switch (pballoc) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1212 case IXGBE_FDIR_PBALLOC_64K:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1213 /* 2k - 1 perfect filters */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1214 fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_64K;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1215 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1216 case IXGBE_FDIR_PBALLOC_128K:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1217 /* 4k - 1 perfect filters */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1218 fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_128K;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1219 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1220 case IXGBE_FDIR_PBALLOC_256K:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1221 /* 8k - 1 perfect filters */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1222 fdirctrl |= IXGBE_FDIRCTRL_PBALLOC_256K;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1223 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1224 default:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1225 /* bad value */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1226 return (IXGBE_ERR_CONFIG);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1227 };
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1228
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1229 /* Turn perfect match filtering on */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1230 fdirctrl |= IXGBE_FDIRCTRL_PERFECT_MATCH;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1231 fdirctrl |= IXGBE_FDIRCTRL_REPORT_STATUS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1232
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1233 /* Move the flexible bytes to use the ethertype - shift 6 words */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1234 fdirctrl |= (0x6 << IXGBE_FDIRCTRL_FLEX_SHIFT);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1235
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1236 /* Prime the keys for hashing */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1237 IXGBE_WRITE_REG(hw, IXGBE_FDIRHKEY,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1238 IXGBE_HTONL(IXGBE_ATR_BUCKET_HASH_KEY));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1239 IXGBE_WRITE_REG(hw, IXGBE_FDIRSKEY,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1240 IXGBE_HTONL(IXGBE_ATR_SIGNATURE_HASH_KEY));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1241
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1242 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1243 * Poll init-done after we write the register. Estimated times:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1244 * 10G: PBALLOC = 11b, timing is 60us
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1245 * 1G: PBALLOC = 11b, timing is 600us
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1246 * 100M: PBALLOC = 11b, timing is 6ms
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1247 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1248 * Multiple these timings by 4 if under full Rx load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1249 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1250 * So we'll poll for IXGBE_FDIR_INIT_DONE_POLL times, sleeping for
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1251 * 1 msec per poll time. If we're at line rate and drop to 100M, then
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1252 * this might not finish in our poll time, but we can live with that
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1253 * for now.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1254 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1255
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1256 /* Set the maximum length per hash bucket to 0xA filters */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1257 fdirctrl |= (0xA << IXGBE_FDIRCTRL_MAX_LENGTH_SHIFT);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1258
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1259 IXGBE_WRITE_REG(hw, IXGBE_FDIRCTRL, fdirctrl);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1260 IXGBE_WRITE_FLUSH(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1261 for (i = 0; i < IXGBE_FDIR_INIT_DONE_POLL; i++) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1262 if (IXGBE_READ_REG(hw, IXGBE_FDIRCTRL) &
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1263 IXGBE_FDIRCTRL_INIT_DONE)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1264 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1265
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1266 msec_delay(1);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1267 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1268 if (i >= IXGBE_FDIR_INIT_DONE_POLL) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1269 DEBUGOUT("Flow Director Perfect poll time exceeded!\n");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1270 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1271
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1272 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1273 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1274
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1275 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1276 * ixgbe_atr_compute_hash_82599 - Compute the hashes for SW ATR
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1277 * @stream: input bitstream to compute the hash on
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1278 * @key: 32-bit hash key
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1279 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1280 u16
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1281 ixgbe_atr_compute_hash_82599(struct ixgbe_atr_input *atr_input, u32 key)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1282 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1283 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1284 * The algorithm is as follows:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1285 * Hash[15:0] = Sum { S[n] x K[n+16] }, n = 0...350
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1286 * where Sum {A[n]}, n = 0...n is bitwise XOR of A[0], A[1]...A[n]
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1287 * and A[n] x B[n] is bitwise AND between same length strings
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1288 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1289 * K[n] is 16 bits, defined as:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1290 * for n modulo 32 >= 15, K[n] = K[n % 32 : (n % 32) - 15]
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1291 * for n modulo 32 < 15, K[n] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1292 * K[(n % 32:0) | (31:31 - (14 - (n % 32)))]
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1293 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1294 * S[n] is 16 bits, defined as:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1295 * for n >= 15, S[n] = S[n:n - 15]
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1296 * for n < 15, S[n] = S[(n:0) | (350:350 - (14 - n))]
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1297 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1298 * To simplify for programming, the algorithm is implemented
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1299 * in software this way:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1300 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1301 * Key[31:0], Stream[335:0]
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1302 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1303 * tmp_key[11 * 32 - 1:0] = 11{Key[31:0] = key concatenated 11 times
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1304 * int_key[350:0] = tmp_key[351:1]
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1305 * int_stream[365:0] = Stream[14:0] | Stream[335:0] | Stream[335:321]
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1306 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1307 * hash[15:0] = 0;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1308 * for (i = 0; i < 351; i++) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1309 * if (int_key[i])
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1310 * hash ^= int_stream[(i + 15):i];
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1311 * }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1312 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1313
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1314 union {
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1315 u64 fill[6];
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1316 u32 key[11];
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1317 u8 key_stream[44];
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1318 } tmp_key;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1319
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1320 u8 *stream = (u8 *)atr_input;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1321 u8 int_key[44]; /* upper-most bit unused */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1322 u8 hash_str[46]; /* upper-most 2 bits unused */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1323 u16 hash_result = 0;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1324 int i, j, k, h;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1325
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1326 DEBUGFUNC("ixgbe_atr_compute_hash_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1327
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1328 /*
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1329 * Initialize the fill member to prevent warnings
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1330 * on some compilers
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1331 */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1332 tmp_key.fill[0] = 0;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1333
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1334 /* First load the temporary key stream */
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1335 for (i = 0; i < 6; i++) {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1336 u64 fillkey = ((u64)key << 32) | key;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1337 tmp_key.fill[i] = fillkey;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1338 }
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1339
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1340 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1341 * Set the interim key for the hashing. Bit 352 is unused, so we must
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1342 * shift and compensate when building the key.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1343 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1344 int_key[0] = tmp_key.key_stream[0] >> 1;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1345 for (i = 1, j = 0; i < 44; i++) {
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1346 unsigned int this_key = tmp_key.key_stream[j] << 7;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1347 j++;
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1348 int_key[i] = (u8)(this_key | (tmp_key.key_stream[j] >> 1));
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1349 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1350
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1351 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1352 * Set the interim bit string for the hashing. Bits 368 and 367 are
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1353 * unused, so shift and compensate when building the string.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1354 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1355 hash_str[0] = (stream[40] & 0x7f) >> 1;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1356 for (i = 1, j = 40; i < 46; i++) {
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1357 unsigned int this_str = stream[j] << 7;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1358 j++;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1359 if (j > 41)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1360 j = 0;
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1361 hash_str[i] = (u8)(this_str | (stream[j] >> 1));
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1362 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1363
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1364 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1365 * Now compute the hash. i is the index into hash_str, j is into our
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1366 * key stream, k is counting the number of bits, and h interates within
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1367 * each byte.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1368 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1369 for (i = 45, j = 43, k = 0; k < 351 && i >= 2 && j >= 0; i--, j--) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1370 for (h = 0; h < 8 && k < 351; h++, k++) {
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1371 if (int_key[j] & (1 << h)) {
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1372 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1373 * Key bit is set, XOR in the current 16-bit
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1374 * string. Example of processing:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1375 * h = 0,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1376 * tmp = (hash_str[i - 2] & 0 << 16) |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1377 * (hash_str[i - 1] & 0xff << 8) |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1378 * (hash_str[i] & 0xff >> 0)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1379 * So tmp = hash_str[15 + k:k], since the
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1380 * i + 2 clause rolls off the 16-bit value
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1381 * h = 7,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1382 * tmp = (hash_str[i - 2] & 0x7f << 9) |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1383 * (hash_str[i - 1] & 0xff << 1) |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1384 * (hash_str[i] & 0x80 >> 7)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1385 */
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1386 int tmp = (hash_str[i] >> h);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1387 tmp |= (hash_str[i - 1] << (8 - h));
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1388 tmp |= (int)(hash_str[i - 2] & ((1 << h) - 1))
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1389 << (16 - h);
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
1390 hash_result ^= (u16)tmp;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1391 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1392 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1393 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1394
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1395 return (hash_result);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1396 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1397
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1398 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1399 * ixgbe_atr_set_vlan_id_82599 - Sets the VLAN id in the ATR input stream
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1400 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1401 * @vlan: the VLAN id to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1402 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1403 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1404 ixgbe_atr_set_vlan_id_82599(struct ixgbe_atr_input *input, u16 vlan)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1405 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1406 DEBUGFUNC("ixgbe_atr_set_vlan_id_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1407
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1408 input->byte_stream[IXGBE_ATR_VLAN_OFFSET + 1] = vlan >> 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1409 input->byte_stream[IXGBE_ATR_VLAN_OFFSET] = vlan & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1410
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1411 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1412 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1413
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1414 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1415 * ixgbe_atr_set_src_ipv4_82599 - Sets the source IPv4 address
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1416 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1417 * @src_addr: the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1418 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1419 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1420 ixgbe_atr_set_src_ipv4_82599(struct ixgbe_atr_input *input, u32 src_addr)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1421 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1422 DEBUGFUNC("ixgbe_atr_set_src_ipv4_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1423
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1424 input->byte_stream[IXGBE_ATR_SRC_IPV4_OFFSET + 3] = src_addr >> 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1425 input->byte_stream[IXGBE_ATR_SRC_IPV4_OFFSET + 2] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1426 (src_addr >> 16) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1427 input->byte_stream[IXGBE_ATR_SRC_IPV4_OFFSET + 1] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1428 (src_addr >> 8) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1429 input->byte_stream[IXGBE_ATR_SRC_IPV4_OFFSET] = src_addr & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1430
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1431 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1432 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1433
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1434 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1435 * ixgbe_atr_set_dst_ipv4_82599 - Sets the destination IPv4 address
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1436 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1437 * @dst_addr: the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1438 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1439 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1440 ixgbe_atr_set_dst_ipv4_82599(struct ixgbe_atr_input *input, u32 dst_addr)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1441 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1442 DEBUGFUNC("ixgbe_atr_set_dst_ipv4_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1443
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1444 input->byte_stream[IXGBE_ATR_DST_IPV4_OFFSET + 3] = dst_addr >> 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1445 input->byte_stream[IXGBE_ATR_DST_IPV4_OFFSET + 2] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1446 (dst_addr >> 16) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1447 input->byte_stream[IXGBE_ATR_DST_IPV4_OFFSET + 1] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1448 (dst_addr >> 8) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1449 input->byte_stream[IXGBE_ATR_DST_IPV4_OFFSET] = dst_addr & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1450
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1451 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1452 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1453
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1454 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1455 * ixgbe_atr_set_src_ipv6_82599 - Sets the source IPv6 address
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1456 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1457 * @src_addr_1: the first 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1458 * @src_addr_2: the second 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1459 * @src_addr_3: the third 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1460 * @src_addr_4: the fourth 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1461 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1462 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1463 ixgbe_atr_set_src_ipv6_82599(struct ixgbe_atr_input *input,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1464 u32 src_addr_1, u32 src_addr_2, u32 src_addr_3, u32 src_addr_4)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1465 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1466 DEBUGFUNC("ixgbe_atr_set_src_ipv6_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1467
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1468 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET] = src_addr_4 & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1469 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 1] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1470 (src_addr_4 >> 8) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1471 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 2] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1472 (src_addr_4 >> 16) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1473 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 3] = src_addr_4 >> 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1474
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1475 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 4] = src_addr_3 & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1476 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 5] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1477 (src_addr_3 >> 8) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1478 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 6] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1479 (src_addr_3 >> 16) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1480 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 7] = src_addr_3 >> 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1481
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1482 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 8] = src_addr_2 & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1483 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 9] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1484 (src_addr_2 >> 8) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1485 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 10] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1486 (src_addr_2 >> 16) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1487 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 11] = src_addr_2 >> 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1488
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1489 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 12] = src_addr_1 & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1490 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 13] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1491 (src_addr_1 >> 8) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1492 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 14] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1493 (src_addr_1 >> 16) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1494 input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 15] = src_addr_1 >> 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1495
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1496 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1497 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1498
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1499 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1500 * ixgbe_atr_set_dst_ipv6_82599 - Sets the destination IPv6 address
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1501 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1502 * @dst_addr_1: the first 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1503 * @dst_addr_2: the second 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1504 * @dst_addr_3: the third 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1505 * @dst_addr_4: the fourth 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1506 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1507 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1508 ixgbe_atr_set_dst_ipv6_82599(struct ixgbe_atr_input *input,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1509 u32 dst_addr_1, u32 dst_addr_2, u32 dst_addr_3, u32 dst_addr_4)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1510 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1511 DEBUGFUNC("ixgbe_atr_set_dst_ipv6_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1512
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1513 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET] = dst_addr_4 & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1514 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 1] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1515 (dst_addr_4 >> 8) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1516 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 2] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1517 (dst_addr_4 >> 16) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1518 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 3] = dst_addr_4 >> 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1519
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1520 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 4] = dst_addr_3 & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1521 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 5] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1522 (dst_addr_3 >> 8) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1523 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 6] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1524 (dst_addr_3 >> 16) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1525 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 7] = dst_addr_3 >> 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1526
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1527 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 8] = dst_addr_2 & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1528 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 9] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1529 (dst_addr_2 >> 8) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1530 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 10] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1531 (dst_addr_2 >> 16) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1532 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 11] = dst_addr_2 >> 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1533
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1534 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 12] = dst_addr_1 & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1535 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 13] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1536 (dst_addr_1 >> 8) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1537 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 14] =
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1538 (dst_addr_1 >> 16) & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1539 input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 15] = dst_addr_1 >> 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1540
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1541 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1542 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1543
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1544 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1545 * ixgbe_atr_set_src_port_82599 - Sets the source port
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1546 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1547 * @src_port: the source port to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1548 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1549 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1550 ixgbe_atr_set_src_port_82599(struct ixgbe_atr_input *input, u16 src_port)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1551 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1552 DEBUGFUNC("ixgbe_atr_set_src_port_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1553
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1554 input->byte_stream[IXGBE_ATR_SRC_PORT_OFFSET + 1] = src_port >> 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1555 input->byte_stream[IXGBE_ATR_SRC_PORT_OFFSET] = src_port & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1556
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1557 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1558 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1559
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1560 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1561 * ixgbe_atr_set_dst_port_82599 - Sets the destination port
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1562 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1563 * @dst_port: the destination port to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1564 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1565 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1566 ixgbe_atr_set_dst_port_82599(struct ixgbe_atr_input *input, u16 dst_port)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1567 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1568 DEBUGFUNC("ixgbe_atr_set_dst_port_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1569
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1570 input->byte_stream[IXGBE_ATR_DST_PORT_OFFSET + 1] = dst_port >> 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1571 input->byte_stream[IXGBE_ATR_DST_PORT_OFFSET] = dst_port & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1572
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1573 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1574 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1575
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1576 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1577 * ixgbe_atr_set_flex_byte_82599 - Sets the flexible bytes
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1578 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1579 * @flex_bytes: the flexible bytes to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1580 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1581 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1582 ixgbe_atr_set_flex_byte_82599(struct ixgbe_atr_input *input, u16 flex_byte)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1583 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1584 DEBUGFUNC("ixgbe_atr_set_flex_byte_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1585
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1586 input->byte_stream[IXGBE_ATR_FLEX_BYTE_OFFSET + 1] = flex_byte >> 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1587 input->byte_stream[IXGBE_ATR_FLEX_BYTE_OFFSET] = flex_byte & 0xff;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1588
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1589 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1590 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1591
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1592 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1593 * ixgbe_atr_set_vm_pool_82599 - Sets the Virtual Machine pool
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1594 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1595 * @vm_pool: the Virtual Machine pool to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1596 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1597 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1598 ixgbe_atr_set_vm_pool_82599(struct ixgbe_atr_input *input, u8 vm_pool)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1599 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1600 DEBUGFUNC("ixgbe_atr_set_vm_pool_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1601
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1602 input->byte_stream[IXGBE_ATR_VM_POOL_OFFSET] = vm_pool;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1603
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1604 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1605 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1606
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1607 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1608 * ixgbe_atr_set_l4type_82599 - Sets the layer 4 packet type
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1609 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1610 * @l4type: the layer 4 type value to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1611 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1612 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1613 ixgbe_atr_set_l4type_82599(struct ixgbe_atr_input *input, u8 l4type)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1614 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1615 DEBUGFUNC("ixgbe_atr_set_l4type_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1616
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1617 input->byte_stream[IXGBE_ATR_L4TYPE_OFFSET] = l4type;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1618
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1619 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1620 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1621
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1622 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1623 * ixgbe_atr_get_vlan_id_82599 - Gets the VLAN id from the ATR input stream
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1624 * @input: input stream to search
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1625 * @vlan: the VLAN id to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1626 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1627 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1628 ixgbe_atr_get_vlan_id_82599(struct ixgbe_atr_input *input, u16 *vlan)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1629 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1630 DEBUGFUNC("ixgbe_atr_get_vlan_id_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1631
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1632 *vlan = input->byte_stream[IXGBE_ATR_VLAN_OFFSET];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1633 *vlan |= input->byte_stream[IXGBE_ATR_VLAN_OFFSET + 1] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1634
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1635 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1636 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1637
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1638 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1639 * ixgbe_atr_get_src_ipv4_82599 - Gets the source IPv4 address
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1640 * @input: input stream to search
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1641 * @src_addr: the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1642 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1643 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1644 ixgbe_atr_get_src_ipv4_82599(struct ixgbe_atr_input *input, u32 *src_addr)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1645 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1646 DEBUGFUNC("ixgbe_atr_get_src_ipv4_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1647
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1648 *src_addr = input->byte_stream[IXGBE_ATR_SRC_IPV4_OFFSET];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1649 *src_addr |= input->byte_stream[IXGBE_ATR_SRC_IPV4_OFFSET + 1] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1650 *src_addr |= input->byte_stream[IXGBE_ATR_SRC_IPV4_OFFSET + 2] << 16;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1651 *src_addr |= input->byte_stream[IXGBE_ATR_SRC_IPV4_OFFSET + 3] << 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1652
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1653 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1654 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1655
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1656 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1657 * ixgbe_atr_get_dst_ipv4_82599 - Gets the destination IPv4 address
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1658 * @input: input stream to search
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1659 * @dst_addr: the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1660 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1661 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1662 ixgbe_atr_get_dst_ipv4_82599(struct ixgbe_atr_input *input, u32 *dst_addr)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1663 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1664 DEBUGFUNC("ixgbe_atr_get_dst_ipv4_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1665
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1666 *dst_addr = input->byte_stream[IXGBE_ATR_DST_IPV4_OFFSET];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1667 *dst_addr |= input->byte_stream[IXGBE_ATR_DST_IPV4_OFFSET + 1] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1668 *dst_addr |= input->byte_stream[IXGBE_ATR_DST_IPV4_OFFSET + 2] << 16;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1669 *dst_addr |= input->byte_stream[IXGBE_ATR_DST_IPV4_OFFSET + 3] << 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1670
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1671 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1672 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1673
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1674 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1675 * ixgbe_atr_get_src_ipv6_82599 - Gets the source IPv6 address
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1676 * @input: input stream to search
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1677 * @src_addr_1: the first 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1678 * @src_addr_2: the second 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1679 * @src_addr_3: the third 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1680 * @src_addr_4: the fourth 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1681 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1682 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1683 ixgbe_atr_get_src_ipv6_82599(struct ixgbe_atr_input *input,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1684 u32 *src_addr_1, u32 *src_addr_2, u32 *src_addr_3, u32 *src_addr_4)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1685 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1686 DEBUGFUNC("ixgbe_atr_get_src_ipv6_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1687
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1688 *src_addr_1 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 12];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1689 *src_addr_1 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 13] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1690 *src_addr_1 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 14] << 16;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1691 *src_addr_1 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 15] << 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1692
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1693 *src_addr_2 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 8];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1694 *src_addr_2 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 9] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1695 *src_addr_2 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 10] << 16;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1696 *src_addr_2 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 11] << 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1697
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1698 *src_addr_3 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 4];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1699 *src_addr_3 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 5] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1700 *src_addr_3 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 6] << 16;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1701 *src_addr_3 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 7] << 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1702
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1703 *src_addr_4 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1704 *src_addr_4 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 1] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1705 *src_addr_4 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 2] << 16;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1706 *src_addr_4 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 3] << 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1707
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1708 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1709 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1710
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1711 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1712 * ixgbe_atr_get_dst_ipv6_82599 - Gets the destination IPv6 address
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1713 * @input: input stream to search
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1714 * @dst_addr_1: the first 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1715 * @dst_addr_2: the second 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1716 * @dst_addr_3: the third 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1717 * @dst_addr_4: the fourth 4 bytes of the IP address to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1718 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1719 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1720 ixgbe_atr_get_dst_ipv6_82599(struct ixgbe_atr_input *input,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1721 u32 *dst_addr_1, u32 *dst_addr_2, u32 *dst_addr_3, u32 *dst_addr_4)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1722 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1723 DEBUGFUNC("ixgbe_atr_get_dst_ipv6_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1724
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1725 *dst_addr_1 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 12];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1726 *dst_addr_1 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 13] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1727 *dst_addr_1 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 14] << 16;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1728 *dst_addr_1 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 15] << 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1729
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1730 *dst_addr_2 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 8];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1731 *dst_addr_2 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 9] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1732 *dst_addr_2 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 10] << 16;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1733 *dst_addr_2 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 11] << 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1734
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1735 *dst_addr_3 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 4];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1736 *dst_addr_3 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 5] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1737 *dst_addr_3 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 6] << 16;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1738 *dst_addr_3 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 7] << 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1739
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1740 *dst_addr_4 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1741 *dst_addr_4 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 1] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1742 *dst_addr_4 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 2] << 16;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1743 *dst_addr_4 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 3] << 24;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1744
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1745 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1746 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1747
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1748 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1749 * ixgbe_atr_get_src_port_82599 - Gets the source port
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1750 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1751 * @src_port: the source port to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1752 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1753 * Even though the input is given in big-endian, the FDIRPORT registers
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1754 * expect the ports to be programmed in little-endian. Hence the need to swap
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1755 * endianness when retrieving the data. This can be confusing since the
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1756 * internal hash engine expects it to be big-endian.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1757 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1758 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1759 ixgbe_atr_get_src_port_82599(struct ixgbe_atr_input *input, u16 *src_port)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1760 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1761 DEBUGFUNC("ixgbe_atr_get_src_port_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1762
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1763 *src_port = input->byte_stream[IXGBE_ATR_SRC_PORT_OFFSET] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1764 *src_port |= input->byte_stream[IXGBE_ATR_SRC_PORT_OFFSET + 1];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1765
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1766 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1767 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1768
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1769 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1770 * ixgbe_atr_get_dst_port_82599 - Gets the destination port
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1771 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1772 * @dst_port: the destination port to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1773 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1774 * Even though the input is given in big-endian, the FDIRPORT registers
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1775 * expect the ports to be programmed in little-endian. Hence the need to swap
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1776 * endianness when retrieving the data. This can be confusing since the
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1777 * internal hash engine expects it to be big-endian.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1778 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1779 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1780 ixgbe_atr_get_dst_port_82599(struct ixgbe_atr_input *input, u16 *dst_port)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1781 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1782 DEBUGFUNC("ixgbe_atr_get_dst_port_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1783
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1784 *dst_port = input->byte_stream[IXGBE_ATR_DST_PORT_OFFSET] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1785 *dst_port |= input->byte_stream[IXGBE_ATR_DST_PORT_OFFSET + 1];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1786
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1787 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1788 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1789
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1790 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1791 * ixgbe_atr_get_flex_byte_82599 - Gets the flexible bytes
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1792 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1793 * @flex_bytes: the flexible bytes to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1794 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1795 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1796 ixgbe_atr_get_flex_byte_82599(struct ixgbe_atr_input *input, u16 *flex_byte)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1797 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1798 DEBUGFUNC("ixgbe_atr_get_flex_byte_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1799
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1800 *flex_byte = input->byte_stream[IXGBE_ATR_FLEX_BYTE_OFFSET];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1801 *flex_byte |= input->byte_stream[IXGBE_ATR_FLEX_BYTE_OFFSET + 1] << 8;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1802
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1803 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1804 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1805
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1806 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1807 * ixgbe_atr_get_vm_pool_82599 - Gets the Virtual Machine pool
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1808 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1809 * @vm_pool: the Virtual Machine pool to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1810 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1811 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1812 ixgbe_atr_get_vm_pool_82599(struct ixgbe_atr_input *input, u8 *vm_pool)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1813 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1814 DEBUGFUNC("ixgbe_atr_get_vm_pool_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1815
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1816 *vm_pool = input->byte_stream[IXGBE_ATR_VM_POOL_OFFSET];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1817
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1818 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1819 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1820
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1821 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1822 * ixgbe_atr_get_l4type_82599 - Gets the layer 4 packet type
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1823 * @input: input stream to modify
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1824 * @l4type: the layer 4 type value to load
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1825 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1826 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1827 ixgbe_atr_get_l4type_82599(struct ixgbe_atr_input *input, u8 *l4type)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1828 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1829 DEBUGFUNC("ixgbe_atr_get_l4type__82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1830
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1831 *l4type = input->byte_stream[IXGBE_ATR_L4TYPE_OFFSET];
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1832
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1833 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1834 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1835
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1836 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1837 * ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1838 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1839 * @stream: input bitstream
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1840 * @queue: queue index to direct traffic to
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1841 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1842 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1843 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1844 struct ixgbe_atr_input *input, u8 queue)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1845 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1846 u64 fdirhashcmd;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1847 u64 fdircmd;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1848 u32 fdirhash;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1849 u16 bucket_hash, sig_hash;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1850 u8 l4type;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1851
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1852 DEBUGFUNC("ixgbe_fdir_add_signature_filter_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1853
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1854 bucket_hash = ixgbe_atr_compute_hash_82599(input,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1855 IXGBE_ATR_BUCKET_HASH_KEY);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1856
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1857 /* bucket_hash is only 15 bits */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1858 bucket_hash &= IXGBE_ATR_HASH_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1859
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1860 sig_hash = ixgbe_atr_compute_hash_82599(input,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1861 IXGBE_ATR_SIGNATURE_HASH_KEY);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1862
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1863 /* Get the l4type in order to program FDIRCMD properly */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1864 /* lowest 2 bits are FDIRCMD.L4TYPE, third lowest bit is FDIRCMD.IPV6 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1865 (void) ixgbe_atr_get_l4type_82599(input, &l4type);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1866
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1867 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1868 * The lower 32-bits of fdirhashcmd is for FDIRHASH, the upper 32-bits
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1869 * is for FDIRCMD. Then do a 64-bit register write from FDIRHASH.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1870 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1871 fdirhash = sig_hash << IXGBE_FDIRHASH_SIG_SW_INDEX_SHIFT | bucket_hash;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1872
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1873 fdircmd = (IXGBE_FDIRCMD_CMD_ADD_FLOW | IXGBE_FDIRCMD_FILTER_UPDATE |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1874 IXGBE_FDIRCMD_LAST | IXGBE_FDIRCMD_QUEUE_EN);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1875
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1876 switch (l4type & IXGBE_ATR_L4TYPE_MASK) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1877 case IXGBE_ATR_L4TYPE_TCP:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1878 fdircmd |= IXGBE_FDIRCMD_L4TYPE_TCP;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1879 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1880 case IXGBE_ATR_L4TYPE_UDP:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1881 fdircmd |= IXGBE_FDIRCMD_L4TYPE_UDP;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1882 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1883 case IXGBE_ATR_L4TYPE_SCTP:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1884 fdircmd |= IXGBE_FDIRCMD_L4TYPE_SCTP;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1885 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1886 default:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1887 DEBUGOUT(" Error on l4type input\n");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1888 return (IXGBE_ERR_CONFIG);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1889 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1890
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1891 if (l4type & IXGBE_ATR_L4TYPE_IPV6_MASK)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1892 fdircmd |= IXGBE_FDIRCMD_IPV6;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1893
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1894 fdircmd |= ((u64)queue << IXGBE_FDIRCMD_RX_QUEUE_SHIFT);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1895 fdirhashcmd = ((fdircmd << 32) | fdirhash);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1896
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1897 DEBUGOUT2("Tx Queue=%x hash=%x\n", queue, fdirhash & 0x7FFF7FFF);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1898 IXGBE_WRITE_REG64(hw, IXGBE_FDIRHASH, fdirhashcmd);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1899
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1900 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1901 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1902
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1903 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1904 * ixgbe_fdir_add_perfect_filter_82599 - Adds a perfect filter
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1905 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1906 * @input: input bitstream
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1907 * @queue: queue index to direct traffic to
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1908 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1909 * Note that the caller to this function must lock before calling, since the
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1910 * hardware writes must be protected from one another.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1911 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1912 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1913 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1914 struct ixgbe_atr_input *input, u16 soft_id, u8 queue)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1915 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1916 u32 fdircmd = 0;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1917 u32 fdirhash;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1918 u32 src_ipv4, dst_ipv4;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1919 u32 src_ipv6_1, src_ipv6_2, src_ipv6_3, src_ipv6_4;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1920 u16 src_port, dst_port, vlan_id, flex_bytes;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1921 u16 bucket_hash;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1922 u8 l4type;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1923
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1924 DEBUGFUNC("ixgbe_fdir_add_perfect_filter_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
1925
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1926 /* Get our input values */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1927 (void) ixgbe_atr_get_l4type_82599(input, &l4type);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1928
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1929 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1930 * Check l4type formatting, and bail out before we touch the hardware
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1931 * if there's a configuration issue
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1932 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1933 switch (l4type & IXGBE_ATR_L4TYPE_MASK) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1934 case IXGBE_ATR_L4TYPE_TCP:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1935 fdircmd |= IXGBE_FDIRCMD_L4TYPE_TCP;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1936 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1937 case IXGBE_ATR_L4TYPE_UDP:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1938 fdircmd |= IXGBE_FDIRCMD_L4TYPE_UDP;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1939 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1940 case IXGBE_ATR_L4TYPE_SCTP:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1941 fdircmd |= IXGBE_FDIRCMD_L4TYPE_SCTP;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1942 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1943 default:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1944 DEBUGOUT(" Error on l4type input\n");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1945 return (IXGBE_ERR_CONFIG);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1946 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1947
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1948 bucket_hash = ixgbe_atr_compute_hash_82599(input,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1949 IXGBE_ATR_BUCKET_HASH_KEY);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1950
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1951 /* bucket_hash is only 15 bits */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1952 bucket_hash &= IXGBE_ATR_HASH_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1953
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1954 (void) ixgbe_atr_get_vlan_id_82599(input, &vlan_id);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1955 (void) ixgbe_atr_get_src_port_82599(input, &src_port);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1956 (void) ixgbe_atr_get_dst_port_82599(input, &dst_port);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1957 (void) ixgbe_atr_get_flex_byte_82599(input, &flex_bytes);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1958
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1959 fdirhash = soft_id << IXGBE_FDIRHASH_SIG_SW_INDEX_SHIFT | bucket_hash;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1960
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1961 /* Now figure out if we're IPv4 or IPv6 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1962 if (l4type & IXGBE_ATR_L4TYPE_IPV6_MASK) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1963 /* IPv6 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1964 (void) ixgbe_atr_get_src_ipv6_82599(input, &src_ipv6_1,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1965 &src_ipv6_2, &src_ipv6_3, &src_ipv6_4);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1966
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1967 IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(0), src_ipv6_1);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1968 IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(1), src_ipv6_2);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1969 IXGBE_WRITE_REG(hw, IXGBE_FDIRSIPv6(2), src_ipv6_3);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1970 /* The last 4 bytes is the same register as IPv4 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1971 IXGBE_WRITE_REG(hw, IXGBE_FDIRIPSA, src_ipv6_4);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1972
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1973 fdircmd |= IXGBE_FDIRCMD_IPV6;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1974 fdircmd |= IXGBE_FDIRCMD_IPv6DMATCH;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1975 } else {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1976 /* IPv4 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1977 (void) ixgbe_atr_get_src_ipv4_82599(input, &src_ipv4);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1978 IXGBE_WRITE_REG(hw, IXGBE_FDIRIPSA, src_ipv4);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1979
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1980 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1981
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1982 (void) ixgbe_atr_get_dst_ipv4_82599(input, &dst_ipv4);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1983 IXGBE_WRITE_REG(hw, IXGBE_FDIRIPDA, dst_ipv4);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1984
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1985 IXGBE_WRITE_REG(hw, IXGBE_FDIRVLAN, (vlan_id |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1986 (flex_bytes << IXGBE_FDIRVLAN_FLEX_SHIFT)));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1987 IXGBE_WRITE_REG(hw, IXGBE_FDIRPORT, (src_port |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1988 (dst_port << IXGBE_FDIRPORT_DESTINATION_SHIFT)));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1989
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1990 fdircmd |= IXGBE_FDIRCMD_CMD_ADD_FLOW;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1991 fdircmd |= IXGBE_FDIRCMD_FILTER_UPDATE;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1992 fdircmd |= IXGBE_FDIRCMD_LAST;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1993 fdircmd |= IXGBE_FDIRCMD_QUEUE_EN;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1994 fdircmd |= queue << IXGBE_FDIRCMD_RX_QUEUE_SHIFT;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1995
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1996 IXGBE_WRITE_REG(hw, IXGBE_FDIRHASH, fdirhash);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1997 IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, fdircmd);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1998
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
1999 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2000 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2001
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2002 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2003 * ixgbe_read_analog_reg8_82599 - Reads 8 bit Omer analog register
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2004 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2005 * @reg: analog register to read
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2006 * @val: read value
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2007 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2008 * Performs read operation to Omer analog register specified.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2009 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2010 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2011 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2012 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2013 u32 core_ctl;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2014
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2015 DEBUGFUNC("ixgbe_read_analog_reg8_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2016
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2017 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, IXGBE_CORECTL_WRITE_CMD |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2018 (reg << 8));
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2019 IXGBE_WRITE_FLUSH(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2020 usec_delay(10);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2021 core_ctl = IXGBE_READ_REG(hw, IXGBE_CORECTL);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2022 *val = (u8)core_ctl;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2023
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2024 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2025 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2026
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2027 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2028 * ixgbe_write_analog_reg8_82599 - Writes 8 bit Omer analog register
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2029 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2030 * @reg: atlas register to write
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2031 * @val: value to write
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2032 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2033 * Performs write operation to Omer analog register specified.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2034 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2035 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2036 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2037 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2038 u32 core_ctl;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2039
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2040 DEBUGFUNC("ixgbe_write_analog_reg8_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2041
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2042 core_ctl = (reg << 8) | val;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2043 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, core_ctl);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2044 IXGBE_WRITE_FLUSH(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2045 usec_delay(10);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2046
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2047 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2048 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2049
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2050 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2051 * ixgbe_start_hw_rev_1_82599 - Prepare hardware for Tx/Rx
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2052 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2053 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2054 * Starts the hardware using the generic start_hw function.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2055 * Then performs revision-specific operations:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2056 * Clears the rate limiter registers.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2057 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2058 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2059 ixgbe_start_hw_rev_1_82599(struct ixgbe_hw *hw)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2060 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2061 u32 i;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2062 s32 ret_val = IXGBE_SUCCESS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2063
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2064 DEBUGFUNC("ixgbe_start_hw_rev_1__82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2065
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2066 ret_val = ixgbe_start_hw_generic(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2067
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2068 /* Clear the rate limiters */
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2069 for (i = 0; i < hw->mac.max_tx_queues; i++) {
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2070 IXGBE_WRITE_REG(hw, IXGBE_RTTDQSEL, i);
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2071 IXGBE_WRITE_REG(hw, IXGBE_RTTBCNRC, 0);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2072 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2073 IXGBE_WRITE_FLUSH(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2074
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2075 /* We need to run link autotry after the driver loads */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2076 hw->mac.autotry_restart = true;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2077
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2078 if (ret_val == IXGBE_SUCCESS)
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2079 ret_val = ixgbe_verify_fw_version_82599(hw);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2080
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2081 return (ret_val);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2082 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2083
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2084 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2085 * ixgbe_identify_phy_82599 - Get physical layer module
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2086 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2087 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2088 * Determines the physical layer module found on the current adapter.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2089 * If PHY already detected, maintains current PHY type in hw struct,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2090 * otherwise executes the PHY detection routine.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2091 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2092 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2093 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2094 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2095 s32 status = IXGBE_ERR_PHY_ADDR_INVALID;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2096
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2097 DEBUGFUNC("ixgbe_identify_phy_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2098
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2099 /* Detect PHY if not unknown - returns success if already detected. */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2100 status = ixgbe_identify_phy_generic(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2101 if (status != IXGBE_SUCCESS)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2102 status = ixgbe_identify_sfp_module_generic(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2103 /* Set PHY type none if no PHY detected */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2104 if (hw->phy.type == ixgbe_phy_unknown) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2105 hw->phy.type = ixgbe_phy_none;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2106 status = IXGBE_SUCCESS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2107 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2108
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2109 /* Return error if SFP module has been detected but is not supported */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2110 if (hw->phy.type == ixgbe_phy_sfp_unsupported)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2111 status = IXGBE_ERR_SFP_NOT_SUPPORTED;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2112
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2113 return (status);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2114 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2115
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2116 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2117 * ixgbe_get_supported_physical_layer_82599 - Returns physical layer type
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2118 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2119 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2120 * Determines physical layer capabilities of the current configuration.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2121 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2122 u32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2123 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2124 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2125 u32 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2126 u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2127 u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2128 u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2129 u32 pma_pmd_10g_parallel = autoc & IXGBE_AUTOC_10G_PMA_PMD_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2130 u32 pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2131 u16 ext_ability = 0;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2132 u8 comp_codes_10g = 0;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2133
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2134 DEBUGFUNC("ixgbe_get_support_physical_layer_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2135
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2136 hw->phy.ops.identify(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2137
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2138 if (hw->phy.type == ixgbe_phy_tn ||
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2139 hw->phy.type == ixgbe_phy_aq ||
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2140 hw->phy.type == ixgbe_phy_cu_unknown) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2141 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2142 IXGBE_MDIO_PMA_PMD_DEV_TYPE, &ext_ability);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2143 if (ext_ability & IXGBE_MDIO_PHY_10GBASET_ABILITY)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2144 physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2145 if (ext_ability & IXGBE_MDIO_PHY_1000BASET_ABILITY)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2146 physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2147 if (ext_ability & IXGBE_MDIO_PHY_100BASETX_ABILITY)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2148 physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2149 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2150 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2151
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2152 switch (autoc & IXGBE_AUTOC_LMS_MASK) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2153 case IXGBE_AUTOC_LMS_1G_AN:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2154 case IXGBE_AUTOC_LMS_1G_LINK_NO_AN:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2155 if (pma_pmd_1g == IXGBE_AUTOC_1G_KX_BX) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2156 physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX |
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2157 IXGBE_PHYSICAL_LAYER_1000BASE_BX;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2158 goto out;
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2159 } else {
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2160 /* SFI mode so read SFP module */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2161 goto sfp_check;
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2162 }
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2163 case IXGBE_AUTOC_LMS_10G_LINK_NO_AN:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2164 if (pma_pmd_10g_parallel == IXGBE_AUTOC_10G_CX4)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2165 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_CX4;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2166 else if (pma_pmd_10g_parallel == IXGBE_AUTOC_10G_KX4)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2167 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KX4;
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2168 else if (pma_pmd_10g_parallel == IXGBE_AUTOC_10G_XAUI)
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2169 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_XAUI;
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2170 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2171 case IXGBE_AUTOC_LMS_10G_SERIAL:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2172 if (pma_pmd_10g_serial == IXGBE_AUTOC2_10G_KR) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2173 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KR;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2174 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2175 } else if (pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2176 goto sfp_check;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2177 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2178 case IXGBE_AUTOC_LMS_KX4_KX_KR:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2179 case IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2180 if (autoc & IXGBE_AUTOC_KX_SUPP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2181 physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_KX;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2182 if (autoc & IXGBE_AUTOC_KX4_SUPP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2183 physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_KX4;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2184 if (autoc & IXGBE_AUTOC_KR_SUPP)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2185 physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_KR;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2186 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2187 default:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2188 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2189 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2190
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2191 sfp_check:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2192 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2193 * SFP check must be done last since DA modules are sometimes used to
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2194 * test KR mode - we need to id KR mode correctly before SFP module.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2195 * Call identify_sfp because the pluggable module may have changed
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2196 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2197 hw->phy.ops.identify_sfp(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2198 if (hw->phy.sfp_type == ixgbe_sfp_type_not_present)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2199 goto out;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2200
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2201 switch (hw->phy.type) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2202 case ixgbe_phy_tw_tyco:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2203 case ixgbe_phy_tw_unknown:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2204 physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2205 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2206 case ixgbe_phy_sfp_avago:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2207 case ixgbe_phy_sfp_ftl:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2208 case ixgbe_phy_sfp_intel:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2209 case ixgbe_phy_sfp_unknown:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2210 hw->phy.ops.read_i2c_eeprom(hw,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2211 IXGBE_SFF_10GBE_COMP_CODES, &comp_codes_10g);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2212 if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2213 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2214 else if (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2215 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2216 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2217 default:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2218 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2219 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2220
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2221 out:
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2222 return (physical_layer);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2223 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2224
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2225 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2226 * ixgbe_enable_rx_dma_82599 - Enable the Rx DMA unit on 82599
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2227 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2228 * @regval: register value to write to RXCTRL
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2229 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2230 * Enables the Rx DMA unit for 82599
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2231 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2232 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2233 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2234 {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2235 #define IXGBE_MAX_SECRX_POLL 30
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2236 int i;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2237 int secrxreg;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2238
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2239 DEBUGFUNC("ixgbe_enable_rx_dma_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2240
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2241 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2242 * Workaround for 82599 silicon errata when enabling the Rx datapath.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2243 * If traffic is incoming before we enable the Rx unit, it could hang
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2244 * the Rx DMA unit. Therefore, make sure the security engine is
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2245 * completely disabled prior to enabling the Rx unit.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2246 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2247 secrxreg = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2248 secrxreg |= IXGBE_SECRXCTRL_RX_DIS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2249 IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, secrxreg);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2250 for (i = 0; i < IXGBE_MAX_SECRX_POLL; i++) {
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2251 secrxreg = IXGBE_READ_REG(hw, IXGBE_SECRXSTAT);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2252 if (secrxreg & IXGBE_SECRXSTAT_SECRX_RDY)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2253 break;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2254 else
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2255 /* Use interrupt-safe sleep just in case */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2256 usec_delay(10);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2257 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2258
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2259 /* For informational purposes only */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2260 if (i >= IXGBE_MAX_SECRX_POLL)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2261 DEBUGOUT("Rx unit being enabled before security "
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2262 "path fully disabled. Continuing with init.\n");
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2263
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2264 IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, regval);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2265 secrxreg = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2266 secrxreg &= ~IXGBE_SECRXCTRL_RX_DIS;
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2267 IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, secrxreg);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2268 IXGBE_WRITE_FLUSH(hw);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2269
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2270 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2271 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2272
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2273 /*
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2274 * ixgbe_get_device_caps_82599 - Get additional device capabilities
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2275 * @hw: pointer to hardware structure
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2276 * @device_caps: the EEPROM word with the extra device capabilities
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2277 *
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2278 * This function will read the EEPROM location for the device capabilities,
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2279 * and return the word through device_caps.
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2280 */
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2281 s32
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2282 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps)
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2283 {
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2284 DEBUGFUNC("ixgbe_get_device_caps_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2285
9353
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2286 hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2287
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2288 return (IXGBE_SUCCESS);
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2289 }
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2290
b9caf92a0042 6708311 ixgbe needs to support the new device Niantic
Bin Tu - Sun Microsystems - Beijing China <Samuel.Tu@Sun.COM>
parents:
diff changeset
2291 /*
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2292 * ixgbe_verify_fw_version_82599 - verify fw version for 82599
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2293 * @hw: pointer to hardware structure
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2294 *
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2295 * Verifies that installed the firmware version is 0.6 or higher
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2296 * for SFI devices. All 82599 SFI devices should have version 0.6 or higher.
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2297 *
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2298 * Returns IXGBE_ERR_EEPROM_VERSION if the FW is not present or
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2299 * if the FW version is not supported.
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2300 */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2301 static s32
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2302 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw)
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2303 {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2304 s32 status = IXGBE_ERR_EEPROM_VERSION;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2305 u16 fw_offset, fw_ptp_cfg_offset;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2306 u16 fw_version = 0;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2307
10998
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2308 DEBUGFUNC("ixgbe_verify_fw_version_82599");
fa3b21f3b03c 6873301 ixgbe shared code update (version 3.1.9)
chenlu chen - Sun Microsystems - Beijing China <Chenlu.Chen@Sun.COM>
parents: 10305
diff changeset
2309
10305
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2310 /* firmware check is only necessary for SFI devices */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2311 if (hw->phy.media_type != ixgbe_media_type_fiber) {
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2312 status = IXGBE_SUCCESS;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2313 goto fw_version_out;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2314 }
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2315
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2316 /* get the offset to the Firmware Module block */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2317 hw->eeprom.ops.read(hw, IXGBE_FW_PTR, &fw_offset);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2318
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2319 if ((fw_offset == 0) || (fw_offset == 0xFFFF))
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2320 goto fw_version_out;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2321
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2322 /* get the offset to the Pass Through Patch Configuration block */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2323 hw->eeprom.ops.read(hw, (fw_offset +
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2324 IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR), &fw_ptp_cfg_offset);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2325
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2326 if ((fw_ptp_cfg_offset == 0) || (fw_ptp_cfg_offset == 0xFFFF))
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2327 goto fw_version_out;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2328
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2329 /* get the firmware version */
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2330 hw->eeprom.ops.read(hw, (fw_ptp_cfg_offset + IXGBE_FW_PATCH_VERSION_4),
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2331 &fw_version);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2332
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2333 if (fw_version > 0x5)
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2334 status = IXGBE_SUCCESS;
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2335
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2336 fw_version_out:
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2337 return (status);
f6df05de8700 6848306 ixgbe need to update the latest shared code (2.9.1.1) from Intel
Paul Guo <Paul.Guo@Sun.COM>
parents: 9353
diff changeset
2338 }