revert commit 56204.
[AROS.git] / rom / usb / classes / ethwrap / ethwrap.h
blobadfd81119ab9da870f3a840d7e8709bcdcd608de
1 #ifndef ETHWRAP_H
2 #define ETHWRAP_H
4 #include <intuition/intuition.h>
5 #include <intuition/intuitionbase.h>
6 #include <libraries/mui.h>
7 #include <libraries/gadtools.h>
8 #include <devices/sana2.h>
9 #include <devices/sana2specialstats.h>
10 #include <exec/devices.h>
12 #if defined(__GNUC__)
13 # pragma pack(2)
14 #endif
16 #define DDF_CONFIGURED (1<<2) /* station address is configured */
17 #define DDF_ONLINE (1<<3) /* device is online */
18 #define DDF_OFFLINE (1<<4) /* device was put offline */
20 #define DROPPED (1<<0) /* Did the packet get dropped? */
21 #define PACKETFILTER (1<<1) /* Use the packet filter? */
23 /* Ethernet address bytesize
25 #define ETHER_ADDR_SIZE 6
27 #define ETHER_MIN_LEN 60 /* smallest amount that nic will accept */
28 #define ETHER_MAX_LEN 1536 /* largest legal amount for Ethernet */
30 /* Ethernet packet data sizes (maximum)
32 #define ETHERPKT_SIZE 1500
33 #define RAWPKT_SIZE 1514
35 #define ID_ABOUT 0x55555555
36 #define ID_STORE_CONFIG 0xaaaaaaaa
37 #define ID_DEF_CONFIG 0xaaaaaaab
39 struct ClsDevCfg
41 ULONG cdc_ChunkID;
42 ULONG cdc_Length;
43 ULONG cdc_DefaultUnit;
44 UBYTE cdc_MACAddress[ETHER_ADDR_SIZE];
47 #if defined(__GNUC__)
48 # pragma pack()
49 #endif
51 /* Structure of an ethernet packet - internal
54 struct EtherPacketHeader
56 UBYTE eph_Dest[ETHER_ADDR_SIZE]; /* 0 destination address */
57 UBYTE eph_Src[ETHER_ADDR_SIZE]; /* 6 originator address */
58 UWORD eph_Type; /* 12 packet type */
61 /* Buffer management node - private
63 struct BufMan
65 struct Node bm_Node;
66 APTR bm_DMACopyFromBuf32;
67 APTR bm_CopyFromBuf;
68 APTR bm_DMACopyToBuf32;
69 APTR bm_CopyToBuf;
70 APTR bm_PacketFilter;
71 struct List bm_RXQueue; /* read requests */
74 /* Multicast address range record - private
76 struct MulticastAddressRange
78 struct Node mar_Node; /* 0 list node */
79 ULONG mar_UseCount; /* 8 number of times used */
80 UBYTE mar_LowerAddr[ETHER_ADDR_SIZE]; /* 12 multicast address lower bound */
81 UBYTE mar_UpperAddr[ETHER_ADDR_SIZE]; /* 18 multicast address upper bound */
84 struct PacketTypeStats
86 struct Node pts_Node;
87 ULONG pts_PacketType;
88 struct Sana2PacketTypeStats pts_Stats;
92 struct NepEthDevBase
94 struct Library np_Library; /* standard */
95 UWORD np_Flags; /* various flags */
97 BPTR np_SegList; /* device seglist */
98 struct NepEthBase *np_ClsBase; /* pointer to class base */
99 struct Library *np_UtilityBase; /* cached utilitybase */
102 struct NepClassEth
104 struct Unit ncp_Unit; /* Unit structure */
105 ULONG ncp_UnitNo; /* Unit number */
106 ULONG ncp_OpenFlags; /* Flags used to open the device */
107 struct NepEthBase *ncp_ClsBase; /* Up linkage */
108 struct NepEthDevBase *ncp_DevBase; /* Device base */
109 struct Library *ncp_Base; /* Poseidon base */
110 struct PsdDevice *ncp_Device; /* Up linkage */
111 struct PsdConfig *ncp_Config; /* Up linkage */
112 struct PsdInterface *ncp_Interface; /* Up linkage */
113 struct Task *ncp_ReadySigTask; /* Task to send ready signal to */
114 LONG ncp_ReadySignal; /* Signal to send when ready */
115 struct Task *ncp_Task; /* Subtask */
116 struct MsgPort *ncp_TaskMsgPort; /* Message Port of Subtask */
118 struct PsdPipe *ncp_EP0Pipe; /* Endpoint 0 pipe */
119 struct PsdEndpoint *ncp_EPOut; /* Endpoint 1 */
120 struct PsdPipe *ncp_EPOutPipe[2]; /* Endpoint 1 pipes */
121 struct PsdEndpoint *ncp_EPIn; /* Endpoint 2 */
122 struct PsdPipe *ncp_EPInPipe; /* Endpoint 2 pipe */
123 struct MsgPort *ncp_DevMsgPort; /* Message Port for IOParReq */
124 UWORD ncp_UnitProdID; /* ProductID of unit */
125 UWORD ncp_UnitVendorID; /* VendorID of unit */
126 //BOOL ncp_DenyRequests; /* Do not accept further IO requests */
128 struct List ncp_BufManList; /* Buffer Managers */
129 struct List ncp_EventList; /* List for DoEvent */
130 struct List ncp_TrackList; /* List of trackables */
131 struct List ncp_Multicasts; /* List of multicast addresses */
132 UBYTE ncp_MacAddress[ETHER_ADDR_SIZE]; /* Current Mac Address */
133 UBYTE ncp_ROMAddress[ETHER_ADDR_SIZE]; /* ROM Mac Address */
134 UBYTE ncp_MulticastArray[8]; /* array for the multicast hashes */
135 ULONG ncp_StateFlags; /* State of the unit */
137 ULONG ncp_Retries; /* tx collision count */
138 ULONG ncp_BadMulticasts; /* bad multicast count */
140 UBYTE *ncp_ReadBuffer[2]; /* Packet Double Buffered Read Buffer */
141 UBYTE *ncp_WriteBuffer[2]; /* Packet Write Buffer */
143 UWORD ncp_ReadBufNum; /* Next Read Buffer to use */
144 UWORD ncp_WriteBufNum; /* Next Write Buffer to use */
146 struct Sana2DeviceStats ncp_DeviceStats; /* SANA Stats */
147 struct Sana2PacketTypeStats *ncp_TypeStats2048; /* IP protocol stats ptr, or NULL */
148 struct Sana2PacketTypeStats *ncp_TypeStats2054; /* ARP protocol stats ptr, or NULL */
150 UBYTE *ncp_ReadPending; /* read IORequest pending */
151 struct IOSana2Req *ncp_WritePending[2]; /* write IORequest pending */
152 struct List ncp_OrphanQueue; /* List of orphan read requests */
153 struct List ncp_WriteQueue; /* List of write requests */
155 UBYTE ncp_DevIDString[128]; /* Device ID String */
157 BOOL ncp_UsingDefaultCfg;
158 struct ClsDevCfg *ncp_CDC;
160 struct Library *ncp_MUIBase; /* MUI master base */
161 struct Library *ncp_PsdBase; /* Poseidon base */
162 struct Library *ncp_IntBase; /* Intuition base */
163 struct Task *ncp_GUITask; /* GUI Task */
164 struct NepClassHid *ncp_GUIBinding; /* Window of binding that's open */
166 Object *ncp_App;
167 Object *ncp_MainWindow;
169 Object *ncp_UnitObj;
170 Object *ncp_MACAddressObj;
172 Object *ncp_UseObj;
173 Object *ncp_SetDefaultObj;
174 Object *ncp_CloseObj;
176 Object *ncp_AboutMI;
177 Object *ncp_UseMI;
178 Object *ncp_SetDefaultMI;
179 Object *ncp_MUIPrefsMI;
183 struct NepEthBase
185 struct Library nh_Library; /* standard */
186 UWORD nh_Flags; /* various flags */
188 struct Library *nh_UtilityBase; /* utility base */
190 struct NepEthDevBase *nh_DevBase; /* base of device created */
191 struct List nh_Units; /* List of units available */
193 struct NepClassEth nh_DummyNCP; /* Dummy ncp for default config */
197 #endif /* ETHWRAP_H */