// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* File: baseband.c
*
* Purpose: Implement functions to access baseband
*
* Author: Jerry Chen
*
* Date: Jun. 5, 2002
*
* Functions:
* vnt_get_frame_time - Calculate data frame transmitting time
* vnt_get_phy_field - Calculate PhyLength, PhyService and Phy
* Signal parameter for baseband Tx
* vnt_vt3184_init - VIA VT3184 baseband chip init code
*
* Revision History:
*
*
*/
#include "mac.h"
#include "baseband.h"
#include "rf.h"
#include "usbpipe.h"
static u8 vnt_vt3184_agc[] = {
0x00, 0x00, 0x02, 0x02, 0x04, 0x04, 0x06, 0x06,
0x08, 0x08, 0x0a, 0x0a, 0x0c, 0x0c, 0x0e, 0x0e, /* 0x0f */
0x10, 0x10, 0x12, 0x12, 0x14, 0x14, 0x16, 0x16,
0x18, 0x18, 0x1a, 0x1a, 0x1c, 0x1c, 0x1e, 0x1e, /* 0x1f */
0x20, 0x20, 0x22, 0x22, 0x24, 0x24, 0x26, 0x26,
0x28, 0x28, 0x2a, 0x2a, 0x2c, 0x2c, 0x2e, 0x2e, /* 0x2f */
0x30, 0x30, 0x32, 0x32, 0x34, 0x34, 0x36, 0x36,
0x38, 0x38, 0x3a, 0x3a, 0x3c, 0x3c, 0x3e, 0x3e /* 0x3f */
};
static u8 vnt_vt3184_al2230[] = {
0x31, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x70, 0x45, 0x2a, 0x76, 0x00, 0x00, 0x80, 0x00, /* 0x0f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x8e, 0x0a, 0x00, 0x00, 0x00, /* 0x1f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x0c, /* 0x2f */
0x26, 0x5b, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa,
0xff, 0xff, 0x79, 0x00, 0x00, 0x0b, 0x48, 0x04, /* 0x3f */
0x00, 0x08, 0x00, 0x08, 0x08, 0x14, 0x05, 0x09,
0x00, 0x00, 0x00, 0x00, 0x09, 0x73, 0x00, 0xc5, /* 0x4f */
0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5f */
0xe4, 0x80, 0x00, 0x00, 0x00, 0x00, 0x98, 0x0a,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, /* 0x6f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7f */
0x8c, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x1f, 0xb7, 0x88, 0x47, 0xaa, 0x00, /* 0x8f */
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xeb,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* 0x9f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
0x18, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x18, /* 0xaf */
0x38, 0x30, 0x00, 0x00, 0xff, 0x0f, 0xe4, 0xe2,
0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x00, /* 0xbf */
0x18, 0x20, 0x07, 0x18, 0xff, 0xff, 0x0e, 0x0a,
0x0e, 0x00, 0x82, 0xa7, 0x3c, 0x10, 0x30, 0x05, /* 0xcf */
0x40, 0x12, 0x00, 0x00, 0x10, 0x28, 0x80, 0x2a,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xdf */
0x00, 0xf3, 0x00, 0x00, 0x00, 0x10, 0x00, 0x12,
0x00, 0xf4, 0x00, 0xff, 0x79, 0x20, 0x30, 0x05, /* 0xef */
0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* 0xff */