Commit 9ef2184d authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: dead code remove zonetypes

Remove vntconfiguration.dat, iocmd.h and country.h

Set all channels are enabled as by rf type.

mac80211 will handles zones
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 94540a1e
......@@ -899,44 +899,7 @@ int BBbVT3184Init(struct vnt_private *priv)
if (status != STATUS_SUCCESS)
return false;
/* zonetype initial */
priv->byOriginalZonetype = priv->abyEEPROM[EEP_OFS_ZONETYPE];
if (priv->config_file.ZoneType >= 0) {
if ((priv->config_file.ZoneType == 0) &&
(priv->abyEEPROM[EEP_OFS_ZONETYPE] != 0x00)) {
priv->abyEEPROM[EEP_OFS_ZONETYPE] = 0;
priv->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0B;
dev_dbg(&priv->usb->dev, "Init Zone Type :USA\n");
} else if ((priv->config_file.ZoneType == 1) &&
(priv->abyEEPROM[EEP_OFS_ZONETYPE] != 0x01)) {
priv->abyEEPROM[EEP_OFS_ZONETYPE] = 0x01;
priv->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
dev_dbg(&priv->usb->dev, "Init Zone Type :Japan\n");
} else if ((priv->config_file.ZoneType == 2) &&
(priv->abyEEPROM[EEP_OFS_ZONETYPE] != 0x02)) {
priv->abyEEPROM[EEP_OFS_ZONETYPE] = 0x02;
priv->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
dev_dbg(&priv->usb->dev, "Init Zone Type :Europe\n");
} else {
if (priv->config_file.ZoneType !=
priv->abyEEPROM[EEP_OFS_ZONETYPE])
printk("zonetype in file[%02x]\
mismatch with in EEPROM[%02x]\n",
priv->config_file.ZoneType,
priv->abyEEPROM[EEP_OFS_ZONETYPE]);
else
printk("Read Zonetype file success,\
use default zonetype setting[%02x]\n",
priv->config_file.ZoneType);
}
}
if (!priv->bZoneRegExist)
priv->byZoneType = priv->abyEEPROM[EEP_OFS_ZONETYPE];
priv->byZoneType = priv->abyEEPROM[EEP_OFS_ZONETYPE];
priv->byRFType = priv->abyEEPROM[EEP_OFS_RFTYPE];
......
......@@ -55,7 +55,6 @@
#include "power.h"
#include "key.h"
#include "rc4.h"
#include "country.h"
#include "datarate.h"
#include "usbpipe.h"
......
This diff is collapsed.
/*
* 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: country.h
*
* Purpose: Country Code information
*
* Author: Lucas Lin
*
* Date: Dec 23, 2004
*
*/
#ifndef __COUNTRY_H__
#define __COUNTRY_H__
/************************************************************************
* The definition here should be complied with the INF country order
* Please check with VNWL.inf/VNWL64.inf/VNWL*.inf
************************************************************************/
typedef enum _COUNTRY_CODE {
CCODE_FCC = 0,
CCODE_TELEC,
CCODE_ETSI,
CCODE_RESV3,
CCODE_RESV4,
CCODE_RESV5,
CCODE_RESV6,
CCODE_RESV7,
CCODE_RESV8,
CCODE_RESV9,
CCODE_RESVa,
CCODE_RESVb,
CCODE_RESVc,
CCODE_RESVd,
CCODE_RESVe,
CCODE_ALLBAND,
CCODE_ALBANIA,
CCODE_ALGERIA,
CCODE_ARGENTINA,
CCODE_ARMENIA,
CCODE_AUSTRALIA,
CCODE_AUSTRIA,
CCODE_AZERBAIJAN,
CCODE_BAHRAIN,
CCODE_BELARUS,
CCODE_BELGIUM,
CCODE_BELIZE,
CCODE_BOLIVIA,
CCODE_BRAZIL,
CCODE_BRUNEI_DARUSSALAM,
CCODE_BULGARIA,
CCODE_CANADA,
CCODE_CHILE,
CCODE_CHINA,
CCODE_COLOMBIA,
CCODE_COSTA_RICA,
CCODE_CROATIA,
CCODE_CYPRUS,
CCODE_CZECH,
CCODE_DENMARK,
CCODE_DOMINICAN_REPUBLIC,
CCODE_ECUADOR,
CCODE_EGYPT,
CCODE_EL_SALVADOR,
CCODE_ESTONIA,
CCODE_FINLAND,
CCODE_FRANCE,
CCODE_GERMANY,
CCODE_GREECE,
CCODE_GEORGIA,
CCODE_GUATEMALA,
CCODE_HONDURAS,
CCODE_HONG_KONG,
CCODE_HUNGARY,
CCODE_ICELAND,
CCODE_INDIA,
CCODE_INDONESIA,
CCODE_IRAN,
CCODE_IRELAND,
CCODE_ITALY,
CCODE_ISRAEL,
CCODE_JAPAN,
CCODE_JORDAN,
CCODE_KAZAKHSTAN,
CCODE_KUWAIT,
CCODE_LATVIA,
CCODE_LEBANON,
CCODE_LEICHTENSTEIN,
CCODE_LITHUANIA,
CCODE_LUXEMBURG,
CCODE_MACAU,
CCODE_MACEDONIA,
CCODE_MALTA,
CCODE_MALAYSIA,
CCODE_MEXICO,
CCODE_MONACO,
CCODE_MOROCCO,
CCODE_NETHERLANDS,
CCODE_NEW_ZEALAND,
CCODE_NORTH_KOREA,
CCODE_NORWAY,
CCODE_OMAN,
CCODE_PAKISTAN,
CCODE_PANAMA,
CCODE_PERU,
CCODE_PHILIPPINES,
CCODE_POLAND,
CCODE_PORTUGAL,
CCODE_PUERTO_RICO,
CCODE_QATAR,
CCODE_ROMANIA,
CCODE_RUSSIA,
CCODE_SAUDI_ARABIA,
CCODE_SINGAPORE,
CCODE_SLOVAKIA,
CCODE_SLOVENIA,
CCODE_SOUTH_AFRICA,
CCODE_SOUTH_KOREA,
CCODE_SPAIN,
CCODE_SWEDEN,
CCODE_SWITZERLAND,
CCODE_SYRIA,
CCODE_TAIWAN,
CCODE_THAILAND,
CCODE_TRINIDAD_TOBAGO,
CCODE_TUNISIA,
CCODE_TURKEY,
CCODE_UK,
CCODE_UKRAINE,
CCODE_UNITED_ARAB_EMIRATES,
CCODE_UNITED_STATES,
CCODE_URUGUAY,
CCODE_UZBEKISTAN,
CCODE_VENEZUELA,
CCODE_VIETNAM,
CCODE_YEMEN,
CCODE_ZIMBABWE,
CCODE_JAPAN_W52_W53,
CCODE_MAX
} COUNTRY_CODE;
/************************************************************************
* Function prototype
************************************************************************/
#endif /* __COUNTRY_H__ */
......@@ -481,9 +481,6 @@ struct vnt_private {
u8 byBBRxConf;
u8 byZoneType;
int bZoneRegExist;
u8 byOriginalZonetype;
int bLinkPass; /* link status: OK or fail */
struct vnt_cmd_card_init init_command;
......
/*
* 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: iocmd.h
*
* Purpose: Handles the viawget ioctl private interface functions
*
* Author: Lyndon Chen
*
* Date: May 8, 2002
*
*/
#ifndef __IOCMD_H__
#define __IOCMD_H__
typedef enum tagWZONETYPE {
ZoneType_USA = 0,
ZoneType_Japan = 1,
ZoneType_Europe = 2
} WZONETYPE;
#endif /* __IOCMD_H__ */
......@@ -56,7 +56,6 @@
#include "wctl.h"
#include "power.h"
#include "wcmd.h"
#include "iocmd.h"
#include "rxtx.h"
#include "bssdb.h"
#include "wpactl.h"
......@@ -222,12 +221,6 @@ static void device_free_int_bufs(struct vnt_private *pDevice);
static void device_free_frag_bufs(struct vnt_private *pDevice);
static bool device_alloc_bufs(struct vnt_private *pDevice);
static int Read_config_file(struct vnt_private *pDevice);
static unsigned char *Config_FileOperation(struct vnt_private *pDevice);
static int Config_FileGetParameter(unsigned char *string,
unsigned char *dest,
unsigned char *source);
static void usb_device_reset(struct vnt_private *pDevice);
static void
......@@ -379,13 +372,9 @@ static int device_init_registers(struct vnt_private *pDevice)
* original zonetype is USA, but custom zonetype is Europe,
* then need to recover 12, 13, 14 channels with 11 channel
*/
if (((pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Japan) ||
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Europe)) &&
(pDevice->byOriginalZonetype == ZoneType_USA)) {
for (ii = 11; ii < 14; ii++) {
pDevice->abyCCKPwrTbl[ii] = pDevice->abyCCKPwrTbl[10];
pDevice->abyOFDMPwrTbl[ii] = pDevice->abyOFDMPwrTbl[10];
}
for (ii = 11; ii < 14; ii++) {
pDevice->abyCCKPwrTbl[ii] = pDevice->abyCCKPwrTbl[10];
pDevice->abyOFDMPwrTbl[ii] = pDevice->abyOFDMPwrTbl[10];
}
pDevice->byOFDMPwrA = 0x34; /* same as RFbMA2829SelectChannel */
......@@ -808,9 +797,6 @@ static int device_open(struct net_device *dev)
MP_SET_FLAG(pDevice, fMP_POST_READS);
MP_SET_FLAG(pDevice, fMP_POST_WRITES);
/* read config file */
Read_config_file(pDevice);
if (device_init_registers(pDevice) == false) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " init register fail\n");
goto free_all;
......@@ -1519,160 +1505,6 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK;
}
/* find out the start position of str2 from str1 */
static unsigned char *kstrstr(const unsigned char *str1,
const unsigned char *str2) {
int str1_len = strlen(str1);
int str2_len = strlen(str2);
while (str1_len >= str2_len) {
str1_len--;
if(memcmp(str1,str2,str2_len)==0)
return (unsigned char *) str1;
str1++;
}
return NULL;
}
static int Config_FileGetParameter(unsigned char *string,
unsigned char *dest,
unsigned char *source)
{
unsigned char buf1[100];
unsigned char buf2[100];
unsigned char *start_p = NULL, *end_p = NULL, *tmp_p = NULL;
int ii;
memset(buf1,0,100);
strcat(buf1, string);
strcat(buf1, "=");
source+=strlen(buf1);
/* find target string start point */
start_p = kstrstr(source,buf1);
if (start_p == NULL)
return false;
/* check if current config line is marked by "#" */
for (ii = 1; ; ii++) {
if (memcmp(start_p - ii, "\n", 1) == 0)
break;
if (memcmp(start_p - ii, "#", 1) == 0)
return false;
}
/* find target string end point */
end_p = kstrstr(start_p,"\n");
if (end_p == NULL) { /* can't find "\n", but don't care */
end_p = start_p + strlen(start_p); /* no include "\n" */
}
memset(buf2,0,100);
memcpy(buf2, start_p, end_p-start_p); /* get the target line */
buf2[end_p-start_p]='\0';
/* find value */
start_p = kstrstr(buf2,"=");
if (start_p == NULL)
return false;
memset(buf1,0,100);
strcpy(buf1,start_p+1);
/* except space */
tmp_p = buf1;
while(*tmp_p != 0x00) {
if(*tmp_p==' ')
tmp_p++;
else
break;
}
memcpy(dest,tmp_p,strlen(tmp_p));
return true;
}
/* if read fails, return NULL, or return data pointer */
static unsigned char *Config_FileOperation(struct vnt_private *pDevice)
{
unsigned char *buffer = kmalloc(1024, GFP_KERNEL);
struct file *file;
if (!buffer) {
printk("allocate mem for file fail?\n");
return NULL;
}
file = filp_open(CONFIG_PATH, O_RDONLY, 0);
if (IS_ERR(file)) {
kfree(buffer);
printk("Config_FileOperation file Not exist\n");
return NULL;
}
if (kernel_read(file, 0, buffer, 1024) < 0) {
printk("read file error?\n");
kfree(buffer);
buffer = NULL;
}
fput(file);
return buffer;
}
/* return --->-1:fail; >=0:successful */
static int Read_config_file(struct vnt_private *pDevice)
{
int result = 0;
unsigned char tmpbuffer[100];
unsigned char *buffer = NULL;
/* init config setting */
pDevice->config_file.ZoneType = -1;
pDevice->config_file.eAuthenMode = -1;
pDevice->config_file.eEncryptionStatus = -1;
buffer = Config_FileOperation(pDevice);
if (buffer == NULL) {
result =-1;
return result;
}
/* get zonetype */
{
memset(tmpbuffer,0,sizeof(tmpbuffer));
if(Config_FileGetParameter("ZONETYPE",tmpbuffer,buffer) ==true) {
if(memcmp(tmpbuffer,"USA",3)==0) {
pDevice->config_file.ZoneType=ZoneType_USA;
}
else if(memcmp(tmpbuffer,"JAPAN",5)==0) {
pDevice->config_file.ZoneType=ZoneType_Japan;
}
else if(memcmp(tmpbuffer,"EUROPE",6)==0) {
pDevice->config_file.ZoneType=ZoneType_Europe;
}
else {
printk("Unknown Zonetype[%s]?\n",tmpbuffer);
}
}
}
/* get other parameter */
{
memset(tmpbuffer,0,sizeof(tmpbuffer));
if(Config_FileGetParameter("AUTHENMODE",tmpbuffer,buffer)==true) {
pDevice->config_file.eAuthenMode = (int) simple_strtol(tmpbuffer, NULL, 10);
}
memset(tmpbuffer,0,sizeof(tmpbuffer));
if(Config_FileGetParameter("ENCRYPTIONMODE",tmpbuffer,buffer)==true) {
pDevice->config_file.eEncryptionStatus= (int) simple_strtol(tmpbuffer, NULL, 10);
}
}
kfree(buffer);
return result;
}
static void device_set_multi(struct net_device *dev)
{
struct vnt_private *priv = netdev_priv(dev);
......
......@@ -58,7 +58,6 @@
#include "rf.h"
#include "datarate.h"
#include "usbpipe.h"
#include "iocmd.h"
static int msglevel = MSG_LEVEL_INFO;
......
#VNT Configuration
[start]
ZONETYPE=EUROPE
AUTHENMODE=12
ENCRYPTIONMODE=34
[end]
\ No newline at end of file
......@@ -36,7 +36,6 @@
#include "mac.h"
#include "device.h"
#include "wmgr.h"
#include "iocmd.h"
#include "iowpa.h"
#include "usbpipe.h"
#include "rf.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment