2 * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
\r
4 * This software is available to you under the OpenIB.org BSD license
\r
7 * Redistribution and use in source and binary forms, with or
\r
8 * without modification, are permitted provided that the following
\r
9 * conditions are met:
\r
11 * - Redistributions of source code must retain the above
\r
12 * copyright notice, this list of conditions and the following
\r
15 * - Redistributions in binary form must reproduce the above
\r
16 * copyright notice, this list of conditions and the following
\r
17 * disclaimer in the documentation and/or other materials
\r
18 * provided with the distribution.
\r
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
21 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
22 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
23 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
24 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
25 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
26 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
32 #ifndef _VNIC_TRAILER_H_
\r
33 #define _VNIC_TRAILER_H_
\r
35 /* pktFlags values */
\r
36 #define PF_CHASH_VALID 0x01
\r
37 #define PF_IPSEC_VALID 0x02
\r
38 #define PF_TCP_SEGMENT 0x04
\r
39 #define PF_KICK 0x08
\r
40 #define PF_VLAN_INSERT 0x10
\r
41 #define PF_PVID_OVERRIDDEN 0x20
\r
42 #define PF_FCS_INCLUDED 0x40
\r
43 #define PF_FORCE_ROUTE 0x80
\r
45 /* txChksumFlags values */
\r
46 #define TX_CHKSUM_FLAGS_CHECKSUM_V4 0x01
\r
47 #define TX_CHKSUM_FLAGS_CHECKSUM_V6 0x02
\r
48 #define TX_CHKSUM_FLAGS_TCP_CHECKSUM 0x04
\r
49 #define TX_CHKSUM_FLAGS_UDP_CHECKSUM 0x08
\r
50 #define TX_CHKSUM_FLAGS_IP_CHECKSUM 0x10
\r
52 /* rxChksumFlags values */
\r
53 #define RX_CHKSUM_FLAGS_TCP_CHECKSUM_FAILED 0x01
\r
54 #define RX_CHKSUM_FLAGS_UDP_CHECKSUM_FAILED 0x02
\r
55 #define RX_CHKSUM_FLAGS_IP_CHECKSUM_FAILED 0x04
\r
56 #define RX_CHKSUM_FLAGS_TCP_CHECKSUM_SUCCEEDED 0x08
\r
57 #define RX_CHKSUM_FLAGS_UDP_CHECKSUM_SUCCEEDED 0x10
\r
58 #define RX_CHKSUM_FLAGS_IP_CHECKSUM_SUCCEEDED 0x20
\r
59 #define RX_CHKSUM_FLAGS_LOOPBACK 0x40
\r
60 #define RX_CHKSUM_FLAGS_RESERVED 0x80
\r
62 /* connectionHashAndValid values */
\r
63 #define CHV_VALID 0x80
\r
64 #define CHV_HASH_MASH 0x7f
\r
66 /* round down value to align, align must be a power of 2 */
\r
68 #define ROUNDDOWNP2(val, align) \
\r
69 (((uintn_t)(val)) & (~((uintn_t)(align)-1)))
\r
72 /* round up value to align, align must be a power of 2 */
\r
74 #define ROUNDUPP2(val, align) \
\r
75 (((uintn_t)(val) + (uintn_t)(align) - 1) & (~((uintn_t)(align)-1)))
\r
78 #define VIPORT_TRAILER_ALIGNMENT 32
\r
79 #define BUFFER_SIZE(len) (sizeof(ViportTrailer_t) + ROUNDUPP2((len), VIPORT_TRAILER_ALIGNMENT))
\r
80 #define MAX_PAYLOAD(len) ROUNDDOWNP2((len) - sizeof(ViportTrailer_t), VIPORT_TRAILER_ALIGNMENT)
\r
82 #include <complib/cl_packon.h>
\r
84 typedef struct ViportTrailer {
\r
85 int8_t dataAlignmentOffset;
\r
86 uint8_t rndisHeaderLength; /* reserved for use by Edp */
\r
87 uint16_t dataLength;
\r
90 uint8_t txChksumFlags;
\r
92 uint8_t rxChksumFlags;
\r
96 uint32_t ipSecOffloadHandle;
\r
97 uint32_t ipSecNextOffloadHandle;
\r
98 uint8_t destMacAddr[6];
\r
100 uint16_t timeStamp;
\r
102 uint8_t connectionHashAndValid;
\r
105 #include <complib/cl_packoff.h>
\r
107 #endif /* _VNIC_TRAILER_H_ */