mirror of
https://github.com/apache/nuttx.git
synced 2026-05-13 10:38:40 +08:00
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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user