• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ rtw_write8函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中rtw_write8函数的典型用法代码示例。如果您正苦于以下问题:C++ rtw_write8函数的具体用法?C++ rtw_write8怎么用?C++ rtw_write8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rtw_write8函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:abgoyal,项目名称:alcatel_ot_4020D_kernel,代码行数:60,代码来源:rtl8723b_sreset.c


示例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));
*/		
	}
}
开发者ID:WayWingsDev,项目名称:Gplus_2159_0801,代码行数:60,代码来源:rtl8192c_d_hal_init.c


示例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);
	}

}
开发者ID:WayWingsDev,项目名称:Gplus_2159_0801,代码行数:32,代码来源:rtl8192c_d_hal_init.c


示例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;
}
开发者ID:hi35xx,项目名称:rtl8188eu,代码行数:33,代码来源:rtl8188eu_led.c


示例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
}
开发者ID:dreamsxin,项目名称:BananaPi-Android-4.2.2-Liab,代码行数:30,代码来源:usb_halinit.c


示例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;
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:35,代码来源:rtl8188eu_led.c


示例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;
}
开发者ID:09sea98,项目名称:rtl8188eu,代码行数:34,代码来源:rtl8188eu_led.c


示例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;
}
开发者ID:dreamsxin,项目名称:BananaPi-Android-4.2.2-Liab,代码行数:29,代码来源:usb_halinit.c


示例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);
	}
}
开发者ID:develersrl,项目名称:winmate-kernel,代码行数:10,代码来源:hal_init.c


示例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);
}
开发者ID:simar7,项目名称:rtl8188eu,代码行数:53,代码来源:rtl8188e_sreset.c


示例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);
	}
}
开发者ID:Audioniek,项目名称:driver,代码行数:51,代码来源:rtl8192e_dm.c


示例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;
}
开发者ID:plathome,项目名称:debian_based_firmware,代码行数:52,代码来源:rtl8812ae_led.c


示例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);
}
开发者ID:avila-devlogic,项目名称:D33_KK_Kernel,代码行数:29,代码来源:rtw_mp.c


示例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);
}
开发者ID:STPJ,项目名称:linux-3.4-sunxi,代码行数:42,代码来源:sdio_ops.c


示例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);		
	}

}
开发者ID:kozmo2k4,项目名称:linux-amlogic,代码行数:30,代码来源:rtl8192d_cmd.c


示例16: SwLedOff_8821AE

/*
 *	Description:
 *		Turn off LED according to LedPin specified.
 *   */
VOID
SwLedOff_8821AE(
	IN	PADAPTER		Adapter,
	IN	PLED_PCIE		pLed
)
{
	u16	LedReg = REG_LEDCFG0;
	HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
	struct led_priv	*ledpriv = &(Adapter->ledpriv);

	if (RTW_CANNOT_RUN(Adapter))
		return;

	switch (pLed->LedPin) {
	case LED_PIN_LED0:
		if (ledpriv->LedStrategy == SW_LED_MODE10)
			LedReg = REG_LEDCFG0;
		else
			LedReg = REG_LEDCFG2;
		break;

	case LED_PIN_LED1:
		LedReg = REG_LEDCFG1;
		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(Adapter, LedReg);

		LedCfg &= 0xd0; /* Set to software control and disable LED2 */
		rtw_write8(Adapter, LedReg, (LedCfg | BIT3));

		/* Open-drain arrangement */
		LedCfg = rtw_read8(Adapter, REG_GPIO_EXT_CTRL + 2);
		LedCfg &= 0xFE;
		rtw_write8(Adapter, REG_GPIO_EXT_CTRL + 2, LedCfg);
	} else
		rtw_write8(Adapter, LedReg, 0x28);

	pLed->bLedOn = _FALSE;
}
开发者ID:plathome,项目名称:debian_based_firmware,代码行数:51,代码来源:rtl8812ae_led.c


示例17: 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);
	tmp1byte |= (HAL_8192EU_HW_GPIO_WPS_BIT);
	rtw_write8(padapter, GPIO_IO_SEL, tmp1byte);	//enable GPIO[7] as output mode

	tmp1byte &= ~(HAL_8192EU_HW_GPIO_WPS_BIT);
	rtw_write8(padapter,GPIO_IN, tmp1byte);		//reset the floating voltage level

	tmp1byte =  rtw_read8(padapter,  GPIO_IO_SEL);
	tmp1byte &= ~(HAL_8192EU_HW_GPIO_WPS_BIT);
	rtw_write8(padapter, GPIO_IO_SEL, tmp1byte);	//enable GPIO[7] as input mode

	tmp1byte = rtw_read8(padapter, GPIO_IN);
	//DBG_871X("CheckPbcGPIO - %x\n", tmp1byte);

	if (tmp1byte == 0xff)
	{		
		return ;
	}

	if (tmp1byte&HAL_8192EU_HW_GPIO_WPS_BIT)
	{
		// Here we only set bPbcPressed to TRUE
		// After trigger PBC, the variable will be set to FALSE
		bPbcPressed = _TRUE;
		//DBG_871X("CheckPbcGPIO - PBC is pressed\n");
			
	}   
