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

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

?? meeprom.c

?? Atheros AP Test with Agilent N4010A source code
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* mEeprom.c - contians functions for reading eeprom and getting pcdac power settings for all channels */
/* Copyright (c) 2001 Atheros Communications, Inc., All Rights Reserved */

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

/* 
Revsision history
--------------------
1.0       Created.
*/

#ifdef VXWORKS
#include "vxworks.h"
#endif

#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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef WIN32 
#include <memory.h>
#include <conio.h>
#endif
#include "athreg.h"
#include "manlib.h"
#include "mEeprom.h"
#include "mConfig.h"
#include "mDevtbl.h"
#include <errno.h>

#include "mEEP211.h"
#include "mEEPROM_d.h"
#include "mEEPROM_g.h"
#include "ar2413reg.h"
#include "..\ar6000\mEep6000.h"

#if defined(SPIRIT_AP) || defined(FREEDOM_AP)
// delta macro defined in both mEeprom.h and ar531x.h 
// cannot #include ar531x.h 
// declaring only the functions and MACROS needed from ar531x.h
UINT8 sysFlashConfigRead(int fcl , int offset);
void sysFlashConfigWrite(int fcl, int offset, UINT8 *data, int len);
#define FLC_RADIOCFG	2

#endif

A_UINT16	intercepts_pre3p2[] = {0,5,10,20,30,50,70,85,90,95,100};
A_UINT16	intercepts[] = {0,10,20,30,40,50,60,70,80,90,100} ;

#define NUM_INTERCEPTS	sizeof(intercepts)/sizeof(A_UINT16)
A_UINT16	channels_11b[] = {2412, 2447, 2484};		
A_UINT16	channels_11g[] = {2312, 2412, 2484};		

A_UINT16  curr_pwr_index_offset; // scale-up factor to make it Pmax referenced power table

static 	A_UINT16 cornerFixChannels[] = {5180, 5320, 5640, 5825};
#define NUM_CORNER_FIX_CHANNELS sizeof(cornerFixChannels)/sizeof(A_UINT16)
//static void writeCornerCal(A_UINT32 devNum, A_UINT16 channel,MDK_EEP_HEADER_INFO	*pHeaderInfo);

//this is static (and a structure), so that getCtlPowerInfo() can return this info
//from library
static CTL_POWER_INFO	   savedCtlPowerInfo;
A_UINT32 checkSumLengthLib=0x400; //default to 16k
A_UINT32 eepromSizeLib=0;

extern void getAR6000Struct(
 A_UINT32 devNum,
 void **ppReturnStruct,		//return ptr to struct asked for
 A_UINT32 *pNumBytes		//return the size of the structure
);

EEP_OFFSET_STRUCT eep3_2 = {
    0xbf,		//HDR_COUNTRY_CODE
    0xc2,		//HDR_MODE_DEVICE_INFO
    0xc4,		//HDR_ANTENNA_GAIN
	0xc9,       //HEADER_MAC_FEATURES
    0xc5,		//HDR_11A_COMMON
    0xd0,		//HDR_11B_COMMON
    0xda,		//HDR_11G_COMMON
    0xe4,		//HDR_CTL
    0xee,		//HDR_11A_SPECIFIC
    0xec,		//HDR_11B_SPECIFIC
    0xed,		//HDR_11G_SPECIFIC
	0x100,		//GROUP1_11A_FREQ_PIERS
    0x105,		//GROUP2_11A_RAW_PWR
    0x137,		//GROUP3_11B_RAW_PWR
    0x146,		//GROUP4_11G_RAW_PWR
    0x155,		//GROUP5_11A_TRGT_PWR
    0x165,		//GROUP6_11B_TRGT_PWR
    0x169,		//GROUP7_11G_TRGT_PWR
    0x16f,		//GROUP8_CTL_INFO
};

