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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? mcont.c

?? Atheros AP Test with Agilent N4010A source code
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/* mCont.c - contians continuous transmit functions */
/* Copyright (c) 2001 Atheros Communications, Inc., All Rights Reserved */

#ident  "ACI $Id: //depot/sw/branches/ART_V53_dragon/sw/src/dk/mdk/devlib/mCont.c#3 $, $Header: //depot/sw/branches/ART_V53_dragon/sw/src/dk/mdk/devlib/mCont.c#3 $"

/* 
Revsision history
--------------------
1.0       Created.
*/
// #include "vxdrv.h"

#ifdef __ATH_DJGPPDOS__
#include <unistd.h>
#ifndef EILSEQ  
    #define EILSEQ EIO
#endif	// EILSEQ

#define __int64	long long
typedef unsigned long DWORD;
#define Sleep	delay
#endif	// #ifdef __ATH_DJGPPDOS__

#include "wlantype.h"
#include "ar5210reg.h"
#include "athreg.h"
#include "manlib.h"
#include "mdata.h"
#include "mEeprom.h"
#include "mConfig.h"
#include "mDevtbl.h"
#include "mIds.h"
#include <assert.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>

#if defined(COBRA_AP) && defined(PCI_INTERFACE)
#include "ar531xPlusreg.h"
#endif

#define SINE_BUFFER_SIZE 2000
#ifndef PI	
#define PI 3.14159265358979323846
#endif

void lclSineWave(A_UINT32 frequency, A_UINT32 amplitude, 
                 A_UCHAR  sine1[2000], A_UCHAR  sine2[2000], A_UINT32 turbo);
static A_UCHAR PN7Data[] = {0xfe, 0xa9, 0x9d, 0xd2, 0xc6, 0xf6, 0xb6, 0x48, 
                            0xe1, 0x7c, 0xae, 0x68, 0x9e, 0x28, 0x60, 0x80};
static A_UCHAR PN9Data[] = {0xff, 0x87, 0xb8, 0x59, 0xb7, 0xa1, 0xcc, 0x24, 
                            0x57, 0x5e, 0x4b, 0x9c, 0x0e, 0xe9, 0xea, 0x50, 
                            0x2a, 0xbe, 0xb4, 0x1b, 0xb6, 0xb0, 0x5d, 0xf1, 
                            0xe6, 0x9a, 0xe3, 0x45, 0xfd, 0x2c, 0x53, 0x18, 
                            0x0c, 0xca, 0xc9, 0xfb, 0x49, 0x37, 0xe5, 0xa8, 
                            0x51, 0x3b, 0x2f, 0x61, 0xaa, 0x72, 0x18, 0x84, 
                            0x02, 0x23, 0x23, 0xab, 0x63, 0x89, 0x51, 0xb3, 
                            0xe7, 0x8b, 0x72, 0x90, 0x4c, 0xe8, 0xfb, 0xc0};

static A_BOOL stabilizePower(A_UINT32 devNum, A_UCHAR  dataRate, A_UINT32 antenna, 
							 A_UINT32 type);

