/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* File: channel.c
*
*/
#include "baseband.h"
#include "country.h"
#include "channel.h"
#include "device.h"
#include "rf.h"
/*--------------------- Static Definitions -------------------------*/
#define CARD_MAX_CHANNEL_TBL 56
//static int msglevel = MSG_LEVEL_DEBUG;
static int msglevel = MSG_LEVEL_INFO;
/*--------------------- Static Variables --------------------------*/
static SChannelTblElement sChannelTbl[CARD_MAX_CHANNEL_TBL + 1] =
{
{0, 0, false, 0},
{1, 2412, true, 0},
{2, 2417, true, 0},
{3, 2422, true, 0},
{4, 2427, true, 0},
{5, 2432, true, 0},
{6, 2437, true, 0},
{7, 2442, true, 0},
{8, 2447, true, 0},
{9, 2452, true, 0},
{10, 2457, true, 0},
{11, 2462, true, 0},
{12, 2467, true, 0},
{13, 2472, true, 0},
{14, 2484, true, 0},
{183, 4915, true, 0},
{184, 4920, true, 0},
{185, 4925, true, 0},
{187, 4935, true, 0},
{188, 4940, true, 0},
{189, 4945, true, 0},
{192, 4960, true, 0},
{196, 4980, true, 0},
{7, 5035, true, 0},
{8, 5040, true, 0},
{9, 5045, true, 0},
{11, 5055, true, 0},
{12, 5060, true, 0},
{16, 5080, true, 0},
{34, 5170, true, 0},
{36, 5180, true, 0},
{38, 5190, true, 0},
{40, 5200, true, 0},
{42, 5210, true, 0},
{44, 5220, true, 0},
{46, 5230, true, 0},
{48, 5240, true, 0},
{52, 5260, true, 0},
{56, 5280, true, 0},
{60, 5300, true, 0},
{64, 5320, true, 0},
{100, 5500, true, 0},
{104, 5520, true, 0},
{108, 5540, true, 0},
{112, 5560, true, 0},
{116, 5580, true, 0},
{120, 5600, true, 0},
{124, 5620, true, 0},
{128, 5640, true, 0},
{132, 5660, true, 0},
{136, 5680, true, 0},
{140, 5700, true, 0},
{149, 5745, true, 0},
{153, 5765, true, 0},
{157, 5785, true, 0},
{161, 5805, true, 0},
{165, 5825, true, 0}
};
/************************************************************************
* The Radar regulation rules for each country
************************************************************************/
static struct
{
unsigned char byChannelCountryCode; /* The country code */
char chCountryCode[2];
unsigned char bChannelIdxList[CB_MAX_CHANNEL]; /* Available channels Index */
unsigned char byPower[CB_MAX_CHANNEL];
} ChannelRuleTab[] =
{
/************************************************************************
* This table is based on Athero driver rules
************************************************************************/
/* Country Available channels, ended with 0 */
/* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 */
{CCODE_FCC, {'U','S'}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1}
, { 27, 27, 27