arch/arm/src/lpc17xx/lpc17_ethernet.c
/****************************************************************************
 * Function: lpc17_response
 *
 * Description:
 *   While processing an RxDone event, higher logic decides to send a packet,
 *   possibly a response to the incoming packet (but probably not, in reality).
 *   However, since the Rx and Tx operations are decoupled, there is no
 *   guarantee that there will be a Tx descriptor available at that time.
 *   This function will perform that check and, if no Tx descriptor is
 *   available, this function will (1) stop incoming Rx processing (bad), and
 *   (2) hold the outgoing packet in a pending state until the next Tx
 *   interrupt occurs.
 *
 * Parameters:
 *   priv  - Reference to the driver state structure
 *
 * Returned Value:
 *   None
 *
 * Assumptions:
 *   Global interrupts are disabled by interrupt handling logic.
 *
 ****************************************************************************/
lpc17_response
Description:
While processing an RxDone event, higher logic decides to send a packet,
possibly a response to the incoming packet (but probably not, in reality).
However, since the Rx and Tx operations are decoupled, there is no
guarantee that there will be a Tx descriptor available at that time.
This function will perform that check and, if no Tx descriptor is
available, this function will (1) stop incoming Rx processing (bad), and
(2) hold the outgoing packet in a pending state until the next Tx
interrupt occurs.

priv  - Reference to the driver state structure

Returned Value:
None

Global interrupts are disabled by interrupt handling logic.
lpc17_response Description : While processing an RxDone event higher logic decides to send a packet possibly a response to the incoming packet ( but probably not in reality ) . However since the Rx and Tx operations are decoupled there is no guarantee that there will be a Tx descriptor available at that time . This function will perform that check and if no Tx descriptor is available this function will ( 1 ) stop incoming Rx processing ( bad ) and ( 2 ) hold the outgoing packet in a pending state until the next Tx interrupt occurs . priv - Reference to the driver state structure Returned Value : None Global interrupts are disabled by interrupt handling logic .
static void lpc17_response(struct lpc17_driver_s *priv)
{
  int ret;
  ret = lpc17_txdesc(priv);
  if (ret == OK)
    {
      lpc17_transmit(priv);
    }
  else
    {
      DEBUGASSERT((priv->lp_inten & ETH_INT_TXDONE) != 0);
      priv->lp_txpending = true;
      priv->lp_inten    &= ~ETH_RXINTS;
      lpc17_putreg(priv->lp_inten, LPC17_ETH_INTEN);
      EMAC_STAT(priv, tx_pending);
    }
}
static void lpc17_response ( struct lpc17_driver_s * priv ) { int ret ; ret = lpc17_txdesc ( priv ) ; if ( ret == OK ) { lpc17_transmit ( priv ) ; } else { DEBUGASSERT ( ( priv -> lp_inten & ETH_INT_TXDONE ) != 0 ) ; priv -> lp_txpending = true ; priv -> lp_inten &= ~ ETH_RXINTS ; lpc17_putreg ( priv -> lp_inten , LPC17_ETH_INTEN ) ; EMAC_STAT ( priv , tx_pending ) ; } }
Function: lpc17_response
 Description:
   While processing an RxDone event, higher logic decides to send a packet,
   possibly a response to the incoming packet (but probably not, in reality).
Function : lpc17_response Description : While processing an RxDone event higher logic decides to send a packet possibly a response to the incoming packet ( but probably not in reality ) .
/* Check if there is room in the device to hold another packet. */ /* Yes.. queue the packet now. */ /* No.. mark the Tx as pending and halt further RX interrupts that
       * could generate more TX activity.
       */