These changes solve:

1) Endianess of TX_DESC_UPDATED_MASK so Tx buffers can be released after tranmission.
   2) Avoid assert( ) failure due uninitialized variable in enet_hal)config_tx_fifo( ) function.

Signed-off-by: Sergio Scaglia <sergio.scaglia@arm.com>
pull/323/head^2
Sergio Scaglia 2014-05-21 15:05:29 -07:00
parent 0f94cf84e8
commit 3c2119fab6
3 changed files with 3 additions and 3 deletions

View File

@ -144,12 +144,12 @@ void enet_hal_config_tx_fifo(uint32_t instance, enet_config_tx_fifo_t *threshold
{
assert(instance < HW_ENET_INSTANCE_COUNT);
assert(thresholdCfg);
assert(thresholdCfg->txFifoWrite <= BM_ENET_TFWR_TFWR);
BW_ENET_TFWR_STRFWD(instance, thresholdCfg->isStoreForwardEnabled); /* Set store and forward mode*/
if(!thresholdCfg->isStoreForwardEnabled)
{
BW_ENET_TFWR_TFWR(instance, thresholdCfg->txFifoWrite); /* Set transmit FIFO write bytes*/
assert(thresholdCfg->txFifoWrite <= BM_ENET_TFWR_TFWR);
}
BW_ENET_TSEM_TX_SECTION_EMPTY(instance,thresholdCfg->txEmpty); /* Set transmit FIFO empty threshold*/
BW_ENET_TAEM_TX_ALMOST_EMPTY(instance,thresholdCfg->txAlmostEmpty); /* Set transmit FIFO almost empty threshold*/

View File

@ -345,7 +345,7 @@ typedef struct ENETBdStruct
uint16_t reserved3;
uint16_t reserved4;
} enet_bd_struct_t;
#define TX_DESC_UPDATED_MASK (0x8000)
#else
/*! @brief Defines the buffer descriptors structure for the Big-Endian system.*/
typedef struct ENETBdStruct
@ -366,6 +366,7 @@ typedef struct ENETBdStruct
uint16_t reserved3;
uint16_t reserved4;
} enet_bd_struct_t;
#define TX_DESC_UPDATED_MASK (0x0080)
#endif
/*! @brief Defines the configuration structure for the 1588 PTP timer.*/

View File

@ -110,7 +110,6 @@ static enet_phy_config_t g_enetPhyCfg[HW_ENET_INSTANCE_COUNT] =
// K64F-specific macros
#define RX_PBUF_AUTO_INDEX (-1)
#define TX_DESC_UPDATED_MASK (0x0080)
/********************************************************************************
* Buffer management