本文整理汇总了C++中NdisAllocateSpinLock函数的典型用法代码示例。如果您正苦于以下问题:C++ NdisAllocateSpinLock函数的具体用法?C++ NdisAllocateSpinLock怎么用?C++ NdisAllocateSpinLock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NdisAllocateSpinLock函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tr_tb_set_entry
VOID tr_tb_set_entry(RTMP_ADAPTER *pAd, UCHAR tr_tb_idx, MAC_TABLE_ENTRY *pEntry)
{
struct _STA_TR_ENTRY *tr_entry;
INT qidx, tid,upId;
//MAC_TABLE_ENTRY *mac_entry;
struct wtbl_entry tb_entry;
//struct wtbl_2_struc *wtbl_2;
if (tr_tb_idx < MAX_LEN_OF_TR_TABLE)
{
tr_entry = &pAd->MacTab.tr_entry[tr_tb_idx];
tr_entry->EntryType = pEntry->EntryType;
tr_entry->wdev = pEntry->wdev;
tr_entry->func_tb_idx = pEntry->func_tb_idx;
tr_entry->wcid = pEntry->wcid;
NdisMoveMemory(tr_entry->Addr, pEntry->Addr, MAC_ADDR_LEN);
tr_entry->NonQosDataSeq = 0;
for (tid = 0; tid < NUM_OF_TID; tid++)
tr_entry->TxSeq[tid] = 0;
for(upId = 0 ; upId < NUM_OF_UP ; upId ++)
{
tr_entry->cacheSn[upId] = -1;
}
/* Reset BA SSN & Score Board Bitmap, for BA Receiptor */
NdisZeroMemory(&tb_entry, sizeof(tb_entry));
if (mt_wtbl_get_entry234(pAd, tr_entry->wcid, &tb_entry) == FALSE) {
DBGPRINT(RT_DEBUG_ERROR, ("%s(): Not found WTBL2/3/4 for tr_entry->wcid(%d), !ERROR!\n",
__FUNCTION__, tr_entry->wcid));
return;
}
//mac_entry = &pAd->MacTab.Content[tr_entry->wcid];
tr_entry->PsMode = PWR_ACTIVE;
tr_entry->isCached = FALSE;
tr_entry->PortSecured = WPA_802_1X_PORT_NOT_SECURED;
tr_entry->CurrTxRate = pEntry->CurrTxRate;
for (qidx = 0 ; qidx < WMM_QUE_NUM; qidx++) {
InitializeQueueHeader(&tr_entry->tx_queue[qidx]);
NdisAllocateSpinLock(pAd, &tr_entry->txq_lock[qidx]);
}
InitializeQueueHeader(&tr_entry->ps_queue);
NdisAllocateSpinLock(pAd, &tr_entry->ps_queue_lock);
tr_entry->deq_cnt = 0;
tr_entry->deq_bytes = 0;
tr_entry->PsQIdleCount = 0;
tr_entry->enq_cap = TRUE;
tr_entry->deq_cap = TRUE;
tr_entry->PsTokenFlag = 0;
NdisMoveMemory(tr_entry->bssid, pEntry->wdev->bssid, MAC_ADDR_LEN);
}
}
示例2: ssh_interceptor_iodevice_alloc
SshInterceptorIoDevice
ssh_interceptor_iodevice_alloc(SshInterceptor interceptor,
const unsigned char *device_name,
Boolean exclusive_access,
SshInterceptorIoDeviceStatusCB status_cb,
SshInterceptorIoDeviceReceiveCB receive_cb,
void *callback_context)
{
SshInterceptorIoDevice io_dev = NULL;
UINT i;
SSH_DEBUG(SSH_D_HIGHSTART,
("Allocating I/O device object '%s'", device_name));
/* Create device object */
io_dev = ssh_calloc(1, sizeof(*io_dev));
if (io_dev == NULL)
{
SSH_DEBUG(SSH_D_FAIL,("Memory allocation failed"));
return NULL;
}
io_dev->notify_event = CreateEvent(NULL, FALSE, FALSE, NULL);
if (io_dev->notify_event == NULL)
{
SSH_DEBUG(SSH_D_FAIL,("Failed to create event object"));
ssh_free(io_dev);
return NULL;
}
/* Initialize variables allocated in the device extension area */
io_dev->open = 0;
io_dev->cancel_io = 0;
io_dev->status_cb = status_cb;
io_dev->receive_cb = receive_cb;
io_dev->cb_context = callback_context;
NdisInitializeListHead(&io_dev->output_queue);
NdisInitializeListHead(&io_dev->unreliable_output_queue);
NdisAllocateSpinLock(&io_dev->output_queue_lock);
NdisInitializeListHead(&io_dev->free_list);
NdisAllocateSpinLock(&io_dev->free_list_lock);
/* Initialize the read critical section. */
InitializeCriticalSection(&io_dev->read_cs);
/* Pre-allocate some "free" SshDeviceBuffers */
for (i = 0; i < SSH_IODEVICE_QUEUE_SIZE; i++)
{
SshDeviceBuffer buf = &(io_dev->pre_allocated_buffers[i]);
buf->pre_allocated = 1;
InsertTailList(&io_dev->free_list, &buf->link);
}
SSH_ASSERT(interceptor->ipm_device == NULL);
interceptor->ipm_device = io_dev;
return io_dev;
}
示例3: OvsInitIoctl
VOID
OvsInitIoctl()
{
gOvsCtrlLock = &ovsCtrlLockObj;
ovsFlowLock = &ovsFlowLockObj;
NdisAllocateSpinLock(ovsFlowLock);
NdisAllocateSpinLock(gOvsCtrlLock);
}
示例4: VenetSetupAdapter
static NDIS_STATUS
VenetSetupAdapter(PADAPTER a)
{
NDIS_STATUS rc;
NDIS_TIMER_CHARACTERISTICS timer;
a->lookAhead = NIC_MAX_LOOKAHEAD;
a->numTcbs = NIC_MAX_BUSY_SENDS;
a->refCount = 1;
VENET_SET_FLAG(a, VNET_DISCONNECTED);
QueueInit(&a->sendQueue);
NdisInitializeListHead(&a->recvFreeList);
NdisInitializeListHead(&a->recvToProcess);
NdisInitializeListHead(&a->tcbFree);
NdisInitializeListHead(&a->tcbBusy);
NdisAllocateSpinLock(&a->lock);
NdisAllocateSpinLock(&a->recvLock);
NdisAllocateSpinLock(&a->sendLock);
NdisInitializeEvent(&a->removeEvent);
NdisInitializeEvent(&a->sendEvent);
/* We use the opposite sense of the sendEvent,
* SET == No Tx in use
* UNSET == Tx in use
*/
NdisInitializeEvent(&a->sendEvent);
NdisSetEvent(&a->sendEvent);
/* Create Rest and receive timers. */
NdisZeroMemory(&timer, sizeof(NDIS_TIMER_CHARACTERISTICS));
timer.Header.Type = NDIS_OBJECT_TYPE_TIMER_CHARACTERISTICS;
timer.Header.Revision = NDIS_TIMER_CHARACTERISTICS_REVISION_1;
timer.Header.Size = sizeof(NDIS_TIMER_CHARACTERISTICS);
timer.AllocationTag = VNET;
timer.TimerFunction = VenetResetTimerDpc;
timer.FunctionContext = a;
rc = NdisAllocateTimerObject(a->adapterHandle, &timer, &a->resetTimer);
if (rc != NDIS_STATUS_SUCCESS)
goto done;
timer.TimerFunction = VenetReceiveTimerDpc;
rc = NdisAllocateTimerObject(a->adapterHandle, &timer, &a->recvTimer);
if (rc != NDIS_STATUS_SUCCESS)
goto done;
done:
return rc;
}
示例5: BBUPollingModeInit
VOID BBUPollingModeInit(IN RTMP_ADAPTER *pAd){
NdisAllocateSpinLock(&pAd->Pollingmode.PollingModeLock);//for polling mode
RTMPInitTimer(pAd, &pAd->Pollingmode.PollingModeDetect, GET_TIMER_FUNCTION(PeriodicPollingModeDetect), pAd, FALSE);
pAd->Pollingmode.PollingModeDetectRunning = FALSE;
}
示例6: mp8711init
void mp8711init(_adapter *padapter)
{
struct mp_priv *pmppriv=&padapter->mppriv;
// MP8711 WorkItem
struct mp_wi_cntx *pmp_wi_cntx = &(pmppriv->wi_cntx);
pmp_wi_cntx->bmpdrv_unload =_FALSE;
pmp_wi_cntx->bmp_wi_progress=_FALSE;
pmp_wi_cntx->curractfunc=NULL;
NdisInitializeEvent(&(pmp_wi_cntx->mp_wi_evt));
NdisAllocateSpinLock(&(pmp_wi_cntx->mp_wi_lock));
NdisInitializeWorkItem(&(pmp_wi_cntx->mp_wi),
mp_wi_callback,// MP8711WorkItemCallback,
padapter);
// H2C/C2H
// padapter->nH2cCmdCnt = 0 ;
// NdisAllocateSpinLock(&(pAdapter->MpH2cSpinLock));
// NdisInitializeEvent(&(pAdapter->CMDCommEvent));
//New Arch.
init_mp_priv(&padapter->mppriv);
}
示例7: m_nReusedRxBuffersCounter
CParaNdisRX::CParaNdisRX() : m_nReusedRxBuffersCounter(0), m_NetNofReceiveBuffers(0)
{
InitializeListHead(&m_NetReceiveBuffers);
NdisAllocateSpinLock(&m_UnclassifiedPacketsQueue.Lock);
InitializeListHead(&m_UnclassifiedPacketsQueue.BuffersList);
}
示例8: DriverEntry
/*****************************************************************************
* DriverEntry()
*
* この関数のは System がこのドライバをロードするときに呼ばれ、ドライバを
* NDIS と関連付け、エントリポイントを登録する。
*
* 引数:
* DriverObject : ドライバーオブジェクトのポインタ
* RegistryPath : ドライバーのレジストリのパス 関連付け
*
* 返り値:
*
* NDIS_STATUS
*
********************************************************************************/
NDIS_STATUS
DriverEntry(
IN PVOID DriverObject,
IN PVOID RegistryPath)
{
NDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics;
NDIS_STATUS Status;
DEBUG_PRINT0(3, "DriverEntry called\n");
NdisZeroMemory(&MiniportCharacteristics, sizeof(NDIS_MINIPORT_CHARACTERISTICS));
/*
* ミニポートドライバを NDIS に関連付けし、NdisWrapperHandle を得る。
*/
NdisMInitializeWrapper(
&NdisWrapperHandle, // OUT PNDIS_HANDLE
DriverObject, // IN ドライバーオブジェクト
RegistryPath, // IN レジストリパス
NULL // IN 必ず NULL
);
if(NdisWrapperHandle == NULL){
DEBUG_PRINT0(1, "NdisInitializeWrapper failed\n");
return(STATUS_INVALID_HANDLE);
}
MiniportCharacteristics.MajorNdisVersion = STE_NDIS_MAJOR_VERSION; // Major Version
MiniportCharacteristics.MinorNdisVersion = STE_NDIS_MINOR_VERSION; // Minor Version
MiniportCharacteristics.CheckForHangHandler = SteMiniportCheckForHang;
MiniportCharacteristics.HaltHandler = SteMiniportHalt;
MiniportCharacteristics.InitializeHandler = SteMiniportInitialize;
MiniportCharacteristics.QueryInformationHandler = SteMiniportQueryInformation;
MiniportCharacteristics.ResetHandler = SteMiniportReset ;
MiniportCharacteristics.SetInformationHandler = SteMiniportSetInformation;
MiniportCharacteristics.ReturnPacketHandler = SteMiniportReturnPacket;
MiniportCharacteristics.SendPacketsHandler = SteMiniportSendPackets;
Status = NdisMRegisterMiniport(
NdisWrapperHandle, // IN NDIS_HANDLE
&MiniportCharacteristics, // IN PNDIS_MINIPORT_CHARACTERISTICS
sizeof(NDIS_MINIPORT_CHARACTERISTICS) // IN UINT
);
if( Status != NDIS_STATUS_SUCCESS){
DEBUG_PRINT1(1, "NdisMRegisterMiniport failed(Status = 0x%x)\n", Status);
NdisTerminateWrapper(
NdisWrapperHandle, // IN NDIS_HANDLE
NULL
);
return(Status);
}
// グローバルロックを初期化
NdisAllocateSpinLock(&SteGlobalSpinLock);
NdisMRegisterUnloadHandler(NdisWrapperHandle, SteMiniportUnload);
return(NDIS_STATUS_SUCCESS);
}
示例9: FT_RIC_Init
/*
========================================================================
Routine Description:
Initialize FT RIC Module.
Arguments:
pAd - WLAN control block pointer
Return Value:
None
Note:
========================================================================
*/
VOID TYPE_FUNC FT_RIC_Init(
IN PRTMP_ADAPTER pAd)
{
DBGPRINT(RT_DEBUG_TRACE, ("ap_ftrc> Initialize FT RIC Module...\n"));
#ifdef CONFIG_STA_SUPPORT
/* allocate control block */
if (pAd->pFT_RIC_Ctrl_BK == NULL)
{
os_alloc_mem(pAd, (UCHAR **)&pAd->pFT_RIC_Ctrl_BK,
sizeof(FT_RIC_CTRL_BLOCK));
if (pAd->pFT_RIC_Ctrl_BK == NULL)
{
DBGPRINT(RT_DEBUG_ERROR, ("ap_ftrc> Allocate control block fail!\n"));
return;
} /* End of if */
/* init spin lock */
NdisAllocateSpinLock(pAd, &(pAd->FT_RicLock));
/* init resource list */
initList(&(FT_RIC_CB->ResourceList));
} /* End of if */
#endif /* CONFIG_STA_SUPPORT */
} /* End of FT_RIC_Init */
示例10: CliWds_ProxyTabInit
VOID CliWds_ProxyTabInit(
IN PRTMP_ADAPTER pAd)
{
INT idx;
ULONG i;
NdisAllocateSpinLock(&pAd->ApCfg.CliWdsTabLock);
pAd->ApCfg.pCliWdsEntryPool = kmalloc(sizeof(CLIWDS_PROXY_ENTRY) * CLIWDS_POOL_SIZE, GFP_ATOMIC);
if (pAd->ApCfg.pCliWdsEntryPool)
{
NdisZeroMemory(pAd->ApCfg.pCliWdsEntryPool, sizeof(CLIWDS_PROXY_ENTRY) * CLIWDS_POOL_SIZE);
initList(&pAd->ApCfg.CliWdsEntryFreeList);
for (i = 0; i < CLIWDS_POOL_SIZE; i++)
insertTailList(&pAd->ApCfg.CliWdsEntryFreeList, (PLIST_ENTRY)(pAd->ApCfg.pCliWdsEntryPool + (ULONG)i));
}
else
{
DBGPRINT(RT_DEBUG_ERROR, ("%s Fail to alloc memory for pAd->CommonCfg.pCliWdsEntryPool", __FUNCTION__));
}
for (idx = 0; idx < CLIWDS_HASH_TAB_SIZE; idx++)
initList(&pAd->ApCfg.CliWdsProxyTab[idx]);
return;
}
示例11: HIFInit
A_STATUS HIFInit(OSDRV_CALLBACKS *callbacks)
{
SD_API_STATUS sdStatus;
AR_DEBUG_ASSERT(callbacks != NULL);
/* store the callback handlers */
osdrvCallbacks = *callbacks;
/* Register with bus driver core */
NDIS_DEBUG_PRINTF(DBG_LEVEL_HIF, "AR6000: HIFInit registering \r\n");
registered = 1;
#if defined(CONFIG_PM)
// TODO about power management.
#endif /* CONFIG_PM */
/* Register with bus driver core */
sdFunction.pName = "sdio_wlan";
sdFunction.pProbe = hifDeviceInserted;
sdFunction.pRemove = hifDeviceRemoved;
A_MUTEX_INIT(&hif_lock);
NdisAllocateSpinLock(&sLock);
sdStatus = SDIORegisterFunction(&sdFunction);
AR_DEBUG_ASSERT(SD_API_SUCCESS(sdStatus));
return A_OK;
}
示例12: PacketReset
NDIS_STATUS NDIS_API PacketReset(POPEN_INSTANCE pOpen)
{
// reset the protocol
PLIST_ENTRY ResetListEntry;
NDIS_STATUS Status;
// Acquire request element from list
NdisAllocateSpinLock(&pOpen->RequestSpinLock);
if (IsListEmpty(&pOpen->RequestList)) {
NdisReleaseSpinLock(&pOpen->RequestSpinLock);
return NDIS_STATUS_RESOURCES;
}
ResetListEntry = RemoveHeadList(&pOpen->RequestList);
NdisReleaseSpinLock(&pOpen->RequestSpinLock);
// Insert Reset IRP into Request Queue
NdisAcquireSpinLock(&pOpen->ResetSpinLock);
InsertTailList(&pOpen->ResetIrpList, ResetListEntry);
NdisReleaseSpinLock(&pOpen->ResetSpinLock);
// Reset the adapter
NdisReset(&Status, pOpen->AdapterHandle);
if (Status != NDIS_STATUS_PENDING)
PacketResetComplete(pOpen, Status);
return Status;
}
示例13: OvsInit
VOID
OvsInit()
{
gOvsCtrlLock = &ovsCtrlLockObj;
NdisAllocateSpinLock(gOvsCtrlLock);
OvsInitEventQueue();
OvsUserInit();
}
示例14: ArcInitializePackage
VOID
ArcInitializePackage(VOID)
{
NdisAllocateSpinLock(&ArcReferenceLock);
KeInitializeEvent(
&ArcPagedInEvent,
NotificationEvent,
FALSE
);
}
示例15: tr_tb_set_mcast_entry
VOID tr_tb_set_mcast_entry(RTMP_ADAPTER *pAd, UCHAR tr_tb_idx, struct wifi_dev *wdev)
{
struct _STA_TR_ENTRY *tr_entry = &pAd->MacTab.tr_entry[tr_tb_idx];
INT qidx, tid;
NdisZeroMemory(tr_entry, sizeof(struct _STA_TR_ENTRY));
tr_entry->EntryType = ENTRY_CAT_MCAST;
tr_entry->wdev = wdev;
tr_entry->func_tb_idx = wdev->func_idx;
tr_entry->PsMode = PWR_ACTIVE;
tr_entry->isCached = FALSE;
tr_entry->PortSecured = WPA_802_1X_PORT_SECURED;
tr_entry->CurrTxRate = pAd->CommonCfg.MlmeRate;
NdisMoveMemory(tr_entry->Addr, &BROADCAST_ADDR[0], MAC_ADDR_LEN);
// TODO: shiang-usw, for following fields, need better assignment!
tr_entry->wcid = tr_tb_idx;
tr_entry->NonQosDataSeq = 0;
for (tid = 0; tid < NUM_OF_TID; tid++)
tr_entry->TxSeq[tid] = 0;
for (qidx = 0 ; qidx < WMM_QUE_NUM; qidx++) {
InitializeQueueHeader(&tr_entry->tx_queue[qidx]);
NdisAllocateSpinLock(pAd, &tr_entry->txq_lock[qidx]);
}
InitializeQueueHeader(&tr_entry->ps_queue);
NdisAllocateSpinLock(pAd, &tr_entry->ps_queue_lock);
tr_entry->deq_cnt = 0;
tr_entry->deq_bytes = 0;
tr_entry->PsQIdleCount = 0;
tr_entry->enq_cap = TRUE;
tr_entry->deq_cap = TRUE;
tr_entry->PsTokenFlag = 0;
#ifdef DATA_QUEUE_RESERVE
tr_entry->high_pkt_cnt = 0;
tr_entry->high_pkt_drop_cnt = 0;
#endif /* DATA_QUEUE_RESERVE */
NdisMoveMemory(tr_entry->bssid, wdev->bssid, MAC_ADDR_LEN);
}