summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/fman/Peripherals/FM/Port/fm_port_dsar.h
blob: 95619eff0beedec2170ad231cfd963356c50b467 (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
/*
 * Copyright 2008-2012 Freescale Semiconductor Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of Freescale Semiconductor nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 *
 * ALTERNATIVELY, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") as published by the Free Software
 * Foundation, either version 2 of that License or (at your option) any
 * later version.
 *
 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**************************************************************************//**
 @File          fm_port_dsar.h

 @Description   Deep Sleep Auto Response project - common module header file.               

                Author - Eyal Harari
                
 @Cautions      See the FMan Controller spec and design document for more information.
*//***************************************************************************/

#ifndef __FM_PORT_DSAR_H_
#define __FM_PORT_DSAR_H_

#define DSAR_GETSER_MASK 0xFF0000FF

#if defined(__MWERKS__) && !defined(__GNUC__)
#pragma pack(push,1)
#endif /* defined(__MWERKS__) && ... */ 

/**************************************************************************//**
 @Description   Deep Sleep Auto Response VLAN-IPv4 Binding Table (for ARP/ICMPv4)
                Refer to the FMan Controller spec for more details.
*//***************************************************************************/
typedef _Packed struct
{
        uint32_t ipv4Addr; /*!< 32 bit IPv4 Address. */
        uint16_t vlanId;   /*!< 12 bits VLAN ID. The 4 left-most bits should be cleared                      */
					   /*!< This field should be 0x0000 for an entry with no VLAN tag or a null VLAN ID. */
        uint16_t reserved;
} _PackedType t_DsarArpBindingEntry;

/**************************************************************************//**
 @Description   Deep Sleep Auto Response Address Resolution Protocol Statistics Descriptor
                Refer to the FMan Controller spec for more details.
	            0x00 INVAL_CNT Invalid ARP IPv4-Ethernet counter
	            0x04 ECHO_CNT Echo counter
	            0x08 CD_CNT Conflict Detection counter
	            0x0C AR_CNT Auto-Response counter
	            0x10 RATM_CNT Replies Addressed To Me counter
	            0x14 UKOP_CNT Unknown Operation counter
	            0x18 NMTP_CNT Not my TPA counter
	            0x1C NMVLAN_CNT Not My VLAN counter
*//***************************************************************************/
typedef _Packed struct
{
    uint32_t invalCnt;	/**< Invalid ARP IPv4-Ethernet counter. */
    uint32_t echoCnt;	/**< Echo counter. 						*/
    uint32_t cdCnt;		/**< Conflict Detection counter.		*/
    uint32_t arCnt;		/**< Auto-Response counter.				*/
    uint32_t ratmCnt;	/**< Replies Addressed To Me counter.	*/
    uint32_t ukopCnt;	/**< Unknown Operation counter.			*/
    uint32_t nmtpCnt;	/**< Not my TPA counter.				*/
    uint32_t nmVlanCnt; /**< Not My VLAN counter				*/
} _PackedType t_DsarArpStatistics;


/**************************************************************************//**
 @Description   Deep Sleep Auto Response Address Resolution Protocol Descriptor
                0x0 0-15 Control bits [0-15]. Bit 15  = CDEN.
                0x2 0-15 NumOfBindings Number of entries in the binding list.
                0x4 0-15 BindingsPointer Bindings Pointer. This points to an IPv4-MAC Addresses Bindings list.
                0x6 0-15
                0x8 0-15 StatisticsPointer Statistics Pointer. This field points to the ARP Descriptors statistics data structure.
                0xA 0-15
                0xC 0-15 Reserved Reserved. Must be cleared.
                0xE 015

*//***************************************************************************/
typedef _Packed struct
{
    uint16_t control;                       /** Control bits [0-15]. Bit 15  = CDEN */
    uint16_t numOfBindings;                 /**< Number of VLAN-IPv4 */
    uint32_t p_Bindings;	/**< VLAN-IPv4 Bindings table pointer. */
    uint32_t p_Statistics;   /**< Statistics Data Structure pointer. */
    uint32_t reserved1;                     /**< Reserved. */
} _PackedType t_DsarArpDescriptor;


/**************************************************************************//**
 @Description   Deep Sleep Auto Response VLAN-IPv4 Binding Table (for ARP/ICMPv4)
                Refer to the FMan Controller spec for more details.
*//***************************************************************************/
typedef _Packed struct 
{
    uint32_t ipv4Addr; /*!< 32 bit IPv4 Address. */
	uint16_t vlanId;   /*!< 12 bits VLAN ID. The 4 left-most bits should be cleared                      */
					   /*!< This field should be 0x0000 for an entry with no VLAN tag or a null VLAN ID. */
	uint16_t reserved;
} _PackedType t_DsarIcmpV4BindingEntry;

/**************************************************************************//**
 @Description   Deep Sleep Auto Response ICMPv4 Statistics Descriptor
                Refer to the FMan Controller spec for more details.
                0x00 INVAL_CNT Invalid ICMPv4 header counter
                0x04 NMVLAN_CNT Not My VLAN counter
                0x08 NMIP_CNT Not My IP counter
                0x0C AR_CNT Auto-Response counter
                0x10 CSERR_CNT Checksum Error counter
                0x14 Reserved Reserved
                0x18 Reserved Reserved
                0x1C Reserved Reserved

*//***************************************************************************/
typedef _Packed struct
{
    uint32_t invalCnt;	/**< Invalid ICMPv4 Echo counter. */
    uint32_t nmVlanCnt;	/**< Not My VLAN counter          */
    uint32_t nmIpCnt;	/**< Not My IP counter		      */
    uint32_t arCnt;		/**< Auto-Response counter        */
    uint32_t cserrCnt;	/**< Checksum Error counter       */
    uint32_t reserved0;	/**< Reserved                     */
    uint32_t reserved1;	/**< Reserved                     */
    uint32_t reserved2; /**< Reserved                     */
} _PackedType t_DsarIcmpV4Statistics;



/**************************************************************************//**
 @Description   Deep Sleep Auto Response ICMPv4 Descriptor
                0x0 0-15 Control bits [0-15]
                0x2 0-15 NumOfBindings Number of entries in the binding list.
                0x4 0-15 BindingsPointer Bindings Pointer. This points to an VLAN-IPv4 Addresses Bindings list.
                0x6 0-15
                0x8 0-15 StatisticsPointer Statistics Pointer. This field points to the ICMPv4 statistics data structure.
                0xA 0-15
                0xC 0-15 Reserved Reserved. Must be cleared.
                0xE 015

*//***************************************************************************/
typedef _Packed struct
{
    uint16_t control;                       /** Control bits [0-15].                */
    uint16_t numOfBindings;                 /**< Number of VLAN-IPv4                */
    uint32_t p_Bindings;	/**< VLAN-IPv4 Bindings table pointer.  */
    uint32_t p_Statistics;   /**< Statistics Data Structure pointer. */
    uint32_t reserved1;                     /**< Reserved.                          */
} _PackedType t_DsarIcmpV4Descriptor;

/**************************************************************************//**
 @Description   Deep Sleep Auto Response VLAN-IPv4 Binding Table (for ARP/ICMPv4)
                The 4 left-most bits (15:12) of the VlanId parameter are control flags.
                Flags[3:1] (VlanId[15:13]): Reserved, should be cleared.
                Flags[0] (VlanId[12]): Temporary address.
                • 0 - Assigned IP address.
                • 1- Temporary (tentative) IP address.
                Refer to the FMan Controller spec for more details.
*//***************************************************************************/
typedef _Packed struct 
{
    uint32_t ipv6Addr[4];  /*!< 3 * 32 bit IPv4 Address.                                                    */
	uint16_t resFlags:4;   /*!< reserved flags. should be cleared                                           */
	uint16_t vlanId:12;    /*!< 12 bits VLAN ID.                                                            */
					       /*!< This field should be 0x000 for an entry with no VLAN tag or a null VLAN ID. */
	uint16_t reserved;
} _PackedType t_DsarIcmpV6BindingEntry;

/**************************************************************************//**
 @Description   Deep Sleep Auto Response ICMPv4 Statistics Descriptor
                Refer to the FMan Controller spec for more details.
                0x00 INVAL_CNT Invalid ICMPv4 header counter
                0x04 NMVLAN_CNT Not My VLAN counter
                0x08 NMIP_CNT Not My IP counter
                0x0C AR_CNT Auto-Response counter
                0x10 CSERR_CNT Checksum Error counter
                0x14 MCAST_CNT Multicast counter
                0x18 Reserved Reserved
                0x1C Reserved Reserved

*//***************************************************************************/
typedef _Packed struct
{
    uint32_t invalCnt;	/**< Invalid ICMPv4 Echo counter. */
    uint32_t nmVlanCnt;	/**< Not My VLAN counter          */
    uint32_t nmIpCnt;	/**< Not My IP counter		      */
    uint32_t arCnt;		/**< Auto-Response counter        */
    uint32_t reserved1;	/**< Reserved                     */
    uint32_t reserved2; /**< Reserved                     */
    uint32_t reserved3;	/**< Reserved                     */
    uint32_t reserved4; /**< Reserved                     */
} _PackedType t_DsarIcmpV6Statistics;

/**************************************************************************//**
 @Description   Deep Sleep Auto Response Neighbor Discovery Statistics Descriptor
                0x00 INVAL_CNT Invalid Neighbor Discovery message counter
                0x04 NMVLAN_CNT Not My VLAN counter
                0x08 NMIP_CNT Not My IP counter
                0x0C AR_CNT Auto-Response counter
                0x10 CSERR_CNT Checksum Error counter
                0x14 USADVERT_CNT Unsolicited Neighbor Advertisements counter
                0x18 NMMCAST_CNT Not My Multicast group counter
                0x1C NSLLA_CNT No Source Link-Layer Address counter. Indicates that there was a match on a Target
                     Address of a packet that its source IP address is a unicast address, but the ICMPv6
                     Source Link-layer Address option is omitted
*//***************************************************************************/
typedef _Packed struct
{
    uint32_t invalCnt;	  /**< Invalid ICMPv4 Echo counter.                */
    uint32_t nmVlanCnt;	  /**< Not My VLAN counter                         */
    uint32_t nmIpCnt;	  /**< Not My IP counter		                   */
    uint32_t arCnt;		  /**< Auto-Response counter                       */
    uint32_t reserved1;	  /**< Reserved                                    */
    uint32_t usadvertCnt; /**< Unsolicited Neighbor Advertisements counter */
    uint32_t nmmcastCnt;  /**< Not My Multicast group counter              */
    uint32_t nsllaCnt;    /**< No Source Link-Layer Address counter        */
} _PackedType t_NdStatistics;

/**************************************************************************//**
 @Description   Deep Sleep Auto Response ICMPv6 Descriptor
                0x0 0-15 Control bits [0-15]
                0x2 0-15 NumOfBindings Number of entries in the binding list.
                0x4 0-15 BindingsPointer Bindings Pointer. This points to an VLAN-IPv4 Addresses Bindings list.
                0x6 0-15
                0x8 0-15 StatisticsPointer Statistics Pointer. This field points to the ICMPv4 statistics data structure.
                0xA 0-15
                0xC 0-15 Reserved Reserved. Must be cleared.
                0xE 015

*//***************************************************************************/
typedef _Packed struct
{
    uint16_t control;                       /** Control bits [0-15].                */
    uint16_t numOfBindings;                 /**< Number of VLAN-IPv6                */
    uint32_t p_Bindings;	/**< VLAN-IPv4 Bindings table pointer.  */
    uint32_t p_Statistics;   /**< Statistics Data Structure pointer. */
	uint32_t reserved1;                     /**< Reserved.                          */
} _PackedType t_DsarIcmpV6Descriptor;


/**************************************************************************//**
 @Description   Internet Control Message Protocol (ICMPv6) Echo message header
                The fields names are taken from RFC 4443.
*//***************************************************************************/
/* 0                   1                   2                   3     */
/* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1   */
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
/* |     Type      |     Code      |          Checksum             | */
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
/* |           Identifier          |        Sequence Number        | */
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
/* |     Data ...                                                    */
/* +-+-+-+-+-                                                        */
typedef _Packed struct
{
	uint8_t  type;
	uint8_t  code;
	uint16_t checksum;
	uint16_t identifier;
	uint16_t sequenceNumber;
} _PackedType t_IcmpV6EchoHdr;

/**************************************************************************//**
 @Description   Internet Control Message Protocol (ICMPv6) 
                Neighbor Solicitation/Advertisement header
                The fields names are taken from RFC 4861.
                The R/S/O fields are valid for Neighbor Advertisement only
*//***************************************************************************/
/* 0                   1                   2                   3
 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 * |     Type      |     Code      |          Checksum             |
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 * |R|S|O|                     Reserved                            |
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 * |                                                               |
 * +                                                               +
 * |                                                               |
 * +                       Target Address                          +
 * |                                                               |
 * +                                                               +
 * |                                                               |
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 * |   Options ...
 * +-+-+-+-+-+-+-+-+-+-+-+-
 *
 * Options Format:
 * 0                   1                   2                   3
 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 * |     Type      |    Length     |   Link-Layer Address ...      |
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 * |                  Link-Layer Address                           |
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
typedef _Packed struct
{
	uint8_t  type;
	uint8_t  code;
	uint16_t checksum;
	uint32_t router:1;
	uint32_t solicited:1;
	uint32_t override:1;
	uint32_t reserved:29;
	uint32_t targetAddr[4];
	uint8_t  optionType;
	uint8_t  optionLength;
	uint8_t  linkLayerAddr[6];
} _PackedType t_IcmpV6NdHdr;

/**************************************************************************//**
 @Description   Deep Sleep Auto Response ICMPv6 Descriptor
                0x0 0-15 Control bits [0-15]
                0x2 0-15 NumOfBindings Number of entries in the binding list.
                0x4 0-15 BindingsPointer Bindings Pointer. This points to an VLAN-IPv4 Addresses Bindings list.
                0x6 0-15
                0x8 0-15 StatisticsPointer Statistics Pointer. This field points to the ICMPv4 statistics data structure.
                0xA 0-15
                0xC 0-15 Reserved Reserved. Must be cleared.
                0xE 015

*//***************************************************************************/
typedef _Packed struct
{
    uint16_t control;                       /** Control bits [0-15].                    */
    uint16_t numOfBindings;                 /**< Number of VLAN-IPv6                    */
    uint32_t p_Bindings;	/**< VLAN-IPv4 Bindings table pointer.      */
    uint32_t p_Statistics;   /**< Statistics Data Structure pointer.     */
	uint32_t solicitedAddr;                 /**< Solicited Node Multicast Group Address */
} _PackedType t_DsarNdDescriptor;

/**************************************************************************//**
@Description    Deep Sleep Auto Response SNMP OIDs table entry
                 
*//***************************************************************************/
typedef struct {
    uint16_t oidSize;     /**< Size in octets of the OID. */
    uint16_t resSize;     /**< Size in octets of the value that is attached to the OID. */
    uint32_t p_Oid;       /**< Pointer to the OID. OID is encoded in BER but type and length are excluded. */
    uint32_t resValOrPtr; /**< Value (for up to 4 octets) or pointer to the Value. Encoded in BER. */
    uint32_t reserved;
} t_OidsTblEntry;

/**************************************************************************//**
 @Description   Deep Sleep Auto Response SNMP IPv4 Addresses Table Entry
                Refer to the FMan Controller spec for more details.
*//***************************************************************************/
typedef struct
{
    uint32_t ipv4Addr; /*!< 32 bit IPv4 Address. */
    uint16_t vlanId;   /*!< 12 bits VLAN ID. The 4 left-most bits should be cleared                      */
                       /*!< This field should be 0x0000 for an entry with no VLAN tag or a null VLAN ID. */
    uint16_t reserved;
} t_DsarSnmpIpv4AddrTblEntry;

/**************************************************************************//**
 @Description   Deep Sleep Auto Response SNMP IPv6 Addresses Table Entry
                Refer to the FMan Controller spec for more details.
*//***************************************************************************/
#pragma pack(push,1)
typedef struct
{
    uint32_t ipv6Addr[4];  /*!< 4 * 32 bit IPv6 Address.                                                     */
    uint16_t vlanId;       /*!< 12 bits VLAN ID. The 4 left-most bits should be cleared                      */
                           /*!< This field should be 0x0000 for an entry with no VLAN tag or a null VLAN ID. */
    uint16_t reserved;
} t_DsarSnmpIpv6AddrTblEntry;
#pragma pack(pop)

/**************************************************************************//**
@Description    Deep Sleep Auto Response SNMP statistics table
                 
*//***************************************************************************/
typedef struct {
    uint32_t snmpErrCnt;  /**< Counts SNMP errors (wrong version, BER encoding, format). */
    uint32_t snmpCommunityErrCnt; /**< Counts messages that were dropped due to insufficient permission. */
    uint32_t snmpTotalDiscardCnt; /**< Counts any message that was dropped. */
    uint32_t snmpGetReqCnt; /**< Counts the number of get-request messages */
    uint32_t snmpGetNextReqCnt; /**< Counts the number of get-next-request messages */
} t_DsarSnmpStatistics;

/**************************************************************************//**
 @Description   Deep Sleep Auto Response SNMP Descriptor

*//***************************************************************************/
typedef struct
{
    uint16_t control;                          /**< Control bits [0-15]. */
    uint16_t maxSnmpMsgLength;                 /**< Maximal allowed SNMP message length. */
    uint16_t numOfIpv4Addresses;               /**< Number of entries in IPv4 addresses table. */
    uint16_t numOfIpv6Addresses;               /**< Number of entries in IPv6 addresses table. */
    uint32_t p_Ipv4AddrTbl; /**< Pointer to IPv4 addresses table. */
    uint32_t p_Ipv6AddrTbl; /**< Pointer to IPv6 addresses table. */
    uint32_t p_RdOnlyCommunityStr;             /**< Pointer to the Read Only Community String. */
    uint32_t p_RdWrCommunityStr;               /**< Pointer to the Read Write Community String. */
    uint32_t p_OidsTbl;                 /**< Pointer to OIDs table. */
    uint32_t oidsTblSize;                      /**< Number of entries in OIDs table. */
    uint32_t p_Statistics;                 /**< Pointer to SNMP statistics table. */
} t_DsarSnmpDescriptor;

/**************************************************************************//**
@Description    Deep Sleep Auto Response (Common) Statistics
                 
*//***************************************************************************/
typedef _Packed struct {
	uint32_t dsarDiscarded;
	uint32_t dsarErrDiscarded;
	uint32_t dsarFragDiscarded;
	uint32_t dsarTunnelDiscarded;
	uint32_t dsarArpDiscarded;
	uint32_t dsarIpDiscarded;
	uint32_t dsarTcpDiscarded;
	uint32_t dsarUdpDiscarded;
	uint32_t dsarIcmpV6ChecksumErr; /* ICMPv6 Checksum Error counter */
	uint32_t dsarIcmpV6OtherType;   /* ICMPv6 'Other' type (not Echo or Neighbor Solicitaion/Advertisement counter */
	uint32_t dsarIcmpV4OtherType;   /* ICMPv4 'Other' type (not Echo) counter */
} _PackedType t_ArStatistics;


/**************************************************************************//**
@Description    Deep Sleep Auto Response TCP/UDP port filter table entry
                 
*//***************************************************************************/
typedef _Packed struct {
	uint32_t	Ports;
	uint32_t	PortsMask;
} _PackedType t_PortTblEntry;


					
/**************************************************************************//**
@Description    Deep Sleep Auto Response Common Parameters Descriptor
                 
*//***************************************************************************/
typedef _Packed struct {
	uint8_t   arTxPort;            /* 0x00 0-7 Auto Response Transmit Port number            */
	uint8_t   controlBits;         /* 0x00 8-15 Auto Response control bits                   */
	uint16_t  res1;                /* 0x00 16-31 Reserved                                    */
	uint32_t  activeHPNIA;         /* 0x04 0-31 Active mode Hardware Parser NIA              */
	uint16_t  snmpPort;            /* 0x08 0-15 SNMP Port.                                   */
	uint8_t   macStationAddr[6];   /* 0x08 16-31 and 0x0C 0-31 MAC Station Address           */
	uint8_t   res2;				   /* 0x10 0-7 Reserved				    					 */
	uint8_t   filterControl;       /* 0x10 8-15 Filtering Control Bits.                      */
	uint16_t   tcpControlPass;	   /* 0x10 16-31 TCP control pass flags					     */
	uint8_t   ipProtocolTblSize;   /* 0x14 0-7 IP Protocol Table Size.                       */
	uint8_t   udpPortTblSize;      /* 0x14 8-15 UDP Port Table Size.                         */
	uint8_t   tcpPortTblSize;      /* 0x14 16-23 TCP Port Table Size.                        */
	uint8_t   res3;                /* 0x14 24-31 Reserved                                    */
	uint32_t  p_IpProtocolFiltTbl; /* 0x18 0-31 Pointer to IP Protocol Filter Table          */
	uint32_t p_UdpPortFiltTbl; /* 0x1C 0-31 Pointer to UDP Port Filter Table          */
	uint32_t p_TcpPortFiltTbl; /* 0x20 0-31 Pointer to TCP Port Filter Table          */
	uint32_t res4;                 /* 0x24 Reserved                                          */
	uint32_t p_ArpDescriptor;     /* 0x28 0-31 ARP Descriptor Pointer.                      */
	uint32_t p_NdDescriptor;      /* 0x2C 0-31 Neighbor Discovery Descriptor.               */
	uint32_t p_IcmpV4Descriptor;  /* 0x30 0-31 ICMPv4 Descriptor pointer.                   */
	uint32_t p_IcmpV6Descriptor;  /* 0x34 0-31 ICMPv6 Descriptor pointer.                   */
	uint32_t p_SnmpDescriptor;    /* 0x38 0-31 SNMP Descriptor pointer.                     */
	uint32_t p_ArStats;     /* 0x3C 0-31 Pointer to Auto Response Statistics          */
} _PackedType t_ArCommonDesc;

#if defined(__MWERKS__) && !defined(__GNUC__)
#pragma pack(pop)
#endif /* defined(__MWERKS__) && ... */ 

/* t_ArCommonDesc.filterControl bits */
#define	IP_PROT_TBL_PASS_MASK	0x08
#define UDP_PORT_TBL_PASS_MASK	0x04
#define TCP_PORT_TBL_PASS_MASK	0x02

/* Offset of TCF flags within TCP packet */
#define TCP_FLAGS_OFFSET 12


#endif /* __FM_PORT_DSAR_H_ */