#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);
	}
}
开发者ID:1fans,项目名称:rtl8192eu-linux-driver,代码行数:46,代码来源:rtl8192e_dm.c


示例18: _InitDriverInfoSize

static VOID
_InitDriverInfoSize(
	IN  PADAPTER	Adapter,
	IN	u8		drvInfoSize
	)
{
	rtw_write8(Adapter,REG_RX_DRVINFO_SZ, drvInfoSize);
}
开发者ID:dreamsxin,项目名称:BananaPi-Android-4.2.2-Liab,代码行数:8,代码来源:usb_halinit.c


示例19: SwLedOff_8188EU

//
//	Description:
//		Turn off LED according to LedPin specified.
//
static void
SwLedOff_8188EU(
	_adapter			*padapter, 
	PLED_USB		pLed
)
{
	u8	LedCfg;
	HAL_DATA_TYPE	*pHalData = GET_HAL_DATA(padapter);

	if(padapter->bSurpriseRemoved == _TRUE)
	{
		goto exit;
	}


	LedCfg = rtw_read8(padapter, REG_LEDCFG2);//0x4E

	switch(pLed->LedPin)
	{
		case LED_PIN_LED0:
			if(pHalData->bLedOpenDrain == _TRUE) // 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;
	
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:50,代码来源:rtl8188eu_led.c


示例20: writeOFDMPowerReg88E

static void writeOFDMPowerReg88E(
	IN		PADAPTER	Adapter,
	IN		u8		index,
	IN 		u32*		pValue
	)
{
	HAL_DATA_TYPE	*pHalData = GET_HAL_DATA(Adapter);
	u16 RegOffset_A[6] = {	rTxAGC_A_Rate18_06, rTxAGC_A_Rate54_24,
							rTxAGC_A_Mcs03_Mcs00, rTxAGC_A_Mcs07_Mcs04,
							rTxAGC_A_Mcs11_Mcs08, rTxAGC_A_Mcs15_Mcs12};
	u16 RegOffset_B[6] = {	rTxAGC_B_Rate18_06, rTxAGC_B_Rate54_24,
							rTxAGC_B_Mcs03_Mcs00, rTxAGC_B_Mcs07_Mcs04,
							rTxAGC_B_Mcs11_Mcs08, rTxAGC_B_Mcs15_Mcs12};
	u8 i, rf, pwr_val[4];
	u32 writeVal;
	u16 RegOffset;

	for(rf=0; rf<2; rf++)
	{
		writeVal = pValue[rf];
		for(i=0; i<4; i++)
		{
			pwr_val[i] = (u8)((writeVal & (0x7f<<(i*8)))>>(i*8));
			if (pwr_val[i]  > RF6052_MAX_TX_PWR)
				pwr_val[i]  = RF6052_MAX_TX_PWR;
		}
		writeVal = (pwr_val[3]<<24) | (pwr_val[2]<<16) |(pwr_val[1]<<8) |pwr_val[0];

		if(rf == 0)
			RegOffset = RegOffset_A[index];
		else
			RegOffset = RegOffset_B[index];

		PHY_SetBBReg(Adapter, RegOffset, bMaskDWord, writeVal);
		//RTPRINT(FPHY, PHY_TXPWR, ("Set 0x%x = %08x\n", RegOffset, writeVal));

		// 201005115 Joseph: Set Tx Power diff for Tx power training mechanism.
		if(((pHalData->rf_type == RF_2T2R) &&
				(RegOffset == rTxAGC_A_Mcs15_Mcs12 || RegOffset == rTxAGC_B_Mcs15_Mcs12))||
		     ((pHalData->rf_type != RF_2T2R) &&
				(RegOffset == rTxAGC_A_Mcs07_Mcs04 || RegOffset == rTxAGC_B_Mcs07_Mcs04))	)
		{
			writeVal = pwr_val[3];
			if(RegOffset == rTxAGC_A_Mcs15_Mcs12 || RegOffset == rTxAGC_A_Mcs07_Mcs04)
				RegOffset = 0xc90;
			if(RegOffset == rTxAGC_B_Mcs15_Mcs12 || RegOffset == rTxAGC_B_Mcs07_Mcs04)
				RegOffset = 0xc98;
			for(i=0; i<3; i++)
			{
				if(i!=2)
					writeVal = (writeVal>8)?(writeVal-8):0;
				else
					writeVal = (writeVal>6)?(writeVal-6):0;
				rtw_write8(Adapter, (u32)(RegOffset+i), (u8)writeVal);
			}
		}
	}
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:58,代码来源:rtl8188e_rf6052.c



注:本文中的rtw_write8函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rtw_zmalloc函数代码示例发布时间:2022-05-30
下一篇:
C++ rtw_read8函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap