cvmx-packet.h revision 210284
1194612Sed/***********************license start***************
2194612Sed *  Copyright (c) 2003-2008 Cavium Networks (support@cavium.com). All rights
3194612Sed *  reserved.
4194612Sed *
5194612Sed *
6194612Sed *  Redistribution and use in source and binary forms, with or without
7194612Sed *  modification, are permitted provided that the following conditions are
8194612Sed *  met:
9194612Sed *
10194612Sed *      * Redistributions of source code must retain the above copyright
11194612Sed *        notice, this list of conditions and the following disclaimer.
12194612Sed *
13194612Sed *      * Redistributions in binary form must reproduce the above
14194612Sed *        copyright notice, this list of conditions and the following
15194612Sed *        disclaimer in the documentation and/or other materials provided
16249423Sdim *        with the distribution.
17249423Sdim *
18249423Sdim *      * Neither the name of Cavium Networks nor the names of
19218893Sdim *        its contributors may be used to endorse or promote products
20249423Sdim *        derived from this software without specific prior written
21194612Sed *        permission.
22194612Sed *
23218893Sdim *  TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
24194612Sed *  AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS
25194612Sed *  OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
26249423Sdim *  RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY
27249423Sdim *  REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT
28198090Srdivacky *  DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES
29198090Srdivacky *  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR
30198090Srdivacky *  PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET
31198090Srdivacky *  POSSESSION OR CORRESPONDENCE TO DESCRIPTION.  THE ENTIRE RISK ARISING OUT
32198090Srdivacky *  OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
33198090Srdivacky *
34198090Srdivacky *
35198090Srdivacky *  For any questions regarding licensing please contact marketing@caviumnetworks.com
36198090Srdivacky *
37198090Srdivacky ***********************license end**************************************/
38198090Srdivacky
39198090Srdivacky
40198090Srdivacky
41194612Sed
42198090Srdivacky
43198090Srdivacky
44198090Srdivacky/**
45203954Srdivacky * @file
46194612Sed *
47194612Sed * Packet buffer defines.
48194612Sed *
49194612Sed * <hr>$Revision: 41586 $<hr>
50194612Sed *
51194612Sed *
52194612Sed */
53194612Sed
54194612Sed#ifndef __CVMX_PACKET_H__
55263508Sdim#define __CVMX_PACKET_H__
56263508Sdim
57263508Sdim#ifdef	__cplusplus
58218893Sdimextern "C" {
59223017Sdim#endif
60223017Sdim
61203954Srdivacky/**
62194612Sed * This structure defines a buffer pointer on Octeon
63194612Sed */
64223017Sdimtypedef union
65223017Sdim{
66194612Sed    void*           ptr;
67203954Srdivacky    uint64_t        u64;
68263508Sdim    struct
69194612Sed    {
70218893Sdim        uint64_t    i    : 1; /**< if set, invert the "free" pick of the overall packet. HW always sets this bit to 0 on inbound packet */
71194612Sed        uint64_t    back : 4; /**< Indicates the amount to back up to get to the buffer start in cache lines. In most cases
72194612Sed                                this is less than one complete cache line, so the value is zero */
73194612Sed        uint64_t    pool : 3; /**< The pool that the buffer came from / goes to */
74194612Sed        uint64_t    size :16; /**< The size of the segment pointed to by addr (in bytes) */
75194612Sed        uint64_t    addr :40; /**< Pointer to the first byte of the data, NOT buffer */
76194612Sed    } s;
77194612Sed} cvmx_buf_ptr_t;
78194612Sed
79194612Sed#ifdef	__cplusplus
80194612Sed}
81194612Sed#endif
82194612Sed
83194612Sed#endif /*  __CVMX_PACKET_H__ */
84194612Sed
85194612Sed