drivers/net/{e1000|igc}: update link status when card is enabled

Update link status in case link status interrupt is missing.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
p-szafonimateusz
2025-05-29 12:05:36 +02:00
committed by Xiang Xiao
parent 7a8ac49836
commit 0a8ef045ab
2 changed files with 13 additions and 15 deletions
+6 -7
View File
@@ -144,10 +144,6 @@ struct e1000_driver_s
struct netdev_lowerhalf_s dev;
struct work_s work;
/* Driver state */
bool bifup;
/* Packets list */
FAR netpkt_t **tx_pkt;
@@ -985,13 +981,17 @@ static int e1000_ifup(FAR struct netdev_lowerhalf_s *dev)
dev->netdev.d_ipv6addr[6], dev->netdev.d_ipv6addr[7]);
#endif
flags = enter_critical_section();
/* Enable the Ethernet */
flags = enter_critical_section();
e1000_enable(priv);
priv->bifup = true;
leave_critical_section(flags);
/* Update link status in case link status interrupt is missing */
e1000_link_work(priv);
return OK;
}
@@ -1028,7 +1028,6 @@ static int e1000_ifdown(FAR struct netdev_lowerhalf_s *dev)
/* Mark the device "down" */
priv->bifup = false;
leave_critical_section(flags);
return OK;
}
+7 -8
View File
@@ -125,10 +125,6 @@ struct igc_driver_s
struct netdev_lowerhalf_s dev;
struct work_s work;
/* Driver state */
bool bifup;
/* Packets list */
FAR netpkt_t **tx_pkt;
@@ -580,7 +576,7 @@ static int igc_transmit(FAR struct netdev_lowerhalf_s *dev,
*
*****************************************************************************/
static FAR netpkt_t * igc_receive(FAR struct netdev_lowerhalf_s *dev)
static FAR netpkt_t *igc_receive(FAR struct netdev_lowerhalf_s *dev)
{
FAR struct igc_driver_s *priv = (FAR struct igc_driver_s *)dev;
FAR netpkt_t *pkt = NULL;
@@ -866,13 +862,17 @@ static int igc_ifup(FAR struct netdev_lowerhalf_s *dev)
dev->netdev.d_ipv6addr[6], dev->netdev.d_ipv6addr[7]);
#endif
flags = enter_critical_section();
/* Enable the Ethernet */
flags = enter_critical_section();
igc_enable(priv);
priv->bifup = true;
leave_critical_section(flags);
/* Update link status in case link status interrupt is missing */
igc_link_work(priv);
return OK;
}
@@ -909,7 +909,6 @@ static int igc_ifdown(FAR struct netdev_lowerhalf_s *dev)
/* Mark the device "down" */
priv->bifup = false;
leave_critical_section(flags);
return OK;
}