TI_HANDLE txnQ_Create (TI_HANDLE hOs) { TI_HANDLE hTxnQ; TTxnQObj *pTxnQ; TI_UINT32 i; hTxnQ = os_memoryAlloc(hOs, sizeof(TTxnQObj)); if (hTxnQ == NULL) return NULL; pTxnQ = (TTxnQObj *)hTxnQ; os_memoryZero(hOs, hTxnQ, sizeof(TTxnQObj)); pTxnQ->hOs = hOs; pTxnQ->pCurrTxn = NULL; pTxnQ->uMinFuncId = MAX_FUNCTIONS; /* Start at maximum and save minimal value in txnQ_Open */ pTxnQ->uMaxFuncId = 0; /* Start at minimum and save maximal value in txnQ_Open */ #ifdef TI_DBG pTxnQ->pAggregQueue = NULL; #endif for (i = 0; i < MAX_FUNCTIONS; i++) { pTxnQ->aFuncInfo[i].eState = FUNC_STATE_NONE; pTxnQ->aFuncInfo[i].uNumPrios = 0; pTxnQ->aFuncInfo[i].pSingleStep = NULL; pTxnQ->aFuncInfo[i].fTxnQueueDoneCb = NULL; pTxnQ->aFuncInfo[i].hCbHandle = NULL; } /* Create the Bus-Driver module */ pTxnQ->hBusDrv = busDrv_Create (hOs); if (pTxnQ->hBusDrv == NULL) { WLAN_OS_REPORT(("%s: Error - failed to create BusDrv\n", __FUNCTION__)); txnQ_Destroy (hTxnQ); return NULL; } return pTxnQ; }
/** * \fn txnQ_Create * \brief Create the module * * Allocate and clear the module's object. * * \note * \param hMcpf - Handle to Os framework * \return Handle of the allocated object, NULL if allocation failed * \sa txnQ_Destroy */ handle_t txnQ_Create (const handle_t hMcpf) { handle_t hTxnQ; TTxnQObj *pTxnQ; McpU32 i; hTxnQ = mcpf_mem_alloc(hMcpf, sizeof(TTxnQObj)); if (hTxnQ == NULL) return NULL; pTxnQ = (TTxnQObj *)hTxnQ; mcpf_mem_zero(hMcpf, hTxnQ, sizeof(TTxnQObj)); pTxnQ->hMcpf = hMcpf; pTxnQ->pCurrTxn = NULL; pTxnQ->uMinFuncId = TXN_MAX_FUNCTIONS; /* Start at maximum and save minimal value in txnQ_Open */ pTxnQ->uMaxFuncId = 0; /* Start at minimum and save maximal value in txnQ_Open */ pTxnQ->bProtectTxnDone = MCP_TRUE; for (i = 0; i < TXN_MAX_FUNCTIONS; i++) { pTxnQ->aFuncInfo[i].eState = FUNC_STATE_NONE; pTxnQ->aFuncInfo[i].uNumPrios = 0; pTxnQ->aFuncInfo[i].pSingleStep = NULL; pTxnQ->aFuncInfo[i].fTxnQueueDoneCb = NULL; pTxnQ->aFuncInfo[i].hCbHandle = NULL; } /* Create the Bus-Driver module */ pTxnQ->hBusDrv = busDrv_Create (hMcpf); if (pTxnQ->hBusDrv == NULL) { MCPF_OS_REPORT(("%s: Error - failed to create BusDrv\n", __FUNCTION__)); txnQ_Destroy (hTxnQ); return NULL; } return pTxnQ; }