revert between 56095 -> 55830 in arch
[AROS.git] / rom / usb / classes / rndis / rndis.h
blobff993ec97839284af3603ca5a82661d8289176cd
1 /*
2 * $Id$
3 */
5 #ifndef RNDIS_H
6 #define RNDIS_H
8 #include <intuition/intuition.h>
9 #include <intuition/intuitionbase.h>
10 #include <libraries/mui.h>
11 #include <libraries/gadtools.h>
12 #include <devices/sana2.h>
13 #include <devices/sana2specialstats.h>
14 #include <exec/devices.h>
15 #include <stdint.h>
17 #if defined(__GNUC__)
18 # pragma pack(2)
19 #endif
21 #define DDF_CONFIGURED (1<<2) /* station address is configured */
22 #define DDF_ONLINE (1<<3) /* device is online */
23 #define DDF_OFFLINE (1<<4) /* device was put offline */
25 #define DROPPED (1<<0) /* Did the packet get dropped? */
26 #define PACKETFILTER (1<<1) /* Use the packet filter? */
28 /* Ethernet address bytesize
30 #define ETHER_ADDR_SIZE 6
32 #define ETHER_MIN_LEN 60 /* smallest amount that nic will accept */
33 #define ETHER_MAX_LEN 1536 /* largest legal amount for Ethernet */
35 /* Ethernet packet data sizes (maximum)
37 #define ETHERPKT_SIZE 1500
38 #define RAWPKT_SIZE 1514
40 #define ID_ABOUT 0x55555555
41 #define ID_STORE_CONFIG 0xaaaaaaaa
42 #define ID_DEF_CONFIG 0xaaaaaaab
44 struct ClsDevCfg
46 ULONG cdc_ChunkID;
47 ULONG cdc_Length;
48 ULONG cdc_DefaultUnit;
49 UBYTE cdc_MACAddress[ETHER_ADDR_SIZE];
52 #if defined(__GNUC__)
53 # pragma pack()
54 #endif
56 /* Structure of an ethernet packet - internal
59 struct EtherPacketHeader
61 UBYTE eph_Dest[ETHER_ADDR_SIZE]; /* 0 destination address */
62 UBYTE eph_Src[ETHER_ADDR_SIZE]; /* 6 originator address */
63 UWORD eph_Type; /* 12 packet type */
66 /* Buffer management node - private
68 struct BufMan
70 struct Node bm_Node;
71 APTR bm_DMACopyFromBuf32;
72 APTR bm_CopyFromBuf;
73 APTR bm_DMACopyToBuf32;
74 APTR bm_CopyToBuf;
75 APTR bm_PacketFilter;
76 struct List bm_RXQueue; /* read requests */
79 /* Multicast address range record - private
81 struct MulticastAddressRange
83 struct Node mar_Node; /* 0 list node */
84 ULONG mar_UseCount; /* 8 number of times used */
85 UBYTE mar_LowerAddr[ETHER_ADDR_SIZE]; /* 12 multicast address lower bound */
86 UBYTE mar_UpperAddr[ETHER_ADDR_SIZE]; /* 18 multicast address upper bound */
89 struct PacketTypeStats
91 struct Node pts_Node;
92 ULONG pts_PacketType;
93 struct Sana2PacketTypeStats pts_Stats;
97 struct NepEthDevBase
99 struct Library np_Library; /* standard */
100 UWORD np_Flags; /* various flags */
102 BPTR np_SegList; /* device seglist */
103 struct NepEthBase *np_ClsBase; /* pointer to class base */
104 struct Library *np_UtilityBase; /* cached utilitybase */
107 struct NepClassEth
109 struct Unit ncp_Unit; /* Unit structure */
110 ULONG ncp_UnitNo; /* Unit number */
111 ULONG ncp_OpenFlags; /* Flags used to open the device */
112 struct NepEthBase *ncp_ClsBase; /* Up linkage */
113 struct NepEthDevBase *ncp_DevBase; /* Device base */
114 struct Library *ncp_Base; /* Poseidon base */
115 struct PsdDevice *ncp_Device; /* Up linkage */
116 struct PsdConfig *ncp_Config; /* Up linkage */
117 struct PsdInterface *ncp_Interface; /* Up linkage */
118 struct Task *ncp_ReadySigTask; /* Task to send ready signal to */
119 LONG ncp_ReadySignal; /* Signal to send when ready */
120 struct Task *ncp_Task; /* Subtask */
121 struct MsgPort *ncp_TaskMsgPort; /* Message Port of Subtask */
123 struct PsdPipe *ncp_EP0Pipe; /* Endpoint 0 pipe */
124 struct PsdEndpoint *ncp_EPOut; /* Endpoint 1 */
125 struct PsdPipe *ncp_EPOutPipe[2]; /* Endpoint 1 pipes */
126 struct PsdEndpoint *ncp_EPIn; /* Endpoint 2 */
127 struct PsdPipe *ncp_EPInPipe; /* Endpoint 2 pipe */
128 struct MsgPort *ncp_DevMsgPort; /* Message Port for IOParReq */
129 UWORD ncp_UnitProdID; /* ProductID of unit */
130 UWORD ncp_UnitVendorID; /* VendorID of unit */
131 //BOOL ncp_DenyRequests; /* Do not accept further IO requests */
133 struct List ncp_BufManList; /* Buffer Managers */
134 struct List ncp_EventList; /* List for DoEvent */
135 struct List ncp_TrackList; /* List of trackables */
136 struct List ncp_Multicasts; /* List of multicast addresses */
137 UBYTE ncp_MacAddress[ETHER_ADDR_SIZE]; /* Current Mac Address */
138 UBYTE ncp_ROMAddress[ETHER_ADDR_SIZE]; /* ROM Mac Address */
139 UBYTE ncp_MulticastArray[8]; /* array for the multicast hashes */
140 ULONG ncp_StateFlags; /* State of the unit */
142 ULONG ncp_Retries; /* tx collision count */
143 ULONG ncp_BadMulticasts; /* bad multicast count */
145 UBYTE *ncp_ReadBuffer[2]; /* Packet Double Buffered Read Buffer */
146 UBYTE *ncp_WriteBuffer[2]; /* Packet Write Buffer */
148 UWORD ncp_ReadBufNum; /* Next Read Buffer to use */
149 UWORD ncp_WriteBufNum; /* Next Write Buffer to use */
151 struct Sana2DeviceStats ncp_DeviceStats; /* SANA Stats */
152 struct Sana2PacketTypeStats *ncp_TypeStats2048; /* IP protocol stats ptr, or NULL */
153 struct Sana2PacketTypeStats *ncp_TypeStats2054; /* ARP protocol stats ptr, or NULL */
155 UBYTE *ncp_ReadPending; /* read IORequest pending */
156 struct IOSana2Req *ncp_WritePending[2]; /* write IORequest pending */
157 struct List ncp_OrphanQueue; /* List of orphan read requests */
158 struct List ncp_WriteQueue; /* List of write requests */
160 UBYTE ncp_DevIDString[128]; /* Device ID String */
162 BOOL ncp_UsingDefaultCfg;
163 struct ClsDevCfg *ncp_CDC;
165 uint32_t sc_filter; /* rndis stuff */
166 uint32_t sc_lim_pktsz;
168 struct Library *ncp_MUIBase; /* MUI master base */
169 struct Library *ncp_PsdBase; /* Poseidon base */
170 struct Library *ncp_IntBase; /* Intuition base */
174 struct NepEthBase
176 struct Library nh_Library; /* standard */
177 UWORD nh_Flags; /* various flags */
179 struct Library *nh_UtilityBase; /* utility base */
181 struct NepEthDevBase *nh_DevBase; /* base of device created */
182 struct List nh_Units; /* List of units available */
184 struct NepClassEth nh_DummyNCP; /* Dummy ncp for default config */
189 #endif /* RNDIS_H */