algin
ae3cac8a7d
Adds sitara_depot/free_rtos Original one is on server_gorbunov/SmartForce4.0/sitara_depot
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
/*
|
||
* eth_frame.h
|
||
*
|
||
* Created on: 7 <20><><EFBFBD>. 2023 <20>.
|
||
* Author: sychev
|
||
*/
|
||
|
||
#ifndef FREE_RTOS_ETHERNET_ETH_FRAME_H_
|
||
#define FREE_RTOS_ETHERNET_ETH_FRAME_H_
|
||
|
||
#include <stdint.h>
|
||
|
||
#define ETH_FRAME_MAC_ADDR_LEN_BYTES (6u)
|
||
|
||
#define ETH_FRAME_MAC_ADDR_MASK (0xFFFFFFFFFFFFul) /// 6 <20><><EFBFBD><EFBFBD>
|
||
|
||
#define ETH_FRAME_MAC_ADDR_BROADCAST (0xFFFFFFFFFFFFul) /// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||
|
||
#define ETH_FRAME_MIN_LEN (14u) /// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
|
||
#define ETH_FRAME_MAX_LEN (1518u) /// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
|
||
typedef union {
|
||
uint64_t addr;
|
||
uint8_t bytes[8];
|
||
} __attribute__ ((packed)) TEthFrameMacAddr;
|
||
|
||
typedef struct {
|
||
uint8_t mac_dest[ETH_FRAME_MAC_ADDR_LEN_BYTES];
|
||
uint8_t mac_src[ETH_FRAME_MAC_ADDR_LEN_BYTES];
|
||
uint16_t prot_id;
|
||
} __attribute__ ((packed)) TEthFrameHeader;
|
||
|
||
typedef struct {
|
||
uint8_t data[ETH_FRAME_MAX_LEN]; //__attribute__ ((aligned(32)))
|
||
uint32_t length;
|
||
}TEthPkt;
|
||
|
||
|
||
#endif /* FREE_RTOS_ETHERNET_ETH_FRAME_H_ */
|