本文整理汇总了C++中rtw_write8函数的典型用法代码示例。如果您正苦于以下问题:C++ rtw_write8函数的具体用法?C++ rtw_write8怎么用?C++ rtw_write8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rtw_write8函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _restore_network_status
static void _restore_network_status(_adapter *padapter)
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network));
unsigned short caps;
u8 join_type;
#if 1
//=======================================================
// reset related register of Beacon control
//set MSR to nolink
Set_MSR(padapter, _HW_STATE_NOLINK_);
// reject all data frame
rtw_write16(padapter, REG_RXFLTMAP2,0x00);
//reset TSF
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0)|BIT(1)));
// disable update TSF
SetBcnCtrlReg(padapter, BIT(4), 0);
//=======================================================
rtw_joinbss_reset(padapter);
set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
//pmlmeinfo->assoc_AP_vendor = maxAP;
if (padapter->registrypriv.wifi_spec) {
// for WiFi test, follow WMM test plan spec
rtw_write32(padapter, REG_EDCA_VO_PARAM, 0x002F431C);
rtw_write32(padapter, REG_EDCA_VI_PARAM, 0x005E541C);
rtw_write32(padapter, REG_EDCA_BE_PARAM, 0x0000A525);
rtw_write32(padapter, REG_EDCA_BK_PARAM, 0x0000A549);
// for WiFi test, mixed mode with intel STA under bg mode throughput issue
if (padapter->mlmepriv.htpriv.ht_option == 0)
rtw_write32(padapter, REG_EDCA_BE_PARAM, 0x00004320);
} else {
rtw_write32(padapter, REG_EDCA_VO_PARAM, 0x002F3217);
rtw_write32(padapter, REG_EDCA_VI_PARAM, 0x005E4317);
rtw_write32(padapter, REG_EDCA_BE_PARAM, 0x00105320);
rtw_write32(padapter, REG_EDCA_BK_PARAM, 0x0000A444);
}
//disable dynamic functions, such as high power, DIG
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
#endif
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
join_type = 0;
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
Set_MSR(padapter, (pmlmeinfo->state & 0x3));
mlmeext_joinbss_event_callback(padapter, 1);
//restore Sequence No.
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
}
示例2: _FirmwareSelfReset
static void _FirmwareSelfReset(PADAPTER Adapter)
{
u8 u1bTmp;
u8 Delay = 100;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
if((pHalData->FirmwareVersion > 0x21) ||
(pHalData->FirmwareVersion == 0x21 &&
pHalData->FirmwareSubVersion >= 0x01))
{
/*
printk("==> %s REG 02(0x%04x),80(0x%08x),130(0x%08x),134(0x%08x),138(0x%08x),13c(0x%08x),\
1c0(0x%08x),1c4(0x%08x),1c8(0x%08x),1cc(0x%08x),\n",
__FUNCTION__,rtw_read16(Adapter,0x02),rtw_read32(Adapter,0x80),
rtw_read32(Adapter,0x130),
rtw_read32(Adapter,0x134),
rtw_read32(Adapter,0x138),
rtw_read32(Adapter,0x13c),
rtw_read32(Adapter,0x1c0),
rtw_read32(Adapter,0x1c4),
rtw_read32(Adapter,0x1c8),
rtw_read32(Adapter,0x1cc));
*/
//0x1cf=0x20. Inform 8051 to reset. 2009.12.25. tynli_test
rtw_write8(Adapter, REG_HMETFR+3, 0x20);
u1bTmp = rtw_read8(Adapter, REG_SYS_FUNC_EN+1);
while(u1bTmp&BIT2)
{
Delay--;
//RT_TRACE(COMP_INIT, DBG_LOUD, ("PowerOffAdapter8192CE(): polling 0x03[2] Delay = %d \n", Delay));
if(Delay == 0)
break;
//delay_us(50);
rtw_udelay_os(50);
u1bTmp = rtw_read8(Adapter, REG_SYS_FUNC_EN+1);
}
if((u1bTmp&BIT2) && (Delay == 0))
{
DBG_8192C("FirmwareDownload92C():fw reset by itself Fail!!!!!! 0x03 = %x\n", u1bTmp);
//RT_ASSERT(FALSE, ("PowerOffAdapter8192CE(): 0x03 = %x\n", u1bTmp));
rtw_write8(Adapter,REG_SYS_FUNC_EN+1,(rtw_read8(Adapter, REG_SYS_FUNC_EN+1)&~BIT2));
}
/*
printk("==> %s REG 02(0x%04x),80(0x%08x),130(0x%08x),134(0x%08x),138(0x%08x),13c(0x%08x),\
1c0(0x%08x),1c4(0x%08x),1c8(0x%08x),1cc(0x%08x),\n",
__FUNCTION__,rtw_read16(Adapter,0x02),rtw_read32(Adapter,0x80),
rtw_read32(Adapter,0x130),
rtw_read32(Adapter,0x134),
rtw_read32(Adapter,0x138),
rtw_read32(Adapter,0x13c),
rtw_read32(Adapter,0x1c0),
rtw_read32(Adapter,0x1c4),
rtw_read32(Adapter,0x1c8),
rtw_read32(Adapter,0x1cc));
*/
}
}
示例3: _FWDownloadEnable
static VOID
_FWDownloadEnable(
IN PADAPTER Adapter,
IN BOOLEAN enable
)
{
u8 tmp;
if(enable)
{
// 8051 with wrapper enable
tmp = rtw_read8(Adapter, REG_SYS_FUNC_EN+1);
rtw_write8(Adapter, REG_SYS_FUNC_EN+1, tmp|0x04);
// MCU firmware download enable.
tmp = rtw_read8(Adapter, REG_MCUFWDL);
rtw_write8(Adapter, REG_MCUFWDL, tmp|0x01);
// 8051 enable
tmp = rtw_read8(Adapter, REG_MCUFWDL+2);
rtw_write8(Adapter, REG_MCUFWDL+2, tmp&0xf7);
}
else
{
// MCU firmware download enable.
tmp = rtw_read8(Adapter, REG_MCUFWDL);
rtw_write8(Adapter, REG_MCUFWDL, tmp&0xfe);
// Reserved for fw extension.
rtw_write8(Adapter, REG_MCUFWDL+1, 0x00);
}
}
示例4: SwLedOn_8188EU
//
// Description:
// Turn on LED according to LedPin specified.
//
static void
SwLedOn_8188EU(
_adapter *padapter,
PLED_USB pLed
)
{
u8 LedCfg;
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
if (RTW_CANNOT_RUN(padapter))
return;
LedCfg = rtw_read8(padapter, REG_LEDCFG2);
switch(pLed->LedPin)
{
case LED_PIN_LED0:
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0xf0)|BIT5|BIT6); // SW control led0 on.
break;
case LED_PIN_LED1:
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0x0f)|BIT5); // SW control led1 on.
break;
default:
break;
}
pLed->bLedOn = _TRUE;
}
示例5: _InitTxBufferBoundary
static VOID
_InitTxBufferBoundary(
IN PADAPTER Adapter
)
{
struct registry_priv *pregistrypriv = &Adapter->registrypriv;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
u8 txpktbuf_bndy;
if(!pregistrypriv->wifi_spec){
txpktbuf_bndy = TX_PAGE_BOUNDARY;
}
else{//for WMM
txpktbuf_bndy = WMM_NORMAL_TX_PAGE_BOUNDARY;
}
rtw_write8(Adapter, REG_TXPKTBUF_BCNQ_BDNY, txpktbuf_bndy);
rtw_write8(Adapter, REG_TXPKTBUF_MGQ_BDNY, txpktbuf_bndy);
rtw_write8(Adapter, REG_TXPKTBUF_WMAC_LBK_BF_HD, txpktbuf_bndy);
rtw_write8(Adapter, REG_TRXFF_BNDY, txpktbuf_bndy);
#if 1
rtw_write8(Adapter, REG_TDECTRL+1, txpktbuf_bndy);
#else
txdmactrl = PlatformIORead2Byte(Adapter, REG_TDECTRL);
txdmactrl &= ~BCN_HEAD_MASK;
txdmactrl |= BCN_HEAD(txpktbuf_bndy);
PlatformIOWrite2Byte(Adapter, REG_TDECTRL, txdmactrl);
#endif
}
示例6: SwLedOn_8188EU
//
// Description:
// Turn on LED according to LedPin specified.
//
static void
SwLedOn_8188EU(
_adapter *padapter,
PLED_USB pLed
)
{
u8 LedCfg;
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
if( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
{
return;
}
LedCfg = rtw_read8(padapter, REG_LEDCFG2);
switch(pLed->LedPin)
{
case LED_PIN_LED0:
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0xf0)|BIT5|BIT6); // SW control led0 on.
break;
case LED_PIN_LED1:
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0x0f)|BIT5); // SW control led1 on.
break;
default:
break;
}
pLed->bLedOn = _TRUE;
}
示例7: SwLedOff
/* Turn off LED according to LedPin specified. */
void SwLedOff(struct adapter *padapter, struct LED_871x *pLed)
{
u8 LedCfg;
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
goto exit;
LedCfg = rtw_read8(padapter, REG_LEDCFG2);/* 0x4E */
switch (pLed->LedPin) {
case LED_PIN_LED0:
if (pHalData->bLedOpenDrain) {
/* Open-drain arrangement for controlling the LED) */
LedCfg &= 0x90; /* Set to software control. */
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));
LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG);
LedCfg &= 0xFE;
rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
} else {
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT5|BIT6));
}
break;
case LED_PIN_LED1:
LedCfg &= 0x0f; /* Set to software control. */
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));
break;
default:
break;
}
exit:
pLed->bLedOn = false;
}
示例8: _InitPowerOn
static u8 _InitPowerOn(PADAPTER padapter)
{
u8 status = _SUCCESS;
u16 value16=0;
u8 value8 = 0;
// RSV_CTRL 0x1C[7:0] = 0x00 // unlock ISO/CLK/Power control register
rtw_write8(padapter, REG_RSV_CTRL, 0x0);
// HW Power on sequence
if(!HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, rtl8723A_card_enable_flow ))
return _FAIL;
// 0x04[19] = 1, suggest by Jackie 2011.05.09, reset 8051
value8 = rtw_read8(padapter, REG_APS_FSMCO+2);
rtw_write8(padapter,REG_APS_FSMCO+2,(value8|BIT3));
// Enable MAC DMA/WMAC/SCHEDULE/SEC block
// Set CR bit10 to enable 32k calibration. Suggested by SD1 Gimmy. Added by tynli. 2011.08.31.
value16 = rtw_read16(padapter, REG_CR);
value16 |= (HCI_TXDMA_EN | HCI_RXDMA_EN | TXDMA_EN | RXDMA_EN
| PROTOCOL_EN | SCHEDULE_EN | MACTXEN | MACRXEN | ENSEC | CALTMR_EN);
rtw_write16(padapter, REG_CR, value16);
//for Efuse PG, suggest by Jackie 2011.11.23
PHY_SetBBReg(padapter, REG_EFUSE_CTRL, BIT28|BIT29|BIT30, 0x06);
return status;
}
示例9: rtw_hal_notch_filter
void rtw_hal_notch_filter(_adapter * adapter, bool enable)
{
if (enable) {
DBG_871X("Enable notch filter\n");
rtw_write8(adapter, 0xc41, rtw_read8(adapter, 0xc41) | 0x02);
} else {
DBG_871X("Disable notch filter\n");
rtw_write8(adapter, 0xc41, rtw_read8(adapter, 0xc41) & ~0x02);
}
}
示例10: _restore_network_status
static void _restore_network_status(struct adapter *padapter)
{
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex*)(&(pmlmeinfo->network));
unsigned short caps;
u8 join_type;
/* */
/* reset related register of Beacon control */
/* set MSR to nolink */
Set_MSR(padapter, _HW_STATE_NOLINK_);
/* reject all data frame */
rtw_write16(padapter, REG_RXFLTMAP2,0x00);
/* reset TSF */
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0)|BIT(1)));
/* disable update TSF */
SetBcnCtrlReg(padapter, BIT(4), 0);
/* */
rtw_joinbss_reset(padapter);
set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
if (padapter->registrypriv.wifi_spec) {
/* for WiFi test, follow WMM test plan spec */
rtw_write32(padapter, REG_EDCA_VO_PARAM, 0x002F431C);
rtw_write32(padapter, REG_EDCA_VI_PARAM, 0x005E541C);
rtw_write32(padapter, REG_EDCA_BE_PARAM, 0x0000A525);
rtw_write32(padapter, REG_EDCA_BK_PARAM, 0x0000A549);
/* for WiFi test, mixed mode with intel STA under bg mode throughput issue */
if (padapter->mlmepriv.htpriv.ht_option == 0)
rtw_write32(padapter, REG_EDCA_BE_PARAM, 0x00004320);
} else {
rtw_write32(padapter, REG_EDCA_VO_PARAM, 0x002F3217);
rtw_write32(padapter, REG_EDCA_VI_PARAM, 0x005E4317);
rtw_write32(padapter, REG_EDCA_BE_PARAM, 0x00105320);
rtw_write32(padapter, REG_EDCA_BK_PARAM, 0x0000A444);
}
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
join_type = 0;
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
Set_MSR(padapter, (pmlmeinfo->state & 0x3));
mlmeext_joinbss_event_callback(padapter, 1);
/* restore Sequence No. */
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
}
示例11: dm_CheckPbcGPIO
static void dm_CheckPbcGPIO(_adapter *padapter)
{
u8 tmp1byte;
u8 bPbcPressed = _FALSE;
if(!padapter->registrypriv.hw_wps_pbc)
return;
#ifdef CONFIG_USB_HCI
tmp1byte = rtw_read8(padapter, GPIO_IO_SEL_8811A);
tmp1byte |= (BIT4);
rtw_write8(padapter, GPIO_IO_SEL_8811A, tmp1byte); //enable GPIO[2] as output mode
tmp1byte &= ~(BIT4);
rtw_write8(padapter, GPIO_IN_8811A, tmp1byte); //reset the floating voltage level
tmp1byte = rtw_read8(padapter, GPIO_IO_SEL_8811A);
tmp1byte &= ~(BIT4);
rtw_write8(padapter, GPIO_IO_SEL_8811A, tmp1byte); //enable GPIO[2] as input mode
tmp1byte =rtw_read8(padapter, GPIO_IN_8811A);
if (tmp1byte == 0xff)
return ;
if (tmp1byte&HAL_8192C_HW_GPIO_WPS_BIT)
{
bPbcPressed = _TRUE;
}
#else
tmp1byte = rtw_read8(padapter, GPIO_IN_8811A);
//RT_TRACE(COMP_IO, DBG_TRACE, ("dm_CheckPbcGPIO - %x\n", tmp1byte));
if (tmp1byte == 0xff || padapter->init_adpt_in_progress)
return ;
if((tmp1byte&BIT4)==0)
{
bPbcPressed = _TRUE;
}
#endif
if( _TRUE == bPbcPressed)
{
// Here we only set bPbcPressed to true
// After trigger PBC, the variable will be set to false
DBG_8192C("CheckPbcGPIO - PBC is pressed\n");
rtw_request_wps_pbc_event(padapter);
}
}
示例12: SwLedOff_8812AE
/*
* Description:
* Turn off LED according to LedPin specified.
* */
static void
SwLedOff_8812AE(
_adapter *padapter,
PLED_PCIE pLed
)
{
u16 LedReg = REG_LEDCFG0;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
struct led_priv *ledpriv = &(padapter->ledpriv);
if (RTW_CANNOT_RUN(padapter))
return;
switch (pLed->LedPin) {
case LED_PIN_LED0:
if (ledpriv->LedStrategy == SW_LED_MODE10)
LedReg = REG_LEDCFG0;
else
LedReg = REG_LEDCFG1;
break;
case LED_PIN_LED1:
LedReg = REG_LEDCFG2;
break;
case LED_PIN_GPIO0:
default:
break;
}
/* RTW_INFO("In SwLedOff,LedAddr:%X LEDPIN=%d\n", LedReg, pLed->LedPin); */
if (pHalData->bLedOpenDrain == _TRUE) { /* Open-drain arrangement for controlling the LED */
u8 LedCfg = rtw_read8(padapter, LedReg);
LedCfg &= 0xd0; /* Set to software control. */
rtw_write8(padapter, LedReg, (LedCfg | BIT3));
/* Open-drain arrangement */
LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG);
LedCfg &= 0xFE;/* Set GPIO[8] to input mode */
rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
} else
rtw_write8(padapter, LedReg, 0x28);
pLed->bLedOn = _FALSE;
}
示例13: disable_dm
static void disable_dm(PADAPTER padapter)
{
#ifndef CONFIG_RTL8723A
u8 v8;
#endif
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
struct dm_priv *pdmpriv = &pHalData->dmpriv;
//3 1. disable firmware dynamic mechanism
// disable Power Training, Rate Adaptive
#ifdef CONFIG_RTL8723A
SetBcnCtrlReg(padapter, 0, EN_BCN_FUNCTION);
#else
v8 = rtw_read8(padapter, REG_BCN_CTRL);
v8 &= ~EN_BCN_FUNCTION;
rtw_write8(padapter, REG_BCN_CTRL, v8);
#endif
//3 2. disable driver dynamic mechanism
// disable Dynamic Initial Gain
// disable High Power
// disable Power Tracking
Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
// enable APK, LCK and IQK but disable power tracking
pdmpriv->TxPowerTrackControl = _FALSE;
Switch_DM_Func(padapter, DYNAMIC_FUNC_SS, _TRUE);
}
示例14: EnableInterrupt8723BSdio
//
// Description:
// Enalbe SDIO Host Interrupt Mask configuration on SDIO local domain.
//
// Assumption:
// 1. Using SDIO Local register ONLY for configuration.
// 2. PASSIVE LEVEL
//
// Created by Roger, 2011.02.11.
//
void EnableInterrupt8723BSdio(PADAPTER padapter)
{
PHAL_DATA_TYPE pHalData;
u32 himr;
#ifdef CONFIG_CONCURRENT_MODE
if ((padapter->isprimary == _FALSE) && padapter->pbuddy_adapter){
padapter = padapter->pbuddy_adapter;
}
#endif
pHalData = GET_HAL_DATA(padapter);
himr = cpu_to_le32(pHalData->sdio_himr);
sdio_local_write(padapter, SDIO_REG_HIMR, 4, (u8*)&himr);
RT_TRACE(_module_hci_ops_c_, _drv_notice_,
("%s: enable SDIO HIMR=0x%08X\n", __FUNCTION__, pHalData->sdio_himr));
// Update current system IMR settings
himr = rtw_read32(padapter, REG_HSIMR);
rtw_write32(padapter, REG_HSIMR, himr|pHalData->SysIntrMask);
RT_TRACE(_module_hci_ops_c_, _drv_notice_,
("%s: enable HSIMR=0x%08X\n", __FUNCTION__, pHalData->SysIntrMask));
//
// <Roger_Notes> There are some C2H CMDs have been sent before system interrupt is enabled, e.g., C2H, CPWM.
// So we need to clear all C2H events that FW has notified, otherwise FW won't schedule any commands anymore.
// 2011.10.19.
//
rtw_write8(padapter, REG_C2HEVT_CLEAR, C2H_EVT_HOST_CLOSE);
}
示例15: rtl8192d_Add_RateATid
//bitmap[0:27] = tx_rate_bitmap
//bitmap[28:31]= Rate Adaptive id
//arg[0:4] = macid
//arg[5] = Short GI
void rtl8192d_Add_RateATid(PADAPTER pAdapter, u32 bitmap, u8 arg)
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
if(pHalData->fw_ractrl == _TRUE)
{
rtl8192d_set_raid_cmd(pAdapter, bitmap, arg);
}
else
{
u8 macid, init_rate, shortGIrate=_FALSE;
init_rate = get_highest_rate_idx(bitmap&0x0fffffff)&0x3f;
macid = arg&0x1f;
shortGIrate = (arg&BIT(5)) ? _TRUE:_FALSE;
if (shortGIrate==_TRUE)
init_rate |= BIT(6);
rtw_write8(pAdapter, (REG_INIDATA_RATE_SEL+macid), (u8)init_rate);
}
}