Hi Sergei,
Subject: Re: [RFC/PATCH 09/18] ravb: Add half_duplex to struct
ravb_hw_info
On 9/23/21 5:08 PM, Biju Das wrote:
quoted
RZ/G2L supports half duplex mode.
Add a half_duplex hw feature bit to struct ravb_hw_info for supporting
half duplex mode for RZ/G2L.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
[...]
Reviewed-by: Sergey Shtylyov <redacted>
Just a little bit of change needed...
[...]
quoted
diff --git a/drivers/net/ethernet/renesas/ravb_main.c
b/drivers/net/ethernet/renesas/ravb_main.c
index 5d18681582b9..04bff44b7660 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1076,6 +1076,18 @@ static int ravb_poll(struct napi_struct *napi,
int budget)
quoted
return budget - quota;
}
+static void ravb_set_duplex_rgeth(struct net_device *ndev) {
+ struct ravb_private *priv = netdev_priv(ndev);
+ u32 ecmr = ravb_read(ndev, ECMR);
+
+ if (priv->duplex > 0) /* Full */
+ ecmr |= ECMR_DM;
+ else /* Half */
+ ecmr &= ~ECMR_DM;
+ ravb_write(ndev, ecmr, ECMR);
I think we should do that like sh_eth.c:
ravb_modify(ndev, ECMR, ECMR_DM, priv->duplex > 0 ? ECMR_DM : 0);
I have prepared a patch with this changes and also renamed the function "ravb_set_duplex_rgeth" to " ravb_set_duplex_gbeth"
As you suggested.
Regards,
Biju