162306a36Sopenharmony_ci/***********************license start*************** 262306a36Sopenharmony_ci * Author: Cavium Networks 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Contact: support@caviumnetworks.com 562306a36Sopenharmony_ci * This file is part of the OCTEON SDK 662306a36Sopenharmony_ci * 762306a36Sopenharmony_ci * Copyright (c) 2003-2008 Cavium Networks 862306a36Sopenharmony_ci * 962306a36Sopenharmony_ci * This file is free software; you can redistribute it and/or modify 1062306a36Sopenharmony_ci * it under the terms of the GNU General Public License, Version 2, as 1162306a36Sopenharmony_ci * published by the Free Software Foundation. 1262306a36Sopenharmony_ci * 1362306a36Sopenharmony_ci * This file is distributed in the hope that it will be useful, but 1462306a36Sopenharmony_ci * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty 1562306a36Sopenharmony_ci * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or 1662306a36Sopenharmony_ci * NONINFRINGEMENT. See the GNU General Public License for more 1762306a36Sopenharmony_ci * details. 1862306a36Sopenharmony_ci * 1962306a36Sopenharmony_ci * You should have received a copy of the GNU General Public License 2062306a36Sopenharmony_ci * along with this file; if not, write to the Free Software 2162306a36Sopenharmony_ci * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 2262306a36Sopenharmony_ci * or visit http://www.gnu.org/licenses/. 2362306a36Sopenharmony_ci * 2462306a36Sopenharmony_ci * This file may also be available under a different license from Cavium. 2562306a36Sopenharmony_ci * Contact Cavium Networks for more information 2662306a36Sopenharmony_ci ***********************license end**************************************/ 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci/* 2962306a36Sopenharmony_ci * Packet buffer defines. 3062306a36Sopenharmony_ci */ 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci#ifndef __CVMX_PACKET_H__ 3362306a36Sopenharmony_ci#define __CVMX_PACKET_H__ 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci/** 3662306a36Sopenharmony_ci * This structure defines a buffer pointer on Octeon 3762306a36Sopenharmony_ci */ 3862306a36Sopenharmony_ciunion cvmx_buf_ptr { 3962306a36Sopenharmony_ci void *ptr; 4062306a36Sopenharmony_ci uint64_t u64; 4162306a36Sopenharmony_ci struct { 4262306a36Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD 4362306a36Sopenharmony_ci /* if set, invert the "free" pick of the overall 4462306a36Sopenharmony_ci * packet. HW always sets this bit to 0 on inbound 4562306a36Sopenharmony_ci * packet */ 4662306a36Sopenharmony_ci uint64_t i:1; 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci /* Indicates the amount to back up to get to the 4962306a36Sopenharmony_ci * buffer start in cache lines. In most cases this is 5062306a36Sopenharmony_ci * less than one complete cache line, so the value is 5162306a36Sopenharmony_ci * zero */ 5262306a36Sopenharmony_ci uint64_t back:4; 5362306a36Sopenharmony_ci /* The pool that the buffer came from / goes to */ 5462306a36Sopenharmony_ci uint64_t pool:3; 5562306a36Sopenharmony_ci /* The size of the segment pointed to by addr (in bytes) */ 5662306a36Sopenharmony_ci uint64_t size:16; 5762306a36Sopenharmony_ci /* Pointer to the first byte of the data, NOT buffer */ 5862306a36Sopenharmony_ci uint64_t addr:40; 5962306a36Sopenharmony_ci#else 6062306a36Sopenharmony_ci uint64_t addr:40; 6162306a36Sopenharmony_ci uint64_t size:16; 6262306a36Sopenharmony_ci uint64_t pool:3; 6362306a36Sopenharmony_ci uint64_t back:4; 6462306a36Sopenharmony_ci uint64_t i:1; 6562306a36Sopenharmony_ci#endif 6662306a36Sopenharmony_ci } s; 6762306a36Sopenharmony_ci}; 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci#endif /* __CVMX_PACKET_H__ */ 70