1251875Speter/***********************license start*************** 2251875Speter * Copyright (c) 2003-2010 Cavium Inc. (support@cavium.com). All rights 3251875Speter * reserved. 4251875Speter * 5251875Speter * 6251875Speter * Redistribution and use in source and binary forms, with or without 7251875Speter * modification, are permitted provided that the following conditions are 8251875Speter * met: 9251875Speter * 10251875Speter * * Redistributions of source code must retain the above copyright 11251875Speter * notice, this list of conditions and the following disclaimer. 12251875Speter * 13251875Speter * * Redistributions in binary form must reproduce the above 14251875Speter * copyright notice, this list of conditions and the following 15251875Speter * disclaimer in the documentation and/or other materials provided 16251875Speter * with the distribution. 17251875Speter 18251875Speter * * Neither the name of Cavium Inc. nor the names of 19251875Speter * its contributors may be used to endorse or promote products 20251875Speter * derived from this software without specific prior written 21251875Speter * permission. 22251875Speter 23251875Speter * This Software, including technical data, may be subject to U.S. export control 24251875Speter * laws, including the U.S. Export Administration Act and its associated 25251875Speter * regulations, and may be subject to export or import regulations in other 26251875Speter * countries. 27251875Speter 28251875Speter * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" 29251875Speter * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR 30251875Speter * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO 31251875Speter * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR 32251875Speter * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM 33251875Speter * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, 34251875Speter * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF 35251875Speter * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR 36251875Speter * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR 37251875Speter * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. 38251875Speter ***********************license end**************************************/ 39251875Speter 40251875Speter 41251875Speter/** 42251875Speter * @file 43251875Speter * 44251875Speter * Packet buffer defines. 45251875Speter * 46251875Speter * <hr>$Revision: 70030 $<hr> 47251875Speter * 48251875Speter */ 49251875Speter 50251875Speter#ifndef __CVMX_PACKET_H__ 51251875Speter#define __CVMX_PACKET_H__ 52251875Speter 53251875Speter#ifdef __cplusplus 54251875Speterextern "C" { 55251875Speter#endif 56251875Speter 57251875Speter/** 58251875Speter * This structure defines a buffer pointer on Octeon 59251875Speter */ 60251875Speterunion cvmx_buf_ptr { 61251875Speter void* ptr; 62251875Speter uint64_t u64; 63251875Speter struct 64251875Speter { 65251875Speter uint64_t i : 1; /**< if set, invert the "free" pick of the overall packet. HW always sets this bit to 0 on inbound packet */ 66251875Speter uint64_t back : 4; /**< Indicates the amount to back up to get to the buffer start in cache lines. In most cases 67251875Speter this is less than one complete cache line, so the value is zero */ 68251875Speter uint64_t pool : 3; /**< The pool that the buffer came from / goes to */ 69251875Speter uint64_t size :16; /**< The size of the segment pointed to by addr (in bytes) */ 70251875Speter uint64_t addr :40; /**< Pointer to the first byte of the data, NOT buffer */ 71251875Speter } s; 72251875Speter}; 73251875Speter 74251875Spetertypedef union cvmx_buf_ptr cvmx_buf_ptr_t; 75251875Speter 76251875Speter#ifdef __cplusplus 77251875Speter} 78251875Speter#endif 79251875Speter 80251875Speter#endif /* __CVMX_PACKET_H__ */ 81251875Speter 82251875Speter