Skip to content

Commit

Permalink
LwIP202: Handle IEEE_1588 for SGMII Phy
Browse files Browse the repository at this point in the history
- Add extra 8 bytes in eth_hdr if 1588 is enabled for SGMII Phy

Signed-off-by: Maulik Jodhani <maulik.jodhani@xilinx.com>
  • Loading branch information
Maulik Jodhani authored and saddepal committed May 11, 2018
1 parent 3bbb430 commit 19f27c5
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,18 @@
#define LWIP_HDR_PROT_ETHERNET_H

#include "lwip/arch.h"
#include "xlwipconfig.h"

#ifdef __cplusplus
extern "C" {
#endif

#if XLWIP_CONFIG_AXI_ETHERNET_ENABLE_1588
#define IEEE_1588_PAD_SIZE 8
#else
#define IEEE_1588_PAD_SIZE 0
#endif

#ifndef ETH_HWADDR_LEN
#ifdef ETHARP_HWADDR_LEN
#define ETH_HWADDR_LEN ETHARP_HWADDR_LEN /* compatibility mode */
Expand Down Expand Up @@ -71,6 +78,9 @@ PACK_STRUCT_BEGIN
struct eth_hdr {
#if ETH_PAD_SIZE
PACK_STRUCT_FLD_8(u8_t padding[ETH_PAD_SIZE]);
#endif
#if XLWIP_CONFIG_AXI_ETHERNET_ENABLE_1588
PACK_STRUCT_FLD_8(u8_t padding[IEEE_1588_PAD_SIZE]);
#endif
PACK_STRUCT_FLD_S(struct eth_addr dest);
PACK_STRUCT_FLD_S(struct eth_addr src);
Expand All @@ -81,7 +91,7 @@ PACK_STRUCT_END
# include "arch/epstruct.h"
#endif

#define SIZEOF_ETH_HDR (14 + ETH_PAD_SIZE)
#define SIZEOF_ETH_HDR (14 + ETH_PAD_SIZE + IEEE_1588_PAD_SIZE)

#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/bpstruct.h"
Expand Down

0 comments on commit 19f27c5

Please sign in to comment.