18c2ecf20Sopenharmony_ci/***********************license start***************
28c2ecf20Sopenharmony_ci * Author: Cavium Networks
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Contact: support@caviumnetworks.com
58c2ecf20Sopenharmony_ci * This file is part of the OCTEON SDK
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (c) 2003-2008 Cavium Networks
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * This file is free software; you can redistribute it and/or modify
108c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License, Version 2, as
118c2ecf20Sopenharmony_ci * published by the Free Software Foundation.
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci * This file is distributed in the hope that it will be useful, but
148c2ecf20Sopenharmony_ci * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
158c2ecf20Sopenharmony_ci * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
168c2ecf20Sopenharmony_ci * NONINFRINGEMENT.  See the GNU General Public License for more
178c2ecf20Sopenharmony_ci * details.
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * You should have received a copy of the GNU General Public License
208c2ecf20Sopenharmony_ci * along with this file; if not, write to the Free Software
218c2ecf20Sopenharmony_ci * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
228c2ecf20Sopenharmony_ci * or visit http://www.gnu.org/licenses/.
238c2ecf20Sopenharmony_ci *
248c2ecf20Sopenharmony_ci * This file may also be available under a different license from Cavium.
258c2ecf20Sopenharmony_ci * Contact Cavium Networks for more information
268c2ecf20Sopenharmony_ci ***********************license end**************************************/
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/*
298c2ecf20Sopenharmony_ci * Packet buffer defines.
308c2ecf20Sopenharmony_ci */
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#ifndef __CVMX_PACKET_H__
338c2ecf20Sopenharmony_ci#define __CVMX_PACKET_H__
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/**
368c2ecf20Sopenharmony_ci * This structure defines a buffer pointer on Octeon
378c2ecf20Sopenharmony_ci */
388c2ecf20Sopenharmony_ciunion cvmx_buf_ptr {
398c2ecf20Sopenharmony_ci	void *ptr;
408c2ecf20Sopenharmony_ci	uint64_t u64;
418c2ecf20Sopenharmony_ci	struct {
428c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN_BITFIELD
438c2ecf20Sopenharmony_ci		/* if set, invert the "free" pick of the overall
448c2ecf20Sopenharmony_ci		 * packet. HW always sets this bit to 0 on inbound
458c2ecf20Sopenharmony_ci		 * packet */
468c2ecf20Sopenharmony_ci		uint64_t i:1;
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci		/* Indicates the amount to back up to get to the
498c2ecf20Sopenharmony_ci		 * buffer start in cache lines. In most cases this is
508c2ecf20Sopenharmony_ci		 * less than one complete cache line, so the value is
518c2ecf20Sopenharmony_ci		 * zero */
528c2ecf20Sopenharmony_ci		uint64_t back:4;
538c2ecf20Sopenharmony_ci		/* The pool that the buffer came from / goes to */
548c2ecf20Sopenharmony_ci		uint64_t pool:3;
558c2ecf20Sopenharmony_ci		/* The size of the segment pointed to by addr (in bytes) */
568c2ecf20Sopenharmony_ci		uint64_t size:16;
578c2ecf20Sopenharmony_ci		/* Pointer to the first byte of the data, NOT buffer */
588c2ecf20Sopenharmony_ci		uint64_t addr:40;
598c2ecf20Sopenharmony_ci#else
608c2ecf20Sopenharmony_ci	        uint64_t addr:40;
618c2ecf20Sopenharmony_ci	        uint64_t size:16;
628c2ecf20Sopenharmony_ci	        uint64_t pool:3;
638c2ecf20Sopenharmony_ci	        uint64_t back:4;
648c2ecf20Sopenharmony_ci	        uint64_t i:1;
658c2ecf20Sopenharmony_ci#endif
668c2ecf20Sopenharmony_ci	} s;
678c2ecf20Sopenharmony_ci};
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci#endif /*  __CVMX_PACKET_H__ */
70