EEP_OFFSET_STRUCT eep3_3 = {
    0xbf,		//HDR_COUNTRY_CODE
    0xc2,		//HDR_MODE_DEVICE_INFO
    0xc3,		//HDR_ANTENNA_GAIN
	0xc9,        //HEADER_MAC_FEATURES
    0xd4,		//HDR_11A_COMMON
    0xf2,		//HDR_11B_COMMON
    0x10d,		//HDR_11G_COMMON
    0x128,		//HDR_CTL
    0xe0,		//HDR_11A_SPECIFIC
    0xfc,		//HDR_11B_SPECIFIC
    0x117,		//HDR_11G_SPECIFIC
	0x150,		//GROUP1_11A_FREQ_PIERS
    0x155,		//GROUP2_11A_RAW_PWR
    0x187,		//GROUP3_11B_RAW_PWR
    0x196,		//GROUP4_11G_RAW_PWR
    0x1a5,		//GROUP5_11A_TRGT_PWR
    0x1b5,		//GROUP6_11B_TRGT_PWR
    0x1b9,		//GROUP7_11G_TRGT_PWR
    0x1bf,		//GROUP8_CTL_INFO
};


EEP_OFFSET_STRUCT *pOffsets = NULL;





/**************************************************************************
* mapPcdacTable - Create full pcdac table from limited table
*
* Given the limited EEPROM table, creates a full linear pcdac to power table
* by extrapolating the power for the intermediate pcdac values
*
* RETURNS: Fills in the full pcdac to power table
*/
void 
mapPcdacTable
(
 MDK_PCDACS_EEPROM *pSrcStruct,					//limited input table
 MDK_FULL_PCDAC_STRUCT *pPcdacStruct			//pointer to table to complete
)
{
	A_UINT16			*pPcdacValue;
	A_INT16				*pPwrValue;
	A_UINT16			i, j;
	A_UINT16			numPcdacs = 0;

	//create the pcdac values
	for(i = PCDAC_START, j = 0; i <= PCDAC_STOP; i+= PCDAC_STEP, j++) {
		numPcdacs++;
		pPcdacStruct->PcdacValues[j] = i;
	}

	pPcdacStruct->numPcdacValues = numPcdacs;
	pPcdacStruct->pcdacMin = pPcdacStruct->PcdacValues[0];
	pPcdacStruct->pcdacMax = pPcdacStruct->PcdacValues[numPcdacs - 1];

	pPcdacValue = pPcdacStruct->PcdacValues;
	pPwrValue = pPcdacStruct->PwrValues;
	//for each of the pcdac values, calculate the power
	for(j = 0; j < pPcdacStruct->numPcdacValues; j++ ) {
		*pPwrValue = getScaledPower(pPcdacStruct->channelValue, *pPcdacValue, pSrcStruct);
		pPcdacValue++;
		pPwrValue++;
    }
	return;
}

/**************************************************************************
* getScaledPower - Calculate power from pcdac values by extrapolation
*
* Either find the power value for the pcdac in the input table
* or extrapolate between 2 nearest pcdac and channel values to get the power
* Power returned is scaled to avoid use of floats
*
* RETURNS: scaled Power value for a given pcdac
*/
A_INT16 
getScaledPower
(
 A_UINT16			channel,			//which channel, power is needed for
 A_UINT16			pcdacValue,			//which pcdac value, power is needed for
 MDK_PCDACS_EEPROM		*pSrcStruct			//input structure to search
)
{
	A_INT16	     powerValue;
	A_UINT16	lFreq, rFreq;			//left and right frequency values
	A_UINT16	llPcdac, ulPcdac;		//lower and upper left pcdac values
	A_UINT16	lrPcdac, urPcdac;		//lower and upper right pcdac values
	A_INT16	    lPwr, uPwr;				//lower and upper temp pwr values
	A_INT16	lScaledPwr, rScaledPwr;	//left and right scaled power

	//if value pcdac is part of the input set then can return
	if(findValueInList(channel, pcdacValue, pSrcStruct, &powerValue)){
		//value was copied from srcStruct
		return(powerValue);
	}

	//find nearest channel and pcdac value to extrapolate between
	getLeftRightChannels(channel, pSrcStruct, &lFreq, &rFreq);
	getLowerUpperPcdacs(pcdacValue, lFreq, pSrcStruct, &llPcdac, &ulPcdac);
	getLowerUpperPcdacs(pcdacValue, rFreq, pSrcStruct, &lrPcdac, &urPcdac);
    
	//get the power index for the upper and lower pcdac
	findValueInList(lFreq, llPcdac, pSrcStruct, &lPwr);
	findValueInList(lFreq, ulPcdac, pSrcStruct, &uPwr);
	lScaledPwr = getInterpolatedValue( pcdacValue, llPcdac, ulPcdac, lPwr, uPwr, 0);
    
	findValueInList(rFreq, lrPcdac, pSrcStruct, &lPwr);
	findValueInList(rFreq, urPcdac, pSrcStruct, &uPwr);
	rScaledPwr = getInterpolatedValue( pcdacValue, lrPcdac, urPcdac, lPwr, uPwr, 0);

	//finally get the power for this pcdac
	return(getInterpolatedValue( channel, lFreq, rFreq, lScaledPwr, rScaledPwr, 0));
} 


