aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLendacky, Thomas <Thomas.Lendacky@amd.com>2014-08-29 14:16:50 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-01 23:38:14 -0400
commita9a4a2d9d622e3bde41356aa4e2694cee052d002 (patch)
treea7b206d5ac94abaf19044a20c24333902cdc2186
parente148e1bf6fcdecb19015c63ba8c6c25ed5dc3a2a (diff)
amd-xgbe: Check for Tx hardware queue flushing support
The flushing of the Tx hardware queues is only supported at a certain level of the hardware. Retrieve the current version of the hardware and use that to determine if flushing is supported. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-dev.c3
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-drv.c2
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c7
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe.h3
4 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
index edaca4496264..e43747a9926f 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
@@ -1633,6 +1633,9 @@ static int xgbe_flush_tx_queues(struct xgbe_prv_data *pdata)
1633{ 1633{
1634 unsigned int i, count; 1634 unsigned int i, count;
1635 1635
1636 if (XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER) < 0x21)
1637 return 0;
1638
1636 for (i = 0; i < pdata->tx_q_count; i++) 1639 for (i = 0; i < pdata->tx_q_count; i++)
1637 XGMAC_MTL_IOWRITE_BITS(pdata, i, MTL_Q_TQOMR, FTQ, 1); 1640 XGMAC_MTL_IOWRITE_BITS(pdata, i, MTL_Q_TQOMR, FTQ, 1);
1638 1641
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index dc84f7193c2d..b26d75856553 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -361,6 +361,8 @@ void xgbe_get_all_hw_features(struct xgbe_prv_data *pdata)
361 361
362 memset(hw_feat, 0, sizeof(*hw_feat)); 362 memset(hw_feat, 0, sizeof(*hw_feat));
363 363
364 hw_feat->version = XGMAC_IOREAD(pdata, MAC_VR);
365
364 /* Hardware feature register 0 */ 366 /* Hardware feature register 0 */
365 hw_feat->gmii = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, GMIISEL); 367 hw_feat->gmii = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, GMIISEL);
366 hw_feat->vlhash = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, VLHASH); 368 hw_feat->vlhash = XGMAC_GET_BITS(mac_hfr0, MAC_HWF0R, VLHASH);
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
index a076aca138a1..46f613028e9c 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
@@ -361,15 +361,16 @@ static void xgbe_get_drvinfo(struct net_device *netdev,
361 struct ethtool_drvinfo *drvinfo) 361 struct ethtool_drvinfo *drvinfo)
362{ 362{
363 struct xgbe_prv_data *pdata = netdev_priv(netdev); 363 struct xgbe_prv_data *pdata = netdev_priv(netdev);
364 struct xgbe_hw_features *hw_feat = &pdata->hw_feat;
364 365
365 strlcpy(drvinfo->driver, XGBE_DRV_NAME, sizeof(drvinfo->driver)); 366 strlcpy(drvinfo->driver, XGBE_DRV_NAME, sizeof(drvinfo->driver));
366 strlcpy(drvinfo->version, XGBE_DRV_VERSION, sizeof(drvinfo->version)); 367 strlcpy(drvinfo->version, XGBE_DRV_VERSION, sizeof(drvinfo->version));
367 strlcpy(drvinfo->bus_info, dev_name(pdata->dev), 368 strlcpy(drvinfo->bus_info, dev_name(pdata->dev),
368 sizeof(drvinfo->bus_info)); 369 sizeof(drvinfo->bus_info));
369 snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%d.%d.%d", 370 snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%d.%d.%d",
370 XGMAC_IOREAD_BITS(pdata, MAC_VR, USERVER), 371 XGMAC_GET_BITS(hw_feat->version, MAC_VR, USERVER),
371 XGMAC_IOREAD_BITS(pdata, MAC_VR, DEVID), 372 XGMAC_GET_BITS(hw_feat->version, MAC_VR, DEVID),
372 XGMAC_IOREAD_BITS(pdata, MAC_VR, SNPSVER)); 373 XGMAC_GET_BITS(hw_feat->version, MAC_VR, SNPSVER));
373 drvinfo->n_stats = XGBE_STATS_COUNT; 374 drvinfo->n_stats = XGBE_STATS_COUNT;
374} 375}
375 376
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
index 07bf70a82908..5af5c38eef4b 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
@@ -526,6 +526,9 @@ struct xgbe_desc_if {
526 * or configurations are present in the device. 526 * or configurations are present in the device.
527 */ 527 */
528struct xgbe_hw_features { 528struct xgbe_hw_features {
529 /* HW Version */
530 unsigned int version;
531
529 /* HW Feature Register0 */ 532 /* HW Feature Register0 */
530 unsigned int gmii; /* 1000 Mbps support */ 533 unsigned int gmii; /* 1000 Mbps support */
531 unsigned int vlhash; /* VLAN Hash Filter */ 534 unsigned int vlhash; /* VLAN Hash Filter */