15449c685a4b39534f18869a93896370224463715Forest Bond/*
25449c685a4b39534f18869a93896370224463715Forest Bond * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
35449c685a4b39534f18869a93896370224463715Forest Bond * All rights reserved.
45449c685a4b39534f18869a93896370224463715Forest Bond *
55449c685a4b39534f18869a93896370224463715Forest Bond * This program is free software; you can redistribute it and/or modify
65449c685a4b39534f18869a93896370224463715Forest Bond * it under the terms of the GNU General Public License as published by
75449c685a4b39534f18869a93896370224463715Forest Bond * the Free Software Foundation; either version 2 of the License, or
85449c685a4b39534f18869a93896370224463715Forest Bond * (at your option) any later version.
95449c685a4b39534f18869a93896370224463715Forest Bond *
105449c685a4b39534f18869a93896370224463715Forest Bond * This program is distributed in the hope that it will be useful,
115449c685a4b39534f18869a93896370224463715Forest Bond * but WITHOUT ANY WARRANTY; without even the implied warranty of
125449c685a4b39534f18869a93896370224463715Forest Bond * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
135449c685a4b39534f18869a93896370224463715Forest Bond * GNU General Public License for more details.
145449c685a4b39534f18869a93896370224463715Forest Bond *
155449c685a4b39534f18869a93896370224463715Forest Bond * You should have received a copy of the GNU General Public License along
165449c685a4b39534f18869a93896370224463715Forest Bond * with this program; if not, write to the Free Software Foundation, Inc.,
175449c685a4b39534f18869a93896370224463715Forest Bond * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
185449c685a4b39534f18869a93896370224463715Forest Bond *
195449c685a4b39534f18869a93896370224463715Forest Bond *
205449c685a4b39534f18869a93896370224463715Forest Bond * File: rf.c
215449c685a4b39534f18869a93896370224463715Forest Bond *
225449c685a4b39534f18869a93896370224463715Forest Bond * Purpose: rf function code
235449c685a4b39534f18869a93896370224463715Forest Bond *
245449c685a4b39534f18869a93896370224463715Forest Bond * Author: Jerry Chen
255449c685a4b39534f18869a93896370224463715Forest Bond *
265449c685a4b39534f18869a93896370224463715Forest Bond * Date: Feb. 19, 2004
275449c685a4b39534f18869a93896370224463715Forest Bond *
285449c685a4b39534f18869a93896370224463715Forest Bond * Functions:
29623b2b39c9ca172364d94baad650f735f497ca89Justin P. Mattock *      IFRFbWriteEmbedded      - Embedded write RF register via MAC
305449c685a4b39534f18869a93896370224463715Forest Bond *
315449c685a4b39534f18869a93896370224463715Forest Bond * Revision History:
325449c685a4b39534f18869a93896370224463715Forest Bond *
335449c685a4b39534f18869a93896370224463715Forest Bond */
34612822f5dd1638de442cf50eb9da54632fba0e66Jim Lieb
355449c685a4b39534f18869a93896370224463715Forest Bond#include "mac.h"
365449c685a4b39534f18869a93896370224463715Forest Bond#include "srom.h"
375449c685a4b39534f18869a93896370224463715Forest Bond#include "rf.h"
385449c685a4b39534f18869a93896370224463715Forest Bond#include "baseband.h"
395449c685a4b39534f18869a93896370224463715Forest Bond
405449c685a4b39534f18869a93896370224463715Forest Bond/*---------------------  Static Definitions -------------------------*/
415449c685a4b39534f18869a93896370224463715Forest Bond
425449c685a4b39534f18869a93896370224463715Forest Bond#define BY_AL2230_REG_LEN     23 //24bit
435449c685a4b39534f18869a93896370224463715Forest Bond#define CB_AL2230_INIT_SEQ    15
445449c685a4b39534f18869a93896370224463715Forest Bond#define SWITCH_CHANNEL_DELAY_AL2230 200 //us
455449c685a4b39534f18869a93896370224463715Forest Bond#define AL2230_PWR_IDX_LEN    64
465449c685a4b39534f18869a93896370224463715Forest Bond
475449c685a4b39534f18869a93896370224463715Forest Bond#define BY_AL7230_REG_LEN     23 //24bit
485449c685a4b39534f18869a93896370224463715Forest Bond#define CB_AL7230_INIT_SEQ    16
495449c685a4b39534f18869a93896370224463715Forest Bond#define SWITCH_CHANNEL_DELAY_AL7230 200 //us
505449c685a4b39534f18869a93896370224463715Forest Bond#define AL7230_PWR_IDX_LEN    64
515449c685a4b39534f18869a93896370224463715Forest Bond
525449c685a4b39534f18869a93896370224463715Forest Bond/*---------------------  Static Classes  ----------------------------*/
535449c685a4b39534f18869a93896370224463715Forest Bond
545449c685a4b39534f18869a93896370224463715Forest Bond/*---------------------  Static Variables  --------------------------*/
555449c685a4b39534f18869a93896370224463715Forest Bond
565da5804b9c4b1cae43eb3034465366bfd3aca597Rashika Kheriastatic const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = {
573bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
583bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
593bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x01A00200+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
603bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00FFF300+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
613bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
623bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0F4DC500+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
633bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0805B600+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
643bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0146C700+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
653bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00068800+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
663bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0403B900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
673bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00DBBA00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
683bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00099B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, //
693bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0BDFFC00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
703bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000D00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
713bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00580F00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW
723bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches};
735449c685a4b39534f18869a93896370224463715Forest Bond
745da5804b9c4b1cae43eb3034465366bfd3aca597Rashika Kheriastatic const unsigned long dwAL2230ChannelTable0[CB_MAX_CHANNEL] = {
753bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz
763bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz
773bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03E79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz
783bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03E79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 4, Tf = 2427MHz
793bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03F7A000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 5, Tf = 2432MHz
803bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03F7A000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 6, Tf = 2437MHz
813bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03E7A000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 7, Tf = 2442MHz
823bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03E7A000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 8, Tf = 2447MHz
833bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03F7B000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 9, Tf = 2452MHz
843bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03F7B000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 10, Tf = 2457MHz
853bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03E7B000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 11, Tf = 2462MHz
863bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03E7B000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 12, Tf = 2467MHz
873bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03F7C000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 13, Tf = 2472MHz
883bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03E7C000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW  // channel = 14, Tf = 2412M
893bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches};
905449c685a4b39534f18869a93896370224463715Forest Bond
915da5804b9c4b1cae43eb3034465366bfd3aca597Rashika Kheriastatic const unsigned long dwAL2230ChannelTable1[CB_MAX_CHANNEL] = {
923bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz
933bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0B333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz
943bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz
953bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0B333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 4, Tf = 2427MHz
963bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 5, Tf = 2432MHz
973bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0B333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 6, Tf = 2437MHz
983bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 7, Tf = 2442MHz
993bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0B333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 8, Tf = 2447MHz
1003bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 9, Tf = 2452MHz
1013bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0B333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 10, Tf = 2457MHz
1023bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 11, Tf = 2462MHz
1033bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0B333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 12, Tf = 2467MHz
1043bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 13, Tf = 2472MHz
1053bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x06666100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW  // channel = 14, Tf = 2412M
1063bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches};
1075449c685a4b39534f18869a93896370224463715Forest Bond
1085da5804b9c4b1cae43eb3034465366bfd3aca597Rashika Kheriastatic unsigned long dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = {
1093bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04040900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1103bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04041900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1113bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04042900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1123bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04043900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1133bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04044900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1143bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04045900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1153bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04046900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1163bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04047900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1173bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04048900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1183bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04049900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1193bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0404A900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1203bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0404B900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1213bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0404C900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1223bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0404D900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1233bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0404E900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1243bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0404F900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1253bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04050900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1263bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04051900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1273bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04052900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1283bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04053900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1293bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04054900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1303bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04055900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1313bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04056900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1323bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04057900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1333bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04058900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1343bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04059900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1353bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0405A900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1363bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0405B900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1373bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0405C900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1383bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0405D900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1393bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0405E900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1403bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0405F900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1413bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04060900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1423bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04061900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1433bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04062900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1443bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04063900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1453bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04064900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1463bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04065900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1473bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04066900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1483bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04067900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1493bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04068900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1503bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04069900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1513bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0406A900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1523bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0406B900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1533bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0406C900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1543bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0406D900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1553bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0406E900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1563bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0406F900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1573bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04070900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1583bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04071900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1593bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04072900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1603bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04073900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1613bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04074900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1623bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04075900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1633bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04076900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1643bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04077900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1653bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04078900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1663bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x04079900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1673bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0407A900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1683bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0407B900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1693bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0407C900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1703bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0407D900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1713bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0407E900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW,
1723bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0407F900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW
1733bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches};
1745449c685a4b39534f18869a93896370224463715Forest Bond
1755449c685a4b39534f18869a93896370224463715Forest Bond//{{ RobertYu:20050104
1765449c685a4b39534f18869a93896370224463715Forest Bond// 40MHz reference frequency
1775449c685a4b39534f18869a93896370224463715Forest Bond// Need to Pull PLLON(PE3) low when writing channel registers through 3-wire.
1785da5804b9c4b1cae43eb3034465366bfd3aca597Rashika Kheriastatic const unsigned long dwAL7230InitTable[CB_AL7230_INIT_SEQ] = {
1793bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel1 // Need modify for 11a
1803bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel1 // Need modify for 11a
1813bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x841FF200+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11a: 451FE2
1823bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x3FDFA300+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11a: 5FDFA3
1833bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // 11b/g    // Need modify for 11a
1843bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// RoberYu:20050113, Rev0.47 Regsiter Setting Guide
1853bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x802B5500+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11a: 8D1B55
1863bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x56AF3600+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW,
1873bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0xCE020700+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11a: 860207
1883bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x6EBC0800+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW,
1893bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x221BB900+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW,
1903bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0xE0000A00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11a: E0600A
1913bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x08031B00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // init 0x080B1B00 => 0x080F1B00 for 3 wire control TxGain(D10)
1923bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// RoberYu:20050113, Rev0.47 Regsiter Setting Guide
1933bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x000A3C00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11a: 00143C
1943bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0xFFFFFD00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW,
1953bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000E00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW,
1963bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x1ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW  // Need modify for 11a: 12BACF
1973bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches};
1985449c685a4b39534f18869a93896370224463715Forest Bond
1995da5804b9c4b1cae43eb3034465366bfd3aca597Rashika Kheriastatic const unsigned long dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = {
2003bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF52000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel184 // Need modify for 11b/g
2013bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel184 // Need modify for 11b/g
2023bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x451FE200+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11b/g
2033bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x5FDFA300+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11b/g
2043bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x67F78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // 11a    // Need modify for 11b/g
2053bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x853F5500+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11b/g, RoberYu:20050113
2063bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x56AF3600+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW,
2073bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0xCE020700+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11b/g
2083bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x6EBC0800+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW,
2093bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x221BB900+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW,
2103bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0xE0600A00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11b/g
2113bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x08031B00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // init 0x080B1B00 => 0x080F1B00 for 3 wire control TxGain(D10)
2123bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00147C00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11b/g
2133bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0xFFFFFD00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW,
2143bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000E00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW,
2153bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x12BACF00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW  // Need modify for 11b/g
2163bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches};
2175449c685a4b39534f18869a93896370224463715Forest Bond
2185da5804b9c4b1cae43eb3034465366bfd3aca597Rashika Kheriastatic const unsigned long dwAL7230ChannelTable0[CB_MAX_CHANNEL] = {
2193bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  1, Tf = 2412MHz
2203bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  2, Tf = 2417MHz
2213bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  3, Tf = 2422MHz
2223bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  4, Tf = 2427MHz
2233bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0037A000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  5, Tf = 2432MHz
2243bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0037A000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  6, Tf = 2437MHz
2253bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0037A000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  7, Tf = 2442MHz
2263bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0037A000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  8, Tf = 2447MHz //RobertYu: 20050218, update for APNode 0.49
2273bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0037B000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  9, Tf = 2452MHz //RobertYu: 20050218, update for APNode 0.49
2283bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0037B000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 10, Tf = 2457MHz //RobertYu: 20050218, update for APNode 0.49
2293bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0037B000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 11, Tf = 2462MHz //RobertYu: 20050218, update for APNode 0.49
2303bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0037B000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 12, Tf = 2467MHz //RobertYu: 20050218, update for APNode 0.49
2313bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0037C000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 13, Tf = 2472MHz //RobertYu: 20050218, update for APNode 0.49
2323bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0037C000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 14, Tf = 2484MHz
2333bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
2343bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// 4.9G => Ch 183, 184, 185, 187, 188, 189, 192, 196  (Value:15 ~ 22)
2353bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF52000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 183, Tf = 4915MHz (15)
2363bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF52000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 184, Tf = 4920MHz (16)
2373bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF52000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 185, Tf = 4925MHz (17)
2383bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF52000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 187, Tf = 4935MHz (18)
2393bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF52000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 188, Tf = 4940MHz (19)
2403bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF52000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 189, Tf = 4945MHz (20)
2413bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF53000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 192, Tf = 4960MHz (21)
2423bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF53000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 196, Tf = 4980MHz (22)
2433bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
2443bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// 5G => Ch 7, 8, 9, 11, 12, 16, 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64,
2453bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165  (Value 23 ~ 56)
2463bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
2473bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF54000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =   7, Tf = 5035MHz (23)
2483bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF54000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =   8, Tf = 5040MHz (24)
2493bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF54000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =   9, Tf = 5045MHz (25)
2503bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF54000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  11, Tf = 5055MHz (26)
2513bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF54000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  12, Tf = 5060MHz (27)
2523bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF55000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  16, Tf = 5080MHz (28)
2533bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF56000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  34, Tf = 5170MHz (29)
2543bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF56000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  36, Tf = 5180MHz (30)
2553bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF57000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  38, Tf = 5190MHz (31) //RobertYu: 20050218, update for APNode 0.49
2563bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF57000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  40, Tf = 5200MHz (32)
2573bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF57000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  42, Tf = 5210MHz (33)
2583bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF57000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  44, Tf = 5220MHz (34)
2593bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF57000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  46, Tf = 5230MHz (35)
2603bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF57000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  48, Tf = 5240MHz (36)
2613bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF58000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  52, Tf = 5260MHz (37)
2623bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF58000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  56, Tf = 5280MHz (38)
2633bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF58000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  60, Tf = 5300MHz (39)
2643bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF59000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  64, Tf = 5320MHz (40)
2653bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
2663bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5C000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 100, Tf = 5500MHz (41)
2673bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5C000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 104, Tf = 5520MHz (42)
2683bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5C000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 108, Tf = 5540MHz (43)
2693bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5D000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 112, Tf = 5560MHz (44)
2703bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5D000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 116, Tf = 5580MHz (45)
2713bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5D000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 120, Tf = 5600MHz (46)
2723bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5E000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 124, Tf = 5620MHz (47)
2733bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5E000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 128, Tf = 5640MHz (48)
2743bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5E000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 132, Tf = 5660MHz (49)
2753bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5F000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 136, Tf = 5680MHz (50)
2763bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF5F000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 140, Tf = 5700MHz (51)
2773bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF60000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 149, Tf = 5745MHz (52)
2783bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF60000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 153, Tf = 5765MHz (53)
2793bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF60000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 157, Tf = 5785MHz (54)
2803bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF61000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 161, Tf = 5805MHz (55)
2813bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0FF61000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW  // channel = 165, Tf = 5825MHz (56)
2823bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches};
2835449c685a4b39534f18869a93896370224463715Forest Bond
2845da5804b9c4b1cae43eb3034465366bfd3aca597Rashika Kheriastatic const unsigned long dwAL7230ChannelTable1[CB_MAX_CHANNEL] = {
2853bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  1, Tf = 2412MHz
2863bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x1B333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  2, Tf = 2417MHz
2873bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  3, Tf = 2422MHz
2883bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0B333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  4, Tf = 2427MHz
2893bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  5, Tf = 2432MHz
2903bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x1B333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  6, Tf = 2437MHz
2913bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  7, Tf = 2442MHz
2923bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0B333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  8, Tf = 2447MHz
2933bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  9, Tf = 2452MHz
2943bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x1B333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 10, Tf = 2457MHz
2953bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x03333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 11, Tf = 2462MHz
2963bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0B333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 12, Tf = 2467MHz
2973bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 13, Tf = 2472MHz
2983bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x06666100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 14, Tf = 2484MHz
2993bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
3003bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// 4.9G => Ch 183, 184, 185, 187, 188, 189, 192, 196  (Value:15 ~ 22)
3013bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x1D555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 183, Tf = 4915MHz (15)
3023bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 184, Tf = 4920MHz (16)
3033bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x02AAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 185, Tf = 4925MHz (17)
3043bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x08000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 187, Tf = 4935MHz (18)
3053bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0AAAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 188, Tf = 4940MHz (19)
3063bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0D555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 189, Tf = 4945MHz (20)
3073bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x15555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 192, Tf = 4960MHz (21)
3083bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 196, Tf = 4980MHz (22)
3093bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
3103bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// 5G => Ch 7, 8, 9, 11, 12, 16, 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64,
3113bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165  (Value 23 ~ 56)
3123bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x1D555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =   7, Tf = 5035MHz (23)
3133bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =   8, Tf = 5040MHz (24)
3143bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x02AAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =   9, Tf = 5045MHz (25)
3153bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x08000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  11, Tf = 5055MHz (26)
3163bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0AAAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  12, Tf = 5060MHz (27)
3173bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x15555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  16, Tf = 5080MHz (28)
3183bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x05555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  34, Tf = 5170MHz (29)
3193bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0AAAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  36, Tf = 5180MHz (30)
3203bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x10000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  38, Tf = 5190MHz (31)
3213bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x15555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  40, Tf = 5200MHz (32)
3223bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x1AAAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  42, Tf = 5210MHz (33)
3233bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  44, Tf = 5220MHz (34)
3243bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x05555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  46, Tf = 5230MHz (35)
3253bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0AAAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  48, Tf = 5240MHz (36)
3263bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x15555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  52, Tf = 5260MHz (37)
3273bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  56, Tf = 5280MHz (38)
3283bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0AAAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  60, Tf = 5300MHz (39)
3293bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x15555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  64, Tf = 5320MHz (40)
3303bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x15555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 100, Tf = 5500MHz (41)
3313bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 104, Tf = 5520MHz (42)
3323bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0AAAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 108, Tf = 5540MHz (43)
3333bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x15555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 112, Tf = 5560MHz (44)
3343bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 116, Tf = 5580MHz (45)
3353bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0AAAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 120, Tf = 5600MHz (46)
3363bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x15555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 124, Tf = 5620MHz (47)
3373bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 128, Tf = 5640MHz (48)
3383bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0AAAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 132, Tf = 5660MHz (49)
3393bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x15555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 136, Tf = 5680MHz (50)
3403bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 140, Tf = 5700MHz (51)
3413bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x18000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 149, Tf = 5745MHz (52)
3423bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x02AAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 153, Tf = 5765MHz (53)
3433bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x0D555100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 157, Tf = 5785MHz (54)
3443bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x18000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 161, Tf = 5805MHz (55)
3453bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x02AAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW  // channel = 165, Tf = 5825MHz (56)
3463bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches};
3475449c685a4b39534f18869a93896370224463715Forest Bond
3485da5804b9c4b1cae43eb3034465366bfd3aca597Rashika Kheriastatic const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = {
3493bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  1, Tf = 2412MHz
3503bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  2, Tf = 2417MHz
3513bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  3, Tf = 2422MHz
3523bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  4, Tf = 2427MHz
3533bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  5, Tf = 2432MHz
3543bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  6, Tf = 2437MHz
3553bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  7, Tf = 2442MHz
3563bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  8, Tf = 2447MHz
3573bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  9, Tf = 2452MHz
3583bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 10, Tf = 2457MHz
3593bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 11, Tf = 2462MHz
3603bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 12, Tf = 2467MHz
3613bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 13, Tf = 2472MHz
3623bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 14, Tf = 2484MHz
3633bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
3643bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// 4.9G => Ch 183, 184, 185, 187, 188, 189, 192, 196  (Value:15 ~ 22)
3653bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 183, Tf = 4915MHz (15)
3663bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x67D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 184, Tf = 4920MHz (16)
3673bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 185, Tf = 4925MHz (17)
3683bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 187, Tf = 4935MHz (18)
3693bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 188, Tf = 4940MHz (19)
3703bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 189, Tf = 4945MHz (20)
3713bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 192, Tf = 4960MHz (21)
3723bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x67D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 196, Tf = 4980MHz (22)
3733bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
3743bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// 5G => Ch 7, 8, 9, 11, 12, 16, 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64,
3753bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165  (Value 23 ~ 56)
3763bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =   7, Tf = 5035MHz (23)
3773bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x67D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =   8, Tf = 5040MHz (24)
3783bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =   9, Tf = 5045MHz (25)
3793bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  11, Tf = 5055MHz (26)
3803bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  12, Tf = 5060MHz (27)
3813bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  16, Tf = 5080MHz (28)
3823bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  34, Tf = 5170MHz (29)
3833bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  36, Tf = 5180MHz (30)
3843bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  38, Tf = 5190MHz (31)
3853bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  40, Tf = 5200MHz (32)
3863bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  42, Tf = 5210MHz (33)
3873bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x67D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  44, Tf = 5220MHz (34)
3883bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  46, Tf = 5230MHz (35)
3893bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  48, Tf = 5240MHz (36)
3903bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  52, Tf = 5260MHz (37)
3913bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x67D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  56, Tf = 5280MHz (38)
3923bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  60, Tf = 5300MHz (39)
3933bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel =  64, Tf = 5320MHz (40)
3943bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 100, Tf = 5500MHz (41)
3953bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x67D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 104, Tf = 5520MHz (42)
3963bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 108, Tf = 5540MHz (43)
3973bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 112, Tf = 5560MHz (44)
3983bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x67D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 116, Tf = 5580MHz (45)
3993bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 120, Tf = 5600MHz (46)
4003bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 124, Tf = 5620MHz (47)
4013bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x67D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 128, Tf = 5640MHz (48)
4023bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 132, Tf = 5660MHz (49)
4033bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 136, Tf = 5680MHz (50)
4043bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x67D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 140, Tf = 5700MHz (51)
4053bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 149, Tf = 5745MHz (52)
4063bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 153, Tf = 5765MHz (53)
4073bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 157, Tf = 5785MHz (54)
4083bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 161, Tf = 5805MHz (55)
4093bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	0x77D78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW  // channel = 165, Tf = 5825MHz (56)
4103bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches};
4115449c685a4b39534f18869a93896370224463715Forest Bond//}} RobertYu
4125449c685a4b39534f18869a93896370224463715Forest Bond
4135449c685a4b39534f18869a93896370224463715Forest Bond/*---------------------  Static Functions  --------------------------*/
4145449c685a4b39534f18869a93896370224463715Forest Bond
4155449c685a4b39534f18869a93896370224463715Forest Bond/*
4165449c685a4b39534f18869a93896370224463715Forest Bond * Description: AIROHA IFRF chip init function
4175449c685a4b39534f18869a93896370224463715Forest Bond *
4185449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
4195449c685a4b39534f18869a93896370224463715Forest Bond *  In:
4205449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
4215449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
4225449c685a4b39534f18869a93896370224463715Forest Bond *      none
4235449c685a4b39534f18869a93896370224463715Forest Bond *
4245a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
4255449c685a4b39534f18869a93896370224463715Forest Bond *
4265449c685a4b39534f18869a93896370224463715Forest Bond */
4271683440595ea33cc019fb8524b04319cf82bc6acGuillaume Clementstatic bool s_bAL7230Init(void __iomem *dwIoBase)
4285449c685a4b39534f18869a93896370224463715Forest Bond{
4293bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	int     ii;
4303bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bool bResult;
4315449c685a4b39534f18869a93896370224463715Forest Bond
4323bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult = true;
4335449c685a4b39534f18869a93896370224463715Forest Bond
4343bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	//3-wire control for normal mode
4353bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	VNSvOutPortB(dwIoBase + MAC_REG_SOFTPWRCTL, 0);
4365449c685a4b39534f18869a93896370224463715Forest Bond
4373bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPECTI  |
4383bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches							 SOFTPWRCTL_TXPEINV));
4393bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	BBvPowerSaveModeOFF(dwIoBase); //RobertYu:20050106, have DC value for Calibration
4405449c685a4b39534f18869a93896370224463715Forest Bond
4413bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++)
4423bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[ii]);
4435449c685a4b39534f18869a93896370224463715Forest Bond
4443bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// PLL On
4453bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
4465449c685a4b39534f18869a93896370224463715Forest Bond
4473bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	//Calibration
4483bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvTimer0MicroSDelay(dwIoBase, 150);//150us
4493bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, (0x9ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW)); //TXDCOC:active, RCK:disable
4503bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvTimer0MicroSDelay(dwIoBase, 30);//30us
4513bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, (0x3ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW)); //TXDCOC:disable, RCK:active
4523bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvTimer0MicroSDelay(dwIoBase, 30);//30us
4533bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[CB_AL7230_INIT_SEQ-1]); //TXDCOC:disable, RCK:disable
4545449c685a4b39534f18869a93896370224463715Forest Bond
4553bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE3    |
4563bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches							 SOFTPWRCTL_SWPE2    |
4573bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches							 SOFTPWRCTL_SWPECTI  |
4583bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches							 SOFTPWRCTL_TXPEINV));
4595449c685a4b39534f18869a93896370224463715Forest Bond
4603bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	BBvPowerSaveModeON(dwIoBase); // RobertYu:20050106
4615449c685a4b39534f18869a93896370224463715Forest Bond
4623bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// PE1: TX_ON, PE2: RX_ON, PE3: PLLON
4633bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	//3-wire control for power saving mode
4643bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	VNSvOutPortB(dwIoBase + MAC_REG_PSPWRSIG, (PSSIG_WPE3 | PSSIG_WPE2)); //1100 0000
4655449c685a4b39534f18869a93896370224463715Forest Bond
4663bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return bResult;
4675449c685a4b39534f18869a93896370224463715Forest Bond}
4685449c685a4b39534f18869a93896370224463715Forest Bond
4695449c685a4b39534f18869a93896370224463715Forest Bond// Need to Pull PLLON low when writing channel registers through 3-wire interface
4701683440595ea33cc019fb8524b04319cf82bc6acGuillaume Clementstatic bool s_bAL7230SelectChannel(void __iomem *dwIoBase, unsigned char byChannel)
4715449c685a4b39534f18869a93896370224463715Forest Bond{
4723bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bool bResult;
4735449c685a4b39534f18869a93896370224463715Forest Bond
4743bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult = true;
4755449c685a4b39534f18869a93896370224463715Forest Bond
4763bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// PLLON Off
4773bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
4785449c685a4b39534f18869a93896370224463715Forest Bond
4793bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230ChannelTable0[byChannel - 1]); //Reg0
4803bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230ChannelTable1[byChannel - 1]); //Reg1
4813bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230ChannelTable2[byChannel - 1]); //Reg4
4825449c685a4b39534f18869a93896370224463715Forest Bond
4833bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// PLLOn On
4843bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
4855449c685a4b39534f18869a93896370224463715Forest Bond
4863bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// Set Channel[7] = 0 to tell H/W channel is changing now.
4873bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel & 0x7F));
4883bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvTimer0MicroSDelay(dwIoBase, SWITCH_CHANNEL_DELAY_AL7230);
4893bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// Set Channel[7] = 1 to tell H/W channel change is done.
4903bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel | 0x80));
4915449c685a4b39534f18869a93896370224463715Forest Bond
4923bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return bResult;
4935449c685a4b39534f18869a93896370224463715Forest Bond}
4945449c685a4b39534f18869a93896370224463715Forest Bond
4955449c685a4b39534f18869a93896370224463715Forest Bond/*
4965449c685a4b39534f18869a93896370224463715Forest Bond * Description: Select channel with UW2452 chip
4975449c685a4b39534f18869a93896370224463715Forest Bond *
4985449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
4995449c685a4b39534f18869a93896370224463715Forest Bond *  In:
5005449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
5015449c685a4b39534f18869a93896370224463715Forest Bond *      uChannel    - Channel number
5025449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
5035449c685a4b39534f18869a93896370224463715Forest Bond *      none
5045449c685a4b39534f18869a93896370224463715Forest Bond *
5055a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
5065449c685a4b39534f18869a93896370224463715Forest Bond *
5075449c685a4b39534f18869a93896370224463715Forest Bond */
5085449c685a4b39534f18869a93896370224463715Forest Bond
5095449c685a4b39534f18869a93896370224463715Forest Bond//{{ RobertYu: 20041210
5105449c685a4b39534f18869a93896370224463715Forest Bond/*
5115449c685a4b39534f18869a93896370224463715Forest Bond * Description: UW2452 IFRF chip init function
5125449c685a4b39534f18869a93896370224463715Forest Bond *
5135449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
5145449c685a4b39534f18869a93896370224463715Forest Bond *  In:
5155449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
5165449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
5175449c685a4b39534f18869a93896370224463715Forest Bond *      none
5185449c685a4b39534f18869a93896370224463715Forest Bond *
5195a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
5205449c685a4b39534f18869a93896370224463715Forest Bond *
5215449c685a4b39534f18869a93896370224463715Forest Bond */
5225449c685a4b39534f18869a93896370224463715Forest Bond
5235449c685a4b39534f18869a93896370224463715Forest Bond//}} RobertYu
5245449c685a4b39534f18869a93896370224463715Forest Bond////////////////////////////////////////////////////////////////////////////////
5255449c685a4b39534f18869a93896370224463715Forest Bond
5265449c685a4b39534f18869a93896370224463715Forest Bond/*
5275449c685a4b39534f18869a93896370224463715Forest Bond * Description: VT3226 IFRF chip init function
5285449c685a4b39534f18869a93896370224463715Forest Bond *
5295449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
5305449c685a4b39534f18869a93896370224463715Forest Bond *  In:
5315449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
5325449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
5335449c685a4b39534f18869a93896370224463715Forest Bond *      none
5345449c685a4b39534f18869a93896370224463715Forest Bond *
5355a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
5365449c685a4b39534f18869a93896370224463715Forest Bond *
5375449c685a4b39534f18869a93896370224463715Forest Bond */
5385449c685a4b39534f18869a93896370224463715Forest Bond
5395449c685a4b39534f18869a93896370224463715Forest Bond/*
5405449c685a4b39534f18869a93896370224463715Forest Bond * Description: Select channel with VT3226 chip
5415449c685a4b39534f18869a93896370224463715Forest Bond *
5425449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
5435449c685a4b39534f18869a93896370224463715Forest Bond *  In:
5445449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
5455449c685a4b39534f18869a93896370224463715Forest Bond *      uChannel    - Channel number
5465449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
5475449c685a4b39534f18869a93896370224463715Forest Bond *      none
5485449c685a4b39534f18869a93896370224463715Forest Bond *
5495a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
5505449c685a4b39534f18869a93896370224463715Forest Bond *
5515449c685a4b39534f18869a93896370224463715Forest Bond */
5525449c685a4b39534f18869a93896370224463715Forest Bond
5535449c685a4b39534f18869a93896370224463715Forest Bond/*---------------------  Export Variables  --------------------------*/
5545449c685a4b39534f18869a93896370224463715Forest Bond
5555449c685a4b39534f18869a93896370224463715Forest Bond/*---------------------  Export Functions  --------------------------*/
5565449c685a4b39534f18869a93896370224463715Forest Bond
5575449c685a4b39534f18869a93896370224463715Forest Bond/*
558789d1aef176e720fce4a8a5a9ab07f093ddb9086Justin P. Mattock * Description: Write to IF/RF, by embedded programming
5595449c685a4b39534f18869a93896370224463715Forest Bond *
5605449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
5615449c685a4b39534f18869a93896370224463715Forest Bond *  In:
5625449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
5635449c685a4b39534f18869a93896370224463715Forest Bond *      dwData      - data to write
5645449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
5655449c685a4b39534f18869a93896370224463715Forest Bond *      none
5665449c685a4b39534f18869a93896370224463715Forest Bond *
5675a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
5685449c685a4b39534f18869a93896370224463715Forest Bond *
5695449c685a4b39534f18869a93896370224463715Forest Bond */
5701683440595ea33cc019fb8524b04319cf82bc6acGuillaume Clementbool IFRFbWriteEmbedded(void __iomem *dwIoBase, unsigned long dwData)
5715449c685a4b39534f18869a93896370224463715Forest Bond{
5723bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned short ww;
5733bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned long dwValue;
5745449c685a4b39534f18869a93896370224463715Forest Bond
5753bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	VNSvOutPortD(dwIoBase + MAC_REG_IFREGCTL, dwData);
5765449c685a4b39534f18869a93896370224463715Forest Bond
5773bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// W_MAX_TIMEOUT is the timeout period
5783bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
5793bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		VNSvInPortD(dwIoBase + MAC_REG_IFREGCTL, &dwValue);
5803bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		if (dwValue & IFREGCTL_DONE)
5813bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			break;
5823bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	}
5835449c685a4b39534f18869a93896370224463715Forest Bond
5844e8a7e5fc29697f881f5c358f84df52914908703Guido Martínez	if (ww == W_MAX_TIMEOUT)
5853bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		return false;
5864e8a7e5fc29697f881f5c358f84df52914908703Guido Martínez
5873bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return true;
5885449c685a4b39534f18869a93896370224463715Forest Bond}
5895449c685a4b39534f18869a93896370224463715Forest Bond
5905449c685a4b39534f18869a93896370224463715Forest Bond/*
5915449c685a4b39534f18869a93896370224463715Forest Bond * Description: RFMD RF2959 IFRF chip init function
5925449c685a4b39534f18869a93896370224463715Forest Bond *
5935449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
5945449c685a4b39534f18869a93896370224463715Forest Bond *  In:
5955449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
5965449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
5975449c685a4b39534f18869a93896370224463715Forest Bond *      none
5985449c685a4b39534f18869a93896370224463715Forest Bond *
5995a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
6005449c685a4b39534f18869a93896370224463715Forest Bond *
6015449c685a4b39534f18869a93896370224463715Forest Bond */
6025449c685a4b39534f18869a93896370224463715Forest Bond
6035449c685a4b39534f18869a93896370224463715Forest Bond/*
6045449c685a4b39534f18869a93896370224463715Forest Bond * Description: Select channel with RFMD 2959 chip
6055449c685a4b39534f18869a93896370224463715Forest Bond *
6065449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
6075449c685a4b39534f18869a93896370224463715Forest Bond *  In:
6085449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
6095449c685a4b39534f18869a93896370224463715Forest Bond *      uChannel    - Channel number
6105449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
6115449c685a4b39534f18869a93896370224463715Forest Bond *      none
6125449c685a4b39534f18869a93896370224463715Forest Bond *
6135a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
6145449c685a4b39534f18869a93896370224463715Forest Bond *
6155449c685a4b39534f18869a93896370224463715Forest Bond */
6165449c685a4b39534f18869a93896370224463715Forest Bond
6175449c685a4b39534f18869a93896370224463715Forest Bond/*
6185449c685a4b39534f18869a93896370224463715Forest Bond * Description: AIROHA IFRF chip init function
6195449c685a4b39534f18869a93896370224463715Forest Bond *
6205449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
6215449c685a4b39534f18869a93896370224463715Forest Bond *  In:
6225449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
6235449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
6245449c685a4b39534f18869a93896370224463715Forest Bond *      none
6255449c685a4b39534f18869a93896370224463715Forest Bond *
6265a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
6275449c685a4b39534f18869a93896370224463715Forest Bond *
6285449c685a4b39534f18869a93896370224463715Forest Bond */
6291683440595ea33cc019fb8524b04319cf82bc6acGuillaume Clementstatic bool RFbAL2230Init(void __iomem *dwIoBase)
6305449c685a4b39534f18869a93896370224463715Forest Bond{
6313bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	int     ii;
6323bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bool bResult;
6335449c685a4b39534f18869a93896370224463715Forest Bond
6343bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult = true;
6355449c685a4b39534f18869a93896370224463715Forest Bond
6363bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	//3-wire control for normal mode
6373bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	VNSvOutPortB(dwIoBase + MAC_REG_SOFTPWRCTL, 0);
6385449c685a4b39534f18869a93896370224463715Forest Bond
6393bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPECTI  |
6403bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches							 SOFTPWRCTL_TXPEINV));
6415449c685a4b39534f18869a93896370224463715Forest Bond//2008-8-21 chester <add>
6423bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// PLL  Off
6435449c685a4b39534f18869a93896370224463715Forest Bond
6443bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
6455449c685a4b39534f18869a93896370224463715Forest Bond
6463bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	//patch abnormal AL2230 frequency output
6475449c685a4b39534f18869a93896370224463715Forest Bond//2008-8-21 chester <add>
6483bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	IFRFbWriteEmbedded(dwIoBase, (0x07168700+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));
6495449c685a4b39534f18869a93896370224463715Forest Bond
6503bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++)
6513bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL2230InitTable[ii]);
6525449c685a4b39534f18869a93896370224463715Forest Bond//2008-8-21 chester <add>
6533bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvTimer0MicroSDelay(dwIoBase, 30); //delay 30 us
6545449c685a4b39534f18869a93896370224463715Forest Bond
6553bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// PLL On
6563bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
6575449c685a4b39534f18869a93896370224463715Forest Bond
6583bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvTimer0MicroSDelay(dwIoBase, 150);//150us
6593bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, (0x00d80f00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));
6603bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvTimer0MicroSDelay(dwIoBase, 30);//30us
6613bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, (0x00780f00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW));
6623bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvTimer0MicroSDelay(dwIoBase, 30);//30us
6633bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL2230InitTable[CB_AL2230_INIT_SEQ-1]);
6645449c685a4b39534f18869a93896370224463715Forest Bond
6653bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE3    |
6663bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches							 SOFTPWRCTL_SWPE2    |
6673bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches							 SOFTPWRCTL_SWPECTI  |
6683bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches							 SOFTPWRCTL_TXPEINV));
6695449c685a4b39534f18869a93896370224463715Forest Bond
6703bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	//3-wire control for power saving mode
6713bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	VNSvOutPortB(dwIoBase + MAC_REG_PSPWRSIG, (PSSIG_WPE3 | PSSIG_WPE2)); //1100 0000
6725449c685a4b39534f18869a93896370224463715Forest Bond
6733bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return bResult;
6745449c685a4b39534f18869a93896370224463715Forest Bond}
6755449c685a4b39534f18869a93896370224463715Forest Bond
6761683440595ea33cc019fb8524b04319cf82bc6acGuillaume Clementstatic bool RFbAL2230SelectChannel(void __iomem *dwIoBase, unsigned char byChannel)
6775449c685a4b39534f18869a93896370224463715Forest Bond{
6783bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bool bResult;
6795449c685a4b39534f18869a93896370224463715Forest Bond
6803bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult = true;
6815449c685a4b39534f18869a93896370224463715Forest Bond
6823bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL2230ChannelTable0[byChannel - 1]);
6833bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL2230ChannelTable1[byChannel - 1]);
6845449c685a4b39534f18869a93896370224463715Forest Bond
6853bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// Set Channel[7] = 0 to tell H/W channel is changing now.
6863bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel & 0x7F));
6873bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvTimer0MicroSDelay(dwIoBase, SWITCH_CHANNEL_DELAY_AL2230);
6883bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// Set Channel[7] = 1 to tell H/W channel change is done.
6893bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel | 0x80));
6905449c685a4b39534f18869a93896370224463715Forest Bond
6913bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return bResult;
6925449c685a4b39534f18869a93896370224463715Forest Bond}
6935449c685a4b39534f18869a93896370224463715Forest Bond
6945449c685a4b39534f18869a93896370224463715Forest Bond/*
6955449c685a4b39534f18869a93896370224463715Forest Bond * Description: UW2451 IFRF chip init function
6965449c685a4b39534f18869a93896370224463715Forest Bond *
6975449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
6985449c685a4b39534f18869a93896370224463715Forest Bond *  In:
6995449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
7005449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
7015449c685a4b39534f18869a93896370224463715Forest Bond *      none
7025449c685a4b39534f18869a93896370224463715Forest Bond *
7035a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
7045449c685a4b39534f18869a93896370224463715Forest Bond *
7055449c685a4b39534f18869a93896370224463715Forest Bond */
7065449c685a4b39534f18869a93896370224463715Forest Bond
7075449c685a4b39534f18869a93896370224463715Forest Bond/*
7085449c685a4b39534f18869a93896370224463715Forest Bond * Description: Select channel with UW2451 chip
7095449c685a4b39534f18869a93896370224463715Forest Bond *
7105449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
7115449c685a4b39534f18869a93896370224463715Forest Bond *  In:
7125449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
7135449c685a4b39534f18869a93896370224463715Forest Bond *      uChannel    - Channel number
7145449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
7155449c685a4b39534f18869a93896370224463715Forest Bond *      none
7165449c685a4b39534f18869a93896370224463715Forest Bond *
7175a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
7185449c685a4b39534f18869a93896370224463715Forest Bond *
7195449c685a4b39534f18869a93896370224463715Forest Bond */
7205449c685a4b39534f18869a93896370224463715Forest Bond
7215449c685a4b39534f18869a93896370224463715Forest Bond/*
7225449c685a4b39534f18869a93896370224463715Forest Bond * Description: Set sleep mode to UW2451 chip
7235449c685a4b39534f18869a93896370224463715Forest Bond *
7245449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
7255449c685a4b39534f18869a93896370224463715Forest Bond *  In:
7265449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
7275449c685a4b39534f18869a93896370224463715Forest Bond *      uChannel    - Channel number
7285449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
7295449c685a4b39534f18869a93896370224463715Forest Bond *      none
7305449c685a4b39534f18869a93896370224463715Forest Bond *
7315a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
7325449c685a4b39534f18869a93896370224463715Forest Bond *
7335449c685a4b39534f18869a93896370224463715Forest Bond */
7345449c685a4b39534f18869a93896370224463715Forest Bond
7355449c685a4b39534f18869a93896370224463715Forest Bond/*
7365449c685a4b39534f18869a93896370224463715Forest Bond * Description: RF init function
7375449c685a4b39534f18869a93896370224463715Forest Bond *
7385449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
7395449c685a4b39534f18869a93896370224463715Forest Bond *  In:
7405449c685a4b39534f18869a93896370224463715Forest Bond *      byBBType
7415449c685a4b39534f18869a93896370224463715Forest Bond *      byRFType
7425449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
7435449c685a4b39534f18869a93896370224463715Forest Bond *      none
7445449c685a4b39534f18869a93896370224463715Forest Bond *
7455a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
7465449c685a4b39534f18869a93896370224463715Forest Bond *
7475449c685a4b39534f18869a93896370224463715Forest Bond */
7483bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perchesbool RFbInit(
7496af4336e64dde7d0dd910c10de5dced9ef7ecf64Malcolm Priestley	struct vnt_private *pDevice
7503bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches)
7515449c685a4b39534f18869a93896370224463715Forest Bond{
7523bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bool bResult = true;
7536b7112719fd48c29f35333ef152a5a450f01dc83Guillaume Clement
7543bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	switch (pDevice->byRFType) {
7553bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AIROHA:
7563bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AL2230S:
7573bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		pDevice->byMaxPwrLevel = AL2230_PWR_IDX_LEN;
7583bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult = RFbAL2230Init(pDevice->PortOffset);
7593bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
7603bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AIROHA7230:
7613bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		pDevice->byMaxPwrLevel = AL7230_PWR_IDX_LEN;
7623bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult = s_bAL7230Init(pDevice->PortOffset);
7633bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
7643bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_NOTHING:
7653bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult = true;
7663bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
7673bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	default:
7683bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult = false;
7693bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
7703bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	}
7713bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return bResult;
7725449c685a4b39534f18869a93896370224463715Forest Bond}
7735449c685a4b39534f18869a93896370224463715Forest Bond
7745449c685a4b39534f18869a93896370224463715Forest Bond/*
7755449c685a4b39534f18869a93896370224463715Forest Bond * Description: Select channel
7765449c685a4b39534f18869a93896370224463715Forest Bond *
7775449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
7785449c685a4b39534f18869a93896370224463715Forest Bond *  In:
7795449c685a4b39534f18869a93896370224463715Forest Bond *      byRFType
7805449c685a4b39534f18869a93896370224463715Forest Bond *      byChannel    - Channel number
7815449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
7825449c685a4b39534f18869a93896370224463715Forest Bond *      none
7835449c685a4b39534f18869a93896370224463715Forest Bond *
7845a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
7855449c685a4b39534f18869a93896370224463715Forest Bond *
7865449c685a4b39534f18869a93896370224463715Forest Bond */
7871683440595ea33cc019fb8524b04319cf82bc6acGuillaume Clementbool RFbSelectChannel(void __iomem *dwIoBase, unsigned char byRFType, unsigned char byChannel)
7885449c685a4b39534f18869a93896370224463715Forest Bond{
7893bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bool bResult = true;
7906b7112719fd48c29f35333ef152a5a450f01dc83Guillaume Clement
7913bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	switch (byRFType) {
7923bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AIROHA:
7933bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AL2230S:
7943bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult = RFbAL2230SelectChannel(dwIoBase, byChannel);
7953bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
7963bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		//{{ RobertYu: 20050104
7973bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AIROHA7230:
7983bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult = s_bAL7230SelectChannel(dwIoBase, byChannel);
7993bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
8003bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		//}} RobertYu
8013bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_NOTHING:
8023bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult = true;
8033bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
8043bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	default:
8053bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult = false;
8063bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
8073bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	}
8083bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return bResult;
8095449c685a4b39534f18869a93896370224463715Forest Bond}
8105449c685a4b39534f18869a93896370224463715Forest Bond
8115449c685a4b39534f18869a93896370224463715Forest Bond/*
8125449c685a4b39534f18869a93896370224463715Forest Bond * Description: Write WakeProgSyn
8135449c685a4b39534f18869a93896370224463715Forest Bond *
8145449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
8155449c685a4b39534f18869a93896370224463715Forest Bond *  In:
8165449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase    - I/O base address
8175449c685a4b39534f18869a93896370224463715Forest Bond *      uChannel    - channel number
8185449c685a4b39534f18869a93896370224463715Forest Bond *      bySleepCnt  - SleepProgSyn count
8195449c685a4b39534f18869a93896370224463715Forest Bond *
8205449c685a4b39534f18869a93896370224463715Forest Bond * Return Value: None.
8215449c685a4b39534f18869a93896370224463715Forest Bond *
8225449c685a4b39534f18869a93896370224463715Forest Bond */
8231683440595ea33cc019fb8524b04319cf82bc6acGuillaume Clementbool RFvWriteWakeProgSyn(void __iomem *dwIoBase, unsigned char byRFType, unsigned int uChannel)
8245449c685a4b39534f18869a93896370224463715Forest Bond{
8253bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	int   ii;
8263bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned char byInitCount = 0;
8273bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned char bySleepCount = 0;
8283bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
8293bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, 0);
8303bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	switch (byRFType) {
8313bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AIROHA:
8323bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AL2230S:
8333bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
8343bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		if (uChannel > CB_MAX_CHANNEL_24G)
8353bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			return false;
8363bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
8373bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		byInitCount = CB_AL2230_INIT_SEQ + 2; // Init Reg + Channel Reg (2)
8383bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bySleepCount = 0;
839bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez		if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
8403bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			return false;
8413bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
842bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez		for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++)
8433bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230InitTable[ii]);
844bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez
8453bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable0[uChannel-1]);
8463bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		ii++;
8473bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable1[uChannel-1]);
8483bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
8493bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
8503bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		//{{ RobertYu: 20050104
8513bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		// Need to check, PLLON need to be low for channel setting
8523bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AIROHA7230:
8533bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		byInitCount = CB_AL7230_INIT_SEQ + 3; // Init Reg + Channel Reg (3)
8543bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bySleepCount = 0;
855bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez		if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
8563bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			return false;
8573bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
8585e0cc8a231be82b0ec44cdf2a406b1a97dd3c971Joe Perches		if (uChannel <= CB_MAX_CHANNEL_24G) {
859bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez			for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++)
8603bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches				MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTable[ii]);
8615e0cc8a231be82b0ec44cdf2a406b1a97dd3c971Joe Perches		} else {
862bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez			for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++)
8633bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches				MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTableAMode[ii]);
8643bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		}
8653bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
8663bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable0[uChannel-1]);
8673bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		ii++;
8683bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable1[uChannel-1]);
8693bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		ii++;
8703bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		MACvSetMISCFifo(dwIoBase, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable2[uChannel-1]);
8713bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
8723bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		//}} RobertYu
8733bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
8743bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_NOTHING:
8753bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		return true;
8763bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
8773bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	default:
8783bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		return false;
8793bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	}
8803bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
8813bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	MACvSetMISCFifo(dwIoBase, MISCFIFO_SYNINFO_IDX, (unsigned long)MAKEWORD(bySleepCount, byInitCount));
8823bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
8833bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return true;
8845449c685a4b39534f18869a93896370224463715Forest Bond}
8855449c685a4b39534f18869a93896370224463715Forest Bond
8865449c685a4b39534f18869a93896370224463715Forest Bond/*
8875449c685a4b39534f18869a93896370224463715Forest Bond * Description: Set Tx power
8885449c685a4b39534f18869a93896370224463715Forest Bond *
8895449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
8905449c685a4b39534f18869a93896370224463715Forest Bond *  In:
8915449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase       - I/O base address
8925449c685a4b39534f18869a93896370224463715Forest Bond *      dwRFPowerTable - RF Tx Power Setting
8935449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
8945449c685a4b39534f18869a93896370224463715Forest Bond *      none
8955449c685a4b39534f18869a93896370224463715Forest Bond *
8965a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
8975449c685a4b39534f18869a93896370224463715Forest Bond *
8985449c685a4b39534f18869a93896370224463715Forest Bond */
8993bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perchesbool RFbSetPower(
9006af4336e64dde7d0dd910c10de5dced9ef7ecf64Malcolm Priestley	struct vnt_private *pDevice,
9013bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned int uRATE,
9023bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned int uCH
9033bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches)
9045449c685a4b39534f18869a93896370224463715Forest Bond{
9053bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bool bResult = true;
9063bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned char byPwr = 0;
9073bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned char byDec = 0;
9083bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned char byPwrdBm = 0;
9093bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
910bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez	if (pDevice->dwDiagRefCount != 0)
9113bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		return true;
912bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez
913bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez	if ((uCH < 1) || (uCH > CB_MAX_CHANNEL))
9143bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		return false;
9153bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
9163bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	switch (uRATE) {
9173bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_1M:
9183bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_2M:
9193bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_5M:
9203bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_11M:
9213bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		byPwr = pDevice->abyCCKPwrTbl[uCH];
9223bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		byPwrdBm = pDevice->abyCCKDefaultPwr[uCH];
9235449c685a4b39534f18869a93896370224463715Forest Bond		break;
9243bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_6M:
9253bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_9M:
9263bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_18M:
9273bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		byPwr = pDevice->abyOFDMPwrTbl[uCH];
928bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez		if (pDevice->byRFType == RF_UW2452)
9293bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			byDec = byPwr + 14;
930bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez		else
9313bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			byDec = byPwr + 10;
932bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez
933bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez		if (byDec >= pDevice->byMaxPwrLevel)
9343bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			byDec = pDevice->byMaxPwrLevel-1;
935bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez
9363bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		if (pDevice->byRFType == RF_UW2452) {
9373bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			byPwrdBm = byDec - byPwr;
9383bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			byPwrdBm /= 3;
9393bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		} else {
9403bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			byPwrdBm = byDec - byPwr;
9413bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			byPwrdBm >>= 1;
9423bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		}
943bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez
9443bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		byPwrdBm += pDevice->abyOFDMDefaultPwr[uCH];
9453bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		byPwr = byDec;
9465449c685a4b39534f18869a93896370224463715Forest Bond		break;
9473bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_24M:
9483bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_36M:
9493bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_48M:
9503bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RATE_54M:
9513bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		byPwr = pDevice->abyOFDMPwrTbl[uCH];
9523bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		byPwrdBm = pDevice->abyOFDMDefaultPwr[uCH];
9535449c685a4b39534f18869a93896370224463715Forest Bond		break;
9543bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	}
9555449c685a4b39534f18869a93896370224463715Forest Bond
956bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez	if (pDevice->byCurPwr == byPwr)
9573bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		return true;
958a7307538805f8a30c25b6f5b9566ab21d8ab7515Joe Perches
9593bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult = RFbRawSetPower(pDevice, byPwr, uRATE);
960bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez	if (bResult)
9613bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		pDevice->byCurPwr = byPwr;
962bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez
9633bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return bResult;
9645449c685a4b39534f18869a93896370224463715Forest Bond}
9655449c685a4b39534f18869a93896370224463715Forest Bond
9665449c685a4b39534f18869a93896370224463715Forest Bond/*
9675449c685a4b39534f18869a93896370224463715Forest Bond * Description: Set Tx power
9685449c685a4b39534f18869a93896370224463715Forest Bond *
9695449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
9705449c685a4b39534f18869a93896370224463715Forest Bond *  In:
9715449c685a4b39534f18869a93896370224463715Forest Bond *      dwIoBase       - I/O base address
9725449c685a4b39534f18869a93896370224463715Forest Bond *      dwRFPowerTable - RF Tx Power Setting
9735449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
9745449c685a4b39534f18869a93896370224463715Forest Bond *      none
9755449c685a4b39534f18869a93896370224463715Forest Bond *
9765a5a2a6ad4aa2467bcc34fa50e85c2afc90bab05Charles Clément * Return Value: true if succeeded; false if failed.
9775449c685a4b39534f18869a93896370224463715Forest Bond *
9785449c685a4b39534f18869a93896370224463715Forest Bond */
9795449c685a4b39534f18869a93896370224463715Forest Bond
9803bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perchesbool RFbRawSetPower(
9816af4336e64dde7d0dd910c10de5dced9ef7ecf64Malcolm Priestley	struct vnt_private *pDevice,
9823bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned char byPwr,
9833bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned int uRATE
9843bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches)
9855449c685a4b39534f18869a93896370224463715Forest Bond{
9863bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bool bResult = true;
9873bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned long dwMax7230Pwr = 0;
9883bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
989bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez	if (byPwr >=  pDevice->byMaxPwrLevel)
990a4ef27ad02e0bfd165e81d6a4f3771ace42ebe41Joe Perches		return false;
991bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez
9923bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	switch (pDevice->byRFType) {
9933bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AIROHA:
9943bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwAL2230PowerTable[byPwr]);
995bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez		if (uRATE <= RATE_11M)
9963bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x0001B400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
997bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez		else
9983bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
999bc5cf6563576bb36baa7e93417b9a2e29999a5c6Guido Martínez
10003bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
10013bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
10023bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AL2230S:
10033bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwAL2230PowerTable[byPwr]);
10043bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		if (uRATE <= RATE_11M) {
10053bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x040C1400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
10063bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x00299B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
10073bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		} else {
10083bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x0005A400+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
10093bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, 0x00099B00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW);
10103bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		}
10113bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
10123bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
10133bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
10143bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AIROHA7230:
10153bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		//  0x080F1B00 for 3 wire control TxGain(D10) and 0x31 as TX Gain value
10163bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		dwMax7230Pwr = 0x080C0B00 | ((byPwr) << 12) |
10173bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches			(BY_AL7230_REG_LEN << 3)  | IFREGCTL_REGW;
10183bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
10193bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwMax7230Pwr);
10203bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
10213bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
10223bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	default:
10233bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
10243bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	}
10253bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return bResult;
10265449c685a4b39534f18869a93896370224463715Forest Bond}
10275449c685a4b39534f18869a93896370224463715Forest Bond
10285449c685a4b39534f18869a93896370224463715Forest Bond/*+
10295449c685a4b39534f18869a93896370224463715Forest Bond *
10305449c685a4b39534f18869a93896370224463715Forest Bond * Routine Description:
10315449c685a4b39534f18869a93896370224463715Forest Bond *     Translate RSSI to dBm
10325449c685a4b39534f18869a93896370224463715Forest Bond *
10335449c685a4b39534f18869a93896370224463715Forest Bond * Parameters:
10345449c685a4b39534f18869a93896370224463715Forest Bond *  In:
10355449c685a4b39534f18869a93896370224463715Forest Bond *      pDevice         - The adapter to be translated
10365449c685a4b39534f18869a93896370224463715Forest Bond *      byCurrRSSI      - RSSI to be translated
10375449c685a4b39534f18869a93896370224463715Forest Bond *  Out:
10385449c685a4b39534f18869a93896370224463715Forest Bond *      pdwdbm          - Translated dbm number
10395449c685a4b39534f18869a93896370224463715Forest Bond *
10405449c685a4b39534f18869a93896370224463715Forest Bond * Return Value: none
10415449c685a4b39534f18869a93896370224463715Forest Bond *
10423bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches -*/
10436b35b7b3798b652a57fbce480f350aac851431c4Charles Clémentvoid
10443bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe PerchesRFvRSSITodBm(
10456af4336e64dde7d0dd910c10de5dced9ef7ecf64Malcolm Priestley	struct vnt_private *pDevice,
10463bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned char byCurrRSSI,
10473bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	long *pldBm
10483bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	)
10495449c685a4b39534f18869a93896370224463715Forest Bond{
10503bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned char byIdx = (((byCurrRSSI & 0xC0) >> 6) & 0x03);
10513bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	long b = (byCurrRSSI & 0x3F);
10523bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	long a = 0;
10533bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	unsigned char abyAIROHARF[4] = {0, 18, 0, 40};
10543bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
10553bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	switch (pDevice->byRFType) {
10563bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AIROHA:
10573bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AL2230S:
10583bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	case RF_AIROHA7230: //RobertYu: 20040104
10593bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		a = abyAIROHARF[byIdx];
10603bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
10613bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	default:
10623bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		break;
10633bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	}
10643bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
10653bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	*pldBm = -1 * (a + b * 2);
10665449c685a4b39534f18869a93896370224463715Forest Bond}
10675449c685a4b39534f18869a93896370224463715Forest Bond
10685449c685a4b39534f18869a93896370224463715Forest Bond////////////////////////////////////////////////////////////////////////////////
10695449c685a4b39534f18869a93896370224463715Forest Bond//{{ RobertYu: 20050104
10705449c685a4b39534f18869a93896370224463715Forest Bond
10715449c685a4b39534f18869a93896370224463715Forest Bond// Post processing for the 11b/g and 11a.
10725449c685a4b39534f18869a93896370224463715Forest Bond// for save time on changing Reg2,3,5,7,10,12,15
10731683440595ea33cc019fb8524b04319cf82bc6acGuillaume Clementbool RFbAL7230SelectChannelPostProcess(void __iomem *dwIoBase, unsigned char byOldChannel, unsigned char byNewChannel)
10745449c685a4b39534f18869a93896370224463715Forest Bond{
10753bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bool bResult;
10763bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
10773bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	bResult = true;
10783bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
10793bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// if change between 11 b/g and 11a need to update the following register
10803bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	// Channel Index 1~14
10813bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
10825e0cc8a231be82b0ec44cdf2a406b1a97dd3c971Joe Perches	if ((byOldChannel <= CB_MAX_CHANNEL_24G) && (byNewChannel > CB_MAX_CHANNEL_24G)) {
10833bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		// Change from 2.4G to 5G
10843bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[2]); //Reg2
10853bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[3]); //Reg3
10863bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[5]); //Reg5
10873bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[7]); //Reg7
10883bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[10]);//Reg10
10893bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[12]);//Reg12
10903bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTableAMode[15]);//Reg15
10915e0cc8a231be82b0ec44cdf2a406b1a97dd3c971Joe Perches	} else if ((byOldChannel > CB_MAX_CHANNEL_24G) && (byNewChannel <= CB_MAX_CHANNEL_24G)) {
10923bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		// change from 5G to 2.4G
10933bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[2]); //Reg2
10943bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[3]); //Reg3
10953bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[5]); //Reg5
10963bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[7]); //Reg7
10973bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[10]);//Reg10
10983bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[12]);//Reg12
10993bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches		bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[15]);//Reg15
11003bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	}
11013bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches
11023bd1996e3a7ebbf166080a4a76a01140ad1a1a8fJoe Perches	return bResult;
11035449c685a4b39534f18869a93896370224463715Forest Bond}
11045449c685a4b39534f18869a93896370224463715Forest Bond
11055449c685a4b39534f18869a93896370224463715Forest Bond//}} RobertYu
11065449c685a4b39534f18869a93896370224463715Forest Bond////////////////////////////////////////////////////////////////////////////////
1107