[PATCH NET 3/3] net: hns: add configuration constraints for 1000M half
From: Peng Li
Date: Thu Aug 23 2018 - 23:12:39 EST
Hisilicon hip05 and hip06 board network card do not support
1000M half configuration. Driver can not config gmac as
1000M half.
Signed-off-by: Peng Li <lipeng321@xxxxxxxxxx>
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
index 09e4061..c1d062e 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
@@ -272,6 +272,11 @@ static int hns_gmac_adjust_link(void *mac_drv, enum mac_speed speed,
{
struct mac_driver *drv = (struct mac_driver *)mac_drv;
+ if (full_duplex == DUPLEX_HALF && speed == MAC_SPEED_1000) {
+ dev_err(drv->dev, "HW do not support 1000M half\n");
+ return -EINVAL;
+ }
+
dsaf_set_dev_bit(drv, GMAC_DUPLEX_TYPE_REG,
GMAC_DUPLEX_TYPE_B, !!full_duplex);
--
2.9.3