/**************************************************************************
* txContBegin - Place device in continuous transmit mode
*
*/
MANLIB_API void txContBegin
( 
 A_UINT32 devNum,  
 A_UINT32 type, 
 A_UINT32 typeOption1,
 A_UINT32 typeOption2, 
 A_UINT32 antenna
)
{
   	LIB_DEV_INFO *pLibDev;
    A_UCHAR      sineBuffer1[SINE_BUFFER_SIZE], sineBuffer2[SINE_BUFFER_SIZE];
    A_UINT32	 i, pktSize=0, dataPatLength;
    A_UCHAR      *pData, dataRate;
    MDK_ATHEROS_DESC localDesc;
    MDK_ATHEROS_DESC localDescRx;
	A_UINT16	queueIndex;
	A_UINT32    value;
	A_UINT32    xpaaHigh = 0;
	A_UINT32    xpabHigh = 0;
	A_UINT32    max_constant_i, max_constant_q;

	if (checkDevNum(devNum) == FALSE) {
		mError(devNum, EINVAL, "Device Number %d:txContBegin\n", devNum);
		return;
	}
	if (gLibInfo.pLibDevArray[devNum]->devState < RESET_STATE) {
		mError(devNum, EILSEQ, "Device Number %d:txContBegin: Device should be out of Reset before continuous transmit\n", devNum);
		return;
	}
    pLibDev = gLibInfo.pLibDevArray[devNum];

	pLibDev->selQueueIndex = 0;
	pLibDev->tx[0].dcuIndex = 0;

	queueIndex = pLibDev->selQueueIndex;

    dataRate = 0;

	switch(type) {
	case CONT_SINE:
        mError(devNum, EINVAL, "Device Number %d:txContBegin: The SINE function is being retooled to provide more accurate\n \
            data and is not available in this version of the library.\n", devNum);
        return;
#if 0  //quiet compiler warnings
		if((typeOption1 < 1) || (typeOption1 > 100)) {
			mError(EINVAL, 
                "txContBegin: SINE amplitude must be between 1 and 100 inclusively - not: %d\n", 
                typeOption1);
			return;
		}
		if((typeOption2 < 1000) || (typeOption2 > 10000)) {
			mError(EINVAL, 
                "txContBegin: SINE frequency must be between 1000 kHz and 10,000 kHz - not: %d\n", 
				typeOption2);
			return;
		}
		break;
#endif
	case CONT_DATA:
    case CONT_FRAMED_DATA:
		if(typeOption1 > RANDOM_PATTERN) {
			mError(devNum, EINVAL, 
                "Device Number %d:txContBegin: DATA pattern does not match a known value: %d\n", devNum, 
				typeOption1);
			return;
		}
		//decode the rate code
		for(dataRate = 0; dataRate < numRateCodes; dataRate++) {
			if(typeOption2 == rateCodes[dataRate]) {
				break;  //dataRate should be set to the correct index
			}
		}
		if(dataRate == numRateCodes) {
            mError(devNum, EINVAL, "Device Number %d:txContBegin: DATA rate does not match a known rate: %d\n", devNum, 
                typeOption2);
            return;
        }
        break;
	case CONT_SINGLE_CARRIER:
		//change xpa value
		xpaaHigh = getFieldForMode(devNum, "bb_xpaa_active_high", pLibDev->mode, pLibDev->turbo);
		xpabHigh = getFieldForMode(devNum, "bb_xpab_active_high", pLibDev->mode, pLibDev->turbo);
		if(pLibDev->mode == MODE_11A) {
			writeField(devNum, "bb_xpaa_active_high", !xpaaHigh);
		} 
		else {
			writeField(devNum, "bb_xpab_active_high", !xpabHigh);
		}

//		resetDevice(devNum, pLibDev->macAddr.octets, pLibDev->bssAddr.octets, pLibDev->freqForResetDevice, pLibDev->turbo);
        if (isDragon(devNum)) {
           max_constant_i = max_constant_q = DAC_11BIT_MAX_VALUE;
        }
        else {
           max_constant_i = max_constant_q = DAC_9BIT_MAX_VALUE;
        }

		if(typeOption1 > max_constant_i) {
			mError(devNum, EINVAL, "Device Number %d:txContBegin: SINGLE_CARRIER constant I value greater than 511: %d\n", devNum, typeOption1);
			return;
		}
		if(typeOption2 > max_constant_q) {
			mError(devNum, EINVAL, "Device Number %d:txContBegin: SINGLE_CARRIER constant Q value greater than 511: %d\n", devNum, typeOption2);
			return;
		}
		break;
	default:
		mError(devNum, EINVAL, "Device Number %d:txContBegin: type must be set to a valid pattern type\n", devNum);
		return;
	}
    pLibDev->tx[queueIndex].contType = type;

	//cleanup any stuff from previous transmit
	if (pLibDev->tx[queueIndex].pktAddress || pLibDev->tx[queueIndex].descAddress) {
		memFree(devNum, pLibDev->tx[queueIndex].pktAddress);
		pLibDev->tx[queueIndex].pktAddress = 0;
		memFree(devNum, pLibDev->tx[queueIndex].descAddress);
		pLibDev->tx[queueIndex].descAddress = 0;
   		pLibDev->tx[queueIndex].txEnable = 0;
	}
	//update antenna
	//IF using Single carrier, then need to switch the antenna to the opposite
	//to what is expected.  This is because the baseband is in "receive" mode in the
	//case of single carrier, and so uses the opposite antenna to what is set for
	//transmit mode
	if(type == CONT_SINGLE_CARRIER) {
		antenna = 
			(antenna==(USE_DESC_ANT|DESC_ANT_A)) ? (USE_DESC_ANT|DESC_ANT_B) : (USE_DESC_ANT|DESC_ANT_A);
	}
	if (!ar5kInitData[pLibDev->ar5kInitIndex].pMacAPI->setupAntenna(devNum, antenna, &antenna))
	{
		return;
	}

   	// send a few packets first to step-up the transmit power
    // Setup the data packet
    pData = sineBuffer1;
    switch (typeOption1 ) {
    case ONES_PATTERN:
        *((A_UINT32 *)pData) = 0xFFFFFFFF;
        dataPatLength = 4;
        break;
    case REPEATING_5A:
        *((A_UINT32 *)pData) = 0x5A5A5A5A;
        dataPatLength = 4;
        break;
    case COUNTING_PATTERN:
        for(i = 0; i < 256; i++) {
            pData[i] = (A_UCHAR)i;
        }
        dataPatLength = 256;
        break;
    case PN7_PATTERN:
        pData = PN7Data;
        dataPatLength = sizeof(PN7Data);
        break;
    case PN9_PATTERN:
        pData = PN9Data;
        dataPatLength = sizeof(PN9Data);
        break;
    case REPEATING_10:
        *((A_UINT32 *)pData) = 0xAAAAAAAA;
        dataPatLength = 4;
		break;
    case RANDOM_PATTERN:
        srand( (unsigned)time( NULL ) );
        for(i = 0; i < 256; i++) {
            pData[i] = (A_UCHAR)(rand() & 0xFF);
        }
        dataPatLength = 256;
        break;
    default:  // Use Zeroes Pattern
        *((A_UINT32 *)pData) = 0;
        dataPatLength = 4;
        break;
    }

//	if((type != CONT_SINGLE_CARRIER)&&(type != CONT_SINE)) {
	if(type != CONT_SINE) {
		// Add a local self-linked rx descriptor and buffer to stop receive overrun
		// cleanup descriptors created by the last begin
		if (pLibDev->rx.rxEnable || pLibDev->rx.bufferAddress) {
			memFree(devNum, pLibDev->rx.bufferAddress);
			pLibDev->rx.bufferAddress = 0;
			memFree(devNum, pLibDev->rx.descAddress);
			pLibDev->rx.descAddress = 0;
			pLibDev->rx.rxEnable = 0;
			pLibDev->rx.numDesc = 0;
			pLibDev->rx.bufferSize = 0;
		}

		pLibDev->rx.descAddress = memAlloc( devNum, sizeof(MDK_ATHEROS_DESC));
		if (0 == pLibDev->rx.descAddress) {
			mError(devNum, ENOMEM, "Device Number %d:txContBegin: unable to allocate memory for rx-descriptor to prevent overrun\n", devNum);
			return;
		}
		pLibDev->rx.bufferAddress = memAlloc(devNum, 512);
		if (0 == pLibDev->rx.bufferAddress) {
			mError(devNum, ENOMEM, "Device Number %d:txContBegin: unable to allocate memory for rx-buffer to prevent overrun\n", devNum);
			return;
		}

#if defined(COBRA_AP) && defined(PCI_INTERFACE)
	    if(isCobra(pLibDev->swDevID)) {
			localDescRx.bufferPhysPtr = pLibDev->rx.bufferAddress;
		    localDescRx.nextPhysPtr = pLibDev->rx.descAddress;
		}
	    else {
		    localDescRx.bufferPhysPtr = pLibDev->rx.bufferAddress | HOST_PCI_SDRAM_BASEADDR;
		    localDescRx.nextPhysPtr = pLibDev->rx.descAddress | HOST_PCI_SDRAM_BASEADDR;
		}
#else
		localDescRx.bufferPhysPtr = pLibDev->rx.bufferAddress;
		localDescRx.nextPhysPtr = pLibDev->rx.descAddress;
#endif
		localDescRx.hwControl[1] = pLibDev->rx.bufferSize;
		localDescRx.hwControl[0] = 0;
		writeDescriptor(devNum, pLibDev->rx.descAddress, &localDescRx);

		//go into AGC deaf mode
		ar5kInitData[pLibDev->ar5kInitIndex].pMacAPI->AGCDeaf(devNum);

		//write RXDP
#if defined(COBRA_AP) && defined(PCI_INTERFACE)
	    if(isCobra(pLibDev->swDevID)) {
			ar5kInitData[pLibDev->ar5kInitIndex].pMacAPI->writeRxDescriptor(devNum, pLibDev->rx.descAddress);
		}
		else {
			ar5kInitData[pLibDev->ar5kInitIndex].pMacAPI->writeRxDescriptor(devNum, pLibDev->rx.descAddress | HOST_PCI_SDRAM_BASEADDR);
		}
#else
		ar5kInitData[pLibDev->ar5kInitIndex].pMacAPI->writeRxDescriptor(devNum, pLibDev->rx.descAddress);
#endif

//printf("SNOOP:dataRate=%x:antenna=%x:type=%d\n", dataRate, antenna, type);
		//stabilize the power before going into continuous mode
		if(!stabilizePower(devNum, dataRate,antenna, type)) {
			return;
		}

		//allocate memory for cont packet and descriptor
		pLibDev->tx[queueIndex].descAddress = memAlloc( devNum, sizeof(MDK_ATHEROS_DESC) );
//printf("SNOOP:txContBegin:tx%d:descAddr=%x\n", queueIndex, pLibDev->tx[queueIndex].descAddress);
	//memDisplay(devNum, pLibDev->tx[queueIndex].descAddress, 8);
		if (0 == pLibDev->tx[queueIndex].descAddress) {
			mError(devNum, ENOMEM, "Device Number %d:stabilize: unable to allocate memory for descriptors\n", devNum);
			return;
		}

 		//setup the transmit packet
		if(type == CONT_DATA) {
			//set this flag so that the packet will be created without the header
			pLibDev->specialTx100Pkt = 1;
		}

		createTransmitPacket(devNum, MDK_NORMAL_PKT, NULL, 1, 2300, pData, 
			dataPatLength, 1, queueIndex, &(pktSize), &(pLibDev->tx[queueIndex].pktAddress));

		// Setup descriptor template - only the desc addresses change per descriptor
		// write buffer ptr to descriptor
#if defined(COBRA_AP) && defined(PCI_INTERFACE)
	    if(isCobra(pLibDev->swDevID)) {
			localDesc.bufferPhysPtr = pLibDev->tx[queueIndex].pktAddress;
		}
		else {
			localDesc.bufferPhysPtr = pLibDev->tx[queueIndex].pktAddress | HOST_PCI_SDRAM_BASEADDR;
		}
#else
		localDesc.bufferPhysPtr = pLibDev->tx[queueIndex].pktAddress;
#endif

		ar5kInitData[pLibDev->ar5kInitIndex].pMacAPI->setContDescriptor( devNum, &localDesc, pktSize, 
							antenna, dataRate );
		
		//set the next pointer to point to itself
#if defined(COBRA_AP) && defined(PCI_INTERFACE)
	    if(isCobra(pLibDev->swDevID)) {
			localDesc.nextPhysPtr = pLibDev->tx[queueIndex].descAddress;
		}
		else {
			localDesc.nextPhysPtr = pLibDev->tx[queueIndex].descAddress | HOST_PCI_SDRAM_BASEADDR;
		}
#else
		localDesc.nextPhysPtr = pLibDev->tx[queueIndex].descAddress;
#endif
		
		//descriptor will be written later
	}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩毛片精品高清免费| 成人av电影在线观看| 午夜视频在线观看一区| 成人高清视频在线| 日韩在线一区二区三区| 中文字幕精品一区二区三区精品 | av激情综合网| 亚洲成人资源在线| 综合色天天鬼久久鬼色| 精品成人一区二区三区四区| 色哟哟精品一区| 国产精品99久久久久久似苏梦涵| 亚洲成人综合视频| 中文字幕一区二区三中文字幕| 3atv一区二区三区| 欧美中文字幕一区二区三区 | **性色生活片久久毛片| 精品国产一区二区三区av性色 | 欧美激情一区二区三区| 欧美一卡二卡三卡四卡| 欧美唯美清纯偷拍| 91免费精品国自产拍在线不卡| 国产一区不卡视频| 免费观看日韩av| 亚洲成人av中文| 一区二区三区蜜桃| 亚洲男人的天堂一区二区| 中文字幕免费不卡| 国产欧美一区二区三区在线看蜜臀 | 亚洲欧美日韩国产综合在线| 久久久亚洲精品一区二区三区 | 国产日韩欧美精品在线| 精品理论电影在线观看| 日韩免费在线观看| 日韩欧美黄色影院| 精品久久久影院| 久久网这里都是精品| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲成人精品影院| 亚洲精品国产高清久久伦理二区| 亚洲欧洲色图综合| 1区2区3区国产精品| 亚洲情趣在线观看| 一区二区三区在线视频免费| 亚洲精品成人天堂一二三| 一区二区三区欧美视频| 亚洲精品高清在线观看| 亚洲成人动漫精品| 秋霞av亚洲一区二区三| 奇米影视一区二区三区| 久久激情五月激情| 国产精品一区二区视频| 国产91在线|亚洲| 成人av综合在线| 色网综合在线观看| 欧美日韩黄色影视| 欧美大片一区二区| 久久久精品国产免大香伊| 亚洲国产精品传媒在线观看| 国产日韩欧美精品综合| 亚洲欧洲另类国产综合| 一区二区三区四区在线| 午夜精品久久久久久久久久久| 奇米精品一区二区三区四区| 国产综合色视频| 国产成人亚洲精品青草天美| 91麻豆精品一区二区三区| 欧美日韩www| 日韩一区国产二区欧美三区| 久久伊99综合婷婷久久伊| 亚洲欧洲精品一区二区精品久久久| 亚洲国产三级在线| 美女久久久精品| 成人黄色av网站在线| 欧美亚洲另类激情小说| 精品少妇一区二区三区在线播放 | 国产精品初高中害羞小美女文| 亚洲色图一区二区三区| 日韩黄色小视频| 成人黄色在线看| 91精品国产综合久久久久久| 欧美激情一区三区| 亚洲va在线va天堂| 国产高清久久久| 亚洲视频一二三| 日本欧美一区二区三区| 99天天综合性| 日韩一级大片在线观看| 中文字幕一区二区三区四区不卡| 日韩福利视频导航| 91香蕉视频在线| 精品国产成人在线影院| 亚洲免费观看在线观看| 国产麻豆精品95视频| 欧美性猛片aaaaaaa做受| 国产三级精品三级在线专区| 天堂久久久久va久久久久| 成人午夜免费av| 欧美成人r级一区二区三区| 亚洲欧美经典视频| 国产成人高清视频| 国产精品国产三级国产aⅴ中文 | 亚洲国产综合在线| 国产精品亚洲综合一区在线观看| 欧美伊人久久久久久午夜久久久久| 精品美女一区二区| 婷婷丁香激情综合| 91麻豆国产在线观看| 国产婷婷色一区二区三区| 日韩av网站在线观看| 色综合天天综合色综合av | 蜜桃视频在线一区| 色妹子一区二区| 国产精品久久久久一区二区三区共| 青娱乐精品视频| 欧美日本在线视频| 亚洲精品欧美激情| 不卡欧美aaaaa| 国产午夜亚洲精品午夜鲁丝片| 美女一区二区视频| 欧美军同video69gay| 樱花影视一区二区| 91网站最新网址| 最新热久久免费视频| 国产91丝袜在线播放0| 国产亚洲综合av| 久久99精品视频| 欧美一区二区三区在线电影| 无码av免费一区二区三区试看| 91精品办公室少妇高潮对白| 亚洲色大成网站www久久九九| 丁香六月久久综合狠狠色| 国产性做久久久久久| 国产精品一区二区久久不卡| 2020国产精品久久精品美国| 麻豆国产精品官网| 欧美成人乱码一区二区三区| 麻豆一区二区99久久久久| 日韩小视频在线观看专区| 麻豆精品在线观看| 精品久久五月天| 国产综合成人久久大片91| 2023国产精品视频| 大胆亚洲人体视频| 一区二区在线看| 欧美视频在线一区| 亚瑟在线精品视频| 91精品国产麻豆国产自产在线 | 午夜精品久久久久久久久久久| 欧美日韩美女一区二区| 日韩高清不卡一区| 久久久www免费人成精品| 高清日韩电视剧大全免费| 1区2区3区欧美| 欧美色手机在线观看| 美女诱惑一区二区| 欧美国产精品久久| 91啪在线观看| 婷婷亚洲久悠悠色悠在线播放| 日韩一区二区三区视频在线观看| 精品无人码麻豆乱码1区2区| 欧美经典一区二区| 91麻豆国产自产在线观看| 亚洲成av人片一区二区| 精品国产亚洲一区二区三区在线观看| 国产一区二区在线观看免费| 国产精品人成在线观看免费| 色噜噜狠狠成人中文综合| 蜜臀久久久久久久| 国产日韩欧美在线一区| 欧美曰成人黄网| 国产主播一区二区三区| 最新国产成人在线观看| 91精品国产综合久久久蜜臀图片| 国产成人免费在线观看| 一区二区三区不卡在线观看| 欧美一区二区久久久| 国产aⅴ综合色| 亚洲妇熟xx妇色黄| 国产亚洲短视频| 91麻豆精品国产自产在线| 风流少妇一区二区| 日韩影院免费视频| 国产精品色婷婷| 日韩一区二区影院| 91捆绑美女网站| 国内精品国产成人| 亚洲成人7777| 国产精品色婷婷久久58| 欧美一区二区视频观看视频| 色综合视频在线观看| 国产在线看一区| 午夜精品一区二区三区三上悠亚| 国产日韩欧美亚洲| 欧美本精品男人aⅴ天堂| 在线免费精品视频| 粉嫩久久99精品久久久久久夜| 日韩精品亚洲专区| 亚洲色图欧洲色图| 国产精品乱子久久久久|