update stm32f107 ethernet driver: update hardware checksum setting.
This commit is contained in:
parent
a5b99acedf
commit
f28aa5e748
@ -23,10 +23,9 @@
|
|||||||
#include "stm32f10x_rcc.h"
|
#include "stm32f10x_rcc.h"
|
||||||
|
|
||||||
/* STM32F107 ETH dirver options */
|
/* STM32F107 ETH dirver options */
|
||||||
#define CHECKSUM_BY_HARDWARE
|
#define CHECKSUM_BY_HARDWARE 1 /* 0: disable. 1: use hardware checksum. */
|
||||||
#define RMII_MODE 0 /* 0: MII MODE, 1: RMII MODE. */
|
#define RMII_MODE 0 /* 0: MII MODE, 1: RMII MODE. */
|
||||||
|
|
||||||
|
|
||||||
/** @addtogroup STM32_ETH_Driver
|
/** @addtogroup STM32_ETH_Driver
|
||||||
* @brief ETH driver modules
|
* @brief ETH driver modules
|
||||||
* @{
|
* @{
|
||||||
@ -3088,9 +3087,9 @@ static rt_err_t rt_stm32_eth_init(rt_device_t dev)
|
|||||||
ETH_InitStructure.ETH_PromiscuousMode = ETH_PromiscuousMode_Disable;
|
ETH_InitStructure.ETH_PromiscuousMode = ETH_PromiscuousMode_Disable;
|
||||||
ETH_InitStructure.ETH_MulticastFramesFilter = ETH_MulticastFramesFilter_Perfect;
|
ETH_InitStructure.ETH_MulticastFramesFilter = ETH_MulticastFramesFilter_Perfect;
|
||||||
ETH_InitStructure.ETH_UnicastFramesFilter = ETH_UnicastFramesFilter_Perfect;
|
ETH_InitStructure.ETH_UnicastFramesFilter = ETH_UnicastFramesFilter_Perfect;
|
||||||
#ifdef CHECKSUM_BY_HARDWARE
|
#if CHECKSUM_BY_HARDWARE
|
||||||
ETH_InitStructure.ETH_ChecksumOffload = ETH_ChecksumOffload_Enable;
|
ETH_InitStructure.ETH_ChecksumOffload = ETH_ChecksumOffload_Enable;
|
||||||
#endif
|
#endif /* CHECKSUM_BY_HARDWARE */
|
||||||
|
|
||||||
/*------------------------ DMA -----------------------------------*/
|
/*------------------------ DMA -----------------------------------*/
|
||||||
|
|
||||||
@ -3232,7 +3231,8 @@ rt_err_t rt_stm32_eth_tx( rt_device_t dev, struct pbuf* p)
|
|||||||
DMATxDescToSet->Status |= ETH_DMATxDesc_LS | ETH_DMATxDesc_FS;
|
DMATxDescToSet->Status |= ETH_DMATxDesc_LS | ETH_DMATxDesc_FS;
|
||||||
/* Enable TX Completion Interrupt */
|
/* Enable TX Completion Interrupt */
|
||||||
DMATxDescToSet->Status |= ETH_DMATxDesc_IC;
|
DMATxDescToSet->Status |= ETH_DMATxDesc_IC;
|
||||||
#ifdef CHECKSUM_BY_HARDWARE
|
|
||||||
|
#if CHECKSUM_BY_HARDWARE
|
||||||
DMATxDescToSet->Status |= ETH_DMATxDesc_ChecksumTCPUDPICMPFull;
|
DMATxDescToSet->Status |= ETH_DMATxDesc_ChecksumTCPUDPICMPFull;
|
||||||
/* clean ICMP checksum STM32F need */
|
/* clean ICMP checksum STM32F need */
|
||||||
{
|
{
|
||||||
@ -3249,7 +3249,8 @@ rt_err_t rt_stm32_eth_tx( rt_device_t dev, struct pbuf* p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* CHECKSUM_BY_HARDWARE */
|
||||||
|
|
||||||
/* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
|
/* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
|
||||||
DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
|
DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
|
||||||
/* When Tx Buffer unavailable flag is set: clear it and resume transmission */
|
/* When Tx Buffer unavailable flag is set: clear it and resume transmission */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user