⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 baseband.c

📁 VIA VT6655 x86下的Linux Source Code
💻 C
📖 第 1 页 / 共 5 页
字号:
/*
 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
 * All rights reserved.
 *
 * This software is copyrighted by and is the sole property of
 * VIA Networking Technologies, Inc. This software may only be used
 * in accordance with the corresponding license agreement. Any unauthorized
 * use, duplication, transmission, distribution, or disclosure of this
 * software is expressly forbidden.
 *
 * This software is provided by VIA Networking Technologies, Inc. "as is"
 * and any express or implied warranties, including, but not limited to, the
 * implied warranties of merchantability and fitness for a particular purpose
 * are disclaimed. In no event shall VIA Networking Technologies, Inc.
 * be liable for any direct, indirect, incidental, special, exemplary, or
 * consequential damages. 
 *
 * File: baseband.c
 *
 * Purpose: Implement functions to access baseband
 *
 * Author: Kyle Hsu
 *
 * Date: Aug.22, 2002 
 *
 * Functions:
 *      BBuGetFrameTime        - Calculate data frame transmitting time
 *      BBvCaculateParameter   - Caculate PhyLength, PhyService and Phy Signal parameter for baseband Tx
 *      BBbReadEmbeded         - Embeded read baseband register via MAC
 *      BBbWriteEmbeded        - Embeded write baseband register via MAC
 *      BBbIsRegBitsOn         - Test if baseband register bits on
 *      BBbIsRegBitsOff        - Test if baseband register bits off
 *      BBbVT3253Init          - VIA VT3253 baseband chip init code
 *      BBvReadAllRegs         - Read All Baseband Registers
 *      BBvLoopbackOn          - Turn on BaseBand Loopback mode
 *      BBvLoopbackOff         - Turn off BaseBand Loopback mode
 *
 * Revision History:
 *      06-10-2003 Bryan YC Fan:  Re-write codes to support VT3253 spec.
 *      08-07-2003 Bryan YC Fan:  Add MAXIM2827/2825 and RFMD2959 support.
 *      08-26-2003 Kyle Hsu    :  Modify BBuGetFrameTime() and BBvCaculateParameter().
 *                                cancel the setting of MAC_REG_SOFTPWRCTL on BBbVT3253Init().
 *                                Add the comments.
 *      09-01-2003 Bryan YC Fan:  RF & BB tables updated.
 *                                Modified BBvLoopbackOn & BBvLoopbackOff().
 */ 

#if !defined(__TMACRO_H__)
#include "tmacro.h"
#endif
#if !defined(__TBIT_H__)
#include "tbit.h"
#endif
#if !defined(__TETHER_H__)
#include "tether.h"
#endif
#if !defined(__MAC_H__)
#include "mac.h"
#endif
#if !defined(__BASEBAND_H__)
#include "baseband.h"
#endif
#if !defined(__SROM_H__)
#include "srom.h"
#endif
#if !defined(__UMEM_H__)
#include "umem.h"
#endif
#if !defined(__RF_H__)
#include "rf.h"
#endif

/*---------------------  Static Definitions -------------------------*/
//static int          msglevel                =MSG_LEVEL_DEBUG;
static int          msglevel                =MSG_LEVEL_INFO;
/*---------------------  Static Classes  ----------------------------*/

/*---------------------  Static Variables  --------------------------*/
/*---------------------  Static Functions  --------------------------*/

/*---------------------  Export Variables  --------------------------*/

/*---------------------  Static Definitions -------------------------*/

/*---------------------  Static Classes  ----------------------------*/

/*---------------------  Static Variables  --------------------------*/



