Commit 92b96797 authored by Forest Bond's avatar Forest Bond Committed by Greg Kroah-Hartman

Staging: Add pristine upstream vt6656 driver sources to drivers/staging/vt6656.

Add pristine upstream vt6656 driver sources to drivers/staging/vt6656.  These
files were copied from the driver directory in the upstream source archive,
available here:

  http://www.viaarena.com/Driver/VT6656_Linux_src_v1.19_12_x86.zip

After copying, trailing whitespace was stripped.  This is GPL-licensed code.
Signed-off-by: default avatarForest Bond <forest@alittletooquiet.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 36c7928c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#
# Build options:
#
#
HOSTAP := 1
KSP := /lib/modules/$(shell uname -r)/build \
/usr/src/linux-$(shell uname -r) \
/usr/src/linux-$(shell uname -r | sed 's/-.*//') \
/usr/src/kernel-headers-$(shell uname -r) \
/usr/src/kernel-source-$(shell uname -r) \
/usr/src/linux-$(shell uname -r | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
/usr/src/linux
test_dir = $(shell [ -e $(dir)/include/linux ] && echo $(dir))
KSP := $(foreach dir, $(KSP), $(test_dir))
KSRC := $(firstword $(KSP))
ifeq (,$(KSRC))
$(error Linux kernel source not found)
endif
# check kernel version
KVER := $(shell uname -r | cut -c1-3 | sed 's/2\.[56]/2\.6/')
KERVER2=$(shell uname -r | cut -d. -f2)
ifeq ($(KVER), 2.6)
# 2.6 kernel
TARGET = vntwusb.ko
else
TARGET = vntwusb.o
endif
INSTDIR := $(shell find /lib/modules/$(shell uname -r) -name $(TARGET) -printf "%h\n" | sort | head -1)
ifeq (,$(INSTDIR))
ifeq (,$(KERVER2))
ifneq (,$(wildcard /lib/modules/$(shell uname -r)/kernel))
INSTDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net
else
INSTDIR := /lib/modules/$(shell uname -r)/net
endif
else
ifneq ($(KERVER2),2)
INSTDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net
else
INSTDIR := /lib/modules/$(shell uname -r)/net
endif
endif
endif
SRC = main_usb.c card.c mac.c baseband.c wctl.c 80211mgr.c \
wcmd.c wmgr.c bssdb.c wpa2.c rxtx.c dpc.c power.c datarate.c \
mib.c rc4.c tether.c tcrc.c ioctl.c hostap.c wpa.c key.c \
tkip.c michael.c rf.c iwctl.c wpactl.c aes_ccmp.c \
usbpipe.c channel.c control.c firmware.c int.c
ifeq ($(HOSTAP), 1)
# CFLAGS += -DHOSTAP
EXTRA_CFLAGS += -DHOSTAP
endif
#CFLAGS += -I$(PWD) -I$(PWD)/../include -I$(PWD)/include
EXTRA_CFLAGS += -I$(PWD) -I$(PWD)/../include -I$(PWD)/include
# build rule
ifeq ($(KVER), 2.6)
# 2.6 kernel
ifndef KERNEL_CONF
KERNEL_CONF= $(KSRC)/.config
endif
include ${KERNEL_CONF}
obj-m += vntwusb.o
vntwusb-objs := main_usb.o card.o mac.o baseband.o wctl.o 80211mgr.o \
wcmd.o wmgr.o bssdb.o rxtx.o dpc.o power.o datarate.o \
mib.o rc4.o tether.o tcrc.o ioctl.o hostap.o wpa.o key.o tkip.o \
michael.o rf.o iwctl.o wpactl.o wpa2.o aes_ccmp.o \
usbpipe.o channel.o control.o firmware.o int.o
.c.o:
# $(CC) $(CFLAGS) -o $@ $<
$(CC) $(EXTRA_CFLAGS) -o $@ $<
default:
make -C $(KSRC) SUBDIRS=$(shell pwd) modules
else
# 2.2/2.4 kernel
OBJS := main_usb.o card.o mac.o baseband.o wctl.o 80211mgr.o \
wcmd.o wmgr.o bssdb.o rxtx.o dpc.o power.o datarate.o \
mib.o rc4.o tether.o tcrc.o ioctl.o hostap.o wpa.o key.o tkip.o \
michael.o rf.o iwctl.o wpactl.o wpa2.o aes_ccmp.o \
usbpipe.o channel.o control.o
VERSION_FILE := $(KSRC)/include/linux/version.h
CONFIG_FILE := $(KSRC)/include/linux/config.h
ifeq (,$(wildcard $(VERSION_FILE)))
$(error Linux kernel source not configured - missing version.h)
endif
ifeq (,$(wildcard $(CONFIG_FILE)))
$(error Linux kernel source not configured - missing config.h)
endif
ifneq (,$(findstring egcs-2.91.66, $(shell cat /proc/version)))
CC := kgcc gcc cc
else
CC := gcc cc
endif
test_cc = $(shell which $(cc) > /dev/null 2>&1 && echo $(cc))
CC := $(foreach cc, $(CC), $(test_cc))
CC := $(firstword $(CC))
#CFLAGS += -Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe
#CFLAGS += -I$(KSRC)/include -Wstrict-prototypes -fomit-frame-pointer -fno-strict-aliasing
#CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
# echo "-DMODVERSIONS -include $(KSRC)/include/linux/modversions.h")
EXTRA_CFLAGS += -Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe
EXTRA_CFLAGS += -I$(KSRC)/include -Wstrict-prototypes -fomit-frame-pointer -fno-strict-aliasing
EXTRA_CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
echo "-DMODVERSIONS -include $(KSRC)/include/linux/modversions.h")
.SILENT: $(TARGET) clean
# look for SMP in config.h
#SMP := $(shell $(CC) $(CFLAGS) -E -dM $(CONFIG_FILE) | \
# grep CONFIG_SMP | awk '{ print $$3 }')
SMP := $(shell $(CC) $(EXTRA_CFLAGS) -E -dM $(CONFIG_FILE) | \
grep CONFIG_SMP | awk '{ print $$3 }')
ifneq ($(SMP),1)
SMP := 0
endif
ifeq ($(SMP), 1)
# CFLAGS += -D__SMP__
EXTRA_CFLAGS += -D__SMP__
endif
# check x86_64
SUBARCH := $(shell uname -m)
ifeq ($(SUBARCH),x86_64)
# CFLAGS += -mcmodel=kernel -mno-red-zone
EXTRA_CFLAGS += -mcmodel=kernel -mno-red-zone
endif
$(TARGET): $(filter-out $(TARGET), $(SRC:.c=.o))
$(LD) -r $^ -o $@
echo; echo
echo "**************************************************"
echo "Build options:"
echo " VERSION $(KVER)"
echo -n " SMP "
if [ "$(SMP)" = "1" ]; \
then echo "Enabled"; else echo "Disabled"; fi
endif # ifeq ($(KVER),2.6)
ifeq ($(KVER), 2.6)
install: default
else
install: clean $(TARGET)
endif
mkdir -p $(MOD_ROOT)$(INSTDIR)
install -m 644 -o root $(TARGET) $(MOD_ROOT)$(INSTDIR)
ifeq (,$(MOD_ROOT))
/sbin/depmod -a || true
else
/sbin/depmod -b $(MOD_ROOT) -a || true
endif
uninstall:
rm -f $(INSTDIR)/$(TARGET)
/sbin/depmod -a
clean:
rm -f $(TARGET) $(SRC:.c=.o) *~ *.o
rm -f .*.o.d .*.o.cmd .*.ko.cmd *.mod.c *.mod.o
-include .depend.mak
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: aes_ccmp.h
*
* Purpose: AES_CCMP Decryption
*
* Author: Warren Hsu
*
* Date: Feb 15, 2005
*
*/
#ifndef __AES_H__
#define __AES_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
/*--------------------- Export Definitions -------------------------*/
/*--------------------- Export Types ------------------------------*/
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
BOOL AESbGenCCMP(PBYTE pbyRxKey, PBYTE pbyFrame, WORD wFrameSize);
#endif //__AES_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: baseband.h
*
* Purpose: Implement functions to access baseband
*
* Author: Jerry Chen
*
* Date: Jun. 5, 2002
*
* Revision History:
* 06-10-2003 Bryan YC Fan: Re-write codes to support VT3253 spec.
* 08-26-2003 Kyle Hsu : Add defines of packet type and TX rate.
*/
#ifndef __BASEBAND_H__
#define __BASEBAND_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
#if !defined(__TETHER_H__)
#include "tether.h"
#endif
#if !defined(__DEVICE_H__)
#include "device.h"
#endif
/*--------------------- Export Definitions -------------------------*/
#define PREAMBLE_LONG 0
#define PREAMBLE_SHORT 1
//
// Registers in the BASEBAND
//
#define BB_MAX_CONTEXT_SIZE 256
#define C_SIFS_A 16 // micro sec.
#define C_SIFS_BG 10
#define C_EIFS 80 // micro sec.
#define C_SLOT_SHORT 9 // micro sec.
#define C_SLOT_LONG 20
#define C_CWMIN_A 15 // slot time
#define C_CWMIN_B 31
#define C_CWMAX 1023 // slot time
//0:11A 1:11B 2:11G
#define BB_TYPE_11A 0
#define BB_TYPE_11B 1
#define BB_TYPE_11G 2
//0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate)
#define PK_TYPE_11A 0
#define PK_TYPE_11B 1
#define PK_TYPE_11GB 2
#define PK_TYPE_11GA 3
#define TOP_RATE_54M 0x80000000
#define TOP_RATE_48M 0x40000000
#define TOP_RATE_36M 0x20000000
#define TOP_RATE_24M 0x10000000
#define TOP_RATE_18M 0x08000000
#define TOP_RATE_12M 0x04000000
#define TOP_RATE_11M 0x02000000
#define TOP_RATE_9M 0x01000000
#define TOP_RATE_6M 0x00800000
#define TOP_RATE_55M 0x00400000
#define TOP_RATE_2M 0x00200000
#define TOP_RATE_1M 0x00100000
/*--------------------- Export Types ------------------------------*/
/*--------------------- Export Macros ------------------------------*/
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
UINT
BBuGetFrameTime(
IN BYTE byPreambleType,
IN BYTE byFreqType,
IN UINT cbFrameLength,
IN WORD wRate
);
VOID
BBvCaculateParameter (
IN PSDevice pDevice,
IN UINT cbFrameLength,
IN WORD wRate,
IN BYTE byPacketType,
OUT PWORD pwPhyLen,
OUT PBYTE pbyPhySrv,
OUT PBYTE pbyPhySgn
);
// timer for antenna diversity
VOID
TimerSQ3CallBack (
IN HANDLE hDeviceContext
);
VOID
TimerSQ3Tmax3CallBack (
IN HANDLE hDeviceContext
);
VOID BBvAntennaDiversity (PSDevice pDevice, BYTE byRxRate, BYTE bySQ3);
void BBvLoopbackOn (PSDevice pDevice);
void BBvLoopbackOff (PSDevice pDevice);
void BBvSoftwareReset (PSDevice pDevice);
void BBvSetShortSlotTime(PSDevice pDevice);
VOID BBvSetVGAGainOffset(PSDevice pDevice, BYTE byData);
void BBvSetAntennaMode(PSDevice pDevice, BYTE byAntennaMode);
BOOL BBbVT3184Init (PSDevice pDevice);
VOID BBvSetDeepSleep (PSDevice pDevice);
VOID BBvExitDeepSleep (PSDevice pDevice);
VOID BBvUpdatePreEDThreshold(
IN PSDevice pDevice,
IN BOOL bScanning
);
#ifdef __cplusplus
} /* End of extern "C" { */
#endif /* __cplusplus */
#endif // __BASEBAND_H__
This diff is collapsed.
This diff is collapsed.
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: card.h
*
* Purpose: Provide functions to setup NIC operation mode
*
* Author: Tevin Chen
*
* Date: May 21, 1996
*
*/
#ifndef __CARD_H__
#define __CARD_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
/*--------------------- Export Definitions -------------------------*/
/*--------------------- Export Classes ----------------------------*/
// Init card type
typedef enum _CARD_PHY_TYPE {
PHY_TYPE_AUTO=0,
PHY_TYPE_11B,
PHY_TYPE_11G,
PHY_TYPE_11A
} CARD_PHY_TYPE, DEF* PCARD_PHY_TYPE;
typedef enum _CARD_OP_MODE {
OP_MODE_INFRASTRUCTURE=0,
OP_MODE_ADHOC,
OP_MODE_AP,
OP_MODE_UNKNOWN
} CARD_OP_MODE, *PCARD_OP_MODE;
#define CB_MAX_CHANNEL_24G 14
//#define CB_MAX_CHANNEL_5G 24
#define CB_MAX_CHANNEL_5G 42 //[20050104] add channel9(5045MHz), 41==>42
#define CB_MAX_CHANNEL (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
BOOL CARDbSetMediaChannel(PVOID pDeviceHandler, UINT uConnectionChannel);
void CARDvSetRSPINF(PVOID pDeviceHandler, BYTE byBBType);
void vUpdateIFS(PVOID pDeviceHandler);
void CARDvUpdateBasicTopRate(PVOID pDeviceHandler);
BOOL CARDbAddBasicRate(PVOID pDeviceHandler, WORD wRateIdx);
BOOL CARDbIsOFDMinBasicRate(PVOID pDeviceHandler);
void CARDvAdjustTSF(PVOID pDeviceHandler, BYTE byRxRate, QWORD qwBSSTimestamp, QWORD qwLocalTSF);
BOOL CARDbGetCurrentTSF (PVOID pDeviceHandler, PQWORD pqwCurrTSF);
BOOL CARDbClearCurrentTSF(PVOID pDeviceHandler);
void CARDvSetFirstNextTBTT(PVOID pDeviceHandler, WORD wBeaconInterval);
void CARDvUpdateNextTBTT(PVOID pDeviceHandler, QWORD qwTSF, WORD wBeaconInterval);
QWORD CARDqGetNextTBTT(QWORD qwTSF, WORD wBeaconInterval);
QWORD CARDqGetTSFOffset(BYTE byRxRate, QWORD qwTSF1, QWORD qwTSF2);
BOOL CARDbRadioPowerOff(PVOID pDeviceHandler);
BOOL CARDbRadioPowerOn(PVOID pDeviceHandler);
BYTE CARDbyGetPktType(PVOID pDeviceHandler);
void CARDvSetBSSMode(PVOID pDeviceHandler);
BOOL
CARDbChannelSwitch (
IN PVOID pDeviceHandler,
IN BYTE byMode,
IN BYTE byNewChannel,
IN BYTE byCount
);
#ifdef __cplusplus
} /* End of extern "C" { */
#endif /* __cplusplus */
#endif // __CARD_H__
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#VNT Configuration
[start]
ZONETYPE=EUROPE
AUTHENMODE=12
ENCRYPTIONMODE=34
<