亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hw_routines.c

?? Atheros AP Test with Agilent N4010A source code
?? C
?? 第 1 頁 / 共 3 頁
字號:
	(
	A_UINT16 Mode        // 0 for off, 1 for on
	)
{
	quietMode = Mode;
	return;
}
#endif

/**************************************************************************
* uiOpenYieldLog - open the yield log file.
*
* A user interface command which turns on logging to the yield log file
*
* RETURNS: 1 if file opened, 0 if not
*/
A_UINT16 uiOpenYieldLog
(
	char *filename,        /* name of file to log to */
	A_BOOL append
)
{
	/* open file for writing */
	if (append) {
		yieldLogFile = fopen(filename, "a+");
	}
	else {
		yieldLogFile = fopen(filename, "w");
	}
	if (yieldLogFile == NULL) {
		uiPrintf("Unable to open yield log file %s\n", filename);
		return(0);
	} else {
		uiPrintf("Opened file %s for yieldLog\n", filename);
	}

	/* set flag to say yield logging enabled */
	yieldLogging = 1;

	return(1);
}

/**************************************************************************
* uiYieldLog - write a string to the yield log file
*
* A user interface command which writes a string to the log file
*
* RETURNS: 1 if sucessful, 0 if not
*/
A_UINT16 uiYieldLog
(
	char *string
)
{
	if (yieldLogging > 0) {
		if(yieldLogFile == NULL) {
			uiPrintf("Error, yield logfile not valid, unable to write to file\n");
			return 0;
		}

	  /* write string to file */
	  fprintf(yieldLogFile, string);

	  fflush(yieldLogFile);
	}
	return 1;
}

/**************************************************************************
* uiCloseYieldLog - close the yield logging file
*
* A user interface command which closes an already open log file
*
* RETURNS: void
*/
void uiCloseYieldLog(void)
{
	if ( yieldLogging) {
		if (yieldLogFile != NULL)
			fclose(yieldLogFile);
		yieldLogging = 0;
	}

	return;
}


A_UINT16 hwGetBarSelect(A_UINT16 devIndex) {
	return (A_UINT16) globDrvInfo.pDevInfoArray[devIndex]->pdkInfo->bar_select;
}

A_UINT16 hwSetBarSelect(A_UINT16 devIndex, A_UINT16 bs) {
	if (driverVer.minorVersion >= 2) {
		if (bs < globDrvInfo.pDevInfoArray[devIndex]->pdkInfo->numBars) {
		   globDrvInfo.pDevInfoArray[devIndex]->pdkInfo->bar_select = bs;
		   return bs;
	   }
	}
	globDrvInfo.pDevInfoArray[devIndex]->pdkInfo->bar_select = 0;
	return 0;
}


