drivers/net/{e1000|igc}: limit no packet is transmit after carrier off

if the drvier tx queue is full up during the network cable unplugging,
there will be no txdone interrupt after inserting the network cable,
transmit cannot be recovered.

Modified to no longer fill the driver with packet when link down.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2024-10-11 12:27:58 +08:00
committed by Xiang Xiao
parent 0932fccfb2
commit ba419cc894
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -572,6 +572,11 @@ static int e1000_transmit(FAR struct netdev_lowerhalf_s *dev,
return -EINVAL;
}
if (!IFF_IS_RUNNING(dev->netdev.d_flags))
{
return -ENETDOWN;
}
/* Store TX packet reference */
priv->tx_pkt[priv->tx_now] = pkt;
+5
View File
@@ -526,6 +526,11 @@ static int igc_transmit(FAR struct netdev_lowerhalf_s *dev,
return -EINVAL;
}
if (!IFF_IS_RUNNING(dev->netdev.d_flags))
{
return -ENETDOWN;
}
/* Store TX packet reference */
priv->tx_pkt[priv->tx_now] = pkt;