arch/arm/src/lpc17xx/lpc17_ethernet.c
/****************************************************************************
 * Function: lpc17_txdesc
 *
 * Description:
 *   Check if a free TX descriptor is available.
 *
 * Parameters:
 *   priv  - Reference to the driver state structure
 *
 * Returned Value:
 *   OK on success; a negated errno on failure
 *
 * Assumptions:
 *   May or may not be called from an interrupt handler.  In either case,
 *   global interrupts are disabled, either explicitly or indirectly through
 *   interrupt handling logic.
 *
 ****************************************************************************/
lpc17_txdesc
Description:
Check if a free TX descriptor is available.

priv  - Reference to the driver state structure

Returned Value:
OK on success; a negated errno on failure

May or may not be called from an interrupt handler.  In either case,
global interrupts are disabled, either explicitly or indirectly through
interrupt handling logic.
lpc17_txdesc Description : Check if a free TX descriptor is available . priv - Reference to the driver state structure Returned Value : OK on success ; a negated errno on failure May or may not be called from an interrupt handler . In either case global interrupts are disabled either explicitly or indirectly through interrupt handling logic .
static int lpc17_txdesc(struct lpc17_driver_s *priv)
{
  unsigned int prodidx;
  unsigned int considx;
  prodidx = lpc17_getreg(LPC17_ETH_TXPRODIDX) & ETH_TXPRODIDX_MASK;
  if (++prodidx >= CONFIG_NET_NTXDESC)
    {
      prodidx = 0;
    }
  considx = lpc17_getreg(LPC17_ETH_TXCONSIDX) & ETH_TXCONSIDX_MASK;
  return prodidx != considx ? OK : -EAGAIN;
}
static int lpc17_txdesc ( struct lpc17_driver_s * priv ) { unsigned int prodidx ; unsigned int considx ; prodidx = lpc17_getreg ( LPC17_ETH_TXPRODIDX ) & ETH_TXPRODIDX_MASK ; if ( ++ prodidx >= CONFIG_NET_NTXDESC ) { prodidx = 0 ; } considx = lpc17_getreg ( LPC17_ETH_TXCONSIDX ) & ETH_TXCONSIDX_MASK ; return prodidx != considx ? OK : - EAGAIN ; }
Function: lpc17_txdesc
 Description:
   Check if a free TX descriptor is available.
Function : lpc17_txdesc Description : Check if a free TX descriptor is available .
/* Get the next producer index */ /* Wrap back to index zero */ /* If the next producer index would overrun the consumer index, then there
   * are no available Tx descriptors.
   */