/**************************************************************************
* hwMemWriteBlock -  Write a block of memory within the simulation environment
*
* Write a block of memory within the simulation environment
*
*
* RETURNS: 0 on success, -1 on error
*/
A_INT16 hwMemWriteBlock
(
	A_UINT16 devIndex,
	A_UCHAR    *pBuffer,
	A_UINT32 length,
	A_UINT32 *pPhysAddr
)
{
	A_UCHAR *pMem;                /* virtual pointer to area to be written */
	A_UINT16 i;
	A_UINT32 startPhysAddr;        /* physical address of start of device memory block,
								   for easier readability */
	MDK_WLAN_DEV_INFO *pdevInfo;

	pdevInfo = globDrvInfo.pDevInfoArray[devIndex];

	if(*pPhysAddr == 0)
	{
		return(-1);
	}

	/* first need to check that the phys address is within the allocated memory block.
	   Need to make sure that the begin size and endsize match.  Will check all the
	   devices.  Only checking the memory block, will not allow registers to be accessed
	   this way
	 */

	/* want to scan all of the F2's to see if this is an allowable address for any of them
	   if it is then allow the access.  This stays compatable with existing lab scripts */
	for (i = 0; i < WLAN_MAX_DEV; i++) {
		if(pdevInfo = globDrvInfo.pDevInfoArray[i])	{
			//check start and end addresswithin memory allocation
			startPhysAddr = pdevInfo->pdkInfo->memPhyAddr;
			if((*pPhysAddr >= startPhysAddr) &&
				(*pPhysAddr <= (startPhysAddr + pdevInfo->pdkInfo->memSize)) &&
				((*pPhysAddr + length) >= startPhysAddr) &&
				((*pPhysAddr + length) <= (startPhysAddr + pdevInfo->pdkInfo->memSize))
				) {
				/* address is within range, so can do the write */

				/* get the virtual pointer to start and read */
				pMem = (A_UINT8 *) (pdevInfo->pdkInfo->memVirAddr + (*pPhysAddr - pdevInfo->pdkInfo->memPhyAddr));
				memcpy(pMem, pBuffer, length);
				return(0);
			}
			// check within the register regions
			startPhysAddr = pdevInfo->pdkInfo->aregPhyAddr[pdevInfo->pdkInfo->bar_select];
			if ((*pPhysAddr >= startPhysAddr) &&
				(*pPhysAddr < startPhysAddr + pdevInfo->pdkInfo->aregRange[pdevInfo->pdkInfo->bar_select]) &&
				((*pPhysAddr + length) >= startPhysAddr) &&
				((*pPhysAddr + length) <= (startPhysAddr + pdevInfo->pdkInfo->aregRange[pdevInfo->pdkInfo->bar_select]))) {
				pMem = (A_UINT8 *) (pdevInfo->pdkInfo->aregVirAddr[pdevInfo->pdkInfo->bar_select] + (*pPhysAddr - pdevInfo->pdkInfo->aregPhyAddr[pdevInfo->pdkInfo->bar_select]));
				memcpy(pMem, pBuffer, length);
				return(0);
			}
		}
	}
	/* if got to here, then address is bad */
	uiPrintf("Warning: Address is not within legal memory range, nothing written\n");
	return(-1);
	}

/**************************************************************************
* hwMemReadBlock - Read a block of memory within the simulation environment
*
* Read a block of memory within the simulation environment
*
*
* RETURNS: 0 on success, -1 on error
*/
A_INT16 hwMemReadBlock
(
	A_UINT16 devIndex,
	A_UCHAR    *pBuffer,
	A_UINT32 physAddr,
	A_UINT32 length
)
{
	A_UCHAR *pMem;                /* virtual pointer to area to be written */
	A_UINT16 i;
	A_UINT32 startPhysAddr;        /* physical address of start of device memory block,
								   for easier readability */
	MDK_WLAN_DEV_INFO *pdevInfo;

	pdevInfo = globDrvInfo.pDevInfoArray[devIndex];



	/* first need to check that the phys address is within the allocated memory block.
	   Need to make sure that the begin size and endsize match.  Will check all the
	   devices.  Only checking the memory block, will not allow registers to be accessed
	   this way
	 */
	for (i = 0; i < WLAN_MAX_DEV; i++) {
		if(pdevInfo = globDrvInfo.pDevInfoArray[i]) {
			//check start and end addresswithin memory allocation
			startPhysAddr = pdevInfo->pdkInfo->memPhyAddr;
			if((physAddr >= startPhysAddr) &&
				(physAddr <= (startPhysAddr + pdevInfo->pdkInfo->memSize)) &&
				((physAddr + length) >= startPhysAddr) &&
				((physAddr + length) <= (startPhysAddr + pdevInfo->pdkInfo->memSize))
				) {
				/* address is within range, so can do the read */
				/* get the virtual pointer to start and read */
				pMem = (A_UINT8 *) (pdevInfo->pdkInfo->memVirAddr + (physAddr - pdevInfo->pdkInfo->memPhyAddr));
				memcpy(pBuffer, pMem, length);
				return(0);
			}
			startPhysAddr = pdevInfo->pdkInfo->aregPhyAddr[pdevInfo->pdkInfo->bar_select];
			if ((physAddr >= startPhysAddr) &&
				(physAddr < startPhysAddr + pdevInfo->pdkInfo->aregRange[pdevInfo->pdkInfo->bar_select]) &&
				((physAddr + length) >= startPhysAddr) &&
				((physAddr + length) <= (startPhysAddr + pdevInfo->pdkInfo->aregRange[pdevInfo->pdkInfo->bar_select]))) {
				pMem = (A_UINT8 *) (pdevInfo->pdkInfo->aregVirAddr[pdevInfo->pdkInfo->bar_select] + (physAddr - pdevInfo->pdkInfo->aregPhyAddr[pdevInfo->pdkInfo->bar_select]));
			// check within the register regions
				memcpy(pBuffer, pMem, length);
				return(0);
			}
		}
	}
	/* if got to here, then address is bad */
	uiPrintf("Warning: Address (%x) is not within legal memory range, nothing read\n", physAddr);
	return(-1);
}

