You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/02/02 14:19:10 UTC

[incubator-nuttx] 03/04: It's enough to only hold the net lock in SLIP driver

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch pr200
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 3dbea9663e0d7ff5b274f626cea2a793772666c7
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Feb 2 15:24:17 2020 +0800

    It's enough to only hold the net lock in SLIP driver
    
    Change-Id: Iccae92cdf0a67817d93908a71f6752977efb9192
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/net/slip.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index 646e2ad..bdd2481 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -460,12 +460,6 @@ static int slip_txtask(int argc, FAR char *argv[])
 
       if (priv->bifup)
         {
-          /* Get exclusive access to the network (if it it is already being
-           * used slip_rxtask, then we have to wait).
-           */
-
-          slip_semtake(priv);
-
           /* Poll the networking layer for new XMIT data. */
 
           net_lock();
@@ -490,7 +484,6 @@ static int slip_txtask(int argc, FAR char *argv[])
             }
 
           net_unlock();
-          slip_semgive(priv);
         }
     }
 
@@ -705,11 +698,10 @@ static int slip_rxtask(int argc, FAR char *argv[])
 
       /* Handle the IP input.  Get exclusive access to the network. */
 
-      slip_semtake(priv);
+      net_lock();
       priv->dev.d_buf = priv->rxbuf;
       priv->dev.d_len = priv->rxlen;
 
-      net_lock();
       NETDEV_RXPACKETS(&priv->dev);
 
       /* All packets are assumed to be IP packets (we don't have a choice..
@@ -759,7 +751,6 @@ static int slip_rxtask(int argc, FAR char *argv[])
         }
 
       net_unlock();
-      slip_semgive(priv);
     }
 
   /* We won't get here */