diff options
author | Jose Abreu <Jose.Abreu@synopsys.com> | 2019-09-06 09:41:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-09-07 17:57:41 +0200 |
commit | 034c8fadba3323941a852fd24b9fdbc703122ad6 (patch) | |
tree | 4eaa51f8d265f526113683bf928c83cb193bc5be | |
parent | 0079ad8e8dc3a4d1af0dd4a53345580a6947beba (diff) | |
download | linux-stable-034c8fadba3323941a852fd24b9fdbc703122ad6.tar.gz linux-stable-034c8fadba3323941a852fd24b9fdbc703122ad6.tar.bz2 linux-stable-034c8fadba3323941a852fd24b9fdbc703122ad6.zip |
net: stmmac: selftests: Add missing checks for support of SA
Add checks for support of Source Address Insertion/Replacement before
running the test.
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c index 305d24935cf4..dce34c081a1e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c @@ -1057,6 +1057,9 @@ static int stmmac_test_desc_sai(struct stmmac_priv *priv) struct stmmac_packet_attrs attr = { }; int ret; + if (!priv->dma_cap.vlins) + return -EOPNOTSUPP; + attr.remove_sa = true; attr.sarc = true; attr.src = src; @@ -1076,6 +1079,9 @@ static int stmmac_test_desc_sar(struct stmmac_priv *priv) struct stmmac_packet_attrs attr = { }; int ret; + if (!priv->dma_cap.vlins) + return -EOPNOTSUPP; + attr.sarc = true; attr.src = src; attr.dst = priv->dev->dev_addr; @@ -1094,6 +1100,9 @@ static int stmmac_test_reg_sai(struct stmmac_priv *priv) struct stmmac_packet_attrs attr = { }; int ret; + if (!priv->dma_cap.vlins) + return -EOPNOTSUPP; + attr.remove_sa = true; attr.sarc = true; attr.src = src; @@ -1114,6 +1123,9 @@ static int stmmac_test_reg_sar(struct stmmac_priv *priv) struct stmmac_packet_attrs attr = { }; int ret; + if (!priv->dma_cap.vlins) + return -EOPNOTSUPP; + attr.sarc = true; attr.src = src; attr.dst = priv->dev->dev_addr; |