Stm32H7 PTP timestamp retrieval issue in HAL
Hi,
I started a github issue for this problem: https://github.com/STMicroelectronics/stm32h7xx_hal_driver/issues/63
Realistically, the entire HAL_ETH_ReadData() function just needs to be rewritten. There are multiple flaws in it:
Take for example here: https://github.com/STMicroelectronics/stm32h7xx_hal_driver/blob/21b29aa338c68333bb5e489b03a04553f8fc2c12/Src/stm32h7xx_hal_eth.c#L1074
What's going on there is the driver examines to check if a descriptor is the context format, and then processes the timestamp data, but then it immediately moves on and treats the descriptor as if it was a normal descriptor.
It's really obvious that the PTP support was not tested (or else ST would have immediately noticed this issue)
Also note that the function does not consider the timestamp dropped or timestamp available bits. This also needs to be fixed.ST, can you please rework this function to correctly handle retrieving the timestamp data from a context descriptor in such a way where one call to this function correctly processes normal descriptors as well as their associated context descriptor?
