mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
TX timeout must also be cancelled on a TX error. TX timeout should check if we are waiting for a TXto complete. TX timeout was too short (short than the maximum number of retries).
This commit is contained in:
@@ -523,15 +523,10 @@ Configuration sub-directories
|
|||||||
length to 84 and that did NOT eliminate the RX FIFO error.
|
length to 84 and that did NOT eliminate the RX FIFO error.
|
||||||
|
|
||||||
At the end of the TCP test, the "nsh> ifconfig" command shows that
|
At the end of the TCP test, the "nsh> ifconfig" command shows that
|
||||||
there were two TX timeouts. Perhaps this is related? The TX timeout
|
there were two TX timeouts. Perhaps this is related? I found that
|
||||||
is set to 5 seconds, so this could be a serious performance issue.
|
the TX timeout was not being cancelled. It must be canceled on each
|
||||||
|
TX completed or TX error. This DID eliminate the RX FIFO error, but
|
||||||
So for now I have to live with the RX FIFO error. I have observed
|
now the test hangs and does not complete.
|
||||||
only a single RX FIFO error and it occurs at the same place in the
|
|
||||||
the TCP test (when the data is turned around and sent back to the
|
|
||||||
client). the UDP test and Telnet work perfectly. The RX FIFO error
|
|
||||||
is handled perfectly and, since it is TCP, there is no loss of data
|
|
||||||
and all tests pass. That is as good as I can do for now.
|
|
||||||
|
|
||||||
Another Errata: "Using the STack packet format and no CRC field, the
|
Another Errata: "Using the STack packet format and no CRC field, the
|
||||||
reading from RX FIFO to the last received byte, is not possible. ..."
|
reading from RX FIFO to the last received byte, is not possible. ..."
|
||||||
@@ -542,4 +537,3 @@ Configuration sub-directories
|
|||||||
|
|
||||||
Reducing the FIFO to 94 bytes fixed the problem with the 2 byte CRC
|
Reducing the FIFO to 94 bytes fixed the problem with the 2 byte CRC
|
||||||
but did not resolve that occasional RX FIFO error.
|
but did not resolve that occasional RX FIFO error.
|
||||||
|
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
|
|||||||
|
|
||||||
# Include BCH driver
|
# Include BCH driver
|
||||||
|
|
||||||
CSRCS += bchlib_setup.c bchlib_teardown.c bchlib_read.c bchlib_write.c \
|
CSRCS += bchlib_setup.c bchlib_teardown.c bchlib_read.c bchlib_write.c
|
||||||
bchlib_cache.c bchlib_sem.c bchdev_register.c bchdev_unregister.c \
|
CSRCS += bchlib_cache.c bchlib_sem.c bchdev_register.c bchdev_unregister.c
|
||||||
bchdev_driver.c
|
CSRCS += bchdev_driver.c
|
||||||
|
|
||||||
# Include BCH driver build support
|
# Include BCH driver build support
|
||||||
|
|
||||||
|
|||||||
@@ -232,14 +232,20 @@
|
|||||||
|
|
||||||
#define SPIRIT_WDDELAY (1*CLK_TCK)
|
#define SPIRIT_WDDELAY (1*CLK_TCK)
|
||||||
|
|
||||||
/* TX timeout = 5 seconds */
|
/* Maximum number of retries (10) */
|
||||||
|
|
||||||
#define SPIRIT_TXTIMEOUT (5*CLK_TCK)
|
#define SPIRIT_MAX_RETX PKT_N_RETX_10
|
||||||
|
|
||||||
/* RX timeout = 1.5 seconds */
|
/* RX timeout = 1.5 seconds. Transmitter will wait this amount timer for
|
||||||
|
* an ACK from the receiver (per transmission).
|
||||||
|
*/
|
||||||
|
|
||||||
#define SPIRIT_RXTIMEOUT 1500.0
|
#define SPIRIT_RXTIMEOUT 1500.0
|
||||||
|
|
||||||
|
/* Failsafe TX timeout = MAX_RETX * RXTIMEOUT + 1 = 16 seconds */
|
||||||
|
|
||||||
|
#define SPIRIT_TXTIMEOUT (16*CLK_TCK)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -1081,10 +1087,16 @@ static void spirit_interrupt_work(FAR void *arg)
|
|||||||
DEBUGVERIFY(spirit_command(spirit, COMMAND_FLUSHTXFIFO));
|
DEBUGVERIFY(spirit_command(spirit, COMMAND_FLUSHTXFIFO));
|
||||||
irqstatus.IRQ_TX_DATA_SENT = 0;
|
irqstatus.IRQ_TX_DATA_SENT = 0;
|
||||||
|
|
||||||
/* Revert the sending state */
|
/* Were we in the sending state? */
|
||||||
|
|
||||||
if (priv->state == DRIVER_STATE_SENDING)
|
if (priv->state == DRIVER_STATE_SENDING)
|
||||||
{
|
{
|
||||||
|
/* Yes.. Cancel the TX timeout */
|
||||||
|
|
||||||
|
wd_cancel(priv->txtimeout);
|
||||||
|
|
||||||
|
/* Revert the sending state */
|
||||||
|
|
||||||
priv->state = DRIVER_STATE_IDLE;
|
priv->state = DRIVER_STATE_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1106,7 +1118,7 @@ static void spirit_interrupt_work(FAR void *arg)
|
|||||||
{
|
{
|
||||||
wlinfo("Data sent\n");
|
wlinfo("Data sent\n");
|
||||||
|
|
||||||
/* Disable the TX timeout */
|
/* Cancel the TX timeout */
|
||||||
|
|
||||||
wd_cancel(priv->txtimeout);
|
wd_cancel(priv->txtimeout);
|
||||||
|
|
||||||
@@ -1407,10 +1419,10 @@ static void spirit_interrupt_work(FAR void *arg)
|
|||||||
|
|
||||||
if (irqstatus.IRQ_RX_DATA_DISC != 0)
|
if (irqstatus.IRQ_RX_DATA_DISC != 0)
|
||||||
{
|
{
|
||||||
wlinfo("Data discarded: Node addr=%02x RX dest addr=%02x\n",
|
wlwarn("WARNING: Data discarded: Node addr=%02x RX dest addr=%02x\n",
|
||||||
spirit_pktcommon_get_nodeaddress(spirit),
|
spirit_pktcommon_get_nodeaddress(spirit),
|
||||||
spirit_pktcommon_get_rxdestaddr(spirit));
|
spirit_pktcommon_get_rxdestaddr(spirit));
|
||||||
wlinfo(" CRC error=%u RX timeout=%u\n",
|
wlwarn(" CRC error=%u RX timeout=%u\n",
|
||||||
irqstatus.IRQ_CRC_ERROR, irqstatus.IRQ_RX_TIMEOUT);
|
irqstatus.IRQ_CRC_ERROR, irqstatus.IRQ_RX_TIMEOUT);
|
||||||
|
|
||||||
/* Flush the RX FIFO and revert the receiving state */
|
/* Flush the RX FIFO and revert the receiving state */
|
||||||
@@ -1500,10 +1512,18 @@ static void spirit_txtimeout_work(FAR void *arg)
|
|||||||
{
|
{
|
||||||
FAR struct spirit_driver_s *priv = (FAR struct spirit_driver_s *)arg;
|
FAR struct spirit_driver_s *priv = (FAR struct spirit_driver_s *)arg;
|
||||||
|
|
||||||
|
wlwarn("WARNING: TX Timeout. state=%u\n", priv->state);
|
||||||
|
|
||||||
|
/* Are we in the sending state? If not, then this must be a spurious
|
||||||
|
* timout.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (priv->state == DRIVER_STATE_SENDING)
|
||||||
|
{
|
||||||
/* Lock the network and serialize driver operations if necessary.
|
/* Lock the network and serialize driver operations if necessary.
|
||||||
* NOTE: Serialization is only required in the case where the driver work
|
* NOTE: Serialization is only required in the case where the driver
|
||||||
* is performed on an LP worker thread and where more than one LP worker
|
* work is performed on an LP worker thread and where more than one LP
|
||||||
* thread has been configured.
|
* worker thread has been configured.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
net_lock();
|
net_lock();
|
||||||
@@ -1517,12 +1537,13 @@ static void spirit_txtimeout_work(FAR void *arg)
|
|||||||
spirit_ifdown(&priv->radio.r_dev);
|
spirit_ifdown(&priv->radio.r_dev);
|
||||||
spirit_ifup(&priv->radio.r_dev);
|
spirit_ifup(&priv->radio.r_dev);
|
||||||
|
|
||||||
/* Then schedule to poll the network for new XMIT data on the LP worker
|
/* Then schedule to poll the network for new XMIT data on the LP
|
||||||
* thread.
|
* worker thread.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
work_queue(LPWORK, &priv->pollwork, spirit_txpoll_work, priv, 0);
|
work_queue(LPWORK, &priv->pollwork, spirit_txpoll_work, priv, 0);
|
||||||
net_unlock();
|
net_unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user