]> begriffs open source - cmsis-freertos/blob - Demo/ColdFire_MCF51CN128_CodeWarrior/Sources/eth.h
Update cmsis_os2.c
[cmsis-freertos] / Demo / ColdFire_MCF51CN128_CodeWarrior / Sources / eth.h
1 /*! 
2  * \file    eth.h
3  * \brief   Definitinos for Ethernet Frames
4  * \version $Revision: 1.2 $
5  * \author  Michael Norman
6  */
7
8 #ifndef _ETH_H
9 #define _ETH_H
10
11 /*******************************************************************/
12
13 /* Ethernet standard lengths in bytes*/
14 #define ETH_ADDR_LEN    (6)
15 #define ETH_TYPE_LEN    (2)
16 #define ETH_CRC_LEN     (4)
17 #define ETH_MAX_DATA    (1500)
18 #define ETH_MIN_DATA    (46)
19 #define ETH_HDR_LEN     (ETH_ADDR_LEN * 2 + ETH_TYPE_LEN)
20
21 /* Defined Ethernet Frame Types */
22 #define ETH_FRM_IP      (0x0800)
23 #define ETH_FRM_ARP     (0x0806)
24 #define ETH_FRM_RARP    (0x8035)
25 #define ETH_FRM_TEST    (0xA5A5)
26
27 /* Maximum and Minimum Ethernet Frame Sizes */
28 #define ETH_MAX_FRM     (ETH_HDR_LEN + ETH_MAX_DATA + ETH_CRC_LEN)
29 #define ETH_MIN_FRM     (ETH_HDR_LEN + ETH_MIN_DATA + ETH_CRC_LEN)
30 #define ETH_MTU         (ETH_HDR_LEN + ETH_MAX_DATA)
31
32 /* Ethernet Addresses */
33 typedef unsigned char ETH_ADDR[ETH_ADDR_LEN];
34
35 /* 16-bit Ethernet Frame Type, ie. Protocol */
36 typedef unsigned short ETH_FRM_TYPE;
37
38 /* Ethernet Frame Header definition */
39 typedef struct
40 {
41     ETH_ADDR     dest;
42     ETH_ADDR     src;
43     ETH_FRM_TYPE type;
44 } ETH_HDR;
45
46 /* Ethernet Frame definition */
47 typedef struct
48 {
49     ETH_HDR head;
50     unsigned char*  data;
51 } ETH_FRAME;
52
53 /*******************************************************************/
54
55 #endif  /* _ETH_H */