#define CB_VT3253_INIT_FOR_RFMD 446
BYTE byVT3253InitTab_RFMD[CB_VT3253_INIT_FOR_RFMD][2] = {
    {0x00, 0x30},
    {0x01, 0x00},
    {0x02, 0x00},
    {0x03, 0x00},
    {0x04, 0x00},
    {0x05, 0x00},
    {0x06, 0x00},
    {0x07, 0x00},
    {0x08, 0x70},
    {0x09, 0x45},
    {0x0a, 0x2a},
    {0x0b, 0x76},
    {0x0c, 0x00},
    {0x0d, 0x01},
    {0x0e, 0x80},
    {0x0f, 0x00},
    {0x10, 0x00},
    {0x11, 0x00},
    {0x12, 0x00},
    {0x13, 0x00},
    {0x14, 0x00},
    {0x15, 0x00},
    {0x16, 0x00},
    {0x17, 0x00},
    {0x18, 0x00},
    {0x19, 0x00},
    {0x1a, 0x00},
    {0x1b, 0x9d},
    {0x1c, 0x05},
    {0x1d, 0x00},
    {0x1e, 0x00},
    {0x1f, 0x00},
    {0x20, 0x00},
    {0x21, 0x00},
    {0x22, 0x00},
    {0x23, 0x00},
    {0x24, 0x00},
    {0x25, 0x4a},
    {0x26, 0x00},
    {0x27, 0x00},
    {0x28, 0x00},
    {0x29, 0x00},
    {0x2a, 0x00},
    {0x2b, 0x00},
    {0x2c, 0x00},
    {0x2d, 0xa8},
    {0x2e, 0x1a},
    {0x2f, 0x0c},
    {0x30, 0x26},
    {0x31, 0x5b},
    {0x32, 0x00},
    {0x33, 0x00},
    {0x34, 0x00},
    {0x35, 0x00},
    {0x36, 0xaa},
    {0x37, 0xaa},
    {0x38, 0xff},
    {0x39, 0xff},
    {0x3a, 0x00},
    {0x3b, 0x00},
    {0x3c, 0x00},
    {0x3d, 0x0d},
    {0x3e, 0x51},
    {0x3f, 0x04},
    {0x40, 0x00},
    {0x41, 0x08},
    {0x42, 0x00},
    {0x43, 0x08},
    {0x44, 0x06},
    {0x45, 0x14},
    {0x46, 0x05},
    {0x47, 0x08},
    {0x48, 0x00},
    {0x49, 0x00},
    {0x4a, 0x00},
    {0x4b, 0x00},
    {0x4c, 0x09},
    {0x4d, 0x80},
    {0x4e, 0x00},
    {0x4f, 0xc5},
    {0x50, 0x14},
    {0x51, 0x19},
    {0x52, 0x00},
    {0x53, 0x00},
    {0x54, 0x00},
    {0x55, 0x00},
    {0x56, 0x00},
    {0x57, 0x00},
    {0x58, 0x00},
    {0x59, 0xb0},
    {0x5a, 0x00},
    {0x5b, 0x00},
    {0x5c, 0x00},
    {0x5d, 0x00},
    {0x5e, 0x00},
    {0x5f, 0x00},
    {0x60, 0x44},
    {0x61, 0x04},
    {0x62, 0x00},
    {0x63, 0x00},
    {0x64, 0x00},
    {0x65, 0x00},
    {0x66, 0x04},
    {0x67, 0xb7},
    {0x68, 0x00},
    {0x69, 0x00},
    {0x6a, 0x00},
    {0x6b, 0x00},
    {0x6c, 0x00},
    {0x6d, 0x03},
    {0x6e, 0x01},
    {0x6f, 0x00},
    {0x70, 0x00},
    {0x71, 0x00},
    {0x72, 0x00},
    {0x73, 0x00},
    {0x74, 0x00},
    {0x75, 0x00},
    {0x76, 0x00},
    {0x77, 0x00},
    {0x78, 0x00},
    {0x79, 0x00},
    {0x7a, 0x00},
    {0x7b, 0x00},
    {0x7c, 0x00},
    {0x7d, 0x00},
    {0x7e, 0x00},
    {0x7f, 0x00},
    {0x80, 0x0b},
    {0x81, 0x00},
    {0x82, 0x3c},
    {0x83, 0x00},
    {0x84, 0x00},
    {0x85, 0x00},
    {0x86, 0x00},
    {0x87, 0x00},
    {0x88, 0x08},
    {0x89, 0x00},
    {0x8a, 0x08},
    {0x8b, 0xa6},
    {0x8c, 0x84},
    {0x8d, 0x47},
    {0x8e, 0xbb},
    {0x8f, 0x02},
    {0x90, 0x21},
    {0x91, 0x0c},
    {0x92, 0x04},
    {0x93, 0x22},
    {0x94, 0x00},
    {0x95, 0x00},
    {0x96, 0x00},
    {0x97, 0xeb},
    {0x98, 0x00},
    {0x99, 0x00},
    {0x9a, 0x00},
    {0x9b, 0x00},
    {0x9c, 0x00},
    {0x9d, 0x00},
    {0x9e, 0x00},
    {0x9f, 0x00},
    {0xa0, 0x00},
    {0xa1, 0x00},
    {0xa2, 0x00},
    {0xa3, 0x00},
    {0xa4, 0x00},
    {0xa5, 0x00},
    {0xa6, 0x10},
    {0xa7, 0x04},
    {0xa8, 0x10},
    {0xa9, 0x00},
    {0xaa, 0x8f},
    {0xab, 0x00},
    {0xac, 0x00},
    {0xad, 0x00},
    {0xae, 0x00},
    {0xaf, 0x80},
    {0xb0, 0x38},
    {0xb1, 0x00},
    {0xb2, 0x00},
    {0xb3, 0x00},
    {0xb4, 0xee},
    {0xb5, 0xff},
    {0xb6, 0x10},
    {0xb7, 0x00},
    {0xb8, 0x00},
    {0xb9, 0x00},
    {0xba, 0x00},
    {0xbb, 0x03},
    {0xbc, 0x00},
    {0xbd, 0x00},
    {0xbe, 0x00},
    {0xbf, 0x00},
    {0xc0, 0x10},
    {0xc1, 0x10},
    {0xc2, 0x18},
    {0xc3, 0x20},
    {0xc4, 0x10},
    {0xc5, 0x00},
    {0xc6, 0x22},
    {0xc7, 0x14},
    {0xc8, 0x0f},
    {0xc9, 0x08},
    {0xca, 0xa4},
    {0xcb, 0xa7},
    {0xcc, 0x3c},
    {0xcd, 0x10},
    {0xce, 0x20},
    {0xcf, 0x00},
    {0xd0, 0x00},
    {0xd1, 0x10},
    {0xd2, 0x00},
    {0xd3, 0x00},
    {0xd4, 0x10},
    {0xd5, 0x33},
    {0xd6, 0x70},
    {0xd7, 0x01},
    {0xd8, 0x00},
    {0xd9, 0x00},
    {0xda, 0x00},
    {0xdb, 0x00},
    {0xdc, 0x00},
    {0xdd, 0x00},
    {0xde, 0x00},
    {0xdf, 0x00},
    {0xe0, 0x00},
    {0xe1, 0x00},
    {0xe2, 0xcc},
    {0xe3, 0x04},
    {0xe4, 0x08},
    {0xe5, 0x10},
    {0xe6, 0x00},
    {0xe7, 0x0e},
    {0xe8, 0x88},
    {0xe9, 0xd4},
    {0xea, 0x05},
    {0xeb, 0xf0},
    {0xec, 0x79},
    {0xed, 0x0f},
    {0xee, 0x04},
    {0xef, 0x04},
    {0xf0, 0x00},
    {0xf1, 0x00},
    {0xf2, 0x00},
    {0xf3, 0x00},
    {0xf4, 0x00},
    {0xf5, 0x00},
    {0xf6, 0x00},
    {0xf7, 0x00},
    {0xf8, 0x00},
    {0xf9, 0x00},
    {0xF0, 0x00},
    {0xF1, 0xF8},
    {0xF0, 0x80},
    {0xF0, 0x00},
    {0xF1, 0xF4},
    {0xF0, 0x81},
    {0xF0, 0x01},
    {0xF1, 0xF0},
    {0xF0, 0x82},
    {0xF0, 0x02},
    {0xF1, 0xEC},
    {0xF0, 0x83},
    {0xF0, 0x03},
    {0xF1, 0xE8},
    {0xF0, 0x84},
    {0xF0, 0x04},
    {0xF1, 0xE4},
    {0xF0, 0x85},
    {0xF0, 0x05},
    {0xF1, 0xE0},
    {0xF0, 0x86},
    {0xF0, 0x06},
    {0xF1, 0xDC},
    {0xF0, 0x87},
    {0xF0, 0x07},
    {0xF1, 0xD8},
    {0xF0, 0x88},
    {0xF0, 0x08},
    {0xF1, 0xD4},
    {0xF0, 0x89},
    {0xF0, 0x09},
    {0xF1, 0xD0},
    {0xF0, 0x8A},
    {0xF0, 0x0A},
    {0xF1, 0xCC},
    {0xF0, 0x8B},
    {0xF0, 0x0B},
    {0xF1, 0xC8},
    {0xF0, 0x8C},
    {0xF0, 0x0C},
    {0xF1, 0xC4},
    {0xF0, 0x8D},
    {0xF0, 0x0D},
    {0xF1, 0xC0},
    {0xF0, 0x8E},
    {0xF0, 0x0E},
    {0xF1, 0xBC},
    {0xF0, 0x8F},
    {0xF0, 0x0F},
    {0xF1, 0xB8},
    {0xF0, 0x90},
    {0xF0, 0x10},
    {0xF1, 0xB4},
    {0xF0, 0x91},
    {0xF0, 0x11},
    {0xF1, 0xB0},
    {0xF0, 0x92},
    {0xF0, 0x12},
    {0xF1, 0xAC},
    {0xF0, 0x93},
    {0xF0, 0x13},
    {0xF1, 0xA8},
    {0xF0, 0x94},
    {0xF0, 0x14},
    {0xF1, 0xA4},
    {0xF0, 0x95},
    {0xF0, 0x15},
    {0xF1, 0xA0},
    {0xF0, 0x96},
    {0xF0, 0x16},
    {0xF1, 0x9C},
    {0xF0, 0x97},
    {0xF0, 0x17},
    {0xF1, 0x98},
    {0xF0, 0x98},
    {0xF0, 0x18},
    {0xF1, 0x94},
    {0xF0, 0x99},
    {0xF0, 0x19},
    {0xF1, 0x90},
    {0xF0, 0x9A},
    {0xF0, 0x1A},
    {0xF1, 0x8C},
    {0xF0, 0x9B},
    {0xF0, 0x1B},
    {0xF1, 0x88},
    {0xF0, 0x9C},
    {0xF0, 0x1C},
    {0xF1, 0x84},
    {0xF0, 0x9D},
    {0xF0, 0x1D},
    {0xF1, 0x80},
    {0xF0, 0x9E},
    {0xF0, 0x1E},
    {0xF1, 0x7C},
    {0xF0, 0x9F},
    {0xF0, 0x1F},
    {0xF1, 0x78},
    {0xF0, 0xA0},
    {0xF0, 0x20},
    {0xF1, 0x74},
    {0xF0, 0xA1},
    {0xF0, 0x21},
    {0xF1, 0x70},
    {0xF0, 0xA2},
    {0xF0, 0x22},
    {0xF1, 0x6C},
    {0xF0, 0xA3},
    {0xF0, 0x23},
    {0xF1, 0x68},
    {0xF0, 0xA4},
    {0xF0, 0x24},
    {0xF1, 0x64},
    {0xF0, 0xA5},
    {0xF0, 0x25},
    {0xF1, 0x60},
    {0xF0, 0xA6},
    {0xF0, 0x26},
    {0xF1, 0x5C},
    {0xF0, 0xA7},
    {0xF0, 0x27},
    {0xF1, 0x58},
    {0xF0, 0xA8},
    {0xF0, 0x28},
    {0xF1, 0x54},
    {0xF0, 0xA9},
    {0xF0, 0x29},
    {0xF1, 0x50},
    {0xF0, 0xAA},
    {0xF0, 0x2A},
    {0xF1, 0x4C},
    {0xF0, 0xAB},
    {0xF0, 0x2B},
    {0xF1, 0x48},
    {0xF0, 0xAC},
    {0xF0, 0x2C},
    {0xF1, 0x44},
    {0xF0, 0xAD},
    {0xF0, 0x2D},
    {0xF1, 0x40},
    {0xF0, 0xAE},
    {0xF0, 0x2E},
    {0xF1, 0x3C},
    {0xF0, 0xAF},
    {0xF0, 0x2F},
    {0xF1, 0x38},
    {0xF0, 0xB0},
    {0xF0, 0x30},
    {0xF1, 0x34},
    {0xF0, 0xB1},
    {0xF0, 0x31},
    {0xF1, 0x30},
    {0xF0, 0xB2},
    {0xF0, 0x32},
    {0xF1, 0x2C},
    {0xF0, 0xB3},
    {0xF0, 0x33},
    {0xF1, 0x28},
    {0xF0, 0xB4},
    {0xF0, 0x34},
    {0xF1, 0x24},
    {0xF0, 0xB5},
    {0xF0, 0x35},
    {0xF1, 0x20},
    {0xF0, 0xB6},
    {0xF0, 0x36},
    {0xF1, 0x1C},
    {0xF0, 0xB7},
    {0xF0, 0x37},
    {0xF1, 0x18},
    {0xF0, 0xB8},
    {0xF0, 0x38},
    {0xF1, 0x14},
    {0xF0, 0xB9},
    {0xF0, 0x39},
    {0xF1, 0x10},
    {0xF0, 0xBA},
    {0xF0, 0x3A},
    {0xF1, 0x0C},
    {0xF0, 0xBB},
    {0xF0, 0x3B},
    {0xF1, 0x08},
    {0xF0, 0x00},
    {0xF0, 0x3C},
    {0xF1, 0x04},
    {0xF0, 0xBD},
    {0xF0, 0x3D},
    {0xF1, 0x00},
    {0xF0, 0xBE},
    {0xF0, 0x3E},
    {0xF1, 0x00},
    {0xF0, 0xBF},
    {0xF0, 0x3F},
    {0xF1, 0x00},
    {0xF0, 0xC0},
    {0xF0, 0x00},
};

#define CB_VT3253B0_INIT_FOR_RFMD 256
BYTE byVT3253B0_RFMD[CB_VT3253B0_INIT_FOR_RFMD][2] = {
    {0x00, 0x31},
    {0x01, 0x00},
    {0x02, 0x00},
    {0x03, 0x00},
    {0x04, 0x00},
    {0x05, 0x81},
    {0x06, 0x00},
    {0x07, 0x00},
    {0x08, 0x38},
    {0x09, 0x45},
    {0x0a, 0x2a},

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -