Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing parameters error in ATSAM4E #1192

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions source/portable/NetworkInterface/ATSAM4E/NetworkInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
static BaseType_t xGMACWaitLS( TickType_t xMaxTime );

#if ( ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM == 1 ) && ( ipconfigHAS_TX_CRC_OFFLOADING == 0 )
void vGMACGenerateChecksum( uint8_t * apBuffer );
void vGMACGenerateChecksum( uint8_t * pucBuffer,
size_t uxLength );
#endif

/*
Expand Down Expand Up @@ -405,9 +406,10 @@ static BaseType_t xGMACWaitLS( TickType_t xMaxTime )

/*#if( ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM == 1 ) && ( ipconfigHAS_TX_CRC_OFFLOADING == 0 ) */

void vGMACGenerateChecksum( uint8_t * apBuffer )
void vGMACGenerateChecksum( uint8_t * pucBuffer,
size_t uxLength )
{
ProtocolPacket_t * xProtPacket = ( ProtocolPacket_t * ) apBuffer;
ProtocolPacket_t * xProtPacket = ( ProtocolPacket_t * ) pucBuffer;

if( xProtPacket->xTCPPacket.xEthernetHeader.usFrameType == ipIPv4_FRAME_TYPE )
{
Expand All @@ -419,7 +421,7 @@ void vGMACGenerateChecksum( uint8_t * apBuffer )
pxIPHeader->usHeaderChecksum = ~FreeRTOS_htons( pxIPHeader->usHeaderChecksum );

/* Calculate the TCP checksum for an outgoing packet. */
usGenerateProtocolChecksum( ( uint8_t * ) apBuffer, pdTRUE );
usGenerateProtocolChecksum( ( uint8_t * ) pucBuffer, uxLength, pdTRUE );
}
}

Expand Down
5 changes: 3 additions & 2 deletions source/portable/NetworkInterface/ATSAM4E/gmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,8 @@ uint32_t gmac_dev_read( gmac_device_t * p_gmac_dev,
}


extern void vGMACGenerateChecksum( uint8_t * apBuffer );
extern void vGMACGenerateChecksum( uint8_t * pucBuffer,
size_t uxLength );

/**
* \brief Send ulLength bytes from pcFrom. This copies the buffer to one of the
Expand Down Expand Up @@ -715,7 +716,7 @@ uint32_t gmac_dev_write( gmac_device_t * p_gmac_dev,
memcpy( ( void * ) p_tx_td->addr, p_buffer, ul_size );
}
#endif /* ipconfigZERO_COPY_TX_DRIVER */
vGMACGenerateChecksum( ( uint8_t * ) p_tx_td->addr );
vGMACGenerateChecksum( ( uint8_t * ) p_tx_td->addr, ( size_t ) ul_size );
}

#if ( GMAC_USES_TX_CALLBACK != 0 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static BaseType_t xPHY_Write( BaseType_t xAddress,
uint32_t ulValue );

#if ( ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM == 1 ) && ( ipconfigHAS_TX_CRC_OFFLOADING == 0 )
void vGMACGenerateChecksum( uint8_t * apBuffer,
void vGMACGenerateChecksum( uint8_t * pucBuffer,
size_t uxLength );
#endif

Expand Down
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/DriverSAM/gmac_SAM.h
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@

/* The SAM4E has problems offloading checksums for transmission.
* The SAME70 does not set the CRC for ICMP packets (ping). */
extern void vGMACGenerateChecksum( uint8_t * apBuffer,
extern void vGMACGenerateChecksum( uint8_t * pucBuffer,
size_t uxLength );

/*/ @cond 0 */
Expand Down
Loading