/**************************************************************************
* findValueInList - Search for pcdac value for a given channel
*
* Search input table to see if already have a pcdac/power mapping for 
* the given pcdac value at the given channel
*
* RETURNS: TRUE (and fills in power value) if found. FALSE otherwise
*/
A_BOOL
findValueInList
(
 A_UINT16			channel,			//which channel, power is needed for
 A_UINT16			pcdacValue,			//which pcdac value, power is needed for
 MDK_PCDACS_EEPROM		*pSrcStruct,		//input structure to search
 A_INT16			*powerValue			//return power value found in src struct
)
{
	MDK_DATA_PER_CHANNEL	*pChannelData;
	A_UINT16			*pPcdac;
	A_UINT16			i, j;

	pChannelData = pSrcStruct->pDataPerChannel; 
	for(i = 0; i < pSrcStruct->numChannels; i++ ) {
		if (pChannelData->channelValue == channel) {
			pPcdac = pChannelData->PcdacValues;
			for(j = 0; j < pChannelData->numPcdacValues; j++ ) {
				if (*pPcdac == pcdacValue) {
					*powerValue = pChannelData->PwrValues[j];
					return(TRUE);
				}
				pPcdac++;
			}
	    }
		pChannelData++;			
	}
	return(FALSE);
}

/**************************************************************************
* getInterpolatedValue - Calculate Interpolated value
*
* Use relationship between left and right source points then apply to the target
* points to perform the interpolation, scale the return value as required by the 
* input flag
*
* RETURNS: the interpolated value, scaled or otherwise
*/
A_UINT16 getInterpolatedValue 
(
 A_UINT16	source,				//Input source value
 A_UINT16	srcLeft,			//Value lower than source
 A_UINT16	srcRight,			//value greater than source
 A_UINT16	targetLeft,			//lower target value
 A_UINT16	targetRight,		//upper target value
 A_BOOL		scaleUp
)
{
  A_UINT16 returnValue;
  A_UINT16 lRatio;
  A_UINT16 scaleValue = SCALE;

  //to get an accurate ratio, always scale, if return scale needed, then don't scale back down
  if((targetLeft * targetRight) == 0) {
	return(0);
  }

  if (scaleUp) {
	scaleValue = 1;  	
  }

  if (abs(srcRight - srcLeft) > 0) {
    //note the ratio always need to be scaled, since it will be a fraction
    lRatio = (A_UINT16)((source - srcLeft)*SCALE / (srcRight - srcLeft));
    returnValue = (A_UINT16)((lRatio*targetRight + (SCALE-lRatio)*targetLeft)/scaleValue);
  } 
  else {
	  returnValue = (A_UINT16)(targetLeft*(scaleUp ? SCALE : 1));
  }
  return (returnValue);
}




