4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
34 * Attribute types and structures.
36 #define PATTR_DSTADDRSAP 0x1 /* destination physical address+SAP */
37 #define PATTR_SRCADDRSAP 0x2 /* source physical address+SAP */
38 #define PATTR_HCKSUM 0x3 /* hardware checksum attribute */
39 #define PATTR_ZCOPY 0x4 /* zerocopy attribute */
42 * Structure shared by {source,destination} physical address+SAP attributes.
44 typedef struct pattr_addr_s
{
45 uint8_t addr_is_group
; /* address is broadcast or multicast */
46 uint8_t addr_len
; /* length of address */
47 uint8_t addr
[1]; /* address */
51 * Structure used for Hardware Checksum attribute.
54 typedef struct pattr_hcksum_s
{
55 uint32_t hcksum_start_offset
;
56 uint32_t hcksum_stuff_offset
;
57 uint32_t hcksum_end_offset
;
60 uint16_t inet_cksum
; /* to store H/W computed cksum value */
62 uint32_t hcksum_flags
;
66 * Values for hcksum_flags
68 #define HCK_IPV4_HDRCKSUM 0x01 /* On Transmit: Compute IP header */
69 /* checksum in hardware. */
71 #define HCK_IPV4_HDRCKSUM_OK 0x01 /* On Receive: IP header checksum */
72 /* was verified by h/w and is */
75 #define HCK_PARTIALCKSUM 0x02 /* On Transmit: Compute partial 1's */
76 /* complement checksum based on */
77 /* start, stuff and end offsets. */
78 /* On Receive : Partial checksum */
79 /* computed and attached. */
81 #define HCK_FULLCKSUM 0x04 /* On Transmit: Compute full(in case */
82 /* of TCP/UDP, full is pseudo-header */
83 /* + header + payload) checksum for */
85 /* On Receive : Full checksum */
86 /* computed in h/w and is attached */
88 #define HCK_FULLCKSUM_OK 0x08 /* On Transmit: N/A */
89 /* On Receive: Full checksum status */
90 /* If set, implies full checksum */
91 /* computation was successful */
92 /* i.e. checksum was correct. */
93 /* If it is not set, IP will also */
94 /* check the attached h/w computed */
95 /* checksum value to determine if */
96 /* checksum was bad */
98 #define HCK_FLAGS (HCK_IPV4_HDRCKSUM | HCK_PARTIALCKSUM | \
99 HCK_FULLCKSUM | HCK_FULLCKSUM_OK)
101 * Extended hardware offloading flags that also use hcksum_flags
103 #define HW_LSO 0x10 /* On Transmit: hardware does LSO */
104 /* On Receive: N/A */
106 #define HW_LSO_FLAGS HW_LSO /* All LSO flags, currently only one */
109 * Structure used for zerocopy attribute.
111 typedef struct pattr_zcopy_s
{
119 #endif /* _SYS_PATTR_H */