/******************************************************************************* * **+--------------------------------------------------------------------------+** * **| **** |** * **| **** |** * **| ******o*** |** * **| ********_///_**** |** * **| ***** /_//_/ **** |** * **| ** ** (__/ **** |** * **| ********* |** * **| **** |** * **| *** |** * **| |** * **| Copyright (c) 1998-2006 Texas Instruments Incorporated |** * **| ALL RIGHTS RESERVED |** * **| |** * **+--------------------------------------------------------------------------+** * *******************************************************************************/ /** \file pal_cppi4TxRx.c * \brief PAL CPPI4 Send/Receive functionality Source file * * This file contains the send/receive core functionality for CPPI4 * device based upon PSP Framework architecture. * * @author Greg Guyotte * */ /* Includes */ #include "pal_cppi4Pvt.h" /** * * PAL_cppi4RxFreeBDFlush * * - read one descriptor off of a Rx push queue. Used in Rx teardown. * */ PAL_Cppi4BD * PAL_cppi4RxFreeBDFlush (PAL_Cppi4RxChHnd * hnd, Ptr param) { PAL_Cppi4RxChObj *rxChObj = (PAL_Cppi4RxChObj *) hnd; Uint32 retBD = rxChObj->rxFreeQueue->Queue; if (!(retBD & 0x7FFFFFFF)) { retBD = 0; rxChObj->rxFreeQueue->Queue = 0; } return ((PAL_Cppi4BD *) retBD); } /** * * PAL_cppi4RxFreeBDPush * * - queue a buffer descriptor and buffer onto a Rx free queue * */ PAL_Result PAL_cppi4RxFreeBDPush (PAL_Cppi4RxChHnd * hnd, PAL_Cppi4BD * bdAddr, Ptr param) { /* bk */ /* static Uint32 * bdRegAddr = (Uint32 *)0xA3068200; */ /* end bk */ PAL_Cppi4RxChObj *rxChObj = (PAL_Cppi4RxChObj *) hnd; /* bk */ /* rxChObj->rxFreeQueue = bdRegAddr; */ /* bdRegAddr += 2; */ /* end bk */ printk("[bk] %s: rxFreeQueue = %p\n",__FUNCTION__,rxChObj->rxFreeQueue); printk("[bk] %s: rxFreeQueue->Queue Addr = %p\n",__FUNCTION__,&(rxChObj->rxFreeQueue->Queue)); rxChObj->rxFreeQueue->Queue = (Uint32) bdAddr; printk("[bk] %s: Queue = %p\n",__FUNCTION__,rxChObj->rxFreeQueue->Queue); return (PAL_SOK); } /** * * PAL_cppi4TxFlush * * - read one descriptor off of a TX push queue. Used in Tx teardown . * */ PAL_Cppi4BD * PAL_cppi4TxFlush (PAL_Cppi4TxChHnd * hnd, Uint32 queuePriority, Ptr param) { PAL_Cppi4TxChObj *txChObj = (PAL_Cppi4TxChObj *) hnd; Uint32 retBD = txChObj->txQueue->Queue[queuePriority]; if (!(retBD & 0x7FFFFFFF)) { retBD = 0; txChObj->txQueue->Queue[queuePriority] = 0; } return ((PAL_Cppi4BD *) retBD); } /** * * PAL_cppi4TxPush * * - queue a buffer descriptor onto a Tx hardware queue * */ PAL_Result PAL_cppi4TxPush (PAL_Cppi4TxChHnd * hnd, PAL_Cppi4BD * bdAddr, Uint32 queuePriority, Ptr param) { PAL_Cppi4TxChObj *txChObj = (PAL_Cppi4TxChObj *) hnd; txChObj->txQueue->Queue[queuePriority] = (Uint32) bdAddr; return (PAL_SOK); } /* EXPORT_SYMBOL(PAL_cppi4RxFreeBDFlush); EXPORT_SYMBOL(PAL_cppi4RxFreeBDPush); EXPORT_SYMBOL(PAL_cppi4TxFlush); EXPORT_SYMBOL(PAL_cppi4TxPush); */