Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions arch/sim/src/sim/sim_cansock.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ static int sim_can_txavail(struct net_driver_s *dev)

/* Ignore the notification if the interface is not yet up */

net_lock();
netdev_lock(dev);
if (IFF_IS_UP(priv->dev.d_flags))
{
devif_poll(&priv->dev, sim_can_txpoll);
}

net_unlock();
netdev_unlock(dev);

return OK;
}
Expand Down Expand Up @@ -189,7 +189,7 @@ static void sim_can_work(void *arg)
* in priv->dev.d_len
*/

net_lock();
netdev_lock(&priv->dev);
priv->dev.d_len = ret;
priv->dev.d_buf = (FAR uint8_t *)&hframe;

Expand All @@ -198,7 +198,7 @@ static void sim_can_work(void *arg)
NETDEV_RXPACKETS(&priv->dev);

can_input(&priv->dev);
net_unlock();
netdev_unlock(&priv->dev);
}

nodata:
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/enc28j60.c
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ static void enc_irqworker(FAR void *arg)

/* Get exclusive access to both the network and the SPI bus. */

net_lock();
netdev_lock(&priv->dev);
enc_lock(priv);

/* Disable further interrupts by clearing the global interrupt enable bit.
Expand Down Expand Up @@ -1739,7 +1739,7 @@ static void enc_irqworker(FAR void *arg)
/* Release lock on the SPI bus and the network */

enc_unlock(priv);
net_unlock();
netdev_unlock(&priv->dev);
}

/****************************************************************************
Expand Down Expand Up @@ -1812,7 +1812,7 @@ static void enc_toworker(FAR void *arg)

/* Get exclusive access to the network */

net_lock();
netdev_lock(&priv->dev);

/* Increment statistics and dump debug info */

Expand All @@ -1834,7 +1834,7 @@ static void enc_toworker(FAR void *arg)

/* Release lock on the network */

net_unlock();
netdev_unlock(&priv->dev);
}

/****************************************************************************
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/encx24j600.c
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ static void enc_irqworker(FAR void *arg)

/* Get exclusive access to both the network and the SPI bus. */

net_lock();
netdev_lock(&priv->dev);
enc_lock(priv);

/* A good practice is for the host controller to clear the Global Interrupt
Expand Down Expand Up @@ -1884,7 +1884,7 @@ static void enc_irqworker(FAR void *arg)
/* Release lock on the SPI bus and the network */

enc_unlock(priv);
net_unlock();
netdev_unlock(&priv->dev);
}

/****************************************************************************
Expand Down Expand Up @@ -1957,7 +1957,7 @@ static void enc_toworker(FAR void *arg)

/* Get exclusive access to the network. */

net_lock();
netdev_lock(&priv->dev);

/* Increment statistics and dump debug info */

Expand All @@ -1979,7 +1979,7 @@ static void enc_toworker(FAR void *arg)

/* Release the network */

net_unlock();
netdev_unlock(&priv->dev);
}

/****************************************************************************
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/ftmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ static void ftmac100_interrupt_work(FAR void *arg)

/* Process pending Ethernet interrupts */

net_lock();
netdev_lock(&priv->ft_dev);
status = priv->status;

ninfo("status=%08x(%08x) BASE=%p ISR=%p PHYCR=%p\n",
Expand Down Expand Up @@ -883,7 +883,7 @@ static void ftmac100_interrupt_work(FAR void *arg)
putreg32 (INT_MASK_ALL_ENABLED, &iobase->imr);

ninfo("ISR-done\n");
net_unlock();
netdev_unlock(&priv->ft_dev);

/* Re-enable Ethernet interrupts */

Expand Down Expand Up @@ -972,12 +972,12 @@ static void ftmac100_txtimeout_work(FAR void *arg)

/* Process pending Ethernet interrupts */

net_lock();
netdev_lock(&priv->ft_dev);

/* Then poll the network for new XMIT data */

devif_poll(&priv->ft_dev, ftmac100_txpoll);
net_unlock();
netdev_unlock(&priv->ft_dev);
}

/****************************************************************************
Expand Down Expand Up @@ -1137,7 +1137,7 @@ static void ftmac100_txavail_work(FAR void *arg)

/* Perform the poll */

net_lock();
netdev_lock(&priv->ft_dev);

/* Ignore the notification if the interface is not yet up */

Expand All @@ -1152,7 +1152,7 @@ static void ftmac100_txavail_work(FAR void *arg)
devif_poll(&priv->ft_dev, ftmac100_txpoll);
}

net_unlock();
netdev_unlock(&priv->ft_dev);
}

/****************************************************************************
Expand Down
24 changes: 12 additions & 12 deletions drivers/net/lan91c111.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ static void lan91c111_interrupt_work(FAR void *arg)
* thread has been configured.
*/

net_lock();
netdev_lock(dev);

/* Process pending Ethernet interrupts */

Expand Down Expand Up @@ -873,7 +873,7 @@ static void lan91c111_interrupt_work(FAR void *arg)
}
}

net_unlock();
netdev_unlock(dev);

/* Re-enable Ethernet interrupts */

Expand Down Expand Up @@ -949,7 +949,7 @@ static int lan91c111_ifup(FAR struct net_driver_s *dev)
dev->d_ipv6addr[6], dev->d_ipv6addr[7]);
#endif

net_lock();
netdev_lock(dev);

/* Initialize PHYs, Ethernet interface, and setup up Ethernet interrupts */

Expand All @@ -974,7 +974,7 @@ static int lan91c111_ifup(FAR struct net_driver_s *dev)

copyto16(priv, ADDR0_REG, &dev->d_mac.ether, sizeof(dev->d_mac.ether));