/**************************************************************************
* getLowerUpperValues - Get 2 values closest to search value in list
*
* Given a search value and a list of values, find the upper and lower values 
* closest to it.If the value is one of the values in the list, or is within 
* a small delta of a value in the list then return the same upper 
* and lower value.  All arithmatic is scaled to avoid floating point.
*
* RETURNS: the upper and lower values
*/
void getLowerUpperValues 
(
 A_UINT16	value,			//value to search for
 A_UINT16	*pList,			//ptr to the list to search
 A_UINT16	listSize,		//number of entries in list
 A_UINT16	*pLowerValue,	//return the lower value
 A_UINT16	*pUpperValue	//return the upper value	
)
{
	A_UINT16	i;
	A_UINT16	listEndValue = *(pList + listSize - 1);
	A_UINT32	target = value * SCALE;

	//see if value is lower than the first value in the list
	//if so return first value
	if (target < (A_UINT32)(*pList * SCALE - DELTA)) {
		*pLowerValue = *pList;
		*pUpperValue = *pList;
		return;
	}
  
	//see if value is greater than last value in list
	//if so return last value
	if (target > (A_UINT32)(listEndValue * SCALE + DELTA)) {
		*pLowerValue = listEndValue;
		*pUpperValue = listEndValue;
		return;
	}

	//look for value being near or between 2 values in list
	for(i = 0; i < listSize; i++) {
		//if value is close to the current value of the list 
		//then target is not between values, it is one of the values
		if (abs(pList[i]*SCALE - target) < DELTA) {
			*pLowerValue = pList[i];
			*pUpperValue = pList[i];
			return;
		}

		//look for value being between current value and next value
		//if so return these 2 values
		if (target < (A_UINT32)(pList[i + 1]*SCALE - DELTA)) {
			*pLowerValue = pList[i];
			*pUpperValue = pList[i + 1];
			return;
		}
	}
} 