//#ifdef ART_BUILD
#if 1
//#else

/**************************************************************************
* hwGetPhysMem - get a block of physically contiguous memory
*
* This routine gets physically contiguous driver-level memory
*
* RETURNS: The physical address of the memory allocated
*/
/* #####Note may replace this with the function later that returns */
/* both physical and virtual memory of buffer. */
void *hwGetPhysMem
(
	A_UINT16 devIndex,
	A_UINT32 memSize,		             /* number of bytes to allocate */
	A_UINT32 *physAddress
)
{
	A_UCHAR *virtAddress;
	A_UINT32 offset;        /* offset from start of where descriptor is */
	A_UINT16 numBlocks;     /* num blocks need to allocate */
	A_UINT16 index;         /* index of first block to allocate */
	MDK_WLAN_DEV_INFO *pdevInfo;

	pdevInfo = globDrvInfo.pDevInfoArray[devIndex];

	if((memSize/BUFF_BLOCK_SIZE + 1) >= (1 << 8 * sizeof(A_UINT16))) {
		uiPrintf("WARNING: Physical memory of size %ld out of range - returning NULL address\n", memSize);
		return(NULL);
	}

	/* calculate how many blocks of memory are needed and round up result */
	numBlocks = (A_UINT16) (memSize/BUFF_BLOCK_SIZE + ((memSize % BUFF_BLOCK_SIZE) || 0));

	if(memGetIndexForBlock2(pdevInfo, pdevInfo->pbuffMapBytes, numBlocks, &index) != A_OK) {
		uiPrintf("WARNING: Failed to allocate physical memory of size %ld - returning NULL address\n", memSize);
		return(NULL);
	}

	/* got an index, now calculate addresses */
	offset = index * BUFF_BLOCK_SIZE;
	virtAddress = (A_UCHAR *)(pdevInfo->pdkInfo->memVirAddr + offset);
	*physAddress = (A_UINT32)(pdevInfo->pdkInfo->memPhyAddr + offset);

//  /* zero out memory */ -- Need to handle for predator also, so comment for now
//	memset(virtAddress, 0, memSize);
	return(virtAddress);
}


/**************************************************************************
* hwFreeAll - Environment specific code for Command to free all the
*             currently allocated memory
*
* This routine calls to the hardware abstraction layer, to free all of the
* currently allocated memory.  This will include all descriptors and packet
* data as well as any memory allocated with the alloc command.
*
*
* RETURNS: N/A
*/
void hwFreeAll
(
	A_UINT16 devIndex
)
{
	A_UINT32        NumBuffBlocks;
	A_UINT32        NumBuffMapBytes;
	MDK_WLAN_DEV_INFO *pdevInfo;

	pdevInfo = globDrvInfo.pDevInfoArray[devIndex];

	if(pdevInfo) {
		NumBuffBlocks	= pdevInfo->pdkInfo->memSize / BUFF_BLOCK_SIZE;
		NumBuffMapBytes = NumBuffBlocks / 8;

		/* clear the memory allocated by clearing all the map bytes */
		memset( pdevInfo->pbuffMapBytes, 0, NumBuffMapBytes * sizeof(A_UCHAR) );
		memset( pdevInfo->pnumBuffs, 0, NumBuffBlocks * sizeof(A_UINT16) );
	}

	return;
}


/**************************************************************************
* hwEnableFeature - Handle feature enable within windows environment
*
* Enable ISR features within windows environment
*
*
* RETURNS: 0 on success, -1 on error
*/

A_INT16 hwEnableFeature
(
	A_UINT16 devIndex,
	PIPE_CMD *pCmd
)
{
	printf("hwEnableFeature not implemented\n");
	return(0);
}

/**************************************************************************
* hwDisableFeature - Handle feature disable within windows environment
*
* Disble ISR features within windows environment
*
*
* RETURNS: 0 on success, -1 on error
*/

A_INT16 hwDisableFeature
(
	A_UINT16 devIndex,
	PIPE_CMD *pCmd
)
{
	printf("hwDiableFeature not implemented\n");
	return(0);
}

/**************************************************************************
* hwGetStats - Get stats
*
* call into kernel plugin to get the stats copied into user supplied
* buffer
*
*
* RETURNS: 0 on success, -1 on error
*/

A_INT16 hwGetStats
(
	A_UINT16 devIndex,
	A_UINT32 clearOnRead,
	A_UCHAR  *pBuffer,
	A_BOOL	 rxStats
)
{
	printf("hwGetStats not implemented\n");
	return(0);
}

/**************************************************************************
* hwGetSingleStat - Get single stat
*
* call into kernel plugin to get the stats copied into user supplied
* buffer
*
*
* RETURNS: 0 on success, -1 on error
*/

A_INT16 hwGetSingleStat
(
	A_UINT16 devIndex,
	A_UINT32 statID,
	A_UINT32 clearOnRead,
	A_UCHAR  *pBuffer,
	A_BOOL	 rxStats
)
{
	printf("hwGetSingleStat not implemented\n");
	return(0);
}

/**************************************************************************
* hwRemapHardware - Remap the hardware to a new address
*
* Remap the hardware to a new address
*
*
* RETURNS: 0 on success, -1 on error
*/
A_INT16 hwRemapHardware
(
	A_UINT16 devIndex,
	A_UINT32 mapAddress
)
{
	printf("hwReMapHardware not implemented\n");
	return(0);
}


/**************************************************************************
* hwTramWriteBlock -  Write trace ram
*
* Write a block of trace ram
*
*
* RETURNS: 0 on success, -1 on error
*/
A_INT16 hwTramWriteBlock
(
	A_UINT16 devIndex,
	A_UCHAR    *pBuffer,
	A_UINT32 length,
	A_UINT32 physAddr
)
{
	A_UINT32 numDWords = length / 4;
	A_UINT32 *pData = (A_UINT32 *)pBuffer;
	A_UINT32 i;
	MDK_WLAN_DEV_INFO *pdevInfo;

	pdevInfo = globDrvInfo.pDevInfoArray[devIndex];


	for(i = 0; i < numDWords; i++) {
		//write the address
		hwMemWrite32(devIndex,pdevInfo->pdkInfo->aregPhyAddr[0] + 0x18, physAddr);

		//write the value
		hwMemWrite32(devIndex,pdevInfo->pdkInfo->aregPhyAddr[0] + 0x1c, *pData);

		pData++;
		physAddr++;
	}
	return 0;
}

/**************************************************************************
* hwTramReadBlock - Read a block of trace ram
*
* Read a block of traceram
*
*
* RETURNS: 0 on success, -1 on error
*/
A_INT16 hwTramReadBlock
(
	A_UINT16 devIndex,
	A_UCHAR    *pBuffer,
	A_UINT32 physAddr,
	A_UINT32 length
)
{
	A_UINT32 numDWords = length / 4;
	A_UINT32 *pData = (A_UINT32 *)pBuffer;
	A_UINT32 i;
	MDK_WLAN_DEV_INFO *pdevInfo;

	pdevInfo = globDrvInfo.pDevInfoArray[devIndex];

	for(i = 0; i < numDWords; i++) {
		//write the address
		hwMemWrite32(devIndex, pdevInfo->pdkInfo->aregPhyAddr[0] + 0x18, physAddr);

		//read the value
		*pData = hwMemRead32(devIndex, pdevInfo->pdkInfo->aregPhyAddr[0] + 0x1c);

		pData++;
		physAddr++;
	}
	return 0;

}

#endif  // ART_BUILD


/**************************************************************************
* freeDevInfo - frees memory held by devInfo
*
* RETURNS: N/A
*/
void freeDevInfo
(
	MDK_WLAN_DEV_INFO *pdevInfo
)
{
	A_FREE(pdevInfo->pdkInfo);
	A_FREE(pdevInfo);

	return;
}



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本va欧美va精品| 成人福利电影精品一区二区在线观看| 欧美日韩一卡二卡三卡| 亚洲免费色视频| 91视频精品在这里| 亚洲欧美日韩中文播放 | 在线精品视频免费播放| 一区二区中文字幕在线| 成人av影院在线| 国产精品久久久久三级| www.欧美.com| 中文字幕一区不卡| 91视视频在线观看入口直接观看www | 日韩欧美国产小视频| 日韩不卡免费视频| 日韩欧美国产电影| 国内外成人在线视频| 26uuu另类欧美亚洲曰本| 国产精品综合二区| 国产精品私人影院| 91色乱码一区二区三区| 亚洲综合色视频| 欧美精品色综合| 日韩精品色哟哟| 精品国免费一区二区三区| 国产精品99久久久久久久女警| 久久久久久久久97黄色工厂| 国产成人在线视频网站| 国产精品传媒视频| 日本道免费精品一区二区三区| 亚洲永久免费av| 日韩一区二区在线观看| 激情亚洲综合在线| 国产精品久久久久三级| 色天天综合久久久久综合片| 午夜精品福利在线| 欧美tickle裸体挠脚心vk| 国产一区二区成人久久免费影院 | 中文字幕高清不卡| 91丨九色丨蝌蚪丨老版| 亚洲国产日韩a在线播放性色| 在线不卡免费av| 久久不见久久见中文字幕免费| 国产女同性恋一区二区| 91丝袜呻吟高潮美腿白嫩在线观看| 亚洲午夜av在线| 日韩欧美亚洲另类制服综合在线| 国产大片一区二区| 亚洲精品网站在线观看| 7777精品伊人久久久大香线蕉完整版| 久久99热99| 椎名由奈av一区二区三区| 欧美高清激情brazzers| 国产成人精品在线看| 一区二区三国产精华液| 精品卡一卡二卡三卡四在线| 成人激情午夜影院| 性久久久久久久| 国产女人水真多18毛片18精品视频| 91国内精品野花午夜精品| 久久99久久久久| 亚洲天堂2014| 精品国产污网站| 日本精品视频一区二区三区| 久久精品国产77777蜜臀| 最新日韩av在线| 日韩一区二区电影网| 97久久人人超碰| 激情五月婷婷综合| 亚洲激情一二三区| 久久精品一区二区三区不卡牛牛| 欧美在线一区二区| 高清成人免费视频| 视频在线观看国产精品| 国产精品另类一区| 欧美一区二区三区性视频| av在线免费不卡| 精品亚洲aⅴ乱码一区二区三区| 亚洲情趣在线观看| 久久精品一区二区三区四区| 欧美人伦禁忌dvd放荡欲情| 成人性生交大片| 蜜桃久久久久久久| 亚洲一级二级三级在线免费观看| 国产亚洲精品福利| 正在播放一区二区| 日本韩国欧美三级| 成人听书哪个软件好| 精品一二三四在线| 午夜精品一区二区三区电影天堂 | 亚洲一区二区四区蜜桃| 国产欧美精品国产国产专区| 欧美一级午夜免费电影| 欧美色综合网站| 成人午夜又粗又硬又大| 麻豆成人综合网| 五月婷婷综合激情| 一区二区三区日韩| 国产精品第一页第二页第三页| 精品国产第一区二区三区观看体验| 欧美日韩国产影片| 日本久久精品电影| 99re成人精品视频| 福利一区二区在线观看| 精品一区二区三区的国产在线播放| 一区二区三区.www| 亚洲日本va在线观看| 欧美国产日韩一二三区| 久久久久久久电影| www久久精品| 欧美成人激情免费网| 欧美一区二区三区系列电影| 欧美三级韩国三级日本一级| 日本精品一区二区三区高清| av高清不卡在线| 成人福利视频网站| 成人av网站免费观看| 国产电影精品久久禁18| 国产麻豆成人精品| 国产精品亚洲一区二区三区妖精| 久久综合综合久久综合| 美女视频一区在线观看| 蜜桃视频在线观看一区| 日本在线不卡视频| 奇米一区二区三区| 日本免费新一区视频| 强制捆绑调教一区二区| 美女视频第一区二区三区免费观看网站| 久久久久国产精品人| 久久久99精品免费观看| 久久精品日产第一区二区三区高清版 | 蜜桃精品视频在线观看| 日韩高清电影一区| 欧美aaaaaa午夜精品| 蜜臀av性久久久久蜜臀av麻豆| 美女久久久精品| 国内精品伊人久久久久影院对白| 狠狠色狠狠色综合| 国产美女在线观看一区| 国产激情精品久久久第一区二区| 国产精品18久久久久| 成人午夜激情影院| 99视频超级精品| 色狠狠桃花综合| 欧美亚洲国产怡红院影院| 欧美日韩国产免费| 欧美一区二区在线看| 日韩欧美亚洲国产另类| 久久亚洲私人国产精品va媚药| 久久久99精品免费观看| 国产精品激情偷乱一区二区∴| 国产精品家庭影院| 亚洲午夜一区二区三区| 丝袜诱惑制服诱惑色一区在线观看| 日本欧美大码aⅴ在线播放| 久久66热re国产| 福利一区二区在线| 91一区二区在线观看| 欧美午夜精品久久久久久超碰| 在线播放中文一区| 久久亚洲影视婷婷| 亚洲欧洲成人自拍| 亚洲成av人片| 狠狠色狠狠色综合系列| 成人黄色片在线观看| 在线观看亚洲精品视频| 日韩一区二区三区电影 | 日韩欧美高清一区| 国产日韩欧美综合在线| 亚洲精品日韩专区silk| 日av在线不卡| 国产成人av影院| 91黄色免费版| 精品捆绑美女sm三区| 一区精品在线播放| 午夜一区二区三区在线观看| 久久国产视频网| 97久久人人超碰| 日韩欧美一级片| 亚洲视频香蕉人妖| 免费美女久久99| 成人午夜看片网址| 欧美日本韩国一区二区三区视频 | 麻豆成人综合网| 99亚偷拍自图区亚洲| 欧美精品丝袜久久久中文字幕| 日韩免费福利电影在线观看| 国产精品欧美久久久久无广告| 亚欧色一区w666天堂| 成人高清视频在线| 日韩限制级电影在线观看| 国产精品乱码久久久久久| 日精品一区二区三区| 国产suv精品一区二区6| 欧美日韩国产经典色站一区二区三区| 久久免费偷拍视频| 午夜亚洲福利老司机| 大尺度一区二区| 91精品在线观看入口| 日韩毛片在线免费观看|