@@ -27,13 +27,15 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
27
27
#include "r_ether_phy.h"
28
28
29
29
/* Additional configurations to use with hal_renesas */
30
- #define ETHER_DEFAULT NULL
31
- #define ETHER_CHANNEL0 0
32
- #define ETHER_BUF_SIZE 1536
33
- #define ETHER_PADDING_OFFSET 1
34
- #define ETHER_BROADCAST_FILTER 0
35
- #define ETHER_TOTAL_BUF_NUM (CONFIG_ETH_RENESAS_TX_BUF_NUM + CONFIG_ETH_RENESAS_RX_BUF_NUM)
36
- #define ETHER_EE_RECEIVE_EVENT_MASK (0x01070000)
30
+ #define ETHER_DEFAULT NULL
31
+ #define ETHER_CHANNEL0 0
32
+ #define ETHER_BUF_SIZE 1536
33
+ #define ETHER_PADDING_OFFSET 1
34
+ #define ETHER_BROADCAST_FILTER 0
35
+ #define ETHER_TOTAL_BUF_NUM (CONFIG_ETH_RENESAS_TX_BUF_NUM + CONFIG_ETH_RENESAS_RX_BUF_NUM)
36
+ #define ETHER_EE_RECEIVE_EVENT_MASK \
37
+ (ETHER_EESR_EVENT_MASK_RFOF | ETHER_EESR_EVENT_MASK_RDE | ETHER_EESR_EVENT_MASK_FR | \
38
+ ETHER_EESR_EVENT_MASK_RFCOF)
37
39
38
40
BUILD_ASSERT (DT_INST_ENUM_IDX (0 , phy_connection_type ) <= 1 , "Invalid PHY connection setting" );
39
41
@@ -79,8 +81,7 @@ LISTIFY(CONFIG_ETH_RENESAS_TX_BUF_NUM, DECLARE_ETHER_TX_BUFFER, (;));
79
81
80
82
uint8_t * pp_g_ether0_ether_buffers [ETHER_TOTAL_BUF_NUM ] = {
81
83
LISTIFY (CONFIG_ETH_RENESAS_RX_BUF_NUM , DECLARE_ETHER_RX_BUFFER_PTR , (,)),
82
- LISTIFY (CONFIG_ETH_RENESAS_TX_BUF_NUM , DECLARE_ETHER_TX_BUFFER_PTR , (,))
83
- };
84
+ LISTIFY (CONFIG_ETH_RENESAS_TX_BUF_NUM , DECLARE_ETHER_TX_BUFFER_PTR , (,)) };
84
85
85
86
static __aligned (16 ) ether_instance_descriptor_t
86
87
g_ether0_tx_descriptors [CONFIG_ETH_RENESAS_TX_BUF_NUM ];
@@ -90,6 +91,7 @@ static __aligned(16) ether_instance_descriptor_t
90
91
const ether_extended_cfg_t g_ether0_extended_cfg_t = {
91
92
.p_rx_descriptors = g_ether0_rx_descriptors ,
92
93
.p_tx_descriptors = g_ether0_tx_descriptors ,
94
+ .eesr_event_filter = ETHER_EE_RECEIVE_EVENT_MASK ,
93
95
};
94
96
95
97
/* Dummy configuration for ether phy as hal layer require */
@@ -142,7 +144,7 @@ void renesas_ra_eth_callback(ether_callback_args_t *p_args)
142
144
struct device * dev = (struct device * )p_args -> p_context ;
143
145
struct renesas_ra_eth_context * ctx = dev -> data ;
144
146
145
- if (p_args -> status_eesr & ETHER_EE_RECEIVE_EVENT_MASK ) {
147
+ if (p_args -> event == ETHER_EVENT_RX_COMPLETE ) {
146
148
k_sem_give (& ctx -> rx_sem );
147
149
}
148
150
}
@@ -251,7 +253,7 @@ static void renesas_ra_eth_initialize(struct net_if *iface)
251
253
LOG_ERR ("Failed to init ether - R_ETHER_Open fail" );
252
254
}
253
255
254
- err = R_ETHER_CallbackSet (& ctx -> ctrl , renesas_ra_eth_callback , dev , NULL );
256
+ err = R_ETHER_CallbackSet (& ctx -> ctrl , renesas_ra_eth_callback , ( void * const ) dev , NULL );
255
257
256
258
if (err != FSP_SUCCESS ) {
257
259
LOG_ERR ("Failed to init ether - R_ETHER_CallbackSet fail" );
0 commit comments