net_unlock();
netdev_unlock(dev);

/* Enable the Ethernet interrupt */

Expand Down Expand Up @@ -1056,7 +1056,7 @@ static void lan91c111_txavail_work(FAR void *arg)
* thread has been configured.
*/

net_lock();
netdev_lock(dev);

/* Ignore the notification if the interface is not yet up */

Expand All @@ -1074,7 +1074,7 @@ static void lan91c111_txavail_work(FAR void *arg)
}
}

net_unlock();
netdev_unlock(dev);
}

/****************************************************************************
Expand Down Expand Up @@ -1187,9 +1187,9 @@ static int lan91c111_addmac(FAR struct net_driver_s *dev,

/* Add the MAC address to the hardware multicast routing table */

net_lock();
netdev_lock(dev);
modifyreg16(priv, MCAST_REG1 + off, 0, 1 << bit);
net_unlock();
netdev_unlock(dev);

return OK;
}
Expand Down Expand Up @@ -1234,9 +1234,9 @@ static int lan91c111_rmmac(FAR struct net_driver_s *dev,

/* Remove the MAC address from the hardware multicast routing table */

net_lock();
netdev_lock(dev);
modifyreg16(priv, MCAST_REG1 + off, 1 << bit, 0);
net_unlock();
netdev_unlock(dev);

return OK;
}
Expand Down Expand Up @@ -1269,7 +1269,7 @@ static int lan91c111_ioctl(FAR struct net_driver_s *dev, int cmd,
FAR struct mii_ioctl_data_s *req = (FAR void *)arg;
int ret = OK;

net_lock();
netdev_lock(dev);

/* Decode and dispatch the driver-specific IOCTL command */

Expand All @@ -1292,7 +1292,7 @@ static int lan91c111_ioctl(FAR struct net_driver_s *dev, int cmd,
ret = -ENOTTY; /* Special return value for this case */
}

net_unlock();
netdev_unlock(dev);
return ret;
}
#endif
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/lan9250.c
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ static void lan9250_txavail_work(FAR void *arg)
* thread has been configured.
*/

net_lock();
netdev_lock(dev);
lan9250_lock_spi(priv);

/* Ignore the notification if the interface is not yet up */
Expand All @@ -1544,7 +1544,7 @@ static void lan9250_txavail_work(FAR void *arg)
/* Release lock on the SPI bus and the network */

lan9250_unlock_spi(priv);
net_unlock();
netdev_unlock(dev);
}

/****************************************************************************
Expand Down Expand Up @@ -1798,7 +1798,7 @@ static void lan9250_int_worker(FAR void *arg)

/* Get exclusive access to both the network and the SPI bus. */

net_lock();
netdev_lock(&priv->dev);
lan9250_lock_spi(priv);

/* There is no infinite loop check... if there are always pending
Expand Down Expand Up @@ -1985,7 +1985,7 @@ static void lan9250_int_worker(FAR void *arg)
/* Release lock on the SPI bus and the network */

lan9250_unlock_spi(priv);
net_unlock();
netdev_unlock(&priv->dev);

/* Enable ISR_GPIO interrupts after unlocking net so that application
* could have chance to process Ethernet packet and free iob.
Expand Down Expand Up @@ -2061,7 +2061,7 @@ static void lan9250_txtout_worker(FAR void *arg)

/* Get exclusive access to the network */

net_lock();
netdev_lock(&priv->dev);

/* Increment statistics and dump debug info */

Expand All @@ -2083,7 +2083,7 @@ static void lan9250_txtout_worker(FAR void *arg)

/* Release lock on the network */

net_unlock();
netdev_unlock(&priv->dev);
}

/****************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static void lo_txavail_work(FAR void *arg)

/* Ignore the notification if the interface is not yet up */

net_lock();
netdev_lock(&priv->lo_dev);
if (priv->lo_bifup)
{
/* Reuse the devif_loopback() logic, Polling all pending events until
Expand All @@ -204,7 +204,7 @@ static void lo_txavail_work(FAR void *arg)
while (devif_poll(&priv->lo_dev, NULL));
}

net_unlock();
netdev_unlock(&priv->lo_dev);
}

/****************************************************************************
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/skeleton.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ static void skel_interrupt_work(FAR void *arg)
* thread has been configured.
*/

net_lock();
netdev_lock(&priv->sk_dev);

/* Process pending Ethernet interrupts */

Expand All @@ -484,7 +484,7 @@ static void skel_interrupt_work(FAR void *arg)
*/

skel_txdone(priv);
net_unlock();
netdev_unlock(&priv->sk_dev);

/* Re-enable Ethernet interrupts */

Expand Down Expand Up @@ -564,7 +564,7 @@ static void skel_txtimeout_work(FAR void *arg)
* thread has been configured.
*/

net_lock();
netdev_lock(&priv->sk_dev);

/* Increment statistics and dump debug info */

Expand All @@ -575,7 +575,7 @@ static void skel_txtimeout_work(FAR void *arg)
/* Then poll the network for new XMIT data */

devif_poll(&priv->sk_dev, skel_txpoll);
net_unlock();
netdev_unlock(&priv->sk_dev);
}

/****************************************************************************
Expand Down Expand Up @@ -731,7 +731,7 @@ static void skel_txavail_work(FAR void *arg)
* thread has been configured.
*/

net_lock();
netdev_lock(&priv->sk_dev);

/* Ignore the notification if the interface is not yet up */

Expand All @@ -744,7 +744,7 @@ static void skel_txavail_work(FAR void *arg)
devif_poll(&priv->sk_dev, skel_txpoll);
}

net_unlock();
netdev_unlock(&priv->sk_dev);
}

/****************************************************************************
Expand Down
Loading
Loading