Modified: asf/avr32/drivers/macb/macb.c =================================================================== --- branches/axima/src/asf/avr32/drivers/macb/macb.c 2013-02-22 10:58:08 UTC (rev 339) +++ branches/axima/src/asf/avr32/drivers/macb/macb.c 2013-02-22 14:15:06 UTC (rev 340) @@ -572,31 +572,29 @@ // Tx buffer within the frame just transmitted. This marks all the buffers // as available again. - // The first buffer in the frame should have the bit set automatically. */ - if( xTxDescriptors[ uxNextBufferToClear ].U_Status.status & AVR32_TRANSMIT_OK ) - { - // Loop through the other buffers in the frame. - while( !( xTxDescriptors[ uxNextBufferToClear ].U_Status.status & AVR32_LAST_BUFFER ) ) - { - uxNextBufferToClear++; + xTxDescriptors[ uxNextBufferToClear ].U_Status.status |= AVR32_TRANSMIT_OK; - if( uxNextBufferToClear >= ETHERNET_CONF_NB_TX_BUFFERS ) - { - uxNextBufferToClear = 0; - } - - xTxDescriptors[ uxNextBufferToClear ].U_Status.status |= AVR32_TRANSMIT_OK; - } - - // Start with the next buffer the next time a Tx interrupt is called. + // Loop through the other buffers in the frame. + while( !( xTxDescriptors[ uxNextBufferToClear ].U_Status.status & AVR32_LAST_BUFFER ) ) + { uxNextBufferToClear++; - // Do we need to wrap back to the first buffer? if( uxNextBufferToClear >= ETHERNET_CONF_NB_TX_BUFFERS ) { uxNextBufferToClear = 0; } + + xTxDescriptors[ uxNextBufferToClear ].U_Status.status |= AVR32_TRANSMIT_OK; } + + // Start with the next buffer the next time a Tx interrupt is called. + uxNextBufferToClear++; + + // Do we need to wrap back to the first buffer? + if( uxNextBufferToClear >= ETHERNET_CONF_NB_TX_BUFFERS ) + { + uxNextBufferToClear = 0; + } } static void prvSetupDescriptors(volatile avr32_macb_t *macb)