| /******************************************************************************* |
| * Copyright (C) Marvell International Ltd. and its affiliates |
| * |
| * Marvell GPL License Option |
| * |
| * If you received this File from Marvell, you may opt to use, redistribute and/or |
| * modify this File in accordance with the terms and conditions of the General |
| * Public License Version 2, June 1991 (the "GPL License"), a copy of which is |
| * available along with the File in the license.txt file or by writing to the Free |
| * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 or |
| * on the worldwide web at http://www.gnu.org/licenses/gpl.txt. |
| * |
| * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE IMPLIED |
| * WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY |
| * DISCLAIMED. The GPL License provides additional details about this warranty |
| * disclaimer. |
| ********************************************************************************/ |
| |
| #ifndef _BCMBUF_H_ |
| #define _BCMBUF_H_ |
| |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| |
| typedef struct DHUB_CFGQ_T { |
| int base_addr; |
| int *addr; |
| int len; |
| } DHUB_CFGQ; |
| |
| /* structure of a buffer descriptor */ |
| /* a buffer descriptor contains the pointers of the entire buffer and sub-buffers */ |
| typedef struct BCMBUF_T { |
| int addr; |
| unsigned int *head; // head of total BCM buffer |
| unsigned int *dv1_head; // head of BCM sub-buffer used for CPCB0 |
| unsigned int *dv3_head; // head of BCM sub-buffer used for CPCB2 |
| unsigned int *tail; // tail of the buffer, used for checking wrap around |
| unsigned int *writer; // write pointer of queue, update with shadow_tail with commit |
| int size; // size of total BCM buffer |
| int subID; // sub-buffer ID currently in use |
| } BCMBUF; |
| |
| int THINVPP_BCMBUF_Create(BCMBUF *pbcmbuf,int size); |
| int THINVPP_BCMBUF_Destroy(BCMBUF *pbcmbuf); |
| int THINVPP_BCMBUF_Reset(BCMBUF *pbcmbuf); |
| void THINVPP_BCMBUF_Select(BCMBUF *pbcmbuf, int subID); |
| int THINVPP_BCMBUF_Write(BCMBUF *pbcmbuf, unsigned int address, unsigned int value); |
| void THINVPP_BCMBUF_HardwareTrans(BCMBUF *pbcmbuf, int block); |
| |
| int THINVPP_CFGQ_Create(DHUB_CFGQ *cfgQ, int size); |
| int THINVPP_CFGQ_Destroy(DHUB_CFGQ *cfgQ); |
| int THINVPP_BCMDHUB_CFGQ_Commit(DHUB_CFGQ *cfgQ, int cpcbID); |
| int THINVPP_BCMBUF_To_CFGQ(BCMBUF *pbcmbuf, DHUB_CFGQ *cfgQ); |
| void THINVPP_CFGQ_To_CFGQ(DHUB_CFGQ *src_cfgQ, DHUB_CFGQ *cfgQ); |
| |
| #ifdef __cplusplus |
| } |
| #endif |
| |
| #endif |