mirror of
				https://github.com/FreeRTOS/FreeRTOS-Kernel.git
				synced 2025-11-04 11:09:01 +01:00 
			
		
		
		
	Corrected the Rx frame length mask when obtaining the length from the rx descriptor.
This commit is contained in:
		
							parent
							
								
									17617c5451
								
							
						
					
					
						commit
						df9b2abe91
					
				@ -54,6 +54,11 @@ Changes from V4.0.1
 | 
				
			|||||||
	+ Made the function vClearEMACTxBuffer() more robust by moving the index
 | 
						+ Made the function vClearEMACTxBuffer() more robust by moving the index
 | 
				
			||||||
	  manipulation into the if() statement.  This allows the tx interrupt to
 | 
						  manipulation into the if() statement.  This allows the tx interrupt to
 | 
				
			||||||
	  execute even when there is no data to handle.
 | 
						  execute even when there is no data to handle.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Changes from V4.0.4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						+ Corrected the Rx frame length mask when obtaining the length from the
 | 
				
			||||||
 | 
						  rx descriptor.
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -128,6 +133,9 @@ one not be immediately available when trying to transmit a frame. */
 | 
				
			|||||||
#define emacRESET_KEY				( ( unsigned portLONG ) 0xA5000000 )
 | 
					#define emacRESET_KEY				( ( unsigned portLONG ) 0xA5000000 )
 | 
				
			||||||
#define emacRESET_LENGTH			( ( unsigned portLONG ) ( 0x01 << 8 ) )
 | 
					#define emacRESET_LENGTH			( ( unsigned portLONG ) ( 0x01 << 8 ) )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* The Atmel header file only defines the TX frame length mask. */
 | 
				
			||||||
 | 
					#define emacRX_LENGTH_FRAME			( 0xfff )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*-----------------------------------------------------------*/
 | 
					/*-----------------------------------------------------------*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Buffer written to by the EMAC DMA.  Must be aligned as described by the
 | 
					/* Buffer written to by the EMAC DMA.  Must be aligned as described by the
 | 
				
			||||||
@ -323,7 +331,7 @@ register unsigned portLONG ulIndex, ulLength = 0;
 | 
				
			|||||||
	frame.  The last buffer will give us the length of the entire frame. */
 | 
						frame.  The last buffer will give us the length of the entire frame. */
 | 
				
			||||||
	while( ( xRxDescriptors[ ulIndex ].addr & AT91C_OWNERSHIP_BIT ) && !ulLength )
 | 
						while( ( xRxDescriptors[ ulIndex ].addr & AT91C_OWNERSHIP_BIT ) && !ulLength )
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		ulLength = xRxDescriptors[ ulIndex ].U_Status.status & AT91C_LENGTH_FRAME;
 | 
							ulLength = xRxDescriptors[ ulIndex ].U_Status.status & emacRX_LENGTH_FRAME;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* Increment to the next buffer, wrapping if necessary. */
 | 
							/* Increment to the next buffer, wrapping if necessary. */
 | 
				
			||||||
		ulIndex++;
 | 
							ulIndex++;
 | 
				
			||||||
 | 
				
			|||||||
@ -57,6 +57,12 @@ Changes from V3.2.4
 | 
				
			|||||||
	+ Also read the EMAC_RSR register in the EMAC ISR as a work around the 
 | 
						+ Also read the EMAC_RSR register in the EMAC ISR as a work around the 
 | 
				
			||||||
	  the EMAC bug that can reset the RX bit in EMAC_ISR register before the
 | 
						  the EMAC bug that can reset the RX bit in EMAC_ISR register before the
 | 
				
			||||||
	  bit has been read.
 | 
						  bit has been read.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Changes from V4.0.4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						+ Corrected the Rx frame length mask when obtaining the length from the
 | 
				
			||||||
 | 
						  rx descriptor.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Standard includes. */
 | 
					/* Standard includes. */
 | 
				
			||||||
@ -105,6 +111,9 @@ one not be immediately available when trying to transmit a frame. */
 | 
				
			|||||||
#define emacRESET_KEY				( ( unsigned portLONG ) 0xA5000000 )
 | 
					#define emacRESET_KEY				( ( unsigned portLONG ) 0xA5000000 )
 | 
				
			||||||
#define emacRESET_LENGTH			( ( unsigned portLONG ) ( 0x01 << 8 ) )
 | 
					#define emacRESET_LENGTH			( ( unsigned portLONG ) ( 0x01 << 8 ) )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* The Atmel header file only defines the TX frame length mask. */
 | 
				
			||||||
 | 
					#define emacRX_LENGTH_FRAME			( 0xfff )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*-----------------------------------------------------------*/
 | 
					/*-----------------------------------------------------------*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
@ -344,7 +353,7 @@ portCHAR *pcSource;
 | 
				
			|||||||
	while( ( xRxDescriptors[ ulNextRxBuffer ].addr & AT91C_OWNERSHIP_BIT ) && !ulSectionLength )
 | 
						while( ( xRxDescriptors[ ulNextRxBuffer ].addr & AT91C_OWNERSHIP_BIT ) && !ulSectionLength )
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		pcSource = ( portCHAR * )( xRxDescriptors[ ulNextRxBuffer ].addr & emacADDRESS_MASK );
 | 
							pcSource = ( portCHAR * )( xRxDescriptors[ ulNextRxBuffer ].addr & emacADDRESS_MASK );
 | 
				
			||||||
		ulSectionLength = xRxDescriptors[ ulNextRxBuffer ].U_Status.status & AT91C_LENGTH_FRAME;
 | 
							ulSectionLength = xRxDescriptors[ ulNextRxBuffer ].U_Status.status & emacRX_LENGTH_FRAME;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if( ulSectionLength == 0 )
 | 
							if( ulSectionLength == 0 )
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user