Commit e642f099 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: add rt3070 wireless driver

This is the Ralink RT3070 driver from the company that does horrible
things like reading a config file from /etc.  However, the driver that
is currently under development from the wireless development community
is not working at all yet, so distros and users are using this version
instead (quite common hardware on a lot of netbook machines).

So here is this driver, for now, until the wireless developers get a
"clean" version into the main tree, or until this version is cleaned up
sufficiently to move out of the staging tree.

Ported to the Linux build system, fixed lots of build issues, forward
ported to the current kernel version, and other minor cleanups were all
done by me.

Cc: Linux wireless <linux-wireless@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 21a6a6e9
......@@ -73,6 +73,8 @@ source "drivers/staging/rt2860/Kconfig"
source "drivers/staging/rt2870/Kconfig"
source "drivers/staging/rt3070/Kconfig"
source "drivers/staging/comedi/Kconfig"
source "drivers/staging/asus_oled/Kconfig"
......
......@@ -19,6 +19,7 @@ obj-$(CONFIG_AGNX) += agnx/
obj-$(CONFIG_OTUS) += otus/
obj-$(CONFIG_RT2860) += rt2860/
obj-$(CONFIG_RT2870) += rt2870/
obj-$(CONFIG_RT3070) += rt3070/
obj-$(CONFIG_COMEDI) += comedi/
obj-$(CONFIG_ASUS_OLED) += asus_oled/
obj-$(CONFIG_PANEL) += panel/
......
This diff is collapsed.
config RT3070
tristate "Ralink 3070 wireless support"
depends on USB && X86 && WLAN_80211
---help---
This is an experimental driver for the Ralink 3070 wireless chip.
obj-$(CONFIG_RT3070) += rt3070sta.o
# TODO: all of these should be removed
EXTRA_CFLAGS += -DLINUX -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT
EXTRA_CFLAGS += -DRT2870 -DRT30xx -DRT3070
EXTRA_CFLAGS += -DCONFIG_STA_SUPPORT
EXTRA_CFLAGS += -DDBG
EXTRA_CFLAGS += -DDOT11_N_SUPPORT
EXTRA_CFLAGS += -DWPA_SUPPLICANT_SUPPORT
EXTRA_CFLAGS += -DNATIVE_WPA_SUPPLICANT_SUPPORT
rt3070sta-objs := \
common/md5.o \
common/mlme.o \
common/rtmp_wep.o \
common/action.o \
common/cmm_data.o \
common/rtmp_init.o \
common/rtmp_tkip.o \
common/cmm_sync.o \
common/eeprom.o \
common/cmm_sanity.o \
common/cmm_info.o \
common/cmm_wpa.o \
common/dfs.o \
common/spectrum.o \
sta/assoc.o \
sta/aironet.o \
sta/auth.o \
sta/auth_rsp.o \
sta/sync.o \
sta/sanity.o \
sta/rtmp_data.o \
sta/connect.o \
sta/wpa.o \
rt_linux.o \
rt_profile.o \
rt_main_dev.o \
sta_ioctl.o \
common/ba_action.o \
2870_main_dev.o \
common/2870_rtmp_init.o \
common/rtusb_io.o \
common/rtusb_bulk.o \
common/rtusb_data.o \
common/cmm_data_2870.o
/*
*************************************************************************
* Ralink Tech Inc.
* 5F., No.36, Taiyuan St., Jhubei City,
* Hsinchu County 302,
* Taiwan, R.O.C.
*
* (c) Copyright 2002-2007, Ralink Technology, Inc.
*
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
Module Name:
aironet.h
Abstract:
Revision History:
Who When What
-------- ---------- ----------------------------------------------
Name Date Modification logs
Paul Lin 04-06-15 Initial
*/
#ifndef __ACTION_H__
#define __ACTION_H__
typedef struct PACKED __HT_INFO_OCTET
{
#ifdef RT_BIG_ENDIAN
UCHAR Reserved:5;
UCHAR STA_Channel_Width:1;
UCHAR Forty_MHz_Intolerant:1;
UCHAR Request:1;
#else
UCHAR Request:1;
UCHAR Forty_MHz_Intolerant:1;
UCHAR STA_Channel_Width:1;
UCHAR Reserved:5;
#endif
} HT_INFORMATION_OCTET;
typedef struct PACKED __FRAME_HT_INFO
{
HEADER_802_11 Hdr;
UCHAR Category;
UCHAR Action;
HT_INFORMATION_OCTET HT_Info;
} FRAME_HT_INFO, *PFRAME_HT_INFO;
#endif /* __ACTION_H__ */
/*
*************************************************************************
* Ralink Tech Inc.
* 5F., No.36, Taiyuan St., Jhubei City,
* Hsinchu County 302,
* Taiwan, R.O.C.
*
* (c) Copyright 2002-2007, Ralink Technology, Inc.
*
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
Module Name:
aironet.h
Abstract:
Revision History:
Who When What
-------- ---------- ----------------------------------------------
Name Date Modification logs
Paul Lin 04-06-15 Initial
*/
#ifndef __AIRONET_H__
#define __AIRONET_H__
// Measurement Type definition
#define MSRN_TYPE_UNUSED 0
#define MSRN_TYPE_CHANNEL_LOAD_REQ 1
#define MSRN_TYPE_NOISE_HIST_REQ 2
#define MSRN_TYPE_BEACON_REQ 3
#define MSRN_TYPE_FRAME_REQ 4
// Scan Mode in Beacon Request
#define MSRN_SCAN_MODE_PASSIVE 0
#define MSRN_SCAN_MODE_ACTIVE 1
#define MSRN_SCAN_MODE_BEACON_TABLE 2
// PHY type definition for Aironet beacon report, CCX 2 table 36-9
#define PHY_FH 1
#define PHY_DSS 2
#define PHY_UNUSED 3
#define PHY_OFDM 4
#define PHY_HR_DSS 5
#define PHY_ERP 6
// RPI table in dBm
#define RPI_0 0 // Power <= -87
#define RPI_1 1 // -87 < Power <= -82
#define RPI_2 2 // -82 < Power <= -77
#define RPI_3 3 // -77 < Power <= -72
#define RPI_4 4 // -72 < Power <= -67
#define RPI_5 5 // -67 < Power <= -62
#define RPI_6 6 // -62 < Power <= -57
#define RPI_7 7 // -57 < Power
// Cisco Aironet IAPP definetions
#define AIRONET_IAPP_TYPE 0x32
#define AIRONET_IAPP_SUBTYPE_REQUEST 0x01
#define AIRONET_IAPP_SUBTYPE_REPORT 0x81
// Measurement Request detail format
typedef struct _MEASUREMENT_REQUEST {
UCHAR Channel;
UCHAR ScanMode; // Use only in beacon request, other requests did not use this field
USHORT Duration;
} MEASUREMENT_REQUEST, *PMEASUREMENT_REQUEST;
// Beacon Measurement Report
// All these field might change to UCHAR, because we didn't do anything to these report.
// We copy all these beacons and report to CCX 2 AP.
typedef struct _BEACON_REPORT {
UCHAR Channel;
UCHAR Spare;
USHORT Duration;
UCHAR PhyType; // Definiation is listed above table 36-9
UCHAR RxPower;
UCHAR BSSID[6];
UCHAR ParentTSF[4];
UCHAR TargetTSF[8];
USHORT BeaconInterval;
USHORT CapabilityInfo;
} BEACON_REPORT, *PBEACON_REPORT;
// Frame Measurement Report (Optional)
typedef struct _FRAME_REPORT {
UCHAR Channel;
UCHAR Spare;
USHORT Duration;
UCHAR TA;
UCHAR BSSID[6];
UCHAR RSSI;
UCHAR Count;
} FRAME_REPORT, *PFRAME_REPORT;
#pragma pack(1)
// Channel Load Report
typedef struct _CHANNEL_LOAD_REPORT {
UCHAR Channel;
UCHAR Spare;
USHORT Duration;
UCHAR CCABusy;
} CHANNEL_LOAD_REPORT, *PCHANNEL_LOAD_REPORT;
#pragma pack()
// Nosie Histogram Report
typedef struct _NOISE_HIST_REPORT {
UCHAR Channel;
UCHAR Spare;
USHORT Duration;
UCHAR Density[8];
} NOISE_HIST_REPORT, *PNOISE_HIST_REPORT;
// Radio Management Capability element
typedef struct _RADIO_MANAGEMENT_CAPABILITY {
UCHAR Eid; // TODO: Why the Eid is 1 byte, not normal 2 bytes???
UCHAR Length;
UCHAR AironetOui[3]; // AIronet OUI (00 40 96)
UCHAR Type; // Type / Version
USHORT Status; // swap16 required
} RADIO_MANAGEMENT_CAPABILITY, *PRADIO_MANAGEMENT_CAPABILITY;
// Measurement Mode Bit definition
typedef struct _MEASUREMENT_MODE {
UCHAR Rsvd:4;
UCHAR Report:1;
UCHAR NotUsed:1;
UCHAR Enable:1;
UCHAR Parallel:1;
} MEASUREMENT_MODE, *PMEASUREMENT_MODE;
// Measurement Request element, This is little endian mode
typedef struct _MEASUREMENT_REQUEST_ELEMENT {
USHORT Eid;
USHORT Length; // swap16 required
USHORT Token; // non-zero unique token
UCHAR Mode; // Measurement Mode
UCHAR Type; // Measurement type
} MEASUREMENT_REQUEST_ELEMENT, *PMEASUREMENT_REQUEST_ELEMENT;
// Measurement Report element, This is little endian mode
typedef struct _MEASUREMENT_REPORT_ELEMENT {
USHORT Eid;
USHORT Length; // swap16 required
USHORT Token; // non-zero unique token
UCHAR Mode; // Measurement Mode
UCHAR Type; // Measurement type
} MEASUREMENT_REPORT_ELEMENT, *PMEASUREMENT_REPORT_ELEMENT;
// Cisco Aironet IAPP Frame Header, Network byte order used
typedef struct _AIRONET_IAPP_HEADER {
UCHAR CiscoSnapHeader[8]; // 8 bytes Cisco snap header
USHORT Length; // IAPP ID & length, remember to swap16 in LE system
UCHAR Type; // IAPP type
UCHAR SubType; // IAPP subtype
UCHAR DA[6]; // Destination MAC address
UCHAR SA[6]; // Source MAC address
USHORT Token; // Dialog token, no need to swap16 since it is for yoken usage only
} AIRONET_IAPP_HEADER, *PAIRONET_IAPP_HEADER;
// Radio Measurement Request frame
typedef struct _AIRONET_RM_REQUEST_FRAME {
AIRONET_IAPP_HEADER IAPP; // Common header
UCHAR Delay; // Activation Delay
UCHAR Offset; // Measurement offset
} AIRONET_RM_REQUEST_FRAME, *PAIRONET_RM_REQUEST_FRAME;
// Radio Measurement Report frame
typedef struct _AIRONET_RM_REPORT_FRAME {
AIRONET_IAPP_HEADER IAPP; // Common header
} AIRONET_RM_REPORT_FRAME, *PAIRONET_RM_REPORT_FRAME;
// Saved element request actions which will saved in StaCfg.
typedef struct _RM_REQUEST_ACTION {
MEASUREMENT_REQUEST_ELEMENT ReqElem; // Saved request element
MEASUREMENT_REQUEST Measurement; // Saved measurement within the request element
} RM_REQUEST_ACTION, *PRM_REQUEST_ACTION;
// CCX administration control
typedef union _CCX_CONTROL {
struct {
UINT32 Enable:1; // Enable CCX2
UINT32 LeapEnable:1; // Enable LEAP at CCX2
UINT32 RMEnable:1; // Radio Measurement Enable
UINT32 DCRMEnable:1; // Non serving channel Radio Measurement enable
UINT32 QOSEnable:1; // Enable QOS for CCX 2.0 support
UINT32 FastRoamEnable:1; // Enable fast roaming
UINT32 Rsvd:2; // Not used
UINT32 dBmToRoam:8; // the condition to roam when receiving Rssi less than this value. It's negative value.
UINT32 TuLimit:16; // Limit for different channel scan
} field;
UINT32 word;
} CCX_CONTROL, *PCCX_CONTROL;
#endif // __AIRONET_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.
/*
*************************************************************************
* Ralink Tech Inc.
* 5F., No.36, Taiyuan St., Jhubei City,
* Hsinchu County 302,
* Taiwan, R.O.C.
*
* (c) Copyright 2002-2007, Ralink Technology, Inc.
*
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
*/
#include "../rt_config.h"
#include "netif_block.h"
static NETIF_ENTRY freeNetIfEntryPool[FREE_NETIF_POOL_SIZE];
static LIST_HEADER freeNetIfEntryList;
void initblockQueueTab(
IN PRTMP_ADAPTER pAd)
{
int i;
initList(&freeNetIfEntryList);
for (i = 0; i < FREE_NETIF_POOL_SIZE; i++)
insertTailList(&freeNetIfEntryList, (PLIST_ENTRY)&freeNetIfEntryPool[i]);
for (i=0; i < NUM_OF_TX_RING; i++)
initList(&pAd->blockQueueTab[i].NetIfList);
return;
}
BOOLEAN blockNetIf(
IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry,
IN PNET_DEV pNetDev)
{
PNETIF_ENTRY pNetIfEntry = NULL;
if ((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(&freeNetIfEntryList)) != NULL)
{
netif_stop_queue(pNetDev);
pNetIfEntry->pNetDev = pNetDev;
insertTailList(&pBlockQueueEntry->NetIfList, (PLIST_ENTRY)pNetIfEntry);
pBlockQueueEntry->SwTxQueueBlockFlag = TRUE;
DBGPRINT(RT_DEBUG_TRACE, ("netif_stop_queue(%s)\n", pNetDev->name));
}
else
return FALSE;
return TRUE;
}
VOID releaseNetIf(
IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry)
{
PNETIF_ENTRY pNetIfEntry = NULL;
PLIST_HEADER pNetIfList = &pBlockQueueEntry->NetIfList;
while((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(pNetIfList)) != NULL)
{
PNET_DEV pNetDev = pNetIfEntry->pNetDev;
netif_wake_queue(pNetDev);
insertTailList(&freeNetIfEntryList, (PLIST_ENTRY)pNetIfEntry);
DBGPRINT(RT_DEBUG_TRACE, ("netif_wake_queue(%s)\n", pNetDev->name));
}
pBlockQueueEntry->SwTxQueueBlockFlag = FALSE;
return;
}
VOID StopNetIfQueue(
IN PRTMP_ADAPTER pAd,
IN UCHAR QueIdx,
IN PNDIS_PACKET pPacket)
{
PNET_DEV NetDev = NULL;
UCHAR IfIdx = 0;
BOOLEAN valid = FALSE;
#ifdef WDS_SUPPORT
if (RTMP_GET_PACKET_NET_DEVICE(pPacket) >= MIN_NET_DEVICE_FOR_WDS)
{
IfIdx = (RTMP_GET_PACKET_NET_DEVICE(pPacket) - MIN_NET_DEVICE_FOR_WDS) % MAX_WDS_ENTRY;
NetDev = pAd->WdsTab.WdsEntry[IfIdx].dev;
}
else
#endif // WDS_SUPPORT //
{
#ifdef MBSS_SUPPORT
if (pAd->OpMode == OPMODE_AP)
{
IfIdx = (RTMP_GET_PACKET_NET_DEVICE(pPacket) - MIN_NET_DEVICE_FOR_MBSSID) % MAX_MBSSID_NUM;
NetDev = pAd->ApCfg.MBSSID[IfIdx].MSSIDDev;
}
else
{
IfIdx = MAIN_MBSSID;
NetDev = pAd->net_dev;
}
#else
IfIdx = MAIN_MBSSID;
NetDev = pAd->net_dev;
#endif
}
// WMM support 4 software queues.
// One software queue full doesn't mean device have no capbility to transmit packet.
// So disable block Net-If queue function while WMM enable.
#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
valid = (pAd->CommonCfg.bWmmCapable == TRUE) ? FALSE : TRUE;
#endif // CONFIG_STA_SUPPORT //
if (valid)
blockNetIf(&pAd->blockQueueTab[QueIdx], NetDev);
return;
}
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.
/*
*************************************************************************
* Ralink Tech Inc.
* 5F., No.36, Taiyuan St., Jhubei City,
* Hsinchu County 302,
* Taiwan, R.O.C.
*
* (c) Copyright 2002-2007, Ralink Technology, Inc.
*
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
*/
#ifndef __MD4_H__
#define __MD4_H__
/* MD4 context. */
typedef struct _MD4_CTX_ {
ULONG state[4]; /* state (ABCD) */
ULONG count[2]; /* number of bits, modulo 2^64 (lsb first) */
UCHAR buffer[64]; /* input buffer */
} MD4_CTX;
VOID MD4Init (MD4_CTX *);
VOID MD4Update (MD4_CTX *, PUCHAR, UINT);
VOID MD4Final (UCHAR [16], MD4_CTX *);
#endif //__MD4_H__
\ No newline at end of file
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.
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