mirror of
https://github.com/apache/nuttx.git
synced 2026-08-10 15:05:07 +00: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:
parent
0932fccfb2
commit
ba419cc894
2 changed files with 10 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue