本文整理汇总了C++中HALASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ HALASSERT函数的具体用法?C++ HALASSERT怎么用?C++ HALASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HALASSERT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ar5416GpioSet
/*
* Once configured for I/O - set output lines
*/
HAL_BOOL
ar5416GpioSet(struct ath_hal *ah, uint32_t gpio, uint32_t val)
{
uint32_t reg;
HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins);
HALDEBUG(ah, HAL_DEBUG_GPIO,
"%s: gpio=%d, val=%d\n", __func__, gpio, val);
reg = OS_REG_READ(ah, AR_GPIO_IN_OUT);
if (val & 1)
reg |= AR_GPIO_BIT(gpio);
else
reg &= ~AR_GPIO_BIT(gpio);
OS_REG_WRITE(ah, AR_GPIO_IN_OUT, reg);
return AH_TRUE;
}
开发者ID:coyizumi,项目名称:cs111,代码行数:20,代码来源:ar5416_gpio.c
示例2: ar5212SetupRxDesc
/*
* Initialize RX descriptor, by clearing the status and setting
* the size (and any other flags).
*/
HAL_BOOL
ar5212SetupRxDesc(struct ath_hal *ah, struct ath_desc *ds,
uint32_t size, u_int flags)
{
struct ar5212_desc *ads = AR5212DESC(ds);
HALASSERT((size &~ AR_BufLen) == 0);
ads->ds_ctl0 = 0;
ads->ds_ctl1 = size & AR_BufLen;
if (flags & HAL_RXDESC_INTREQ)
ads->ds_ctl1 |= AR_RxInterReq;
ads->ds_rxstatus0 = ads->ds_rxstatus1 = 0;
return AH_TRUE;
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:21,代码来源:ar5212_recv.c
示例3: ar5416SetupRxDesc
/*
* Initialize RX descriptor, by clearing the status and setting
* the size (and any other flags).
*/
HAL_BOOL
ar5416SetupRxDesc(struct ath_hal *ah, struct ath_desc *ds,
uint32_t size, u_int flags)
{
struct ar5416_desc *ads = AR5416DESC(ds);
HALASSERT((size &~ AR_BufLen) == 0);
ads->ds_ctl1 = size & AR_BufLen;
if (flags & HAL_RXDESC_INTREQ)
ads->ds_ctl1 |= AR_RxIntrReq;
/* this should be enough */
ads->ds_rxstatus8 &= ~AR_RxDone;
return AH_TRUE;
}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:21,代码来源:ar5416_recv.c
示例4: ar2425GetRfBank
/*
* Return a reference to the requested RF Bank.
*/
static u_int32_t *
ar2425GetRfBank(struct ath_hal *ah, int bank)
{
struct ath_hal_5212 *ahp = AH5212(ah);
AR5212_RF_BANKS_2425 *pRfBank2425 = ahp->ah_analogBanks;
HALASSERT(ahp->ah_analogBanks != AH_NULL);
switch (bank) {
case 1: return pRfBank2425->Bank1Data;
case 2: return pRfBank2425->Bank2Data;
case 3: return pRfBank2425->Bank3Data;
case 6: return pRfBank2425->Bank6Data;
case 7: return pRfBank2425->Bank7Data;
}
HDPRINTF(ah, HAL_DBG_RF_PARAM, "%s: unknown RF Bank %d requested\n", __func__, bank);
return AH_NULL;
}
开发者ID:jorneytu,项目名称:wlan,代码行数:20,代码来源:ar2425.c
示例5: ar5212AniCckErrTrigger
static void
ar5212AniCckErrTrigger(struct ath_hal *ah)
{
struct ath_hal_5212 *ahp = AH5212(ah);
HAL_CHANNEL_INTERNAL *chan = AH_PRIVATE(ah)->ah_curchan;
struct ar5212AniState *aniState;
WIRELESS_MODE mode;
int32_t rssi;
HALASSERT(chan != AH_NULL);
if (!DO_ANI(ah))
return;
/* first, raise noise immunity level, up to max */
aniState = ahp->ah_curani;
if (aniState->noiseImmunityLevel < HAL_NOISE_IMMUNE_MAX) {
ar5212AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL,
aniState->noiseImmunityLevel + 1);
return;
}
/* Do not play with OFDM and CCK weak detection in AP mode */
if( AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) {
return;
}
rssi = BEACON_RSSI(aniState);
if (rssi > aniState->rssiThrLow) {
/*
* Beacon signal in mid and high range, raise firsteplevel.
*/
if (aniState->firstepLevel < HAL_FIRST_STEP_MAX)
ar5212AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
aniState->firstepLevel + 1);
} else {
/*
* Beacon rssi is low, zero firstepLevel to maximize
* CCK sensitivity.
*/
mode = ath_hal_chan2wmode(ah, (HAL_CHANNEL *) chan);
if (mode == WIRELESS_MODE_11g || mode == WIRELESS_MODE_11b) {
if (aniState->firstepLevel > 0)
ar5212AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, 0);
}
}
}
开发者ID:jorneytu,项目名称:wlan,代码行数:45,代码来源:ar5212_ani.c
示例6: ar5416GpioCfgOutput
/*
* Configure GPIO Output lines
*/
HAL_BOOL
ar5416GpioCfgOutput(struct ath_hal *ah, uint32_t gpio)
{
uint32_t gpio_shift, reg;
HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins);
/* NB: type maps directly to hardware */
//cfgOutputMux(ah, gpio, type);
gpio_shift = gpio << 1; /* 2 bits per output mode */
reg = OS_REG_READ(ah, AR_GPIO_OE_OUT);
reg &= ~(AR_GPIO_OE_OUT_DRV << gpio_shift);
reg |= AR_GPIO_OE_OUT_DRV_ALL << gpio_shift;
OS_REG_WRITE(ah, AR_GPIO_OE_OUT, reg);
return AH_TRUE;
}
开发者ID:roccozhang,项目名称:wtp-simulator,代码行数:21,代码来源:ar5416_gpio.c
示例7: ar5416GpioCfgInput
/*
* Configure GPIO Input lines
*/
HAL_BOOL
ar5416GpioCfgInput(struct ath_hal *ah, u_int32_t gpio)
{
u_int32_t gpio_shift;
HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.hal_num_gpio_pins);
/* TODO: configure input mux for AR5416 */
/* If configured as input, set output to tristate */
gpio_shift = 2*gpio;
OS_REG_RMW(ah,
AR_GPIO_OE_OUT,
(AR_GPIO_OE_OUT_DRV_NO << gpio_shift),
(AR_GPIO_OE_OUT_DRV << gpio_shift));
return AH_TRUE;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:21,代码来源:ar5416_gpio.c
示例8: ar7010GpioCfgInput
/*
* Configure GPIO Input lines
*/
HAL_BOOL
ar7010GpioCfgInput(struct ath_hal *ah, u_int32_t gpio)
{
u_int32_t gpio_shift;
HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.hal_num_gpio_pins);
/* If configured as input, set output to tristate */
gpio_shift = gpio;
/* Per bit output enable. 1: enable the input driver */
OS_REG_RMW(ah,
AR7010_GPIO_OE,
(AR7010_GPIO_OE_AS_INPUT << gpio_shift),
(AR7010_GPIO_OE_MASK << gpio_shift));
return AH_TRUE;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:21,代码来源:ar5416_gpio.c
示例9: ar5416GpioCfgInput
/*
* Configure GPIO Input lines
*/
HAL_BOOL
ar5416GpioCfgInput(struct ath_hal *ah, uint32_t gpio)
{
uint32_t gpio_shift, reg;
HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins);
/* TODO: configure input mux for AR5416 */
/* If configured as input, set output to tristate */
gpio_shift = gpio << 1;
reg = OS_REG_READ(ah, AR_GPIO_OE_OUT);
reg &= ~(AR_GPIO_OE_OUT_DRV << gpio_shift);
reg |= AR_GPIO_OE_OUT_DRV_ALL << gpio_shift;
OS_REG_WRITE(ah, AR_GPIO_OE_OUT, reg);
return AH_TRUE;
}
开发者ID:roccozhang,项目名称:wtp-simulator,代码行数:21,代码来源:ar5416_gpio.c
示例10: ar5416FillTxDesc
HAL_BOOL
ar5416FillTxDesc(struct ath_hal *ah, void *ds, dma_addr_t *bufAddr,
u_int32_t *seg_len, u_int desc_id, u_int qcu, HAL_KEY_TYPE keyType, HAL_BOOL first_seg,
HAL_BOOL last_seg, const void *ds0)
{
struct ar5416_desc *ads = AR5416DESC(ds);
HALASSERT((seg_len[0] &~ AR_BufLen) == 0);
OS_MEMZERO(&(ads->u.tx.tx_status), sizeof(ads->u.tx.tx_status));
/* Set the buffer addresses */
ads->ds_data = bufAddr[0];
if (first_seg) {
/*
* First descriptor, don't clobber xmit control data
* setup by ar5416SetupTxDesc.
*/
ads->ds_ctl1 |= seg_len[0] | (last_seg ? 0 : AR_TxMore);
} else if (last_seg) { /* !first_seg && last_seg */
/*
* Last descriptor in a multi-descriptor frame,
* copy the multi-rate transmit parameters from
* the first frame for processing on completion.
*/
ads->ds_ctl0 = 0;
ads->ds_ctl1 = seg_len[0];
#ifdef AH_NEED_DESC_SWAP
ads->ds_ctl2 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl2);
ads->ds_ctl3 = __bswap32(AR5416DESC_CONST(ds0)->ds_ctl3);
#else
ads->ds_ctl2 = AR5416DESC_CONST(ds0)->ds_ctl2;
ads->ds_ctl3 = AR5416DESC_CONST(ds0)->ds_ctl3;
#endif
} else { /* !first_seg && !last_seg */
/*
* Intermediate descriptor in a multi-descriptor frame.
*/
ads->ds_ctl0 = 0;
ads->ds_ctl1 = seg_len[0] | AR_TxMore;
ads->ds_ctl2 = 0;
ads->ds_ctl3 = 0;
}
return AH_TRUE;
}
开发者ID:edwacode,项目名称:qca-hostap,代码行数:44,代码来源:ar5416_xmit_ds.c
示例11: ar5416CalcTxAirtime
/*
* Calculate air time of a transmit packet
*/
u_int32_t
ar5416CalcTxAirtime(struct ath_hal *ah, void *ds, struct ath_tx_status *ts,
HAL_BOOL comp_wastedt, u_int8_t nbad, u_int8_t nframes)
{
struct ar5416_desc *ads = AR5416DESC(ds);
int finalindex_tries;
int status9;
/*
* Number of attempts made on the final index
* Note: If no BA was recv, then the data_fail_cnt is the number of tries
* made on the final index. If BA was recv, then add 1 to account for the
* successful attempt.
*/
finalindex_tries = ts->ts_longretry + (ts->ts_flags & HAL_TX_BA)? 1 : 0;
/*
* Use a local copy of the ads in the cacheable memory to
* improve the d-cache efficiency.
*/
status9 = ads->ds_txstatus9;
status9 = MS(status9, AR_FinalTxIdx);
/*
* Calculate time of transmit on air for packet including retries
* at different rates.
*/
if (status9 == 0) {
return MS(ads->ds_ctl4, AR_PacketDur0) * finalindex_tries;
} else if (status9 == 1) {
return (MS(ads->ds_ctl4, AR_PacketDur1) * finalindex_tries) +
(MS(ads->ds_ctl2, AR_XmitDataTries0) * MS(ads->ds_ctl4, AR_PacketDur0));
} else if (status9 == 2) {
return (MS(ads->ds_ctl5, AR_PacketDur2) * finalindex_tries) +
(MS(ads->ds_ctl2, AR_XmitDataTries1) * MS(ads->ds_ctl4, AR_PacketDur1)) +
(MS(ads->ds_ctl2, AR_XmitDataTries0) * MS(ads->ds_ctl4, AR_PacketDur0));
} else if (status9 == 3) {
return (MS(ads->ds_ctl5, AR_PacketDur3) * finalindex_tries) +
(MS(ads->ds_ctl2, AR_XmitDataTries2) * MS(ads->ds_ctl5, AR_PacketDur2)) +
(MS(ads->ds_ctl2, AR_XmitDataTries1) * MS(ads->ds_ctl4, AR_PacketDur1)) +
(MS(ads->ds_ctl2, AR_XmitDataTries0) * MS(ads->ds_ctl4, AR_PacketDur0));
} else {
HALASSERT(0);
return 0;
}
}
开发者ID:edwacode,项目名称:qca-hostap,代码行数:47,代码来源:ar5416_xmit_ds.c
示例12: ar5416GpioCfgOutputLEDoff
/*
* Configure GPIO Output lines - LED Off
*/
HAL_BOOL
ar5416GpioCfgOutputLEDoff(struct ath_hal *ah, u_int32_t gpio, HAL_GPIO_OUTPUT_MUX_TYPE halSignalType)
{
#define N(a) (sizeof(a)/sizeof(a[0]))
u_int32_t ah_signal_type;
u_int32_t gpio_shift;
static const u_int32_t MuxSignalConversionTable[] = {
/* HAL_GPIO_OUTPUT_MUX_AS_OUTPUT */ AR_GPIO_OUTPUT_MUX_AS_OUTPUT,
/* HAL_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED */ AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED,
/* HAL_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED */ AR_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED,
/* HAL_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED */ AR_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED,
/* HAL_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED */ AR_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED,
/* HAL_GPIO_OUTPUT_MUX_AS_WLAN_ACTIVE */ AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL,
/* HAL_GPIO_OUTPUT_MUX_AS_TX_FRAME */ AR_GPIO_OUTPUT_MUX_AS_TX_FRAME,
};
HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.hal_num_gpio_pins);
// Convert HAL signal type definitions to hardware-specific values.
if ((halSignalType >= 0) && (halSignalType < N(MuxSignalConversionTable)))
{
ah_signal_type = MuxSignalConversionTable[halSignalType];
}
else
{
return AH_FALSE;
}
// Configure the MUX
ar5416GpioCfgOutputMux(ah, gpio, ah_signal_type);
// 2 bits per output mode
gpio_shift = 2*gpio;
OS_REG_RMW(ah,
AR_GPIO_OE_OUT,
(AR_GPIO_OE_OUT_DRV_NO << gpio_shift),
(AR_GPIO_OE_OUT_DRV << gpio_shift));
return AH_TRUE;
#undef N
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:46,代码来源:ar5416_gpio.c
示例13: GetLowerUpperIndex
/*
* Return indices surrounding the value in sorted integer lists.
*
* NB: the input list is assumed to be sorted in ascending order
*/
static void
GetLowerUpperIndex(int16_t v, const uint16_t *lp, uint16_t listSize,
uint32_t *vlo, uint32_t *vhi)
{
int16_t target = v;
const int16_t *ep = lp+listSize;
const int16_t *tp;
/*
* Check first and last elements for out-of-bounds conditions.
*/
if (target < lp[0]) {
*vlo = *vhi = 0;
return;
}
if (target >= ep[-1]) {
*vlo = *vhi = listSize - 1;
return;
}
/* look for value being near or between 2 values in list */
for (tp = lp; tp < ep; tp++) {
/*
* If value is close to the current value of the list
* then target is not between values, it is one of the values
*/
if (*tp == target) {
*vlo = *vhi = tp - (const int16_t *) lp;
return;
}
/*
* Look for value being between current value and next value
* if so return these 2 values
*/
if (target < tp[1]) {
*vlo = tp - (const int16_t *) lp;
*vhi = *vlo + 1;
return;
}
}
HALASSERT(AH_FALSE); /* should not reach here */
*vlo = *vhi = 0;
}
开发者ID:HWL-RobAt,项目名称:madwifi,代码行数:48,代码来源:ar2316.c
示例14: ar9300GpioCfgInput
/*
* Configure GPIO Input lines
*/
HAL_BOOL
ar9300GpioCfgInput(struct ath_hal *ah, u_int32_t gpio)
{
#ifndef AR9340_EMULATION
u_int32_t gpio_shift;
HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins);
/* TODO: configure input mux for AR9300 */
/* If configured as input, set output to tristate */
gpio_shift = 2*gpio;
OS_REG_RMW(ah,
AR_HOSTIF_REG(ah, AR_GPIO_OE_OUT),
(AR_GPIO_OE_OUT_DRV_NO << gpio_shift),
(AR_GPIO_OE_OUT_DRV << gpio_shift));
#endif
return AH_TRUE;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:23,代码来源:ar9300_gpio.c
示例15: ar5416SetupRxDesc
HAL_BOOL
ar5416SetupRxDesc(struct ath_hal *ah, struct ath_desc *ds,
u_int32_t size, u_int flags)
{
struct ar5416_desc *ads = AR5416DESC(ds);
HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps;
HALASSERT((size &~ AR_BufLen) == 0);
ads->ds_ctl1 = size & AR_BufLen;
if (flags & HAL_RXDESC_INTREQ)
ads->ds_ctl1 |= AR_RxIntrReq;
/* this should be enough */
ads->ds_rxstatus8 &= ~AR_RxDone;
if (! pCap->halAutoSleepSupport) {
/* If AutoSleep not supported, clear all fields. */
OS_MEMZERO(&(ads->u), sizeof(ads->u));
}
return AH_TRUE;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:21,代码来源:ar5416_recv_ds.c
示例16: ar5210GetTxDP
/*
* Get the TXDP for the "main" data queue. Needs to be extended
* for multiple Q functionality
*/
uint32_t
ar5210GetTxDP(struct ath_hal *ah, u_int q)
{
struct ath_hal_5210 *ahp = AH5210(ah);
HAL_TX_QUEUE_INFO *qi;
HALASSERT(q < HAL_NUM_TX_QUEUES);
qi = &ahp->ah_txq[q];
switch (qi->tqi_type) {
case HAL_TX_QUEUE_DATA:
return OS_REG_READ(ah, AR_TXDP0);
case HAL_TX_QUEUE_INACTIVE:
HALDEBUG(ah, HAL_DEBUG_ANY, "%s: inactive queue %u\n",
__func__, q);
/* fall thru... */
default:
break;
}
return 0xffffffff;
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:25,代码来源:ar5210_xmit.c
示例17: ar9300_beacon_set_beacon_timers
/*
* Initializes all of the hardware registers used to
* send beacons. Note that for station operation the
* driver calls ar9300_set_sta_beacon_timers instead.
*/
static void
ar9300_beacon_set_beacon_timers(struct ath_hal *ah,
const HAL_BEACON_TIMERS *bt)
{
uint32_t bperiod;
#if 0
HALASSERT(opmode == HAL_M_IBSS || opmode == HAL_M_HOSTAP);
if (opmode == HAL_M_IBSS) {
OS_REG_SET_BIT(ah, AR_TXCFG, AR_TXCFG_ADHOC_BEACON_ATIM_TX_POLICY);
}
#endif
/* XXX TODO: should migrate the HAL code to always use ONE_EIGHTH_TU */
OS_REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(bt->bt_nexttbtt));
OS_REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, ONE_EIGHTH_TU_TO_USEC(bt->bt_nextdba));
OS_REG_WRITE(ah, AR_NEXT_SWBA, ONE_EIGHTH_TU_TO_USEC(bt->bt_nextswba));
OS_REG_WRITE(ah, AR_NEXT_NDP_TIMER, TU_TO_USEC(bt->bt_nextatim));
bperiod = TU_TO_USEC(bt->bt_intval & HAL_BEACON_PERIOD);
/* XXX TODO! */
// ahp->ah_beaconInterval = bt->bt_intval & HAL_BEACON_PERIOD;
OS_REG_WRITE(ah, AR_BEACON_PERIOD, bperiod);
OS_REG_WRITE(ah, AR_DMA_BEACON_PERIOD, bperiod);
OS_REG_WRITE(ah, AR_SWBA_PERIOD, bperiod);
OS_REG_WRITE(ah, AR_NDP_PERIOD, bperiod);
/*
* Reset TSF if required.
*/
if (bt->bt_intval & HAL_BEACON_RESET_TSF)
ar9300_reset_tsf(ah);
/* enable timers */
/* NB: flags == 0 handled specially for backwards compatibility */
OS_REG_SET_BIT(ah, AR_TIMER_MODE,
bt->bt_flags != 0 ? bt->bt_flags :
AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN);
}
开发者ID:ngkaho1234,项目名称:freebsd,代码行数:44,代码来源:ar9300_freebsd.c
示例18: updateMIBStats
/*
* Update ani stats in preparation for listen time processing.
*/
static void
updateMIBStats(struct ath_hal *ah, struct ar5212AniState *aniState)
{
struct ath_hal_5212 *ahp = AH5212(ah);
const struct ar5212AniParams *params = aniState->params;
uint32_t phyCnt1, phyCnt2;
int32_t ofdmPhyErrCnt, cckPhyErrCnt;
HALASSERT(ahp->ah_hasHwPhyCounters);
/* Clear the mib counters and save them in the stats */
ar5212UpdateMibCounters(ah, &ahp->ah_mibStats);
/* NB: these are not reset-on-read */
phyCnt1 = OS_REG_READ(ah, AR_PHYCNT1);
phyCnt2 = OS_REG_READ(ah, AR_PHYCNT2);
/* NB: these are spec'd to never roll-over */
ofdmPhyErrCnt = phyCnt1 - params->ofdmPhyErrBase;
if (ofdmPhyErrCnt < 0) {
HALDEBUG(ah, HAL_DEBUG_ANI, "OFDM phyErrCnt %d phyCnt1 0x%x\n",
ofdmPhyErrCnt, phyCnt1);
ofdmPhyErrCnt = AR_PHY_COUNTMAX;
}
ahp->ah_stats.ast_ani_ofdmerrs +=
ofdmPhyErrCnt - aniState->ofdmPhyErrCount;
aniState->ofdmPhyErrCount = ofdmPhyErrCnt;
cckPhyErrCnt = phyCnt2 - params->cckPhyErrBase;
if (cckPhyErrCnt < 0) {
HALDEBUG(ah, HAL_DEBUG_ANI, "CCK phyErrCnt %d phyCnt2 0x%x\n",
cckPhyErrCnt, phyCnt2);
cckPhyErrCnt = AR_PHY_COUNTMAX;
}
ahp->ah_stats.ast_ani_cckerrs +=
cckPhyErrCnt - aniState->cckPhyErrCount;
aniState->cckPhyErrCount = cckPhyErrCnt;
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:41,代码来源:ar5212_ani.c
示例19: ar5210SetTxDP
/*
* Set the TxDP for the "main" data queue.
*/
HAL_BOOL
ar5210SetTxDP(struct ath_hal *ah, u_int q, uint32_t txdp)
{
struct ath_hal_5210 *ahp = AH5210(ah);
HAL_TX_QUEUE_INFO *qi;
HALASSERT(q < HAL_NUM_TX_QUEUES);
HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: queue %u 0x%x\n",
__func__, q, txdp);
qi = &ahp->ah_txq[q];
switch (qi->tqi_type) {
case HAL_TX_QUEUE_DATA:
#ifdef AH_DEBUG
/*
* Make sure that TXE is deasserted before setting the
* TXDP. If TXE is still asserted, setting TXDP will
* have no effect.
*/
if (OS_REG_READ(ah, AR_CR) & AR_CR_TXE0)
ath_hal_printf(ah, "%s: TXE asserted; AR_CR=0x%x\n",
__func__, OS_REG_READ(ah, AR_CR));
#endif
OS_REG_WRITE(ah, AR_TXDP0, txdp);
break;
case HAL_TX_QUEUE_BEACON:
case HAL_TX_QUEUE_CAB:
OS_REG_WRITE(ah, AR_TXDP1, txdp);
break;
case HAL_TX_QUEUE_INACTIVE:
HALDEBUG(ah, HAL_DEBUG_TXQUEUE, "%s: inactive queue %u\n",
__func__, q);
/* fall thru... */
default:
return AH_FALSE;
}
return AH_TRUE;
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:41,代码来源:ar5210_xmit.c
示例20: ar5416GpioSetIntr
/*
* Set the GPIO Interrupt
*/
void
ar5416GpioSetIntr(struct ath_hal *ah, u_int gpio, uint32_t ilevel)
{
uint32_t val;
HALASSERT(gpio < AR_NUM_GPIO);
/* XXX bounds check gpio */
val = MS(OS_REG_READ(ah, AR_GPIO_INTR_OUT), AR_GPIO_INTR_CTRL);
if (ilevel) /* 0 == interrupt on pin high */
val &= ~AR_GPIO_BIT(gpio);
else /* 1 == interrupt on pin low */
val |= AR_GPIO_BIT(gpio);
OS_REG_RMW_FIELD(ah, AR_GPIO_INTR_OUT, AR_GPIO_INTR_CTRL, val);
/* Change the interrupt mask. */
val = MS(OS_REG_READ(ah, AR_INTR_ASYNC_ENABLE), AR_INTR_GPIO);
val |= AR_GPIO_BIT(gpio);
OS_REG_RMW_FIELD(ah, AR_INTR_ASYNC_ENABLE, AR_INTR_GPIO, val);
val = MS(OS_REG_READ(ah, AR_INTR_ASYNC_MASK), AR_INTR_GPIO);
val |= AR_GPIO_BIT(gpio);
OS_REG_RMW_FIELD(ah, AR_INTR_ASYNC_MASK, AR_INTR_GPIO, val);
}
开发者ID:se7oluti0n,项目名称:madwifi,代码行数:26,代码来源:ar5416_gpio.c
注:本文中的HALASSERT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论