You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by da...@apache.org on 2022/08/12 14:30:56 UTC

[incubator-nuttx] 01/05: arch: imx6: Apply the imxrt_enet.c changes to imx_enet.c (1/4)

This is an automated email from the ASF dual-hosted git repository.

davids5 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 4e4ebba30682e5da8ee6e644f1ba234942284890
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Fri Aug 12 21:22:25 2022 +0900

    arch: imx6: Apply the imxrt_enet.c changes to imx_enet.c (1/4)
    
    Summary:
    - This commit applies the following imxrt_enet.c changes to imx_enet.c
    
      commit 12a515ebb639992c749e823d90ad3530fa764492
      Author: Masayuki Ishikawa <ma...@gmail.com>
      Date:   Thu Feb 4 11:27:09 2021 +0900
    
          arch: imxrt: Introduce CONFIG_NET_GUARDSIZE to imxrt_enet.c
    
    Impact:
    - imx_enet.c
    
    Testing:
    - Tested with qemu-6.2 (defconfig will be updated later)
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 arch/arm/src/imx6/imx_enet.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/src/imx6/imx_enet.c b/arch/arm/src/imx6/imx_enet.c
index 9d89f13552..f6c4064195 100644
--- a/arch/arm/src/imx6/imx_enet.c
+++ b/arch/arm/src/imx6/imx_enet.c
@@ -256,7 +256,8 @@
 
 #define BUF ((struct eth_hdr_s *)priv->dev.d_buf)
 
-#define IMX_BUF_SIZE  ENET_ALIGN_UP(CONFIG_NET_ETH_PKTSIZE)
+#define IMX_BUF_SIZE  ENET_ALIGN_UP(CONFIG_NET_ETH_PKTSIZE + \
+                                    CONFIG_NET_GUARDSIZE)
 
 /****************************************************************************
  * Private Types
@@ -2244,11 +2245,13 @@ static inline int imx_initphy(struct imx_driver_s *priv, bool renogphy)
 
 #ifdef CONFIG_IMX_ENETUSEMII
   rcr = ENET_RCR_CRCFWD |
-        CONFIG_NET_ETH_PKTSIZE << ENET_RCR_MAX_FL_SHIFT |
+        (CONFIG_NET_ETH_PKTSIZE + CONFIG_NET_GUARDSIZE)
+          << ENET_RCR_MAX_FL_SHIFT |
         ENET_RCR_MII_MODE;
 #else
   rcr = ENET_RCR_RMII_MODE | ENET_RCR_CRCFWD |
-        CONFIG_NET_ETH_PKTSIZE << ENET_RCR_MAX_FL_SHIFT |
+        (CONFIG_NET_ETH_PKTSIZE + CONFIG_NET_GUARDSIZE)
+          << ENET_RCR_MAX_FL_SHIFT |
         ENET_RCR_MII_MODE;
 #endif
   tcr = 0;