Atheros Wireless Device Emulation
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line · On Thursday 28 February 2008 15:12:20 [email protected] wrote:
Atheros Wireless Device Emulation
Hm... seems attachments don't go too well. Since it is a 9.500 LOC patch, I put here for download:
http://stud4.tuwien.ac.at/~e0126605/qemu_atheros/atheros_wlan.patch
Cheers
Hello!
Since I cannot guarantee that the code will be on my server forever, I'll post the CVS-patch here once more. Furthermore, I'll split it into smaller sections and put it inline, so the chance of getting it reviewed are a little bigger ;-)
Also, here are some comments I posted mistakenly into a message that was not attached to the wlan-device thread:
----------------------
Some more infos on the wlan emulation:
- if you cannot connect to the router (happens to me sometimes with windows
guests), simply cancel connecting and retry
- i experienced problems when getting a dynamic ip from qemu (dhcp) when
using multiple NICs. Simply disable all other NICs and it always worked for me or use static IPs.
- Inbound connections still buggy
- Still does not work with current CVS of Madwifi drivers. Use MadWifi 0.9.3
(and don't forget to use the _linux_ model type as explained in previous posts)
- I just tried the patch and got a "qemu: fatal: triple fault" ... i
restarted qemu and everything worked fine. either there is still a major bug in my code, or the snapshots inside my image were a little messed up.
Have fun with the code ;-)
----------------------
Briefly documented patches will come in the next posts
--Clemens
Patch #1:
Necessary changes to Qemu itself... Makefile and hw/pci.c to include the device:
hw/pci.c +2 -0
@@ -636,6 +636,8 @@pci_i82559er_init (bus, nd, devfn); }else if (strcmp (nd->model,"rtl8139" ) ==0 ) {pci_rtl8139_init (bus, nd, devfn); + }else if (strncmp (nd->model,"atheros_wlan" ,12 ) ==0 ) { +pci_Atheros_WLAN_init (bus, nd, devfn); }else if (strcmp (nd->model,"e1000" ) ==0 ) {pci_e1000_init (bus, nd, devfn); }else if (strcmp (nd->model,"pcnet" ) ==0 ) {
hw/pci.h +4 -0
@@ -126,6 +126,10 @@void pci_rtl8139_init (PCIBus *bus,NICInfo *nd,int devfn); +/* atheros_wlan.c */ + +void pci_Atheros_WLAN_init (PCIBus *bus,NICInfo *nd,int devfn); +/* e1000.c */ void pci_e1000_init (PCIBus *bus,NICInfo *nd,int devfn);
Makefile.target +2 -0
@@ -528,6 +528,8 @@ OBJS += pcnet.o OBJS += rtl8139.o OBJS += e1000.o +OBJS += atheros_wlan.o atheros_wlan_io.o atheros_wlan_ap.o +OBJS += atheros_wlan_packet.o atheros_wlan_crc32.o ifeq ($(TARGET_BASE_ARCH), i386) # Hardware support
Patch #2:
Setup code for the device
hw/atheros_wlan.c +6 -0
@@ -0,0 +1,348 @@ +/** +* QEMU WLAN device emulation +* +* Copyright (c) 2008 Clemens Kolbitsch +* +* Permission is hereby granted, free of charge, to any person obtaining a
copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * Modifications:
+ * 2008-February-24 Clemens Kolbitsch :
+ * New implementation based on ne2000.c
+ *
+ */
+
+#include "hw.h"
+#include "pci.h"
+#include "pc.h"
+#include "net.h"
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/shm.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+#include <sys/mman.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include <signal.h>
+
+#include <time.h>
+#include <sys/time.h>
+
+/*
+ * PCI and EEPROM definitions
+ */
+#include "hw/atheros_wlan.h"
+#include "hw/atheros_wlan_io.h"
+#include "hw/atheros_wlan_ap.h"
+#include "hw/atheros_wlan_eeprom.h"
+
+/*
+ * MadWifi OPENHAL atheros constants
+ */
+#include "hw/ath5k_hw.h"
+#include "hw/ath5kreg.h"
+#include "hw/ath5k.h"
+
+
+static void Atheros_WLAN_reset(NICInfo *nd, Atheros_WLANState *s) +{
+ DEBUG_PRINT(("reset\n"));
+
+ /*
+ * Restore mac address
+ */
+ memcpy(s->macaddr, nd->macaddr, 6);
+
+ /*
+ * data from my local AR5212 device
+ */
+ SET_MEM_L(s->mem, 12, 0);
+ SET_MEM_L(s->mem, AR5K_SREV, 86);
+ SET_MEM_L(s->mem, AR5K_PCICFG, 0x00010014);
+ SET_MEM_L(s->mem, AR5K_PHY_CHIP_ID, 65);
+ SET_MEM_L(s->mem, AR5K_SLEEP_CTL, 0x00010000);
+ SET_MEM_L(s->mem, 0x9820, 0x02020200);
+
+ Atheros_WLAN_update_irq(s);
+}
+
+void Atheros_WLAN_setup_type(NICInfo *nd, PCIAtheros_WLANState *d) +{
+ // create buffer large enough to
+ // do all checks
+ char *device_name;
+ char nd_model[128];
+ uint8_t *pci_conf;
+ Atheros_WLANState *s;
+
+ device_name = nd_model;
+ pci_conf = d->dev.config;
+ s = &d->Atheros_WLAN;
+
+ snprintf(nd_model, sizeof(nd_model), "%s", nd->model);
+
+
+ // skip "atheros_wlan"
+ // if it had not been part of nd->model, this
+ // module would not be loaded anyways!!
+ device_name += 12;
+ DEBUG_PRINT_AP(("Loading virtual wlan-pci device...\n"));
+ if (strncmp(device_name, "_winxp", 6) == 0)
+ {
+ s->device_driver_type = WINXP_DRIVER;
+ DEBUG_PRINT_AP((" * Make sure you are using a MS Windows driver!!\n"));
+
+ // skip "_winxp"
+ device_name += 6;
+ }
+ else if (strncmp(device_name, "_linux", 6) == 0)
+ {
+ s->device_driver_type = LINUX_DRIVER;
+ DEBUG_PRINT_AP((" * Make sure you are using a MadWifi driver!!\n"));
+
+ // skip "_linux"
+ device_name += 6;
+ }
+ else
+ {
+ s->device_driver_type = LINUX_DRIVER;
+ DEBUG_PRINT_AP((" * Unknown driver type '%s'... defaulting to Linux... Make
sure you are using a MadWifi driver!!\n", nd->model));
+ }
+
+ if (strncmp(device_name, "_HPW400", 7) == 0)
+ {
+ s->eeprom_data = (u_int32_t*)Atheros_WLAN_eeprom_data_HPW400;
+ s->eeprom_size = sizeof(Atheros_WLAN_eeprom_data_HPW400);
+
+ memcpy(pci_conf, Atheros_WLAN_pci_config_HPW400, 256);
+
+ DEBUG_PRINT_AP((" * Using EEPROM and device configuration of HP W400!!
\n"));
+
+ // skip "_HPW400"
+ device_name += 7;
+ }
+ else if (strncmp(device_name, "_MacBook", 8) == 0)
+ {
+ s->eeprom_data = (u_int32_t*)Atheros_WLAN_eeprom_data_MacBook;
+ s->eeprom_size = sizeof(Atheros_WLAN_eeprom_data_MacBook);
+
+ memcpy(pci_conf, Atheros_WLAN_pci_config_MacBook, 256);
+
+ DEBUG_PRINT_AP((" * Using EEPROM and device configuration of Mac Book!!
\n"));
+
+ // skip "_MacBook"
+ device_name += 8;
+ }
+ else if (strncmp(device_name, "_AR5001XPlus", 12) == 0)
+ {
+ s->eeprom_data = (u_int32_t*)Atheros_WLAN_eeprom_data_HPW400;
+ s->eeprom_size = sizeof(Atheros_WLAN_eeprom_data_HPW400);
+
+ memcpy(pci_conf, Atheros_WLAN_pci_config_AR5001XPlus, 256);
+
+ DEBUG_PRINT_AP((" * Using EEPROM and device configuration of AR5001X+ (e.g.
Toshiba A100)!!\n"));
+
+ // skip "_AR5001XPlus"
+ device_name += 12;
+ }
+ else if (strncmp(device_name, "_John", 5) == 0)
+ {
+ s->eeprom_data = (u_int32_t*)Atheros_WLAN_eeprom_data_HPW400;
+ s->eeprom_size = sizeof(Atheros_WLAN_eeprom_data_HPW400);
+
+ memcpy(pci_conf, Atheros_WLAN_pci_config_JOHN, 256);
+
+ DEBUG_PRINT_AP((" * Using EEPROM and device configuration of John!!\n"));
+
+ // skip "_John"
+ device_name += 5;
+ }
+ else if (strncmp(device_name, "_TPLinkWN651G", 13) == 0)
+ {
+ s->eeprom_data = (u_int32_t*)Atheros_WLAN_eeprom_data_HPW400;
+ s->eeprom_size = sizeof(Atheros_WLAN_eeprom_data_HPW400);
+
+ memcpy(pci_conf, Atheros_WLAN_pci_config_TP_Link_WN651G, 64);
+
+ DEBUG_PRINT_AP((" * Using EEPROM and device configuration of TP-Link
WN651G!!\n"));
+
+ // skip "_TPLinkWN651G"
+ device_name += 13;
+ }
+ else
+ {
+ s->eeprom_data = (u_int32_t*)Atheros_WLAN_eeprom_data_HPW400;
+ s->eeprom_size = sizeof(Atheros_WLAN_eeprom_data_HPW400);
+
+ memcpy(pci_conf, Atheros_WLAN_pci_config_HPW400, 256);
+
+ DEBUG_PRINT_AP((" * Unknown EEPROM type '%s'... defaulting to HP W400!!\n",nd->model));
+ }
+}
+
+
+static void Atheros_WLAN_save(QEMUFile* f, void* opaque)
+{
+ int i;
+ uint32_t direct_value;
+ Atheros_WLANState *s = (Atheros_WLANState *)opaque;
+
+ if (s->pci_dev)
+ {
+ pci_device_save(s->pci_dev, f);
+ }
+
+ qemu_put_be32s(f, &s->device_driver_type);
+
+ qemu_put_buffer(f, s->ipaddr, 4);
+ qemu_put_buffer(f, s->macaddr, 6);
+
+ qemu_put_buffer(f, s->ap_ipaddr, 4);
+ qemu_put_buffer(f, s->ap_macaddr, 6);
+
+
+ qemu_put_be32s(f, &s->interrupt_p_mask);
+ for (i=0; i<5; qemu_put_be32s(f, &s->interrupt_s_mask[i++]));
+ qemu_put_8s(f, &s->interrupt_enabled);
+
+ qemu_put_be32s(f, &s->current_frequency);
+
+ direct_value = (uint32_t)s->receive_queue_address;
+ qemu_put_be32s(f, &direct_value);
+ qemu_put_be32s(f, &s->receive_queue_count);
+
+ qemu_put_be32s(f, &s->transmit_queue_size);
+ for (i=0; i<16; i++)
+ {
+ qemu_put_8s(f, &s->transmit_queue_enabled[i]);
+ direct_value = (uint32_t)s->transmit_queue_address[i];
+ qemu_put_be32s(f, &direct_value);
+ qemu_put_be32s(f, &s->transmit_queue_processed[i]);
+ }
+
+ qemu_put_be32s(f, &s->ap_state);
+ qemu_put_be32s(f, &s->inject_sequence_number);
+
+ qemu_put_buffer(f, (uint8_t *)s->mem, Atheros_WLAN_MEM_SIZE);
+}
+
+static int Atheros_WLAN_load(QEMUFile* f, void* opaque, int version_id) +{
+ int i, ret;
+ uint32_t direct_value;
+ Atheros_WLANState *s = (Atheros_WLANState *)opaque;
+
+ // everyone has version 3... and the pci
+ // stuff should be there as well, I think
+ //
+ // let's just claim this has been around
+ // for quite some time ;-)
+ if (version_id != 3)
+ return -EINVAL;
+
+ if (s->pci_dev && version_id >= 3) {
+ ret = pci_device_load(s->pci_dev, f);
+ if (ret < 0)
+ return ret;
+ }
+
+ qemu_get_be32s(f, &s->device_driver_type);
+
+ qemu_get_buffer(f, s->ipaddr, 4);
+ qemu_get_buffer(f, s->macaddr, 6);
+
+ qemu_get_buffer(f, s->ap_ipaddr, 4);
+ qemu_get_buffer(f, s->ap_macaddr, 6);
+
+
+ qemu_get_be32s(f, &s->interrupt_p_mask);
+ for (i=0; i<5; qemu_get_be32s(f, &s->interrupt_s_mask[i++]));
+ qemu_get_8s(f, &s->interrupt_enabled);
+
+ qemu_get_be32s(f, &s->current_frequency);
+ qemu_get_be32s(f, &direct_value);
+ s->receive_queue_address = (uint32_t*)direct_value;
+ qemu_get_be32s(f, &s->receive_queue_count);
+
+ qemu_get_be32s(f, &s->transmit_queue_size);
+ for (i=0; i<16; i++)
+ {
+ qemu_get_8s(f, &s->transmit_queue_enabled[i]);
+ qemu_get_be32s(f, &direct_value);
+ s->transmit_queue_address[i] = (uint32_t*)direct_value;
+ qemu_get_be32s(f, &s->transmit_queue_processed[i]);
+ }
+
+ qemu_get_be32s(f, &s->ap_state);
+ qemu_get_be32s(f, &s->inject_sequence_number);
+
+ qemu_get_buffer(f, (uint8_t *)s->mem, Atheros_WLAN_MEM_SIZE);
+
+
+ s->inject_timer_running = 0;
+ s->inject_queue_size = 0;
+ s->inject_queue = NULL;
+
+ return 0;
+}
+
+
+void pci_Atheros_WLAN_init(PCIBus *bus, NICInfo *nd, int devfn) +{
+ PCIAtheros_WLANState *d;
+ Atheros_WLANState *s;
+
+ /*
+ * currently, we have to use this mac-address.
+ * it is hardcoded in the eeprom/io-stuff
+ */
+ nd->macaddr[0] = 0x00;
+ nd->macaddr[1] = 0x11;
+ nd->macaddr[2] = 0x0a;
+ nd->macaddr[3] = 0x80;
+ nd->macaddr[4] = 0x2e;
+ nd->macaddr[5] = 0x9e;
+
+ d = (PCIAtheros_WLANState *)pci_register_device(bus, "Atheros_WLAN",sizeof(PCIAtheros_WLANState), devfn, NULL, NULL);
+ s = &d->Atheros_WLAN;
+
+ // s->irq = 9; /* PCI interrupt */
+ s->irq = d->dev.irq[0];
+ s->pci_dev = (PCIDevice *)d;
+ s->pending_interrupts = NULL;
+ memcpy(s->macaddr, nd->macaddr, 6);
+
+ Atheros_WLAN_setup_type(nd, d);
+ Atheros_WLAN_setup_io(d);
+ Atheros_WLAN_setup_ap(nd, d);
+
+ /* TODO: we don't support multiple instance yet!! */
+ register_savevm("Atheros_WLAN", 0, 3, Atheros_WLAN_save, Atheros_WLAN_load,
s);
+
+ Atheros_WLAN_reset(nd, s);
+}
Patch #3:
Setup code definitions. The 802.11 data structures, device memory, and debugging macros.
hw/atheros_wlan.h +6 -0
@@ -0,0 +1,345 @@ +/** +* QEMU WLAN device emulation +* +* Copyright (c) 2008 Clemens Kolbitsch +* +* Permission is hereby granted, free of charge, to any person obtaining a
copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * Modifications:
+ * 2008-February-24 Clemens Kolbitsch :
+ * New implementation based on ne2000.c
+ *
+ */
+
+#ifndef atheros_wlan_h
+#define atheros_wlan_h 1
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/shm.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+#include <sys/mman.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+
+/*
+ * debug Atheros_WLAN card
+ *
+ * i.e. show all access traces
+ */
+// #define DEBUG_Atheros_WLAN 1
+// #define DEBUG_Atheros_AP_WLAN 1
+
+#define PCI_FREQUENCY 33000000L
+
+#if defined (DEBUG_Atheros_WLAN)
+# define DEBUG_PRINT(x) do { struct timeval __tt; gettimeofday(&__tt, NULL); printf("%u:%u ", __tt.tv_sec, __tt.tv_usec); printf x ; } while (0) +#else
+# define DEBUG_PRINT(x)
+#endif
+
+#if defined (DEBUG_Atheros_AP_WLAN)
+# define DEBUG_PRINT_AP(x) printf x ;
+#else
+# define DEBUG_PRINT_AP(x)
+#endif
+
+
+
+/*
+ * The madwifi driver crashes if too
+ * many frames are in the receive
+ * queue linked list
+ *
+ * This can happen when interrupts are
+ * not picked up right away (what can
+ * happen due to qemu's lazy interrupt
+ * checking/handling)!!
+ *
+ * UPDATE: BinaryHAL suddenly seems to
+ * work with the WINDOWS_RX_FRAME as well
+ * which is even better (because more frames
+ * may be received concurrently...)
+ */
+#define MAX_CONCURRENT_RX_FRAMES_WINDOWS_OR_OPEN_HAL 999
+#define MAX_CONCURRENT_RX_FRAMES_BINARY_HAL 10
+#define MAX_CONCURRENT_RX_FRAMES MAX_CONCURRENT_RX_FRAMES_WINDOWS_OR_OPEN_HAL
+
+/*
+ * In case we are connecting with a windows guest OS
+ * (or the ndiswrapper of the windows driver) we must
+ * define this macro... otherwise no packets will be
+ * received.
+ *
+ * If connecting with a linux guest/madwifi with the
+ * macro defined it won't work on the other hand!!!
+ */
+#define WINXP_DRIVER 1
+#define LINUX_DRIVER 2
+
+#define PCI_CONFIG_AR5212 1
+#define PCI_CONFIG_AR5424 2
+
+
+
+
+
+#define IEEE80211_IDLE 0xff
+
+#define IEEE80211_TYPE_MGT 0x00
+#define IEEE80211_TYPE_CTL 0x01
+#define IEEE80211_TYPE_DATA 0x02
+
+#define IEEE80211_TYPE_MGT_SUBTYPE_BEACON 0x08
+#define IEEE80211_TYPE_MGT_SUBTYPE_ACTION 0x0d
+#define IEEE80211_TYPE_MGT_SUBTYPE_PROBE_REQ 0x04
+#define IEEE80211_TYPE_MGT_SUBTYPE_PROBE_RESP 0x05
+#define IEEE80211_TYPE_MGT_SUBTYPE_AUTHENTICATION 0x0b
+#define IEEE80211_TYPE_MGT_SUBTYPE_DEAUTHENTICATION 0x0c
+#define IEEE80211_TYPE_MGT_SUBTYPE_ASSOCIATION_REQ 0x00
+#define IEEE80211_TYPE_MGT_SUBTYPE_ASSOCIATION_RESP 0x01
+#define IEEE80211_TYPE_MGT_SUBTYPE_DISASSOCIATION 0x09
+
+#define IEEE80211_TYPE_CTL_SUBTYPE_ACK 0x0d
+
+#define IEEE80211_TYPE_DATA_SUBTYPE_DATA 0x00
+
+
+#define IEEE80211_BEACON_PARAM_SSID 0x00
+#define IEEE80211_BEACON_PARAM_SSID_STRING "\x00"
+#define IEEE80211_BEACON_PARAM_RATES 0x01
+#define IEEE80211_BEACON_PARAM_RATES_STRING "\x01"
+#define IEEE80211_BEACON_PARAM_CHANNEL 0x03
+#define IEEE80211_BEACON_PARAM_CHANNEL_STRING "\x03"
+#define IEEE80211_BEACON_PARAM_EXTENDED_RATES 0x32
+#define IEEE80211_BEACON_PARAM_EXTENDED_RATES_STRING "\x32"
+
+
+
+
+
+
+#define IEEE80211_CHANNEL1_FREQUENCY 2412
+#define IEEE80211_CHANNEL2_FREQUENCY 2417
+#define IEEE80211_CHANNEL3_FREQUENCY 2422
+#define IEEE80211_CHANNEL4_FREQUENCY 2427
+#define IEEE80211_CHANNEL5_FREQUENCY 2432
+#define IEEE80211_CHANNEL6_FREQUENCY 2437
+#define IEEE80211_CHANNEL7_FREQUENCY 2442
+#define IEEE80211_CHANNEL8_FREQUENCY 2447
+#define IEEE80211_CHANNEL9_FREQUENCY 2452
+#define IEEE80211_CHANNEL10_FREQUENCY 2457
+#define IEEE80211_CHANNEL11_FREQUENCY 2462
+
+
+#define IEEE80211_HEADER_SIZE 24
+
+struct mac80211_frame
+{
+ struct mac80211_frame_control
+ {
+ unsigned protocol_version :2;
+ unsigned type :2;
+ unsigned sub_type :4;
+
+ union
+ {
+ struct mac80211_frame_control_flags
+ {
+ unsigned to_ds :1;
+ unsigned from_ds :1;
+ unsigned more_frag :1;
+ unsigned retry :1;
+ unsigned power_mng :1;
+ unsigned more_data :1;
+ unsigned wep :1;
+ unsigned order :1;
+ } __attribute__((packed)) frame_control_flags;
+ uint8_t flags;
+ };
+
+ } __attribute__((packed)) frame_control;
+ uint16_t duration_id;
+
+ union
+ {
+ uint8_t address_1[6];
+ uint8_t destination_address[6];
+ };
+
+ union
+ {
+ uint8_t address_2[6];
+ uint8_t source_address[6];
+ };
+
+ union
+ {
+ uint8_t address_3[6];
+ uint8_t bssid_address[6];
+ };
+
+ struct mac80211_sequence_control
+ {
+ unsigned fragment_number :4;
+ unsigned sequence_number :12;
+ } __attribute__((packed)) sequence_control;
+
+ // WHEN IS THIS USED??
+ // uint8_t address_4[6];
+
+ // variable length, 2312 byte plus 4 byte frame-checksum
+ uint8_t data_and_fcs[2316];
+
+ unsigned int frame_length;
+ struct mac80211_frame *next_frame;
+
+} __attribute__((packed));
+
+
+#define GET_MEM_L(_mem, _addr) _mem[_addr >> 2]
+#define SET_MEM_L(_mem, _addr, _val) _mem[_addr >> 2] = _val
+
+#define WRITE_EEPROM(_mem, _val) \
+ SET_MEM_L(_mem, AR5K_EEPROM_DATA_5210, _val); \
+ SET_MEM_L(_mem, AR5K_EEPROM_DATA_5211, _val);
+
+
+
+
+#define Atheros_WLAN_PCI_REVID_ATHEROS 0x01
+#define Atheros_WLAN_PCI_REVID Atheros_WLAN_PCI_REVID_ATHEROS
+
+
+#define KiB 1024
+#define Atheros_WLAN_MEM_SIZE (64 * KiB)
+#define Atheros_WLAN_MEM_SANITIZE(x) (x & (Atheros_WLAN_MEM_SIZE - 1))
+
+#define Atheros_WLAN__STATE_NOT_AUTHENTICATED 0
+#define Atheros_WLAN__STATE_AUTHENTICATED 1
+#define Atheros_WLAN__STATE_ASSOCIATED 2
+
+
+#define Atheros_WLAN__MAX_INJECT_QUEUE_SIZE 20
+
+
+/*
+ * We use a semaphore to make sure
+ * that accessing the linked lists
+ * inside the state is done atomically
+ */
+#define ATHEROS_WLAN_ACCESS_SEM_KEY 20071
+
+
+/*
+ * AR521X uses a very complicated algorithm to
+ * express current channel... too lazy to understand
+ * it... just use a matrix :-)
+ *
+ * ATTENTION: This matrix is valid only for little-endian
+ * as the algorithm uses bitswapping
+ *
+ * NOTE: Maybe, bitswapping also takes care of this and
+ * big-endian values thus correspond with this matrix, but
+ * I just don't care ;-)
+ */
+struct Atheros_WLAN_frequency {
+ u_int32_t value1;
+ u_int32_t value2;
+ u_int32_t frequency;
+};
+
+struct pending_interrupt
+{
+ uint32_t status;
+ struct pending_interrupt *next;
+};
+
+typedef struct Atheros_WLANState
+{
+ PCIDevice *pci_dev;
+ VLANClientState *vc;
+ int Atheros_WLAN_mmio_io_addr;
+
+ int device_driver_type;
+
+ uint8_t ipaddr[4]; // currently unused
+ uint8_t macaddr[6]; // mac address
+
+ uint8_t ap_ipaddr[4]; // currently unused
+ uint8_t ap_macaddr[6]; // mac address
+
+ // int irq;
+ qemu_irq irq;
+ uint32_t interrupt_p_mask; // primary interrupt mask
+ uint32_t interrupt_s_mask[5]; // secondary interrupt masks
+ uint8_t interrupt_enabled;
+ struct pending_interrupt *pending_interrupts;
+ int access_semaphore;
+
+ uint32_t current_frequency_partial_data[2];
+ uint32_t current_frequency;
+
+
+ uint32_t *receive_queue_address;
+ uint32_t receive_queue_count;
+
+ uint32_t transmit_queue_size;
+ uint8_t transmit_queue_enabled[16];
+ uint32_t *transmit_queue_address[16];
+ int transmit_queue_processed[16];
+
+ uint32_t mem[Atheros_WLAN_MEM_SIZE / 4];
+
+ int eeprom_size;
+ u_int32_t *eeprom_data;
+
+ int ap_state;
+ int inject_timer_running;
+ unsigned int inject_sequence_number;
+
+ // various timers
+ QEMUTimer *beacon_timer;
+ QEMUTimer *inject_timer;
+
+ int inject_queue_size;
+ struct mac80211_frame *inject_queue;
+
+} Atheros_WLANState;
+
+
+/***********************************************************/ +/* PCI Atheros_WLAN definitions */
+
+typedef struct PCIAtheros_WLANState {
+ PCIDevice dev;
+ Atheros_WLANState Atheros_WLAN;
+} PCIAtheros_WLANState;
+
+
+#endif // atheros_wlan_h
Patch #4:
Virtual access point code. It is based on a message queue and a timer that repeatedly injects the ingoing messages and replies into the queue. Outgoing messages are parsed to extract the IP-datagram from the wireless packet and passed on to Qemu.
There are 3 important functions here:
- Atheros_WLAN_handle_frame, is the AP state machine. Really simplified but
sufficient ;-)
- Atheros_WLAN_handleRxBuffer, inject a packet into the guest driver
- Atheros_WLAN_handleTxBuffer, extract a packet from the guest driver
hw/atheros_wlan_ap.c +6 -0
@@ -0,0 +1,771 @@ +/** +* QEMU WLAN access point emulation +* +* Copyright (c) 2008 Clemens Kolbitsch +* +* Permission is hereby granted, free of charge, to any person obtaining a
copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * Modifications:
+ * 2008-February-24 Clemens Kolbitsch :
+ * New implementation based on ne2000.c
+ *
+ */
+
+
+#include "hw.h"
+#include "pci.h"
+#include "pc.h"
+#include "net.h"
+#include "qemu-timer.h"
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/shm.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+#include <sys/mman.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include <signal.h>
+
+#include <time.h>
+#include <sys/time.h>
+
+/*
+ * PCI and EEPROM definitions
+ */
+#include "hw/atheros_wlan.h"
+#include "hw/atheros_wlan_ap.h"
+#include "hw/atheros_wlan_io.h"
+#include "hw/atheros_wlan_packet.h"
+
+/*
+ * MadWifi OPENHAL atheros constants
+ */
+#include "hw/ath5k_hw.h"
+#include "hw/ath5kreg.h"
+#include "hw/ath5k.h"
+
+static int semaphore_helper(int semaphore, int sem_op, int semaphore_nr, short flags)
+{
+ struct sembuf semp;
+ semp.sem_num = semaphore_nr;
+ semp.sem_op = sem_op;
+ semp.sem_flg = flags;
+
+ if (semaphore == -1)
+ {
+ /*
+ * We don't have a semaphore... probably not
+ * that bad, but having one is better :-)
+ */
+ return -1;
+ }
+
+ int ret;
+ while ((ret = semop(semaphore, &semp, 1)) < 0)
+ {
+ if (errno == EAGAIN && flags == IPC_NOWAIT)
+ {
+ return errno;
+ }
+ else if (errno != EINTR)
+ {
+ fprintf(stderr, "Semaphore error: 0x%x / %u\n", errno, errno);
+ return errno;
+ }
+ }
+
+ return ret;
+}
+
+
+static int signal_semaphore(int semaphore, int semaphore_nr)
+{
+ return semaphore_helper(semaphore, 1, semaphore_nr, 0);
+}
+static int wait_semaphore(int semaphore, int semaphore_nr)
+{
+ return semaphore_helper(semaphore, -1, semaphore_nr, 0);
+}
+
+void Atheros_WLAN_insert_frame(Atheros_WLANState *s, struct mac80211_frame *frame)
+{
+ struct mac80211_frame *i_frame;
+
+ wait_semaphore(s->access_semaphore, 0);
+
+ s->inject_queue_size++;
+ i_frame = s->inject_queue;
+ if (!i_frame)
+ {
+ s->inject_queue = frame;
+ }
+ else
+ {
+ while (i_frame->next_frame)
+ {
+ i_frame = i_frame->next_frame;
+ }
+
+ i_frame->next_frame = frame;
+ }
+
+ if (!s->inject_timer_running)
+ {
+ // if the injection timer is not
+ // running currently, let's schedule
+ // one run...
+ s->inject_timer_running = 1;
+ qemu_mod_timer(s->inject_timer, qemu_get_clock(rt_clock) + 5);
+ }
+
+ signal_semaphore(s->access_semaphore, 0);
+}
+
+static void Atheros_WLAN_beacon_timer(void *opaque)
+{
+ struct mac80211_frame *frame;
+ Atheros_WLANState *s = (Atheros_WLANState *)opaque;
+
+ frame = Atheros_WLAN_create_beacon_frame();
+ if (frame)
+ {
+ Atheros_WLAN_init_frame(s, frame);
+ Atheros_WLAN_insert_frame(s, frame);
+ }
+
+ qemu_mod_timer(s->beacon_timer, qemu_get_clock(rt_clock) + 500);
+}
+
+static void Atheros_WLAN_inject_timer(void *opaque)
+{
+ Atheros_WLANState *s = (Atheros_WLANState *)opaque;
+ struct mac80211_frame *frame;
+
+ wait_semaphore(s->access_semaphore, 0);
+
+ frame = s->inject_queue;
+ if (frame)
+ {
+ // remove from queue
+ s->inject_queue_size--;
+ s->inject_queue = frame->next_frame;
+ }
+ signal_semaphore(s->access_semaphore, 0);
+
+ if (!frame)
+ {
+ goto timer_done;
+ }
+
+ if (s->receive_queue_address == NULL)
+ {
+ // we drop the packet
+ }
+ else
+ {
+ Atheros_WLAN_handleRxBuffer(s, frame, frame->frame_length);
+ }
+
+ free(frame);
+
+timer_done:
+ wait_semaphore(s->access_semaphore, 0);
+
+ if (s->inject_queue_size > 0)
+ {
+ // there are more packets... schedule
+ // the timer for sending them as well
+ qemu_mod_timer(s->inject_timer, qemu_get_clock(rt_clock) + 25);
+ }
+ else
+ {
+ // we wait until a new packet schedules
+ // us again
+ s->inject_timer_running = 0;
+ }
+
+ signal_semaphore(s->access_semaphore, 0);
+}
+
+
+static int Atheros_WLAN_can_receive(void *opaque)
+{
+ Atheros_WLANState *s = (Atheros_WLANState *)opaque;
+
+ if (s->ap_state != Atheros_WLAN__STATE_ASSOCIATED)
+ {
+ // we are currently not connected
+ // to the access point
+ return 0;
+ }
+
+ if (s->inject_queue_size > Atheros_WLAN__MAX_INJECT_QUEUE_SIZE)
+ {
+ // overload, please give me some time...
+ return 0;
+ }
+
+ return 1;
+}
+
+static void Atheros_WLAN_receive(void *opaque, const uint8_t *buf, int size) +{
+ struct mac80211_frame *frame;
+ Atheros_WLANState *s = (Atheros_WLANState *)opaque;
+
+ if (!Atheros_WLAN_can_receive(opaque))
+ {
+ // this should not happen, but in
+ // case it does, let's simply drop
+ // the packet
+ return;
+ }
+
+ if (!s)
+ {
+ return;
+ }
+
+ /*
+ * A 802.3 packet comes from the qemu network. The
+ * access points turns it into a 802.11 frame and
+ * forwards it to the wireless device
+ */
+ frame = Atheros_WLAN_create_data_packet(s, buf, size);
+ if (frame)
+ {
+ Atheros_WLAN_init_frame(s, frame);
+ Atheros_WLAN_insert_frame(s, frame);
+ }
+}
+
+void Atheros_WLAN_setup_ap(NICInfo *nd, PCIAtheros_WLANState *d) +{
+ Atheros_WLANState *s;
+ s = &d->Atheros_WLAN;
+
+ s->ap_state = Atheros_WLAN__STATE_NOT_AUTHENTICATED;
+ s->ap_macaddr[0] = 0x00;
+ s->ap_macaddr[1] = 0x13;
+ s->ap_macaddr[2] = 0x46;
+ s->ap_macaddr[3] = 0xbf;
+ s->ap_macaddr[4] = 0x31;
+ s->ap_macaddr[5] = 0x59;
+
+ s->inject_timer_running = 0;
+ s->inject_sequence_number = 0;
+
+ s->inject_queue = NULL;
+ s->inject_queue_size = 0;
+
+ s->access_semaphore = semget(ATHEROS_WLAN_ACCESS_SEM_KEY, 1, 0666 |IPC_CREAT);
+ semctl(s->access_semaphore, 0, SETVAL, 1);
+
+ s->beacon_timer = qemu_new_timer(rt_clock, Atheros_WLAN_beacon_timer, s);
+ qemu_mod_timer(s->beacon_timer, qemu_get_clock(rt_clock));
+
+ // setup the timer but only schedule
+ // it when necessary...
+ s->inject_timer = qemu_new_timer(rt_clock, Atheros_WLAN_inject_timer, s);
+
+ s->vc = qemu_new_vlan_client(nd->vlan, Atheros_WLAN_receive,Atheros_WLAN_can_receive, s);
+
+ snprintf(s->vc->info_str, sizeof(s->vc->info_str), "atheros wireless lan
(macaddr=%02x:%02x:%02x:%02x:%02x:%02x)",
+ s->macaddr[0], s->macaddr[1], s->macaddr[2],
+ s->macaddr[3], s->macaddr[4], s->macaddr[5]);
+}
+
+
+
+void Atheros_WLAN_disable_irq(void *arg)
+{
+ Atheros_WLANState *s = (Atheros_WLANState *)arg;
+ SET_MEM_L(s->mem, ATH_HW_IRQ_PENDING, ATH_HW_IRQ_PENDING_FALSE);
+ qemu_set_irq(s->irq, 0);
+ DEBUG_PRINT((">> Disabling irq\n"));
+}
+
+void Atheros_WLAN_enable_irq(void *arg)
+{
+ Atheros_WLANState *s = (Atheros_WLANState *)arg;
+
+ if (!s->interrupt_enabled)
+ {
+ DEBUG_PRINT((">> Wanted to enable irq, but they are disabled\n"));
+ Atheros_WLAN_disable_irq(s);
+ return;
+ }
+
+ DEBUG_PRINT((">> Enabling irq\n"));
+ SET_MEM_L(s->mem, ATH_HW_IRQ_PENDING, ATH_HW_IRQ_PENDING_TRUE);
+ qemu_set_irq(s->irq, 1);
+}
+
+
+void Atheros_WLAN_update_irq(void *arg)
+{
+ Atheros_WLANState *s = (Atheros_WLANState *)arg;
+ DEBUG_PRINT((">> Updating... irq-enabled is %u\n", s->interrupt_enabled));
+ /*
+ * NOTE: Since we use shared interrupts
+ * the device driver will check if the
+ * interrupt really comes from this hardware
+ *
+ * This is done by checking the
+ * ATH_HW_IRQ_PENDING memory...
+ */
+ if (/*(!s->interrupt_enabled) ||*/
+ (s->pending_interrupts == NULL))
+ {
+ SET_MEM_L(s->mem, AR5K_RAC_PISR, 0);
+ goto disable_further_interrupts;
+ }
+
+ /*
+ * Make sure this is done atomically!!
+ */
+ wait_semaphore(s->access_semaphore, 0);
+ uint32_t status = 0x0;
+ struct pending_interrupt *i = s->pending_interrupts;
+ struct pending_interrupt *next;
+
+ s->pending_interrupts = NULL;
+ while (i != NULL)
+ {
+ next = i->next;
+ if (1) //(s->interrupt_p_mask & i->status)
+ {
+ status |= i->status;
+ }
+ free(i);
+
+ i = next;
+ }
+
+ SET_MEM_L(s->mem, AR5K_RAC_PISR, status);
+ DEBUG_PRINT((">> Status set to %u\n", status));
+ /*
+ * Atomic part done...
+ */
+ signal_semaphore(s->access_semaphore, 0);
+
+
+disable_further_interrupts:
+ /*
+ * NOTE: At last, it will check if any
+ * more interrupts are pending. The call
+ * to check what type of interrupt was
+ * pending already put down the interrupt_pending
+ * bit for us (check the readl function for RAC)
+ *
+ * if_ath.c: 921
+ */
+ Atheros_WLAN_disable_irq(s);
+}
+
+
+void Atheros_WLAN_append_irq(Atheros_WLANState *s, struct pending_interrupt intr)
+{
+ struct pending_interrupt *new_intr;
+ new_intr = (struct pending_interrupt *)malloc(sizeof(structpending_interrupt));
+ memcpy(new_intr, &intr, sizeof(intr));
+
+ /*
+ * Make sure this is done atomically!!
+ */
+ wait_semaphore(s->access_semaphore, 0);
+
+ if (s->pending_interrupts == NULL)
+ {
+ s->pending_interrupts = new_intr;
+ }
+ else
+ {
+ /*
+ * Insert at the end of the
+ * list to assure correct order
+ * of interrupts!
+ */
+ struct pending_interrupt *i = s->pending_interrupts;
+ while (i->next != NULL)
+ {
+ i = i->next;
+ }
+
+ new_intr->next = NULL;
+ i->next = new_intr;
+ }
+
+ /*
+ * Atomic part done...
+ */
+ signal_semaphore(s->access_semaphore, 0);
+}
+
+
+
+
+
+
+
+
+void Atheros_WLAN_handleRxBuffer(Atheros_WLANState *s, struct mac80211_frame *frame, uint32_t frame_length)
+{
+ struct ath_desc desc;
+ struct ath5k_ar5212_rx_status *rx_status;
+ rx_status = (struct ath5k_ar5212_rx_status*)&desc.ds_hw[0];
+
+ if (s->receive_queue_address == NULL)
+ {
+ return;
+ }
+
+ cpu_physical_memory_read((target_phys_addr_t)s->receive_queue_address,
(uint8_t*)&desc, sizeof(desc));
+
+ /*
+ * Put some good base-data into
+ * the descriptor. Length & co
+ * will be modified below...
+ *
+ * NOTE: Better set everything correctly
+ *
+ * Look at ath5k_hw.c: proc_tx_desc
+ */
+ desc.ds_ctl0 = 0x0;
+ desc.ds_ctl1 = 0x9c0;
+ desc.ds_hw[0] = 0x126d806a;
+ desc.ds_hw[1] = 0x49860003;
+ desc.ds_hw[2] = 0x0;
+ desc.ds_hw[3] = 0x0;
+
+
+ /*
+ * Filter out old length and put in correct value...
+ */
+ rx_status->rx_status_0 &= ~AR5K_AR5212_DESC_RX_STATUS0_DATA_LEN;
+ rx_status->rx_status_0 |= frame_length;
+ rx_status->rx_status_0 &= ~AR5K_AR5211_DESC_RX_STATUS0_MORE;
+
+ /*
+ * Write descriptor and packet back to DMA memory...
+ */
+ cpu_physical_memory_write((target_phys_addr_t)s->receive_queue_address,
(uint8_t*)&desc, sizeof(desc));
+ cpu_physical_memory_write((target_phys_addr_t)desc.ds_data, (uint8_t*)frame,sizeof(struct mac80211_frame));
+
+ /*
+ * Set address to next position
+ * in single-linked list
+ *
+ * The receive list's last element
+ * points to itself to avoid overruns.
+ * This way, at some point no more
+ * packets will be received, but (I
+ * ASSUME) that it is the drivers
+ * responsibility to reset the address
+ * list!
+ *
+ *
+ * NOTE: It seems the real madwifi cannot
+ * handle multiple packets at once. so we
+ * set the buffer to NULL to make the injection
+ * fail next time until an interrupt was
+ * received by the driver and a new buffer
+ * is registered!!
+ */
+ s->receive_queue_address =
+ ((++s->receive_queue_count) > MAX_CONCURRENT_RX_FRAMES)
+ ? NULL
+ : (uint32_t *)desc.ds_link;
+
+
+ DEBUG_PRINT((">> Enabling rx\n"));
+ /*
+ * Notify the driver about the new packet
+ */
+ struct pending_interrupt intr;
+ intr.status = AR5K_INT_RX;
+ Atheros_WLAN_append_irq(s, intr);
+ Atheros_WLAN_enable_irq(s);
+}
+
+
+
+void Atheros_WLAN_handleTxBuffer(Atheros_WLANState *s, uint32_t queue) +{
+ struct ath_desc desc;
+ struct mac80211_frame frame;
+
+ if (s->transmit_queue_address[queue] == NULL)
+ {
+ return;
+ }
+
+ cpu_physical_memory_read((target_phys_addr_t)s->transmit_queue_address[queue], (uint8_t*)&desc, sizeof(desc));
+
+ if (s->transmit_queue_processed[queue])
+ {
+ /*
+ * Maybe we already processed the frame
+ * and have not gotten the address of the
+ * next frame buffer but still got a call
+ * to send the next frame
+ *
+ * this way we have to process the next
+ * frame in the single linked list!!
+ */
+ s->transmit_queue_address[queue] = (uint32_t *)desc.ds_link;
+
+ /*
+ * And now get the frame we really have to process...
+ */
+ cpu_physical_memory_read((target_phys_addr_t)s->transmit_queue_address[queue], (uint8_t*)&desc, sizeof(desc));
+ }
+
+ uint32_t segment_len, frame_length = 0, more;
+ uint8_t *frame_pos = (uint8_t*)&frame;
+ struct ath5k_ar5212_tx_desc *tx_desc;
+ tx_desc = (struct ath5k_ar5212_tx_desc*)&desc.ds_ctl0;
+ do
+ {
+ more = tx_desc->tx_control_1 & AR5K_AR5211_DESC_TX_CTL1_MORE;
+ segment_len = tx_desc->tx_control_1 & AR5K_AR5212_DESC_TX_CTL1_BUF_LEN;
+
+ cpu_physical_memory_read((target_phys_addr_t)desc.ds_data, frame_pos,segment_len);
+ frame_pos += segment_len;
+ frame_length += segment_len;
+
+
+ /*
+ * Notify successful transmission
+ *
+ * NOTE: It'd be better to leave the
+ * descriptor as it is and only modify
+ * the transmit-ok-bits --> this way
+ * the timestamp and co. would stay
+ * valid...
+ *
+ * Look at ath5k_hw.c: proc_tx_desc
+ *
+ * NOTE: Not sure if this acknowledgement
+ * must be copied back for every single
+ * descriptor in a multi-segment frame,
+ * but better safe than sorry!!
+ */
+ desc.ds_ctl0 = 0x213f002f;
+ desc.ds_ctl1 = 0x2b;
+ desc.ds_hw[0] = 0xf0000;
+ desc.ds_hw[1] = 0x1b;
+ desc.ds_hw[2] = 0xab640001;
+ desc.ds_hw[3] = 0x4a019;
+
+ /*
+ *
+ * struct ath5k_tx_status *tx_status = (struct
ath5k_tx_status*)&desc.ds_hw[2];
+ * tx_status->tx_status_1 |= AR5K_DESC_TX_STATUS1_DONE;
+ * tx_status->tx_status_0 |= AR5K_DESC_TX_STATUS0_FRAME_XMIT_OK;
+ *
+ *
+ * Write descriptor back to DMA memory...
+ */
+ cpu_physical_memory_write((target_phys_addr_t)s->transmit_queue_address[queue], (uint8_t*)&desc, sizeof(desc));
+
+ if (more && frame_length < sizeof(frame))
+ {
+ /*
+ * This is done at the end of the loop
+ * since sometimes the next-link is not
+ * yet set (assuming frame is a 1-segment
+ * frame)!!
+ *
+ * This is very strange (and maybe obsolete
+ * by this version) but let's do it the safe
+ * way and not mess it up :-)
+ */
+ s->transmit_queue_address[queue] = (uint32_t *)desc.ds_link;
+ cpu_physical_memory_read((target_phys_addr_t)s->transmit_queue_address[queue], (uint8_t*)&desc, sizeof(desc));
+ }
+ }
+ while (more && frame_length < sizeof(frame));
+
+
+ struct pending_interrupt intr;
+ intr.status = AR5K_INT_TX;
+ Atheros_WLAN_append_irq(s, intr);
+ Atheros_WLAN_enable_irq(s);
+
+ /*
+ * Set address to next position
+ * in single-linked list
+ *
+ * The transmit list's last element
+ * points to itself to avoid overruns.
+ * This way, at some point no more
+ * packets will be received, but (I
+ * ASSUME) that it is the drivers
+ * responsibility to reset the address
+ * list!
+ */
+ s->transmit_queue_processed[queue] = 1;
+
+ frame.frame_length = frame_length + 4;
+ Atheros_WLAN_handle_frame(s, &frame);
+}
+
+
+void Atheros_WLAN_handle_frame(Atheros_WLANState *s, struct mac80211_frame *frame)
+{
+ struct mac80211_frame *reply = NULL;
+ unsigned long ethernet_frame_size;
+ unsigned char ethernet_frame[1518];
+
+ if ((frame->frame_control.type == IEEE80211_TYPE_MGT) &&
+ (frame->frame_control.sub_type == IEEE80211_TYPE_MGT_SUBTYPE_PROBE_REQ))
+ {
+ reply = Atheros_WLAN_create_probe_response();
+ }
+ else if ((frame->frame_control.type == IEEE80211_TYPE_MGT) &&
+ (frame->frame_control.sub_type ==IEEE80211_TYPE_MGT_SUBTYPE_AUTHENTICATION))
+ {
+ DEBUG_PRINT_AP(("Received authentication!\n"));
+ reply = Atheros_WLAN_create_authentication();
+
+ if (s->ap_state == Atheros_WLAN__STATE_NOT_AUTHENTICATED)
+ {
+ // if everything is going according to
+ // the state machine, let's jump into the
+ // next state
+ s->ap_state = Atheros_WLAN__STATE_AUTHENTICATED;
+ }
+ }
+ else if ((frame->frame_control.type == IEEE80211_TYPE_MGT) &&
+ (frame->frame_control.sub_type ==IEEE80211_TYPE_MGT_SUBTYPE_DEAUTHENTICATION))
+ {
+ DEBUG_PRINT_AP(("Received deauthentication!\n"));
+ reply = Atheros_WLAN_create_deauthentication();
+
+ // some systems (e.g. WinXP) won't send a
+ // disassociation. just believe that the
+ // deauthentication is ok... nothing bad
+ // can happen anyways ;-)
+ s->ap_state = Atheros_WLAN__STATE_NOT_AUTHENTICATED;
+ }
+ else if ((frame->frame_control.type == IEEE80211_TYPE_MGT) &&
+ (frame->frame_control.sub_type ==IEEE80211_TYPE_MGT_SUBTYPE_ASSOCIATION_REQ))
+ {
+ DEBUG_PRINT_AP(("Received association request!\n"));
+ reply = Atheros_WLAN_create_association_response();
+
+ if (s->ap_state == Atheros_WLAN__STATE_AUTHENTICATED)
+ {
+ // if everything is going according to
+ // the state machine, let's jump into the
+ // next state
+ s->ap_state = Atheros_WLAN__STATE_ASSOCIATED;
+ }
+ }
+ else if ((frame->frame_control.type == IEEE80211_TYPE_MGT) &&
+ (frame->frame_control.sub_type ==IEEE80211_TYPE_MGT_SUBTYPE_DISASSOCIATION))
+ {
+ DEBUG_PRINT_AP(("Received disassociation!\n"));
+ reply = Atheros_WLAN_create_disassociation();
+
+ if (s->ap_state == Atheros_WLAN__STATE_ASSOCIATED)
+ {
+ // if everything is going according to
+ // the state machine, let's jump into the
+ // next state
+ s->ap_state = Atheros_WLAN__STATE_AUTHENTICATED;
+ }
+ }
+ else if ((frame->frame_control.type == IEEE80211_TYPE_DATA) &&
+ (s->ap_state == Atheros_WLAN__STATE_ASSOCIATED))
+ {
+ /*
+ * The access point uses the 802.11 frame
+ * and sends a 802.3 frame into the network...
+ * This packet is then understandable by
+ * qemu-slirp
+ *
+ * If we ever want the access point to offer
+ * some services, it can be added here!!
+ */
+ // ethernet header type
+ ethernet_frame[12] = frame->data_and_fcs[6];
+ ethernet_frame[13] = frame->data_and_fcs[7];
+
+ // the new originator of the packet is
+ // the access point
+ memcpy(ðernet_frame[6], s->ap_macaddr, 6);
+
+ if (ethernet_frame[12] == 0x08 && ethernet_frame[13] == 0x06)
+ {
+ // for arp request, we use a broadcast
+ memset(ðernet_frame[0], 0xff, 6);
+ }
+ else
+ {
+ // otherwise we forward the packet to
+ // where it really belongs
+ memcpy(ðernet_frame[0], frame->destination_address, 6);
+ }
+
+ // add packet content
+ ethernet_frame_size = frame->frame_length - 24 - 4 - 8;
+
+ // for some reason, the packet is 22 bytes too small (??)
+ ethernet_frame_size += 22;
+ if (ethernet_frame_size > sizeof(ethernet_frame))
+ {
+ ethernet_frame_size = sizeof(ethernet_frame);
+ }
+ memcpy(ðernet_frame[14], &frame->data_and_fcs[8], ethernet_frame_size);
+
+ // add size of ethernet header
+ ethernet_frame_size += 14;
+
+ /*
+ * Send 802.3 frame
+ */
+ qemu_send_packet(s->vc, ethernet_frame, ethernet_frame_size);
+ }
+
+ if (reply)
+ {
+ memcpy(reply->destination_address, frame->source_address, 6);
+ Atheros_WLAN_init_frame(s, reply);
+ Atheros_WLAN_insert_frame(s, reply);
+ }
+}
+
+
+
+
+
+
+
hw/atheros_wlan_ap.h +6 -0
@@ -0,0 +1,47 @@ +/** +* QEMU WLAN access point emulation +* +* Copyright (c) 2008 Clemens Kolbitsch +* +* Permission is hereby granted, free of charge, to any person obtaining a
copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * Modifications:
+ * 2008-February-24 Clemens Kolbitsch :
+ * New implementation based on ne2000.c
+ *
+ */
+
+#ifndef atheros_wlan_ap_h
+#define atheros_wlan_ap_h 1
+
+void Atheros_WLAN_setup_ap(NICInfo *nd, PCIAtheros_WLANState *d); +
+void Atheros_WLAN_handleTxBuffer(Atheros_WLANState *s, uint32_t queue); +void Atheros_WLAN_handleRxBuffer(Atheros_WLANState *s, struct mac80211_frame *frame, uint32_t frame_length);
+
+void Atheros_WLAN_handle_frame(Atheros_WLANState *s, struct mac80211_frame *frame);
+
+void Atheros_WLAN_insert_frame(Atheros_WLANState *s, struct mac80211_frame *frame);
+
+void Atheros_WLAN_disable_irq(void *arg);
+void Atheros_WLAN_enable_irq(void *arg);
+void Atheros_WLAN_update_irq(void *arg);
+void Atheros_WLAN_append_irq(Atheros_WLANState *s, struct pending_interrupt intr);
+
+#endif // atheros_wlan_ap_h
Patch #5:
The most important/difficult/ugly part: Hardware I/O. It is handled over a direclty mapped memory regions that is written to/read from the device driver code. Based on ath5k and plenty of reverse engineering.
NOTE: I did NOT reimplement the hardware!! I simply handled the events as they come in and mess with the device memory to fake a real device. Thus the code is quite hard to understand. Sorry *g*
hw/atheros_wlan_io.c +1188 -0
@@ -0,0 +1,1188 @@ +/** +* QEMU WLAN device emulation +* +* Copyright (c) 2008 Clemens Kolbitsch +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +* +* Modifications: +* 2008-February-24 Clemens Kolbitsch : +* New implementation based on ne2000.c +* +*/ + + +#include "hw.h" +#include "pci.h" +#include "pc.h" +#include "net.h" + + +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/shm.h> +#include <sys/stat.h> +#include <sys/socket.h> +#include <sys/ipc.h> +#include <sys/sem.h> +#include <sys/mman.h> +#include <netinet/in.h> +#include <netdb.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> + +#include <signal.h> + +#include <time.h> +#include <sys/time.h> + +#include "hw/atheros_wlan.h" +#include "hw/atheros_wlan_ap.h" + + +/* +* MadWifi OPENHAL atheros constants +*/ +#include "hw/ath5k.h" +#include "hw/ath5k_hw.h" +#include "hw/ath5kreg.h" + + +static const struct Atheros_WLAN_frequency Atheros_WLAN_frequency_data[] = + { + {20689 ,3077 ,2412 },// channel 1 + {20715 ,3078 ,2417 },// channel 2 + {20689 ,3079 ,2422 },// channel 3 + {20715 ,3079 ,2427 },// channel 4 + {20529 ,3076 ,2432 },// channel 5 + {20507 ,3078 ,2437 },// channel 6 + {20529 ,3078 ,2442 },// channel 7 + {20507 ,3079 ,2447 },// channel 8 + {20529 ,3077 ,2452 },// channel 9 + {20635 ,3078 ,2457 },// channel 10 + {20529 ,3079 ,2462 },// channel 11 + {20635 ,3079 ,2467 },// channel 12 + {20657 ,3076 ,2472 },// channel 13 + {20529 ,1029 ,2484 }// channel 14 + }; + +/* +* NOTE: By using this function instead +* of accessing the array directly through +* an index, we can leave out parts of the +* EEPROM data!! +*/ +static int get_eeprom_data (Atheros_WLANState *s,uint32_t addr,uint32_t *val) +{ +if (val ==NULL ) + { +return 1 ; + } + +// why?? but seems necessary... + addr--; + +if ((addr <0 ) || (addr > s->eeprom_size)) + { +return 2 ; + } + + *val = s->eeprom_data[addr]; +return 0 ; +} + + + + + + +void updateFrequency (Atheros_WLANState *s) +{ +int i; +u_int32_t new_frequency =0 ; +for (i=0 ; i <sizeof (Atheros_WLAN_frequency_data) /sizeof (Atheros_WLAN_frequency_data[0 ]); i++) + { +if (Atheros_WLAN_frequency_data[i].value1 != s->current_frequency_partial_data[0 ]) +continue ; + +if (Atheros_WLAN_frequency_data[i].value2 != s->current_frequency_partial_data[1 ]) +continue ; + + new_frequency = Atheros_WLAN_frequency_data[i].frequency; +break ; + } + +if (new_frequency) + { + s->current_frequency = new_frequency; + } +} + + + +static uint32_t mm_readl (Atheros_WLANState *s,target_phys_addr_t addr); +static void mm_writel (Atheros_WLANState *s,target_phys_addr_t addr,uint32_t val); + +static void Atheros_WLAN_mmio_writeb (void *opaque,target_phys_addr_t addr,uint32_t val) +{ +DEBUG_PRINT (("!!! DEBUG INIMPLEMENTED !!!\n" )); +DEBUG_PRINT (("mmio_writeb %x val %x\n" , addr, val)); +DEBUG_PRINT (("!!! DEBUG INIMPLEMENTED !!!\n" )); +} + +static void Atheros_WLAN_mmio_writew (void *opaque,target_phys_addr_t addr,uint32_t val) +{ +DEBUG_PRINT (("!!! DEBUG INIMPLEMENTED !!!\n" )); +DEBUG_PRINT (("mmio_writew %x val %x\n" , addr, val)); +DEBUG_PRINT (("!!! DEBUG INIMPLEMENTED !!!\n" )); +} + +static void Atheros_WLAN_mmio_writel (void *opaque,target_phys_addr_t addr,uint32_t val) +{ +mm_writel ((Atheros_WLANState *)opaque,Atheros_WLAN_MEM_SANITIZE (addr), val); +DEBUG_PRINT ((" through call: mmio_writel 0x%x (%u) val 0x%x (%u)\n" ,Atheros_WLAN_MEM_SANITIZE (addr),Atheros_WLAN_MEM_SANITIZE (addr), val, val)); +} + +static uint32_t Atheros_WLAN_mmio_readb (void *opaque,target_phys_addr_t addr) +{ +DEBUG_PRINT (("!!! DEBUG INIMPLEMENTED !!!\n" )); +DEBUG_PRINT (("mmio_readb %u\n" , addr)); +DEBUG_PRINT (("!!! DEBUG INIMPLEMENTED !!!\n" )); + +return 0 ; +} + +static uint32_t Atheros_WLAN_mmio_readw (void *opaque,target_phys_addr_t addr) +{ +DEBUG_PRINT (("!!! DEBUG INIMPLEMENTED !!!\n" )); +DEBUG_PRINT (("mmio_readw %u\n" , addr)); +DEBUG_PRINT (("!!! DEBUG INIMPLEMENTED !!!\n" )); + +return 0 ; +} + +static uint32_t Atheros_WLAN_mmio_readl (void *opaque,target_phys_addr_t addr) +{ +uint32_t val; + val =mm_readl ((Atheros_WLANState *)opaque,Atheros_WLAN_MEM_SANITIZE (addr)); + +DEBUG_PRINT ((" mmio_readl 0x%x (%u) = 0x%x (%u)\n" ,Atheros_WLAN_MEM_SANITIZE (addr),Atheros_WLAN_MEM_SANITIZE (addr), val, val)); +return val; +} + + +static void Atheros_WLAN_mmio_map (PCIDevice *pci_dev,int region_num,uint32_t addr,uint32_t size,int type) +{ +DEBUG_PRINT (("mmio_map\n" )); +PCIAtheros_WLANState *d = (PCIAtheros_WLANState *)pci_dev; +Atheros_WLANState *s = &d->Atheros_WLAN; + +DEBUG_PRINT (("cpu_register_physical_memory(%p, %u, %p);\n" , (unsigned long *)addr, Atheros_WLAN_MEM_SIZE, (unsigned long *)s->Atheros_WLAN_mmio_io_addr)); + +cpu_register_physical_memory (addr +0 , Atheros_WLAN_MEM_SIZE, s->Atheros_WLAN_mmio_io_addr); +} + +static CPUReadMemoryFunc *Atheros_WLAN_mmio_read[3 ] = { + Atheros_WLAN_mmio_readb, + Atheros_WLAN_mmio_readw, + Atheros_WLAN_mmio_readl, +}; + +static CPUWriteMemoryFunc *Atheros_WLAN_mmio_write[3 ] = { + Atheros_WLAN_mmio_writeb, + Atheros_WLAN_mmio_writew, + Atheros_WLAN_mmio_writel, +}; + +void Atheros_WLAN_setup_io (PCIAtheros_WLANState *d) +{ +Atheros_WLANState *s; + s = &d->Atheros_WLAN; + +/* I/O handler for memory-mapped I/O */ + s->Atheros_WLAN_mmio_io_addr =cpu_register_io_memory (0 , Atheros_WLAN_mmio_read, Atheros_WLAN_mmio_write, s); +pci_register_io_region (&d->dev,0 , Atheros_WLAN_MEM_SIZE,PCI_ADDRESS_SPACE_MEM , Atheros_WLAN_mmio_map); +} + + + + + + + + + + + + + + + + +#define FASTBINLOG (x) \ + (x == 1) ? 0 : \ + (x == 2) ? 1 : \ + (x == 4) ? 2 : \ + (x == 8) ? 3 : \ + (x == 16) ? 4 : \ + (x == 32) ? 5 : \ + (x == 64) ? 6 : \ + (x == 128) ? 7 : \ + (x == 256) ? 8 : \ + (x == 512) ? 9 : \ + (x == 1024) ? 10 : \ + (x == 2048) ? 11 : \ + (x == 4096) ? 12 : 13 + + + +static uint32_t mm_readl (Atheros_WLANState *s,target_phys_addr_t addr) +{ +uint32_t val =GET_MEM_L (s->mem, addr); +switch (addr) + { +case ATH_HW_IRQ_PENDING : +/* +* This indicates that the interrupt +* routine has been called. reset interrupt +* status and put the interrupt-status +* number at the correct memory-location +* +* In case multiple interrupts are pending +* this memory-location is checked multiple +* times... each time, we put another interrupt +* status into memory until no more interrupts +* have to be handled +*/ +Atheros_WLAN_disable_irq (s); + +DEBUG_PRINT ((">> irq pending? ... 0x%x\n" , val)); +SET_MEM_L (s->mem,0x0080 ,0x0 ); +SET_MEM_L (s->mem,0x80ec ,0x0001c680 ); +SET_MEM_L (s->mem,0x80f0 ,0x000055dc ); +SET_MEM_L (s->mem,0x80f8 ,0x0015f6fc ); +SET_MEM_L (s->mem,0x9850 ,0x0de8b0da ); +break ; + +/* +* The following registers are Read-and-Clear +* registers --> must be reset after a read!! +* +* However, it does not work when using linux!! +*/ +case AR5K_PISR : +if (s->device_driver_type ==WINXP_DRIVER ) + { + addr =AR5K_RAC_PISR ; +// fall through... + } +else + { +break ; + } + +case AR5K_RAC_PISR : +Atheros_WLAN_update_irq (s); + val =GET_MEM_L (s->mem, addr); +SET_MEM_L (s->mem, addr,0 ); +SET_MEM_L (s->mem,AR5K_PCICFG ,0x34 ); + +DEBUG_PRINT ((">> irq status 0x%x\n" , val)); +break ; + +case AR5K_RAC_SISR0 : +case AR5K_RAC_SISR1 : +case AR5K_RAC_SISR2 : +case AR5K_RAC_SISR3 : +case AR5K_RAC_SISR4 : + val =0 ; +SET_MEM_L (s->mem, addr,0 ); +DEBUG_PRINT (("secondary irq status\n" )); +break ; + + +/* +* According to the openHAL source +* documentation this is also read-and-clear +* but if it is made so, the WinDriver does +* not work any more... +*/ +case AR5K_RXDP : +//SET_MEM_L(s->mem, addr, 0); +break ; + +default : +break ; + } +return val; +} + +static void mm_writel (Atheros_WLANState *s,target_phys_addr_t addr,uint32_t val) +{ +uint32_t h; +switch (addr) + { + +/****************************************************************** +* +* ath5k_hw_init ---> ath5k_hw_nic_wakeup +* +******************************************************************/ + +case AR5K_RESET_CTL : + +if (val == (AR5K_RESET_CTL_CHIP |AR5K_RESET_CTL_PCI )) + { +/* ath5k_hw.c: 613 */ +DEBUG_PRINT (("reset device (MAC + PCI)\n" )); + +/* +* claim device is inited +*/ +SET_MEM_L (s->mem,AR5K_STA_ID1 ,0 ); +SET_MEM_L (s->mem,AR5K_RESET_CTL ,3 ); + } +else if (val & (AR5K_RESET_CTL_CHIP |AR5K_RESET_CTL_PCI )) + { +/* ath5k_hw.c: 613 */ +DEBUG_PRINT (("reset device (MAC + PCI + ?)\n" )); + +/* +* claim device is inited +*/ +SET_MEM_L (s->mem,AR5K_STA_ID1 ,0 ); +SET_MEM_L (s->mem,AR5K_RESET_CTL ,3 ); + } +else + { +/* ath5k_hw.c: 626 */ +DEBUG_PRINT (("reset device (generic)\n" )); + +/* +* warm-start device +*/ +SET_MEM_L (s->mem,AR5K_RESET_CTL ,0 ); + } +break ; + + +/****************************************************************** +* +* interrupt handling +* +******************************************************************/ + +case AR5K_IER : +if (val ==AR5K_IER_DISABLE ) + { +/* ath5k_hw.c: 1636 */ +DEBUG_PRINT (("disabling interrupts\n" )); +SET_MEM_L (s->mem,AR5K_GPIODO ,0x0 ); +SET_MEM_L (s->mem,AR5K_GPIODI ,0x0 ); + + s->interrupt_enabled =0 ; + } +else if (val ==AR5K_IER_ENABLE ) + { +/* ath5k_hw.c: 1674 */ +DEBUG_PRINT (("enabling interrupts\n" )); +SET_MEM_L (s->mem,AR5K_GPIODO ,0x2 ); +SET_MEM_L (s->mem,AR5K_GPIODI ,0x3 );// new + + s->interrupt_enabled =1 ; + } +else + { +DEBUG_PRINT (("setting interrupt-enable to undefined value!!\n" )); + } +break ; + +case AR5K_GPIODO : +if (val ==0x2 ) + { +SET_MEM_L (s->mem,AR5K_GPIODI ,0x3 ); + } +break ; + +case AR5K_GPIODI :// new +if (val ==0x2 ) + { +SET_MEM_L (s->mem,AR5K_GPIODO ,0x3 ); + } +break ; + +case AR5K_PIMR : +/* ath5k_hw.c: 1668 */ +DEBUG_PRINT (("setting primary interrupt-mask to 0x%x (%u)\n" , val, val)); + s->interrupt_p_mask = val; + +SET_MEM_L (s->mem, addr, val); +break ; + +case AR5K_SIMR0 : +DEBUG_PRINT (("setting secondary interrupt-mask 0 to 0x%x (%u)\n" , val, val)); + s->interrupt_s_mask[0 ] = val; +break ; +case AR5K_SIMR1 : +DEBUG_PRINT (("setting secondary interrupt-mask 1 to 0x%x (%u)\n" , val, val)); + s->interrupt_s_mask[1 ] = val; +break ; +case AR5K_SIMR2 : +DEBUG_PRINT (("setting secondary interrupt-mask 2 to 0x%x (%u)\n" , val, val)); + s->interrupt_s_mask[2 ] = val; +break ; +case AR5K_SIMR3 : +DEBUG_PRINT (("setting secondary interrupt-mask 3 to 0x%x (%u)\n" , val, val)); + s->interrupt_s_mask[3 ] = val; +break ; +case AR5K_SIMR4 : +DEBUG_PRINT (("setting secondary interrupt-mask 4 to 0x%x (%u)\n" , val, val)); + s->interrupt_s_mask[4 ] = val; +break ; + +/****************************************************************** +* +* ath5k queuing (for transmit and receive buffers) +* +******************************************************************/ + +case AR5K_QCU_TXE : +/* ath5k_hw.c: 1423ff */ + +/* enable specified queue (nr in val) */ + val =FASTBINLOG (val); + +DEBUG_PRINT (("queue %u enabled\n" , val)); +if ((val >=0 ) && (val <16 )) + { + s->transmit_queue_enabled[val] =1 ; +Atheros_WLAN_handleTxBuffer (s, val); + } +else + { +DEBUG_PRINT (("unknown queue 0x%x (%u)\n" , val, val)); + } +break ; + +case AR5K_QCU_TXD : +/* ath5k_hw.c: 1423ff */ + +/* disable specified queue (nr in val) */ + val =FASTBINLOG (val); + +DEBUG_PRINT (("queue %u disabled\n" , val)); +if ((val >=0 ) && (val <16 )) + { + s->transmit_queue_enabled[val] =0 ; + } +else + { +DEBUG_PRINT (("unknown queue 0x%x (%u)\n" , val, val)); + } +break ; + +case AR5K_IFS0 : +case AR5K_IFS1 : +DEBUG_PRINT (("TODO: find out what inter frame spacing registers are used for...\n" )); +break ; + +case AR5K_CFG : + +if (val ==AR5K_INIT_CFG ) + { +/* ath5k_hw.c: 1261 */ +DEBUG_PRINT (("Reset configuration register (for hw bitswap)\n" )); + } +SET_MEM_L (s->mem,AR5K_SLEEP_CTL ,0x0 ); +break ; + +case AR5K_TXCFG : +/* ath5k_hw.c: 1122 */ +DEBUG_PRINT (("Setting transmit queue size to %u byte\n" , (1 << (val+2 )) )); + + s->transmit_queue_size = (1 << (val+2 )); +break ; + +case AR5K_CR : +if (val ==AR5K_CR_TXE0 )// TX Enable for queue 0 on 5210 + { +DEBUG_PRINT (("TX enable for queue 0\n" )); + } +else if (val ==AR5K_CR_TXE1 )// TX Enable for queue 1 on 5210 + { +DEBUG_PRINT (("TX enable for queue 1\n" )); + } +else if (val ==AR5K_CR_RXE )// RX Enable + { +DEBUG_PRINT (("RX enable\n" )); +SET_MEM_L (s->mem,AR5K_DIAG_SW_5211 ,0x0 ); + } +else if (val ==AR5K_CR_TXD0 )// TX Disable for queue 0 on 5210 + { +DEBUG_PRINT (("TX disable for queue 0\n" )); + } +else if (val ==AR5K_CR_TXD1 )// TX Disable for queue 1 on 5210 + { +DEBUG_PRINT (("TX disable for queue 1\n" )); + } +else if (val ==AR5K_CR_RXD )// RX Disable + { +DEBUG_PRINT (("RX disable\n" )); + } +else if (val ==AR5K_CR_SWI )// unknown... + { + +DEBUG_PRINT (("Undefined TX/RX en/disable CR_SWI\n" )); + } +else + { +DEBUG_PRINT (("Undefined TX/RX en/disable\n" )); + } +break ; + +case AR5K_RXDP : +/* +* unkown location, but this should +* set the location of the receive +* buffer's PHYSICAL address!! +*/ +DEBUG_PRINT (("Setting receive queue to address 0x%x (%u)\n" , val, val)); + +/* +* This address will be queried again +* later... store it!! +*/ +if (val ==0 ) + { +// hm... ar5424 resets its queue to 0 :-( + } +SET_MEM_L (s->mem, addr, val); + s->receive_queue_address = (uint32_t *)val; + +/* +* Madwifi hack: we allow only a certain +* number of packets in the receive queue!! +*/ + s->receive_queue_count =0 ; +break ; + +case AR5K_QUEUE_TXDP (0 ): +case AR5K_QUEUE_TXDP (1 ): +case AR5K_QUEUE_TXDP (2 ): +case AR5K_QUEUE_TXDP (3 ): +case AR5K_QUEUE_TXDP (4 ): +case AR5K_QUEUE_TXDP (5 ): +case AR5K_QUEUE_TXDP (6 ): +case AR5K_QUEUE_TXDP (7 ): +case AR5K_QUEUE_TXDP (8 ): +case AR5K_QUEUE_TXDP (9 ): +case AR5K_QUEUE_TXDP (10 ): +case AR5K_QUEUE_TXDP (11 ): +case AR5K_QUEUE_TXDP (12 ): +case AR5K_QUEUE_TXDP (13 ): +case AR5K_QUEUE_TXDP (14 ): +case AR5K_QUEUE_TXDP (15 ): +/* +* unkown location, but this should +* set the location of queue-dependent +* transmit buffer's PHYSICAL address!! +*/ +DEBUG_PRINT (("Setting a transmit queue to address 0x%x (%u)\n" , val, val)); + +/* +* This address will be queried again +* later... store it!! +*/ +SET_MEM_L (s->mem, addr, val); + + addr -=AR5K_QCU_TXDP_BASE ; + addr /=4 ; +if (addr >=0 && addr <16 ) + { +/* +* In case the given address specifies a +* valid DMA address, let's use it and copy +* the data into our device and process it +* once the queue is enabled +*/ + s->transmit_queue_processed[addr] =0 ; + s->transmit_queue_address[addr] = (uint32_t *)val; + } +else + { +DEBUG_PRINT (("unknown queue 0x%x (%u)\n" , addr, addr)); + } +break ; + +case AR5K_RXCFG : +/* ath5k_hw.c: 1124 */ +DEBUG_PRINT (("Setting receive queue size to %u byte\n" , (1 << (val+2 )) )); +SET_MEM_L (s->mem, addr, val); +break ; + +case AR5K_QUEUE_QCUMASK (0 ): +case AR5K_QUEUE_QCUMASK (1 ): +case AR5K_QUEUE_QCUMASK (2 ): +case AR5K_QUEUE_QCUMASK (3 ): +case AR5K_QUEUE_QCUMASK (4 ): +case AR5K_QUEUE_QCUMASK (5 ): +case AR5K_QUEUE_QCUMASK (6 ): +case AR5K_QUEUE_QCUMASK (7 ): +case AR5K_QUEUE_QCUMASK (8 ): +case AR5K_QUEUE_QCUMASK (9 ): +case AR5K_QUEUE_QCUMASK (10 ): +case AR5K_QUEUE_QCUMASK (11 ): +case AR5K_QUEUE_QCUMASK (12 ): +case AR5K_QUEUE_QCUMASK (13 ): +case AR5K_QUEUE_QCUMASK (14 ): +case AR5K_QUEUE_QCUMASK (15 ): +DEBUG_PRINT (("ath5k_hw_reset_tx_queue for queue x (%u)\n" , val)); +break ; + +case AR5K_QUEUE_DFS_RETRY_LIMIT (0 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (1 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (2 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (3 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (4 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (5 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (6 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (7 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (8 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (9 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (10 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (11 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (12 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (13 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (14 ): +case AR5K_QUEUE_DFS_RETRY_LIMIT (15 ): +DEBUG_PRINT (("setting retry-limit for queue x to 0x%x (%u)\n" , val, val)); +break ; + +case AR5K_QUEUE_DFS_LOCAL_IFS (0 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (1 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (2 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (3 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (4 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (5 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (6 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (7 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (8 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (9 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (10 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (11 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (12 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (13 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (14 ): +case AR5K_QUEUE_DFS_LOCAL_IFS (15 ): +DEBUG_PRINT (("setting interframe space for queue x to 0x%x (%u)\n" , val, val)); +break ; + +case AR5K_QUEUE_MISC (0 ): +case AR5K_QUEUE_MISC (1 ): +case AR5K_QUEUE_MISC (2 ): +case AR5K_QUEUE_MISC (3 ): +case AR5K_QUEUE_MISC (4 ): +case AR5K_QUEUE_MISC (5 ): +case AR5K_QUEUE_MISC (6 ): +case AR5K_QUEUE_MISC (7 ): +case AR5K_QUEUE_MISC (8 ): +case AR5K_QUEUE_MISC (9 ): +case AR5K_QUEUE_MISC (10 ): +case AR5K_QUEUE_MISC (11 ): +case AR5K_QUEUE_MISC (12 ): +case AR5K_QUEUE_MISC (13 ): +case AR5K_QUEUE_MISC (14 ): +case AR5K_QUEUE_MISC (15 ): +DEBUG_PRINT (("setting options for queue x to 0x%x (%u)\n" , val, val)); +break ; + +case AR5K_SLEEP_CTL : +SET_MEM_L (s->mem,AR5K_SLEEP_CTL , val); +if (val ==AR5K_SLEEP_CTL_SLE_WAKE ) + { +DEBUG_PRINT (("waking up device\n" )); + +/* +* yes, we are awake +* +* basically it just checks if power-down +* is false (val & AR5K_PCICFG_SPWR_DN == 0) +* but my AR5212 says 20 what has the same +* result but might be better ;-) +*/ +SET_MEM_L (s->mem,AR5K_PCICFG ,0x14 ); +SET_MEM_L (s->mem,AR5K_STA_ID1 ,0x00049e2e ); +// SET_MEM_L(s->mem, AR5K_STA_ID1, 0x0); + +// SET_MEM_L(s->mem, AR5K_PCICFG, 0x34); +// SET_MEM_L(s->mem, AR5K_STA_ID1, AR5K_STA_ID1_PWR_SV); + } +else if (val ==AR5K_SLEEP_CTL_SLE_SLP ) + { +DEBUG_PRINT (("putting device to sleep\n" )); + } +else + { +DEBUG_PRINT (("unknown SLEEP command %u\n" , val)); + } +break ; + +case AR5K_PHY_PLL : +/* +* ...set the PHY operating mode after reset +*/ + +/* ath5k_hw.c: 632 */ +DEBUG_PRINT (("setting PHY operating mode (PLL)\n" )); +break ; + +case AR5K_PHY_MODE : +/* +* ...set the PHY operating mode after reset +*/ + +/* ath5k_hw.c: 635 */ +DEBUG_PRINT (("setting PHY operating mode (mode)\n" )); +break ; + +case AR5K_PHY_TURBO : +/* +* ...set the PHY operating mode after reset +*/ + +/* ath5k_hw.c: 636 */ +DEBUG_PRINT (("setting PHY operating mode (turbo)\n" )); +break ; + + +/****************************************************************** +* +* ath5k_hw_init ---> ath5k_hw_radio_revision +* +******************************************************************/ + + +case AR5K_PHY (0 ): +/* +* Unknown +*/ +if (val ==AR5K_PHY_SHIFT_2GHZ ) + { +DEBUG_PRINT (("requesting 2GHZ radio\n" )); +SET_MEM_L (s->mem,AR5K_PHY (0x100 ),0x4c047000 ); + } +/* ath5k_hw.c: 662 */ +else if (val ==AR5K_PHY_SHIFT_5GHZ ) + { +DEBUG_PRINT (("requesting 5GHZ radio\n" )); +SET_MEM_L (s->mem,AR5K_PHY (0x100 ),0x8e000000 ); + } + +SET_MEM_L (s->mem,AR5K_SLEEP_CTL ,0x0 ); +break ; + +case AR5K_PHY (0x20 ): +/* +* request radio revision +*/ + +/* ath5k_hw.c: 659 */ +if (val ==AR5K_PHY_SHIFT_2GHZ ) + { +DEBUG_PRINT (("requesting 2GHZ radio\n" )); +SET_MEM_L (s->mem,AR5K_PHY (0x100 ),0x4c047000 );// 1275359232); + } +/* ath5k_hw.c: 662 */ +else if (val ==AR5K_PHY_SHIFT_5GHZ ) + { +DEBUG_PRINT (("requesting 5GHZ radio\n" )); +SET_MEM_L (s->mem,AR5K_PHY (0x100 ),0x7fffffff );// 2382364672); + } +/* ath5k_hw.c: 671 */ +else if (val ==0x00001c16 ) + { +DEBUG_PRINT (("requesting radio\n" )); + } +/* ath5k_hw.c: 674 */ +else if (val ==0x00010000 ) + { +DEBUG_PRINT (("requesting radio 8 times...\n" )); +// NOW we request the radio revision (it was set before...) + +// SET_MEM_L(s->mem, 0x9c00, 0x8e026023); +SET_MEM_L (s->mem,0x9c00 ,0x8e000000 ); + +SET_MEM_L (s->mem,0x9c00 ,0x4c047000 ); + } + +break ; + +/* +* Setting frequency is different for AR5210/AR5211/AR5212 +* +* see ath5k_hw.c: 4590 ff +* +* they all set AR5K_PHY(0x27), +* AR5210 sets AR5K_PHY(0x30), +* AR5211 sets AR5K_PHY(0x34) and +* AR5212 sets AR5K_PHY(0x36) +* +* +* The virtual device seems to read out 0x34 for +* the current channel (e.g. after a packet has +* been received)!! +*/ +case AR5K_PHY (0x27 ): +// fprintf(stderr, "0x%04x => 0x%08x (27)\n", addr, val); +SET_MEM_L (s->mem, addr, val); + s->current_frequency_partial_data[0 ] = val; +updateFrequency (s); +break ; + +case AR5K_PHY (0x34 ): +// fprintf(stderr, "0x%04x => 0x%08x (34)\n", addr, val); +SET_MEM_L (s->mem, addr, val); + s->current_frequency_partial_data[1 ] = val; +updateFrequency (s); +break ; + +/* +* these are used by AR521 and AR5212 respectively, +* but we seem to simulate an AR5211 and the calls +* destroy our channel frequency mapping :-( +* +case AR5K_PHY(0x30): +fprintf(stderr, "0x%04x => 0x%08x (30)\n", addr, val); +SET_MEM_L(s->mem, addr, val); +s->current_frequency_partial_data[1] = val; +updateFrequency(s); +break; +case AR5K_PHY(0x36): +fprintf(stderr, "0x%04x => 0x%08x (36)\n", addr, val); +SET_MEM_L(s->mem, addr, val); +s->current_frequency_partial_data[1] = val; +updateFrequency(s); +break; +*/ + + + +/* +case AR5K_PHY(0x21): +case AR5K_PHY(0x22): +case AR5K_PHY(0x23): +case AR5K_PHY(0x24): +case AR5K_PHY(0x25): +case AR5K_PHY(0x26): +case AR5K_PHY(0x28): +case AR5K_PHY(0x29): +case AR5K_PHY(0x31): +case AR5K_PHY(0x32): +case AR5K_PHY(0x33): +case AR5K_PHY(0x35): +case AR5K_PHY(0x37): +case AR5K_PHY(0x38): +case AR5K_PHY(0x39): +case AR5K_PHY(0x40): +case AR5K_PHY(0x41): +case AR5K_PHY(0x42): +case AR5K_PHY(0x43): +case AR5K_PHY(0x44): +case AR5K_PHY(0x45): +case AR5K_PHY(0x46): +case AR5K_PHY(0x47): +case AR5K_PHY(0x48): +case AR5K_PHY(0x49): +case AR5K_PHY(0x50): +fprintf(stderr, "0x%04x => 0x%08x\n", addr, val); +break;*/ + +/****************************************************************** +* +* ath5k_hw_init ---> ath5k_hw_set_associd (aka. set BSSID) +* +******************************************************************/ + +case AR5K_BSS_IDM0 : +case AR5K_BSS_IDM1 : +/* +* Set simple BSSID mask on 5212 +*/ + +/* ath5k_hw.c: 2420 */ +DEBUG_PRINT (("setting bssid mask\n" )); +break ; + +case AR5K_BSS_ID0 : +case AR5K_BSS_ID1 : +/* +* Set BSSID which triggers the "SME Join" operation +*/ + +/* ath5k_hw.c: 2432 & 2433 */ +DEBUG_PRINT (("setting bssid : %c%c%c%c \n" , (val <<24 ) >>24 , (val <<16 ) >>24 , (val <<8 ) >>24 , val >>24 )); +break ; + +case AR5K_STA_ID0 : +/* +* a set to client(adhoc|managed) | ap | monitor mode is coming +* +* if there are more than one chip present, this +* call defines which chip is to be used! +*/ + +/* ath5k_hw.c: 2358 */ +DEBUG_PRINT (("a set to client | ap | monitor mode is coming for station %u\n" , val)); + +// ext +SET_MEM_L (s->mem, addr, val); + +break ; + +case AR5K_STA_ID1 : +/* +* seems to have a double-meaning: +* +* setting client mode AND power mode +*/ + +/* ath5k_hw.c: 619 */ +DEBUG_PRINT (("setting power mode\n" )); +SET_MEM_L (s->mem,AR5K_STA_ID1 , val); +SET_MEM_L (s->mem,AR5K_STA_ID0 ,0x800a1100 ); +//SET_MEM_L(s->mem, 0xc, 0x1a7d823c); +SET_MEM_L (s->mem,0xc ,0x0 ); +SET_MEM_L (s->mem,0x00c0 ,0x01040000 ); + + +/* ath5k_hw.c: 2361 */ +if (val &AR5K_STA_ID1_ADHOC &AR5K_STA_ID1_DESC_ANTENNA ) + { +DEBUG_PRINT (("setting device into ADHOC mode\n" )); + } +else if (val &AR5K_STA_ID1_AP &AR5K_STA_ID1_RTS_DEF_ANTENNA ) + { +DEBUG_PRINT (("setting device into managed mode\n" )); + } +else if (val &AR5K_STA_ID1_DEFAULT_ANTENNA ) + { +DEBUG_PRINT (("setting device into some other mode (probably monitor)\n" )); + } +else + { +DEBUG_PRINT (("setting device into unknown mode\n" )); + } +break ; + + + +/****************************************************************** +* +* ath5k_hw_init ---> ath5k_eeprom_init +* +******************************************************************/ + +case AR5K_EEPROM_BASE : +/* +* an access to an offset inside the +* EEPROM uses an initialization of +* the address at this location +*/ + +/* ath5k_hw.c: 1738 */ +DEBUG_PRINT (("there will be an access to the EEPROM at %p\n" , (unsigned long *)val)); + +/* +* set the data that will be returned +* after calling AR5K_EEPROM_CMD=READ +*/ +switch (val) + { +#if 0 +case AR5K_EEPROM_MAGIC : +WRITE_EEPROM (s->mem,AR5K_EEPROM_MAGIC_VALUE ); +break ; + +case AR5K_EEPROM_PROTECT : +WRITE_EEPROM (s->mem,0 ); +break ; + +case AR5K_EEPROM_REG_DOMAIN : +/* +* reg-domain central europe ??? +*/ +WRITE_EEPROM (s->mem,96 ); +break ; + +case AR5K_EEPROM_VERSION : +WRITE_EEPROM (s->mem,AR5K_EEPROM_VERSION_3_4 ); +break ; + +case AR5K_EEPROM_HDR : +WRITE_EEPROM (s->mem,23046 ); +break ; + +case 195 : +/* +* an radio-GHZ specific eeprom data (AR5K_EEPROM_ANT_GAIN) +* +* on my AR5212 it is 0 +*/ + +/* ath5k_hw.c: 2023 */ +WRITE_EEPROM (s->mem,0 ); +break ; + +case 0x20 : +/* +* before we read the MAC addr, we read this (???) +* +* ATTENTION: this value is present in the EEPROM!! +*/ + +/* ath5k_hw.c : 2185 */ +break ; + +case 0x1f : +/* +* 1st part of MAC-addr +*/ +DEBUG_PRINT (("EEPROM request first part of MAC\n" )); +WRITE_EEPROM (s->mem, (s->phys[0 ] <<8 ) | s->phys[1 ]); +break ; + +case 0x1e : +/* +* 2nd part of MAC-addr +*/ +DEBUG_PRINT (("EEPROM request second part of MAC\n" )); +WRITE_EEPROM (s->mem, (s->phys[2 ] <<8 ) | s->phys[3 ]); +break ; + +case 0x1d : +/* +* 3rd part of MAC-addr +*/ +DEBUG_PRINT (("EEPROM request third part of MAC\n" )); +WRITE_EEPROM (s->mem, (s->phys[4 ] <<8 ) | s->phys[5 ]); +break ; +#endif +/* +* ATTENTION: if we modify anything in the +* eeprom, we might get (at least in linux we +* do) an EEPROM-checksum error!! +*/ + +case 0x0 : +/* +* this is not part of the EEPROM dumps for some reason!! +*/ +DEBUG_PRINT (("EEPROM request 0x0\n" )); +WRITE_EEPROM (s->mem,0x13 ); +break ; + +default : +if (!get_eeprom_data (s, val, &h)) + { +/* +* we have a hit in the internal eeprom-buffer +*/ +DEBUG_PRINT (("EEPROM hit %u at %u\n" , h, val)); +WRITE_EEPROM (s->mem, h); + } +else + { +DEBUG_PRINT (("EEPROM request at %p is unknown\n" , (unsigned long *)val)); +WRITE_EEPROM (s->mem,0 ); + } +break ; + } +break ; + +case AR5K_EEPROM_CMD : +/* +* what type of access is specified as well +*/ + +/* ath5k_hw.c: 1739 */ +if (val &AR5K_EEPROM_CMD_READ ) + { +DEBUG_PRINT (("the EEPROM access will be READ\n" )); + +/* +* tell the device the read was successful +*/ +SET_MEM_L (s->mem,AR5K_EEPROM_STAT_5210 ,AR5K_EEPROM_STAT_RDDONE ); +SET_MEM_L (s->mem,AR5K_EEPROM_STAT_5211 ,AR5K_EEPROM_STAT_RDDONE ); +/* +* and return the data that was set +* during the write to AR5K_EEPROM_BASE +*/ + } +else + { +DEBUG_PRINT (("the EEPROM access will be UNKNOWN\n" )); +fprintf (stderr,"Is this a write to the eeprom??\n" ); + } +break ; + + +/****************************************************************** +* +* additional reverse engineering: +* +******************************************************************/ + +case AR5K_USEC_5210 :// new +SET_MEM_L (s->mem,AR5K_XRMODE ,0x2a80001a ); +SET_MEM_L (s->mem,AR5K_XRTIMEOUT ,0x13881c20 ); +break ; + +case AR5K_PHY_AGCCTL :// new +if (val &AR5K_PHY_AGCCTL_CAL ) + { +SET_MEM_L (s->mem,AR5K_PHY_AGCCTL , val & (~AR5K_PHY_AGCCTL_CAL )); + } +else if (val &AR5K_PHY_AGCCTL_NF ) + { +SET_MEM_L (s->mem,AR5K_PHY_AGCCTL , val & (~AR5K_PHY_AGCCTL_NF )); + } +break ; + +default : +if (addr /4 < Atheros_WLAN_MEM_SIZE) + { +SET_MEM_L (s->mem, addr, val); + } + +if ((addr >=AR5K_PCU_MIN ) && + (addr <=AR5K_PCU_MAX )) + { +DEBUG_PRINT (("Setting up ini-registers...!!\n" )); + } +else + { +DEBUG_PRINT (("Unknown call to memory!!\n" )); + } +break ; + } +} +
hw/atheros_wlan_io.h +35 -0
@@ -0,0 +1,35 @@ +/** +* QEMU WLAN device emulation +* +* Copyright (c) 2008 Clemens Kolbitsch +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +* +* Modifications: +* 2008-February-24 Clemens Kolbitsch : +* New implementation based on ne2000.c +* +*/ + +#ifndef atheros_wlan_io_h +#define atheros_wlan_io_h 1 + +void Atheros_WLAN_setup_io (PCIAtheros_WLANState *d); + +#endif // atheros_wlan_io_h
Patch #6:
802.11 packet definitions. Code to create beacon frames, probe responses, authentication frames, association replies, etc.
hw/atheros_wlan_packet.c +481 -0
@@ -0,0 +1,481 @@ +/** +* QEMU WLAN access point emulation +* +* Copyright (c) 2008 Clemens Kolbitsch +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +* +* Modifications: +* 2008-February-24 Clemens Kolbitsch : +* New implementation based on ne2000.c +* +*/ + + +#include "hw.h" +#include "pci.h" +#include "pc.h" +#include "net.h" + + +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/shm.h> +#include <sys/stat.h> +#include <sys/socket.h> +#include <sys/ipc.h> +#include <sys/sem.h> +#include <sys/mman.h> +#include <netinet/in.h> +#include <netdb.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> + + +#include "hw/atheros_wlan.h" +#include "hw/atheros_wlan_crc32.h" +#include "hw/atheros_wlan_packet.h" + +#define FRAME_INSERT (_8bit_data) buf[i++] = _8bit_data + + +static int insertCRC (struct mac80211_frame *frame,uint32_t frame_length) +{ +unsigned long crc; +unsigned char *fcs = (char *)frame; + + crc =crc32_ccitt (fcs, frame_length); +memcpy (&fcs[frame_length], &crc,4 ); + +return frame_length +4 ; +} + + +void Atheros_WLAN_init_frame (Atheros_WLANState *s,struct mac80211_frame *frame) +{ +if (!frame) +return ; + + frame->sequence_control.sequence_number = s->inject_sequence_number++; +memcpy (frame->source_address, s->ap_macaddr,6 ); +memcpy (frame->bssid_address, s->ap_macaddr,6 ); + + frame->frame_length =insertCRC (frame, frame->frame_length); +} + + +struct mac80211_frame *Atheros_WLAN_create_beacon_frame () +{ +unsigned int i; +unsigned char *buf; +struct mac80211_frame *frame; + + frame = (struct mac80211_frame *)malloc (sizeof (struct mac80211_frame )); +if (!frame) + { +return NULL ; + } + + frame->next_frame =NULL ; + frame->frame_control.protocol_version =0 ; + frame->frame_control.type =IEEE80211_TYPE_MGT ; + frame->frame_control.sub_type =IEEE80211_TYPE_MGT_SUBTYPE_BEACON ; + frame->frame_control.flags =0 ; + frame->duration_id =0 ; + frame->sequence_control.fragment_number =0 ; + +for (i=0 ; i<6 ; frame->destination_address[i] =0xff , i++); + + i =0 ; + buf = (unsigned char *)frame->data_and_fcs; + +/* +* Fixed params... typical AP params (12 byte) +* +* They include +* - Timestamp +* - Beacon Interval +* - Capability Information +*/ +FRAME_INSERT (0x8d ); +FRAME_INSERT (0x61 ); +FRAME_INSERT (0xa5 ); +FRAME_INSERT (0x18 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x64 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x01 ); +FRAME_INSERT (0x00 ); + +FRAME_INSERT (IEEE80211_BEACON_PARAM_SSID ); +FRAME_INSERT (4 );// length +FRAME_INSERT ('Q' );// SSID +FRAME_INSERT ('L' );// SSID +FRAME_INSERT ('a' );// SSID +FRAME_INSERT ('n' );// SSID + +FRAME_INSERT (IEEE80211_BEACON_PARAM_RATES ); +FRAME_INSERT (8 );// length +FRAME_INSERT (0x82 ); +FRAME_INSERT (0x84 ); +FRAME_INSERT (0x8b ); +FRAME_INSERT (0x96 ); +FRAME_INSERT (0x24 ); +FRAME_INSERT (0x30 ); +FRAME_INSERT (0x48 ); +FRAME_INSERT (0x6c ); + +FRAME_INSERT (IEEE80211_BEACON_PARAM_CHANNEL ); +FRAME_INSERT (1 );// length +FRAME_INSERT (0x09 ); + + frame->frame_length =IEEE80211_HEADER_SIZE + i; +return frame; +} + +struct mac80211_frame *Atheros_WLAN_create_probe_response () +{ +unsigned int i; +unsigned char *buf; +struct mac80211_frame *frame; + + frame = (struct mac80211_frame *)malloc (sizeof (struct mac80211_frame )); +if (!frame) + { +return NULL ; + } + + frame->next_frame =NULL ; + frame->frame_control.protocol_version =0 ; + frame->frame_control.type =IEEE80211_TYPE_MGT ; + frame->frame_control.sub_type =IEEE80211_TYPE_MGT_SUBTYPE_PROBE_RESP ; + frame->frame_control.flags =0 ; + frame->duration_id =314 ; + frame->sequence_control.fragment_number =0 ; + + i =0 ; + buf = (unsigned char *)frame->data_and_fcs; + +/* +* Fixed params... typical AP params (12 byte) +* +* They include +* - Timestamp +* - Beacon Interval +* - Capability Information +*/ + buf[i++] =0x8d ; buf[i++] =0x61 ; buf[i++] =0xa5 ; buf[i++] =0x18 ; + buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x00 ; + buf[i++] =0x64 ; buf[i++] =0x00 ; buf[i++] =0x01 ; buf[i++] =0x00 ; + +FRAME_INSERT (IEEE80211_BEACON_PARAM_SSID ); +FRAME_INSERT (4 );// length +FRAME_INSERT ('Q' );// SSID +FRAME_INSERT ('L' );// SSID +FRAME_INSERT ('a' );// SSID +FRAME_INSERT ('n' );// SSID + +FRAME_INSERT (IEEE80211_BEACON_PARAM_RATES ); +FRAME_INSERT (8 );// length +FRAME_INSERT (0x82 ); +FRAME_INSERT (0x84 ); +FRAME_INSERT (0x8b ); +FRAME_INSERT (0x96 ); +FRAME_INSERT (0x24 ); +FRAME_INSERT (0x30 ); +FRAME_INSERT (0x48 ); +FRAME_INSERT (0x6c ); + +FRAME_INSERT (IEEE80211_BEACON_PARAM_CHANNEL ); +FRAME_INSERT (1 );// length +FRAME_INSERT (0x09 ); + + frame->frame_length =IEEE80211_HEADER_SIZE + i; +return frame; +} + +struct mac80211_frame *Atheros_WLAN_create_authentication () +{ +unsigned int i; +unsigned char *buf; +struct mac80211_frame *frame; + + frame = (struct mac80211_frame *)malloc (sizeof (struct mac80211_frame )); +if (!frame) + { +return NULL ; + } + + frame->next_frame =NULL ; + frame->frame_control.protocol_version =0 ; + frame->frame_control.type =IEEE80211_TYPE_MGT ; + frame->frame_control.sub_type =IEEE80211_TYPE_MGT_SUBTYPE_AUTHENTICATION ; + frame->frame_control.flags =0 ; + frame->duration_id =314 ; + frame->sequence_control.fragment_number =0 ; + + i =0 ; + buf = (unsigned char *)frame->data_and_fcs; + +/* +* Fixed params... typical AP params (6 byte) +* +* They include +* - Authentication Algorithm (here: Open System) +* - Authentication SEQ +* - Status code (successful 0x0) +*/ +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x02 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x00 ); + +FRAME_INSERT (IEEE80211_BEACON_PARAM_SSID ); +FRAME_INSERT (4 );// length +FRAME_INSERT ('Q' );// SSID +FRAME_INSERT ('L' );// SSID +FRAME_INSERT ('a' );// SSID +FRAME_INSERT ('n' );// SSID + + frame->frame_length =IEEE80211_HEADER_SIZE + i; +return frame; +} + +struct mac80211_frame *Atheros_WLAN_create_deauthentication () +{ +unsigned int i; +unsigned char *buf; +struct mac80211_frame *frame; + + frame = (struct mac80211_frame *)malloc (sizeof (struct mac80211_frame )); +if (!frame) + { +return NULL ; + } + + frame->next_frame =NULL ; + frame->frame_control.protocol_version =0 ; + frame->frame_control.type =IEEE80211_TYPE_MGT ; + frame->frame_control.sub_type =IEEE80211_TYPE_MGT_SUBTYPE_DEAUTHENTICATION ; + frame->frame_control.flags =0 ; + frame->duration_id =314 ; + frame->sequence_control.fragment_number =0 ; + + i =0 ; + buf = (unsigned char *)frame->data_and_fcs; + +/* +* Inser reason code: +* "Deauthentication because sending STA is leaving" +*/ +FRAME_INSERT (0x03 ); +FRAME_INSERT (0x00 ); + + frame->frame_length =IEEE80211_HEADER_SIZE + i; +return frame; +} + +struct mac80211_frame *Atheros_WLAN_create_association_response () +{ +unsigned int i; +unsigned char *buf; +struct mac80211_frame *frame; + + frame = (struct mac80211_frame *)malloc (sizeof (struct mac80211_frame )); +if (!frame) + { +return NULL ; + } + + frame->next_frame =NULL ; + frame->frame_control.protocol_version =0 ; + frame->frame_control.type =IEEE80211_TYPE_MGT ; + frame->frame_control.sub_type =IEEE80211_TYPE_MGT_SUBTYPE_ASSOCIATION_RESP ; + frame->frame_control.flags =0 ; +// frame->duration_id = 314; + frame->sequence_control.fragment_number =0 ; + + i =0 ; + buf = (unsigned char *)frame->data_and_fcs; + +/* +* Fixed params... typical AP params (6 byte) +* +* They include +* - Capability Information +* - Status code (successful 0x0) +* - Association ID +*/ +FRAME_INSERT (0x01 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x00 ); +FRAME_INSERT (0x01 ); +FRAME_INSERT (0xc0 ); + +FRAME_INSERT (IEEE80211_BEACON_PARAM_SSID ); +FRAME_INSERT (4 );// length +FRAME_INSERT ('Q' );// SSID +FRAME_INSERT ('L' );// SSID +FRAME_INSERT ('a' );// SSID +FRAME_INSERT ('n' );// SSID + +FRAME_INSERT (IEEE80211_BEACON_PARAM_RATES ); +FRAME_INSERT (8 );// length +FRAME_INSERT (0x82 ); +FRAME_INSERT (0x84 ); +FRAME_INSERT (0x8b ); +FRAME_INSERT (0x96 ); +FRAME_INSERT (0x24 ); +FRAME_INSERT (0x30 ); +FRAME_INSERT (0x48 ); +FRAME_INSERT (0x6c ); + +FRAME_INSERT (IEEE80211_BEACON_PARAM_EXTENDED_RATES ); +FRAME_INSERT (4 );// length +FRAME_INSERT (0x0c ); +FRAME_INSERT (0x12 ); +FRAME_INSERT (0x18 ); +FRAME_INSERT (0x60 ); + + frame->frame_length =IEEE80211_HEADER_SIZE + i; +return frame; +} + +struct mac80211_frame *Atheros_WLAN_create_disassociation () +{ +unsigned int i; +unsigned char *buf; +struct mac80211_frame *frame; + + frame = (struct mac80211_frame *)malloc (sizeof (struct mac80211_frame )); +if (!frame) + { +return NULL ; + } + + frame->next_frame =NULL ; + frame->frame_control.protocol_version =0 ; + frame->frame_control.type =IEEE80211_TYPE_MGT ; + frame->frame_control.sub_type =IEEE80211_TYPE_MGT_SUBTYPE_DISASSOCIATION ; + frame->frame_control.flags =0 ; + frame->duration_id =314 ; + frame->sequence_control.fragment_number =0 ; + + i =0 ; + buf = (unsigned char *)frame->data_and_fcs; + +/* +* Inser reason code: +* "Disassociation because sending STA is leaving" +*/ +FRAME_INSERT (0x03 ); +FRAME_INSERT (0x00 ); + + frame->frame_length =IEEE80211_HEADER_SIZE + i; +return frame; +} + +struct mac80211_frame *Atheros_WLAN_create_data_packet (Atheros_WLANState *s,const uint8_t *buf,int size) +{ +struct mac80211_frame *frame; + + frame = (struct mac80211_frame *)malloc (sizeof (struct mac80211_frame )); +if (!frame) + { +return NULL ; + } + + frame->next_frame =NULL ; + frame->frame_control.protocol_version =0 ; + frame->frame_control.type =IEEE80211_TYPE_DATA ; + frame->frame_control.sub_type =IEEE80211_TYPE_DATA_SUBTYPE_DATA ; + frame->frame_control.flags =0x2 ;// from station back to station via AP + frame->duration_id =44 ; + frame->sequence_control.fragment_number =0 ; + +// send message to wlan-device +memcpy (frame->destination_address, s->macaddr,6 ); + + size -=12 ;// remove old 803.2 header + size +=6 ;// add new 803.11 header +if (size >sizeof (frame->data_and_fcs)) + { +// sanitize memcpy + size =sizeof (frame->data_and_fcs); + } + +// LLC + frame->data_and_fcs[0 ] =0xaa ; + frame->data_and_fcs[1 ] =0xaa ; + frame->data_and_fcs[2 ] =0x03 ; + frame->data_and_fcs[3 ] =0x00 ; + frame->data_and_fcs[4 ] =0x00 ; + frame->data_and_fcs[5 ] =0x00 ; + +memcpy (&frame->data_and_fcs[6 ], &buf[12 ], size); + frame->frame_length =IEEE80211_HEADER_SIZE + size; + +return frame; +} + +int Atheros_WLAN_dumpFrame (struct mac80211_frame *frame,int frame_len,char *filename) +{ +int i =0 , j; +unsigned char buf[56 ]; +unsigned int frame_total_length = frame_len +16 ; +unsigned char *l = (unsigned char *)&frame_total_length; + +// Wireshark header + buf[i++] =0xd4 ; buf[i++] =0xc3 ; buf[i++] =0xb2 ; buf[i++] =0xa1 ; buf[i++] =0x02 ; buf[i++] =0x00 ; buf[i++] =0x04 ; buf[i++] =0x00 ; + buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x00 ; + buf[i++] =0x60 ; buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x7f ; buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x00 ; + buf[i++] =0xd1 ; buf[i++] =0x75 ; buf[i++] =0x5d ; buf[i++] =0x46 ; buf[i++] =0x76 ; buf[i++] =0x8b ; buf[i++] =0x06 ; buf[i++] =0x00 ; + +// total frame length +for (j=0 ; j<4 ; buf[i++] = l[j++]); +// captured frame length +for (j=0 ; j<4 ; buf[i++] = l[j++]); + +// Radiotap header + buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x10 ; buf[i++] =0x00 ; buf[i++] =0x0e ; buf[i++] =0x18 ; buf[i++] =0x00 ; buf[i++] =0x00 ; + buf[i++] =0x10 ; buf[i++] =0x02 ; buf[i++] =0x94 ; buf[i++] =0x09 ; buf[i++] =0xa0 ; buf[i++] =0x00 ; buf[i++] =0x00 ; buf[i++] =0x26 ; + +FILE *fp; + fp =fopen (filename,"w" ); +if (!fp) + { +return 1 ; + } + +fwrite (buf,1 ,sizeof (buf), fp); +fwrite (frame,1 , frame_len, fp); + +fclose (fp); + +return 0 ; +} +
hw/atheros_wlan_packet.h +48 -0
48 lines not on this page · raw message
Patch #7:
PCI definition code for various vendors using an Atheros chip internally. Using these different codes information, we can fake various wlan devices. I know this could be shortened (as there are _many_ repeated 0x00 or 0xff), but this works and I don't want to edit right now ;-)
hw/atheros_wlan_eeprom.h +1137 -0
@@ -0,0 +1,1137 @@ +/** +* QEMU WLAN device emulation +* +* Copyright (c) 2008 Clemens Kolbitsch +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +* +* Modifications: +* 2008-February-24 Clemens Kolbitsch : +* New implementation based on ne2000.c +* +*/ + +#ifndef atheros_wlan_eeprom +#define atheros_wlan_eeprom 1 + + +/* +* on my laptop the atheros card is at +* +* lspci -n +* 02:04:00 0200 168c:0013 (rev 01) +* +* lspci +* 02:04.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01) +* +* +* +* values found on my laptop using +* +* sudo pcitweak 02:04:00 0 +* sudo pcitweak 02:04:00 4 +* sudo pcitweak 02:04:00 8 +* sudo pcitweak 02:04:00 12 +* ... +* sudo pcitweak -r 02:04:00 -b 52 // to read byte-values +* +* OR +* +* sudo lspci -xxxx > tmp +* lspci2devconfig tmp +*/ + +const unsigned int Atheros_WLAN_eeprom_data_MacBook[] = +{ +0x168c ,0x0200 ,0x0001 ,0x0000 ,0x5001 ,0x0000 ,0x00e6 ,0x0e11 , +0x1c0a ,0x0100 ,0x0000 ,0x0002 ,0x0002 ,0xc606 ,0x0001 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x2e9e ,0x0a80 ,0x0011 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x5aa5 ,0x0000 ,0x0000 ,0x0313 , +0x4943 ,0x2053 ,0x7104 ,0x1202 ,0x0400 ,0x0306 ,0x0001 ,0x0000 , +0x0500 ,0x410e ,0x39b1 ,0x1eb5 ,0x4e2d ,0x3056 ,0xffff ,0xe902 , +0x0700 ,0x0106 ,0x0000 ,0x0100 ,0x1500 ,0x0752 ,0x4101 ,0x6874 , +0x7265 ,0x736f ,0x4320 ,0x6d6f ,0x756d ,0x696e ,0x6163 ,0x6974 , +0x6e6f ,0x2c73 ,0x4920 ,0x636e ,0x002e ,0x5241 ,0x3035 ,0x3130 , +0x302d ,0x3030 ,0x2d30 ,0x3030 ,0x3030 ,0x5700 ,0x7269 ,0x6c65 , +0x7365 ,0x2073 ,0x414c ,0x204e ,0x6552 ,0x6566 ,0x6572 ,0x636e , +0x2065 ,0x6143 ,0x6472 ,0x3000 ,0x0030 ,0x00ff ,0x2100 ,0x0602 , +0x2201 ,0x0205 ,0x8d80 ,0x005b ,0x0522 ,0x4002 ,0x8954 ,0x2200 , +0x0205 ,0x1b00 ,0x00b7 ,0x0522 ,0x8002 ,0x12a8 ,0x2201 ,0x0205 , +0x3600 ,0x016e ,0x0522 ,0x0002 ,0x2551 ,0x2202 ,0x0205 ,0x6c00 , +0x02dc ,0x0522 ,0x8002 ,0x37f9 ,0x2203 ,0x0205 ,0xa200 ,0x044a , +0x0222 ,0x0803 ,0x0822 ,0x0604 ,0x0011 ,0x0a80 ,0x2e9e ,0x0222 , +0x0105 ,0x00ff ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xffff ,0x0060 ,0x6115 , +0x3004 ,0x5a06 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x2d2c ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0xe028 ,0xa492 ,0x1c00 ,0x000e ,0xb8ca ,0x01bb ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x233c ,0x0214 ,0x1100 ,0x0460 ,0x8400 ,0xda22 ,0x021c , +0x0007 ,0xb0ff ,0x01b7 ,0x4024 ,0x0001 ,0x0170 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x2d3c ,0x0214 ,0x1100 ,0x0460 , +0x8400 ,0xe022 ,0x021c ,0x000e ,0xb0ff ,0x01b7 ,0x401b ,0x0079 , +0x8e70 ,0x0020 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x1112 , +0x3132 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xe014 ,0x5461 , +0xc7e1 ,0x9259 ,0xe8a4 ,0x9c34 ,0x5359 ,0x96de ,0x7e18 ,0xa494 , +0x9c34 ,0x1359 ,0x86dd ,0x7e18 ,0xa390 ,0xa814 ,0x5459 ,0x96dd , +0x7e08 ,0xa390 ,0xa814 ,0x5459 ,0x96dd ,0x7e08 ,0xa390 ,0x6044 , +0x1251 ,0x55d9 ,0x69b7 ,0x5e7c ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x7079 ,0xe79e ,0xb879 ,0xe79e , +0x7079 ,0xc698 ,0x8979 ,0xc698 ,0xa279 ,0xc698 ,0x7075 ,0x7a84 , +0x8e9d ,0xa2a7 ,0x2224 ,0x2424 ,0x2424 ,0x223c ,0x7075 ,0x7a84 , +0x8e9d ,0xa2a7 ,0x1c24 ,0x2424 ,0x2424 ,0x1c3c ,0x7075 ,0x7a84 , +0x8e9d ,0xa7ac ,0x3c3c ,0x3c3c ,0x3c3c ,0x3c3c ,0x7075 ,0x7a84 , +0x8e9d ,0xa7ac ,0x3c3c ,0x3c3c ,0x3c3c ,0x3c3c ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xbad1 , +0x0205 ,0x0013 ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff +}; + +const unsigned char Atheros_WLAN_pci_config_MacBook[] = +{ +0x8c ,0x16 ,0x1c ,0x00 ,0x07 ,0x00 ,0x10 ,0x00 , +0x01 ,0x00 ,0x00 ,0x02 ,0x40 ,0x00 ,0x00 ,0x00 , +0x04 ,0x00 ,0x10 ,0x90 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 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 ,0x0000 ,0x2e9e ,0x0a80 ,0x0011 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x5aa5 ,0x0000 ,0x0000 ,0x0313 , +0x4943 ,0x2053 ,0x7104 ,0x1202 ,0x0400 ,0x0306 ,0x0001 ,0x0000 , +0x0500 ,0x410e ,0x39b1 ,0x1eb5 ,0x4e2d ,0x3056 ,0xffff ,0xe902 , +0x0700 ,0x0106 ,0x0000 ,0x0100 ,0x1500 ,0x0752 ,0x4101 ,0x6874 , +0x7265 ,0x736f ,0x4320 ,0x6d6f ,0x756d ,0x696e ,0x6163 ,0x6974 , +0x6e6f ,0x2c73 ,0x4920 ,0x636e ,0x002e ,0x5241 ,0x3035 ,0x3130 , +0x302d ,0x3030 ,0x2d30 ,0x3030 ,0x3030 ,0x5700 ,0x7269 ,0x6c65 , +0x7365 ,0x2073 ,0x414c ,0x204e ,0x6552 ,0x6566 ,0x6572 ,0x636e , +0x2065 ,0x6143 ,0x6472 ,0x3000 ,0x0030 ,0x00ff ,0x2100 ,0x0602 , +0x2201 ,0x0205 ,0x8d80 ,0x005b ,0x0522 ,0x4002 ,0x8954 ,0x2200 , +0x0205 ,0x1b00 ,0x00b7 ,0x0522 ,0x8002 ,0x12a8 ,0x2201 ,0x0205 , +0x3600 ,0x016e ,0x0522 ,0x0002 ,0x2551 ,0x2202 ,0x0205 ,0x6c00 , +0x02dc ,0x0522 ,0x8002 ,0x37f9 ,0x2203 ,0x0205 ,0xa200 ,0x044a , +0x0222 ,0x0803 ,0x0822 ,0x0604 ,0x0011 ,0x0a80 ,0x2e9e ,0x0222 , +0x0105 ,0x00ff ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xffff ,0x0060 ,0x6115 , +0x3004 ,0x5a06 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x2d2c ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0xe028 ,0xa492 ,0x1c00 ,0x000e ,0xb8ca ,0x01bb ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x233c ,0x0214 ,0x1100 ,0x0460 ,0x8400 ,0xda22 ,0x021c , +0x0007 ,0xb0ff ,0x01b7 ,0x4024 ,0x0001 ,0x0170 ,0x0000 ,0x0013 , +0x168c ,0x0200 ,0x0001 ,0x0000 ,0x5001 ,0x0000 ,0x00e6 ,0x0e11 , +0x1c0a ,0x0100 ,0x0000 ,0x0002 ,0x0002 ,0xc606 ,0x0001 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x2e9e ,0x0a80 ,0x0011 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x5aa5 ,0x0000 ,0x0000 ,0x0313 , +0x4943 ,0x2053 ,0x7104 ,0x1202 ,0x0400 ,0x0306 ,0x0001 ,0x0000 , +0x0500 ,0x410e ,0x39b1 ,0x1eb5 ,0x4e2d ,0x3056 ,0xffff ,0xe902 , +0x0700 ,0x0106 ,0x0000 ,0x0100 ,0x1500 ,0x0752 ,0x4101 ,0x6874 , +0x7265 ,0x736f ,0x4320 ,0x6d6f ,0x756d ,0x696e ,0x6163 ,0x6974 , +0x6e6f ,0x2c73 ,0x4920 ,0x636e ,0x002e ,0x5241 ,0x3035 ,0x3130 , +0x302d ,0x3030 ,0x2d30 ,0x3030 ,0x3030 ,0x5700 ,0x7269 ,0x6c65 , +0x7365 ,0x2073 ,0x414c ,0x204e ,0x6552 ,0x6566 ,0x6572 ,0x636e , +0x2065 ,0x6143 ,0x6472 ,0x3000 ,0x0030 ,0x00ff ,0x2100 ,0x0602 , +0x2201 ,0x0205 ,0x8d80 ,0x005b ,0x0522 ,0x4002 ,0x8954 ,0x2200 , +0x0205 ,0x1b00 ,0x00b7 ,0x0522 ,0x8002 ,0x12a8 ,0x2201 ,0x0205 , +0x3600 ,0x016e ,0x0522 ,0x0002 ,0x2551 ,0x2202 ,0x0205 ,0x6c00 , +0x02dc ,0x0522 ,0x8002 ,0x37f9 ,0x2203 ,0x0205 ,0xa200 ,0x044a , +0x0222 ,0x0803 ,0x0822 ,0x0604 ,0x0011 ,0x0a80 ,0x2e9e ,0x0222 , +0x0105 ,0x00ff ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xffff ,0x0060 ,0x6115 , +0x3004 ,0x5a06 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x2d2c ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0xe028 ,0xa492 ,0x1c00 ,0x000e ,0xb8ca ,0x01bb ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x233c ,0x0214 ,0x1100 ,0x0460 ,0x8400 ,0xda22 ,0x021c , +0x0007 ,0xb0ff ,0x01b7 ,0x4024 ,0x0001 ,0x0170 ,0x0000 ,0x0013 , +0x168c ,0x0200 ,0x0001 ,0x0000 ,0x5001 ,0x0000 ,0x00e6 ,0x0e11 , +0x1c0a ,0x0100 ,0x0000 ,0x0002 ,0x0002 ,0xc606 ,0x0001 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x2e9e ,0x0a80 ,0x0011 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x5aa5 ,0x0000 ,0x0000 ,0x0313 , +0x4943 ,0x2053 ,0x7104 ,0x1202 ,0x0400 ,0x0306 ,0x0001 ,0x0000 , +0x0500 ,0x410e ,0x39b1 ,0x1eb5 ,0x4e2d ,0x3056 ,0xffff ,0xe902 , +0x0700 ,0x0106 ,0x0000 ,0x0100 ,0x1500 ,0x0752 ,0x4101 ,0x6874 , +0x7265 ,0x736f ,0x4320 ,0x6d6f ,0x756d ,0x696e ,0x6163 ,0x6974 , +0x6e6f ,0x2c73 ,0x4920 ,0x636e ,0x002e ,0x5241 ,0x3035 ,0x3130 , +0x302d ,0x3030 ,0x2d30 ,0x3030 ,0x3030 ,0x5700 ,0x7269 ,0x6c65 , +0x7365 ,0x2073 ,0x414c ,0x204e ,0x6552 ,0x6566 ,0x6572 ,0x636e , +0x2065 ,0x6143 ,0x6472 ,0x3000 ,0x0030 ,0x00ff ,0x2100 ,0x0602 , +0x2201 ,0x0205 ,0x8d80 ,0x005b ,0x0522 ,0x4002 ,0x8954 ,0x2200 , +0x0205 ,0x1b00 ,0x00b7 ,0x0522 ,0x8002 ,0x12a8 ,0x2201 ,0x0205 , +0x3600 ,0x016e ,0x0522 ,0x0002 ,0x2551 ,0x2202 ,0x0205 ,0x6c00 , +0x02dc ,0x0522 ,0x8002 ,0x37f9 ,0x2203 ,0x0205 ,0xa200 ,0x044a , +0x0222 ,0x0803 ,0x0822 ,0x0604 ,0x0011 ,0x0a80 ,0x2e9e ,0x0222 , +0x0105 ,0x00ff ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xffff ,0x0060 ,0x6115 , +0x3004 ,0x5a06 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x2d2c ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0xe028 ,0xa492 ,0x1c00 ,0x000e ,0xb8ca ,0x01bb ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x233c ,0x0214 ,0x1100 ,0x0460 ,0x8400 ,0xda22 ,0x021c , +0x0007 ,0xb0ff ,0x01b7 ,0x4024 ,0x0001 ,0x0170 ,0x0000 ,0x0013 , +0x168c ,0x0200 ,0x0001 ,0x0000 ,0x5001 ,0x0000 ,0x00e6 ,0x0e11 , +0x1c0a ,0x0100 ,0x0000 ,0x0002 ,0x0002 ,0xc606 ,0x0001 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x2e9e ,0x0a80 ,0x0011 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x5aa5 ,0x0000 ,0x0000 ,0x0313 , +0x4943 ,0x2053 ,0x7104 ,0x1202 ,0x0400 ,0x0306 ,0x0001 ,0x0000 , +0x0500 ,0x410e ,0x39b1 ,0x1eb5 ,0x4e2d ,0x3056 ,0xffff ,0xe902 , +0x0700 ,0x0106 ,0x0000 ,0x0100 ,0x1500 ,0x0752 ,0x4101 ,0x6874 , +0x7265 ,0x736f ,0x4320 ,0x6d6f ,0x756d ,0x696e ,0x6163 ,0x6974 , +0x6e6f ,0x2c73 ,0x4920 ,0x636e ,0x002e ,0x5241 ,0x3035 ,0x3130 , +0x302d ,0x3030 ,0x2d30 ,0x3030 ,0x3030 ,0x5700 ,0x7269 ,0x6c65 , +0x7365 ,0x2073 ,0x414c ,0x204e ,0x6552 ,0x6566 ,0x6572 ,0x636e , +0x2065 ,0x6143 ,0x6472 ,0x3000 ,0x0030 ,0x00ff ,0x2100 ,0x0602 , +0x2201 ,0x0205 ,0x8d80 ,0x005b ,0x0522 ,0x4002 ,0x8954 ,0x2200 , +0x0205 ,0x1b00 ,0x00b7 ,0x0522 ,0x8002 ,0x12a8 ,0x2201 ,0x0205 , +0x3600 ,0x016e ,0x0522 ,0x0002 ,0x2551 ,0x2202 ,0x0205 ,0x6c00 , +0x02dc ,0x0522 ,0x8002 ,0x37f9 ,0x2203 ,0x0205 ,0xa200 ,0x044a , +0x0222 ,0x0803 ,0x0822 ,0x0604 ,0x0011 ,0x0a80 ,0x2e9e ,0x0222 , +0x0105 ,0x00ff ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xffff ,0x0060 ,0x6115 , +0x3004 ,0x5a06 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x2d2c ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0xe028 ,0xa492 ,0x1c00 ,0x000e ,0xb8ca ,0x01bb ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x233c ,0x0214 ,0x1100 ,0x0460 ,0x8400 ,0xda22 ,0x021c , +0x0007 ,0xb0ff ,0x01b7 ,0x4024 ,0x0001 ,0x0170 ,0x0000 ,0x0013 , +0x168c ,0x0200 ,0x0001 ,0x0000 ,0x5001 ,0x0000 ,0x00e6 ,0x0e11 , +0x1c0a ,0x0100 ,0x0000 ,0x0002 ,0x0002 ,0xc606 ,0x0001 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x2e9e ,0x0a80 ,0x0011 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x5aa5 ,0x0000 ,0x0000 ,0x0313 , +0x4943 ,0x2053 ,0x7104 ,0x1202 ,0x0400 ,0x0306 ,0x0001 ,0x0000 , +0x0500 ,0x410e ,0x39b1 ,0x1eb5 ,0x4e2d ,0x3056 ,0xffff ,0xe902 , +0x0700 ,0x0106 ,0x0000 ,0x0100 ,0x1500 ,0x0752 ,0x4101 ,0x6874 , +0x7265 ,0x736f ,0x4320 ,0x6d6f ,0x756d ,0x696e ,0x6163 ,0x6974 , +0x6e6f ,0x2c73 ,0x4920 ,0x636e ,0x002e ,0x5241 ,0x3035 ,0x3130 , +0x302d ,0x3030 ,0x2d30 ,0x3030 ,0x3030 ,0x5700 ,0x7269 ,0x6c65 , +0x7365 ,0x2073 ,0x414c ,0x204e ,0x6552 ,0x6566 ,0x6572 ,0x636e , +0x2065 ,0x6143 ,0x6472 ,0x3000 ,0x0030 ,0x00ff ,0x2100 ,0x0602 , +0x2201 ,0x0205 ,0x8d80 ,0x005b ,0x0522 ,0x4002 ,0x8954 ,0x2200 , +0x0205 ,0x1b00 ,0x00b7 ,0x0522 ,0x8002 ,0x12a8 ,0x2201 ,0x0205 , +0x3600 ,0x016e ,0x0522 ,0x0002 ,0x2551 ,0x2202 ,0x0205 ,0x6c00 , +0x02dc ,0x0522 ,0x8002 ,0x37f9 ,0x2203 ,0x0205 ,0xa200 ,0x044a , +0x0222 ,0x0803 ,0x0822 ,0x0604 ,0x0011 ,0x0a80 ,0x2e9e ,0x0222 , +0x0105 ,0x00ff ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xffff ,0x0060 ,0x6115 , +0x3004 ,0x5a06 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x2d2c ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0xe028 ,0xa492 ,0x1c00 ,0x000e ,0xb8ca ,0x01bb ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x233c ,0x0214 ,0x1100 ,0x0460 ,0x8400 ,0xda22 ,0x021c +}; + +const unsigned int Atheros_WLAN_eeprom_data_HPW400[] = +{ +0x168c ,0x0200 ,0x0001 ,0x0000 ,0x5001 ,0x0000 ,0x00e6 ,0x0e11 , +0x1c0a ,0x0100 ,0x0000 ,0x0002 ,0x0002 ,0xc606 ,0x0001 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x2e9e ,0x0a80 ,0x0011 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x5aa5 ,0x0000 ,0x0000 ,0x0313 , +0x4943 ,0x2053 ,0x7104 ,0x1202 ,0x0400 ,0x0306 ,0x0001 ,0x0000 , +0x0500 ,0x410e ,0x39b1 ,0x1eb5 ,0x4e2d ,0x3056 ,0xffff ,0xe902 , +0x0700 ,0x0106 ,0x0000 ,0x0100 ,0x1500 ,0x0752 ,0x4101 ,0x6874 , +0x7265 ,0x736f ,0x4320 ,0x6d6f ,0x756d ,0x696e ,0x6163 ,0x6974 , +0x6e6f ,0x2c73 ,0x4920 ,0x636e ,0x002e ,0x5241 ,0x3035 ,0x3130 , +0x302d ,0x3030 ,0x2d30 ,0x3030 ,0x3030 ,0x5700 ,0x7269 ,0x6c65 , +0x7365 ,0x2073 ,0x414c ,0x204e ,0x6552 ,0x6566 ,0x6572 ,0x636e , +0x2065 ,0x6143 ,0x6472 ,0x3000 ,0x0030 ,0x00ff ,0x2100 ,0x0602 , +0x2201 ,0x0205 ,0x8d80 ,0x005b ,0x0522 ,0x4002 ,0x8954 ,0x2200 , +0x0205 ,0x1b00 ,0x00b7 ,0x0522 ,0x8002 ,0x12a8 ,0x2201 ,0x0205 , +0x3600 ,0x016e ,0x0522 ,0x0002 ,0x2551 ,0x2202 ,0x0205 ,0x6c00 , +0x02dc ,0x0522 ,0x8002 ,0x37f9 ,0x2203 ,0x0205 ,0xa200 ,0x044a , +0x0222 ,0x0803 ,0x0822 ,0x0604 ,0x0011 ,0x0a80 ,0x2e9e ,0x0222 , +0x0105 ,0x00ff ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xffff ,0x0060 ,0x6115 , +0x3004 ,0x5a06 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x2d2c ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0xe028 ,0xa492 ,0x1c00 ,0x000e ,0xb8ca ,0x01bb ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x233c ,0x0214 ,0x1100 ,0x0460 ,0x8400 ,0xda22 ,0x021c , +0x0007 ,0xb0ff ,0x01b7 ,0x4024 ,0x0001 ,0x0170 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x2d3c ,0x0214 ,0x1100 ,0x0460 , +0x8400 ,0xe022 ,0x021c ,0x000e ,0xb0ff ,0x01b7 ,0x401b ,0x0079 , +0x8e70 ,0x0020 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x1112 , +0x3132 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xe014 ,0x5461 , +0xc7e1 ,0x9259 ,0xe8a4 ,0x9c34 ,0x5359 ,0x96de ,0x7e18 ,0xa494 , +0x9c34 ,0x1359 ,0x86dd ,0x7e18 ,0xa390 ,0xa814 ,0x5459 ,0x96dd , +0x7e08 ,0xa390 ,0xa814 ,0x5459 ,0x96dd ,0x7e08 ,0xa390 ,0x6044 , +0x1251 ,0x55d9 ,0x69b7 ,0x5e7c ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x7079 ,0xe79e ,0xb879 ,0xe79e , +0x7079 ,0xc698 ,0x8979 ,0xc698 ,0xa279 ,0xc698 ,0x7075 ,0x7a84 , +0x8e9d ,0xa2a7 ,0x2224 ,0x2424 ,0x2424 ,0x223c ,0x7075 ,0x7a84 , +0x8e9d ,0xa2a7 ,0x1c24 ,0x2424 ,0x2424 ,0x1c3c ,0x7075 ,0x7a84 , +0x8e9d ,0xa7ac ,0x3c3c ,0x3c3c ,0x3c3c ,0x3c3c ,0x7075 ,0x7a84 , +0x8e9d ,0xa7ac ,0x3c3c ,0x3c3c ,0x3c3c ,0x3c3c ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 , +0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0x0000 ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xbad1 , +0x0205 ,0x0013 ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff , +0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff ,0xffff +}; + +const unsigned char Atheros_WLAN_pci_config_HPW400[] = +{ +0x8c ,0x16 ,0x13 ,0x00 ,0x06 ,0x00 ,0x90 ,0x02 , +0x01 ,0x00 ,0x00 ,0x02 ,0x10 ,0xa8 ,0x00 ,0x00 , +0x00 ,0x00 ,0x08 ,0x90 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x01 ,0x50 ,0x00 ,0x00 ,0x11 ,0x0e ,0xe6 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x44 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x0b ,0x01 ,0x0a ,0x1c , +0x00 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x02 ,0x00 , +0x00 ,0x40 ,0x00 ,0xc6 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0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ks Zzav (?? MadWifi mailing list) +* +* it's a TP-LINK TL-WN651G +* http://www.tp-link.com/products/product_des.asp?id=17 +*/ +const unsigned char Atheros_WLAN_pci_config_TP_Link_WN651G[] = +{ +0x8c ,0x16 ,0x13 ,0x00 ,0x16 ,0x00 ,0x90 ,0x02 , +0x01 ,0x00 ,0x00 ,0x02 ,0x08 ,0xa8 ,0x00 ,0x00 , +0x00 ,0x00 ,0xbf ,0xfe ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x01 ,0x50 ,0x00 ,0x00 ,0x8c ,0x16 ,0x51 ,0x10 , +0x00 ,0x00 ,0x00 ,0x00 ,0x44 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x0a ,0x01 ,0x0a ,0x1c +}; + +#endif // atheros_wlan_eeprom
Patch #8:
CRC32 helper code. Sorry if there is already some global function that could be used for this purpose. Simply took the code from Wireshark (license and header documentation unchanged obviously).
hw/atheros_wlan_crc32.c +238 -0
@@ -0,0 +1,238 @@ +/* crc32.c +* CRC-32 routine +* +* $Id: crc32.c 18197 2006-05-21 05:12:17Z sahlberg $ +* +* Wireshark - Network traffic analyzer +* By Gerald Combs <[email protected]> +* Copyright 1998 Gerald Combs +* +* Copied from README.developer +* +* 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. +* +* Credits: +* +* Table from Solomon Peachy +* Routine from Chris Waters +*/ + +#include "atheros_wlan_crc32.h" + +/* +* Table for the AUTODIN/HDLC/802.x CRC. +* +* Polynomial is +* +* x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^8 + x^7 + +* x^5 + x^4 + x^2 + x + 1 +*/ +const guint32 crc32_ccitt_table[256 ] = { +0x00000000 ,0x77073096 ,0xee0e612c ,0x990951ba ,0x076dc419 , +0x706af48f ,0xe963a535 ,0x9e6495a3 ,0x0edb8832 ,0x79dcb8a4 , +0xe0d5e91e ,0x97d2d988 ,0x09b64c2b ,0x7eb17cbd ,0xe7b82d07 , +0x90bf1d91 ,0x1db71064 ,0x6ab020f2 ,0xf3b97148 ,0x84be41de , +0x1adad47d ,0x6ddde4eb ,0xf4d4b551 ,0x83d385c7 ,0x136c9856 , +0x646ba8c0 ,0xfd62f97a ,0x8a65c9ec ,0x14015c4f ,0x63066cd9 , +0xfa0f3d63 ,0x8d080df5 ,0x3b6e20c8 ,0x4c69105e ,0xd56041e4 , +0xa2677172 ,0x3c03e4d1 ,0x4b04d447 ,0xd20d85fd ,0xa50ab56b , +0x35b5a8fa ,0x42b2986c ,0xdbbbc9d6 ,0xacbcf940 ,0x32d86ce3 , +0x45df5c75 ,0xdcd60dcf ,0xabd13d59 ,0x26d930ac ,0x51de003a , +0xc8d75180 ,0xbfd06116 ,0x21b4f4b5 ,0x56b3c423 ,0xcfba9599 , +0xb8bda50f ,0x2802b89e ,0x5f058808 ,0xc60cd9b2 ,0xb10be924 , +0x2f6f7c87 ,0x58684c11 ,0xc1611dab ,0xb6662d3d ,0x76dc4190 , +0x01db7106 ,0x98d220bc ,0xefd5102a ,0x71b18589 ,0x06b6b51f , +0x9fbfe4a5 ,0xe8b8d433 ,0x7807c9a2 ,0x0f00f934 ,0x9609a88e , +0xe10e9818 ,0x7f6a0dbb ,0x086d3d2d ,0x91646c97 ,0xe6635c01 , +0x6b6b51f4 ,0x1c6c6162 ,0x856530d8 ,0xf262004e ,0x6c0695ed , +0x1b01a57b ,0x8208f4c1 ,0xf50fc457 ,0x65b0d9c6 ,0x12b7e950 , +0x8bbeb8ea ,0xfcb9887c ,0x62dd1ddf ,0x15da2d49 ,0x8cd37cf3 , +0xfbd44c65 ,0x4db26158 ,0x3ab551ce ,0xa3bc0074 ,0xd4bb30e2 , +0x4adfa541 ,0x3dd895d7 ,0xa4d1c46d ,0xd3d6f4fb ,0x4369e96a , +0x346ed9fc ,0xad678846 ,0xda60b8d0 ,0x44042d73 ,0x33031de5 , +0xaa0a4c5f ,0xdd0d7cc9 ,0x5005713c ,0x270241aa ,0xbe0b1010 , +0xc90c2086 ,0x5768b525 ,0x206f85b3 ,0xb966d409 ,0xce61e49f , +0x5edef90e ,0x29d9c998 ,0xb0d09822 ,0xc7d7a8b4 ,0x59b33d17 , +0x2eb40d81 ,0xb7bd5c3b ,0xc0ba6cad ,0xedb88320 ,0x9abfb3b6 , +0x03b6e20c ,0x74b1d29a ,0xead54739 ,0x9dd277af ,0x04db2615 , +0x73dc1683 ,0xe3630b12 ,0x94643b84 ,0x0d6d6a3e ,0x7a6a5aa8 , +0xe40ecf0b ,0x9309ff9d ,0x0a00ae27 ,0x7d079eb1 ,0xf00f9344 , +0x8708a3d2 ,0x1e01f268 ,0x6906c2fe ,0xf762575d ,0x806567cb , +0x196c3671 ,0x6e6b06e7 ,0xfed41b76 ,0x89d32be0 ,0x10da7a5a , +0x67dd4acc ,0xf9b9df6f ,0x8ebeeff9 ,0x17b7be43 ,0x60b08ed5 , +0xd6d6a3e8 ,0xa1d1937e ,0x38d8c2c4 ,0x4fdff252 ,0xd1bb67f1 , +0xa6bc5767 ,0x3fb506dd ,0x48b2364b ,0xd80d2bda ,0xaf0a1b4c , +0x36034af6 ,0x41047a60 ,0xdf60efc3 ,0xa867df55 ,0x316e8eef , +0x4669be79 ,0xcb61b38c ,0xbc66831a ,0x256fd2a0 ,0x5268e236 , +0xcc0c7795 ,0xbb0b4703 ,0x220216b9 ,0x5505262f ,0xc5ba3bbe , +0xb2bd0b28 ,0x2bb45a92 ,0x5cb36a04 ,0xc2d7ffa7 ,0xb5d0cf31 , +0x2cd99e8b ,0x5bdeae1d ,0x9b64c2b0 ,0xec63f226 ,0x756aa39c , +0x026d930a ,0x9c0906a9 ,0xeb0e363f ,0x72076785 ,0x05005713 , +0x95bf4a82 ,0xe2b87a14 ,0x7bb12bae ,0x0cb61b38 ,0x92d28e9b , +0xe5d5be0d ,0x7cdcefb7 ,0x0bdbdf21 ,0x86d3d2d4 ,0xf1d4e242 , +0x68ddb3f8 ,0x1fda836e ,0x81be16cd ,0xf6b9265b ,0x6fb077e1 , +0x18b74777 ,0x88085ae6 ,0xff0f6a70 ,0x66063bca ,0x11010b5c , +0x8f659eff ,0xf862ae69 ,0x616bffd3 ,0x166ccf45 ,0xa00ae278 , +0xd70dd2ee ,0x4e048354 ,0x3903b3c2 ,0xa7672661 ,0xd06016f7 , +0x4969474d ,0x3e6e77db ,0xaed16a4a ,0xd9d65adc ,0x40df0b66 , +0x37d83bf0 ,0xa9bcae53 ,0xdebb9ec5 ,0x47b2cf7f ,0x30b5ffe9 , +0xbdbdf21c ,0xcabac28a ,0x53b39330 ,0x24b4a3a6 ,0xbad03605 , +0xcdd70693 ,0x54de5729 ,0x23d967bf ,0xb3667a2e ,0xc4614ab8 , +0x5d681b02 ,0x2a6f2b94 ,0xb40bbe37 ,0xc30c8ea1 ,0x5a05df1b , +0x2d02ef8d +}; + +#define CRC32_CCITT_SEED 0xFFFFFFFF + +guint32 +crc32_ccitt (const guint8 *buf,guint len) +{ +return (crc32_ccitt_seed (buf, len,CRC32_CCITT_SEED ) ); +} + +guint32 +crc32_ccitt_seed (const guint8 *buf,guint len,guint32 seed) +{ +guint i; +guint32 crc32 = seed; + +for (i =0 ; i < len; i++) + crc32 = crc32_ccitt_table[(crc32 ^ buf[i]) &0xff ] ^ (crc32 >>8 ); + +return ( ~crc32 ); +} + + + + + + + + + + +/* +* Checksum routine for Internet Protocol family headers (Portable Version). +* +* This routine is very heavily used in the network +* code and should be modified for each CPU to be as fast as possible. +*/ + +#define ADDCARRY (x) (x > 65535 ? x -= 65535 : x) +#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);} + +int +in_cksum (const vec_t *vec,int veclen) +{ + registerconst guint16 *w; + registerint sum =0 ; + registerint mlen =0 ; +int byte_swapped =0 ; + +union { +guint8 c[2 ]; +guint16 s; + } s_util; +union { +guint16 s[2 ]; +guint32 l; + } l_util; + +for (; veclen !=0 ; vec++, veclen--) { +if (vec->len ==0 ) +continue ; + w = (const guint16 *)vec->ptr; +if (mlen ==-1 ) { +/* +* The first byte of this chunk is the continuation +* of a word spanning between this chunk and the +* last chunk. +* +* s_util.c[0] is already saved when scanning previous +* chunk. +*/ + s_util.c[1 ] = *(const guint8 *)w; + sum += s_util.s; + w = (const guint16 *)((const guint8 *)w +1 ); + mlen = vec->len -1 ; + }else + mlen = vec->len; +/* +* Force to even boundary. +*/ +if ((1 & (unsigned long ) w) && (mlen >0 )) { +REDUCE ; + sum <<=8 ; + s_util.c[0 ] = *(const guint8 *)w; + w = (const guint16 *)((const guint8 *)w +1 ); + mlen--; + byte_swapped =1 ; + } +/* +* Unroll the loop to make overhead from +* branches &c small. +*/ +while ((mlen -=32 ) >=0 ) { + sum += w[0 ]; sum += w[1 ]; sum += w[2 ]; sum += w[3 ]; + sum += w[4 ]; sum += w[5 ]; sum += w[6 ]; sum += w[7 ]; + sum += w[8 ]; sum += w[9 ]; sum += w[10 ]; sum += w[11 ]; + sum += w[12 ]; sum += w[13 ]; sum += w[14 ]; sum += w[15 ]; + w +=16 ; + } + mlen +=32 ; +while ((mlen -=8 ) >=0 ) { + sum += w[0 ]; sum += w[1 ]; sum += w[2 ]; sum += w[3 ]; + w +=4 ; + } + mlen +=8 ; +if (mlen ==0 && byte_swapped ==0 ) +continue ; +REDUCE ; +while ((mlen -=2 ) >=0 ) { + sum += *w++; + } +if (byte_swapped) { +REDUCE ; + sum <<=8 ; + byte_swapped =0 ; +if (mlen ==-1 ) { + s_util.c[1 ] = *(const guint8 *)w; + sum += s_util.s; + mlen =0 ; + }else + mlen =-1 ; + }else if (mlen ==-1 ) + s_util.c[0 ] = *(const guint8 *)w; + } +if (mlen ==-1 ) { +/* The last mbuf has odd # of bytes. Follow the +standard (the odd byte may be shifted left by 8 bits +or not as determined by endian-ness of the machine) */ + s_util.c[1 ] =0 ; + sum += s_util.s; + } +REDUCE ; +return (~sum &0xffff ); +} + +guint16 ip_checksum (const guint8 *ptr,int len) +{ +vec_t cksum_vec[1 ]; + + cksum_vec[0 ].ptr = ptr; + cksum_vec[0 ].len = len; +return in_cksum (&cksum_vec[0 ],1 ); +} +
hw/atheros_wlan_crc32.h +51 -0
51 lines not on this page · raw message
Patch #9: (final)
These three files are taken from the ath5k reverse engineering project and include definitions used inside the driver/IO code. Again, license and documentation unchanged.
There are many definitions that might not be used, but eliminating those is a time consuming process...
hw/ath5k.h +887 -0
@@ -0,0 +1,887 @@ +/* +* Copyright (c) 2004-2007 Reyk Floeter <[email protected]> +* Copyright (c) 2006-2007 Nick Kossifidis <[email protected]> +* +* 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. +* +* $Id$ +*/ + +/* +* HAL interface for Atheros Wireless LAN devices. +* +* 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. +* +* Many thanks to various contributors who supported the development of +* ar5k with hard work and useful information. And, of course, for all the +* people who encouraged me to continue this work which has been based +* on my initial approach found on http://team.vantronix.net/ar5k/. +*/ + +#ifndef _AR5K_H +#define _AR5K_H + + + + +/* +* Device tracing +*/ + +#define AR5K_TRACE_PRINTF (_trace) AR5K_PRINTF(_trace) + + + + + + +/****************************\ +GENERIC DRIVER DEFINITIONS +\****************************/ + +/* +* C doesn't support boolean ;-( +* TODO: See if there is a bool definition somewere else +* in the kernel, we shouldn't redefine it if it does... +*/ +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif +typedef u_int8_t AR5K_BOOL ; + +/* +* Error codes reported from HAL to the driver +*/ +typedef enum { +AR5K_OK =0 ,/* Everything went O.K.*/ +AR5K_ENOMEM =1 ,/* Unable to allocate memory for ath_hal*/ +AR5K_EIO =2 ,/* Hardware I/O Error*/ +AR5K_EELOCKED =3 ,/* Unable to access EEPROM*/ +AR5K_EEBADSUM =4 ,/* Invalid EEPROM checksum*/ +AR5K_EEREAD =5 ,/* Unable to get device caps from EEPROM */ +AR5K_EEBADMAC =6 ,/* Unable to read MAC address from EEPROM */ +AR5K_EINVAL =7 ,/* Invalid parameter to function */ +AR5K_ENOTSUPP =8 ,/* Hardware revision not supported */ +AR5K_EINPROGRESS =9 ,/* Unexpected error ocured during process */ +}AR5K_STATUS ; + +/* +* 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 ((MAX_PDU_LENGTH / 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 ((u_int32_t) -1) + +#define IEEE80211_ADDR_LEN 6/* size of 802.11 address */ +#define ETHER_ADDR_LEN 6/* length of an Ethernet address */ +static const u_char etherbroadcastaddr[ETHER_ADDR_LEN ] = {0xff ,0xff ,0xff ,0xff ,0xff ,0xff }; +//#define etherbroadcastaddr 0xff + + + + +/*****************************\ +GENERIC CHIPSET DEFINITIONS +\*****************************/ + +/* MAC Chips*/ +enum ath5k_version { +AR5K_AR5210 =0 , +AR5K_AR5211 =1 , +AR5K_AR5212 =2 , +}; + +/*PHY Chips*/ +enum ath5k_radio { +AR5K_AR5110 =0 , +AR5K_AR5111 =1 , +AR5K_AR5112 =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, AR5K_DEVID_AR2413 }, \ + { "5413", AR5K_VERSION_DEV, AR5K_DEVID_AR5413 }, \ + { "5424", AR5K_VERSION_DEV, AR5K_DEVID_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 +#define AR5K_SREV_RAD_2111 0x20 +#define AR5K_SREV_RAD_5112 0x30 +#define AR5K_SREV_RAD_5112A 0x35 +#define AR5K_SREV_RAD_2112 0x40 +#define AR5K_SREV_RAD_2112A 0x45 +#define AR5K_SREV_RAD_UNSUPP 0x50 + + + + +/****************\ +TX DEFINITIONS +\****************/ + +/* +* Tx Descriptor +*/ +struct ath_tx_status { +u_int16_t ts_seqnum; +u_int16_t ts_tstamp; +u_int8_t ts_status; +u_int8_t ts_rate; +int8_t ts_rssi; +u_int8_t ts_shortretry; +u_int8_t ts_longretry; +u_int8_t ts_virtcol; +u_int8_t ts_antenna; +}; + +#define AR5K_TXSTAT_ALTRATE 0x80 +#define AR5K_TXERR_XRETRY 0x01 +#define AR5K_TXERR_FILT 0x02 +#define AR5K_TXERR_FIFO 0x04 + +/* +* Queue types used to classify tx queues. +*/ +typedef enum { +AR5K_TX_QUEUE_INACTIVE =0 ,/*This queue is not used -see ath_hal_releasetxqueue*/ +AR5K_TX_QUEUE_DATA ,/*A normal data queue*/ +AR5K_TX_QUEUE_XR_DATA ,/*An XR-data queue*/ +AR5K_TX_QUEUE_BEACON ,/*The beacon queue*/ +AR5K_TX_QUEUE_CAB ,/*The ater-beacon queue*/ +AR5K_TX_QUEUE_UAPSD ,/*Unscheduled Automatic Power Save Delivery queue*/ +}AR5K_TX_QUEUE ; + +#define AR5K_NUM_TX_QUEUES 10 + +/* +* Queue syb-types to classify normal data queues. +* These are the 4 Access Categories as defined in +* WME spec. 0 is the lowest priority and 4 is the +* highest. Normal data that hasn't been classified +* goes to the Best Effort AC. +*/ +typedef enum { +AR5K_WME_AC_BK =0 ,/*Background traffic*/ +AR5K_WME_AC_BE ,/*Best-effort (normal) traffic)*/ +AR5K_WME_AC_VI ,/*Video traffic*/ +AR5K_WME_AC_VO ,/*Voice traffic*/ +}AR5K_TX_QUEUE_SUBTYPE ; + +/* +* Queue ID numbers as returned by the HAL, each number +* represents a hw queue. If hw does not support hw queues +* (eg 5210/5211) all data goes in one queue. These match +* d80211 definitions (net80211/MadWiFi don't use them). +*/ +typedef enum { +AR5K_TX_QUEUE_ID_DATA_MIN =0 ,/*IEEE80211_TX_QUEUE_DATA0*/ +AR5K_TX_QUEUE_ID_DATA_MAX =4 ,/*IEEE80211_TX_QUEUE_DATA4*/ +AR5K_TX_QUEUE_ID_DATA_SVP =5 ,/*IEEE80211_TX_QUEUE_SVP - Spectralink Voice Protocol*/ +AR5K_TX_QUEUE_ID_CAB =6 ,/*IEEE80211_TX_QUEUE_AFTER_BEACON*/ +AR5K_TX_QUEUE_ID_BEACON =7 ,/*IEEE80211_TX_QUEUE_BEACON*/ +AR5K_TX_QUEUE_ID_UAPSD =8 , +AR5K_TX_QUEUE_ID_XR_DATA =9 , +}AR5K_TX_QUEUE_ID ; + + +/* +* Flags to set hw queue's parameters... +*/ +#define AR5K_TXQ_FLAG_TXINT_ENABLE 0x0001/* Enable TXOK and TXERR interrupts -not used- */ +#define AR5K_TXQ_FLAG_TXDESCINT_ENABLE 0x0002/* Enable TXDESC interrupt -not implemented- */ +#define AR5K_TXQ_FLAG_BACKOFF_DISABLE 0x0004/* Disable random post-backoff */ +#define AR5K_TXQ_FLAG_COMPRESSION_ENABLE 0x0008/* Enable hw compression -not implemented-*/ +#define AR5K_TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE 0x0010/* Enable ready time expiry policy (?)*/ +#define AR5K_TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE 0x0020/* Enable backoff while bursting */ +#define AR5K_TXQ_FLAG_POST_FR_BKOFF_DIS 0x0040/* Disable backoff while bursting */ +#define AR5K_TXQ_FLAG_TXEOLINT_ENABLE 0x0080/* Enable TXEOL interrupt -not implemented-*/ + +/* +* A struct to hold tx queue's parameters +*/ +typedef struct { +AR5K_TX_QUEUE tqi_type;/* See AR5K_TX_QUEUE */ +AR5K_TX_QUEUE_SUBTYPE tqi_subtype;/* See AR5K_TX_QUEUE_SUBTYPE */ +u_int16_t tqi_flags;/* Tx queue flags (see above) */ +u_int32_t tqi_aifs;/* Arbitrated Interframe Space */ +int32_t tqi_cw_min;/* Minimum Contention Window */ +int32_t tqi_cw_max;/* Maximum Contention Window */ +u_int32_t tqi_cbr_period;/* Constant bit rate period */ +u_int32_t tqi_cbr_overflow_limit; +u_int32_t tqi_burst_time; +u_int32_t tqi_ready_time;/* Not used */ +u_int32_t tqi_comp_buffer;/* Compression Buffer's phys addr */ +}AR5K_TXQ_INFO ; + +/* +* Transmit packet types. +* These are not fully used inside OpenHAL yet +*/ +typedef enum { +AR5K_PKT_TYPE_NORMAL =0 , +AR5K_PKT_TYPE_ATIM =1 , +AR5K_PKT_TYPE_PSPOLL =2 , +AR5K_PKT_TYPE_BEACON =3 , +AR5K_PKT_TYPE_PROBE_RESP =4 , +AR5K_PKT_TYPE_PIFS =5 , +}AR5K_PKT_TYPE ; + +/* +* TX power and TPC settings +*/ +#define AR5K_TXPOWER_OFDM (_r, _v) ( \ + ((0 & 1) << ((_v) + 6)) | \ + (((hal->ah_txpower.txp_rates[(_r)]) & 0x3f) << (_v)) \ +) + +#define AR5K_TXPOWER_CCK (_r, _v) ( \ + (hal->ah_txpower.txp_rates[(_r)] & 0x3f) << (_v) \ +) + +/* +* Used to compute TX times +*/ +#define AR5K_CCK_SIFS_TIME 10 +#define AR5K_CCK_PREAMBLE_BITS 144 +#define AR5K_CCK_PLCP_BITS 48 + +#define AR5K_OFDM_SIFS_TIME 16 +#define AR5K_OFDM_PREAMBLE_TIME 20 +#define AR5K_OFDM_PLCP_BITS 22 +#define AR5K_OFDM_SYMBOL_TIME 4 + +#define AR5K_TURBO_SIFS_TIME 8 +#define AR5K_TURBO_PREAMBLE_TIME 14 +#define AR5K_TURBO_PLCP_BITS 22 +#define AR5K_TURBO_SYMBOL_TIME 4 + +#define AR5K_XR_SIFS_TIME 16 +#define AR5K_XR_PLCP_BITS 22 +#define AR5K_XR_SYMBOL_TIME 4 + +/* CCK */ +#define AR5K_CCK_NUM_BITS (_frmlen) (_frmlen << 3) + +#define AR5K_CCK_PHY_TIME (_sp) (_sp ? \ + ((AR5K_CCK_PREAMBLE_BITS + AR5K_CCK_PLCP_BITS) >> 1) : \ + (AR5K_CCK_PREAMBLE_BITS + AR5K_CCK_PLCP_BITS)) + +#define AR5K_CCK_TX_TIME (_kbps, _frmlen, _sp) \ + AR5K_CCK_PHY_TIME(_sp) + \ + ((AR5K_CCK_NUM_BITS(_frmlen) * 1000) / _kbps) + \ + AR5K_CCK_SIFS_TIME + +/* OFDM */ +#define AR5K_OFDM_NUM_BITS (_frmlen) (AR5K_OFDM_PLCP_BITS + (_frmlen << 3)) + +#define AR5K_OFDM_NUM_BITS_PER_SYM (_kbps) ((_kbps * \ + AR5K_OFDM_SYMBOL_TIME) / 1000) + +#define AR5K_OFDM_NUM_BITS (_frmlen) (AR5K_OFDM_PLCP_BITS + (_frmlen << 3)) + +#define AR5K_OFDM_NUM_SYMBOLS (_kbps, _frmlen) \ + howmany(AR5K_OFDM_NUM_BITS(_frmlen), AR5K_OFDM_NUM_BITS_PER_SYM(_kbps)) + +#define AR5K_OFDM_TX_TIME (_kbps, _frmlen) \ + AR5K_OFDM_PREAMBLE_TIME + AR5K_OFDM_SIFS_TIME + \ + (AR5K_OFDM_NUM_SYMBOLS(_kbps, _frmlen) * AR5K_OFDM_SYMBOL_TIME) + +/* TURBO */ +#define AR5K_TURBO_NUM_BITS (_frmlen) (AR5K_TURBO_PLCP_BITS + (_frmlen << 3)) + +#define AR5K_TURBO_NUM_BITS_PER_SYM (_kbps) (((_kbps << 1) * \ + AR5K_TURBO_SYMBOL_TIME) / 1000) + +#define AR5K_TURBO_NUM_BITS (_frmlen) (AR5K_TURBO_PLCP_BITS + (_frmlen << 3)) + +#define AR5K_TURBO_NUM_SYMBOLS (_kbps, _frmlen) \ + howmany(AR5K_TURBO_NUM_BITS(_frmlen), \ + AR5K_TURBO_NUM_BITS_PER_SYM(_kbps)) + +#define AR5K_TURBO_TX_TIME (_kbps, _frmlen) \ + AR5K_TURBO_PREAMBLE_TIME + AR5K_TURBO_SIFS_TIME + \ + (AR5K_TURBO_NUM_SYMBOLS(_kbps, _frmlen) * AR5K_TURBO_SYMBOL_TIME) + +/* eXtendent Range (?)*/ +#define AR5K_XR_PREAMBLE_TIME (_kbps) (((_kbps) < 1000) ? 173 : 76) + +#define AR5K_XR_NUM_BITS_PER_SYM (_kbps) ((_kbps * \ + AR5K_XR_SYMBOL_TIME) / 1000) + +#define AR5K_XR_NUM_BITS (_frmlen) (AR5K_XR_PLCP_BITS + (_frmlen << 3)) + +#define AR5K_XR_NUM_SYMBOLS (_kbps, _frmlen) \ + howmany(AR5K_XR_NUM_BITS(_frmlen), AR5K_XR_NUM_BITS_PER_SYM(_kbps)) + +#define AR5K_XR_TX_TIME (_kbps, _frmlen) \ + AR5K_XR_PREAMBLE_TIME(_kbps) + AR5K_XR_SIFS_TIME + \ + (AR5K_XR_NUM_SYMBOLS(_kbps, _frmlen) * AR5K_XR_SYMBOL_TIME) + +/* +* DMA size definitions (2^n+2) +*/ +typedef enum { +AR5K_DMASIZE_4B =0 , +AR5K_DMASIZE_8B , +AR5K_DMASIZE_16B , +AR5K_DMASIZE_32B , +AR5K_DMASIZE_64B , +AR5K_DMASIZE_128B , +AR5K_DMASIZE_256B , +AR5K_DMASIZE_512B +}ath5k_dmasize_t ; + + + +/****************\ +RX DEFINITIONS +\****************/ + +/* +* Rx Descriptor +*/ +struct ath_rx_status { +u_int16_t rs_datalen; +u_int16_t rs_tstamp; +u_int8_t rs_status; +u_int8_t rs_phyerr; +int8_t rs_rssi; +u_int8_t rs_keyix; +u_int8_t rs_rate; +u_int8_t rs_antenna; +u_int8_t rs_more; +}; + +#define AR5K_RXERR_CRC 0x01 +#define AR5K_RXERR_PHY 0x02 +#define AR5K_RXERR_FIFO 0x04 +#define AR5K_RXERR_DECRYPT 0x08 +#define AR5K_RXERR_MIC 0x10 +#define AR5K_RXKEYIX_INVALID ((u_int8_t) - 1) +#define AR5K_TXKEYIX_INVALID ((u_int32_t) - 1) + +/* +* RX filters +* Most of them are not yet used inside OpenHAL +*/ +#define AR5K_RX_FILTER_UCAST 0x00000001/* Don't filter unicast frames */ +#define AR5K_RX_FILTER_MCAST 0x00000002/* Don't filter multicast frames */ +#define AR5K_RX_FILTER_BCAST 0x00000004/* Don't filter broadcast frames */ +#define AR5K_RX_FILTER_CONTROL 0x00000008/* Don't filter control frames */ +#define AR5K_RX_FILTER_BEACON 0x00000010/* Don't filter beacon frames */ +#define AR5K_RX_FILTER_PROM 0x00000020/* Set promiscuous mode */ +#define AR5K_RX_FILTER_XRPOLL 0x00000040/* Don't filter XR poll frame */ +#define AR5K_RX_FILTER_PROBEREQ 0x00000080/* Don't filter probe requests */ +#define AR5K_RX_FILTER_PHYERROR 0x00000100/* Don't filter phy errors */ +#define AR5K_RX_FILTER_PHYRADAR 0x00000200/* Don't filter phy radar errors*/ + +typedef struct { +u_int32_t ackrcv_bad; +u_int32_t rts_bad; +u_int32_t rts_good; +u_int32_t fcs_bad; +u_int32_t beacons; +}AR5K_MIB_STATS ; + + + + +/**************************\ +BEACON TIMERS DEFINITIONS +\**************************/ + +#define AR5K_BEACON_PERIOD 0x0000ffff +#define AR5K_BEACON_ENA 0x00800000/*enable beacon xmit*/ +#define AR5K_BEACON_RESET_TSF 0x01000000/*force a TSF reset*/ + +/* +* Per-station beacon timer state. +*/ +typedef struct { +u_int32_t bs_next_beacon; +u_int32_t bs_next_dtim; +u_int32_t bs_interval;/*in TU's -see net80211/ieee80211_var.h- +can also include the above flags*/ +u_int8_t bs_dtim_period; +u_int8_t bs_cfp_period; +u_int16_t bs_cfp_max_duration;/*if non-zero hw is setup to coexist with +a Point Coordination Function capable AP*/ +u_int16_t bs_cfp_du_remain; +u_int16_t bs_tim_offset; +u_int16_t bs_sleep_duration; +u_int16_t bs_bmiss_threshold; +u_int32_t bs_cfp_next; +}AR5K_BEACON_STATE ; + + + + +/********************\ +COMMON DEFINITIONS +\********************/ + +/* +* Atheros descriptor +*/ +struct ath_desc { +u_int32_t ds_link; +u_int32_t ds_data; +u_int32_t ds_ctl0; +u_int32_t ds_ctl1; +u_int32_t ds_hw[4 ]; + +union { +struct ath_rx_status rx; +struct ath_tx_status tx; + } ds_us; + +#define ds_rxstat ds_us.rx +#define ds_txstat ds_us.tx + +} __packed; + +#define AR5K_RXDESC_INTREQ 0x0020 + +#define AR5K_TXDESC_CLRDMASK 0x0001 +#define AR5K_TXDESC_NOACK 0x0002 +#define AR5K_TXDESC_RTSENA 0x0004 +#define AR5K_TXDESC_CTSENA 0x0008 +#define AR5K_TXDESC_INTREQ 0x0010 +#define AR5K_TXDESC_VEOL 0x0020 + +/* +* 802.11 operating modes... +*/ +#define AR5K_MODE_11A 0x01 +#define AR5K_MODE_11B 0x02 +#define AR5K_MODE_11G 0x04 +#define AR5K_MODE_TURBO 0x08 +#define AR5K_MODE_108G 0x16 +#define AR5K_MODE_XR 0x32 +#define AR5K_MODE_ALL (AR5K_MODE_11A| \ + AR5K_MODE_11B| \ + AR5K_MODE_11G| \ + AR5K_MODE_TURBO|\ + AR5K_MODE_108G| \ + AR5K_MODE_XR) + +/* +* Channel definitions +*/ +typedef struct { +u_int16_t freq;/* setting in Mhz */ +u_int16_t channel_flags; +u_int8_t private_flags;/* not used in OpenHAL yet*/ +}AR5K_CHANNEL ; + +#define AR5K_SLOT_TIME_9 396 +#define AR5K_SLOT_TIME_20 880 +#define AR5K_SLOT_TIME_MAX 0xffff + +/* channel_flags */ +#define CHANNEL_CW_INT 0x0008/* Contention Window interference detected */ +#define CHANNEL_TURBO 0x0010/* Turbo Channel */ +#define CHANNEL_CCK 0x0020/* CCK channel */ +#define CHANNEL_OFDM 0x0040/* OFDM channel */ +#define CHANNEL_2GHZ 0x0080/* 2GHz channel. */ +#define CHANNEL_5GHZ 0x0100/* 5GHz channel */ +#define CHANNEL_PASSIVE 0x0200/* Only passive scan allowed */ +#define CHANNEL_DYN 0x0400/* Dynamic CCK-OFDM channel (for g operation)*/ +#define CHANNEL_XR 0x0800/* XR channel */ + +#define CHANNEL_A (CHANNEL_5GHZ|CHANNEL_OFDM) +#define CHANNEL_B (CHANNEL_2GHZ|CHANNEL_CCK) +#define CHANNEL_PUREG (CHANNEL_2GHZ|CHANNEL_OFDM) +//#ifdef notdef +#define CHANNEL_G (CHANNEL_2GHZ|CHANNEL_DYN) +//#else +//#define CHANNEL_G (CHANNEL_2GHZ|CHANNEL_OFDM) +//#endif +#define CHANNEL_T (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_TURBO) +#define CHANNEL_TG (CHANNEL_2GHZ|CHANNEL_OFDM|CHANNEL_TURBO) +#define CHANNEL_108A CHANNEL_T +#define CHANNEL_108G CHANNEL_TG +#define CHANNEL_X (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_XR) + +#define CHANNEL_ALL (CHANNEL_OFDM|CHANNEL_CCK| CHANNEL_2GHZ |\ + CHANNEL_5GHZ | CHANNEL_TURBO) + +#define CHANNEL_ALL_NOTURBO (CHANNEL_ALL &~ CHANNEL_TURBO) +#define CHANNEL_MODES CHANNEL_ALL + +/* +* Used internaly in OpenHAL (ar5211.c/ar5212.c +* for reset_tx_queue). Also see struct AR5K_CHANNEL. +*/ +#define IS_CHAN_XR (_c) \ + ((_c.channel_flags & CHANNEL_XR) != 0) + +#define IS_CHAN_B (_c) \ + ((_c.channel_flags & CHANNEL_B) != 0) + +typedef enum { +AR5K_CHIP_5GHZ =CHANNEL_5GHZ , +AR5K_CHIP_2GHZ =CHANNEL_2GHZ , +}AR5K_CHIP ; + +/* +* The following structure will be used to map 2GHz channels to +* 5GHz Atheros channels. +*/ +struct ath5k_athchan_2ghz { +u_int32_t a2_flags; +u_int16_t a2_athchan; +}; + +/* +* Rate definitions +*/ + +#define AR5K_MAX_RATES 32/*max number of rates on the rate table*/ + +typedef struct { +u_int8_t valid;/* Valid for rate control */ +u_int32_t modulation; +u_int16_t rate_kbps; +u_int8_t rate_code;/* Rate mapping for h/w descriptors */ +u_int8_t dot11_rate; +u_int8_t control_rate; +u_int16_t lp_ack_duration;/* long preamble ACK duration */ +u_int16_t sp_ack_duration;/* short preamble ACK duration*/ +}AR5K_RATE ; + +typedef struct { +u_int16_t rate_count; +u_int8_t rate_code_to_index[AR5K_MAX_RATES ];/* Back-mapping */ +AR5K_RATE rates[AR5K_MAX_RATES ]; +}AR5K_RATE_TABLE ; + +/* +* Rate tables... +*/ +#define AR5K_RATES_11A { 8, { \ + 255, 255, 255, 255, 255, 255, 255, 255, 6, 4, 2, 0, \ + 7, 5, 3, 1, 255, 255, 255, 255, 255, 255, 255, 255, \ + 255, 255, 255, 255, 255, 255, 255, 255 }, { \ + { 1, MODULATION_OFDM, 6000, 11, 140, 0 }, \ + { 1, MODULATION_OFDM, 9000, 15, 18, 0 }, \ + { 1, MODULATION_OFDM, 12000, 10, 152, 2 }, \ + { 1, MODULATION_OFDM, 18000, 14, 36, 2 }, \ + { 1, MODULATION_OFDM, 24000, 9, 176, 4 }, \ + { 1, MODULATION_OFDM, 36000, 13, 72, 4 }, \ + { 1, MODULATION_OFDM, 48000, 8, 96, 4 }, \ + { 1, MODULATION_OFDM, 54000, 12, 108, 4 } } \ +} + +#define AR5K_RATES_11B { 4, { \ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, \ + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, \ + 3, 2, 1, 0, 255, 255, 255, 255 }, { \ + { 1, MODULATION_CCK, 1000, 27, 130, 0 }, \ + { 1, MODULATION_CCK, 2000, 26, 132, 1 }, \ + { 1, MODULATION_CCK, 5500, 25, 139, 1 }, \ + { 1, MODULATION_CCK, 11000, 24, 150, 1 } } \ +} + +#define AR5K_RATES_11G { 12, { \ + 255, 255, 255, 255, 255, 255, 255, 255, 10, 8, 6, 4, \ + 11, 9, 7, 5, 255, 255, 255, 255, 255, 255, 255, 255, \ + 3, 2, 1, 0, 255, 255, 255, 255 }, { \ + { 1, MODULATION_CCK, 1000, 27, 2, 0 }, \ + { 1, MODULATION_CCK, 2000, 26, 4, 1 }, \ + { 1, MODULATION_CCK, 5500, 25, 11, 1 }, \ + { 1, MODULATION_CCK, 11000, 24, 22, 1 }, \ + { 0, MODULATION_OFDM, 6000, 11, 12, 4 }, \ + { 0, MODULATION_OFDM, 9000, 15, 18, 4 }, \ + { 1, MODULATION_OFDM, 12000, 10, 24, 6 }, \ + { 1, MODULATION_OFDM, 18000, 14, 36, 6 }, \ + { 1, MODULATION_OFDM, 24000, 9, 48, 8 }, \ + { 1, MODULATION_OFDM, 36000, 13, 72, 8 }, \ + { 1, MODULATION_OFDM, 48000, 8, 96, 8 }, \ + { 1, MODULATION_OFDM, 54000, 12, 108, 8 } } \ +} + +#define AR5K_RATES_TURBO { 8, { \ + 255, 255, 255, 255, 255, 255, 255, 255, 6, 4, 2, 0, \ + 7, 5, 3, 1, 255, 255, 255, 255, 255, 255, 255, 255, \ + 255, 255, 255, 255, 255, 255, 255, 255 }, { \ + { 1, MODULATION_TURBO, 6000, 11, 140, 0 }, \ + { 1, MODULATION_TURBO, 9000, 15, 18, 0 }, \ + { 1, MODULATION_TURBO, 12000, 10, 152, 2 }, \ + { 1, MODULATION_TURBO, 18000, 14, 36, 2 }, \ + { 1, MODULATION_TURBO, 24000, 9, 176, 4 }, \ + { 1, MODULATION_TURBO, 36000, 13, 72, 4 }, \ + { 1, MODULATION_TURBO, 48000, 8, 96, 4 }, \ + { 1, MODULATION_TURBO, 54000, 12, 108, 4 } } \ +} + +#define AR5K_RATES_XR { 12, { \ + 255, 3, 1, 255, 255, 255, 2, 0, 10, 8, 6, 4, \ + 11, 9, 7, 5, 255, 255, 255, 255, 255, 255, 255, 255, \ + 255, 255, 255, 255, 255, 255, 255, 255 }, { \ + { 1, MODULATION_XR, 500, 7, 129, 0 }, \ + { 1, MODULATION_XR, 1000, 2, 139, 1 }, \ + { 1, MODULATION_XR, 2000, 6, 150, 2 }, \ + { 1, MODULATION_XR, 3000, 1, 150, 3 }, \ + { 1, MODULATION_OFDM, 6000, 11, 140, 4 }, \ + { 1, MODULATION_OFDM, 9000, 15, 18, 4 }, \ + { 1, MODULATION_OFDM, 12000, 10, 152, 6 }, \ + { 1, MODULATION_OFDM, 18000, 14, 36, 6 }, \ + { 1, MODULATION_OFDM, 24000, 9, 176, 8 }, \ + { 1, MODULATION_OFDM, 36000, 13, 72, 8 }, \ + { 1, MODULATION_OFDM, 48000, 8, 96, 8 }, \ + { 1, MODULATION_OFDM, 54000, 12, 108, 8 } } \ +} + +/* +* Crypto definitions +*/ + +/* key types */ +typedef enum { +AR5K_CIPHER_WEP =0 , +AR5K_CIPHER_AES_OCB =1 , +AR5K_CIPHER_AES_CCM =2 , +AR5K_CIPHER_CKIP =3 , +AR5K_CIPHER_TKIP =4 , +AR5K_CIPHER_CLR =5 ,/* no encryption */ +AR5K_CIPHER_MIC =127 /* used for Message +Integrity Code */ +}AR5K_CIPHER ; + +#define AR5K_KEYVAL_LENGTH_40 5 +#define AR5K_KEYVAL_LENGTH_104 13 +#define AR5K_KEYVAL_LENGTH_128 16 +#define AR5K_KEYVAL_LENGTH_MAX AR5K_KEYVAL_LENGTH_128 + +typedef struct { +int wk_len;/* key's length */ +u_int8_t wk_key[AR5K_KEYVAL_LENGTH_MAX ]; +u_int8_t wk_type;/* see above */ +u_int8_t wk_mic[8 ];/* TKIP MIC key */ +}AR5K_KEYVAL ; + + + +/***********************\ +HW RELATED DEFINITIONS +\***********************/ + +/* +* Misc definitions +*/ +#define AR5K_RSSI_EP_MULTIPLIER (1<<7) + +#define AR5K_ASSERT_ENTRY (_e, _s) do { \ + if (_e >= _s) \ + return (FALSE); \ +} while (0) + + +typedef struct { +u_int32_t ns_avgbrssi;/* average beacon rssi */ +u_int32_t ns_avgrssi;/* average data rssi */ +u_int32_t ns_avgtxrssi;/* average tx rssi */ +}AR5K_NODE_STATS ; + +typedef enum { +AR5K_ANT_VARIABLE =0 ,/* variable by programming */ +AR5K_ANT_FIXED_A =1 ,/* fixed to 11a frequencies */ +AR5K_ANT_FIXED_B =2 ,/* fixed to 11b frequencies */ +AR5K_ANT_MAX =3 , +}AR5K_ANT_SETTING ; + +/* +* HAL interrupt abstraction +*/ + +/* +* These are maped to take advantage of some common bits +* between the MAC chips, to be able to set intr properties +* easier. Some of them are not used yet inside OpenHAL. +*/ +typedef enum { +AR5K_INT_RX =0x00000001 , +AR5K_INT_RXDESC =0x00000002 , +AR5K_INT_RXNOFRM =0x00000008 , +AR5K_INT_RXEOL =0x00000010 , +AR5K_INT_RXORN =0x00000020 , +AR5K_INT_TX =0x00000040 , +AR5K_INT_TXDESC =0x00000080 , +AR5K_INT_TXURN =0x00000800 , +AR5K_INT_MIB =0x00001000 , +AR5K_INT_RXPHY =0x00004000 , +AR5K_INT_RXKCM =0x00008000 , +AR5K_INT_SWBA =0x00010000 , +AR5K_INT_BMISS =0x00040000 , +AR5K_INT_BNR =0x00100000 , +AR5K_INT_GPIO =0x01000000 , +AR5K_INT_FATAL =0x40000000 , +AR5K_INT_GLOBAL =0x80000000 , + +/*A sum of all the common bits*/ +AR5K_INT_COMMON =AR5K_INT_RXNOFRM + |AR5K_INT_RXDESC + |AR5K_INT_RXEOL + |AR5K_INT_RXORN + |AR5K_INT_TXURN + |AR5K_INT_TXDESC + |AR5K_INT_MIB + |AR5K_INT_RXPHY + |AR5K_INT_RXKCM + |AR5K_INT_SWBA + |AR5K_INT_BMISS + |AR5K_INT_GPIO , +AR5K_INT_NOCARD =0xffffffff /*Declare that the card +has been removed*/ +}AR5K_INT ; + +/* +* Power management +*/ +typedef enum { +AR5K_PM_UNDEFINED =0 , +AR5K_PM_AUTO , +AR5K_PM_AWAKE , +AR5K_PM_FULL_SLEEP , +AR5K_PM_NETWORK_SLEEP , +}AR5K_POWER_MODE ; + + +/* +* LED states +*/ +typedef int AR5K_LED_STATE ; + +/* +* These match net80211 definitions (not used in +* d80211). +*/ +#define AR5K_LED_INIT 0/*IEEE80211_S_INIT*/ +#define AR5K_LED_SCAN 1/*IEEE80211_S_SCAN*/ +#define AR5K_LED_AUTH 2/*IEEE80211_S_AUTH*/ +#define AR5K_LED_ASSOC 3/*IEEE80211_S_ASSOC*/ +#define AR5K_LED_RUN 4/*IEEE80211_S_RUN*/ + +/* GPIO-controlled software LED */ +#define AR5K_SOFTLED_PIN 0 +#define AR5K_SOFTLED_ON 0 +#define AR5K_SOFTLED_OFF 1 + +/* +* Chipset capabilities -see ath_hal_getcapability- +* get_capability function is not yet fully implemented +* in OpenHAL so most of these don't work yet... +*/ +typedef enum { +AR5K_CAP_REG_DMN =0 ,/* Used to get current reg. domain id */ +AR5K_CAP_CIPHER =1 ,/* Can handle encryption */ +AR5K_CAP_TKIP_MIC =2 ,/* Can handle TKIP MIC in hardware */ +AR5K_CAP_TKIP_SPLIT =3 ,/* TKIP uses split keys */ +AR5K_CAP_PHYCOUNTERS =4 ,/* PHY error counters */ +AR5K_CAP_DIVERSITY =5 ,/* Supports fast diversity */ +AR5K_CAP_NUM_TXQUEUES =6 ,/* Used to get max number of hw txqueues */ +AR5K_CAP_VEOL =7 ,/* Supports virtual EOL */ +AR5K_CAP_COMPRESSION =8 ,/* Supports compression */ +AR5K_CAP_BURST =9 ,/* Supports packet bursting */ +AR5K_CAP_FASTFRAME =10 ,/* Supports fast frames */ +AR5K_CAP_TXPOW =11 ,/* Used to get global tx power limit */ +AR5K_CAP_TPC =12 ,/* Can do per-packet tx power control (needed for 802.11a) */ +AR5K_CAP_BSSIDMASK =13 ,/* Supports bssid mask */ +AR5K_CAP_MCAST_KEYSRCH =14 ,/* Supports multicast key search */ +AR5K_CAP_TSF_ADJUST =15 ,/* Supports beacon tsf adjust */ +AR5K_CAP_XR =16 ,/* Supports XR mode */ +AR5K_CAP_WME_TKIPMIC =17 ,/* Supports TKIP MIC when using WMM */ +AR5K_CAP_CHAN_HALFRATE =18 ,/* Supports half rate channels */ +AR5K_CAP_CHAN_QUARTERRATE =19 ,/* Supports quarter rate channels */ +AR5K_CAP_RFSILENT =20 ,/* Supports RFsilent */ +}AR5K_CAPABILITY_TYPE ; + + +#endif /* _AR5K_H */
hw/ath5k_hw.h +1939 -0
1,939 lines not on this page · raw message
hw/ath5kreg.h +1878 -0
174 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.