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

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

?? meeprom.c

?? Atheros AP Test with Agilent N4010A source code
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/* 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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www久久精品| 国产成人亚洲综合a∨婷婷图片| 99久久亚洲一区二区三区青草| 国产精品―色哟哟| 成人免费视频视频在线观看免费| 中文字幕中文字幕在线一区| 色丁香久综合在线久综合在线观看| 亚洲欧美一区二区三区孕妇| 99re成人在线| 午夜精品aaa| 精品国产一区二区三区久久影院 | 国产欧美精品国产国产专区| 成人免费视频免费观看| 亚洲国产美女搞黄色| 日韩一卡二卡三卡四卡| 国产电影一区二区三区| 亚洲精品成人天堂一二三| 欧美日韩dvd在线观看| 国产精品主播直播| 亚洲欧美日韩精品久久久久| 欧美精品久久天天躁| 国内精品在线播放| 中文字幕乱码日本亚洲一区二区| 91亚洲资源网| 麻豆极品一区二区三区| 中文字幕一区二区5566日韩| 欧美久久婷婷综合色| 国产激情91久久精品导航| 一区二区免费在线| 久久精品日产第一区二区三区高清版 | 精品在线免费观看| 1024亚洲合集| 精品精品国产高清a毛片牛牛| 99综合影院在线| 日本亚洲免费观看| 亚洲精选在线视频| 精品国产sm最大网站免费看| 日本韩国欧美在线| 国产乱码精品一品二品| 天天影视色香欲综合网老头| 国产精品乱人伦一区二区| 欧美高清精品3d| 99精品黄色片免费大全| 韩国精品主播一区二区在线观看| 亚洲激情校园春色| 国产女同性恋一区二区| 日韩三级精品电影久久久 | 一区二区三区.www| 久久蜜臀精品av| 在线不卡中文字幕播放| 日本电影欧美片| 国产福利一区二区三区| 看国产成人h片视频| 亚洲一区二区三区中文字幕| 国产精品久久久久9999吃药| 欧美r级在线观看| 欧美日韩成人一区二区| 欧美综合色免费| caoporen国产精品视频| 韩国av一区二区三区四区| 日韩不卡一区二区三区| 天天综合天天综合色| 一个色综合av| 亚洲精品欧美综合四区| 国产精品美女www爽爽爽| 久久综合中文字幕| 精品99久久久久久| 欧美电影精品一区二区| 91精品国产欧美一区二区成人| 欧美综合亚洲图片综合区| 99久久婷婷国产综合精品| 色偷偷一区二区三区| 国产乱码字幕精品高清av| 极品美女销魂一区二区三区| 麻豆91精品91久久久的内涵| 麻豆久久久久久| 看电视剧不卡顿的网站| 韩日欧美一区二区三区| 国产精品一区二区久久精品爱涩 | 日韩成人一区二区| 亚洲一区精品在线| 一区二区三区欧美日| 亚洲精品国产一区二区精华液 | 成av人片一区二区| 99国产精品久| 日本高清成人免费播放| 欧美日韩中字一区| 8v天堂国产在线一区二区| 欧美一区二区网站| 精品国产伦理网| 国产午夜久久久久| 亚洲精品自拍动漫在线| 亚洲成a人片综合在线| 日韩精品高清不卡| 国产一区二区调教| 99久久伊人久久99| 欧美最猛性xxxxx直播| 欧美一区二区免费观在线| 精品国产一区二区三区四区四| 久久九九久久九九| 亚洲男人的天堂网| 日韩综合在线视频| 国产精品综合在线视频| 91视频在线看| 在线成人av网站| 国产蜜臀av在线一区二区三区| 亚洲免费看黄网站| 蜜臀va亚洲va欧美va天堂| 丁香亚洲综合激情啪啪综合| 在线影院国内精品| 2欧美一区二区三区在线观看视频| 欧美国产在线观看| 亚洲午夜在线视频| 国产v综合v亚洲欧| 欧美性受极品xxxx喷水| wwwwxxxxx欧美| 一区二区三区精品在线| 久国产精品韩国三级视频| 99久久精品情趣| 日韩精品一区二区在线| 亚洲欧美经典视频| 久久99日本精品| 色哟哟精品一区| 精品盗摄一区二区三区| 亚洲欧美国产77777| 久久97超碰国产精品超碰| 色婷婷av一区二区三区之一色屋| 日韩午夜精品电影| 一区二区在线看| 国产毛片精品视频| 欧美人体做爰大胆视频| 国产精品另类一区| 久久99精品国产.久久久久久| 色婷婷亚洲综合| 国产午夜精品一区二区三区视频| 视频一区视频二区中文| 色88888久久久久久影院按摩| 亚洲精品一区二区三区影院 | 欧美专区在线观看一区| 久久九九久精品国产免费直播| 水野朝阳av一区二区三区| 波波电影院一区二区三区| 精品国产髙清在线看国产毛片| 亚洲一区二区精品久久av| 国产凹凸在线观看一区二区| 欧美电视剧在线观看完整版| 视频精品一区二区| 一本一道波多野结衣一区二区| 久久精品视频在线免费观看 | 国产欧美一区二区三区沐欲| 免费成人在线视频观看| 欧美日韩国产首页在线观看| 亚洲精品一卡二卡| 91丨porny丨在线| 国产精品伦理在线| 丁香啪啪综合成人亚洲小说 | av欧美精品.com| 国产欧美日韩综合| 男女男精品视频网| 欧美一区二区三区日韩| 亚洲gay无套男同| 欧洲色大大久久| 一区二区三区免费| 精品视频一区二区三区免费| 亚洲欧美日韩国产另类专区| 色婷婷综合久久久中文字幕| 国产精品白丝在线| 97久久精品人人澡人人爽| 中文字幕在线不卡| 国产不卡一区视频| 国产精品免费久久久久| 不卡电影一区二区三区| 综合久久久久综合| 欧洲一区在线观看| 亚洲图片欧美色图| 欧美日韩免费电影| 日韩影院精彩在线| 欧美成人激情免费网| 国产精品一区二区在线播放 | 欧美电视剧免费全集观看 | av网站一区二区三区| 亚洲女爱视频在线| 欧美日韩国产中文| 另类小说欧美激情| 国产视频一区不卡| 色天天综合色天天久久| 天天色天天操综合| 欧美一级日韩免费不卡| 国产在线国偷精品免费看| 国产精品网曝门| 在线观看www91| 日韩精品1区2区3区| 26uuuu精品一区二区| av网站一区二区三区| 首页亚洲欧美制服丝腿| 日韩精品中文字幕一区 | 91蜜桃网址入口| 日韩一区精品字幕| 欧美国产一区二区| 欧美色图激情小说|