本文整理汇总了C++中FL函数的典型用法代码示例。如果您正苦于以下问题:C++ FL函数的具体用法?C++ FL怎么用?C++ FL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gausstrig_process_krate
static int32_t gausstrig_process_krate(CSOUND* csound, GAUSSTRIG *p)
{
MYFLT frq, dev;
p->frq0 = *p->kfrq;
frq = (*p->kfrq > FL(0.001) ? *p->kfrq : FL(0.001));
dev = *p->kdev;
if (p->first > 0) {
/* values less than FL(0.0) could be used in later versions
as an offset in samples */
int32_t nextsamps;
MYFLT nextcount, r1, r2;
/* this very line of k-time fix. Changed GetSt to GetKr */
nextsamps = (int32_t)(csound->GetKr(csound) / frq);
p->rand = csoundRand31(&p->rand);
r1 = (MYFLT)p->rand * dv2_31;
p->rand = csoundRand31(&p->rand);
r2 = (MYFLT)p->rand * dv2_31;
nextcount = SQRT(FL(-2.0) * LOG(r1)) * SIN(r2 * TWOPI_F);
if (nextcount < FL(-1.0)) {
MYFLT diff = FL(-1.0) - nextcount;
nextcount = (FL(1.0) < FL(-1.0) + diff ? FL(1.0) : FL(-1.0) + diff);
}
else if (nextcount > FL(1.0)) {
MYFLT diff = nextcount - FL(1.0);
nextcount = (FL(-1.0) > FL(1.0) - diff ? FL(-1.0) : FL(1.0) - diff);
}
p->count = (int32_t)(nextsamps + nextcount * dev * nextsamps);
p->first = 0;
}
if (p->count <= 0) {
int32_t nextsamps;
MYFLT nextcount, r1, r2;
/* this very line of k-time fix. Changed GetSt to GetKr */
nextsamps = (int32_t)(csound->GetKr(csound) / frq);
p->rand = csoundRand31(&p->rand);
r1 = (MYFLT)p->rand * dv2_31;
p->rand = csoundRand31(&p->rand);
r2 = (MYFLT)p->rand * dv2_31;
nextcount = SQRT(FL(-2.0) * LOG(r1)) * SIN(r2 * TWOPI_F);
if (nextcount < FL(-1.0)) {
MYFLT diff = FL(-1.0) - nextcount;
nextcount = (FL(1.0) < FL(-1.0) + diff ? FL(1.0) : FL(-1.0) + diff);
}
else if (nextcount > FL(1.0)) {
MYFLT diff = nextcount - FL(1.0);
nextcount = (FL(-1.0) > FL(1.0) - diff ? FL(-1.0) : FL(1.0) - diff);
}
p->count = (int32_t)(nextsamps + nextcount * dev * nextsamps);
*p->out = *p->kamp;
}
else {
if (p->mmode && *p->kfrq != p->frq0)
p->count = 0;
*p->out = FL(0.0);
}
p->count--;
return OK;
}
示例2: psynth_process
static int psynth_process(CSOUND *csound, _PSYN *p)
{
double ampnext, amp, freq, freqnext, phase, ratio;
double a, f, frac, incra, incrph, factor;
MYFLT scale = *p->scal, pitch = *p->pitch;
int ndx, size = p->func->flen;
int i, j, k, m, id;
int notcontin = 0;
int contin = 0;
int tracks = p->tracks, maxtracks = (int) *p->maxtracks;
MYFLT *tab = p->func->ftable, *out = p->out;
float *fin = (float *) p->fin->frame.auxp;
uint32_t offset = p->h.insdshead->ksmps_offset;
uint32_t early = p->h.insdshead->ksmps_no_end;
uint32_t n, nsmps = CS_KSMPS;
int pos = p->pos;
double *amps = (double *) p->amps.auxp, *freqs = (double *) p->freqs.auxp;
double *phases = (double *) p->phases.auxp;
MYFLT *outsum = (MYFLT *) p->sum.auxp;
int *trackID = (int *) p->trackID.auxp;
int hopsize = p->hopsize;
double min = p->min;
ratio = size * csound->onedsr;
factor = p->factor;
maxtracks = p->numbins > maxtracks ? maxtracks : p->numbins;
if (UNLIKELY(offset)) memset(out, '\0', offset*sizeof(MYFLT));
if (UNLIKELY(early)) {
nsmps -= early;
memset(&out[nsmps], '\0', early*sizeof(MYFLT));
}
for (n = offset; n < nsmps; n++) {
out[n] = outsum[pos];
pos++;
if (pos == hopsize) {
memset(outsum, 0, sizeof(MYFLT) * hopsize);
/* for each track */
i = j = k = 0;
while (i < maxtracks * 4) {
ampnext = (double) fin[i] * scale;
freqnext = (double) fin[i + 1] * pitch;
if ((id = (int) fin[i + 3]) != -1) {
j = k + notcontin;
if (k < tracks - notcontin) {
if (trackID[j] == id) {
/* if this is a continuing track */
contin = 1;
freq = freqs[j];
phase = phases[j];
amp = amps[j];
}
else {
/* if this is a dead track */
contin = 0;
freqnext = freq = freqs[j];
phase = phases[j];
amp = amps[j];
ampnext = FL(0.0);
}
}
else {
/* new track */
contin = 1;
freq = freqnext;
phase = -freq * factor;
amp = FL(0.0);
}
if(amp > min){
/* interpolation & track synthesis loop */
a = amp;
f = freq;
incra = (ampnext - amp) / hopsize;
incrph = (freqnext - freq) / hopsize;
for (m = 0; m < hopsize; m++) {
/* table lookup oscillator */
phase += f * ratio;
while (phase < 0)
phase += size;
while (phase >= size)
phase -= size;
ndx = (int) phase;
frac = phase - ndx;
outsum[m] += a * (tab[ndx] + (tab[ndx + 1] - tab[ndx]) * frac);
a += incra;
f += incrph;
}
}
/* keep amp, freq, and phase values for next time */
if (contin) {
amps[k] = ampnext;
freqs[k] = freqnext;
phases[k] = phase;
trackID[k] = id;
i += 4;
//.........这里部分代码省略.........
示例3: limSendRemainOnChannelDebugMarkerFrame
/*----------------------------------------------------------------------------
*
* The function limSendRemainOnChannelDebugMarkerFrame, prepares Marker frame
* for Start and End of remain on channel with RemainOnChannelMsg as Vendor
* Specific information element of the frame.
*
*----------------------------------------------------------------------------*/
tSirRetStatus limSendRemainOnChannelDebugMarkerFrame(tpAniSirGlobal pMac,
tANI_U8 *remainOnChannelMsg)
{
tSirMacAddr magicMacAddr= {0x11, 0x22, 0x33, 0x44, 0x55, 0x66};
tANI_U32 nBytes, nPayload;
tSirRetStatus nSirStatus;
tANI_U8 *pFrame;
void *pPacket;
eHalStatus halstatus;
tANI_U8 txFlag = 0;
publicVendorSpecific *pPublicVendorSpecific;
pPublicVendorSpecific = vos_mem_malloc(sizeof(publicVendorSpecific));
if( pPublicVendorSpecific == NULL )
{
limLog( pMac, LOGE,
FL( "Unable to allocate memory for Vendor specific information"
" element" ) );
return eSIR_MEM_ALLOC_FAILED;
}
// Assigning Action category code as unknown as this is debug marker frame
pPublicVendorSpecific->category = REMAIN_ON_CHANNEL_UNKNOWN_ACTION_CATEGORY;
pPublicVendorSpecific->elementid = VENDOR_SPECIFIC_ELEMENT_ID;
pPublicVendorSpecific->length = strlen(remainOnChannelMsg);
nPayload = sizeof(publicVendorSpecific) + pPublicVendorSpecific->length;
nBytes = nPayload + sizeof( tSirMacMgmtHdr );
halstatus = palPktAlloc( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT,
( tANI_U16 )nBytes, ( void** ) &pFrame,
( void** ) &pPacket );
if ( ! HAL_STATUS_SUCCESS ( halstatus ) )
{
limLog( pMac, LOGE, FL("Failed to allocate %d bytes for a Remain"
" on channel action frame."), nBytes );
nSirStatus = eSIR_MEM_ALLOC_FAILED;
goto end;
}
vos_mem_zero( pFrame, nBytes );
// Populate frame with MAC header
nSirStatus = limPopulateMacHeader( pMac, pFrame, SIR_MAC_MGMT_FRAME,
SIR_MAC_MGMT_ACTION, magicMacAddr,
pMac->lim.gSelfMacAddr);
if ( eSIR_SUCCESS != nSirStatus )
{
limLog( pMac, LOGE, FL("Failed to populate the buffer descriptor for a"
" Action frame for remain on channel.") );
palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT,
( void* ) pFrame, ( void* ) pPacket );
goto end;
}
// Copy Public Vendor specific fields to frame's information element
vos_mem_copy( (pFrame + (sizeof( tSirMacMgmtHdr ))),
pPublicVendorSpecific, sizeof(publicVendorSpecific) );
// Copy Remain On channel message to Vendor Specific information field
vos_mem_copy( (pFrame + (nBytes - pPublicVendorSpecific->length)),
remainOnChannelMsg, pPublicVendorSpecific->length );
halstatus = halTxFrame( pMac, pPacket,
( tANI_U16 ) sizeof(tSirMacMgmtHdr) + nPayload,
HAL_TXRX_FRM_802_11_MGMT,
ANI_TXDIR_TODS,
7,//SMAC_SWBD_TX_TID_MGMT_HIGH,
limTxComplete, pFrame, txFlag );
if ( ! HAL_STATUS_SUCCESS ( halstatus ) )
{
limLog( pMac, LOGE, FL("could not send marker frame for"
" remain on channel!" ));
//Pkt will be freed up by the callback
nSirStatus = eSIR_FAILURE;
goto end;
}
nSirStatus = eSIR_SUCCESS;
end:
vos_mem_free( pPublicVendorSpecific );
return nSirStatus;
}
示例4: BiQuad_clear
void BiQuad_clear(BiQuad *b)
{
b->inputs[0] = FL(0.0);
b->inputs[1] = FL(0.0);
b->lastOutput = FL(0.0);
}
示例5: dotablefilter
/* dotablefilter()
*
*
*
*
*/
static int32_t dotablefilter (CSOUND *csound, TABFILT *p)
{
int32 loopcount; /* Loop counter. Set by the length of the dest table.*/
int32 indx = 0; /* Index to be added to offsets */
int32 indx2 = 0; /*index into source table*/
MYFLT *based, *bases; /* Base addresses of the two tables.*/
int32 masks; /* Binary masks for the source table */
MYFLT *pdest, *ps;
MYFLT threshold;
int32 ftype;
MYFLT previous = FL(0.0);
//int32 sourcelength;
ftype = (int32) *p->ftype;
threshold = Digest (*p->threshold);
loopcount = p->funcd->flen;
//sourcelength = loopcount;
/* Now get the base addresses and length masks of the tables. */
based = p->funcd->ftable;
bases = p->funcs->ftable;
masks = p->funcs->lenmask;
do {
/* Create source pointers by ANDing index with mask, and adding to base
* address. This causes source addresses to wrap around if the
* destination table is longer.
* Destination address is simply the index plus the base address since
* we know we will be writing within the table. */
pdest = based + indx;
ps = bases + (masks & indx2);
switch (ftype) {
default:
case 0:
*pdest = *ps;
indx++; indx2++;
break;
case 1:
{ /* filter all above threshold */
int32_t p, q = 0;
float2frac (csound, *ps, &p, &q);
if (Digest (q) > threshold) {
indx2++;
} else {
*pdest = *ps;
indx++; indx2++;
}
break;
}
case 2:
{ /* filter all below threshold */
int32_t p, q = 0;
float2frac (csound, *ps, &p, &q);
if (Digest (q) < threshold) {
indx2++;
} else {
*pdest = *ps;
indx++; indx2++;
}
break;
}
case 3:
{ /* generate IOIs from source and write into destination */
if (*ps == FL(0.0)) { /* skip zeros in source table */
indx2++;
break;
}
*pdest = *ps - previous;
previous = *ps;
indx++; indx2++;
break;
}
}
} while (--loopcount);
*p->result = indx;
return OK;
}
示例6: make_DCBlock
void make_DCBlock(DCBlock* p)
{
p->outputs = FL(0.0);
p->inputs = FL(0.0);
}
示例7: ADSR_keyOn
void ADSR_keyOn(ADSR *a)
{
a->target = FL(1.0);
a->rate = a->attackRate;
a->state = ATTACK;
}
示例8: csrTdlsProcessSendMgmt
eHalStatus csrTdlsProcessSendMgmt( tpAniSirGlobal pMac, tSmeCmd *cmd )
{
tTdlsSendMgmtCmdInfo *tdlsSendMgmtCmdInfo = &cmd->u.tdlsCmd.u.tdlsSendMgmtCmdInfo ;
tSirTdlsSendMgmtReq *tdlsSendMgmtReq = NULL ;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, cmd->sessionId );
eHalStatus status = eHAL_STATUS_FAILURE;
if (NULL == pSession->pConnectBssDesc)
{
smsLog( pMac, LOGE, FL("BSS Description is not present") );
return eHAL_STATUS_FAILURE;
}
tdlsSendMgmtReq = vos_mem_malloc(
sizeof(tSirTdlsSendMgmtReq) + tdlsSendMgmtCmdInfo->len);
if ( NULL == tdlsSendMgmtReq )
status = eHAL_STATUS_FAILURE;
else
status = eHAL_STATUS_SUCCESS;
if (!HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL("alloc failed") );
VOS_ASSERT(0) ;
return status ;
}
tdlsSendMgmtReq->sessionId = cmd->sessionId;
//Using dialog as transactionId. This can be used to match response with request
tdlsSendMgmtReq->transactionId = tdlsSendMgmtCmdInfo->dialog;
tdlsSendMgmtReq->reqType = tdlsSendMgmtCmdInfo->frameType ;
tdlsSendMgmtReq->dialog = tdlsSendMgmtCmdInfo->dialog ;
tdlsSendMgmtReq->statusCode = tdlsSendMgmtCmdInfo->statusCode ;
tdlsSendMgmtReq->responder = tdlsSendMgmtCmdInfo->responder;
vos_mem_copy(tdlsSendMgmtReq->bssid,
pSession->pConnectBssDesc->bssId, sizeof (tSirMacAddr));
vos_mem_copy(tdlsSendMgmtReq->peerMac,
tdlsSendMgmtCmdInfo->peerMac, sizeof(tSirMacAddr)) ;
if(tdlsSendMgmtCmdInfo->len && tdlsSendMgmtCmdInfo->buf)
{
vos_mem_copy(tdlsSendMgmtReq->addIe, tdlsSendMgmtCmdInfo->buf,
tdlsSendMgmtCmdInfo->len);
}
// Send the request to PE.
smsLog( pMac, LOG1, "sending TDLS Mgmt Frame req to PE " );
status = tdlsSendMessage(pMac, eWNI_SME_TDLS_SEND_MGMT_REQ,
(void *)tdlsSendMgmtReq , sizeof(tSirTdlsSendMgmtReq)+tdlsSendMgmtCmdInfo->len) ;
if(!HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL("Failed to send request to MAC"));
}
if(tdlsSendMgmtCmdInfo->len && tdlsSendMgmtCmdInfo->buf)
{
//Done with the buf. Free it.
vos_mem_free( tdlsSendMgmtCmdInfo->buf );
tdlsSendMgmtCmdInfo->buf = NULL;
tdlsSendMgmtCmdInfo->len = 0;
}
return status;
}
示例9: csrTdlsProcessAddSta
eHalStatus csrTdlsProcessAddSta( tpAniSirGlobal pMac, tSmeCmd *cmd )
{
tTdlsAddStaCmdInfo *tdlsAddStaCmdInfo = &cmd->u.tdlsCmd.u.tdlsAddStaCmdInfo ;
tSirTdlsAddStaReq *tdlsAddStaReq = NULL ;
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, cmd->sessionId );
eHalStatus status = eHAL_STATUS_FAILURE;
if (NULL == pSession->pConnectBssDesc)
{
smsLog( pMac, LOGE, FL("BSS description is not present") );
return eHAL_STATUS_FAILURE;
}
tdlsAddStaReq = vos_mem_malloc(sizeof(tSirTdlsAddStaReq));
if ( NULL == tdlsAddStaReq )
status = eHAL_STATUS_FAILURE;
else
status = eHAL_STATUS_SUCCESS;
if (!HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL("alloc failed") );
VOS_ASSERT(0) ;
return status ;
}
tdlsAddStaReq->sessionId = cmd->sessionId;
tdlsAddStaReq->tdlsAddOper = tdlsAddStaCmdInfo->tdlsAddOper;
//Using dialog as transactionId. This can be used to match response with request
tdlsAddStaReq->transactionId = 0;
vos_mem_copy( tdlsAddStaReq->bssid,
pSession->pConnectBssDesc->bssId, sizeof (tSirMacAddr));
vos_mem_copy( tdlsAddStaReq->peerMac,
tdlsAddStaCmdInfo->peerMac, sizeof(tSirMacAddr)) ;
tdlsAddStaReq->capability = tdlsAddStaCmdInfo->capability;
tdlsAddStaReq->uapsd_queues = tdlsAddStaCmdInfo->uapsdQueues;
tdlsAddStaReq->max_sp = tdlsAddStaCmdInfo->maxSp;
vos_mem_copy( tdlsAddStaReq->extn_capability,
tdlsAddStaCmdInfo->extnCapability,
SIR_MAC_MAX_EXTN_CAP);
tdlsAddStaReq->htcap_present = tdlsAddStaCmdInfo->htcap_present;
vos_mem_copy( &tdlsAddStaReq->htCap,
&tdlsAddStaCmdInfo->HTCap, sizeof(tdlsAddStaCmdInfo->HTCap));
tdlsAddStaReq->vhtcap_present = tdlsAddStaCmdInfo->vhtcap_present;
vos_mem_copy( &tdlsAddStaReq->vhtCap,
&tdlsAddStaCmdInfo->VHTCap, sizeof(tdlsAddStaCmdInfo->VHTCap));
tdlsAddStaReq->supported_rates_length = tdlsAddStaCmdInfo->supportedRatesLen;
vos_mem_copy( &tdlsAddStaReq->supported_rates,
tdlsAddStaCmdInfo->supportedRates, tdlsAddStaCmdInfo->supportedRatesLen);
// Send the request to PE.
smsLog( pMac, LOGE, "sending TDLS Add Sta req to PE " );
status = tdlsSendMessage(pMac, eWNI_SME_TDLS_ADD_STA_REQ,
(void *)tdlsAddStaReq , sizeof(tSirTdlsAddStaReq)) ;
if(!HAL_STATUS_SUCCESS( status ) )
{
smsLog( pMac, LOGE, FL("Failed to send request to MAC"));
}
return status;
}
示例10: call_system_set
int32_t call_system_set(CSOUND *csound, SYSTEM *p)
{
IGN(csound);
p->prv_ktrig = FL(0.0);
return OK;
}
示例11: limIsAuthAlgoSupported
/**
* limIsAuthAlgoSupported()
*
*FUNCTION:
* This function is called in various places within LIM code
* to determine whether passed authentication algorithm is enabled
* or not
*
*LOGIC:
*
*ASSUMPTIONS:
* NA
*
*NOTE:
* NA
*
* @param authType Indicates MAC based authentication type
* (eSIR_OPEN_SYSTEM or eSIR_SHARED_KEY)
* If Shared Key authentication to be used,
* 'Privacy Option Implemented' flag is also
* checked.
*
* @return true if passed authType is enabled else false
*/
tANI_U8
limIsAuthAlgoSupported(tpAniSirGlobal pMac, tAniAuthType authType, tpPESession psessionEntry)
{
tANI_U32 algoEnable, privacyOptImp;
if (authType == eSIR_OPEN_SYSTEM)
{
if(psessionEntry->limSystemRole == eLIM_AP_ROLE)
{
if((psessionEntry->authType == eSIR_OPEN_SYSTEM) || (psessionEntry->authType == eSIR_AUTO_SWITCH))
return true;
else
return false;
}
if (wlan_cfgGetInt(pMac, WNI_CFG_OPEN_SYSTEM_AUTH_ENABLE,
&algoEnable) != eSIR_SUCCESS)
{
/**
* Could not get AuthAlgo1 Enable value
* from CFG. Log error.
*/
limLog(pMac, LOGE,
FL("could not retrieve AuthAlgo1 Enable value"));
return false;
}
else
return ( (algoEnable > 0 ? true : false) );
}
else
{
if(psessionEntry->limSystemRole == eLIM_AP_ROLE)
{
if((psessionEntry->authType == eSIR_SHARED_KEY) || (psessionEntry->authType == eSIR_AUTO_SWITCH))
algoEnable = true;
else
algoEnable = false;
}
else
if (wlan_cfgGetInt(pMac, WNI_CFG_SHARED_KEY_AUTH_ENABLE,
&algoEnable) != eSIR_SUCCESS)
{
/**
* Could not get AuthAlgo2 Enable value
* from CFG. Log error.
*/
limLog(pMac, LOGE,
FL("could not retrieve AuthAlgo2 Enable value"));
return false;
}
if(psessionEntry->limSystemRole == eLIM_AP_ROLE)
{
privacyOptImp = psessionEntry->privacy;
}
else
if (wlan_cfgGetInt(pMac, WNI_CFG_PRIVACY_ENABLED,
&privacyOptImp) != eSIR_SUCCESS)
{
/**
* Could not get PrivacyOptionImplemented value
* from CFG. Log error.
*/
limLog(pMac, LOGE,
FL("could not retrieve PrivacyOptImplemented value"));
return false;
}
return (algoEnable && privacyOptImp);
//.........这里部分代码省略.........
示例12: sme_FTUpdateKey
eHalStatus sme_FTUpdateKey(tHalHandle hHal, tANI_U32 sessionId,
tCsrRoamSetKey * pFTKeyInfo )
{
tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
eHalStatus status = eHAL_STATUS_FAILURE;
if (!pSession)
{
smsLog( pMac, LOGE, FL("pSession is NULL"));
return eHAL_STATUS_FAILURE;
}
if (pFTKeyInfo == NULL)
{
smsLog( pMac, LOGE, "%s: pFTKeyInfo is NULL", __func__);
return eHAL_STATUS_FAILURE;
}
status = sme_AcquireGlobalLock( &pMac->sme );
if (!( HAL_STATUS_SUCCESS( status )))
{
return eHAL_STATUS_FAILURE;
}
#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG
smsLog( pMac, LOG1, "sme_FTUpdateKey is received in state %d",
pSession->ftSmeContext.FTState);
#endif
// Global Station FT State
switch(pSession->ftSmeContext.FTState)
{
case eFT_SET_KEY_WAIT:
if (sme_GetFTPreAuthState(hHal, sessionId) == TRUE)
{
status = sme_FTSendUpdateKeyInd(pMac, sessionId, pFTKeyInfo);
if (status != 0 )
{
smsLog( pMac, LOGE, "%s: Key set failure %d", __func__,
status);
pSession->ftSmeContext.setFTPTKState = FALSE;
status = eHAL_STATUS_FT_PREAUTH_KEY_FAILED;
}
else
{
pSession->ftSmeContext.setFTPTKState = TRUE;
status = eHAL_STATUS_FT_PREAUTH_KEY_SUCCESS;
smsLog( pMac, LOG1, "%s: Key set success", __func__);
}
sme_SetFTPreAuthState(hHal, sessionId, FALSE);
}
pSession->ftSmeContext.FTState = eFT_START_READY;
#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
smsLog( pMac, LOG1, "%s: state changed to %d status %d", __func__,
pSession->ftSmeContext.FTState, status);
#endif
break;
default:
smsLog( pMac, LOGW, "%s: Unhandled state=%d", __func__,
pSession->ftSmeContext.FTState);
status = eHAL_STATUS_FAILURE;
break;
}
sme_ReleaseGlobalLock( &pMac->sme );
return status;
}
示例13: schAppendAddnIE
tSirRetStatus schAppendAddnIE(tpAniSirGlobal pMac, tpPESession psessionEntry,
tANI_U8 *pFrame, tANI_U32 maxBeaconSize,
tANI_U32 *nBytes)
{
tSirRetStatus status = eSIR_FAILURE;
tANI_U32 present, len;
tANI_U8 addIE[WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA_LEN];
if((status = wlan_cfgGetInt(pMac, WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG,
&present)) != eSIR_SUCCESS)
{
schLog(pMac, LOGP, FL("Unable to get WNI_CFG_PROBE_RSP_BCN_ADDNIE_FLAG"));
return status;
}
if(present)
{
if((status = wlan_cfgGetStrLen(pMac, WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA,
&len)) != eSIR_SUCCESS)
{
schLog(pMac, LOGP,
FL("Unable to get WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA length"));
return status;
}
if(len <= WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA_LEN && len &&
((len + *nBytes) <= maxBeaconSize))
{
if((status = wlan_cfgGetStr(pMac,
WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA, &addIE[0], &len))
== eSIR_SUCCESS)
{
tANI_U8* pP2pIe = limGetP2pIEPtr(pMac, &addIE[0], len);
if(pP2pIe != NULL)
{
tANI_U8 noaLen = 0;
tANI_U8 noaStream[SIR_MAX_NOA_ATTR_LEN + SIR_P2P_IE_HEADER_LEN];
noaLen = limGetNoaAttrStream(pMac, noaStream, psessionEntry);
if(noaLen)
{
if(noaLen + len <= WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA_LEN)
{
vos_mem_copy(&addIE[len], noaStream, noaLen);
len += noaLen;
pP2pIe[1] += noaLen;
}
else
{
schLog(pMac, LOGE,
FL("Not able to insert NoA because of length constraint"));
}
}
}
vos_mem_copy(pFrame, &addIE[0], len);
*nBytes = *nBytes + len;
}
}
}
return status;
}
示例14: gausstrig_process_arate
static int32_t gausstrig_process_arate(CSOUND* csound, GAUSSTRIG *p)
{
uint32_t offset = p->h.insdshead->ksmps_offset;
uint32_t early = p->h.insdshead->ksmps_no_end;
uint32_t n, nsmps = CS_KSMPS;
MYFLT *out = p->out;
MYFLT frq, dev;
p->frq0 = *p->kfrq;
frq = (p->frq0 > FL(0.001) ? p->frq0 : FL(0.001));
dev = *p->kdev;
if (UNLIKELY(offset)) memset(p->out, '\0', offset*sizeof(MYFLT));
if (UNLIKELY(early)) {
nsmps -= early;
memset(&p->out[nsmps], '\0', early*sizeof(MYFLT));
}
//memset(out, '\0', offset*sizeof(MYFLT));
if (p->first > FL(0.0)) {
/* values less than FL(0.0) could be used in later versions
as an offset in samples */
int32_t nextsamps;
MYFLT nextcount, dev, r1, r2;
//p->frq0 = *p->kfrq;
//frq = (p->frq0 > FL(0.001) ? p->frq0 : FL(0.001));
dev = *p->kdev;
nextsamps = (int32_t)(csound->GetSr(csound) / frq);
p->rand = csoundRand31(&p->rand);
r1 = (MYFLT)p->rand * dv2_31;
p->rand = csoundRand31(&p->rand);
r2 = (MYFLT)p->rand * dv2_31;
nextcount = SQRT(FL(-2.0) * LOG(r1)) * SIN(r2 * TWOPI_F);
if (nextcount < FL(-1.0)) {
MYFLT diff = FL(-1.0) - nextcount;
nextcount = (FL(1.0) < FL(-1.0) + diff ? FL(1.0) : FL(-1.0) + diff);
}
else if (nextcount > FL(1.0)) {
MYFLT diff = nextcount - FL(1.0);
nextcount = (FL(-1.0) > FL(1.0) - diff ? FL(-1.0) : FL(1.0) - diff);
}
p->count = (int32_t)(nextsamps + nextcount * dev * nextsamps);
p->first = 0; /* Only once called */
}
for (n=offset; n<nsmps; n++) {
if (p->count <= 0) {
int32_t nextsamps;
MYFLT nextcount, r1, r2;
nextsamps = (int32_t)(csound->GetSr(csound) / frq);
p->rand = csoundRand31(&p->rand);
r1 = (MYFLT)p->rand * dv2_31;
p->rand = csoundRand31(&p->rand);
r2 = (MYFLT)p->rand * dv2_31;
nextcount = SQRT(FL(-2.0) * LOG(r1)) * SIN(r2 * TWOPI_F);
if (nextcount < FL(-1.0)) {
MYFLT diff = FL(-1.0) - nextcount;
nextcount = (FL(1.0) < FL(-1.0) + diff ? FL(1.0) : FL(-1.0) + diff);
}
else if (nextcount > FL(1.0)) {
MYFLT diff = nextcount - FL(1.0);
nextcount = (FL(-1.0) > FL(1.0) - diff ? FL(-1.0) : FL(1.0) - diff);
}
p->count = (int32_t)(nextsamps + nextcount * dev * nextsamps);
out[n] = *p->kamp;
}
else {
if (p->mmode && *p->kfrq != p->frq0)
p->count = 0;
out[n] = FL(0.0);
}
p->count--;
}
return OK;
}
示例15: uMacPostCtrlMsg
tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb)
{
tSirMsgQ msg;
tpAniSirGlobal pMac = (tpAniSirGlobal)pSirGlobal;
tSirMbMsg* pMbLocal;
msg.type = pMb->type;
msg.bodyval = 0;
WDALOG3(wdaLog(pMac, LOG3, FL("msgType %d, msgLen %d\n" ),
pMb->type, pMb->msgLen));
// copy the message from host buffer to firmware buffer
// this will make sure that firmware allocates, uses and frees
// it's own buffers for mailbox message instead of working on
// host buffer
// second parameter, 'wait option', to palAllocateMemory is ignored on Windows
if( eHAL_STATUS_SUCCESS != palAllocateMemory( pMac->hHdd, (void **)&pMbLocal, pMb->msgLen))
{
WDALOGE( wdaLog(pMac, LOGE, FL("Buffer Allocation failed!\n")));
return eSIR_FAILURE;
}
palCopyMemory(pMac, (void *)pMbLocal, (void *)pMb, pMb->msgLen);
msg.bodyptr = pMbLocal;
switch (msg.type & HAL_MMH_MB_MSG_TYPE_MASK)
{
case WDA_MSG_TYPES_BEGIN: // Posts a message to the HAL MsgQ
wdaPostCtrlMsg(pMac, &msg);
break;
case SIR_LIM_MSG_TYPES_BEGIN: // Posts a message to the LIM MsgQ
limPostMsgApi(pMac, &msg);
break;
case SIR_CFG_MSG_TYPES_BEGIN: // Posts a message to the CFG MsgQ
wdaPostCfgMsg(pMac, &msg);
break;
case SIR_PMM_MSG_TYPES_BEGIN: // Posts a message to the PMM MsgQ
pmmPostMessage(pMac, &msg);
break;
case SIR_PTT_MSG_TYPES_BEGIN:
WDALOGW( wdaLog(pMac, LOGW, FL("%s:%d: message type = 0x%X"),
__func__, __LINE__, msg.type));
vos_mem_free(msg.bodyptr);
break;
default:
WDALOGW( wdaLog(pMac, LOGW, FL("Unknown message type = "
"0x%X\n"),
msg.type));
// Release the memory.
if (palFreeMemory( pMac->hHdd, (void*)(msg.bodyptr))
!= eHAL_STATUS_SUCCESS)
{
WDALOGE( wdaLog(pMac, LOGE, FL("Buffer Allocation failed!\n")));
return eSIR_FAILURE;
}
break;
}
return eSIR_SUCCESS;
} // uMacPostCtrlMsg()