commit 0d75814f0fadabf669881951da8e7e991ce052a9 Author: Jiri Slaby Date: Mon Jun 18 16:00:00 2007 +0200 get rid of most headers since we will merge the hal and the driver together diff --git a/README b/README new file mode 100644 index 0000000..51b3814 --- /dev/null +++ b/README @@ -0,0 +1,117 @@ +Linux OpenHAL 20072703 +====================== +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ + * This is a port of the ar5k hal for atheros device drivers that is * + * source-compatible with the Madwifi driver for linux. * + * * + * Code ported, modified for combatibility and some bugs were fixed by * + * Nick "Mick Flemm" Kossifidis (Athens Wireless Metropolitan Network) * + * and Pavel Roskin so ar5k can work propertly * + * on Linux. * + * * + * Currently only the 5212 code has been tested due to lack of hardware. * + * * + * Some code from John Bicket's port (roofnet project) was taken, you can * + * can find his OpenHAL here -> http://pdos.csail.mit.edu/~jbicket/openhal/ * + * * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * +\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +DEVELOPMENT +=========== + +We are basing our openhal on OpenBSD's ar5k. Because of this and since the GPL does not +allow us to commit changes on the GPL version back to the BSD version please sumbit your +non-linux enhancements to the HAL to "Reyk Floeter" and CC madwifi-devel. + + +About AR5K +================= +ar5k is a free replacement of the binary-only HAL used by some drivers +for Atheros chipsets. While using a different ABI, it tries to be +source-compatible with the original (non-free) HAL interface. + +It is maintained by Reyk Floeter and many others. You can find more +infos at http://team.vantronix.net/ar5k/ or inside ar5k's source. + +The ar5k hal maintained at OpenBSD +http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/ic/#dirlist + + +About channels and regulatory domains +===================================== + +Regulatory domain restrictions are enabled by default to follow ETSI and FCC standards. +If you want to be legal you shouldn't disable regdomains, althow if you want to +experiment etc there are 2 ways you can override regdomains: + +a) Change SUPERCHANNEL to 1 (opt_ah.h) +b) Change your card's regulatory domain (EEPROM) to 0x00 + +WARNING: Whatever you do with your hardware is YOUR resposibility, don't blame the developers +if you get caught using your hardware outside legal ranges etc, you 've been warned... + +The goal of this project is to create an open-source free alternative to binary HAL from Atheros, +NOT to allow more channels/frequencies etc. + + +About AWMN +========== +Athens Wireless Metropolitan Network is a community radio network based in Athens, Greece. +Its members are node owners, comprising the Athens metropolitan area network, which at the +moment has roughly 750 active nodes, using 802.11b and 802.11a wireless technology for interconnection. + +Its aims include: + + * The development and use of community wireless network throughout the greater Athens area. + * The development of wireless technology and its implementation. + * Making the public aware of wireless networks and their use. + * Educating it's members and the public on the use and benefits of wireless networks. + +The Athens Wireless Metropolitan Network +http://www.awmn.net + + +Building +======== +To build OpenHAL with MadWiFi, place the OpenHAL source directory in the +MadWiFi directory. Edit Makefile.inc and set the following: + +HAL=${DEPTH}/ +ATH_HAL=${DEPTH}/ + +After that, go to the top directory and build like you normally would. + +WARNING: Don't delete the empty files included (ah_desc.h etc) + +Note: Currenty works for MadWiFi-old + +Use +===== +You 'll have to set everything propertly for things to work +e.g. you 'll first need to set the mode (a/b/g) using + +iwpriv mode X + +Then if you want to use it as an AP you'll have to set channel + +iwconfig athX channel x + +Txpower currently seems to be buggy, in measurements I did it seems that +tx power differs from -56 to -41 dbm, setting txpower does change txpower +but not in a normal way -needs revision. + + +TODO +==== +* Lot's of tests and fixes. +* Make it combatible with newer versions of MadWiFi (after the merge). +* Test 5210/5211 code. diff --git a/ath/if_ath.c b/ath/if_ath.c index 81f0ca1..f2a6748 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -70,9 +70,7 @@ /*#include "radar.h"*/ #include "if_athvar.h" -#include "ah_desc.h" -#include "ah_devid.h" /* XXX to identify IBM cards */ -#include "ah.h" +#include "ath5k.h" #ifdef ATH_PCI /* PCI BUS */ #include "if_ath_pci.h" @@ -555,7 +553,8 @@ ath_attach(u_int16_t devid, struct net_device *dev) * 5211 minipci cards. Users can also manually enable/disable * support with a sysctl. */ - sc->sc_softled = (devid == AR5212_DEVID_IBM || devid == AR5211_DEVID); + sc->sc_softled = (devid == PCI_DEVICE_ID_ATHEROS_AR5212_IBM || + devid == PCI_DEVICE_ID_ATHEROS_AR5211); if (sc->sc_softled) { ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); diff --git a/ath/if_athvar.h b/ath/if_athvar.h index cb707cd..0df6d40 100644 --- a/ath/if_athvar.h +++ b/ath/if_athvar.h @@ -46,7 +46,7 @@ #include #include -#include "ah.h" +#include "ath5k.h" #include "if_athioctl.h" #include "if_athrate.h" diff --git a/openhal/README b/openhal/README deleted file mode 100644 index 51b3814..0000000 --- a/openhal/README +++ /dev/null @@ -1,117 +0,0 @@ -Linux OpenHAL 20072703 -====================== -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ - * This is a port of the ar5k hal for atheros device drivers that is * - * source-compatible with the Madwifi driver for linux. * - * * - * Code ported, modified for combatibility and some bugs were fixed by * - * Nick "Mick Flemm" Kossifidis (Athens Wireless Metropolitan Network) * - * and Pavel Roskin so ar5k can work propertly * - * on Linux. * - * * - * Currently only the 5212 code has been tested due to lack of hardware. * - * * - * Some code from John Bicket's port (roofnet project) was taken, you can * - * can find his OpenHAL here -> http://pdos.csail.mit.edu/~jbicket/openhal/ * - * * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * -\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - -DEVELOPMENT -=========== - -We are basing our openhal on OpenBSD's ar5k. Because of this and since the GPL does not -allow us to commit changes on the GPL version back to the BSD version please sumbit your -non-linux enhancements to the HAL to "Reyk Floeter" and CC madwifi-devel. - - -About AR5K -================= -ar5k is a free replacement of the binary-only HAL used by some drivers -for Atheros chipsets. While using a different ABI, it tries to be -source-compatible with the original (non-free) HAL interface. - -It is maintained by Reyk Floeter and many others. You can find more -infos at http://team.vantronix.net/ar5k/ or inside ar5k's source. - -The ar5k hal maintained at OpenBSD -http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/ic/#dirlist - - -About channels and regulatory domains -===================================== - -Regulatory domain restrictions are enabled by default to follow ETSI and FCC standards. -If you want to be legal you shouldn't disable regdomains, althow if you want to -experiment etc there are 2 ways you can override regdomains: - -a) Change SUPERCHANNEL to 1 (opt_ah.h) -b) Change your card's regulatory domain (EEPROM) to 0x00 - -WARNING: Whatever you do with your hardware is YOUR resposibility, don't blame the developers -if you get caught using your hardware outside legal ranges etc, you 've been warned... - -The goal of this project is to create an open-source free alternative to binary HAL from Atheros, -NOT to allow more channels/frequencies etc. - - -About AWMN -========== -Athens Wireless Metropolitan Network is a community radio network based in Athens, Greece. -Its members are node owners, comprising the Athens metropolitan area network, which at the -moment has roughly 750 active nodes, using 802.11b and 802.11a wireless technology for interconnection. - -Its aims include: - - * The development and use of community wireless network throughout the greater Athens area. - * The development of wireless technology and its implementation. - * Making the public aware of wireless networks and their use. - * Educating it's members and the public on the use and benefits of wireless networks. - -The Athens Wireless Metropolitan Network -http://www.awmn.net - - -Building -======== -To build OpenHAL with MadWiFi, place the OpenHAL source directory in the -MadWiFi directory. Edit Makefile.inc and set the following: - -HAL=${DEPTH}/ -ATH_HAL=${DEPTH}/ - -After that, go to the top directory and build like you normally would. - -WARNING: Don't delete the empty files included (ah_desc.h etc) - -Note: Currenty works for MadWiFi-old - -Use -===== -You 'll have to set everything propertly for things to work -e.g. you 'll first need to set the mode (a/b/g) using - -iwpriv mode X - -Then if you want to use it as an AP you'll have to set channel - -iwconfig athX channel x - -Txpower currently seems to be buggy, in measurements I did it seems that -tx power differs from -56 to -41 dbm, setting txpower does change txpower -but not in a normal way -needs revision. - - -TODO -==== -* Lot's of tests and fixes. -* Make it combatible with newer versions of MadWiFi (after the merge). -* Test 5210/5211 code. diff --git a/openhal/ah.h b/openhal/ah.h deleted file mode 100644 index f7e2f2b..0000000 --- a/openhal/ah.h +++ /dev/null @@ -1 +0,0 @@ -#include "ath5k.h" diff --git a/openhal/ah_desc.h b/openhal/ah_desc.h deleted file mode 100644 index e69de29..0000000 diff --git a/openhal/ah_devid.h b/openhal/ah_devid.h deleted file mode 100644 index f17813b..0000000 --- a/openhal/ah_devid.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Device IDs... - * - */ - -/* From /dev/pci/pcidevs.h also incudes updates from the binary HAL's ah_devid.h */ - -/*Products*/ -#define PCI_DEVICE_ID_ATHEROS_AR5210 0x0007 /* AR5210 */ -#define PCI_DEVICE_ID_ATHEROS_AR5311 0x0011 /* AR5311 */ -#define PCI_DEVICE_ID_ATHEROS_AR5211 0x0012 /* AR5211 */ -#define PCI_DEVICE_ID_ATHEROS_AR5212 0x0013 /* AR5212 */ -#define PCI_DEVICE_ID_3COM_3CRDAG675 0x0013 /* 3CRDAG675 (Atheros AR5212) */ -#define PCI_DEVICE_ID_3COM_2_3CRPAG175 0x0013 /* 3CRPAG175 (Atheros AR5212) */ -#define PCI_DEVICE_ID_ATHEROS_AR5210_AP 0x0207 /* AR5210 (Early) */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_IBM 0x1014 /* AR5212 (IBM MiniPCI) */ -#define PCI_DEVICE_ID_ATHEROS_AR5210_DEFAULT 0x1107 /* AR5210 (no eeprom) */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_DEFAULT 0x1113 /* AR5212 (no eeprom) */ -#define PCI_DEVICE_ID_ATHEROS_AR5211_DEFAULT 0x1112 /* AR5211 (no eeprom) */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_FPGA 0xf013 /* AR5212 (emulation board) */ -#define PCI_DEVICE_ID_ATHEROS_AR5211_LEGACY 0xff12 /* AR5211 (emulation board) */ -#define PCI_DEVICE_ID_ATHEROS_AR5211_FPGA11B 0xf11b /* AR5211 (emulation board) */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_REV2 0x0052 /* AR5312 WMAC (AP31) */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_REV7 0x0057 /* AR5312 WMAC (AP30-040) */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_REV8 0x0058 /* AR5312 WMAC (AP43-030) */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_0014 0x0014 /* AR5212 compatible */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_0015 0x0015 /* AR5212 compatible */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_0016 0x0016 /* AR5212 compatible */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_0017 0x0017 /* AR5212 compatible */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_0018 0x0018 /* AR5212 compatible */ -#define PCI_DEVICE_ID_ATHEROS_AR5212_0019 0x0019 /* AR5212 compatible */ -#define PCI_DEVICE_ID_ATHEROS_AR2413 0x001a /* AR2413 (Griffin-lite) */ -#define PCI_DEVICE_ID_ATHEROS_AR5413 0x001b /* AR5413 (Eagle) */ -#define PCI_DEVICE_ID_ATHEROS_AR5424 0x001c /* AR5424 (Condor PCI-E) */ - -#define AR5K_DEVID_AR2413 PCI_DEVICE_ID_ATHEROS_AR2413 -#define AR5K_DEVID_AR5413 PCI_DEVICE_ID_ATHEROS_AR5413 -#define AR5K_DEVID_AR5424 PCI_DEVICE_ID_ATHEROS_AR5424 - - -/*Combatibility with MadWiFi's definitions (bimary HAL)*/ - -#define ATHEROS_VENDOR_ID PCI_VENDOR_ATHEROS /* Atheros PCI vendor ID */ -#define ATHEROS_3COM_VENDOR_ID PCI_VENDOR_3COM2 /* 3Com 3CRPAG175 vendor ID */ -#define ATHEROS_3COM2_VENDOR_ID PCI_VENDOR_3COM /* 3Com 3CRDAG675 vendor ID */ - -/* AR5210 (for reference) */ -#define AR5210_DEFAULT PCI_DEVICE_ID_ATHEROS_AR5210_DEFAULT /* No eeprom HW default */ -#define AR5210_PROD PCI_DEVICE_ID_ATHEROS_AR5210 /* Final device ID */ -#define AR5210_AP PCI_DEVICE_ID_ATHEROS_AR5210_AP /* Early AP11s */ - -/* AR5211 */ -#define AR5211_DEFAULT PCI_DEVICE_ID_ATHEROS_AR5211_DEFAULT /* No eeprom HW default */ -#define AR5311_DEVID PCI_DEVICE_ID_ATHEROS_AR5311 /* Final ar5311 devid */ -#define AR5211_DEVID PCI_DEVICE_ID_ATHEROS_AR5211 /* Final ar5211 devid */ -#define AR5211_LEGACY PCI_DEVICE_ID_ATHEROS_AR5211_LEGACY /* Original emulation board */ -#define AR5211_FPGA11B PCI_DEVICE_ID_ATHEROS_AR5211_FPGA11B /* 11b emulation board */ - -/* AR5212 */ -#define AR5212_DEFAULT PCI_DEVICE_ID_ATHEROS_AR5212_DEFAULT /* No eeprom HW default */ -#define AR5212_DEVID PCI_DEVICE_ID_ATHEROS_AR5212 /* Final ar5212 devid */ -#define AR5212_FPGA PCI_DEVICE_ID_ATHEROS_AR5212_FPGA /* Emulation board */ -#define AR5212_DEVID_IBM PCI_DEVICE_ID_ATHEROS_AR5212_IBM /* IBM minipci ID */ -#define AR5212_AR5312_REV2 PCI_DEVICE_ID_ATHEROS_AR5212_REV2 /* AR5312 WMAC (AP31) */ -#define AR5212_AR5312_REV7 PCI_DEVICE_ID_ATHEROS_AR5212_REV7 /* AR5312 WMAC (AP30-040) */ -#define AR5212_AR2313_REV8 PCI_DEVICE_ID_ATHEROS_AR5212_REV8 /* AR2313 WMAC (AP43-030) */ - -/* AR5212 compatible devid's also attach to 5212 */ -#define AR5212_DEVID_0014 PCI_DEVICE_ID_ATHEROS_AR5212_0014 -#define AR5212_DEVID_0015 PCI_DEVICE_ID_ATHEROS_AR5212_0015 -#define AR5212_DEVID_0016 PCI_DEVICE_ID_ATHEROS_AR5212_0016 -#define AR5212_DEVID_0017 PCI_DEVICE_ID_ATHEROS_AR5212_0017 -#define AR5212_DEVID_0018 PCI_DEVICE_ID_ATHEROS_AR5212_0018 -#define AR5212_DEVID_0019 PCI_DEVICE_ID_ATHEROS_AR5212_0019 -#define AR5212_AR2413 PCI_DEVICE_ID_ATHEROS_AR2413 /* AR2413 aka Griffin-lite */ -#define AR5212_AR5413 PCI_DEVICE_ID_ATHEROS_AR5413 /* Eagle */ -#define AR5212_AR5424 PCI_DEVICE_ID_ATHEROS_AR5424 /* Condor (PCI express) */ - -/*Not-supported by OpenHAL*/ -/* AR5213 */ -#define AR5213_SREV_1_0 0x0055 -#define AR5213_SREV_REG 0x4020 - -#define AR_SUBVENDOR_ID_NOG 0x0e11 /* No 11G subvendor ID */ -#define AR_SUBVENDOR_ID_NEW_A 0x7065 /* Update device to new RD */ diff --git a/openhal/ah_osdep.h b/openhal/ah_osdep.h deleted file mode 100644 index 3b0661e..0000000 --- a/openhal/ah_osdep.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2006-2007 Nick Kossifidis - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - */ - -#include - -#define AR5K_PRINTF(fmt, ...) printk("%s: " fmt, __func__, ##__VA_ARGS__) -#define AR5K_PRINT(fmt) printk("%s: " fmt, __func__) -#ifdef AR5K_DEBUG -#define AR5K_TRACE printk("%s:%d\n", __func__, __LINE__) -#else -#define AR5K_TRACE -#endif diff --git a/openhal/ath5k.h b/openhal/ath5k.h index 07a146e..830612b 100644 --- a/openhal/ath5k.h +++ b/openhal/ath5k.h @@ -33,28 +33,60 @@ #ifndef _AR5K_H #define _AR5K_H +/* Set this to 1 to disable regulatory domain restrictions for channel tests. + * WARNING: This is for debuging only and has side effects (eg. scan takes too long + * and results timeouts). It's also illegal to tune to some of the supported frequencies + * in some countries, so use this at your own risk, you 've been warned. */ +#define CHAN_DEBUG 0 + +/* Uncomment this for debuging (warning that results TOO much output) */ +/*#define AR5K_DEBUG 1 */ + #include -/*Os dependent definitions*/ -#include "ah_osdep.h" #include "ath5k_hw.h" - -/*Regulatory domain & Channel definitions*/ #include "ieee80211_regdomain.h" - -/*Options*/ -#include "opt_ah.h" - -/* - *Translation for MadWiFi combatibility - *(damn this is changed AGAIN in if_ath.pci :P) - */ #include "translation.h" +/* PCI IDs */ +#define PCI_DEVICE_ID_ATHEROS_AR5210 0x0007 /* AR5210 */ +#define PCI_DEVICE_ID_ATHEROS_AR5311 0x0011 /* AR5311 */ +#define PCI_DEVICE_ID_ATHEROS_AR5211 0x0012 /* AR5211 */ +#define PCI_DEVICE_ID_ATHEROS_AR5212 0x0013 /* AR5212 */ +#define PCI_DEVICE_ID_3COM_3CRDAG675 0x0013 /* 3CRDAG675 (Atheros AR5212) */ +#define PCI_DEVICE_ID_3COM_2_3CRPAG175 0x0013 /* 3CRPAG175 (Atheros AR5212) */ +#define PCI_DEVICE_ID_ATHEROS_AR5210_AP 0x0207 /* AR5210 (Early) */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_IBM 0x1014 /* AR5212 (IBM MiniPCI) */ +#define PCI_DEVICE_ID_ATHEROS_AR5210_DEFAULT 0x1107 /* AR5210 (no eeprom) */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_DEFAULT 0x1113 /* AR5212 (no eeprom) */ +#define PCI_DEVICE_ID_ATHEROS_AR5211_DEFAULT 0x1112 /* AR5211 (no eeprom) */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_FPGA 0xf013 /* AR5212 (emulation board) */ +#define PCI_DEVICE_ID_ATHEROS_AR5211_LEGACY 0xff12 /* AR5211 (emulation board) */ +#define PCI_DEVICE_ID_ATHEROS_AR5211_FPGA11B 0xf11b /* AR5211 (emulation board) */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_REV2 0x0052 /* AR5312 WMAC (AP31) */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_REV7 0x0057 /* AR5312 WMAC (AP30-040) */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_REV8 0x0058 /* AR5312 WMAC (AP43-030) */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_0014 0x0014 /* AR5212 compatible */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_0015 0x0015 /* AR5212 compatible */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_0016 0x0016 /* AR5212 compatible */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_0017 0x0017 /* AR5212 compatible */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_0018 0x0018 /* AR5212 compatible */ +#define PCI_DEVICE_ID_ATHEROS_AR5212_0019 0x0019 /* AR5212 compatible */ +#define PCI_DEVICE_ID_ATHEROS_AR2413 0x001a /* AR2413 (Griffin-lite) */ +#define PCI_DEVICE_ID_ATHEROS_AR5413 0x001b /* AR5413 (Eagle) */ +#define PCI_DEVICE_ID_ATHEROS_AR5424 0x001c /* AR5424 (Condor PCI-E) */ + /****************************\ GENERIC DRIVER DEFINITIONS \****************************/ +#define AR5K_PRINTF(fmt, ...) printk("%s: " fmt, __func__, ##__VA_ARGS__) +#define AR5K_PRINT(fmt) printk("%s: " fmt, __func__) +#ifdef AR5K_DEBUG +#define AR5K_TRACE printk("%s:%d\n", __func__, __LINE__) +#else +#define AR5K_TRACE +#endif #define howmany(x, y) (((x)+((y)-1))/(y)) /* @@ -154,9 +186,9 @@ struct ath5k_srev_name { { "2112", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112 }, \ { "2112a", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112A }, \ { "xxxx", AR5K_VERSION_RAD, AR5K_SREV_UNKNOWN }, \ - { "2413", AR5K_VERSION_DEV, AR5K_DEVID_AR2413 }, \ - { "5413", AR5K_VERSION_DEV, AR5K_DEVID_AR5413 }, \ - { "5424", AR5K_VERSION_DEV, AR5K_DEVID_AR5424 }, \ + { "2413", AR5K_VERSION_DEV, PCI_DEVICE_ID_ATHEROS_AR2413 },\ + { "5413", AR5K_VERSION_DEV, PCI_DEVICE_ID_ATHEROS_AR5413 },\ + { "5424", AR5K_VERSION_DEV, PCI_DEVICE_ID_ATHEROS_AR5424 },\ { "xxxx", AR5K_VERSION_DEV, AR5K_SREV_UNKNOWN } \ } @@ -1218,69 +1250,4 @@ extern u_int ath_hal_getwirelessmodes(struct ath_hal *, enum ieee80211_countryc void ath_hal_detach(struct ath_hal *ah); struct ath_hal *ath_hal_attach(u16 devid, void *sc, void __iomem *h, enum ath5k_status *s); - -/* COMPAT stuff */ - -#ifdef CONFIG_OPENHAL_COMPAT -typedef u32 ieee80211_regdomain_t; - -typedef struct ath5k_node_stats AR5K_NODE_STATS; -typedef struct ath5k_rate_table AR5K_RATE_TABLE; -typedef struct ath5k_channel AR5K_CHANNEL; -typedef struct ath5k_keyval AR5K_KEYVAL; -typedef struct ath5k_txq_info AR5K_TXQ_INFO; - -typedef enum ieee80211_if_types AR5K_OPMODE; -typedef enum ath5k_int AR5K_INT; -typedef enum ath5k_status AR5K_STATUS; -typedef enum ath5k_pkt_type AR5K_PKT_TYPE; - -typedef void *AR5K_SOFTC; -typedef int AR5K_BUS_TAG; -typedef __iomem void *AR5K_BUS_HANDLE; -typedef u_int32_t AR5K_BUS_ADDR; - -typedef bool AR5K_BOOL; - -#define TRUE true -#define FALSE false - -#define AR5K_M_STA IEEE80211_IF_TYPE_STA -#define AR5K_M_IBSS IEEE80211_IF_TYPE_IBSS -#define AR5K_M_HOSTAP IEEE80211_IF_TYPE_AP -#define AR5K_M_MONITOR IEEE80211_IF_TYPE_MNTR - -#define PCI_PRODUCT_ATHEROS_AR5210_DEFAULT PCI_DEVICE_ID_ATHEROS_AR5210_DEFAULT -#define PCI_PRODUCT_ATHEROS_AR5210 PCI_DEVICE_ID_ATHEROS_AR5210 -#define PCI_PRODUCT_ATHEROS_AR5210_AP PCI_DEVICE_ID_ATHEROS_AR5210_AP -#define PCI_PRODUCT_ATHEROS_AR5212_IBM PCI_DEVICE_ID_ATHEROS_AR5212_IBM -#define PCI_PRODUCT_ATHEROS_AR5211 PCI_DEVICE_ID_ATHEROS_AR5211 -#define PCI_PRODUCT_ATHEROS_AR5211_DEFAULT PCI_DEVICE_ID_ATHEROS_AR5211_DEFAULT -#define PCI_PRODUCT_ATHEROS_AR5311 PCI_DEVICE_ID_ATHEROS_AR5311 -#define PCI_PRODUCT_ATHEROS_AR5211_LEGACY PCI_DEVICE_ID_ATHEROS_AR5211_LEGACY -#define PCI_PRODUCT_ATHEROS_AR5211_FPGA11B PCI_DEVICE_ID_ATHEROS_AR5211_FPGA11B -#define PCI_PRODUCT_ATHEROS_AR5212_DEFAULT PCI_DEVICE_ID_ATHEROS_AR5212_DEFAULT -#define PCI_PRODUCT_ATHEROS_AR5212 PCI_DEVICE_ID_ATHEROS_AR5212 -#define PCI_PRODUCT_ATHEROS_AR5212_FPGA PCI_DEVICE_ID_ATHEROS_AR5212_FPGA -#define PCI_PRODUCT_ATHEROS_AR5212_IBM PCI_DEVICE_ID_ATHEROS_AR5212_IBM -#define PCI_PRODUCT_ATHEROS_AR5212_REV2 PCI_DEVICE_ID_ATHEROS_AR5212_REV2 -#define PCI_PRODUCT_ATHEROS_AR5212_REV7 PCI_DEVICE_ID_ATHEROS_AR5212_REV7 -#define PCI_PRODUCT_ATHEROS_AR5212_REV8 PCI_DEVICE_ID_ATHEROS_AR5212_REV8 -#define PCI_PRODUCT_ATHEROS_AR5212_0014 PCI_DEVICE_ID_ATHEROS_AR5212_0014 -#define PCI_PRODUCT_ATHEROS_AR5212_0015 PCI_DEVICE_ID_ATHEROS_AR5212_0015 -#define PCI_PRODUCT_ATHEROS_AR5212_0016 PCI_DEVICE_ID_ATHEROS_AR5212_0016 -#define PCI_PRODUCT_ATHEROS_AR5212_0017 PCI_DEVICE_ID_ATHEROS_AR5212_0017 -#define PCI_PRODUCT_ATHEROS_AR5212_0018 PCI_DEVICE_ID_ATHEROS_AR5212_0018 -#define PCI_PRODUCT_ATHEROS_AR5212_0019 PCI_DEVICE_ID_ATHEROS_AR5212_0019 -#define PCI_PRODUCT_ATHEROS_AR2413 PCI_DEVICE_ID_ATHEROS_AR2413 -#define PCI_PRODUCT_ATHEROS_AR5413 PCI_DEVICE_ID_ATHEROS_AR5413 -#define PCI_PRODUCT_ATHEROS_AR5424 PCI_DEVICE_ID_ATHEROS_AR5424 - -static inline struct ath_hal *_ath_hal_attach(u16 devid, AR5K_SOFTC sc, - AR5K_BUS_TAG t, AR5K_BUS_HANDLE h, void *s) -{ - return ath_hal_attach(devid, sc, h, s); -} -#endif - #endif /* _AR5K_H */ diff --git a/openhal/ath5k_hw.c b/openhal/ath5k_hw.c index 4a1e44c..df0b1ec 100644 --- a/openhal/ath5k_hw.c +++ b/openhal/ath5k_hw.c @@ -27,7 +27,6 @@ #include #include -#include "ah_devid.h" #include "ath5k.h" #include "ath5kreg.h" diff --git a/openhal/ieee80211_regdomain.c b/openhal/ieee80211_regdomain.c index 172c0dc..4c0fd06 100644 --- a/openhal/ieee80211_regdomain.c +++ b/openhal/ieee80211_regdomain.c @@ -10,7 +10,9 @@ * Basic regulation domain extensions for the IEEE 802.11 stack */ -#include "ah_osdep.h" +#include +#include + #include "ieee80211_regdomain.h" static const struct ieee80211_regdomainname diff --git a/openhal/ieee80211_regdomain.h b/openhal/ieee80211_regdomain.h index 1c68e8f..7df7990 100644 --- a/openhal/ieee80211_regdomain.h +++ b/openhal/ieee80211_regdomain.h @@ -19,6 +19,8 @@ #ifndef _NET80211_IEEE80211_REGDOMAIN_H_ #define _NET80211_IEEE80211_REGDOMAIN_H_ +#include + enum ieee80211_regdomain { DMN_DEFAULT = 0x00, DMN_NULL_WORLD = 0x03, @@ -766,7 +768,6 @@ struct ieee80211_regchannel { { 5240, DMN_WORLD, CHANNEL_OFDM }, \ } - extern u16 ieee80211_name2countrycode(const char *); extern u32 ieee80211_name2regdomain(const char *); extern const char *ieee80211_countrycode2name(u16); @@ -774,5 +775,4 @@ extern const char *ieee80211_regdomain2name(u32); extern u32 ieee80211_regdomain2flag(u16, u16); extern u32 ieee80211_countrycode2regdomain(u16); - #endif /* _NET80211_IEEE80211_REGDOMAIN_H_ */ diff --git a/openhal/opt_ah.h b/openhal/opt_ah.h index b92921a..e69de29 100644 --- a/openhal/opt_ah.h +++ b/openhal/opt_ah.h @@ -1,8 +0,0 @@ -/* Set this to 1 to disable regulatory domain restrictions for channel tests. - * WARNING: This is for debuging only and has side effects (eg. scan takes too long - * and results timeouts). It's also illegal to tune to some of the supported frequencies - * in some countries, so use this at your own risk, you 've been warned. */ -#define CHAN_DEBUG 0 - -/* Uncomment this for debuging (warning that results TOO much output) */ -//#define AR5K_DEBUG 1