本文整理汇总了C++中DBGLOG函数的典型用法代码示例。如果您正苦于以下问题:C++ DBGLOG函数的具体用法?C++ DBGLOG怎么用?C++ DBGLOG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DBGLOG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: time
int CResPermissionsCache::lookup( IArrayOf<ISecResource>& resources, bool* pFound )
{
time_t tstamp;
time(&tstamp);
int timeout = m_pParentCache->getCacheTimeout();
if(timeout == 0 && m_pParentCache->isTransactionalEnabled())
timeout = 10; //Transactional timeout is set to 10 seconds for long transactions that might take over 10 seconds.
tstamp -= timeout;
if (m_tLastCleanup < tstamp)
removeStaleEntries(tstamp);
int nresources = resources.ordinality();
int nFound = 0;
for (int i = 0; i < nresources; i++)
{
ISecResource& secResource = resources.item(i);
const char* resource = secResource.getName();
if(resource == NULL)
{
*pFound++ = false;
continue;
}
#ifdef _DEBUG
DBGLOG("CACHE: CResPermissionsCache Looking up resource(%d of %d) %s:%s", i, nresources, m_user.c_str(), resource);
#endif
MapResAccess::iterator it = m_resAccessMap.find(SecCacheKeyEntry(resource, secResource.getResourceType()));
if (it != m_resAccessMap.end())//exists in cache
{
ResPermCacheEntry& resParamCacheEntry = (*it).second;
const time_t timestamp = resParamCacheEntry.first;
if (timestamp < tstamp)//entry was not stale during last cleanup but is stale now
*pFound++ = false;
else if(!m_pParentCache->isCacheEnabled() && m_pParentCache->isTransactionalEnabled())//m_pParentCache->getOriginalTimeout() == 0)
{
time_t tctime = getThreadCreateTime();
if(tctime <= 0 || timestamp < tctime)
{
*pFound++ = false;
}
else
{
secResource.copy(resParamCacheEntry.second);
#ifdef _DEBUG
DBGLOG("CACHE: CResPermissionsCache FoundA %s:%s=>%d", m_user.c_str(), resource, ((ISecResource*)resParamCacheEntry.second)->getAccessFlags());
#endif
*pFound++ = true;
nFound++;
}
}
else
{
secResource.copy(resParamCacheEntry.second);
#ifdef _DEBUG
DBGLOG("CACHE: CResPermissionsCache FoundB %s:%s=>%d", m_user.c_str(), resource, ((ISecResource*)resParamCacheEntry.second)->getAccessFlags());
#endif
*pFound++ = true;
nFound++;
}
}
else
*pFound++ = false;
}
return nFound;
}
示例2: mtk_cfg80211_join_ibss
/*----------------------------------------------------------------------------*/
int
mtk_cfg80211_join_ibss (
struct wiphy *wiphy,
struct net_device *ndev,
struct cfg80211_ibss_params *params
)
{
PARAM_SSID_T rNewSsid;
P_GLUE_INFO_T prGlueInfo = NULL;
UINT_32 u4ChnlFreq; /* Store channel or frequency information */
UINT_32 u4BufLen = 0;
WLAN_STATUS rStatus;
prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy);
ASSERT(prGlueInfo);
/* set channel */
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 7, 0)
if(params->channel) {
u4ChnlFreq = nicChannelNum2Freq(params->channel->hw_value);
#else
if(params->chandef.chan) {
u4ChnlFreq = nicChannelNum2Freq(params->chandef.chan->hw_value);
#endif
rStatus = kalIoctl(prGlueInfo,
wlanoidSetFrequency,
&u4ChnlFreq,
sizeof(u4ChnlFreq),
FALSE,
FALSE,
FALSE,
FALSE,
&u4BufLen);
if (rStatus != WLAN_STATUS_SUCCESS) {
return -EFAULT;
}
}
/* set SSID */
kalMemCopy(rNewSsid.aucSsid, params->ssid, params->ssid_len);
rStatus = kalIoctl(prGlueInfo,
wlanoidSetSsid,
(PVOID) &rNewSsid,
sizeof(PARAM_SSID_T),
FALSE,
FALSE,
TRUE,
FALSE,
&u4BufLen);
if (rStatus != WLAN_STATUS_SUCCESS) {
DBGLOG(REQ, WARN, ("set SSID:%lx\n", rStatus));
return -EFAULT;
}
return 0;
return -EINVAL;
}
/*----------------------------------------------------------------------------*/
/*!
* @brief This routine is responsible for requesting to leave from IBSS group
*
* @param
*
* @retval 0: successful
* others: failure
*/
/*----------------------------------------------------------------------------*/
int
mtk_cfg80211_leave_ibss (
struct wiphy *wiphy,
struct net_device *ndev
)
{
P_GLUE_INFO_T prGlueInfo = NULL;
WLAN_STATUS rStatus;
UINT_32 u4BufLen;
prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy);
ASSERT(prGlueInfo);
rStatus = kalIoctl(prGlueInfo,
wlanoidSetDisassociate,
NULL,
0,
FALSE,
FALSE,
TRUE,
FALSE,
&u4BufLen);
if (rStatus != WLAN_STATUS_SUCCESS) {
DBGLOG(REQ, WARN, ("disassociate error:%lx\n", rStatus));
return -EFAULT;
//.........这里部分代码省略.........
示例3: kalP2PInvitationIndication
/*----------------------------------------------------------------------------*/
VOID
kalP2PInvitationIndication (
IN P_GLUE_INFO_T prGlueInfo,
IN P_P2P_DEVICE_DESC_T prP2pDevDesc,
IN PUINT_8 pucSsid,
IN UINT_8 ucSsidLen,
IN UINT_8 ucOperatingChnl,
IN UINT_8 ucInvitationType,
IN PUINT_8 pucGroupBssid
)
{
#if 1
union iwreq_data evt;
UINT_8 aucBuffer[IW_CUSTOM_MAX];
ASSERT(prGlueInfo);
/* buffer peer information for later IOC_P2P_GET_STRUCT access */
prGlueInfo->prP2PInfo->u4ConnReqNameLength = (UINT_32)((prP2pDevDesc->u2NameLength > 32)? 32 : prP2pDevDesc->u2NameLength);
kalMemCopy(prGlueInfo->prP2PInfo->aucConnReqDevName,
prP2pDevDesc->aucName,
prGlueInfo->prP2PInfo->u4ConnReqNameLength);
COPY_MAC_ADDR(prGlueInfo->prP2PInfo->rConnReqPeerAddr, prP2pDevDesc->aucDeviceAddr);
COPY_MAC_ADDR(prGlueInfo->prP2PInfo->rConnReqGroupAddr, pucGroupBssid);
prGlueInfo->prP2PInfo->i4ConnReqConfigMethod = (INT_32)(prP2pDevDesc->u2ConfigMethod);
prGlueInfo->prP2PInfo->ucOperatingChnl = ucOperatingChnl;
prGlueInfo->prP2PInfo->ucInvitationType = ucInvitationType;
// prepare event structure
memset(&evt, 0, sizeof(evt));
snprintf(aucBuffer, IW_CUSTOM_MAX-1, "P2P_INV_INDICATE");
evt.data.length = strlen(aucBuffer);
/* indicate in IWEVCUSTOM event */
wireless_send_event(prGlueInfo->prP2PInfo->prDevHandler,
IWEVCUSTOM,
&evt,
aucBuffer);
return;
#else
P_MSG_P2P_CONNECTION_REQUEST_T prP2pConnReq = (P_MSG_P2P_CONNECTION_REQUEST_T)NULL;
P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL;
P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
do {
ASSERT_BREAK((prGlueInfo != NULL) && (prP2pDevDesc != NULL));
// Not a real solution
prP2pSpecificBssInfo = prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo;
prP2pConnSettings = prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings;
prP2pConnReq = (P_MSG_P2P_CONNECTION_REQUEST_T)cnmMemAlloc(prGlueInfo->prAdapter,
RAM_TYPE_MSG,
sizeof(MSG_P2P_CONNECTION_REQUEST_T));
if (prP2pConnReq == NULL) {
break;
}
kalMemZero(prP2pConnReq, sizeof(MSG_P2P_CONNECTION_REQUEST_T));
prP2pConnReq->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_REQ;
prP2pConnReq->eFormationPolicy = ENUM_P2P_FORMATION_POLICY_AUTO;
COPY_MAC_ADDR(prP2pConnReq->aucDeviceID, prP2pDevDesc->aucDeviceAddr);
prP2pConnReq->u2ConfigMethod = prP2pDevDesc->u2ConfigMethod;
if (ucInvitationType == P2P_INVITATION_TYPE_INVITATION) {
prP2pConnReq->fgIsPersistentGroup = FALSE;
prP2pConnReq->fgIsTobeGO = FALSE;
}
else if (ucInvitationType == P2P_INVITATION_TYPE_REINVOKE) {
DBGLOG(P2P, TRACE, ("Re-invoke Persistent Group\n"));
prP2pConnReq->fgIsPersistentGroup = TRUE;
prP2pConnReq->fgIsTobeGO = (prGlueInfo->prP2PInfo->ucRole == 2)?TRUE:FALSE;
}
p2pFsmRunEventDeviceDiscoveryAbort(prGlueInfo->prAdapter, NULL);
if (ucOperatingChnl != 0) {
prP2pSpecificBssInfo->ucPreferredChannel = ucOperatingChnl;
}
if ((ucSsidLen < 32) && (pucSsid != NULL)) {
COPY_SSID(prP2pConnSettings->aucSSID,
prP2pConnSettings->ucSSIDLen,
pucSsid,
ucSsidLen);
//.........这里部分代码省略.........
示例4: mtk_cfg80211_scan
/*----------------------------------------------------------------------------*/
int
mtk_cfg80211_scan (
struct wiphy *wiphy,
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
struct net_device *ndev,
#endif
struct cfg80211_scan_request *request
)
{
P_GLUE_INFO_T prGlueInfo = NULL;
WLAN_STATUS rStatus;
UINT_32 u4BufLen;
PARAM_SCAN_REQUEST_EXT_T rScanRequest;
prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy);
ASSERT(prGlueInfo);
kalMemZero(&rScanRequest, sizeof(PARAM_SCAN_REQUEST_EXT_T));
/* check if there is any pending scan not yet finished */
if(prGlueInfo->prScanRequest != NULL) {
return -EBUSY;
}
if(request->n_ssids == 0) {
rScanRequest.rSsid.u4SsidLen = 0;
}
else if(request->n_ssids == 1) {
COPY_SSID(rScanRequest.rSsid.aucSsid, rScanRequest.rSsid.u4SsidLen, request->ssids[0].ssid, request->ssids[0].ssid_len);
}
else {
return -EINVAL;
}
if(request->ie_len > 0) {
rScanRequest.u4IELength = request->ie_len;
rScanRequest.pucIE = (PUINT_8)(request->ie);
}
else {
rScanRequest.u4IELength = 0;
}
rStatus = kalIoctl(prGlueInfo,
wlanoidSetBssidListScanExt,
&rScanRequest,
sizeof(PARAM_SCAN_REQUEST_EXT_T),
FALSE,
FALSE,
FALSE,
FALSE,
&u4BufLen);
if (rStatus != WLAN_STATUS_SUCCESS) {
DBGLOG(REQ, WARN, ("scan error:%lx\n", rStatus));
return -EINVAL;
}
prGlueInfo->prScanRequest = request;
return 0;
}
示例5: rlmDomainPassiveScanSendCmd
VOID rlmDomainPassiveScanSendCmd(
P_ADAPTER_T prAdapter,
BOOLEAN fgIsOid
)
{
P_DOMAIN_INFO_ENTRY prDomainInfo;
P_CMD_SET_DOMAIN_INFO_T prCmd;
WLAN_STATUS rStatus;
P_DOMAIN_SUBBAND_INFO prSubBand;
UINT_8 i;
prCmd = cnmMemAlloc(prAdapter, RAM_TYPE_BUF, sizeof(CMD_SET_DOMAIN_INFO_T));
ASSERT(prCmd);
/* To do: exception handle */
if (!prCmd) {
DBGLOG(RLM, ERROR, ("Domain: no buf to send cmd\n"));
return;
}
kalMemZero(prCmd, sizeof(CMD_SET_DOMAIN_INFO_T));
prCmd->u2CountryCode = prAdapter->rWifiVar.rConnSettings.u2CountryCode;
prCmd->u2IsSetPassiveScan = 1;
prCmd->uc2G4Bandwidth = prAdapter->rWifiVar.rConnSettings.uc2G4BandwidthMode;
prCmd->uc5GBandwidth = prAdapter->rWifiVar.rConnSettings.uc5GBandwidthMode;
prCmd->aucReserved[0] = 0;
prCmd->aucReserved[1] = 0;
DBGLOG(RLM, INFO, ("rlmDomainPassiveScanSendCmd(), CountryCode = %x\n", prAdapter->rWifiVar.rConnSettings.u2CountryCode));
if (prAdapter->rWifiVar.rConnSettings.u2CountryCode == COUNTRY_CODE_UDF){
prDomainInfo = &arSupportedRegDomains_Passive[REG_DOMAIN_PASSIVE_UDF_IDX];
}
else{
prDomainInfo = &arSupportedRegDomains_Passive[REG_DOMAIN_PASSIVE_DEF_IDX];
}
for (i = 0; i < 6; i++) {
prSubBand = &prDomainInfo->rSubBand[i];
prCmd->rSubBand[i].ucRegClass = prSubBand->ucRegClass;
prCmd->rSubBand[i].ucBand = prSubBand->ucBand;
if (prSubBand->ucBand != BAND_NULL && prSubBand->ucBand < BAND_NUM) {
prCmd->rSubBand[i].ucChannelSpan = prSubBand->ucChannelSpan;
prCmd->rSubBand[i].ucFirstChannelNum = prSubBand->ucFirstChannelNum;
prCmd->rSubBand[i].ucNumChannels = prSubBand->ucNumChannels;
}
}
rStatus = wlanSendSetQueryCmd (
prAdapter, /* prAdapter */
CMD_ID_SET_DOMAIN_INFO, /* ucCID */
TRUE, /* fgSetQuery */
FALSE, /* fgNeedResp */
fgIsOid, /* fgIsOid */
NULL, /* pfCmdDoneHandler*/
NULL, /* pfCmdTimeoutHandler */
sizeof(CMD_SET_DOMAIN_INFO_T), /* u4SetQueryInfoLen */
(PUINT_8) prCmd, /* pucInfoBuffer */
NULL, /* pvSetQueryBuffer */
0 /* u4SetQueryBufferLen */
);
ASSERT(rStatus == WLAN_STATUS_PENDING);
cnmMemFree(prAdapter, prCmd);
}
示例6: assertex
void OrderedInput::updateSequentialDistance(const void * seek, const void * next, unsigned numFields, bool seekToSameLocation, bool nowMatched)
{
//Note: With large numbers of matches in all documents, the ordered inputs will remain stable,
//because the first input will have a better distance than the exact matches.
assertex(distanceCalculator);
SkipDistance thisDistance;
thisDistance.field = distanceCalculator->getDistance(thisDistance.distance, seek, next, numFields);
#ifdef IGNORE_SEEK_TO_SELF
//If the previous seek was a nextGE() that returned a row which didn't match the criteia, that then matched
//a different index, and we then get a subsequent call which does match property on the same record
//then we shouldn't include this is the skipping distance.
if (thisDistance.field == DISTANCE_EXACT_MATCH)
{
assertex(nowMatched);
if (nowMatched && seekToSameLocation)
return;
}
#endif
distances[nextDistanceIndex].set(thisDistance);
if (nextDistanceIndex == MaxDistanceSamples-1)
nextDistanceIndex = 0;
else
nextDistanceIndex++;
if (numSamples < MaxDistanceSamples)
numSamples++;
if (numSamples < MaxDistanceSamples)
{
//choose the last to start with - fairly arbitrary.
medianDistance.set(thisDistance);
}
else
{
int c01 = distances[0].compare(distances[1]);
unsigned median;
if (c01 == 0)
{
//Same => the median must be the same as either of them.
median = 0;
}
else
{
int c02 = distances[0].compare(distances[2]);
if (c01 < 0)
{
if (c02 >= 0)
{
//c <= a < b
median = 0;
}
else
{
//a < b, a < c => smallest of b,c
int c12 = distances[1].compare(distances[2]);
median = c12 <= 0 ? 1 : 2;
}
}
else
{
if (c02 <= 0)
{
// c >= a > b
median = 0;
}
else
{
// a > b, a > c => median is largest if b,c
int c12 = distances[1].compare(distances[2]);
median = c12 >= 0 ? 1 : 2;
}
}
}
#ifdef TRACE_JOIN_OPTIMIZATION
if (medianDistance.compare(distances[median]) != 0)
DBGLOG("Median for input %d changed from %d:%" I64F "d to %d:%" I64F "d",
originalIndex, medianDistance.field, medianDistance.distance,
distances[median].field, distances[median].distance);
#endif
medianDistance.set(distances[median]);
}
}
示例7: eemcs_expt_mod_init
/*
* @brief Initialization of exception handling
* @param
* None
* @return
* This function returns KAL_SUCCESS always.
*/
KAL_INT32 eemcs_expt_mod_init(void)
{
KAL_UINT32 i = 0;
//KAL_UINT32 except_txq = 0, except_rxq = 0;
//KAL_UINT32 nonstop_rxq = 0; /* for Log path to output as much as possible */
KAL_INT32 ret;
ccci_port_cfg *log_queue_config;
DEBUG_LOG_FUNCTION_ENTRY;
//Init md exception type
g_except_inst.md_ex_type = 0;
/* init expt_cb and expt_cb_lock*/
spin_lock_init(&g_except_inst.expt_cb_lock);
for(i = 0; i < CCCI_PORT_NUM_MAX; i++) {
g_except_inst.expt_cb[i] = NULL;
if(TR_Q_INVALID != ccci_expt_port_info[i].expt_txq_id)
{
set_bit(SDIO_TXQ(ccci_expt_port_info[i].expt_txq_id), (unsigned long *)&except_txq);
}
if(TR_Q_INVALID != ccci_expt_port_info[i].expt_rxq_id)
{
set_bit(SDIO_RXQ(ccci_expt_port_info[i].expt_rxq_id), (unsigned long *)&except_rxq);
}
}
eemcs_expt_ut_init();
log_queue_config = ccci_get_port_info(CCCI_PORT_MD_LOG);
set_bit(SDIO_RXQ(log_queue_config->rxq_id), (unsigned long *)&nonstop_rxq);
hif_except_init(nonstop_rxq, (except_txq << 16) | except_rxq);
ret = hif_reg_expt_cb(ccci_df_to_ccci_exception_callback);
KAL_ASSERT(ret == KAL_SUCCESS);
DBGLOG(EXPT, TRA, "nonstop_txq=%d, nonstop_rxq=%d, exp_txq=%d, exp_rxq=%d", \
0, nonstop_rxq, except_txq, except_rxq);
/* Init Tx Q list */
for (i = 0; i < SDIO_TX_Q_NUM; i++) {
g_except_inst.txq[i].id = -1;
atomic_set(&g_except_inst.txq[i].pkt_cnt, 0);
skb_queue_head_init(&g_except_inst.txq[i].skb_list);
}
/* Init Rx Q list */
for (i = 0; i < SDIO_RX_Q_NUM; i++) {
g_except_inst.rxq[i].id = -1;
atomic_set(&g_except_inst.rxq[i].pkt_cnt, 0);
skb_queue_head_init(&g_except_inst.rxq[i].skb_list);
}
/* Init port list */
for (i = 0; i < CCCI_PORT_NUM; i++) {
atomic_set(&g_except_inst.port[i].pkt_cnt, 0);
skb_queue_head_init(&g_except_inst.port[i].skb_list);
}
/* initialize drop count */
eemcs_expt_reset_statistics();
/* initialize exception*/
eemcs_exception_state = EEMCS_EX_NONE;
/* initialize exception timer*/
init_timer(&g_except_inst.md_ex_monitor);
g_except_inst.md_ex_monitor.function = ex_monitor_func;
g_except_inst.md_ex_monitor.data = (unsigned long)&g_except_inst;
/* allocate memory for modem assert info*/
g_except_inst.expt_info_mem = (KAL_UINT8 *)kmalloc(MD_EX_MEM_SIZE, GFP_KERNEL);
if (g_except_inst.expt_info_mem) {
DBGLOG(EXPT, ERR, "alloc exception info memory ok: %p", g_except_inst.expt_info_mem);
memset(g_except_inst.expt_info_mem, 0, MD_EX_MEM_SIZE);
} else {
DBGLOG(EXPT, ERR, "alloc exception info memory fail");
}
#ifdef ENABLE_MD_WDT_PROCESS
eemcs_ccci_register_WDT_callback(eemcs_wdt_reset_callback);
#endif
DEBUG_LOG_FUNCTION_LEAVE;
return KAL_SUCCESS;
}
示例8: eemcs_ee_info_dump
/*
* @brief dump ee info to string and send to eemcs_aed
* @param
* debug_info [in] debug info get from MD_EX_REC_OK msg,
* parse by eemcs_md_exception_data_parse.
*
* @return
* none.
*/
void eemcs_ee_info_dump(DEBUG_INFO_T *debug_info, char* except_info_addr)
{
char ex_info[EE_BUF_LEN]="";
char i_bit_ex_info[EE_BUF_LEN]="\nMay I-Bit dis too long\n";
struct rtc_time tm;
struct timeval tv = {0};
struct timeval tv_android = {0};
struct rtc_time tm_android;
do_gettimeofday(&tv);
tv_android = tv;
rtc_time_to_tm(tv.tv_sec, &tm);
tv_android.tv_sec -= sys_tz.tz_minuteswest*60;
rtc_time_to_tm(tv_android.tv_sec, &tm_android);
DBGLOG(EXPT, DBG, "");
DBGLOG(EXPT, DBG, "Sync:%d%02d%02d %02d:%02d:%02d.%u(%02d:%02d:%02d.%03d(TZone))",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec,
(unsigned int) tv.tv_usec,
tm_android.tm_hour, tm_android.tm_min, tm_android.tm_sec,
(unsigned int) tv_android.tv_usec);
DBGLOG(EXPT, DBG, "exception type(%d):%s",debug_info->type,debug_info->name?:"Unknown");
switch(debug_info->type)
{
case MD_EX_TYPE_ASSERT_DUMP:
case MD_EX_TYPE_ASSERT:
DBGLOG(EXPT, DBG, "filename = %s", debug_info->assert.file_name);
DBGLOG(EXPT, DBG, "line = %d", debug_info->assert.line_num);
DBGLOG(EXPT, DBG, "para0 = %d, para1 = %d, para2 = %d",
debug_info->assert.parameters[0],
debug_info->assert.parameters[1],
debug_info->assert.parameters[2]);
snprintf(ex_info,EE_BUF_LEN,"\n[%s] file:%s line:%d\np1:0x%08x\np2:0x%08x\np3:0x%08x\n",
debug_info->name,
debug_info->assert.file_name,
debug_info->assert.line_num,
debug_info->assert.parameters[0],
debug_info->assert.parameters[1],
debug_info->assert.parameters[2]);
break;
case MD_EX_TYPE_UNDEF:
case MD_EX_TYPE_SWI:
case MD_EX_TYPE_PREF_ABT:
case MD_EX_TYPE_DATA_ABT:
case MD_EX_TYPE_FATALERR_BUF:
case MD_EX_TYPE_FATALERR_TASK:
DBGLOG(EXPT, DBG, "fatal error code 1 = %d", debug_info->fatal_error.err_code1);
DBGLOG(EXPT, DBG, "fatal error code 2 = %d", debug_info->fatal_error.err_code2);
snprintf(ex_info,EE_BUF_LEN,"\n[%s] err_code1:%d err_code2:%d\n", debug_info->name,
debug_info->fatal_error.err_code1, debug_info->fatal_error.err_code2);
break;
case MD_EX_TYPE_EMI_CHECK:
DBGLOG(EXPT, ERR, "md_emi_check: %08X, %08X, %02d, %08X",
debug_info->data.data0, debug_info->data.data1,
debug_info->data.channel, debug_info->data.reserved);
snprintf(ex_info,EE_BUF_LEN,"\n[emi_chk] %08X, %08X, %02d, %08X\n",
debug_info->data.data0, debug_info->data.data1,
debug_info->data.channel, debug_info->data.reserved);
break;
case DSP_EX_TYPE_ASSERT:
DBGLOG(EXPT, DBG, "filename = %s", debug_info->dsp_assert.file_name);
DBGLOG(EXPT, DBG, "line = %d", debug_info->dsp_assert.line_num);
DBGLOG(EXPT, DBG, "exec unit = %s", debug_info->dsp_assert.execution_unit);
DBGLOG(EXPT, DBG, "para0 = %d, para1 = %d, para2 = %d",
debug_info->dsp_assert.parameters[0],
debug_info->dsp_assert.parameters[1],
debug_info->dsp_assert.parameters[2]);
snprintf(ex_info,EE_BUF_LEN,"\n[%s] file:%s line:%d\nexec:%s\np1:%d\np2:%d\np3:%d\n",
debug_info->name, debug_info->assert.file_name, debug_info->assert.line_num,
debug_info->dsp_assert.execution_unit,
debug_info->dsp_assert.parameters[0],
debug_info->dsp_assert.parameters[1],
debug_info->dsp_assert.parameters[2]);
break;
case DSP_EX_TYPE_EXCEPTION:
DBGLOG(EXPT, DBG, "exec unit = %s, code1:0x%08x", debug_info->dsp_exception.execution_unit,
debug_info->dsp_exception.code1);
snprintf(ex_info,EE_BUF_LEN,"\n[%s] exec:%s code1:0x%08x\n",
debug_info->name, debug_info->dsp_exception.execution_unit,
debug_info->dsp_exception.code1);
break;
case DSP_EX_FATAL_ERROR:
DBGLOG(EXPT, DBG, "exec unit = %s", debug_info->dsp_fatal_err.execution_unit);
DBGLOG(EXPT, DBG, "err_code0 = 0x%08x, err_code1 = 0x%08x",
debug_info->dsp_fatal_err.err_code[0],
debug_info->dsp_fatal_err.err_code[1]);
snprintf(ex_info,EE_BUF_LEN,"\n[%s] exec:%s err_code1:0x%08x err_code2:0x%08x\n",
debug_info->name, debug_info->dsp_fatal_err.execution_unit,
//.........这里部分代码省略.........
示例9: eemcs_expt_flush
/*
* @brief Flush all packets in exception instance to files for debugging
* @param
* None
* @return
* This function returns KAL_SUCCESS always.
*/
KAL_INT32 eemcs_expt_flush()
{
KAL_UINT32 pkts = 0;
KAL_UINT32 i = 0;
// struct sk_buff *skb = NULL;
/* Flush all port skb from expt skb list */
for (i = 0; i < CCCI_PORT_NUM; i++) {
pkts = atomic_read(&g_except_inst.port[i].pkt_cnt);
/* No data in port */
if (pkts == 0)
continue;
DBGLOG(EXPT, DBG, "free %d skb in port%d expt list", pkts, i);
skb_queue_purge(&g_except_inst.port[i].skb_list);
atomic_set(&g_except_inst.port[i].pkt_cnt, 0);
}
/* Flush all rx skb from expt skb list */
for (i = 0; i < SDIO_RX_Q_NUM; i++) {
pkts = atomic_read(&g_except_inst.rxq[i].pkt_cnt);
/* No data in port */
if (pkts == 0)
continue;
DBGLOG(EXPT, DBG, "free %d skb in rxq%d expt list", pkts, i);
skb_queue_purge(&g_except_inst.rxq[i].skb_list);
atomic_set(&g_except_inst.rxq[i].pkt_cnt, 0);
}
/* Flush all tx skb from expt skb list */
for (i = 0; i < SDIO_TX_Q_NUM; i++) {
pkts = atomic_read(&g_except_inst.txq[i].pkt_cnt);
/* No data in port */
if (pkts == 0)
continue;
DBGLOG(EXPT, DBG, "free %d skb in txq%d expt list", pkts, i);
skb_queue_purge(&g_except_inst.txq[i].skb_list);
atomic_set(&g_except_inst.txq[i].pkt_cnt, 0);
}
#if 0
char log_file[NAME_MAX] = {0};
struct file *fp = NULL;
KAL_UINT32 pkts = 0;
KAL_UINT32 i = 0, j = 0;
struct sk_buff *skb = NULL;
DEBUG_LOG_FUNCTION_ENTRY;
/* Flush all DL packets to a file */
for (i = 0; i < SDIO_RX_Q_NUM; i++) {
pkts = atomic_read(&g_except_inst.rxq[i].pkt_cnt);
DBGLOG(EXPT, DBG, "[EXPT] %d packets in DL SWQ %d", pkts, i);
/* No data in Rx Q */
if (pkts == 0)
continue;
sprintf(log_file, "%s/eemcs_expt_rx-%02d_%d.bak", EEMCS_EXCEPTION_LOG_PATH, g_except_inst.rxq[i].id, pkts);
fp = file_open(log_file, O_RDWR | O_CREAT | O_TRUNC, 0777);
if (fp == NULL) {
DBGLOG(EXPT, ERR, "[EXPT] Failed to open file %s", log_file);
continue;
}
// Write packets number
file_write(fp, (char*)&pkts, sizeof(KAL_UINT32));
/* Write each skb in list */
for (j = 0; j < pkts; j++) {
skb = skb_dequeue(&g_except_inst.rxq[i].skb_list);
if (skb == NULL) {
DBGLOG(EXPT, WAR, "[EXPT] Failed to read skb from RX list %d", i);
} else {
hif_dl_pkt_handle_complete(i);
// Write skb data length
file_write(fp, (char*)&skb->len, sizeof(unsigned int));
// Write skb data
file_write(fp, skb->data, skb->len);
atomic_dec(&g_except_inst.rxq[i].pkt_cnt);
}
}
file_close(fp);
DBGLOG(EXPT, TRA, "[EXPT] All unhandled DL packets in Q are saved to %s", log_file);
}
/* Flush all UL packets to a file */
for (i = 0; i < SDIO_TX_Q_NUM; i++) {
pkts = atomic_read(&g_except_inst.txq[i].pkt_cnt);
DBGLOG(EXPT, DBG, "[EXPT] %d packets in UL SWQ %d", pkts, i);
/* No data in Tx Q */
if (pkts == 0)
continue;
//.........这里部分代码省略.........
示例10: rlmDomainGetDomainInfo
/*----------------------------------------------------------------------------*/
P_DOMAIN_INFO_ENTRY
rlmDomainGetDomainInfo (
P_ADAPTER_T prAdapter
)
{
#define REG_DOMAIN_GROUP_NUM \
(sizeof(arSupportedRegDomains) / sizeof(DOMAIN_INFO_ENTRY))
UINT_16 i, j;
P_DOMAIN_INFO_ENTRY prDomainInfo;
P_REG_INFO_T prRegInfo;
UINT_16 u2TargetCountryCode;
ASSERT(prAdapter);
prRegInfo = &prAdapter->prGlueInfo->rRegInfo;
DBGLOG(RLM, INFO, ("Domain: map=%d, idx=%d, code=0x%04x\n",
prRegInfo->eRegChannelListMap, prRegInfo->ucRegChannelListIndex,
prAdapter->rWifiVar.rConnSettings.u2CountryCode));
/* only 1 is set among idx/customized/countryCode in NVRAM */
/* searched by idx */
if (prRegInfo->eRegChannelListMap == REG_CH_MAP_TBL_IDX &&
prRegInfo->ucRegChannelListIndex < REG_DOMAIN_GROUP_NUM) {
prDomainInfo = &arSupportedRegDomains[prRegInfo->ucRegChannelListIndex];
goto L_set_domain_info;
} /* searched by customized */
else if (prRegInfo->eRegChannelListMap == REG_CH_MAP_CUSTOMIZED) {
prDomainInfo = &prRegInfo->rDomainInfo;
goto L_set_domain_info;
}
/* searched by countryCode */
u2TargetCountryCode = prAdapter->rWifiVar.rConnSettings.u2CountryCode;
for (i = 0; i < REG_DOMAIN_GROUP_NUM; i++) {
prDomainInfo = &arSupportedRegDomains[i];
ASSERT((prDomainInfo->u4CountryNum && prDomainInfo->pu2CountryGroup) ||
prDomainInfo->u4CountryNum == 0);
for (j = 0; j < prDomainInfo->u4CountryNum; j++) {
if (prDomainInfo->pu2CountryGroup[j] == u2TargetCountryCode) {
break;
}
}
if (j < prDomainInfo->u4CountryNum) {
break; /* Found */
}
}
DATA_STRUC_INSPECTING_ASSERT(REG_DOMAIN_DEF_IDX < REG_DOMAIN_GROUP_NUM);
/* If no matched countryCode */
if (i >= REG_DOMAIN_GROUP_NUM){
if (prAdapter->prDomainInfo) /* use previous NVRAM setting */
return prAdapter->prDomainInfo;
else /* if never set before, use EU */
prDomainInfo = &arSupportedRegDomains[REG_DOMAIN_DEF_IDX];
}
L_set_domain_info:
prAdapter->prDomainInfo = prDomainInfo;
return prDomainInfo;
}
示例11: eemcs_expt_handshake
/*
* @brief EEMCS exception handshake .
* @param
* skb [in] SKB from MD exception, call by eemcs_boot_rx_callback
* when receive with MAGIC "MD_EX_MAGIC".
*
* @return
* KAL_SUCCESS success.
* KAL_FAIL fail.
*/
KAL_INT32 eemcs_expt_handshake(struct sk_buff *skb){
CCCI_BUFF_T *msg = (CCCI_BUFF_T *)skb->data;
DEBUG_INFO_T debug_info = {0};
KAL_INT32 ret = KAL_SUCCESS;
switch(msg->id){
case MD_EX :
if(msg->reserved != MD_EX_CHK_ID){
DBGLOG(EXPT, ERR, "Invalid MD_EX: %08X, %08X, %08X, %08X",
msg->magic, msg->id, msg->channel, msg->reserved);
ret = KAL_FAIL;
break;
}
DBGLOG(EXPT, DBG, "receive MD_EX");
//change_device_state(EEMCS_EXCEPTION);
/*move to ccci_df_to_ccci_exception_callback*/
//eemcs_cdev_msg(CCCI_PORT_CTRL, CCCI_MD_MSG_EXCEPTION, 0);
msg->channel = CH_CTRL_TX;
eemcs_ccci_UL_write_skb_to_swq(CH_CTRL_TX, skb);
//2. set up timer for waiting MD_EX_REC_OK msg
if (eemcs_exception_state != EEMCS_EX_REC_MSG_OK) {
set_exception_mode(EEMCS_EX_MSG_OK);
mod_timer(&g_except_inst.md_ex_monitor, jiffies+EE_HS2_TIMER);
}
return ret;
case MD_EX_REC_OK :
if(msg->reserved != MD_EX_REC_OK_CHK_ID){
DBGLOG(EXPT, ERR, "Invalid MD_EX_REC_OK: %08X, %08X, %08X, %08X",
msg->magic, msg->id, msg->channel, msg->reserved);
ret = KAL_FAIL;
break;
}
DBGLOG(EXPT, DBG, "receive MD_EX_REC_OK");
set_exception_mode(EEMCS_EX_REC_MSG_OK);
del_timer(&g_except_inst.md_ex_monitor);
DBGLOG(EXPT, DBG, "eemcs_md_exception_data_parse");
eemcs_md_exception_data_parse((char*)(msg+1), &debug_info);
eemcs_ee_info_dump(&debug_info, (char*)(msg+1));
break;
case MD_EX_RESUME_CHK_ID :
DBGLOG(EXPT, DBG, "receive MD_EX_RESUME_CHK_ID");
md_emi_check(msg, &debug_info);
eemcs_ee_info_dump(&debug_info, (char*)(msg+1));
break;
case CCCI_DRV_VER_ERROR :
DBGLOG(EXPT, ERR, "AP EEMCS driver version mis-match to MD!!");
eemcs_aed(0, "AP/MD driver version mis-match\n");
break;
default:
DBGLOG(EXPT, ERR, "[EXPT] Invalid MD_EX_MAGIC: %08X, %08X, %02d, %08X",
msg->magic, msg->id, msg->channel, msg->reserved);
break;
}
dev_kfree_skb(skb);
return ret;
}
示例12: rlmDomainSendCmd
/*----------------------------------------------------------------------------*/
VOID
rlmDomainSendCmd (
P_ADAPTER_T prAdapter,
BOOLEAN fgIsOid
)
{
P_DOMAIN_INFO_ENTRY prDomainInfo;
P_CMD_SET_DOMAIN_INFO_T prCmd;
WLAN_STATUS rStatus;
P_DOMAIN_SUBBAND_INFO prSubBand;
UINT_8 i;
prDomainInfo = rlmDomainGetDomainInfo(prAdapter);
ASSERT(prDomainInfo);
prCmd = cnmMemAlloc(prAdapter, RAM_TYPE_BUF, sizeof(CMD_SET_DOMAIN_INFO_T));
ASSERT(prCmd);
/* To do: exception handle */
if (!prCmd) {
DBGLOG(RLM, ERROR, ("Domain: no buf to send cmd\n"));
return;
}
kalMemZero(prCmd, sizeof(CMD_SET_DOMAIN_INFO_T));
/* previous country code == FF : ignore country code, current country code == FE : resume */
if(prAdapter->rWifiVar.rConnSettings.u2CountryCodeBakup == COUNTRY_CODE_FF){
if (prAdapter->rWifiVar.rConnSettings.u2CountryCode != COUNTRY_CODE_FE){
DBGLOG(RLM, INFO, ("Domain: skip country code cmd (0x%x)\n",prAdapter->rWifiVar.rConnSettings.u2CountryCode));
return;
}else{
DBGLOG(RLM, INFO, ("Domain: disable skip country code cmd (0x%x)\n",prAdapter->rWifiVar.rConnSettings.u2CountryCode));
}
}
prAdapter->rWifiVar.rConnSettings.u2CountryCodeBakup = prAdapter->rWifiVar.rConnSettings.u2CountryCode;
DBGLOG(RLM, INFO, ("Domain: country code backup %x \n",prAdapter->rWifiVar.rConnSettings.u2CountryCodeBakup));
prCmd->u2CountryCode = prAdapter->rWifiVar.rConnSettings.u2CountryCode;
prCmd->u2IsSetPassiveScan = 0;
prCmd->uc2G4Bandwidth = prAdapter->rWifiVar.rConnSettings.uc2G4BandwidthMode;
prCmd->uc5GBandwidth = prAdapter->rWifiVar.rConnSettings.uc5GBandwidthMode;
prCmd->aucReserved[0] = 0;
prCmd->aucReserved[1] = 0;
for (i = 0; i < 6; i++) {
prSubBand = &prDomainInfo->rSubBand[i];
prCmd->rSubBand[i].ucRegClass = prSubBand->ucRegClass;
prCmd->rSubBand[i].ucBand = prSubBand->ucBand;
if (prSubBand->ucBand != BAND_NULL && prSubBand->ucBand < BAND_NUM) {
prCmd->rSubBand[i].ucChannelSpan = prSubBand->ucChannelSpan;
prCmd->rSubBand[i].ucFirstChannelNum = prSubBand->ucFirstChannelNum;
prCmd->rSubBand[i].ucNumChannels = prSubBand->ucNumChannels;
}
}
DBGLOG(RLM, INFO, ("rlmDomainSendCmd(), SetQueryCmd\n"));
/* Update domain info to chip */
rStatus = wlanSendSetQueryCmd (
prAdapter, /* prAdapter */
CMD_ID_SET_DOMAIN_INFO, /* ucCID */
TRUE, /* fgSetQuery */
FALSE, /* fgNeedResp */
fgIsOid, /* fgIsOid */
NULL, /* pfCmdDoneHandler*/
NULL, /* pfCmdTimeoutHandler */
sizeof(CMD_SET_DOMAIN_INFO_T), /* u4SetQueryInfoLen */
(PUINT_8) prCmd, /* pucInfoBuffer */
NULL, /* pvSetQueryBuffer */
0 /* u4SetQueryBufferLen */
);
ASSERT(rStatus == WLAN_STATUS_PENDING);
cnmMemFree(prAdapter, prCmd);
rlmDomainPassiveScanSendCmd(prAdapter, fgIsOid);
}
示例13: eemcs_wdt_reset_work_func
static void eemcs_wdt_reset_work_func(struct work_struct *work){
DBGLOG(EXPT, DBG, "eemcs_wdt_reset_work_func modem reset");
eemcs_md_reset();
}
示例14: mtk_cfg80211_get_station
int
mtk_cfg80211_get_station (
struct wiphy *wiphy,
struct net_device *ndev,
u8 *mac,
struct station_info *sinfo
)
{
P_GLUE_INFO_T prGlueInfo = NULL;
WLAN_STATUS rStatus;
PARAM_MAC_ADDRESS arBssid;
UINT_32 u4BufLen, u4Rate;
INT_32 i4Rssi;
prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy);
ASSERT(prGlueInfo);
kalMemZero(arBssid, MAC_ADDR_LEN);
wlanQueryInformation(prGlueInfo->prAdapter,
wlanoidQueryBssid,
&arBssid[0],
sizeof(arBssid),
&u4BufLen);
/* 1. check BSSID */
if(UNEQUAL_MAC_ADDR(arBssid, mac)) {
/* wrong MAC address */
DBGLOG(REQ, WARN, ("incorrect BSSID: ["MACSTR"] currently connected BSSID["MACSTR"]\n",
MAC2STR(mac), MAC2STR(arBssid)));
return -ENOENT;
}
/* 2. fill TX rate */
rStatus = kalIoctl(prGlueInfo,
wlanoidQueryLinkSpeed,
&u4Rate,
sizeof(u4Rate),
TRUE,
FALSE,
FALSE,
FALSE,
&u4BufLen);
if (rStatus != WLAN_STATUS_SUCCESS) {
DBGLOG(REQ, WARN, ("unable to retrieve link speed\n"));
}
else {
sinfo->filled |= STATION_INFO_TX_BITRATE;
sinfo->txrate.legacy = u4Rate / 1000; /* convert from 100bps to 100kbps */
}
if(prGlueInfo->eParamMediaStateIndicated != PARAM_MEDIA_STATE_CONNECTED) {
/* not connected */
DBGLOG(REQ, WARN, ("not yet connected\n"));
}
else {
/* 3. fill RSSI */
rStatus = kalIoctl(prGlueInfo,
wlanoidQueryRssi,
&i4Rssi,
sizeof(i4Rssi),
TRUE,
FALSE,
FALSE,
FALSE,
&u4BufLen);
if (rStatus != WLAN_STATUS_SUCCESS) {
DBGLOG(REQ, WARN, ("unable to retrieve link speed\n"));
}
else {
sinfo->filled |= STATION_INFO_SIGNAL;
sinfo->signal = i4Rssi; /* dBm */
}
}
return 0;
}
示例15: eemcs_wdt_reset_callback
KAL_INT32 eemcs_wdt_reset_callback(void){
static DECLARE_WORK(eemcs_wdt_reset_work, eemcs_wdt_reset_work_func);
DBGLOG(EXPT, DBG, "eemcs_wdt_reset_callback");
schedule_work(&eemcs_wdt_reset_work);
return 0;
}