git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@308 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2008-05-26 13:23:11 +00:00
parent 04a6871085
commit 90b16f78c2
2 changed files with 7 additions and 7 deletions

View File

@ -315,12 +315,12 @@ BufDescriptorEntry *EMACGetTransmitBuffer(void) {
void EMACTransmit(BufDescriptorEntry *cptr, size_t size) {
chDbgAssert(size <= EMAC_TRANSMIT_BUFFERS_SIZE, "sam7x_emac.c, EMACTransmit");
cptr->w2 &= ~W2_R_LENGTH_MASK;
cptr->w2 |= size;
chSysLock();
cptr->w2 &= ~(W2_T_USED | W2_T_LOCKED);
if (cptr < &tent[EMAC_TRANSMIT_BUFFERS - 1])
cptr->w2 = size | W2_T_LAST_BUFFER;
else
cptr->w2 = size | W2_T_LAST_BUFFER | W2_T_WRAP;
AT91C_BASE_EMAC->EMAC_NCR |= AT91C_EMAC_TSTART;
chSysUnlock();
}

View File

@ -50,9 +50,9 @@ typedef struct {
#define W2_T_LENGTH_MASK 0x000007FF
#define W2_T_LOCKED 0x00000800 /* Not an EMAC flag, used by the driver */
#define W2_T_RFU1 0x00003000
#define W2_T_LAST_BUFFER 0x00004000
#define W2_T_NO_CRC 0x00008000
#define W2_T_RFU2 0x07FF0000
#define W2_T_LAST_BUFFER 0x00008000
#define W2_T_NO_CRC 0x00010000
#define W2_T_RFU2 0x07FE0000
#define W2_T_BUFFERS_EXHAUSTED 0x08000000
#define W2_T_TRANSMIT_UNDERRUN 0x10000000
#define W2_T_RETRY_LIMIT_EXC 0x20000000