IMM_ZC_STRU *CSD_UL_GetQueueFrontNode(IMM_ZC_HEAD_STRU *pstQueue) { IMM_ZC_STRU *pstNode; /* Modified by l60609 for AP适配项目 ,2012-08-31 Begin */ VOS_UINT32 ulLockLevel; ulLockLevel = 0; /* 队列加锁 */ VOS_SpinLockIntLock(&g_stCsdCtx.stSpinLock, ulLockLevel); /* 返回队尾节点指针 */ pstNode = IMM_ZcDequeueHead(pstQueue); /* 队列解锁 */ VOS_SpinUnlockIntUnlock(&g_stCsdCtx.stSpinLock, ulLockLevel); /* Modified by l60609 for AP适配项目 ,2012-08-31 End */ CSD_NORMAL_LOG3(ACPU_PID_CSD, "CSD_UL_GetQueueFrontNode:: Queue len is %d, Pre is 0x%x, Next is 0x%x", pstQueue->qlen, pstQueue->next, pstQueue->prev); return pstNode; }
VOS_UINT32 CSD_UL_InsertQueueTail( IMM_ZC_HEAD_STRU *pstQueueHead, IMM_ZC_STRU *pstNode ) { /* Modified by l60609 for AP适配项目 ,2012-08-31 Begin */ VOS_UINT32 ulLockLevel; ulLockLevel = 0; /* 队列加锁 */ VOS_SpinLockIntLock(&g_stCsdCtx.stSpinLock, ulLockLevel); /* 数据插入队尾 */ IMM_ZcQueueTail(pstQueueHead, pstNode); /* 队列解锁 */ VOS_SpinUnlockIntUnlock(&g_stCsdCtx.stSpinLock, ulLockLevel); /* Modified by l60609 for AP适配项目 ,2012-08-31 End */ CSD_NORMAL_LOG3(ACPU_PID_CSD, "CSD_UL_InsertQueueTail:: Queue len is %d, Pre is 0x%x, Next is 0x%x", pstQueueHead->qlen, pstQueueHead->next, pstQueueHead->prev); return VOS_OK; }
IMM_ZC_STRU *CSD_UL_GetQueueFrontNode(IMM_ZC_HEAD_STRU *pstQueue) { IMM_ZC_STRU *pstNode; VOS_ULONG ulLockLevel; ulLockLevel = 0; /* 队列加锁 */ VOS_SpinLockIntLock(&g_stCsdCtx.stSpinLock, ulLockLevel); /* 返回队尾节点指针 */ pstNode = IMM_ZcDequeueHead(pstQueue); /* 队列解锁 */ VOS_SpinUnlockIntUnlock(&g_stCsdCtx.stSpinLock, ulLockLevel); CSD_NORMAL_LOG3(ACPU_PID_CSD, "CSD_UL_GetQueueFrontNode:: Queue len is %d, Pre is 0x%x, Next is 0x%x", pstQueue->qlen, pstQueue->next, pstQueue->prev); return pstNode; }
VOS_UINT32 CSD_UL_FreeQueue(IMM_ZC_HEAD_STRU *pstQueue) { IMM_ZC_STRU *pstNode; VOS_UINT32 i; VOS_UINT32 ulQueueCnt; ulQueueCnt = IMM_ZcQueueLen(pstQueue); for (i = 0; i < ulQueueCnt; i++) { pstNode = CSD_UL_GetQueueFrontNode(pstQueue); if(VOS_NULL_PTR == pstNode) { CSD_ERROR_LOG1(ACPU_PID_CSD, "CSD_UL_FreeQueue:: CSD_UL_GetQueueFrontNode fail", pstNode); return VOS_ERR; } /*释放数据内存*/ IMM_ZcFree(pstNode); } CSD_NORMAL_LOG3(ACPU_PID_CSD, "CSD_UL_FreeQueue:: Queue len is %d, Pre is 0x%x, Next is 0x%x", pstQueue->qlen, pstQueue->next, pstQueue->prev); return VOS_OK; }
VOS_UINT32 CSD_UL_InsertQueueTail( IMM_ZC_HEAD_STRU *pstQueueHead, IMM_ZC_STRU *pstNode ) { VOS_ULONG ulLockLevel; ulLockLevel = 0; /* 队列加锁 */ VOS_SpinLockIntLock(&g_stCsdCtx.stSpinLock, ulLockLevel); /* 数据插入队尾 */ IMM_ZcQueueTail(pstQueueHead, pstNode); /* 队列解锁 */ VOS_SpinUnlockIntUnlock(&g_stCsdCtx.stSpinLock, ulLockLevel); CSD_NORMAL_LOG3(ACPU_PID_CSD, "CSD_UL_InsertQueueTail:: Queue len is %d, Pre is 0x%x, Next is 0x%x", pstQueueHead->qlen, pstQueueHead->next, pstQueueHead->prev); return VOS_OK; }