本文整理汇总了C++中A_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ A_ASSERT函数的具体用法?C++ A_ASSERT怎么用?C++ A_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了A_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BMIInit
/* APIs visible to the driver */
void
BMIInit(void)
{
bmiDone = false;
pendingEventsFuncCheck = false;
/*
* On some platforms, it's not possible to DMA to a static variable
* in a device driver (e.g. Linux loadable driver module).
* So we need to A_MALLOC space for "command credits" and for commands.
*
* Note: implicitly relies on A_MALLOC to provide a buffer that is
* suitable for DMA (or PIO). This buffer will be passed down the
* bus stack.
*/
if (!pBMICmdCredits) {
pBMICmdCredits = (u32 *)A_MALLOC_NOWAIT(4);
A_ASSERT(pBMICmdCredits);
}
if (!pBMICmdBuf) {
pBMICmdBuf = (u8 *)A_MALLOC_NOWAIT(MAX_BMI_CMDBUF_SZ);
A_ASSERT(pBMICmdBuf);
}
A_REGISTER_MODULE_DEBUG_INFO(bmi);
}
示例2: BMIInit
/* APIs visible to the driver */
A_STATUS
BMIInit(A_VOID *pCxt)
{
bmiDone = FALSE;
/*
* On some platforms, it's not possible to DMA to a static variable
* in a device driver (e.g. Linux loadable driver module).
* So we need to A_MALLOC space for "command credits" and for commands.
*
* Note: implicitly relies on A_MALLOC to provide a buffer that is
* suitable for DMA (or PIO). This buffer will be passed down the
* bus stack.
*/
if (!pBMICmdCredits) {
pBMICmdCredits = (A_UINT32 *)A_MALLOC(4, MALLOC_ID_TEMPORARY);
A_ASSERT(pBMICmdCredits);
}
if (!pBMICmdBuf) {
pBMICmdBuf = (A_UCHAR *)A_MALLOC(MAX_BMI_CMDBUF_SZ, MALLOC_ID_TEMPORARY);
A_ASSERT(pBMICmdBuf);
}
return A_OK;
}
示例3: btpal_send_frame
/****************************************************
* Invoked from bluetooth stack via hdev->send()
* to send the packet out via ar6k to PAL firmware.
*
* For HCI command packet wmi_send_hci_cmd() is invoked.
* wmi_send_hci_cmd adds WMI_CMD_HDR and sends the packet
* to PAL firmware.
*
* For HCI ACL data packet wmi_data_hdr_add is invoked
* to add WMI_DATA_HDR to the packet. ar6000_acl_data_tx
* is then invoked to send the packet to PAL firmware.
******************************************************/
static int btpal_send_frame(struct sk_buff *skb)
{
struct hci_dev *hdev = (struct hci_dev *)skb->dev;
HCI_TRANSPORT_PACKET_TYPE type;
ar6k_hci_pal_info_t *pHciPalInfo;
A_STATUS status = A_OK;
struct sk_buff *txSkb = NULL;
AR_SOFTC_DEV_T *ar;
if (!hdev) {
PRIN_LOG("HCI PAL: btpal_send_frame - no device\n");
return -ENODEV;
}
if (!test_bit(HCI_RUNNING, &hdev->flags)) {
PRIN_LOG("HCI PAL: btpal_send_frame - not open\n");
return -EBUSY;
}
pHciPalInfo = (ar6k_hci_pal_info_t *)hdev->driver_data;
A_ASSERT(pHciPalInfo != NULL);
ar = pHciPalInfo->ar;
PRIN_LOG("+btpal_send_frame type: %d \n",bt_cb(skb)->pkt_type);
type = HCI_COMMAND_TYPE;
switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT:
type = HCI_COMMAND_TYPE;
hdev->stat.cmd_tx++;
break;
case HCI_ACLDATA_PKT:
type = HCI_ACL_TYPE;
hdev->stat.acl_tx++;
break;
case HCI_SCODATA_PKT:
/* we don't support SCO over the pal */
kfree_skb(skb);
return 0;
default:
A_ASSERT(FALSE);
kfree_skb(skb);
return 0;
}
if(loghci) {
A_PRINTF(">>> Send HCI %s packet len: %d\n",
(type == HCI_COMMAND_TYPE) ? "COMMAND" : "ACL",
skb->len);
if (type == HCI_COMMAND_TYPE) {
A_PRINTF("HCI Command: OGF:0x%X OCF:0x%X \r\n",
(HCI_GET_OP_CODE(skb->data)) >> 10,
(HCI_GET_OP_CODE(skb->data)) & 0x3FF);
}
DebugDumpBytes(skb->data,skb->len,"BT HCI SEND Packet Dump");
}
示例4: bt_send_frame
/*
* bt_send_frame - send data frames
*/
static int bt_send_frame(struct sk_buff *skb)
{
struct hci_dev *hdev = (struct hci_dev *)skb->dev;
HCI_TRANSPORT_PACKET_TYPE type;
AR6K_HCI_BRIDGE_INFO *pHcidevInfo;
HTC_PACKET *pPacket;
A_STATUS status = A_OK;
struct sk_buff *txSkb = NULL;
if (!hdev) {
AR_DEBUG_PRINTF(ATH_DEBUG_WARN, ("HCI Bridge: bt_send_frame - no device\n"));
return -ENODEV;
}
if (!test_bit(HCI_RUNNING, &hdev->flags)) {
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HCI Bridge: bt_send_frame - not open\n"));
return -EBUSY;
}
pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)hdev->driver_data;
A_ASSERT(pHcidevInfo != NULL);
AR_DEBUG_PRINTF(ATH_DEBUG_HCI_SEND, ("+bt_send_frame type: %d \n",bt_cb(skb)->pkt_type));
type = HCI_COMMAND_TYPE;
switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT:
type = HCI_COMMAND_TYPE;
hdev->stat.cmd_tx++;
break;
case HCI_ACLDATA_PKT:
type = HCI_ACL_TYPE;
hdev->stat.acl_tx++;
break;
case HCI_SCODATA_PKT:
/* we don't support SCO over the bridge */
kfree_skb(skb);
return 0;
default:
A_ASSERT(FALSE);
kfree_skb(skb);
return 0;
}
if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_HCI_DUMP)) {
AR_DEBUG_PRINTF(ATH_DEBUG_ANY,(">>> Send HCI %s packet len: %d\n",
(type == HCI_COMMAND_TYPE) ? "COMMAND" : "ACL",
skb->len));
if (type == HCI_COMMAND_TYPE) {
A_UINT16 opcode = HCI_GET_OP_CODE(skb->data);
AR_DEBUG_PRINTF(ATH_DEBUG_ANY,(" HCI Command: OGF:0x%X OCF:0x%X \r\n",
opcode >> 10, opcode & 0x3FF));
}
AR_DEBUG_PRINTBUF(skb->data,skb->len,"BT HCI SEND Packet Dump");
}
示例5: Api_WMIInitFinish
/* Api_WMIInitFinish - implements common code for sending default wmi commands
* to target.
* This should be called after Api_InitFinish().
* A_VOID *pCxt - the driver context.
*****************************************************************************/
A_VOID
Api_WMIInitFinish(A_VOID *pCxt)
{
A_DRIVER_CONTEXT *pDCxt = GET_DRIVER_COMMON(pCxt);
A_STATUS status;
WMI_ALLOW_AGGR_CMD allow_aggr_cmd;
if(pDCxt->wmiReady == A_TRUE)
{
do{
status = STACK_INIT(pCxt);
if(status == A_OK){
CUSTOM_WAIT_FOR_WMI_RESPONSE(pCxt);
break;
}else if(status == A_NO_MEMORY){
pDCxt->tx_complete_pend = A_TRUE;
if(A_OK != CUSTOM_DRIVER_WAIT_FOR_CONDITION(pCxt, &(pDCxt->tx_complete_pend), A_FALSE, 5000)){
A_ASSERT(0);
}
}else{
A_ASSERT(0);
}
}while(1);
/* issue some default WMI commands appropriate for most systems */
#if WLAN_CONFIG_IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN
wmi_cmd_process(pCxt, WMI_SET_POWER_PARAMS_CMDID, &default_power_param, sizeof(WMI_POWER_PARAMS_CMD));
#endif
wmi_cmd_process(pCxt, WMI_SET_SCAN_PARAMS_CMDID, &default_scan_param, sizeof(WMI_SCAN_PARAMS_CMD));
wmi_cmd_process(pCxt, WMI_STORERECALL_CONFIGURE_CMDID,
&default_strrcl_config_cmd, sizeof(WMI_STORERECALL_CONFIGURE_CMD));
pDCxt->strrclState = STRRCL_ST_INIT;
/* technically this call to wmi_allow_aggr_cmd is not necessary if both
* masks are 0 as the firmware has 0,0 as the default. */
allow_aggr_cmd.tx_allow_aggr = A_CPU2LE16(pDCxt->txAggrTidMask);
allow_aggr_cmd.rx_allow_aggr = A_CPU2LE16(pDCxt->rxAggrTidMask);
wmi_cmd_process(pCxt, WMI_ALLOW_AGGR_CMDID, &allow_aggr_cmd, sizeof(WMI_ALLOW_AGGR_CMD));
#if ENABLE_P2P_MODE
if(WLAN_NUM_OF_DEVICES == 2) {
/* Device-0 is P2P Device and Device-1 is Legacy STA.\
Set Default P2P Params
*/
wmi_cmd_process(pCxt,WMI_P2P_SET_CONFIG_CMDID,&default_p2p_config,sizeof(WMI_P2P_FW_SET_CONFIG_CMD));
}
#endif
/* Set the BSS Filter to None. If this is not set, by default the firmware
sets to forward the beacons to host. This causes unnecessary BSSINFO events in
the host even after connecting to the AP */
wmi_bssfilter_cmd(pDCxt->pWmiCxt, NONE_BSS_FILTER, 0);
}
}
示例6: htc_get_endpoint_statistics
A_BOOL htc_get_endpoint_statistics(HTC_HANDLE HTCHandle,
HTC_ENDPOINT_ID Endpoint,
HTC_ENDPOINT_STAT_ACTION Action,
HTC_ENDPOINT_STATS *pStats)
{
#ifdef HTC_EP_STAT_PROFILING
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
A_BOOL clearStats = false;
A_BOOL sample = false;
switch (Action) {
case HTC_EP_STAT_SAMPLE:
sample = true;
break;
case HTC_EP_STAT_SAMPLE_AND_CLEAR:
sample = true;
clearStats = true;
break;
case HTC_EP_STAT_CLEAR:
clearStats = true;
break;
default:
break;
}
A_ASSERT(Endpoint < ENDPOINT_MAX);
/* lock out TX and RX while we sample and/or clear */
LOCK_HTC_TX(target);
LOCK_HTC_RX(target);
if (sample) {
A_ASSERT(pStats != NULL);
/* return the stats to the caller */
A_MEMCPY(pStats, &target->EndPoint[Endpoint].EndPointStats,
sizeof(HTC_ENDPOINT_STATS));
}
if (clearStats) {
/* reset stats */
A_MEMZERO(&target->EndPoint[Endpoint].EndPointStats,
sizeof(HTC_ENDPOINT_STATS));
}
UNLOCK_HTC_RX(target);
UNLOCK_HTC_TX(target);
return true;
#else
return false;
#endif
}
示例7: DevServiceErrorInterrupt
static int DevServiceErrorInterrupt(AR6K_DEVICE *pDev)
{
int status;
u8 error_int_status;
u8 regBuffer[4];
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Error Interrupt\n"));
error_int_status = pDev->IrqProcRegisters.error_int_status & 0x0F;
A_ASSERT(error_int_status);
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,
("Valid interrupt source(s) in ERROR_INT_STATUS: 0x%x\n",
error_int_status));
if (ERROR_INT_STATUS_WAKEUP_GET(error_int_status)) {
/* Wakeup */
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Error : Wakeup\n"));
}
if (ERROR_INT_STATUS_RX_UNDERFLOW_GET(error_int_status)) {
/* Rx Underflow */
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Error : Rx Underflow\n"));
}
if (ERROR_INT_STATUS_TX_OVERFLOW_GET(error_int_status)) {
/* Tx Overflow */
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Error : Tx Overflow\n"));
}
/* Clear the interrupt */
pDev->IrqProcRegisters.error_int_status &= ~error_int_status; /* W1C */
/* set up the register transfer buffer to hit the register 4 times , this is done
* to make the access 4-byte aligned to mitigate issues with host bus interconnects that
* restrict bus transfer lengths to be a multiple of 4-bytes */
/* set W1C value to clear the interrupt, this hits the register first */
regBuffer[0] = error_int_status;
/* the remaining 4 values are set to zero which have no-effect */
regBuffer[1] = 0;
regBuffer[2] = 0;
regBuffer[3] = 0;
status = HIFReadWrite(pDev->HIFDevice,
ERROR_INT_STATUS_ADDRESS,
regBuffer,
4,
HIF_WR_SYNC_BYTE_FIX,
NULL);
A_ASSERT(status == 0);
return status;
}
示例8: CopyChunkToBinCache
static void CopyChunkToBinCache(AR6K_BIN_CACHE_INFO *pCache,
A_UINT8 *pChunk,
A_UINT32 Length)
{
A_ASSERT(!pCache->Static);
if ((pCache->ActualLength + Length) > Length &&
(pCache->ActualLength + Length) < pCache->MaxLength) {
A_MEMCPY(&pCache->pData[pCache->ActualLength],pChunk,Length);
pCache->ActualLength += Length;
} else {
A_ASSERT(FALSE);
}
}
示例9: FindPool
// -------------------------------------------------------------------------------------------------------
Bool AllocatorMT::Free( void* ptr )
{
UInt32 threadID = (UInt32)GetCurrentThreadId();
MemPool* pool = FindPool(threadID);
A_ASSERT(pool != 0, "Try to free a pointer which not in this thread!");
return pool->Free(ptr);
}
示例10: DevServiceDebugInterrupt
static int DevServiceDebugInterrupt(AR6K_DEVICE *pDev)
{
u32 dummy;
int status;
/* Send a target failure event to the application */
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Target debug interrupt\n"));
if (pDev->TargetFailureCallback != NULL) {
pDev->TargetFailureCallback(pDev->HTCContext);
}
if (pDev->GMboxEnabled) {
DevNotifyGMboxTargetFailure(pDev);
}
/* clear the interrupt , the debug error interrupt is
* counter 0 */
/* read counter to clear interrupt */
status = HIFReadWrite(pDev->HIFDevice,
COUNT_DEC_ADDRESS,
(u8 *)&dummy,
4,
HIF_RD_SYNC_BYTE_INC,
NULL);
A_ASSERT(status == 0);
return status;
}
示例11: CleanupHIFScatterResources
/* clean up scatter support */
void CleanupHIFScatterResources(struct hif_device *device)
{
struct hif_scatter_req_priv *pReqPriv;
struct hif_scatter_req *pReq;
/* empty the free list */
while (1) {
pReq = AllocScatterReq(device);
if (NULL == pReq) {
break;
}
pReqPriv = (struct hif_scatter_req_priv *)pReq->HIFPrivate[0];
A_ASSERT(pReqPriv != NULL);
if (pReqPriv->busrequest != NULL) {
pReqPriv->busrequest->pScatterReq = NULL;
/* free bus request */
hifFreeBusRequest(device, pReqPriv->busrequest);
pReqPriv->busrequest = NULL;
}
if (pReqPriv->pHifScatterReq != NULL) {
kfree(pReqPriv->pHifScatterReq);
pReqPriv->pHifScatterReq = NULL;
}
kfree(pReqPriv);
}
}
示例12: CleanupHIFScatterResources
/* clean up scatter support */
void CleanupHIFScatterResources(HIF_DEVICE *device)
{
HIF_SCATTER_REQ_PRIV *pReqPriv;
HIF_SCATTER_REQ *pReq;
/* empty the free list */
while (1) {
pReq = AllocScatterReq(device);
if (NULL == pReq) {
break;
}
pReqPriv = (HIF_SCATTER_REQ_PRIV *)pReq->HIFPrivate[0];
A_ASSERT(pReqPriv != NULL);
if (pReqPriv->busrequest != NULL) {
pReqPriv->busrequest->pScatterReq = NULL;
/* free bus request */
hifFreeBusRequest(device, pReqPriv->busrequest);
pReqPriv->busrequest = NULL;
}
if (pReqPriv->pHifScatterReq != NULL) {
A_FREE(pReqPriv->pHifScatterReq);
pReqPriv->pHifScatterReq = NULL;
}
A_FREE(pReqPriv);
}
}
示例13: BMIWriteSOCRegister
A_STATUS
BMIWriteSOCRegister(A_VOID *pCxt,
A_UINT32 address,
A_UINT32 param)
{
A_UINT32 cid;
A_STATUS status;
A_UINT32 offset, temp;
A_ASSERT(BMI_COMMAND_FITS(sizeof(cid) + sizeof(address) + sizeof(param)));
memset (pBMICmdBuf, 0, sizeof(cid) + sizeof(address) + sizeof(param));
if (bmiDone) {
return A_ERROR;
}
cid = A_CPU2LE32(BMI_WRITE_SOC_REGISTER);
offset = 0;
A_MEMCPY(&(pBMICmdBuf[offset]), &cid, sizeof(cid));
offset += sizeof(cid);
temp = A_CPU2LE32(address);
A_MEMCPY(&(pBMICmdBuf[offset]), &temp, sizeof(address));
offset += sizeof(address);
A_MEMCPY(&(pBMICmdBuf[offset]), ¶m, sizeof(param));
offset += sizeof(param);
status = bmiBufferSend(pCxt, pBMICmdBuf, offset);
if (status != A_OK) {
return A_ERROR;
}
return A_OK;
}
示例14: GetMTEStatus
/* status look up based on current state */
A_UINT32 GetMTEStatus()
{
switch (g_WifiMTE.TestState) {
case TEST_STATE_WAIT_WMI_READY :
DBG_LOG_PRINT(DBG_ZONE_ERR, ("status: MTE_WIFI_STATUS_BOOT_FAILED \r\n"));
return MTE_WIFI_STATUS_BOOT_FAILED;
case TEST_STATE_WAIT_WMI_CONNECT :
DBG_LOG_PRINT(DBG_ZONE_ERR, ("status: MTE_WIFI_STATUS_ASSOC_FAILED \r\n"));
return MTE_WIFI_STATUS_ASSOC_FAILED;
case TEST_WAIT_DHCP_REPLY :
DBG_LOG_PRINT(DBG_ZONE_ERR, ("status: MTE_WIFI_STATUS_DHCP_FAILED \r\n"));
return MTE_WIFI_STATUS_DHCP_FAILED;
case TEST_WAIT_WMI_STATS:
DBG_LOG_PRINT(DBG_ZONE_ERR, ("status: MTE_WIFI_STATUS_WMI_FAILED \r\n"));
return MTE_WIFI_STATUS_WMI_FAILED;
case TEST_END_SUCCESS:
DBG_LOG_PRINT(DBG_ZONE_ERR, ("status: MTE_WIFI_STATUS_SUCCESS \r\n"));
return MTE_WIFI_STATUS_SUCCESS;
case TEST_GEN_FAILURE:
DBG_LOG_PRINT(DBG_ZONE_ERR, ("status: MTE_WIFI_STATUS_FAILED \r\n"));
return MTE_WIFI_STATUS_FAILED;
default:
A_ASSERT(FALSE);
break;
}
return MTE_WIFI_STATUS_FAILED;
}
示例15: ar6000_hci_send_complete
static void ar6000_hci_send_complete(void *pContext, HTC_PACKET *pPacket)
{
AR6K_HCI_BRIDGE_INFO *pHcidevInfo = (AR6K_HCI_BRIDGE_INFO *)pContext;
void *osbuf = pPacket->pPktContext;
A_ASSERT(osbuf != NULL);
A_ASSERT(pHcidevInfo != NULL);
if (A_FAILED(pPacket->Status)) {
if ((pPacket->Status != A_ECANCELED) && (pPacket->Status != A_NO_RESOURCE)) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HCI Bridge: Send Packet Failed: %d \n",pPacket->Status));
}
}
FreeHTCStruct(pHcidevInfo,pPacket);
FreeBtOsBuf(pHcidevInfo,osbuf);
}