1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
/*++
Copyright (c) 2010 WonderMedia Technologies, Inc.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details. You
should have received a copy of the GNU General Public License along with this
program. If not, see http://www.gnu.org/licenses/>.
WonderMedia Technologies, Inc.
10F, 529, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C.
--*/
#ifndef __PROTO_H__
#define __PROTO_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
#if !defined(__ADAPTER_H__)
#include "adapter.h"
#endif
#define HW_8021PQ_TAG TCR0_VETAG
#define HW_IP_CHECKSUM TCR0_IPCK
#define HW_UDP_CHECKSUM TCR0_UDPCK
#define HW_TCP_CHECKSUM TCR0_TCPCK
/*--------------------- Export Definitions -------------------------*/
/*
* Protocol buffer ring
*/
typedef struct tagSProtocolBuffer {
UINT uProtoIndex; /* protocol index */
int idxRxBufHead;
int idxRxBufTail;
PBYTE apbyRxBuffer[CB_MAX_RD_NUM];
UINT auRxBufLength[CB_MAX_RD_NUM];
BOOL abRxBufOccupied[CB_MAX_RD_NUM];
/* for pingpong test */
BYTE abyDstAddr[U_ETHER_ADDR_LEN];
BYTE abySrcAddr[U_ETHER_ADDR_LEN];
DWORD dwSerialNo;
BYTE byDataSeed;
} SProtocolBuffer, DEF * PSProtocolBuffer;
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
extern SProtocolBuffer sg_aGProBuf[MAX_NET_DEVICE];
/*--------------------- Export Functions --------------------------*/
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
BOOL GPRObDriverSend(PSAdapterInfo pAdapter, PBYTE pbyPacket, UINT uPktLen, BYTE byTxQue);
BOOL GPRObDriverSendEx(PSAdapterInfo pAdapter, BYTE byTxQue, WORD wVID,
BYTE byPri, BYTE byHwOpt, PBYTE pbyPacket, UINT uPktLen);
BOOL GPRObProtocolReceive(PSAdapterInfo pAdapter, PBYTE *ppbyPacket, PUINT puPktLen);
VOID GPROvProtocolReturnPacket(PSAdapterInfo pAdapter);
BOOL GPRObProtocolConstruct(PSAdapterInfo pAdapter);
VOID GPROvProtocolDestruct(PSAdapterInfo pAdapter);
VOID GPROvPrepareTxPacketEx(PSAdapterInfo pAdapter, BYTE byTxQue, UINT uIdx, UINT uNumSeg);
VOID GPROvDoTransmitSinglePacket(PSAdapterInfo pAdapter, BYTE byTxQue);
VOID GPROvDoTransmitEx(PSAdapterInfo pAdapter, BYTE byTxQue);
/* VOID vSetBit(PDWORD pdwTD0); */
#ifdef __cplusplus
} /* End of extern "C" { */
#endif /* __cplusplus */
#endif /* __PROTO_H__ */
|