/**************************************************************************
* getLeftRightChannels - Get lower and upper channels from source struct.
*
* As above function, except pulls the channel list from the input struct 
*
* RETURNS: the upper and lower channel values
*/
void getLeftRightChannels

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美电影免费观看完整版 | 免费看日韩a级影片| 国产无一区二区| 精品理论电影在线| 欧美电影免费观看高清完整版| 欧美日韩国产三级| 欧美日韩国产综合久久| 在线欧美日韩国产| 欧美日韩一区二区三区视频| 91精品福利在线| 欧美三级日韩在线| 91精品国产一区二区三区香蕉| 欧美午夜精品一区| 制服丝袜激情欧洲亚洲| 欧美一区二区三区不卡| 日韩欧美精品在线| 中文字幕+乱码+中文字幕一区| 国产精品麻豆久久久| 亚洲青青青在线视频| 亚洲欧美日本在线| 99精品视频在线免费观看| 国产麻豆91精品| 久久精品国产亚洲高清剧情介绍 | 91蜜桃免费观看视频| 色香色香欲天天天影视综合网| 色视频成人在线观看免| 欧美一区二区视频在线观看2022 | 韩国在线一区二区| 成人激情综合网站| 欧美偷拍一区二区| 欧美成人bangbros| 亚洲色图视频网| 日韩va亚洲va欧美va久久| 精品一区二区三区影院在线午夜| 国产**成人网毛片九色| 欧美亚洲综合色| 久久久久久久综合色一本| 亚洲天堂a在线| 青青草97国产精品免费观看无弹窗版| 国产剧情av麻豆香蕉精品| 91国偷自产一区二区开放时间 | 精品一区二区免费看| a级精品国产片在线观看| 欧美人体做爰大胆视频| 中文字幕国产一区二区| 偷拍日韩校园综合在线| 丁香婷婷综合激情五月色| 欧美日韩和欧美的一区二区| 国产日韩欧美高清| 国产一区二区三区在线看麻豆| 91网页版在线| 国产亚洲精品bt天堂精选| 亚洲成a人v欧美综合天堂下载| 国产精品羞羞答答xxdd| 9191成人精品久久| 成人欧美一区二区三区| 精品一区二区三区免费视频| 欧美影院午夜播放| 国产精品理论在线观看| 国产一区福利在线| 日韩你懂的在线播放| 亚洲黄色在线视频| 成人免费高清视频| 久久精品夜色噜噜亚洲aⅴ| 日韩精品国产精品| 精品视频免费在线| 一区二区三区四区在线播放 | 亚洲乱码国产乱码精品精可以看| 日日嗨av一区二区三区四区| 日本精品一区二区三区高清| 中文字幕一区二区三区在线播放| 国产乱妇无码大片在线观看| 久久综合五月天婷婷伊人| 日本午夜一本久久久综合| 欧美日韩国产bt| 亚洲一二三四在线| 精品视频在线视频| 日韩黄色一级片| 日韩一区二区高清| 美腿丝袜在线亚洲一区| 欧美一级视频精品观看| 日韩av在线发布| 日韩一级片在线观看| 蜜臀av一区二区| 精品国产成人在线影院| 卡一卡二国产精品 | 欧美日韩亚洲高清一区二区| 亚洲精品免费在线播放| 日本久久电影网| 偷偷要91色婷婷| 日韩精品专区在线影院观看| 久久av中文字幕片| 久久精品视频一区二区| 不卡av在线免费观看| 亚洲欧美激情小说另类| 欧美亚洲综合久久| 久久精品999| 中文字幕亚洲区| 欧美丝袜丝交足nylons| 婷婷久久综合九色综合绿巨人| 日韩午夜激情免费电影| 国产成人亚洲综合a∨婷婷图片| 国产欧美va欧美不卡在线| 91在线观看美女| 日本伊人色综合网| 久久久久久久久99精品| 97久久超碰国产精品电影| 一二三四社区欧美黄| 欧美一区二区黄色| 成人性生交大片免费看在线播放| 亚洲免费电影在线| 日韩一区二区视频| 97超碰欧美中文字幕| 日韩精品亚洲专区| 亚洲欧洲成人自拍| 日韩视频一区二区三区在线播放| 丁香亚洲综合激情啪啪综合| 午夜欧美在线一二页| 国产精品婷婷午夜在线观看| 欧美午夜宅男影院| 成人国产精品视频| 免费人成在线不卡| 亚洲欧美日韩一区二区| 日韩你懂的在线观看| 欧美日韩视频在线观看一区二区三区| 九九九久久久精品| 亚洲超碰97人人做人人爱| 久久久天堂av| 日韩一区二区三区电影| 色妞www精品视频| 国产成人精品影视| 久久成人麻豆午夜电影| 亚洲成人激情综合网| 亚洲免费观看高清| 中文字幕亚洲综合久久菠萝蜜| 精品久久一二三区| 日韩一区二区三区四区| 欧美午夜片在线看| 欧美在线一二三四区| 成人性生交大片免费| 高清视频一区二区| 国产一区二区三区免费观看| 欧美aaaaaa午夜精品| 午夜影院久久久| 欧美电影免费观看高清完整版| 成人黄色综合网站| 麻豆国产精品777777在线| 亚洲电影欧美电影有声小说| 亚洲综合色自拍一区| 亚洲精品菠萝久久久久久久| 1024成人网色www| 中文字幕免费一区| 久久精品欧美一区二区三区不卡 | 不卡在线视频中文字幕| 精品无人区卡一卡二卡三乱码免费卡 | 奇米综合一区二区三区精品视频| 国产精品美女久久久久久久久久久 | 免费美女久久99| 亚洲精品欧美在线| 亚洲婷婷在线视频| 国产精品区一区二区三区| 国产精品美女久久久久久久久久久| 日韩免费高清av| 日韩欧美的一区二区| 欧美剧情片在线观看| 欧美一级片免费看| 欧美一区二区啪啪| 日韩一区二区三| 精品久久国产老人久久综合| 欧美欧美欧美欧美首页| 在线播放亚洲一区| 久久这里只有精品6| 精品电影一区二区三区| 日韩精品综合一本久道在线视频| 9191国产精品| 久久人人97超碰com| 久久久亚洲欧洲日产国码αv| 精品黑人一区二区三区久久| 欧美三级三级三级爽爽爽| 日韩一区国产二区欧美三区| 日韩精品一区国产麻豆| 欧美mv日韩mv国产网站app| 国产精品污www在线观看| 综合久久久久久久| 一区二区三区四区精品在线视频| 亚洲精品国产一区二区三区四区在线 | 亚洲欧美日韩人成在线播放| 亚洲久本草在线中文字幕| 五月天久久比比资源色| 日本伊人色综合网| 国产精品一区二区视频| 国产一区二区伦理| 91久久精品一区二区二区| 91精品国产黑色紧身裤美女| 精品国产污污免费网站入口| 精品国产成人系列| 亚洲色图清纯唯美| 日本欧美韩国一区三区| 日韩一区精品视频| 成人性生交大片免费|