예제 #1
0
u2Byte
ODM_Read2Byte(
	IN 	PDM_ODM_T		pDM_Odm,
	IN	u4Byte			RegAddr
	)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
	prtl8192cd_priv	priv	= pDM_Odm->priv;
	return	RTL_R16(RegAddr);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
	PADAPTER		Adapter = pDM_Odm->Adapter;
	return rtw_read16(Adapter,RegAddr);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
	PADAPTER		Adapter = pDM_Odm->Adapter;
	return	PlatformEFIORead2Byte(Adapter, RegAddr);
#endif	

}
u16
ODM_Read2Byte(
	PDM_ODM_T		pDM_Odm,
	u32			RegAddr
	)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
	prtl8192cd_priv	priv	= pDM_Odm->priv;
	return	RTL_R16(RegAddr);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
	struct rtw_adapter *		Adapter = pDM_Odm->Adapter;
	return rtw_read16(Adapter,RegAddr);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
	struct rtw_adapter *		Adapter = pDM_Odm->Adapter;
	return	PlatformEFIORead2Byte(Adapter, RegAddr);
#endif

}
예제 #3
0
extern NDIS_STATUS usb_dvobj_init(_adapter * padapter){
	NDIS_STATUS	status=_SUCCESS;
	struct dvobj_priv *pdvobjpriv=&padapter->dvobjpriv;
	u8 hw_version;
	u32  val32,size;
	_func_enter_;
	pdvobjpriv->padapter=padapter;
	
	DEBUG_ERR(("\nusb_dvobj_init:read hw_version!!\n"));
	hw_version = 0;

#if 0
	hw_version = (read32(padapter, TCR) & TCR_HWVERID_MASK)>>TCR_HWVERID_SHIFT;

	switch (hw_version) {
		case VERSION_819xUsb_A:
			padapter->registrypriv.chip_version=VERSION_819xUsb_A;
			DEBUG_ERR(("\nusb_dvobj_init:padapter->registrypriv.chip_version=%d(VERSION_819xUsb_A)\n",padapter->registrypriv.chip_version));
			
		default:
			padapter->registrypriv.chip_version= VERSION_819xUsb_A;
			break;
	}
	  	
	DEBUG_ERR(("\nusb_dvobj_init:padapter->registrypriv.chip_version=%d\n",padapter->registrypriv.chip_version));
#endif

	/*Read EEprom size */ 
	DEBUG_ERR(("\nusb_dvobj_init:read eeprom Size!!\n"));

	val32 = PlatformEFIORead2Byte(padapter, Cmd9346CR);
	size = (val32 & Cmd9346CR_9356SEL) ? 8 : 6;
	padapter->EepromAddressSize = size;

	DEBUG_ERR(("EEPROM type is %s\n",size==8 ? "93C56" : "93C46"));
	
	DEBUG_ERR(("\nusb_dvobj_init:padapter->EepromAddressSize=%d\n",padapter->EepromAddressSize));
	
	read_eeprom_content(padapter);
	
	//write IDR0~IDR5
//	for(i=0 ; i<6 ; i++)
//		write8(padapter, IDR0+i, padapter->eeprompriv.mac_addr[i]);

	PlatformEFIOWrite4Byte(padapter, IDR0, ((pu4Byte)(padapter->eeprompriv.mac_addr))[0]);
	PlatformEFIOWrite2Byte(padapter, IDR4, ((pu2Byte)(padapter->eeprompriv.mac_addr+4))[0]);


//	for(i=0 ; i<6 ; i++)
	{
		
		DEBUG_ERR(("%8x ",PlatformEFIORead4Byte(padapter, IDR0) ) );
		DEBUG_ERR(("%4x ",PlatformEFIORead2Byte(padapter, IDR4) ));
	}
printk("\n");

#ifdef TODO
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))
	INIT_WORK(&_sys_mib->DigWorkItem, (void(*)(void*)) DigWorkItemCallback, padapter);
	INIT_WORK(&_sys_mib->RateAdaptiveWorkItem, (void(*)(void*)) RateAdaptiveWorkItemCallback, padapter);
#else
	INIT_DELAYED_WORK(&_sys_mib->DigWorkItem, DigWorkItemCallback);
	INIT_DELAYED_WORK(&_sys_mib->RateAdaptiveWorkItem, RateAdaptiveWorkItemCallback);
#endif
#endif

	_func_exit_;
	return status;


}