@@ -52,7 +52,6 @@ struct eth_nxp_s32_config {
5252struct eth_nxp_s32_data {
5353 struct net_if * iface ;
5454 uint8_t mac_addr [ETH_NXP_S32_MAC_ADDR_LEN ];
55- uint8_t if_suspended ;
5655 struct k_mutex tx_mutex ;
5756 struct k_sem rx_sem ;
5857 struct k_sem tx_sem ;
@@ -119,13 +118,6 @@ static void phy_link_state_changed(const struct device *pdev,
119118
120119 cfg -> base -> MAC_CONFIGURATION |= GMAC_MAC_CONFIGURATION_DM (gmac_cfg .Duplex );
121120
122- /* net iface should be down even if PHY link state is up
123- * till the upper network layers have suspended the iface.
124- */
125- if (ctx -> if_suspended ) {
126- return ;
127- }
128-
129121 LOG_DBG ("Link up" );
130122 net_eth_carrier_on (ctx -> iface );
131123 } else {
@@ -230,33 +222,12 @@ static int eth_nxp_s32_init(const struct device *dev)
230222static int eth_nxp_s32_start (const struct device * dev )
231223{
232224 const struct eth_nxp_s32_config * cfg = dev -> config ;
233- struct eth_nxp_s32_data * ctx = dev -> data ;
234- struct phy_link_state state ;
235225
236226 Gmac_Ip_EnableController (cfg -> instance );
237227
238228 irq_enable (cfg -> rx_irq );
239229 irq_enable (cfg -> tx_irq );
240230
241- /* If upper layers enable the net iface then mark it as
242- * not suspended so that PHY Link changes can have the impact
243- */
244- ctx -> if_suspended = false;
245-
246- if (cfg -> phy_dev ) {
247- phy_get_link_state (cfg -> phy_dev , & state );
248-
249- /* Enable net_iface only when Ethernet PHY link is up or else
250- * if net_iface is enabled when link is down and tx happens
251- * in this state then the used tx buffers will never be recovered back.
252- */
253- if (state .is_up == true) {
254- net_eth_carrier_on (ctx -> iface );
255- }
256- } else {
257- net_eth_carrier_on (ctx -> iface );
258- }
259-
260231 LOG_DBG ("GMAC%d started" , cfg -> instance );
261232
262233 return 0 ;
@@ -265,20 +236,12 @@ static int eth_nxp_s32_start(const struct device *dev)
265236static int eth_nxp_s32_stop (const struct device * dev )
266237{
267238 const struct eth_nxp_s32_config * cfg = dev -> config ;
268- struct eth_nxp_s32_data * ctx = dev -> data ;
269239 Gmac_Ip_StatusType status ;
270240 int err = 0 ;
271241
272242 irq_disable (cfg -> rx_irq );
273243 irq_disable (cfg -> tx_irq );
274244
275- /* If upper layers disable the net iface then mark it as suspended
276- * in order to save it from the PHY link state changes
277- */
278- ctx -> if_suspended = true;
279-
280- net_eth_carrier_off (ctx -> iface );
281-
282245 status = Gmac_Ip_DisableController (cfg -> instance );
283246 if (status != GMAC_STATUS_SUCCESS ) {
284247 LOG_ERR ("Failed to disable controller GMAC%d (%d)" , cfg -> instance , status );
@@ -308,17 +271,14 @@ static void eth_nxp_s32_iface_init(struct net_if *iface)
308271 ctx -> mac_addr [0 ], ctx -> mac_addr [1 ], ctx -> mac_addr [2 ],
309272 ctx -> mac_addr [3 ], ctx -> mac_addr [4 ], ctx -> mac_addr [5 ]);
310273
311- /* Make sure that the net iface state is not suspended unless
312- * upper layers explicitly stop the iface
313- */
314- ctx -> if_suspended = false;
315-
316274 /* No PHY available, link is always up and MAC speed/duplex settings are fixed */
317275 if (cfg -> phy_dev == NULL ) {
318276 net_if_carrier_on (iface );
319277 return ;
320278 }
321279
280+ net_eth_carrier_off (iface );
281+
322282 /*
323283 * GMAC controls the PHY. If PHY is configured either as fixed
324284 * link or autoneg, the callback is executed at least once
0 commit comments