1210284Sjmallett/***********************license start***************
2232812Sjmallett * Copyright (c) 2003-2010  Cavium Inc. (support@cavium.com). All rights
3215990Sjmallett * reserved.
4210284Sjmallett *
5210284Sjmallett *
6215990Sjmallett * Redistribution and use in source and binary forms, with or without
7215990Sjmallett * modification, are permitted provided that the following conditions are
8215990Sjmallett * met:
9210284Sjmallett *
10215990Sjmallett *   * Redistributions of source code must retain the above copyright
11215990Sjmallett *     notice, this list of conditions and the following disclaimer.
12210284Sjmallett *
13215990Sjmallett *   * Redistributions in binary form must reproduce the above
14215990Sjmallett *     copyright notice, this list of conditions and the following
15215990Sjmallett *     disclaimer in the documentation and/or other materials provided
16215990Sjmallett *     with the distribution.
17210284Sjmallett
18232812Sjmallett *   * Neither the name of Cavium Inc. nor the names of
19215990Sjmallett *     its contributors may be used to endorse or promote products
20215990Sjmallett *     derived from this software without specific prior written
21215990Sjmallett *     permission.
22210284Sjmallett
23215990Sjmallett * This Software, including technical data, may be subject to U.S. export  control
24215990Sjmallett * laws, including the U.S. Export Administration Act and its  associated
25215990Sjmallett * regulations, and may be subject to export or import  regulations in other
26215990Sjmallett * countries.
27210284Sjmallett
28215990Sjmallett * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29232812Sjmallett * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR
30215990Sjmallett * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31215990Sjmallett * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32215990Sjmallett * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33215990Sjmallett * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34215990Sjmallett * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35215990Sjmallett * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36215990Sjmallett * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE  RISK ARISING OUT OF USE OR
37215990Sjmallett * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38215990Sjmallett ***********************license end**************************************/
39210284Sjmallett
40210284Sjmallett
41210284Sjmallett/**
42210284Sjmallett * @file
43210284Sjmallett *
44210284Sjmallett * Packet buffer defines.
45210284Sjmallett *
46232812Sjmallett * <hr>$Revision: 70030 $<hr>
47210284Sjmallett *
48210284Sjmallett */
49210284Sjmallett
50210284Sjmallett#ifndef __CVMX_PACKET_H__
51210284Sjmallett#define __CVMX_PACKET_H__
52210284Sjmallett
53210284Sjmallett#ifdef	__cplusplus
54210284Sjmallettextern "C" {
55210284Sjmallett#endif
56210284Sjmallett
57210284Sjmallett/**
58210284Sjmallett * This structure defines a buffer pointer on Octeon
59210284Sjmallett */
60215990Sjmallettunion cvmx_buf_ptr {
61210284Sjmallett    void*           ptr;
62210284Sjmallett    uint64_t        u64;
63210284Sjmallett    struct
64210284Sjmallett    {
65210284Sjmallett        uint64_t    i    : 1; /**< if set, invert the "free" pick of the overall packet. HW always sets this bit to 0 on inbound packet */
66210284Sjmallett        uint64_t    back : 4; /**< Indicates the amount to back up to get to the buffer start in cache lines. In most cases
67210284Sjmallett                                this is less than one complete cache line, so the value is zero */
68210284Sjmallett        uint64_t    pool : 3; /**< The pool that the buffer came from / goes to */
69210284Sjmallett        uint64_t    size :16; /**< The size of the segment pointed to by addr (in bytes) */
70210284Sjmallett        uint64_t    addr :40; /**< Pointer to the first byte of the data, NOT buffer */
71210284Sjmallett    } s;
72215990Sjmallett};
73210284Sjmallett
74215990Sjmalletttypedef union cvmx_buf_ptr cvmx_buf_ptr_t;
75215990Sjmallett
76210284Sjmallett#ifdef	__cplusplus
77210284Sjmallett}
78210284Sjmallett#endif
79210284Sjmallett
80210284Sjmallett#endif /*  __CVMX_PACKET_H__ */
81210284Sjmallett
82