rpms/kernel/devel linux-2.6-at76.patch, NONE, 1.1 linux-2.6-ath5k.patch, NONE, 1.1 linux-2.6-mac80211-extras.patch, NONE, 1.1 linux-2.6-zd1211rw-mac80211.patch, NONE, 1.1 kernel.spec, 1.191, 1.192 linux-2.6-wireless-pending.patch, 1.4, 1.5 git-wireless-dev.patch, 1.36, NONE
John W. Linville (linville)
fedora-extras-commits at redhat.com
Thu Sep 27 00:44:08 UTC 2007
- Previous message (by thread): rpms/libsepol/devel .cvsignore, 1.123, 1.124 libsepol.spec, 1.165, 1.166 sources, 1.124, 1.125
- Next message (by thread): rpms/bzr/F-7 .cvsignore, 1.15, 1.16 bzr.spec, 1.20, 1.21 sources, 1.15, 1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: linville
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9101
Modified Files:
kernel.spec linux-2.6-wireless-pending.patch
Added Files:
linux-2.6-at76.patch linux-2.6-ath5k.patch
linux-2.6-mac80211-extras.patch
linux-2.6-zd1211rw-mac80211.patch
Removed Files:
git-wireless-dev.patch
Log Message:
Update and restructure wireless patches
linux-2.6-at76.patch:
--- NEW FILE linux-2.6-at76.patch ---
diff -up linux-2.6.22.noarch/MAINTAINERS.orig linux-2.6.22.noarch/MAINTAINERS
--- linux-2.6.22.noarch/MAINTAINERS.orig 2007-09-26 19:57:31.000000000 -0400
+++ linux-2.6.22.noarch/MAINTAINERS 2007-09-26 19:59:33.000000000 -0400
@@ -685,6 +685,15 @@ W: http://www.thekelleys.org.uk/atmel
W: http://atmelwlandriver.sourceforge.net/
S: Maintained
+ATMEL USB WIRELESS DRIVER
+P: Pavel Roskin
+M: proski at gnu.org
+L: linux-wireless at vger.kernel.org
+L: at76c503a-user at lists.berlios.de
+L: at76c503a-develop at lists.berlios.de
+W: http://at76c503a.berlios.de/
+S: Maintained
+
AUDIT SUBSYSTEM
P: David Woodhouse
M: dwmw2 at infradead.org
diff -up /dev/null linux-2.6.22.noarch/drivers/net/wireless/at76_usb.h
--- /dev/null 2007-09-25 08:26:55.562976333 -0400
+++ linux-2.6.22.noarch/drivers/net/wireless/at76_usb.h 2007-09-26 19:59:33.000000000 -0400
@@ -0,0 +1,662 @@
+/*
+ * Copyright (c) 2002,2003 Oliver Kurth
+ * (c) 2003,2004 Joerg Albert <joerg.albert at gmx.de>
+ * (c) 2007 Guido Guenther <agx at sigxcpu.org>
+ *
+ * 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 driver was based on information from the Sourceforge driver
+ * released and maintained by Atmel:
+ *
+ * http://sourceforge.net/projects/atmelwlandriver/
+ *
+ * Although the code was completely re-written,
+ * it would have been impossible without Atmel's decision to
+ * release an Open Source driver (unfortunately the firmware was
+ * kept binary only). Thanks for that decision to Atmel!
+ */
+
+#ifndef _AT76_USB_H
+#define _AT76_USB_H
+
+#include <net/ieee80211.h>
+
+/* current driver version */
+#define DRIVER_VERSION "0.16"
+
+/* Board types */
+enum board_type {
+ BOARD_503_ISL3861 = 1,
+ BOARD_503_ISL3863 = 2,
+ BOARD_503 = 3,
+ BOARD_503_ACC = 4,
+ BOARD_505 = 5,
+ BOARD_505_2958 = 6,
+ BOARD_505A = 7,
+ BOARD_505AMX = 8
+};
+
+/* our private ioctl's */
+/* preamble length (0 - long, 1 - short, 2 - auto) */
+#define AT76_SET_SHORT_PREAMBLE (SIOCIWFIRSTPRIV + 0)
+#define AT76_GET_SHORT_PREAMBLE (SIOCIWFIRSTPRIV + 1)
+/* which debug channels are enabled */
+#define AT76_SET_DEBUG (SIOCIWFIRSTPRIV + 2)
+#define AT76_GET_DEBUG (SIOCIWFIRSTPRIV + 3)
+/* power save mode (incl. the Atmel proprietary smart save mode) */
+#define AT76_SET_POWERSAVE_MODE (SIOCIWFIRSTPRIV + 4)
+#define AT76_GET_POWERSAVE_MODE (SIOCIWFIRSTPRIV + 5)
+/* min and max channel times for scan */
+#define AT76_SET_SCAN_TIMES (SIOCIWFIRSTPRIV + 6)
+#define AT76_GET_SCAN_TIMES (SIOCIWFIRSTPRIV + 7)
+/* scan mode (0 - active, 1 - passive) */
+#define AT76_SET_SCAN_MODE (SIOCIWFIRSTPRIV + 8)
+#define AT76_GET_SCAN_MODE (SIOCIWFIRSTPRIV + 9)
+
+#define CMD_STATUS_IDLE 0x00
+#define CMD_STATUS_COMPLETE 0x01
+#define CMD_STATUS_UNKNOWN 0x02
+#define CMD_STATUS_INVALID_PARAMETER 0x03
+#define CMD_STATUS_FUNCTION_NOT_SUPPORTED 0x04
+#define CMD_STATUS_TIME_OUT 0x07
+#define CMD_STATUS_IN_PROGRESS 0x08
+#define CMD_STATUS_HOST_FAILURE 0xff
+#define CMD_STATUS_SCAN_FAILED 0xf0
+
+/* answers to get op mode */
+#define OPMODE_NONE 0x00
+#define OPMODE_NORMAL_NIC_WITH_FLASH 0x01
+#define OPMODE_HW_CONFIG_MODE 0x02
+#define OPMODE_DFU_MODE_WITH_FLASH 0x03
+#define OPMODE_NORMAL_NIC_WITHOUT_FLASH 0x04
+
+#define CMD_SET_MIB 0x01
+#define CMD_GET_MIB 0x02
+#define CMD_SCAN 0x03
+#define CMD_JOIN 0x04
+#define CMD_START_IBSS 0x05
+#define CMD_RADIO 0x06
+#define CMD_STARTUP 0x0B
+#define CMD_GETOPMODE 0x33
+
+#define MIB_LOCAL 0x01
+#define MIB_MAC_ADDR 0x02
+#define MIB_MAC 0x03
+#define MIB_MAC_MGMT 0x05
+#define MIB_MAC_WEP 0x06
+#define MIB_PHY 0x07
+#define MIB_FW_VERSION 0x08
+#define MIB_MDOMAIN 0x09
+
+#define ADHOC_MODE 1
+#define INFRASTRUCTURE_MODE 2
+
+/* values for struct mib_local, field preamble_type */
+#define PREAMBLE_TYPE_LONG 0
+#define PREAMBLE_TYPE_SHORT 1
+#define PREAMBLE_TYPE_AUTO 2
+
+/* values for tx_rate */
+#define TX_RATE_1MBIT 0
+#define TX_RATE_2MBIT 1
+#define TX_RATE_5_5MBIT 2
+#define TX_RATE_11MBIT 3
+#define TX_RATE_AUTO 4
+
+/* power management modes */
+#define AT76_PM_OFF 1
+#define AT76_PM_ON 2
+#define AT76_PM_SMART 3
+
+struct hwcfg_r505 {
+ u8 cr39_values[14];
+ u8 reserved1[14];
+ u8 bb_cr[14];
+ u8 pidvid[4];
+ u8 mac_addr[ETH_ALEN];
+ u8 regulatory_domain;
+ u8 reserved2[14];
+ u8 cr15_values[14];
+ u8 reserved3[3];
+} __attribute__((packed));
+
+struct hwcfg_rfmd {
+ u8 cr20_values[14];
+ u8 cr21_values[14];
+ u8 bb_cr[14];
+ u8 pidvid[4];
+ u8 mac_addr[ETH_ALEN];
+ u8 regulatory_domain;
+ u8 low_power_values[14];
+ u8 normal_power_values[14];
+ u8 reserved1[3];
+} __attribute__((packed));
+
+struct hwcfg_intersil {
+ u8 mac_addr[ETH_ALEN];
+ u8 cr31_values[14];
+ u8 cr58_values[14];
+ u8 pidvid[4];
+ u8 regulatory_domain;
+ u8 reserved[1];
+} __attribute__((packed));
+
+union at76_hwcfg {
+ struct hwcfg_intersil i;
+ struct hwcfg_rfmd r3;
+ struct hwcfg_r505 r5;
+};
+
+#define WEP_SMALL_KEY_LEN (40 / 8)
+#define WEP_LARGE_KEY_LEN (104 / 8)
+
+struct at76_card_config {
+ u8 exclude_unencrypted;
+ u8 promiscuous_mode;
+ u8 short_retry_limit;
+ u8 encryption_type;
+ __le16 rts_threshold;
+ __le16 fragmentation_threshold; /* 256..2346 */
+ u8 basic_rate_set[4];
+ u8 auto_rate_fallback; /* 0,1 */
+ u8 channel;
+ u8 privacy_invoked;
+ u8 wep_default_key_id; /* 0..3 */
+ u8 current_ssid[32];
+ u8 wep_default_key_value[4][WEP_KEY_LEN];
+ u8 ssid_len;
+ u8 short_preamble;
+ __le16 beacon_period;
+} __attribute__((packed));
+
+struct at76_command {
+ u8 cmd;
[...5873 lines suppressed...]
+{
+ int ret;
+ struct at76_priv *priv;
+ struct fwentry *fwe;
+ struct usb_device *udev;
+ int op_mode;
+ int need_ext_fw = 0;
+ struct mib_fw_version fwv;
+ int board_type = (int)id->driver_info;
+
+ udev = usb_get_dev(interface_to_usbdev(interface));
+
+ /* Load firmware into kernel memory */
+ fwe = at76_load_firmware(udev, board_type);
+ if (!fwe) {
+ ret = -ENOENT;
+ goto error;
+ }
+
+ op_mode = at76_get_op_mode(udev);
+
+ at76_dbg(DBG_DEVSTART, "opmode %d", op_mode);
+
+ /* we get OPMODE_NONE with 2.4.23, SMC2662W-AR ???
+ we get 204 with 2.4.23, Fiberline FL-WL240u (505A+RFMD2958) ??? */
+
+ if (op_mode == OPMODE_HW_CONFIG_MODE) {
+ err("cannot handle a device in HW_CONFIG_MODE (opmode %d)",
+ op_mode);
+ ret = -EBUSY;
+ goto error;
+ }
+
+ if (op_mode != OPMODE_NORMAL_NIC_WITH_FLASH
+ && op_mode != OPMODE_NORMAL_NIC_WITHOUT_FLASH) {
+ /* download internal firmware part */
+ at76_dbg(DBG_DEVSTART, "downloading internal firmware");
+ ret = at76_load_internal_fw(udev, fwe);
+ if (ret < 0) {
+ err("error %d downloading internal firmware", ret);
+ goto error;
+ }
+ usb_put_dev(udev);
+ return ret;
+ }
+
+ /* Internal firmware already inside the device. Get firmware
+ * version to test if external firmware is loaded.
+ * This works only for newer firmware, e.g. the Intersil 0.90.x
+ * says "control timeout on ep0in" and subsequent
+ * at76_get_op_mode() fail too :-( */
+
+ /* if version >= 0.100.x.y or device with built-in flash we can
+ * query the device for the fw version */
+ if ((fwe->fw_version.major > 0 || fwe->fw_version.minor >= 100)
+ || (op_mode == OPMODE_NORMAL_NIC_WITH_FLASH)) {
+ ret = at76_get_mib(udev, MIB_FW_VERSION, &fwv, sizeof(fwv));
+ if (ret < 0 || (fwv.major | fwv.minor) == 0)
+ need_ext_fw = 1;
+ } else
+ /* No way to check firmware version, reload to be sure */
+ need_ext_fw = 1;
+
+ if (need_ext_fw) {
+ at76_dbg(DBG_DEVSTART, "downloading external firmware");
+
+ ret = at76_load_external_fw(udev, fwe);
+ if (ret)
+ goto error;
+
+ /* Re-check firmware version */
+ ret = at76_get_mib(udev, MIB_FW_VERSION, &fwv, sizeof(fwv));
+ if (ret < 0) {
+ err("error %d getting firmware version", ret);
+ goto error;
+ }
+
+ /* Major and minor version must match */
+ if (fwv.major != fwe->fw_version.major
+ || fwv.minor != fwe->fw_version.minor) {
+ printk(KERN_ERR DRIVER_NAME
+ ": wrong firmware version, loaded %d.%d.%d-%d, "
+ "read back %d.%d.%d-%d\n",
+ fwe->fw_version.major, fwe->fw_version.minor,
+ fwe->fw_version.patch, fwe->fw_version.build,
+ fwv.major, fwv.minor, fwv.patch, fwv.build);
+ ret = -EBUSY;
+ goto error;
+ }
+ }
+
+ priv = at76_alloc_new_device(udev);
+ if (!priv) {
+ ret = -ENOMEM;
+ goto error;
+ }
+
+ SET_NETDEV_DEV(priv->netdev, &interface->dev);
+ usb_set_intfdata(interface, priv);
+
+ memcpy(&priv->fw_version, &fwv, sizeof(struct mib_fw_version));
+ priv->board_type = board_type;
+
+ ret = at76_init_new_device(priv, interface);
+ if (ret < 0)
+ at76_delete_device(priv);
+
+ return ret;
+
+error:
+ usb_put_dev(udev);
+ return ret;
+}
+
+static void at76_disconnect(struct usb_interface *interface)
+{
+ struct at76_priv *priv;
+
+ priv = usb_get_intfdata(interface);
+ usb_set_intfdata(interface, NULL);
+
+ /* Disconnect after loading internal firmware */
+ if (!priv)
+ return;
+
+ printk(KERN_INFO "%s: disconnecting\n", priv->netdev->name);
+ at76_delete_device(priv);
+ printk(KERN_INFO DRIVER_NAME ": disconnected\n");
+}
+
+/* Structure for registering this driver with the USB subsystem */
+static struct usb_driver at76_driver = {
+ .name = DRIVER_NAME,
+ .probe = at76_probe,
+ .disconnect = at76_disconnect,
+ .id_table = dev_table,
+};
+
+static int __init at76_mod_init(void)
+{
+ int result;
+
+ printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION " loading\n");
+
+ mutex_init(&fw_mutex);
+
+ /* register this driver with the USB subsystem */
+ result = usb_register(&at76_driver);
+ if (result < 0)
+ err("usb_register failed (status %d)", result);
+
+ led_trigger_register_simple("at76_usb-tx", &ledtrig_tx);
+ return result;
+}
+
+static void __exit at76_mod_exit(void)
+{
+ int i;
+
+ printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION " unloading\n");
+ usb_deregister(&at76_driver);
+ for (i = 0; i < ARRAY_SIZE(firmwares); i++) {
+ if (firmwares[i].fw)
+ release_firmware(firmwares[i].fw);
+ }
+ led_trigger_unregister_simple(ledtrig_tx);
+}
+
+module_param_named(debug, at76_debug, int, 0600);
+MODULE_PARM_DESC(debug, "Debugging level");
+
+module_init(at76_mod_init);
+module_exit(at76_mod_exit);
+
+MODULE_AUTHOR("Oliver Kurth <oku at masqmail.cx>");
+MODULE_AUTHOR("Joerg Albert <joerg.albert at gmx.de>");
+MODULE_AUTHOR("Alex <alex at foogod.com>");
+MODULE_AUTHOR("Nick Jones");
+MODULE_AUTHOR("Balint Seeber <n0_5p4m_p13453 at hotmail.com>");
+MODULE_AUTHOR("Pavel Roskin <proski at gnu.org>");
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
diff -up linux-2.6.22.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.22.noarch/drivers/net/wireless/Kconfig
--- linux-2.6.22.noarch/drivers/net/wireless/Kconfig.orig 2007-09-26 19:57:31.000000000 -0400
+++ linux-2.6.22.noarch/drivers/net/wireless/Kconfig 2007-09-26 19:59:33.000000000 -0400
@@ -381,6 +381,14 @@ config PCI_HERMES
common. Some of the built-in wireless adaptors in laptops are of
this variety.
+config USB_ATMEL
+ tristate "Atmel at76c503/at76c505/at76c505a USB cards"
+ depends on WLAN_80211 && USB
+ select FW_LOADER
+ ---help---
+ Enable support for USB Wireless devices using Atmel at76c503,
+ at76c505 or at76c505a chips.
+
config PCMCIA_HERMES
tristate "Hermes PCMCIA card support"
depends on PCMCIA && HERMES
linux-2.6-ath5k.patch:
--- NEW FILE linux-2.6-ath5k.patch ---
diff -up linux-2.6.22.noarch/MAINTAINERS.orig linux-2.6.22.noarch/MAINTAINERS
--- linux-2.6.22.noarch/MAINTAINERS.orig 2007-09-26 19:59:33.000000000 -0400
+++ linux-2.6.22.noarch/MAINTAINERS 2007-09-26 20:00:12.000000000 -0400
@@ -642,6 +642,14 @@ M: ecashin at coraid.com
W: http://www.coraid.com/support/linux
S: Supported
+ATHEROS ATH5K WIRELESS DRIVER
+P: Jiri Slaby
+M: jirislaby at gmail.com
+P: Luis R. Rodriguez
+M: mcgrof at gmail.com
+L: linux-wireless at vger.kernel.org
+S: Maintained
+
ATL1 ETHERNET DRIVER
P: Jay Cliburn
M: jcliburn at gmail.com
diff -up /dev/null linux-2.6.22.noarch/drivers/net/wireless/ath5k.h
--- /dev/null 2007-09-25 08:26:55.562976333 -0400
+++ linux-2.6.22.noarch/drivers/net/wireless/ath5k.h 2007-09-26 20:00:12.000000000 -0400
@@ -0,0 +1,1104 @@
+/*
+ * Copyright (c) 2004-2007 Reyk Floeter <reyk at openbsd.org>
+ * Copyright (c) 2006-2007 Nick Kossifidis <mickflemm at gmail.com>
+ *
+ * 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.
+ *
+ * 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.
+ */
+
+#ifndef _ATH5K_H
+#define _ATH5K_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 it results in TOO much output) */
+/*#define AR5K_DEBUG 1 */
+
+#include <linux/types.h>
+#include <net/mac80211.h>
+
+#include "ath5k_hw.h"
+#include "ath5k_regdom.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(KERN_DEBUG "%s:%d\n", __func__, __LINE__)
+#else
+#define AR5K_TRACE
+#endif
+
+/*
+ * Some tuneable values (these should be changeable by the user)
+ */
+#define AR5K_TUNE_DMA_BEACON_RESP 2
+#define AR5K_TUNE_SW_BEACON_RESP 10
+#define AR5K_TUNE_ADDITIONAL_SWBA_BACKOFF 0
+#define AR5K_TUNE_RADAR_ALERT false
+#define AR5K_TUNE_MIN_TX_FIFO_THRES 1
+#define AR5K_TUNE_MAX_TX_FIFO_THRES ((IEEE80211_MAX_LEN / 64) + 1)
+#define AR5K_TUNE_RSSI_THRES 1792
+#define AR5K_TUNE_REGISTER_TIMEOUT 20000
+#define AR5K_TUNE_REGISTER_DWELL_TIME 20000
+#define AR5K_TUNE_BEACON_INTERVAL 100
+#define AR5K_TUNE_AIFS 2
+#define AR5K_TUNE_AIFS_11B 2
+#define AR5K_TUNE_AIFS_XR 0
+#define AR5K_TUNE_CWMIN 15
+#define AR5K_TUNE_CWMIN_11B 31
+#define AR5K_TUNE_CWMIN_XR 3
+#define AR5K_TUNE_CWMAX 1023
+#define AR5K_TUNE_CWMAX_11B 1023
+#define AR5K_TUNE_CWMAX_XR 7
+#define AR5K_TUNE_NOISE_FLOOR -72
+#define AR5K_TUNE_MAX_TXPOWER 60
+#define AR5K_TUNE_DEFAULT_TXPOWER 30
+#define AR5K_TUNE_TPC_TXPOWER true
+#define AR5K_TUNE_ANT_DIVERSITY true
+#define AR5K_TUNE_HWTXTRIES 4
+
+/* token to use for aifs, cwmin, cwmax in MadWiFi */
+#define AR5K_TXQ_USEDEFAULT ((u32) -1)
+
+/* GENERIC CHIPSET DEFINITIONS */
+
+/* MAC Chips */
+enum ath5k_version {
+ AR5K_AR5210 = 0,
+ AR5K_AR5211 = 1,
+ AR5K_AR5212 = 2,
+};
+
+/* PHY Chips */
+enum ath5k_radio {
+ AR5K_RF5110 = 0,
+ AR5K_RF5111 = 1,
+ AR5K_RF5112 = 2,
+};
+
+/*
+ * Common silicon revision/version values
+ */
+enum ath5k_srev_type {
+ AR5K_VERSION_VER,
+ AR5K_VERSION_REV,
+ AR5K_VERSION_RAD,
+ AR5K_VERSION_DEV
+};
+
+struct ath5k_srev_name {
+ const char *sr_name;
+ enum ath5k_srev_type sr_type;
+ u_int sr_val;
+};
+
+#define AR5K_SREV_NAME { \
+ { "5210", AR5K_VERSION_VER, AR5K_SREV_VER_AR5210 }, \
+ { "5311", AR5K_VERSION_VER, AR5K_SREV_VER_AR5311 }, \
+ { "5311a", AR5K_VERSION_VER, AR5K_SREV_VER_AR5311A },\
+ { "5311b", AR5K_VERSION_VER, AR5K_SREV_VER_AR5311B },\
+ { "5211", AR5K_VERSION_VER, AR5K_SREV_VER_AR5211 }, \
+ { "5212", AR5K_VERSION_VER, AR5K_SREV_VER_AR5212 }, \
+ { "5213", AR5K_VERSION_VER, AR5K_SREV_VER_AR5213 }, \
+ { "xxxx", AR5K_VERSION_VER, AR5K_SREV_UNKNOWN }, \
+ { "5110", AR5K_VERSION_RAD, AR5K_SREV_RAD_5110 }, \
+ { "5111", AR5K_VERSION_RAD, AR5K_SREV_RAD_5111 }, \
+ { "2111", AR5K_VERSION_RAD, AR5K_SREV_RAD_2111 }, \
+ { "5112", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112 }, \
+ { "5112a", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112A }, \
+ { "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, 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 } \
+}
+
+#define AR5K_SREV_UNKNOWN 0xffff
+
+#define AR5K_SREV_VER_AR5210 0x00
+#define AR5K_SREV_VER_AR5311 0x10
+#define AR5K_SREV_VER_AR5311A 0x20
+#define AR5K_SREV_VER_AR5311B 0x30
+#define AR5K_SREV_VER_AR5211 0x40
+#define AR5K_SREV_VER_AR5212 0x50
+#define AR5K_SREV_VER_AR5213 0x55
+#define AR5K_SREV_VER_UNSUPP 0x60
+
+#define AR5K_SREV_RAD_5110 0x00
+#define AR5K_SREV_RAD_5111 0x10
+#define AR5K_SREV_RAD_5111A 0x15
[...13868 lines suppressed...]
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ * redistribution must be conditioned upon including a substantially
+ * similar Disclaimer requirement for further binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * 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.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.20 2005/01/24 20:31:24 sam Exp $
+ */
+
+/*
+ * Defintions for the Atheros Wireless LAN controller driver.
+ */
+#ifndef _DEV_ATH_ATHVAR_H
+#define _DEV_ATH_ATHVAR_H
+
+#include <linux/interrupt.h>
+#include <linux/list.h>
+#include <linux/wireless.h>
+#include <linux/if_ether.h>
+
+#include "ath5k.h"
+
+#define ATH_TIMEOUT 1000
+
+#define ATH_LONG_CALIB 30 /* seconds */
+#define ATH_SHORT_CALIB 1
+
+/*
+ * Maximum acceptable MTU
+ * MAXFRAMEBODY - WEP - QOS - RSN/WPA:
+ * 2312 - 8 - 2 - 12 = 2290
+ */
+#define ATH_MAX_MTU 2290
+#define ATH_MIN_MTU 32
+
+#define ATH_RXBUF 40 /* number of RX buffers */
+#define ATH_TXBUF 200 /* number of TX buffers */
+#define ATH_TXDESC 1 /* number of descriptors per buffer */
+#define ATH_BCBUF 1 /* number of beacon buffers */
+#define ATH_TXMAXTRY 11 /* max number of transmit attempts */
+#define ATH_TXINTR_PERIOD 5 /* max number of batched tx descriptors */
+
+#define ATH_BEACON_AIFS_DEFAULT 0 /* default aifs for ap beacon q */
+#define ATH_BEACON_CWMIN_DEFAULT 0 /* default cwmin for ap beacon q */
+#define ATH_BEACON_CWMAX_DEFAULT 0 /* default cwmax for ap beacon q */
+
+#define ATH_RSSI_LPF_LEN 10
+#define ATH_RSSI_DUMMY_MARKER 0x127
+#define ATH_EP_MUL(x, mul) ((x) * (mul))
+#define ATH_RSSI_IN(x) (ATH_EP_MUL((x), AR5K_RSSI_EP_MULTIPLIER))
+#define ATH_LPF_RSSI(x, y, len) \
+ ((x != ATH_RSSI_DUMMY_MARKER) ? (((x) * ((len) - 1) + (y)) / (len)) : (y))
+#define ATH_RSSI_LPF(x, y) do { \
+ if ((y) >= -20) \
+ x = ATH_LPF_RSSI((x), ATH_RSSI_IN((y)), ATH_RSSI_LPF_LEN); \
+} while (0)
+
+struct ath_buf {
+ struct list_head list;
+ unsigned int flags; /* tx descriptor flags */
+ struct ath_desc *desc; /* virtual addr of desc */
+ dma_addr_t daddr; /* physical addr of desc */
+ struct sk_buff *skb; /* skbuff for buf */
+ dma_addr_t skbaddr;/* physical addr of skb data */
+ struct ieee80211_tx_control ctl;
+};
+
+/*
+ * Data transmit queue state. One of these exists for each
+ * hardware transmit queue. Packets sent to us from above
+ * are assigned to queues based on their priority. Not all
+ * devices support a complete set of hardware transmit queues.
+ * For those devices the array sc_ac2q will map multiple
+ * priorities to fewer hardware queues (typically all to one
+ * hardware queue).
+ */
+struct ath_txq {
+ unsigned int qnum; /* hardware q number */
+ u32 *link; /* link ptr in last TX desc */
+ struct list_head q; /* transmit queue */
+ spinlock_t lock; /* lock on q and link */
+ bool setup;
+};
+
+#if CHAN_DEBUG
+#define ATH_CHAN_MAX (26+26+26+200+200)
+#else
+#define ATH_CHAN_MAX (14+14+14+252+20) /* XXX what's the max? */
+#endif
+
+struct ath_softc {
+ struct pci_dev *pdev; /* for dma mapping */
+ void __iomem *iobase; /* address of the device */
+ struct mutex lock; /* dev-level lock */
+ struct ieee80211_tx_queue_stats tx_stats;
+ struct ieee80211_low_level_stats ll_stats;
+ struct ieee80211_hw *hw; /* IEEE 802.11 common */
+ struct ieee80211_hw_mode modes[NUM_IEEE80211_MODES];
+ struct ieee80211_channel channels[ATH_CHAN_MAX];
+ struct ieee80211_rate rates[AR5K_MAX_RATES * NUM_IEEE80211_MODES];
+ enum ieee80211_if_types opmode;
+ struct ath_hw *ah; /* Atheros HW */
+
+ int debug;
+
+ struct ath_buf *bufptr; /* allocated buffer ptr */
+ struct ath_desc *desc; /* TX/RX descriptors */
+ dma_addr_t desc_daddr; /* DMA (physical) address */
+ size_t desc_len; /* size of TX/RX descriptors */
+ u16 cachelsz; /* cache line size */
+
+ DECLARE_BITMAP(status, 6);
+#define ATH_STAT_INVALID 0 /* disable hardware accesses */
+#define ATH_STAT_MRRETRY 1 /* multi-rate retry support */
+#define ATH_STAT_PROMISC 2
+#define ATH_STAT_LEDBLINKING 3 /* LED blink operation active */
+#define ATH_STAT_LEDENDBLINK 4 /* finish LED blink operation */
+#define ATH_STAT_LEDSOFT 5 /* enable LED gpio status */
+
+ unsigned int curmode; /* current phy mode */
+ struct ieee80211_channel *curchan; /* current h/w channel */
+
+ int iface_id; /* add/remove_interface id */
+
+ struct {
+ u8 rxflags; /* radiotap rx flags */
+ u8 txflags; /* radiotap tx flags */
+ u16 ledon; /* softled on time */
+ u16 ledoff; /* softled off time */
+ } hwmap[32]; /* h/w rate ix mappings */
+
+ enum ath5k_int imask; /* interrupt mask copy */
+
+ DECLARE_BITMAP(keymap, AR5K_KEYCACHE_SIZE); /* key use bit map */
+
+ u8 bssidmask[ETH_ALEN];
+
+ unsigned int led_pin, /* GPIO pin for driving LED */
+ led_on, /* pin setting for LED on */
+ led_off; /* off time for current blink */
+ struct timer_list led_tim; /* led off timer */
+ u8 led_rxrate; /* current rx rate for LED */
+ u8 led_txrate; /* current tx rate for LED */
+
+ struct tasklet_struct restq; /* reset tasklet */
+
+ unsigned int rxbufsize; /* rx size based on mtu */
+ struct list_head rxbuf; /* receive buffer */
+ spinlock_t rxbuflock;
+ u32 *rxlink; /* link ptr in last RX desc */
+ struct tasklet_struct rxtq; /* rx intr tasklet */
+
+ struct list_head txbuf; /* transmit buffer */
+ spinlock_t txbuflock;
+ unsigned int txbuf_len; /* buf count in txbuf list */
+ struct ath_txq txqs[2]; /* beacon and tx */
+
+ struct ath_txq *txq; /* beacon and tx*/
+ struct tasklet_struct txtq; /* tx intr tasklet */
+
+ struct ath_buf *bbuf; /* beacon buffer */
+ unsigned int bhalq, /* HAL q for outgoing beacons */
+ bmisscount, /* missed beacon transmits */
+ bintval, /* beacon interval */
+ bsent;
+
+ struct timer_list calib_tim; /* calibration timer */
+};
+
+#define ath5k_hw_hasbssidmask(_ah) \
+ (ath5k_hw_get_capability(_ah, AR5K_CAP_BSSIDMASK, 0, NULL) == 0)
+#define ath5k_hw_hasveol(_ah) \
+ (ath5k_hw_get_capability(_ah, AR5K_CAP_VEOL, 0, NULL) == 0)
+
+#endif
linux-2.6-mac80211-extras.patch:
--- NEW FILE linux-2.6-mac80211-extras.patch ---
diff -up linux-2.6.22.noarch/include/linux/ieee80211.h.orig linux-2.6.22.noarch/include/linux/ieee80211.h
--- linux-2.6.22.noarch/include/linux/ieee80211.h.orig 2007-09-26 20:24:17.000000000 -0400
+++ linux-2.6.22.noarch/include/linux/ieee80211.h 2007-09-26 20:24:22.000000000 -0400
@@ -106,6 +106,75 @@ struct ieee80211_hdr {
} __attribute__ ((packed));
+struct ieee80211_ht_capability {
+ __le16 capabilities_info;
+ u8 mac_ht_params_info;
+ u8 supported_mcs_set[16];
+ __le16 extended_ht_capability_info;
+ __le32 tx_BF_capability_info;
+ u8 antenna_selection_info;
+}__attribute__ ((packed));
+
+struct ieee80211_ht_additional_info {
+ u8 control_chan;
+ u8 ht_param;
+ __le16 operation_mode;
+ __le16 stbc_param;
+ u8 basic_set[16];
+}__attribute__ ((packed));
+
+
+#define IEEE80211_TSINFO_TYPE(a) ((a.byte1 & 0x01) >> 0)
+#define IEEE80211_TSINFO_TSID(a) ((a.byte1 & 0x1E) >> 1)
+#define IEEE80211_TSINFO_DIR(a) ((a.byte1 & 0x60) >> 5)
+#define IEEE80211_TSINFO_POLICY(a) ((a.byte1 & 0x80) >> 7 + \
+ (a.byte2 & 0x01) << 1)
+#define IEEE80211_TSINFO_AGG(a) ((a.byte2 & 0x02) >> 1)
+#define IEEE80211_TSINFO_APSD(a) ((a.byte2 & 0x04) >> 2)
+#define IEEE80211_TSINFO_UP(a) ((a.byte2 & 0x38) >> 3)
+#define IEEE80211_TSINFO_ACK(a) ((a.byte2 & 0xC0) >> 6)
+#define IEEE80211_TSINFO_SCHEDULE(a) ((a.byte3 & 0x01) >> 0)
+
+#define IEEE80211_SET_TSINFO_TYPE(i, d) (i.byte1 |= (d << 0) & 0x01)
+#define IEEE80211_SET_TSINFO_TSID(i, d) (i.byte1 |= (d << 1) & 0x1E)
+#define IEEE80211_SET_TSINFO_DIR(i, d) (i.byte1 |= (d << 5) & 0x60)
+#define IEEE80211_SET_TSINFO_POLICY(i, d) \
+do { \
+ i.byte1 |= (d & 0x01) << 7; \
+ i.byte2 |= (d & 0x02) >> 1; \
+} while(0)
+#define IEEE80211_SET_TSINFO_AGG(i, d) (i.byte2 |= (d << 1) & 0x02)
+#define IEEE80211_SET_TSINFO_APSD(i, d) (i.byte2 |= (d << 2) & 0x04)
+#define IEEE80211_SET_TSINFO_UP(i, d) (i.byte2 |= (d << 3) & 0x38)
+#define IEEE80211_SET_TSINFO_ACK(i, d) (i.byte2 |= (d << 6) & 0xC0)
+#define IEEE80211_SET_TSINFO_SCHEDULE(i, d) (i.byte3 |= (d << 0) & 0x01)
+
+struct ieee80211_ts_info {
+ u8 byte1;
+ u8 byte2;
+ u8 byte3;
+} __attribute__ ((packed));
+
+struct ieee80211_elem_tspec {
+ struct ieee80211_ts_info ts_info;
+ __le16 nominal_msdu_size;
+ __le16 max_msdu_size;
+ __le32 min_service_interval;
+ __le32 max_service_interval;
+ __le32 inactivity_interval;
+ __le32 suspension_interval;
+ __le32 service_start_time;
+ __le32 min_data_rate;
+ __le32 mean_data_rate;
+ __le32 peak_data_rate;
+ __le32 burst_size;
+ __le32 delay_bound;
+ __le32 min_phy_rate;
+ __le16 surplus_band_allow;
+ __le16 medium_time;
+} __attribute__ ((packed));
+
+
struct ieee80211_mgmt {
__le16 frame_control;
__le16 duration;
@@ -173,9 +242,51 @@ struct ieee80211_mgmt {
struct {
u8 action_code;
u8 dialog_token;
+ u8 variable[0];
+ } __attribute__ ((packed)) addts_req;
+ struct {
+ u8 action_code;
+ u8 dialog_token;
+ __le16 status_code;
+ u8 variable[0];
+ } __attribute__ ((packed)) addts_resp;
+ struct {
+ u8 action_code;
+ struct ieee80211_ts_info ts_info;
+ __le16 reason_code;
+ } __attribute__ ((packed)) delts;
+ struct {
+ u8 action_code;
+ u8 dialog_token;
u8 status_code;
u8 variable[0];
} __attribute__ ((packed)) wme_action;
+ struct {
+ u8 action_code;
+ u8 dest[6];
+ u8 src[6];
+ __le16 capab_info;
+ __le16 timeout;
+ /* Followed by Supported Rates and
+ * Extended Supported Rates */
+ u8 variable[0];
+ } __attribute__ ((packed)) dls_req;
+ struct {
+ u8 action_code;
+ __le16 status_code;
+ u8 dest[6];
+ u8 src[6];
+ /* Followed by Capability Information,
+ * Supported Rates and Extended
+ * Supported Rates */
+ u8 variable[0];
+ } __attribute__ ((packed)) dls_resp;
+ struct {
+ u8 action_code;
+ u8 dest[6];
+ u8 src[6];
+ __le16 reason_code;
+ } __attribute__ ((packed)) dls_teardown;
struct{
u8 action_code;
u8 element_id;
@@ -184,6 +295,25 @@ struct ieee80211_mgmt {
u8 new_chan;
u8 switch_count;
} __attribute__((packed)) chan_switch;
+ struct{
+ u8 action_code;
+ u8 dialog_token;
+ __le16 capab;
+ __le16 timeout;
+ __le16 start_seq_num;
+ } __attribute__((packed)) addba_req;
+ struct{
+ u8 action_code;
+ u8 dialog_token;
+ __le16 status;
+ __le16 capab;
+ __le16 timeout;
+ } __attribute__((packed)) addba_resp;
+ struct{
+ u8 action_code;
+ __le16 params;
+ __le16 reason_code;
+ }__attribute__((packed)) delba;
} u;
} __attribute__ ((packed)) action;
} u;
@@ -270,6 +400,18 @@ enum ieee80211_statuscode {
WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
+ /* 802.11e */
+ WLAN_STATUS_UNSPECIFIED_QOS = 32,
+ WLAN_STATUS_ASSOC_DENIED_NOBANDWIDTH = 33,
+ WLAN_STATUS_ASSOC_DENIED_LOWACK = 34,
+ WLAN_STATUS_ASSOC_DENIED_UNSUPP_QOS = 35,
+ WLAN_STATUS_REQUEST_DECLINED = 37,
+ WLAN_STATUS_INVALID_QOS_PARAM = 38,
+ WLAN_STATUS_CHANGE_TSPEC = 39,
+ WLAN_STATUS_WAIT_TS_DELAY = 47,
+ WLAN_STATUS_NO_DIRECT_LINK = 48,
+ WLAN_STATUS_STA_NOT_PRESENT = 49,
+ WLAN_STATUS_STA_NOT_QSTA = 50,
};
@@ -300,9 +442,50 @@ enum ieee80211_reasoncode {
WLAN_REASON_INVALID_RSN_IE_CAP = 22,
WLAN_REASON_IEEE8021X_FAILED = 23,
WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
+ /* 802.11e */
+ WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32,
+ WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33,
+ WLAN_REASON_DISASSOC_LOW_ACK = 34,
+ WLAN_REASON_DISASSOC_QAP_EXCEED_TXOP = 35,
+ WLAN_REASON_QSTA_LEAVE_QBSS = 36,
+ WLAN_REASON_QSTA_NOT_USE = 37,
+ WLAN_REASON_QSTA_REQUIRE_SETUP = 38,
+ WLAN_REASON_QSTA_TIMEOUT = 39,
+ WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45,
};
+/* Category Code */
+enum ieee80211_category {
+ WLAN_CATEGORY_SPECTRUM_MGMT = 0,
+ WLAN_CATEGORY_QOS = 1,
+ WLAN_CATEGORY_DLS = 2,
+ WLAN_CATEGORY_BACK = 3,
[...3755 lines suppressed...]
+ printk(" %02x", mic[i]);
+ printk("\n");
+ printk(KERN_DEBUG " SA=" MAC_FMT " DA=" MAC_FMT " key",
+ MAC_ARG(sa), MAC_ARG(da));
+ for (i = 0; i < 8; i++)
+ printk(" %02x", key[i]);
+ printk(" (%d)\n", authenticator);
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
mac80211_ev_michael_mic_failure(rx->dev, rx->key->conf.keyidx,
(void *) skb->data);
@@ -208,12 +271,30 @@ static int tkip_encrypt_skb(struct ieee8
memmove(pos, pos + TKIP_IV_LEN, hdrlen);
pos += hdrlen;
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ if (test & WPA_TRIGGER_TX_REPLAY)
+ goto skip_iv_inc;
+iv_inc:
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
+
/* Increase IV for the frame */
key->u.tkip.iv16++;
if (key->u.tkip.iv16 == 0)
key->u.tkip.iv32++;
- if (tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ if (test & WPA_TRIGGER_TX_SKIP_SEQ) {
+ test = 0;
+ goto iv_inc;
+ }
+skip_iv_inc:
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
+
+ if (tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ && !tx->wpa_test
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
+ ) {
hdr = (struct ieee80211_hdr *)skb->data;
/* hwaccel - with preallocated room for IV */
@@ -255,6 +336,37 @@ ieee80211_tx_h_tkip_encrypt(struct ieee8
tx->u.tx.control->iv_len = TKIP_IV_LEN;
ieee80211_tx_set_iswep(tx);
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ if ((tx->sta && tx->sta->wpa_trigger & WPA_TRIGGER_FAIL_TX_ICV) ||
+ (!(tx->flags & IEEE80211_TXRXD_TXUNICAST) &&
+ tx->local->wpa_trigger & WPA_TRIGGER_FAIL_TX_ICV)) {
+ wpa_test = 1;
+ }
+
+ if (tx->sta) {
+ test = tx->sta->wpa_trigger;
+ tx->sta->wpa_trigger &=
+ ~(WPA_TRIGGER_TX_REPLAY | WPA_TRIGGER_TX_REPLAY_FRAG |
+ WPA_TRIGGER_TX_SKIP_SEQ);
+ } else {
+ test = tx->local->wpa_trigger;
+ tx->local->wpa_trigger &=
+ ~(WPA_TRIGGER_TX_REPLAY | WPA_TRIGGER_TX_REPLAY_FRAG |
+ WPA_TRIGGER_TX_SKIP_SEQ);
+ }
+ if (test &
+ (WPA_TRIGGER_TX_REPLAY | WPA_TRIGGER_TX_REPLAY_FRAG |
+ WPA_TRIGGER_TX_SKIP_SEQ)) {
+ printk(KERN_INFO "%s: WPA testing - TKIP TX packet number "
+ "%s%s%s%s\n", tx->dev->name,
+ tx->sta ? "[UNICAST]" : "[MULTICAST]",
+ test & WPA_TRIGGER_TX_REPLAY ? "[REPLAY]" : "",
+ test & WPA_TRIGGER_TX_REPLAY_FRAG ?
+ "[REPLAY FRAG]" : "",
+ test & WPA_TRIGGER_TX_SKIP_SEQ ? "[SKIP SEQ]" : "");
+ }
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
+
if ((tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) &&
!(tx->key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV) &&
!wpa_test) {
@@ -268,6 +380,10 @@ ieee80211_tx_h_tkip_encrypt(struct ieee8
if (tx->u.tx.extra_frag) {
int i;
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ if (test & WPA_TRIGGER_TX_REPLAY_FRAG)
+ test |= WPA_TRIGGER_TX_REPLAY;
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
for (i = 0; i < tx->u.tx.num_extra_frag; i++) {
if (tkip_encrypt_skb(tx, tx->u.tx.extra_frag[i], test)
< 0)
@@ -275,6 +391,23 @@ ieee80211_tx_h_tkip_encrypt(struct ieee8
}
}
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ if (tx->sta && tx->sta->wpa_trigger & WPA_TRIGGER_FAIL_TX_ICV) {
+ printk(KERN_INFO "%s: WPA testing - corrupting TX TKIP ICV "
+ "for STA " MAC_FMT "\n",
+ tx->dev->name, MAC_ARG(tx->sta->addr));
+ tx->sta->wpa_trigger &= ~WPA_TRIGGER_FAIL_TX_ICV;
+ skb->data[skb->len - 1]++;
+ } else if (!(tx->flags & IEEE80211_TXRXD_TXUNICAST) &&
+ tx->local->wpa_trigger & WPA_TRIGGER_FAIL_TX_ICV) {
+ printk(KERN_INFO "%s: WPA testing - corrupting TX TKIP ICV "
+ "for Group Key\n",
+ tx->dev->name);
+ tx->local->wpa_trigger &= ~WPA_TRIGGER_FAIL_TX_ICV;
+ skb->data[skb->len - 1]++;
+ }
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
+
return TXRX_CONTINUE;
}
@@ -299,6 +432,17 @@ ieee80211_rx_h_tkip_decrypt(struct ieee8
if (!rx->sta || skb->len - hdrlen < 12)
return TXRX_DROP;
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ if (rx->sta && rx->sta->wpa_trigger & WPA_TRIGGER_FAIL_RX_ICV) {
+ printk(KERN_INFO "%s: WPA testing - corrupting RX TKIP ICV "
+ "for STA " MAC_FMT "\n",
+ rx->dev->name, MAC_ARG(rx->sta->addr));
+ rx->sta->wpa_trigger &= ~WPA_TRIGGER_FAIL_RX_ICV;
+ skb->data[skb->len - 1]++;
+ wpa_test = 1;
+ }
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
+
if (rx->u.rx.status->flag & RX_FLAG_DECRYPTED) {
if (rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED) {
/*
@@ -467,12 +611,26 @@ static int ccmp_encrypt_skb(struct ieee8
/* PN = PN + 1 */
pn = key->u.ccmp.tx_pn;
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ if (test & WPA_TRIGGER_TX_REPLAY)
+ goto skip_pn_inc;
+pn_inc:
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
+
for (i = CCMP_PN_LEN - 1; i >= 0; i--) {
pn[i]++;
if (pn[i])
break;
}
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ if (test & WPA_TRIGGER_TX_SKIP_SEQ) {
+ test = 0;
+ goto pn_inc;
+ }
+skip_pn_inc:
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
+
ccmp_pn2hdr(pos, pn, key->conf.keyidx);
if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
@@ -504,6 +662,27 @@ ieee80211_tx_h_ccmp_encrypt(struct ieee8
if (!key || key->conf.alg != ALG_CCMP || !WLAN_FC_DATA_PRESENT(fc))
return TXRX_CONTINUE;
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ if (tx->sta) {
+ test = tx->sta->wpa_trigger;
+ tx->sta->wpa_trigger = 0;
+ } else {
+ test = tx->local->wpa_trigger;
+ tx->local->wpa_trigger = 0;
+ }
+ if (test &
+ (WPA_TRIGGER_TX_REPLAY | WPA_TRIGGER_TX_REPLAY_FRAG |
+ WPA_TRIGGER_TX_SKIP_SEQ)) {
+ printk(KERN_INFO "%s: WPA testing - CCMP TX packet number "
+ "%s%s%s%s\n", tx->dev->name,
+ tx->sta ? "[UNICAST]" : "[MULTICAST]",
+ test & WPA_TRIGGER_TX_REPLAY ? "[REPLAY]" : "",
+ test & WPA_TRIGGER_TX_REPLAY_FRAG ?
+ "[REPLAY FRAG]" : "",
+ test & WPA_TRIGGER_TX_SKIP_SEQ ? "[SKIP SEQ]" : "");
+ }
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
+
tx->u.tx.control->icv_len = CCMP_MIC_LEN;
tx->u.tx.control->iv_len = CCMP_HDR_LEN;
ieee80211_tx_set_iswep(tx);
@@ -521,6 +700,10 @@ ieee80211_tx_h_ccmp_encrypt(struct ieee8
if (tx->u.tx.extra_frag) {
int i;
+#ifdef CONFIG_HOSTAPD_WPA_TESTING
+ if (test & WPA_TRIGGER_TX_REPLAY_FRAG)
+ test |= WPA_TRIGGER_TX_REPLAY;
+#endif /* CONFIG_HOSTAPD_WPA_TESTING */
for (i = 0; i < tx->u.tx.num_extra_frag; i++) {
if (ccmp_encrypt_skb(tx, tx->u.tx.extra_frag[i], test)
< 0)
linux-2.6-zd1211rw-mac80211.patch:
--- NEW FILE linux-2.6-zd1211rw-mac80211.patch ---
diff -up linux-2.6.22.noarch/MAINTAINERS.orig linux-2.6.22.noarch/MAINTAINERS
--- linux-2.6.22.noarch/MAINTAINERS.orig 2007-09-26 20:00:12.000000000 -0400
+++ linux-2.6.22.noarch/MAINTAINERS 2007-09-26 20:03:54.000000000 -0400
@@ -4287,6 +4287,16 @@ W: http://www.qsl.net/dl1bke/
L: linux-hams at vger.kernel.org
S: Maintained
+Z1211 WIRELESS DRIVER
+P: Daniel Drake
+M: dsd at gentoo.org
+P: Ulrich Kunitz
+M: kune at deine-taler.de
+W: http://zd1211.ath.cx/wiki/DriverRewrite
+L: linux-wireless at vger.kernel.org
+L: zd1211-devs at lists.sourceforge.net (subscribers-only)
+S: Maintained
+
ZD1211RW WIRELESS DRIVER
P: Daniel Drake
M: dsd at gentoo.org
diff -up linux-2.6.22.noarch/drivers/net/wireless/Makefile.orig linux-2.6.22.noarch/drivers/net/wireless/Makefile
--- linux-2.6.22.noarch/drivers/net/wireless/Makefile.orig 2007-09-26 20:00:32.000000000 -0400
+++ linux-2.6.22.noarch/drivers/net/wireless/Makefile 2007-09-26 20:03:54.000000000 -0400
@@ -41,6 +41,7 @@ obj-$(CONFIG_BCM43XX) += bcm43xx/
obj-$(CONFIG_B43) += b43/
obj-$(CONFIG_B43LEGACY) += b43legacy/
obj-$(CONFIG_ZD1211RW) += zd1211rw/
+obj-$(CONFIG_Z1211) += zd1211rw-mac80211/
# 16-bit wireless PCMCIA client drivers
obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o
diff -up /dev/null linux-2.6.22.noarch/drivers/net/wireless/zd1211rw-mac80211/zd_chip.c
--- /dev/null 2007-09-25 08:26:55.562976333 -0400
+++ linux-2.6.22.noarch/drivers/net/wireless/zd1211rw-mac80211/zd_chip.c 2007-09-26 20:03:54.000000000 -0400
@@ -0,0 +1,1620 @@
+/* zd_chip.c
+ *
+ * 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
+ */
+
+/* This file implements all the hardware specific functions for the ZD1211
+ * and ZD1211B chips. Support for the ZD1211B was possible after Timothy
+ * Legge sent me a ZD1211B device. Thank you Tim. -- Uli
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+
+#include "zd_def.h"
+#include "zd_chip.h"
+#include "zd_ieee80211.h"
+#include "zd_mac.h"
+#include "zd_rf.h"
+#include "zd_util.h"
+
+void zd_chip_init(struct zd_chip *chip,
+ struct ieee80211_hw *hw,
+ struct usb_interface *intf)
+{
+ memset(chip, 0, sizeof(*chip));
+ mutex_init(&chip->mutex);
+ zd_usb_init(&chip->usb, hw, intf);
+ zd_rf_init(&chip->rf);
+}
+
+void zd_chip_clear(struct zd_chip *chip)
+{
+ ZD_ASSERT(!mutex_is_locked(&chip->mutex));
+ zd_usb_clear(&chip->usb);
+ zd_rf_clear(&chip->rf);
+ mutex_destroy(&chip->mutex);
+ ZD_MEMCLEAR(chip, sizeof(*chip));
+}
+
+static int scnprint_mac_oui(struct zd_chip *chip, char *buffer, size_t size)
+{
+ u8 *addr = zd_chip_to_mac(chip)->hwaddr;
+ return scnprintf(buffer, size, "%02x-%02x-%02x",
+ addr[0], addr[1], addr[2]);
+}
+
+/* Prints an identifier line, which will support debugging. */
+static int scnprint_id(struct zd_chip *chip, char *buffer, size_t size)
+{
+ int i = 0;
+
+ i = scnprintf(buffer, size, "zd1211%s chip ",
+ zd_chip_is_zd1211b(chip) ? "b" : "");
+ i += zd_usb_scnprint_id(&chip->usb, buffer+i, size-i);
+ i += scnprintf(buffer+i, size-i, " ");
+ i += scnprint_mac_oui(chip, buffer+i, size-i);
+ i += scnprintf(buffer+i, size-i, " ");
+ i += zd_rf_scnprint_id(&chip->rf, buffer+i, size-i);
+ i += scnprintf(buffer+i, size-i, " pa%1x %c%c%c%c%c", chip->pa_type,
+ chip->patch_cck_gain ? 'g' : '-',
+ chip->patch_cr157 ? '7' : '-',
+ chip->patch_6m_band_edge ? '6' : '-',
+ chip->new_phy_layout ? 'N' : '-',
+ chip->al2230s_bit ? 'S' : '-');
+ return i;
+}
+
+static void print_id(struct zd_chip *chip)
+{
+ char buffer[80];
+
+ scnprint_id(chip, buffer, sizeof(buffer));
+ buffer[sizeof(buffer)-1] = 0;
+ dev_info(zd_chip_dev(chip), "%s\n", buffer);
+}
+
+static zd_addr_t inc_addr(zd_addr_t addr)
+{
+ u16 a = (u16)addr;
+ /* Control registers use byte addressing, but everything else uses word
+ * addressing. */
+ if ((a & 0xf000) == CR_START)
+ a += 2;
+ else
+ a += 1;
+ return (zd_addr_t)a;
+}
+
+/* Read a variable number of 32-bit values. Parameter count is not allowed to
+ * exceed USB_MAX_IOREAD32_COUNT.
+ */
+int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr,
+ unsigned int count)
+{
+ int r;
+ int i;
+ zd_addr_t *a16 = (zd_addr_t *)NULL;
+ u16 *v16;
+ unsigned int count16;
+
+ if (count > USB_MAX_IOREAD32_COUNT)
+ return -EINVAL;
+
+ /* Allocate a single memory block for values and addresses. */
+ count16 = 2*count;
+ a16 = (zd_addr_t *)kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)),
+ GFP_KERNEL);
+ if (!a16) {
+ dev_dbg_f(zd_chip_dev(chip),
+ "error ENOMEM in allocation of a16\n");
+ r = -ENOMEM;
+ goto out;
+ }
+ v16 = (u16 *)(a16 + count16);
+
+ for (i = 0; i < count; i++) {
+ int j = 2*i;
+ /* We read the high word always first. */
+ a16[j] = inc_addr(addr[i]);
+ a16[j+1] = addr[i];
+ }
+
+ r = zd_ioread16v_locked(chip, v16, a16, count16);
+ if (r) {
+ dev_dbg_f(zd_chip_dev(chip),
+ "error: zd_ioread16v_locked. Error number %d\n", r);
+ goto out;
+ }
+
+ for (i = 0; i < count; i++) {
+ int j = 2*i;
+ values[i] = (v16[j] << 16) | v16[j+1];
+ }
+
+out:
+ kfree((void *)a16);
+ return r;
+}
+
+int _zd_iowrite32v_locked(struct zd_chip *chip, const struct zd_ioreq32 *ioreqs,
+ unsigned int count)
+{
+ int i, j, r;
+ struct zd_ioreq16 *ioreqs16;
+ unsigned int count16;
+
+ ZD_ASSERT(mutex_is_locked(&chip->mutex));
+
+ if (count == 0)
+ return 0;
+ if (count > USB_MAX_IOWRITE32_COUNT)
+ return -EINVAL;
[...7630 lines suppressed...]
+ spin_unlock_irq(&mac->lock);
+
+ zd_chip_set_multicast_hash(&mac->chip, &hash);
+}
+
+static void zd_op_set_multicast_list(struct ieee80211_hw *hw,
+ unsigned short dev_flags, int mc_count)
+{
+ struct zd_mc_hash hash;
+ struct zd_mac *mac = zd_hw_mac(hw);
+ unsigned long flags;
+
+ if ((dev_flags & (IFF_PROMISC|IFF_ALLMULTI)) ||
+ has_monitor_interfaces(mac))
+ {
+ zd_mc_add_all(&hash);
+ } else {
+ struct dev_mc_list *mc = NULL;
+ void *tmp = NULL;
+ DECLARE_MAC_BUF(macbuf);
+
+ zd_mc_clear(&hash);
+ while ((mc = ieee80211_get_mc_list_item(hw, mc, &tmp))) {
+ dev_dbg_f(zd_mac_dev(mac), "mc addr %s\n",
+ print_mac(macbuf, mc->dmi_addr));
+ zd_mc_add_addr(&hash, mc->dmi_addr);
+ }
+ }
+
+ spin_lock_irqsave(&mac->lock, flags);
+ mac->multicast_hash = hash;
+ spin_unlock_irqrestore(&mac->lock, flags);
+ queue_work(zd_workqueue, &mac->set_multicast_hash_work);
+}
+
+static void set_rts_cts_work(struct work_struct *work)
+{
+ struct zd_mac *mac =
+ container_of(work, struct zd_mac, set_rts_cts_work);
+ unsigned long flags;
+ unsigned int short_preamble;
+
+ mutex_lock(&mac->chip.mutex);
+
+ spin_lock_irqsave(&mac->lock, flags);
+ mac->updating_rts_rate = 0;
+ short_preamble = mac->short_preamble;
+ spin_unlock_irqrestore(&mac->lock, flags);
+
+ zd_chip_set_rts_cts_rate_locked(&mac->chip, short_preamble);
+ mutex_unlock(&mac->chip.mutex);
+}
+
+static void zd_op_erp_ie_changed(struct ieee80211_hw *hw, u8 changes,
+ int cts_protection, int preamble)
+{
+ struct zd_mac *mac = zd_hw_mac(hw);
+ unsigned long flags;
+
+ dev_dbg_f(zd_mac_dev(mac), "changes: %x\n", changes);
+
+ if (changes & IEEE80211_ERP_CHANGE_PREAMBLE) {
+ spin_lock_irqsave(&mac->lock, flags);
+ mac->short_preamble = !preamble;
+ if (!mac->updating_rts_rate) {
+ mac->updating_rts_rate = 1;
+ /* FIXME: should disable TX here, until work has
+ * completed and RTS_CTS reg is updated */
+ queue_work(zd_workqueue, &mac->set_rts_cts_work);
+ }
+ spin_unlock_irqrestore(&mac->lock, flags);
+ }
+}
+
+static const struct ieee80211_ops zd_ops = {
+ .tx = zd_op_tx,
+ .open = zd_op_open,
+ .stop = zd_op_stop,
+ .add_interface = zd_op_add_interface,
+ .remove_interface = zd_op_remove_interface,
+ .config = zd_op_config,
+ .config_interface = zd_op_config_interface,
+ .set_multicast_list = zd_op_set_multicast_list,
+ .erp_ie_changed = zd_op_erp_ie_changed,
+};
+
+struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)
+{
+ struct zd_mac *mac;
+ struct ieee80211_hw *hw;
+ int i;
+
+ hw = ieee80211_alloc_hw(sizeof(struct zd_mac), &zd_ops);
+ if (!hw) {
+ dev_dbg_f(&intf->dev, "out of memory\n");
+ return NULL;
+ }
+
+ mac = zd_hw_mac(hw);
+
+ memset(mac, 0, sizeof(*mac));
+ spin_lock_init(&mac->lock);
+ mac->hw = hw;
+
+ mac->type = IEEE80211_IF_TYPE_MGMT;
+ mac->hwaddr = hw->wiphy->perm_addr;
+
+ memcpy(mac->channels, zd_channels, sizeof(zd_channels));
+ memcpy(mac->rates, zd_rates, sizeof(zd_rates));
+ mac->modes[0].mode = MODE_IEEE80211G;
+ mac->modes[0].num_rates = ARRAY_SIZE(zd_rates);
+ mac->modes[0].rates = mac->rates;
+ mac->modes[0].num_channels = ARRAY_SIZE(zd_channels);
+ mac->modes[0].channels = mac->channels;
+ mac->modes[1].mode = MODE_IEEE80211B;
+ mac->modes[1].num_rates = 4;
+ mac->modes[1].rates = mac->rates;
+ mac->modes[1].num_channels = ARRAY_SIZE(zd_channels);
+ mac->modes[1].channels = mac->channels;
+
+ hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
+ IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED;
+ hw->max_rssi = 100;
+ hw->max_signal = 100;
+
+ hw->queues = 1;
+ hw->extra_tx_headroom = sizeof(struct zd_ctrlset);
+
+ skb_queue_head_init(&mac->ack_wait_queue);
+
+ for (i = 0; i < 2; i++) {
+ if (ieee80211_register_hwmode(hw, &mac->modes[i])) {
+ dev_dbg_f(&intf->dev, "cannot register hwmode\n");
+ ieee80211_free_hw(hw);
+ return NULL;
+ }
+ }
+
+ zd_chip_init(&mac->chip, hw, intf);
+ housekeeping_init(mac);
+ INIT_WORK(&mac->set_multicast_hash_work, set_multicast_hash_handler);
+ INIT_WORK(&mac->set_rts_cts_work, set_rts_cts_work);
+
+ SET_IEEE80211_DEV(hw, &intf->dev);
+ return hw;
+}
+
+#define LINK_LED_WORK_DELAY HZ
+
+static void link_led_handler(struct work_struct *work)
+{
+ struct zd_mac *mac =
+ container_of(work, struct zd_mac, housekeeping.link_led_work.work);
+ struct zd_chip *chip = &mac->chip;
+ int is_associated;
+ int r;
+
+ spin_lock_irq(&mac->lock);
+ is_associated = mac->associated;
+ spin_unlock_irq(&mac->lock);
+
+ r = zd_chip_control_leds(chip,
+ is_associated ? LED_ASSOCIATED : LED_SCANNING);
+ if (r)
+ dev_err(zd_mac_dev(mac), "zd_chip_control_leds error %d\n", r);
+
+ queue_delayed_work(zd_workqueue, &mac->housekeeping.link_led_work,
+ LINK_LED_WORK_DELAY);
+}
+
+static void housekeeping_init(struct zd_mac *mac)
+{
+ INIT_DELAYED_WORK(&mac->housekeeping.link_led_work, link_led_handler);
+}
+
+static void housekeeping_enable(struct zd_mac *mac)
+{
+ dev_dbg_f(zd_mac_dev(mac), "\n");
+ queue_delayed_work(zd_workqueue, &mac->housekeeping.link_led_work,
+ 0);
+}
+
+static void housekeeping_disable(struct zd_mac *mac)
+{
+ dev_dbg_f(zd_mac_dev(mac), "\n");
+ cancel_rearming_delayed_workqueue(zd_workqueue,
+ &mac->housekeeping.link_led_work);
+ zd_chip_control_leds(&mac->chip, LED_OFF);
+}
diff -up linux-2.6.22.noarch/drivers/net/wireless/Kconfig.orig linux-2.6.22.noarch/drivers/net/wireless/Kconfig
--- linux-2.6.22.noarch/drivers/net/wireless/Kconfig.orig 2007-09-26 20:00:12.000000000 -0400
+++ linux-2.6.22.noarch/drivers/net/wireless/Kconfig 2007-09-26 20:04:18.000000000 -0400
@@ -616,6 +616,7 @@ source "drivers/net/wireless/bcm43xx/Kco
source "drivers/net/wireless/b43/Kconfig"
source "drivers/net/wireless/b43legacy/Kconfig"
source "drivers/net/wireless/zd1211rw/Kconfig"
+source "drivers/net/wireless/zd1211rw-mac80211/Kconfig"
source "drivers/net/wireless/rt2x00/Kconfig"
endmenu
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -r1.191 -r1.192
--- kernel.spec 26 Sep 2007 22:38:30 -0000 1.191
+++ kernel.spec 27 Sep 2007 00:43:33 -0000 1.192
@@ -631,7 +631,10 @@
Patch662: linux-2.6-libata-pata-dma-disable-option.patch
Patch670: linux-2.6-ata-quirk.patch
Patch681: linux-2.6-wireless-pending.patch
-Patch690: git-wireless-dev.patch
+Patch690: linux-2.6-at76.patch
+Patch691: linux-2.6-ath5k.patch
+Patch692: linux-2.6-zd1211rw-mac80211.patch
+Patch693: linux-2.6-mac80211-extras.patch
Patch700: linux-2.6-bcm43xx-pci-neuter.patch
Patch701: linux-2.6-drivers-ssb-debug-revision.patch
Patch710: linux-2.6-netdev-e1000e-01.patch
@@ -1140,8 +1143,11 @@
# wireless patches headed for 2.6.23
# wireless patches staged for 2.6.24
ApplyPatch linux-2.6-wireless-pending.patch
-# Add the wireless stack updates and drivers from wireless-dev
-ApplyPatch git-wireless-dev.patch
+# Add misc wireless bits from upstream wireless tree
+ApplyPatch linux-2.6-at76.patch
+ApplyPatch linux-2.6-ath5k.patch
+ApplyPatch linux-2.6-zd1211rw-mac80211.patch
+ApplyPatch linux-2.6-mac80211-extras.patch
# avoid bcm3xx vs bcm43xx-mac80211 PCI ID conflicts
ApplyPatch linux-2.6-bcm43xx-pci-neuter.patch
@@ -1809,6 +1815,9 @@
%changelog
+* Wed Sep 26 2007 John W. Linville <linville at redhat.com>
+- Update and restructure wireless patches
+
* Wed Sep 26 2007 Chuck Ebbert <cebbert at redhat.com>
- x86 e820 bugfix
linux-2.6-wireless-pending.patch:
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.4 -r 1.5 linux-2.6-wireless-pending.patch
Index: linux-2.6-wireless-pending.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-wireless-pending.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux-2.6-wireless-pending.patch 18 Sep 2007 14:01:35 -0000 1.4
+++ linux-2.6-wireless-pending.patch 27 Sep 2007 00:43:34 -0000 1.5
@@ -1,6 +1,1753 @@
+diff -up linux-2.6.22.noarch/CREDITS.orig linux-2.6.22.noarch/CREDITS
+--- linux-2.6.22.noarch/CREDITS.orig 2007-09-26 19:41:26.000000000 -0400
++++ linux-2.6.22.noarch/CREDITS 2007-09-26 19:49:37.000000000 -0400
+@@ -665,6 +665,11 @@ D: Minor updates to SCSI types, added /p
+ S: (ask for current address)
+ S: USA
+
++N: Robin Cornelius
++E: robincornelius at users.sourceforge.net
++D: Ralink rt2x00 WLAN driver
++S: Cornwall, U.K.
++
+ N: Mark Corner
+ E: mcorner at umich.edu
+ W: http://www.eecs.umich.edu/~mcorner/
+@@ -679,6 +684,11 @@ D: Kernel module SMART utilities
+ S: Santa Cruz, California
+ S: USA
+
++N: Luis Correia
++E: lfcorreia at users.sf.net
++D: Ralink rt2x00 WLAN driver
++S: Belas, Portugal
++
+ N: Alan Cox
+ W: http://www.linux.org.uk/diary/
+ D: Linux Networking (0.99.10->2.0.29)
+@@ -833,6 +843,12 @@ S: Lancs
+ S: PR4 6AX
+ S: United Kingdom
+
++N: Ivo van Doorn
++E: IvDoorn at gmail.com
++W: http://www.mendiosus.nl
++D: Ralink rt2x00 WLAN driver
++S: Haarlem, The Netherlands
++
+ N: John G Dorsey
+ E: john+ at cs.cmu.edu
+ D: ARM Linux ports to Assabet/Neponset, Spot
+@@ -3517,6 +3533,12 @@ S: Maastrichterweg 63
+ S: 5554 GG Valkenswaard
+ S: The Netherlands
+
++N: Mark Wallis
++E: mwallis at serialmonkey.com
++W: http://mark.serialmonkey.com
++D: Ralink rt2x00 WLAN driver
++S: Newcastle, Australia
++
+ N: Peter Shaobo Wang
+ E: pwang at mmdcorp.com
+ W: http://www.mmdcorp.com/pw/linux
+@@ -3651,6 +3673,15 @@ S: Alte Regensburger Str. 11a
+ S: 93149 Nittenau
+ S: Germany
+
++N: Gertjan van Wingerde
++E: gwingerde at home.nl
++D: Ralink rt2x00 WLAN driver
++D: Minix V2 file-system
++D: Misc fixes
++S: Geessinkweg 177
++S: 7544 TX Enschede
++S: The Netherlands
++
+ N: Lars Wirzenius
+ E: liw at iki.fi
+ D: Linux System Administrator's Guide, author, former maintainer
+diff -up linux-2.6.22.noarch/include/linux/nl80211.h.orig linux-2.6.22.noarch/include/linux/nl80211.h
+--- linux-2.6.22.noarch/include/linux/nl80211.h.orig 2007-07-08 19:32:17.000000000 -0400
++++ linux-2.6.22.noarch/include/linux/nl80211.h 2007-09-26 19:49:38.000000000 -0400
+@@ -7,7 +7,97 @@
+ */
+
+ /**
++ * enum nl80211_commands - supported nl80211 commands
++ *
++ * @NL80211_CMD_UNSPEC: unspecified command to catch errors
++ *
++ * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
++ * to get a list of all present wiphys.
++ * @NL80211_CMD_SET_WIPHY: set wiphy name, needs %NL80211_ATTR_WIPHY and
++ * %NL80211_ATTR_WIPHY_NAME.
++ * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
++ * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
++ * %NL80211_ATTR_WIPHY_NAME.
++ * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
++ * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
++ *
++ * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
++ * either a dump request on a %NL80211_ATTR_WIPHY or a specific get
++ * on an %NL80211_ATTR_IFINDEX is supported.
++ * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
++ %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
++ * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
++ * to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
++ * %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
++ * be sent from userspace to request creation of a new virtual interface,
++ * then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
++ * %NL80211_ATTR_IFNAME.
++ * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
++ * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
++ * userspace to request deletion of a virtual interface, then requires
++ * attribute %NL80211_ATTR_IFINDEX.
++ *
++ * @NL80211_CMD_MAX: highest used command number
++ * @__NL80211_CMD_AFTER_LAST: internal use
++ */
++enum nl80211_commands {
++/* don't change the order or add anything inbetween, this is ABI! */
++ NL80211_CMD_UNSPEC,
++
++ NL80211_CMD_GET_WIPHY, /* can dump */
++ NL80211_CMD_SET_WIPHY,
++ NL80211_CMD_NEW_WIPHY,
++ NL80211_CMD_DEL_WIPHY,
++
++ NL80211_CMD_GET_INTERFACE, /* can dump */
++ NL80211_CMD_SET_INTERFACE,
++ NL80211_CMD_NEW_INTERFACE,
++ NL80211_CMD_DEL_INTERFACE,
++
++ /* add commands here */
++
++ /* used to define NL80211_CMD_MAX below */
++ __NL80211_CMD_AFTER_LAST,
++ NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
++};
++
++
++/**
++ * enum nl80211_attrs - nl80211 netlink attributes
++ *
++ * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
++ *
++ * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
++ * /sys/class/ieee80211/<phyname>/index
++ * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
++ *
++ * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
++ * @NL80211_ATTR_IFNAME: network interface name
++ * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
++ *
++ * @NL80211_ATTR_MAX: highest attribute number currently defined
++ * @__NL80211_ATTR_AFTER_LAST: internal use
++ */
++enum nl80211_attrs {
++/* don't change the order or add anything inbetween, this is ABI! */
++ NL80211_ATTR_UNSPEC,
++
++ NL80211_ATTR_WIPHY,
++ NL80211_ATTR_WIPHY_NAME,
++
++ NL80211_ATTR_IFINDEX,
++ NL80211_ATTR_IFNAME,
++ NL80211_ATTR_IFTYPE,
++
++ /* add attributes here, update the policy in nl80211.c */
++
++ __NL80211_ATTR_AFTER_LAST,
++ NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
++};
++
++/**
+ * enum nl80211_iftype - (virtual) interface types
++ *
+ * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
+ * @NL80211_IFTYPE_ADHOC: independent BSS member
+ * @NL80211_IFTYPE_STATION: managed BSS member
+@@ -15,9 +105,10 @@
+ * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
+ * @NL80211_IFTYPE_WDS: wireless distribution interface
+ * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
++ * @NL80211_IFTYPE_MAX: highest interface type number currently defined
+ * @__NL80211_IFTYPE_AFTER_LAST: internal use
+ *
+- * These values are used with the NL80211_ATTR_IFTYPE
++ * These values are used with the %NL80211_ATTR_IFTYPE
+ * to set the type of an interface.
+ *
+ */
+@@ -31,8 +122,8 @@ enum nl80211_iftype {
+ NL80211_IFTYPE_MONITOR,
+
+ /* keep last */
+- __NL80211_IFTYPE_AFTER_LAST
++ __NL80211_IFTYPE_AFTER_LAST,
++ NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
+ };
+-#define NL80211_IFTYPE_MAX (__NL80211_IFTYPE_AFTER_LAST - 1)
[...131489 lines suppressed...]
++ return 0;
++
++ return !mips_busprobe32(tmp, (bus->mmio + (pc->dev->core_index * SSB_CORE_SIZE)));
++}
++#endif /* CONFIG_SSB_PCICORE_HOSTMODE */
++
++
++/**************************************************
++ * Generic and Clientmode operation code.
++ **************************************************/
++
++static void ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
++{
++ /* Disable PCI interrupts. */
++ ssb_write32(pc->dev, SSB_INTVEC, 0);
++}
++
++void ssb_pcicore_init(struct ssb_pcicore *pc)
++{
++ struct ssb_device *dev = pc->dev;
++ struct ssb_bus *bus;
++
++ if (!dev)
++ return;
++ bus = dev->bus;
++ if (!ssb_device_is_enabled(dev))
++ ssb_device_enable(dev, 0);
++
++#ifdef CONFIG_SSB_PCICORE_HOSTMODE
++ pc->hostmode = pcicore_is_in_hostmode(pc);
++ if (pc->hostmode)
++ ssb_pcicore_init_hostmode(pc);
++#endif /* CONFIG_SSB_PCICORE_HOSTMODE */
++ if (!pc->hostmode)
++ ssb_pcicore_init_clientmode(pc);
++}
++
++static u32 ssb_pcie_read(struct ssb_pcicore *pc, u32 address)
++{
++ pcicore_write32(pc, 0x130, address);
++ return pcicore_read32(pc, 0x134);
++}
++
++static void ssb_pcie_write(struct ssb_pcicore *pc, u32 address, u32 data)
++{
++ pcicore_write32(pc, 0x130, address);
++ pcicore_write32(pc, 0x134, data);
++}
++
++static void ssb_pcie_mdio_write(struct ssb_pcicore *pc, u8 device,
++ u8 address, u16 data)
++{
++ const u16 mdio_control = 0x128;
++ const u16 mdio_data = 0x12C;
++ u32 v;
++ int i;
++
++ v = 0x80; /* Enable Preamble Sequence */
++ v |= 0x2; /* MDIO Clock Divisor */
++ pcicore_write32(pc, mdio_control, v);
++
++ v = (1 << 30); /* Start of Transaction */
++ v |= (1 << 28); /* Write Transaction */
++ v |= (1 << 17); /* Turnaround */
++ v |= (u32)device << 22;
++ v |= (u32)address << 18;
++ v |= data;
++ pcicore_write32(pc, mdio_data, v);
++ /* Wait for the device to complete the transaction */
++ udelay(10);
++ for (i = 0; i < 10; i++) {
++ v = pcicore_read32(pc, mdio_control);
++ if (v & 0x100 /* Trans complete */)
++ break;
++ msleep(1);
++ }
++ pcicore_write32(pc, mdio_control, 0);
++}
++
++static void ssb_broadcast_value(struct ssb_device *dev,
++ u32 address, u32 data)
++{
++ /* This is used for both, PCI and ChipCommon core, so be careful. */
++ BUILD_BUG_ON(SSB_PCICORE_BCAST_ADDR != SSB_CHIPCO_BCAST_ADDR);
++ BUILD_BUG_ON(SSB_PCICORE_BCAST_DATA != SSB_CHIPCO_BCAST_DATA);
++
++ ssb_write32(dev, SSB_PCICORE_BCAST_ADDR, address);
++ ssb_read32(dev, SSB_PCICORE_BCAST_ADDR); /* flush */
++ ssb_write32(dev, SSB_PCICORE_BCAST_DATA, data);
++ ssb_read32(dev, SSB_PCICORE_BCAST_DATA); /* flush */
++}
++
++static void ssb_commit_settings(struct ssb_bus *bus)
++{
++ struct ssb_device *dev;
++
++ dev = bus->chipco.dev ? bus->chipco.dev : bus->pcicore.dev;
++ if (WARN_ON(!dev))
++ return;
++ /* This forces an update of the cached registers. */
++ ssb_broadcast_value(dev, 0xFD8, 0);
++}
++
++int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
++ struct ssb_device *dev)
++{
++ struct ssb_device *pdev = pc->dev;
++ struct ssb_bus *bus;
++ int err = 0;
++ u32 tmp;
++
++ might_sleep();
++
++ if (!pdev)
++ goto out;
++ bus = pdev->bus;
++
++ /* Enable interrupts for this device. */
++ if (bus->host_pci &&
++ ((pdev->id.revision >= 6) || (pdev->id.coreid == SSB_DEV_PCIE))) {
++ u32 coremask;
++
++ /* Calculate the "coremask" for the device. */
++ coremask = (1 << dev->core_index);
++
++ err = pci_read_config_dword(bus->host_pci, SSB_PCI_IRQMASK, &tmp);
++ if (err)
++ goto out;
++ tmp |= coremask << 8;
++ err = pci_write_config_dword(bus->host_pci, SSB_PCI_IRQMASK, tmp);
++ if (err)
++ goto out;
++ } else {
++ u32 intvec;
++
++ intvec = ssb_read32(pdev, SSB_INTVEC);
++ if ((bus->chip_id & 0xFF00) == 0x4400) {
++ /* Workaround: On the BCM44XX the BPFLAG routing
++ * bit is wrong. Use a hardcoded constant. */
++ intvec |= 0x00000002;
++ } else {
++ tmp = ssb_read32(dev, SSB_TPSFLAG);
++ tmp &= SSB_TPSFLAG_BPFLAG;
++ intvec |= tmp;
++ }
++ ssb_write32(pdev, SSB_INTVEC, intvec);
++ }
++
++ /* Setup PCIcore operation. */
++ if (pc->setup_done)
++ goto out;
++ if (pdev->id.coreid == SSB_DEV_PCI) {
++ tmp = pcicore_read32(pc, SSB_PCICORE_SBTOPCI2);
++ tmp |= SSB_PCICORE_SBTOPCI_PREF;
++ tmp |= SSB_PCICORE_SBTOPCI_BURST;
++ pcicore_write32(pc, SSB_PCICORE_SBTOPCI2, tmp);
++
++ if (pdev->id.revision < 5) {
++ tmp = ssb_read32(pdev, SSB_IMCFGLO);
++ tmp &= ~SSB_IMCFGLO_SERTO;
++ tmp |= 2;
++ tmp &= ~SSB_IMCFGLO_REQTO;
++ tmp |= 3 << SSB_IMCFGLO_REQTO_SHIFT;
++ ssb_write32(pdev, SSB_IMCFGLO, tmp);
++ ssb_commit_settings(bus);
++ } else if (pdev->id.revision >= 11) {
++ tmp = pcicore_read32(pc, SSB_PCICORE_SBTOPCI2);
++ tmp |= SSB_PCICORE_SBTOPCI_MRM;
++ pcicore_write32(pc, SSB_PCICORE_SBTOPCI2, tmp);
++ }
++ } else {
++ WARN_ON(pdev->id.coreid != SSB_DEV_PCIE);
++ //TODO: Better make defines for all these magic PCIE values.
++ if ((pdev->id.revision == 0) || (pdev->id.revision == 1)) {
++ /* TLP Workaround register. */
++ tmp = ssb_pcie_read(pc, 0x4);
++ tmp |= 0x8;
++ ssb_pcie_write(pc, 0x4, tmp);
++ }
++ if (pdev->id.revision == 0) {
++ const u8 serdes_rx_device = 0x1F;
++
++ ssb_pcie_mdio_write(pc, serdes_rx_device,
++ 2 /* Timer */, 0x8128);
++ ssb_pcie_mdio_write(pc, serdes_rx_device,
++ 6 /* CDR */, 0x0100);
++ ssb_pcie_mdio_write(pc, serdes_rx_device,
++ 7 /* CDR BW */, 0x1466);
++ } else if (pdev->id.revision == 1) {
++ /* DLLP Link Control register. */
++ tmp = ssb_pcie_read(pc, 0x100);
++ tmp |= 0x40;
++ ssb_pcie_write(pc, 0x100, tmp);
++ }
++ }
++ pc->setup_done = 1;
++out:
++ return err;
++}
++EXPORT_SYMBOL(ssb_pcicore_dev_irqvecs_enable);
--- git-wireless-dev.patch DELETED ---
- Previous message (by thread): rpms/libsepol/devel .cvsignore, 1.123, 1.124 libsepol.spec, 1.165, 1.166 sources, 1.124, 1.125
- Next message (by thread): rpms/bzr/F-7 .cvsignore, 1.15, 1.16 bzr.spec, 1.20, 1.21 sources, 1.15, 1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list