7 #if !defined(__SDCC_mcs51) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
8 #pragma disable_warning 85
10 #define UCHAR unsigned char
11 #define USHORT unsigned short
12 #define PCHAR unsigned char *
16 typedef struct _PACKET_LIST PACKET_LIST
;
22 UCHAR pRecvIP
[IP_ALEN
];
25 void memcpy4(PCHAR dst
) {}
27 #define EP_TYPE (HW_ALEN + HW_ALEN)
28 #define EP_DATA (EP_TYPE + 2)
30 #define ETHERNET_MAX_SIZE 1514
31 #define IP_DATA_MAX_SIZE (ETHERNET_MAX_SIZE - EP_DATA - IP_DATA)
32 UCHAR Adapter_pPacketBuf
[ETHERNET_MAX_SIZE
+ 1 + IP_DATA_MAX_SIZE
+ 1];
33 #define Adapter_pReceivePacket (PCHAR)(Adapter_pPacketBuf + ETHERNET_MAX_SIZE + 1)
37 UCHAR _pReceiveIP
[IP_ALEN
];
38 USHORT _sReceiveDataLen
;
40 void TcpRun(PACKET_LIST
* p
)
48 _pReceive
= Adapter_pReceivePacket
;
52 // check if packet length is valid
53 iHeadLen
= (_pReceive
[TCP_OFFSET
] & 0xf0) >> 2;
58 _sReceiveDataLen
= sLen
- iHeadLen
;
64 #if !defined(__SDCC_mcs51) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
67 (Adapter_pReceivePacket
)[TCP_OFFSET
] = 0x00;
68 _sReceiveDataLen
= 0xaa55;
70 ASSERT(_sReceiveDataLen
== 0xff);