PMESH_MULTIPATH_ENTRY MultipathEntyAlloc( IN PRTMP_ADAPTER pAd) { PMESH_MULTIPATH_ENTRY pEntry; RTMP_SEM_LOCK(&pAd->MeshTab.MultipathTabLock); pEntry = (PMESH_MULTIPATH_ENTRY)removeHeadList(&pAd->MeshTab.MultipathEntryFreeList); RTMP_SEM_UNLOCK(&pAd->MeshTab.MultipathTabLock); return pEntry; }
static inline PMEMBER_ENTRY AllocaGrpMemberEntry( IN PMULTICAST_FILTER_TABLE pMulticastFilterTable) { PMEMBER_ENTRY pMemberEntry; RTMP_SEM_LOCK(&pMulticastFilterTable->FreeMemberPoolTabLock); pMemberEntry = (PMEMBER_ENTRY)removeHeadList(&pMulticastFilterTable->freeEntryList); RTMP_SEM_UNLOCK(&pMulticastFilterTable->FreeMemberPoolTabLock); return (PMEMBER_ENTRY)pMemberEntry; }
PCLIWDS_PROXY_ENTRY CliWdsEntyAlloc( IN PRTMP_ADAPTER pAd) { PCLIWDS_PROXY_ENTRY pCliWdsEntry; RTMP_SEM_LOCK(&pAd->ApCfg.CliWdsTabLock); pCliWdsEntry = (PCLIWDS_PROXY_ENTRY)removeHeadList(&pAd->ApCfg.CliWdsEntryFreeList); RTMP_SEM_UNLOCK(&pAd->ApCfg.CliWdsTabLock); return pCliWdsEntry; }
VOID MultipathListDelete( IN PRTMP_ADAPTER pAd, IN UCHAR LinkIdx) { ULONG i; PMESH_MULTIPATH_ENTRY pEntry; if (!VALID_MESH_LINK_ID(LinkIdx)) return; DBGPRINT(RT_DEBUG_TRACE, ("release all multipath pkt of link(%d)\n", LinkIdx)); for (i = 0; i < MULTIPATH_HASH_TAB_SIZE; i++) { pEntry = (PMESH_MULTIPATH_ENTRY)removeHeadList(&pAd->MeshTab.MeshLink[LinkIdx].Entry.MultiPathHash[i]); while (pEntry != NULL) { MultipathEntyFree(pAd, pEntry); pEntry = (PMESH_MULTIPATH_ENTRY)removeHeadList(&pAd->MeshTab.MeshLink[LinkIdx].Entry.MultiPathHash[i]); } } return; }
VOID releaseNetIf( IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry) { PNETIF_ENTRY pNetIfEntry = NULL; PLIST_HEADER pNetIfList = &pBlockQueueEntry->NetIfList; while((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(pNetIfList)) != NULL) { PNET_DEV pNetDev = pNetIfEntry->pNetDev; RTMP_OS_NETDEV_WAKE_QUEUE(pNetDev); insertTailList(&freeNetIfEntryList, (PLIST_ENTRY)pNetIfEntry); DBGPRINT(RT_DEBUG_TRACE, ("RTMP_OS_NETDEV_WAKE_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); } pBlockQueueEntry->SwTxQueueBlockFlag = FALSE; return; }
VOID releaseNetIf( IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry) { PNETIF_ENTRY pNetIfEntry = NULL; PLIST_HEADER pNetIfList = &pBlockQueueEntry->NetIfList; while((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(pNetIfList)) != NULL) { PNET_DEV pNetDev = pNetIfEntry->pNetDev; netif_wake_queue(pNetDev); insertTailList(&freeNetIfEntryList, (PLIST_ENTRY)pNetIfEntry); DBGPRINT(RT_DEBUG_TRACE, "netif_wake_queue(%s)\n", pNetDev->name); } pBlockQueueEntry->SwTxQueueBlockFlag = FALSE; return; }
BOOLEAN blockNetIf(BLOCK_QUEUE_ENTRY *pBlockQueueEntry, PNET_DEV pNetDev) { NETIF_ENTRY *pNetIfEntry = NULL; if ((pNetIfEntry = (NETIF_ENTRY *)removeHeadList(&freeNetIfEntryList)) != NULL) { RTMP_OS_NETDEV_STOP_QUEUE(pNetDev); pNetIfEntry->pNetDev = pNetDev; insertTailList(&pBlockQueueEntry->NetIfList, (RT_LIST_ENTRY *)pNetIfEntry); pBlockQueueEntry->SwTxQueueBlockFlag = TRUE; MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("RTMP_OS_NETDEV_STOP_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); } else return FALSE; return TRUE; }
VOID releaseNetIf(BLOCK_QUEUE_ENTRY *pBlockQueueEntry) { NETIF_ENTRY *pNetIfEntry = NULL; LIST_HEADER *pNetIfList = &pBlockQueueEntry->NetIfList; while((pNetIfEntry = (NETIF_ENTRY *)removeHeadList(pNetIfList)) != NULL) { PNET_DEV pNetDev = pNetIfEntry->pNetDev; if (pNetDev) { RTMP_OS_NETDEV_WAKE_QUEUE(pNetDev); MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("RTMP_OS_NETDEV_WAKE_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); } insertTailList(&freeNetIfEntryList, (RT_LIST_ENTRY *)pNetIfEntry); } pBlockQueueEntry->SwTxQueueBlockFlag = FALSE; return; }
BOOLEAN blockNetIf( IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry, IN PNET_DEV pNetDev) { PNETIF_ENTRY pNetIfEntry = NULL; if ((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(&freeNetIfEntryList)) != NULL) { RTMP_OS_NETDEV_STOP_QUEUE(pNetDev); pNetIfEntry->pNetDev = pNetDev; insertTailList(&pBlockQueueEntry->NetIfList, (PLIST_ENTRY)pNetIfEntry); pBlockQueueEntry->SwTxQueueBlockFlag = TRUE; DBGPRINT(RT_DEBUG_TRACE, ("RTMP_OS_NETDEV_STOP_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); } else return FALSE; return TRUE; }
BOOLEAN blockNetIf( IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry, IN PNET_DEV pNetDev) { PNETIF_ENTRY pNetIfEntry = NULL; if ((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(&freeNetIfEntryList)) != NULL) { netif_stop_queue(pNetDev); pNetIfEntry->pNetDev = pNetDev; insertTailList(&pBlockQueueEntry->NetIfList, (PLIST_ENTRY)pNetIfEntry); pBlockQueueEntry->SwTxQueueBlockFlag = TRUE; DBGPRINT(RT_DEBUG_TRACE, "netif_stop_queue(%s)\n", pNetDev->name); } else return FALSE; return TRUE; }
void removeLinkedList(LinkedList **listPtr, LinkedList *listToRemove) { LinkedList *currentPtr = *listPtr; LinkedList *removeList, *tempList; removeHeadList(listPtr, listToRemove); if((*listPtr) == NULL) return; currentPtr = *listPtr; //update currentPtr //listToRemove at body/tail removeList = currentPtr->next; while(removeList != NULL) { if(isItemInList(&removeList, listToRemove->data)) { tempList = removeList->next; currentPtr->next = tempList; return; } currentPtr = currentPtr->next; removeList = removeList->next; } }