diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_82599.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82599.c | 418 |
1 files changed, 23 insertions, 395 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index 12fc0e7ba2ca..e9706eb8e4ff 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -133,27 +133,6 @@ setup_sfp_out: | |||
133 | return ret_val; | 133 | return ret_val; |
134 | } | 134 | } |
135 | 135 | ||
136 | /** | ||
137 | * ixgbe_get_pcie_msix_count_82599 - Gets MSI-X vector count | ||
138 | * @hw: pointer to hardware structure | ||
139 | * | ||
140 | * Read PCIe configuration space, and get the MSI-X vector count from | ||
141 | * the capabilities table. | ||
142 | **/ | ||
143 | static u32 ixgbe_get_pcie_msix_count_82599(struct ixgbe_hw *hw) | ||
144 | { | ||
145 | struct ixgbe_adapter *adapter = hw->back; | ||
146 | u16 msix_count; | ||
147 | pci_read_config_word(adapter->pdev, IXGBE_PCIE_MSIX_82599_CAPS, | ||
148 | &msix_count); | ||
149 | msix_count &= IXGBE_PCIE_MSIX_TBL_SZ_MASK; | ||
150 | |||
151 | /* MSI-X count is zero-based in HW, so increment to give proper value */ | ||
152 | msix_count++; | ||
153 | |||
154 | return msix_count; | ||
155 | } | ||
156 | |||
157 | static s32 ixgbe_get_invariants_82599(struct ixgbe_hw *hw) | 136 | static s32 ixgbe_get_invariants_82599(struct ixgbe_hw *hw) |
158 | { | 137 | { |
159 | struct ixgbe_mac_info *mac = &hw->mac; | 138 | struct ixgbe_mac_info *mac = &hw->mac; |
@@ -165,7 +144,7 @@ static s32 ixgbe_get_invariants_82599(struct ixgbe_hw *hw) | |||
165 | mac->num_rar_entries = IXGBE_82599_RAR_ENTRIES; | 144 | mac->num_rar_entries = IXGBE_82599_RAR_ENTRIES; |
166 | mac->max_rx_queues = IXGBE_82599_MAX_RX_QUEUES; | 145 | mac->max_rx_queues = IXGBE_82599_MAX_RX_QUEUES; |
167 | mac->max_tx_queues = IXGBE_82599_MAX_TX_QUEUES; | 146 | mac->max_tx_queues = IXGBE_82599_MAX_TX_QUEUES; |
168 | mac->max_msix_vectors = ixgbe_get_pcie_msix_count_82599(hw); | 147 | mac->max_msix_vectors = ixgbe_get_pcie_msix_count_generic(hw); |
169 | 148 | ||
170 | return 0; | 149 | return 0; |
171 | } | 150 | } |
@@ -642,6 +621,7 @@ static s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw, | |||
642 | s32 i, j; | 621 | s32 i, j; |
643 | bool link_up = false; | 622 | bool link_up = false; |
644 | u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); | 623 | u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); |
624 | struct ixgbe_adapter *adapter = hw->back; | ||
645 | 625 | ||
646 | hw_dbg(hw, "ixgbe_setup_mac_link_smartspeed.\n"); | 626 | hw_dbg(hw, "ixgbe_setup_mac_link_smartspeed.\n"); |
647 | 627 | ||
@@ -726,64 +706,14 @@ static s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw, | |||
726 | autoneg_wait_to_complete); | 706 | autoneg_wait_to_complete); |
727 | 707 | ||
728 | out: | 708 | out: |
709 | if (link_up && (link_speed == IXGBE_LINK_SPEED_1GB_FULL)) | ||
710 | netif_info(adapter, hw, adapter->netdev, "Smartspeed has" | ||
711 | " downgraded the link speed from the maximum" | ||
712 | " advertised\n"); | ||
729 | return status; | 713 | return status; |
730 | } | 714 | } |
731 | 715 | ||
732 | /** | 716 | /** |
733 | * ixgbe_check_mac_link_82599 - Determine link and speed status | ||
734 | * @hw: pointer to hardware structure | ||
735 | * @speed: pointer to link speed | ||
736 | * @link_up: true when link is up | ||
737 | * @link_up_wait_to_complete: bool used to wait for link up or not | ||
738 | * | ||
739 | * Reads the links register to determine if link is up and the current speed | ||
740 | **/ | ||
741 | static s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw, | ||
742 | ixgbe_link_speed *speed, | ||
743 | bool *link_up, | ||
744 | bool link_up_wait_to_complete) | ||
745 | { | ||
746 | u32 links_reg; | ||
747 | u32 i; | ||
748 | |||
749 | links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); | ||
750 | if (link_up_wait_to_complete) { | ||
751 | for (i = 0; i < IXGBE_LINK_UP_TIME; i++) { | ||
752 | if (links_reg & IXGBE_LINKS_UP) { | ||
753 | *link_up = true; | ||
754 | break; | ||
755 | } else { | ||
756 | *link_up = false; | ||
757 | } | ||
758 | msleep(100); | ||
759 | links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); | ||
760 | } | ||
761 | } else { | ||
762 | if (links_reg & IXGBE_LINKS_UP) | ||
763 | *link_up = true; | ||
764 | else | ||
765 | *link_up = false; | ||
766 | } | ||
767 | |||
768 | if ((links_reg & IXGBE_LINKS_SPEED_82599) == | ||
769 | IXGBE_LINKS_SPEED_10G_82599) | ||
770 | *speed = IXGBE_LINK_SPEED_10GB_FULL; | ||
771 | else if ((links_reg & IXGBE_LINKS_SPEED_82599) == | ||
772 | IXGBE_LINKS_SPEED_1G_82599) | ||
773 | *speed = IXGBE_LINK_SPEED_1GB_FULL; | ||
774 | else | ||
775 | *speed = IXGBE_LINK_SPEED_100_FULL; | ||
776 | |||
777 | /* if link is down, zero out the current_mode */ | ||
778 | if (*link_up == false) { | ||
779 | hw->fc.current_mode = ixgbe_fc_none; | ||
780 | hw->fc.fc_was_autonegged = false; | ||
781 | } | ||
782 | |||
783 | return 0; | ||
784 | } | ||
785 | |||
786 | /** | ||
787 | * ixgbe_setup_mac_link_82599 - Set MAC link speed | 717 | * ixgbe_setup_mac_link_82599 - Set MAC link speed |
788 | * @hw: pointer to hardware structure | 718 | * @hw: pointer to hardware structure |
789 | * @speed: new link speed | 719 | * @speed: new link speed |
@@ -1045,243 +975,6 @@ reset_hw_out: | |||
1045 | } | 975 | } |
1046 | 976 | ||
1047 | /** | 977 | /** |
1048 | * ixgbe_clear_vmdq_82599 - Disassociate a VMDq pool index from a rx address | ||
1049 | * @hw: pointer to hardware struct | ||
1050 | * @rar: receive address register index to disassociate | ||
1051 | * @vmdq: VMDq pool index to remove from the rar | ||
1052 | **/ | ||
1053 | static s32 ixgbe_clear_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq) | ||
1054 | { | ||
1055 | u32 mpsar_lo, mpsar_hi; | ||
1056 | u32 rar_entries = hw->mac.num_rar_entries; | ||
1057 | |||
1058 | if (rar < rar_entries) { | ||
1059 | mpsar_lo = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar)); | ||
1060 | mpsar_hi = IXGBE_READ_REG(hw, IXGBE_MPSAR_HI(rar)); | ||
1061 | |||
1062 | if (!mpsar_lo && !mpsar_hi) | ||
1063 | goto done; | ||
1064 | |||
1065 | if (vmdq == IXGBE_CLEAR_VMDQ_ALL) { | ||
1066 | if (mpsar_lo) { | ||
1067 | IXGBE_WRITE_REG(hw, IXGBE_MPSAR_LO(rar), 0); | ||
1068 | mpsar_lo = 0; | ||
1069 | } | ||
1070 | if (mpsar_hi) { | ||
1071 | IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), 0); | ||
1072 | mpsar_hi = 0; | ||
1073 | } | ||
1074 | } else if (vmdq < 32) { | ||
1075 | mpsar_lo &= ~(1 << vmdq); | ||
1076 | IXGBE_WRITE_REG(hw, IXGBE_MPSAR_LO(rar), mpsar_lo); | ||
1077 | } else { | ||
1078 | mpsar_hi &= ~(1 << (vmdq - 32)); | ||
1079 | IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), mpsar_hi); | ||
1080 | } | ||
1081 | |||
1082 | /* was that the last pool using this rar? */ | ||
1083 | if (mpsar_lo == 0 && mpsar_hi == 0 && rar != 0) | ||
1084 | hw->mac.ops.clear_rar(hw, rar); | ||
1085 | } else { | ||
1086 | hw_dbg(hw, "RAR index %d is out of range.\n", rar); | ||
1087 | } | ||
1088 | |||
1089 | done: | ||
1090 | return 0; | ||
1091 | } | ||
1092 | |||
1093 | /** | ||
1094 | * ixgbe_set_vmdq_82599 - Associate a VMDq pool index with a rx address | ||
1095 | * @hw: pointer to hardware struct | ||
1096 | * @rar: receive address register index to associate with a VMDq index | ||
1097 | * @vmdq: VMDq pool index | ||
1098 | **/ | ||
1099 | static s32 ixgbe_set_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq) | ||
1100 | { | ||
1101 | u32 mpsar; | ||
1102 | u32 rar_entries = hw->mac.num_rar_entries; | ||
1103 | |||
1104 | if (rar < rar_entries) { | ||
1105 | if (vmdq < 32) { | ||
1106 | mpsar = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar)); | ||
1107 | mpsar |= 1 << vmdq; | ||
1108 | IXGBE_WRITE_REG(hw, IXGBE_MPSAR_LO(rar), mpsar); | ||
1109 | } else { | ||
1110 | mpsar = IXGBE_READ_REG(hw, IXGBE_MPSAR_HI(rar)); | ||
1111 | mpsar |= 1 << (vmdq - 32); | ||
1112 | IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), mpsar); | ||
1113 | } | ||
1114 | } else { | ||
1115 | hw_dbg(hw, "RAR index %d is out of range.\n", rar); | ||
1116 | } | ||
1117 | return 0; | ||
1118 | } | ||
1119 | |||
1120 | /** | ||
1121 | * ixgbe_set_vfta_82599 - Set VLAN filter table | ||
1122 | * @hw: pointer to hardware structure | ||
1123 | * @vlan: VLAN id to write to VLAN filter | ||
1124 | * @vind: VMDq output index that maps queue to VLAN id in VFVFB | ||
1125 | * @vlan_on: boolean flag to turn on/off VLAN in VFVF | ||
1126 | * | ||
1127 | * Turn on/off specified VLAN in the VLAN filter table. | ||
1128 | **/ | ||
1129 | static s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan, u32 vind, | ||
1130 | bool vlan_on) | ||
1131 | { | ||
1132 | u32 regindex; | ||
1133 | u32 vlvf_index; | ||
1134 | u32 bitindex; | ||
1135 | u32 bits; | ||
1136 | u32 first_empty_slot; | ||
1137 | u32 vt_ctl; | ||
1138 | |||
1139 | if (vlan > 4095) | ||
1140 | return IXGBE_ERR_PARAM; | ||
1141 | |||
1142 | /* | ||
1143 | * this is a 2 part operation - first the VFTA, then the | ||
1144 | * VLVF and VLVFB if vind is set | ||
1145 | */ | ||
1146 | |||
1147 | /* Part 1 | ||
1148 | * The VFTA is a bitstring made up of 128 32-bit registers | ||
1149 | * that enable the particular VLAN id, much like the MTA: | ||
1150 | * bits[11-5]: which register | ||
1151 | * bits[4-0]: which bit in the register | ||
1152 | */ | ||
1153 | regindex = (vlan >> 5) & 0x7F; | ||
1154 | bitindex = vlan & 0x1F; | ||
1155 | bits = IXGBE_READ_REG(hw, IXGBE_VFTA(regindex)); | ||
1156 | if (vlan_on) | ||
1157 | bits |= (1 << bitindex); | ||
1158 | else | ||
1159 | bits &= ~(1 << bitindex); | ||
1160 | IXGBE_WRITE_REG(hw, IXGBE_VFTA(regindex), bits); | ||
1161 | |||
1162 | |||
1163 | /* Part 2 | ||
1164 | * If VT mode is set | ||
1165 | * Either vlan_on | ||
1166 | * make sure the vlan is in VLVF | ||
1167 | * set the vind bit in the matching VLVFB | ||
1168 | * Or !vlan_on | ||
1169 | * clear the pool bit and possibly the vind | ||
1170 | */ | ||
1171 | vt_ctl = IXGBE_READ_REG(hw, IXGBE_VT_CTL); | ||
1172 | if (!(vt_ctl & IXGBE_VT_CTL_VT_ENABLE)) | ||
1173 | goto out; | ||
1174 | |||
1175 | /* find the vlanid or the first empty slot */ | ||
1176 | first_empty_slot = 0; | ||
1177 | |||
1178 | for (vlvf_index = 1; vlvf_index < IXGBE_VLVF_ENTRIES; vlvf_index++) { | ||
1179 | bits = IXGBE_READ_REG(hw, IXGBE_VLVF(vlvf_index)); | ||
1180 | if (!bits && !first_empty_slot) | ||
1181 | first_empty_slot = vlvf_index; | ||
1182 | else if ((bits & 0x0FFF) == vlan) | ||
1183 | break; | ||
1184 | } | ||
1185 | |||
1186 | if (vlvf_index >= IXGBE_VLVF_ENTRIES) { | ||
1187 | if (first_empty_slot) | ||
1188 | vlvf_index = first_empty_slot; | ||
1189 | else { | ||
1190 | hw_dbg(hw, "No space in VLVF.\n"); | ||
1191 | goto out; | ||
1192 | } | ||
1193 | } | ||
1194 | |||
1195 | if (vlan_on) { | ||
1196 | /* set the pool bit */ | ||
1197 | if (vind < 32) { | ||
1198 | bits = IXGBE_READ_REG(hw, | ||
1199 | IXGBE_VLVFB(vlvf_index * 2)); | ||
1200 | bits |= (1 << vind); | ||
1201 | IXGBE_WRITE_REG(hw, | ||
1202 | IXGBE_VLVFB(vlvf_index * 2), bits); | ||
1203 | } else { | ||
1204 | bits = IXGBE_READ_REG(hw, | ||
1205 | IXGBE_VLVFB((vlvf_index * 2) + 1)); | ||
1206 | bits |= (1 << (vind - 32)); | ||
1207 | IXGBE_WRITE_REG(hw, | ||
1208 | IXGBE_VLVFB((vlvf_index * 2) + 1), bits); | ||
1209 | } | ||
1210 | } else { | ||
1211 | /* clear the pool bit */ | ||
1212 | if (vind < 32) { | ||
1213 | bits = IXGBE_READ_REG(hw, | ||
1214 | IXGBE_VLVFB(vlvf_index * 2)); | ||
1215 | bits &= ~(1 << vind); | ||
1216 | IXGBE_WRITE_REG(hw, | ||
1217 | IXGBE_VLVFB(vlvf_index * 2), bits); | ||
1218 | bits |= IXGBE_READ_REG(hw, | ||
1219 | IXGBE_VLVFB((vlvf_index * 2) + 1)); | ||
1220 | } else { | ||
1221 | bits = IXGBE_READ_REG(hw, | ||
1222 | IXGBE_VLVFB((vlvf_index * 2) + 1)); | ||
1223 | bits &= ~(1 << (vind - 32)); | ||
1224 | IXGBE_WRITE_REG(hw, | ||
1225 | IXGBE_VLVFB((vlvf_index * 2) + 1), bits); | ||
1226 | bits |= IXGBE_READ_REG(hw, | ||
1227 | IXGBE_VLVFB(vlvf_index * 2)); | ||
1228 | } | ||
1229 | } | ||
1230 | |||
1231 | if (bits) { | ||
1232 | IXGBE_WRITE_REG(hw, IXGBE_VLVF(vlvf_index), | ||
1233 | (IXGBE_VLVF_VIEN | vlan)); | ||
1234 | /* if bits is non-zero then some pools/VFs are still | ||
1235 | * using this VLAN ID. Force the VFTA entry to on */ | ||
1236 | bits = IXGBE_READ_REG(hw, IXGBE_VFTA(regindex)); | ||
1237 | bits |= (1 << bitindex); | ||
1238 | IXGBE_WRITE_REG(hw, IXGBE_VFTA(regindex), bits); | ||
1239 | } | ||
1240 | else | ||
1241 | IXGBE_WRITE_REG(hw, IXGBE_VLVF(vlvf_index), 0); | ||
1242 | |||
1243 | out: | ||
1244 | return 0; | ||
1245 | } | ||
1246 | |||
1247 | /** | ||
1248 | * ixgbe_clear_vfta_82599 - Clear VLAN filter table | ||
1249 | * @hw: pointer to hardware structure | ||
1250 | * | ||
1251 | * Clears the VLAN filer table, and the VMDq index associated with the filter | ||
1252 | **/ | ||
1253 | static s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw) | ||
1254 | { | ||
1255 | u32 offset; | ||
1256 | |||
1257 | for (offset = 0; offset < hw->mac.vft_size; offset++) | ||
1258 | IXGBE_WRITE_REG(hw, IXGBE_VFTA(offset), 0); | ||
1259 | |||
1260 | for (offset = 0; offset < IXGBE_VLVF_ENTRIES; offset++) { | ||
1261 | IXGBE_WRITE_REG(hw, IXGBE_VLVF(offset), 0); | ||
1262 | IXGBE_WRITE_REG(hw, IXGBE_VLVFB(offset * 2), 0); | ||
1263 | IXGBE_WRITE_REG(hw, IXGBE_VLVFB((offset * 2) + 1), 0); | ||
1264 | } | ||
1265 | |||
1266 | return 0; | ||
1267 | } | ||
1268 | |||
1269 | /** | ||
1270 | * ixgbe_init_uta_tables_82599 - Initialize the Unicast Table Array | ||
1271 | * @hw: pointer to hardware structure | ||
1272 | **/ | ||
1273 | static s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw) | ||
1274 | { | ||
1275 | int i; | ||
1276 | hw_dbg(hw, " Clearing UTA\n"); | ||
1277 | |||
1278 | for (i = 0; i < 128; i++) | ||
1279 | IXGBE_WRITE_REG(hw, IXGBE_UTA(i), 0); | ||
1280 | |||
1281 | return 0; | ||
1282 | } | ||
1283 | |||
1284 | /** | ||
1285 | * ixgbe_reinit_fdir_tables_82599 - Reinitialize Flow Director tables. | 978 | * ixgbe_reinit_fdir_tables_82599 - Reinitialize Flow Director tables. |
1286 | * @hw: pointer to hardware structure | 979 | * @hw: pointer to hardware structure |
1287 | **/ | 980 | **/ |
@@ -1303,7 +996,7 @@ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw) | |||
1303 | } | 996 | } |
1304 | if (i >= IXGBE_FDIRCMD_CMD_POLL) { | 997 | if (i >= IXGBE_FDIRCMD_CMD_POLL) { |
1305 | hw_dbg(hw ,"Flow Director previous command isn't complete, " | 998 | hw_dbg(hw ,"Flow Director previous command isn't complete, " |
1306 | "aborting table re-initialization. \n"); | 999 | "aborting table re-initialization.\n"); |
1307 | return IXGBE_ERR_FDIR_REINIT_FAILED; | 1000 | return IXGBE_ERR_FDIR_REINIT_FAILED; |
1308 | } | 1001 | } |
1309 | 1002 | ||
@@ -2462,10 +2155,14 @@ sfp_check: | |||
2462 | goto out; | 2155 | goto out; |
2463 | 2156 | ||
2464 | switch (hw->phy.type) { | 2157 | switch (hw->phy.type) { |
2465 | case ixgbe_phy_tw_tyco: | 2158 | case ixgbe_phy_sfp_passive_tyco: |
2466 | case ixgbe_phy_tw_unknown: | 2159 | case ixgbe_phy_sfp_passive_unknown: |
2467 | physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU; | 2160 | physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU; |
2468 | break; | 2161 | break; |
2162 | case ixgbe_phy_sfp_ftl_active: | ||
2163 | case ixgbe_phy_sfp_active_unknown: | ||
2164 | physical_layer = IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA; | ||
2165 | break; | ||
2469 | case ixgbe_phy_sfp_avago: | 2166 | case ixgbe_phy_sfp_avago: |
2470 | case ixgbe_phy_sfp_ftl: | 2167 | case ixgbe_phy_sfp_ftl: |
2471 | case ixgbe_phy_sfp_intel: | 2168 | case ixgbe_phy_sfp_intel: |
@@ -2545,75 +2242,6 @@ static s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps) | |||
2545 | } | 2242 | } |
2546 | 2243 | ||
2547 | /** | 2244 | /** |
2548 | * ixgbe_get_san_mac_addr_offset_82599 - SAN MAC address offset for 82599 | ||
2549 | * @hw: pointer to hardware structure | ||
2550 | * @san_mac_offset: SAN MAC address offset | ||
2551 | * | ||
2552 | * This function will read the EEPROM location for the SAN MAC address | ||
2553 | * pointer, and returns the value at that location. This is used in both | ||
2554 | * get and set mac_addr routines. | ||
2555 | **/ | ||
2556 | static s32 ixgbe_get_san_mac_addr_offset_82599(struct ixgbe_hw *hw, | ||
2557 | u16 *san_mac_offset) | ||
2558 | { | ||
2559 | /* | ||
2560 | * First read the EEPROM pointer to see if the MAC addresses are | ||
2561 | * available. | ||
2562 | */ | ||
2563 | hw->eeprom.ops.read(hw, IXGBE_SAN_MAC_ADDR_PTR, san_mac_offset); | ||
2564 | |||
2565 | return 0; | ||
2566 | } | ||
2567 | |||
2568 | /** | ||
2569 | * ixgbe_get_san_mac_addr_82599 - SAN MAC address retrieval for 82599 | ||
2570 | * @hw: pointer to hardware structure | ||
2571 | * @san_mac_addr: SAN MAC address | ||
2572 | * | ||
2573 | * Reads the SAN MAC address from the EEPROM, if it's available. This is | ||
2574 | * per-port, so set_lan_id() must be called before reading the addresses. | ||
2575 | * set_lan_id() is called by identify_sfp(), but this cannot be relied | ||
2576 | * upon for non-SFP connections, so we must call it here. | ||
2577 | **/ | ||
2578 | static s32 ixgbe_get_san_mac_addr_82599(struct ixgbe_hw *hw, u8 *san_mac_addr) | ||
2579 | { | ||
2580 | u16 san_mac_data, san_mac_offset; | ||
2581 | u8 i; | ||
2582 | |||
2583 | /* | ||
2584 | * First read the EEPROM pointer to see if the MAC addresses are | ||
2585 | * available. If they're not, no point in calling set_lan_id() here. | ||
2586 | */ | ||
2587 | ixgbe_get_san_mac_addr_offset_82599(hw, &san_mac_offset); | ||
2588 | |||
2589 | if ((san_mac_offset == 0) || (san_mac_offset == 0xFFFF)) { | ||
2590 | /* | ||
2591 | * No addresses available in this EEPROM. It's not an | ||
2592 | * error though, so just wipe the local address and return. | ||
2593 | */ | ||
2594 | for (i = 0; i < 6; i++) | ||
2595 | san_mac_addr[i] = 0xFF; | ||
2596 | |||
2597 | goto san_mac_addr_out; | ||
2598 | } | ||
2599 | |||
2600 | /* make sure we know which port we need to program */ | ||
2601 | hw->mac.ops.set_lan_id(hw); | ||
2602 | /* apply the port offset to the address offset */ | ||
2603 | (hw->bus.func) ? (san_mac_offset += IXGBE_SAN_MAC_ADDR_PORT1_OFFSET) : | ||
2604 | (san_mac_offset += IXGBE_SAN_MAC_ADDR_PORT0_OFFSET); | ||
2605 | for (i = 0; i < 3; i++) { | ||
2606 | hw->eeprom.ops.read(hw, san_mac_offset, &san_mac_data); | ||
2607 | san_mac_addr[i * 2] = (u8)(san_mac_data); | ||
2608 | san_mac_addr[i * 2 + 1] = (u8)(san_mac_data >> 8); | ||
2609 | san_mac_offset++; | ||
2610 | } | ||
2611 | |||
2612 | san_mac_addr_out: | ||
2613 | return 0; | ||
2614 | } | ||
2615 | |||
2616 | /** | ||
2617 | * ixgbe_verify_fw_version_82599 - verify fw version for 82599 | 2245 | * ixgbe_verify_fw_version_82599 - verify fw version for 82599 |
2618 | * @hw: pointer to hardware structure | 2246 | * @hw: pointer to hardware structure |
2619 | * | 2247 | * |
@@ -2715,7 +2343,7 @@ static struct ixgbe_mac_operations mac_ops_82599 = { | |||
2715 | .get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82599, | 2343 | .get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82599, |
2716 | .enable_rx_dma = &ixgbe_enable_rx_dma_82599, | 2344 | .enable_rx_dma = &ixgbe_enable_rx_dma_82599, |
2717 | .get_mac_addr = &ixgbe_get_mac_addr_generic, | 2345 | .get_mac_addr = &ixgbe_get_mac_addr_generic, |
2718 | .get_san_mac_addr = &ixgbe_get_san_mac_addr_82599, | 2346 | .get_san_mac_addr = &ixgbe_get_san_mac_addr_generic, |
2719 | .get_device_caps = &ixgbe_get_device_caps_82599, | 2347 | .get_device_caps = &ixgbe_get_device_caps_82599, |
2720 | .get_wwn_prefix = &ixgbe_get_wwn_prefix_82599, | 2348 | .get_wwn_prefix = &ixgbe_get_wwn_prefix_82599, |
2721 | .stop_adapter = &ixgbe_stop_adapter_generic, | 2349 | .stop_adapter = &ixgbe_stop_adapter_generic, |
@@ -2724,7 +2352,7 @@ static struct ixgbe_mac_operations mac_ops_82599 = { | |||
2724 | .read_analog_reg8 = &ixgbe_read_analog_reg8_82599, | 2352 | .read_analog_reg8 = &ixgbe_read_analog_reg8_82599, |
2725 | .write_analog_reg8 = &ixgbe_write_analog_reg8_82599, | 2353 | .write_analog_reg8 = &ixgbe_write_analog_reg8_82599, |
2726 | .setup_link = &ixgbe_setup_mac_link_82599, | 2354 | .setup_link = &ixgbe_setup_mac_link_82599, |
2727 | .check_link = &ixgbe_check_mac_link_82599, | 2355 | .check_link = &ixgbe_check_mac_link_generic, |
2728 | .get_link_capabilities = &ixgbe_get_link_capabilities_82599, | 2356 | .get_link_capabilities = &ixgbe_get_link_capabilities_82599, |
2729 | .led_on = &ixgbe_led_on_generic, | 2357 | .led_on = &ixgbe_led_on_generic, |
2730 | .led_off = &ixgbe_led_off_generic, | 2358 | .led_off = &ixgbe_led_off_generic, |
@@ -2732,23 +2360,23 @@ static struct ixgbe_mac_operations mac_ops_82599 = { | |||
2732 | .blink_led_stop = &ixgbe_blink_led_stop_generic, | 2360 | .blink_led_stop = &ixgbe_blink_led_stop_generic, |
2733 | .set_rar = &ixgbe_set_rar_generic, | 2361 | .set_rar = &ixgbe_set_rar_generic, |
2734 | .clear_rar = &ixgbe_clear_rar_generic, | 2362 | .clear_rar = &ixgbe_clear_rar_generic, |
2735 | .set_vmdq = &ixgbe_set_vmdq_82599, | 2363 | .set_vmdq = &ixgbe_set_vmdq_generic, |
2736 | .clear_vmdq = &ixgbe_clear_vmdq_82599, | 2364 | .clear_vmdq = &ixgbe_clear_vmdq_generic, |
2737 | .init_rx_addrs = &ixgbe_init_rx_addrs_generic, | 2365 | .init_rx_addrs = &ixgbe_init_rx_addrs_generic, |
2738 | .update_uc_addr_list = &ixgbe_update_uc_addr_list_generic, | 2366 | .update_uc_addr_list = &ixgbe_update_uc_addr_list_generic, |
2739 | .update_mc_addr_list = &ixgbe_update_mc_addr_list_generic, | 2367 | .update_mc_addr_list = &ixgbe_update_mc_addr_list_generic, |
2740 | .enable_mc = &ixgbe_enable_mc_generic, | 2368 | .enable_mc = &ixgbe_enable_mc_generic, |
2741 | .disable_mc = &ixgbe_disable_mc_generic, | 2369 | .disable_mc = &ixgbe_disable_mc_generic, |
2742 | .clear_vfta = &ixgbe_clear_vfta_82599, | 2370 | .clear_vfta = &ixgbe_clear_vfta_generic, |
2743 | .set_vfta = &ixgbe_set_vfta_82599, | 2371 | .set_vfta = &ixgbe_set_vfta_generic, |
2744 | .fc_enable = &ixgbe_fc_enable_generic, | 2372 | .fc_enable = &ixgbe_fc_enable_generic, |
2745 | .init_uta_tables = &ixgbe_init_uta_tables_82599, | 2373 | .init_uta_tables = &ixgbe_init_uta_tables_generic, |
2746 | .setup_sfp = &ixgbe_setup_sfp_modules_82599, | 2374 | .setup_sfp = &ixgbe_setup_sfp_modules_82599, |
2747 | }; | 2375 | }; |
2748 | 2376 | ||
2749 | static struct ixgbe_eeprom_operations eeprom_ops_82599 = { | 2377 | static struct ixgbe_eeprom_operations eeprom_ops_82599 = { |
2750 | .init_params = &ixgbe_init_eeprom_params_generic, | 2378 | .init_params = &ixgbe_init_eeprom_params_generic, |
2751 | .read = &ixgbe_read_eeprom_generic, | 2379 | .read = &ixgbe_read_eerd_generic, |
2752 | .write = &ixgbe_write_eeprom_generic, | 2380 | .write = &ixgbe_write_eeprom_generic, |
2753 | .validate_checksum = &ixgbe_validate_eeprom_checksum_generic, | 2381 | .validate_checksum = &ixgbe_validate_eeprom_checksum_generic, |
2754 | .update_checksum = &ixgbe_update_eeprom_checksum_generic, | 2382 | .update_checksum = &ixgbe_update_eeprom_checksum_generic, |
@@ -2757,7 +2385,7 @@ static struct ixgbe_eeprom_operations eeprom_ops_82599 = { | |||
2757 | static struct ixgbe_phy_operations phy_ops_82599 = { | 2385 | static struct ixgbe_phy_operations phy_ops_82599 = { |
2758 | .identify = &ixgbe_identify_phy_82599, | 2386 | .identify = &ixgbe_identify_phy_82599, |
2759 | .identify_sfp = &ixgbe_identify_sfp_module_generic, | 2387 | .identify_sfp = &ixgbe_identify_sfp_module_generic, |
2760 | .init = &ixgbe_init_phy_ops_82599, | 2388 | .init = &ixgbe_init_phy_ops_82599, |
2761 | .reset = &ixgbe_reset_phy_generic, | 2389 | .reset = &ixgbe_reset_phy_generic, |
2762 | .read_reg = &ixgbe_read_phy_reg_generic, | 2390 | .read_reg = &ixgbe_read_phy_reg_generic, |
2763 | .write_reg = &ixgbe_write_phy_reg_generic, | 2391 | .write_reg = &ixgbe_write_phy_reg_generic, |