aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igb/igb_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb_ethtool.c')
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ethtool.c67
1 files changed, 50 insertions, 17 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 8412f9746c78..48b594701efa 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -181,18 +181,29 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
181 ecmd->phy_address = hw->phy.addr; 181 ecmd->phy_address = hw->phy.addr;
182 ecmd->transceiver = XCVR_INTERNAL; 182 ecmd->transceiver = XCVR_INTERNAL;
183 } else { 183 } else {
184 ecmd->supported = (SUPPORTED_1000baseT_Full | 184 ecmd->supported = (SUPPORTED_1000baseT_Full |
185 SUPPORTED_100baseT_Full | 185 SUPPORTED_100baseT_Full |
186 SUPPORTED_Autoneg | 186 SUPPORTED_FIBRE |
187 SUPPORTED_FIBRE | 187 SUPPORTED_Autoneg |
188 SUPPORTED_Pause); 188 SUPPORTED_Pause);
189 if (hw->mac.type == e1000_i354)
190 ecmd->supported |= SUPPORTED_2500baseX_Full;
189 191
190 ecmd->advertising = ADVERTISED_FIBRE; 192 ecmd->advertising = ADVERTISED_FIBRE;
191 193
192 if (adapter->link_speed == SPEED_100) 194 switch (adapter->link_speed) {
193 ecmd->advertising = ADVERTISED_100baseT_Full; 195 case SPEED_2500:
194 else if (adapter->link_speed == SPEED_1000) 196 ecmd->advertising = ADVERTISED_2500baseX_Full;
197 break;
198 case SPEED_1000:
195 ecmd->advertising = ADVERTISED_1000baseT_Full; 199 ecmd->advertising = ADVERTISED_1000baseT_Full;
200 break;
201 case SPEED_100:
202 ecmd->advertising = ADVERTISED_100baseT_Full;
203 break;
204 default:
205 break;
206 }
196 207
197 if (hw->mac.autoneg == 1) 208 if (hw->mac.autoneg == 1)
198 ecmd->advertising |= ADVERTISED_Autoneg; 209 ecmd->advertising |= ADVERTISED_Autoneg;
@@ -204,21 +215,23 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
204 status = rd32(E1000_STATUS); 215 status = rd32(E1000_STATUS);
205 216
206 if (status & E1000_STATUS_LU) { 217 if (status & E1000_STATUS_LU) {
207 218 if ((hw->mac.type == e1000_i354) &&
208 if (status & E1000_STATUS_SPEED_1000) 219 (status & E1000_STATUS_2P5_SKU) &&
209 ethtool_cmd_speed_set(ecmd, SPEED_1000); 220 !(status & E1000_STATUS_2P5_SKU_OVER))
221 ecmd->speed = SPEED_2500;
222 else if (status & E1000_STATUS_SPEED_1000)
223 ecmd->speed = SPEED_1000;
210 else if (status & E1000_STATUS_SPEED_100) 224 else if (status & E1000_STATUS_SPEED_100)
211 ethtool_cmd_speed_set(ecmd, SPEED_100); 225 ecmd->speed = SPEED_100;
212 else 226 else
213 ethtool_cmd_speed_set(ecmd, SPEED_10); 227 ecmd->speed = SPEED_10;
214
215 if ((status & E1000_STATUS_FD) || 228 if ((status & E1000_STATUS_FD) ||
216 hw->phy.media_type != e1000_media_type_copper) 229 hw->phy.media_type != e1000_media_type_copper)
217 ecmd->duplex = DUPLEX_FULL; 230 ecmd->duplex = DUPLEX_FULL;
218 else 231 else
219 ecmd->duplex = DUPLEX_HALF; 232 ecmd->duplex = DUPLEX_HALF;
220 } else { 233 } else {
221 ethtool_cmd_speed_set(ecmd, -1); 234 ecmd->speed = -1;
222 ecmd->duplex = -1; 235 ecmd->duplex = -1;
223 } 236 }
224 237
@@ -281,12 +294,22 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
281 hw->phy.autoneg_advertised = ecmd->advertising | 294 hw->phy.autoneg_advertised = ecmd->advertising |
282 ADVERTISED_FIBRE | 295 ADVERTISED_FIBRE |
283 ADVERTISED_Autoneg; 296 ADVERTISED_Autoneg;
284 if (adapter->link_speed == SPEED_1000) 297 switch (adapter->link_speed) {
298 case SPEED_2500:
299 hw->phy.autoneg_advertised =
300 ADVERTISED_2500baseX_Full;
301 break;
302 case SPEED_1000:
285 hw->phy.autoneg_advertised = 303 hw->phy.autoneg_advertised =
286 ADVERTISED_1000baseT_Full; 304 ADVERTISED_1000baseT_Full;
287 else if (adapter->link_speed == SPEED_100) 305 break;
306 case SPEED_100:
288 hw->phy.autoneg_advertised = 307 hw->phy.autoneg_advertised =
289 ADVERTISED_100baseT_Full; 308 ADVERTISED_100baseT_Full;
309 break;
310 default:
311 break;
312 }
290 } else { 313 } else {
291 hw->phy.autoneg_advertised = ecmd->advertising | 314 hw->phy.autoneg_advertised = ecmd->advertising |
292 ADVERTISED_TP | 315 ADVERTISED_TP |
@@ -1225,6 +1248,7 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
1225 1248
1226 switch (adapter->hw.mac.type) { 1249 switch (adapter->hw.mac.type) {
1227 case e1000_i350: 1250 case e1000_i350:
1251 case e1000_i354:
1228 test = reg_test_i350; 1252 test = reg_test_i350;
1229 toggle = 0x7FEFF3FF; 1253 toggle = 0x7FEFF3FF;
1230 break; 1254 break;
@@ -1387,6 +1411,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
1387 ics_mask = 0x77DCFED5; 1411 ics_mask = 0x77DCFED5;
1388 break; 1412 break;
1389 case e1000_i350: 1413 case e1000_i350:
1414 case e1000_i354:
1390 case e1000_i210: 1415 case e1000_i210:
1391 case e1000_i211: 1416 case e1000_i211:
1392 ics_mask = 0x77DCFED5; 1417 ics_mask = 0x77DCFED5;
@@ -1881,6 +1906,13 @@ static int igb_loopback_test(struct igb_adapter *adapter, u64 *data)
1881 *data = 0; 1906 *data = 0;
1882 goto out; 1907 goto out;
1883 } 1908 }
1909
1910 if (adapter->hw.mac.type == e1000_i354) {
1911 dev_info(&adapter->pdev->dev,
1912 "Loopback test not supported on i354.\n");
1913 *data = 0;
1914 goto out;
1915 }
1884 *data = igb_setup_desc_rings(adapter); 1916 *data = igb_setup_desc_rings(adapter);
1885 if (*data) 1917 if (*data)
1886 goto out; 1918 goto out;
@@ -2311,6 +2343,7 @@ static int igb_get_ts_info(struct net_device *dev,
2311 case e1000_82576: 2343 case e1000_82576:
2312 case e1000_82580: 2344 case e1000_82580:
2313 case e1000_i350: 2345 case e1000_i350:
2346 case e1000_i354:
2314 case e1000_i210: 2347 case e1000_i210:
2315 case e1000_i211: 2348 case e1000_i211:
2316 info->so_timestamping = 2349 info->so_timestamping =