#ifndef _DEV_IC_ANREG_H
#define _DEV_IC_ANREG_H
#define AN_IOSIZ 0x40
#define AN_COMMAND 0x00
#define AN_PARAM0 0x02
#define AN_PARAM1 0x04
#define AN_PARAM2 0x06
#define AN_STATUS 0x08
#define AN_RESP0 0x0A
#define AN_RESP1 0x0C
#define AN_RESP2 0x0E
#define AN_LINKSTAT 0x10
#define AN_CMD_BUSY 0x8000
#define AN_CMD_NO_ACK 0x0080
#define AN_CMD_CODE_MASK 0x003F
#define AN_CMD_QUAL_MASK 0x7F00
#define AN_CMD_NOOP 0x0000
#define AN_CMD_ENABLE 0x0001
#define AN_CMD_DISABLE 0x0002
#define AN_CMD_FORCE_SYNCLOSS 0x0003
#define AN_CMD_FW_RESTART 0x0004
#define AN_CMD_HOST_SLEEP 0x0005
#define AN_CMD_MAGIC_PKT 0x0006
#define AN_CMD_READCFG 0x0008
#define AN_CMD_SET_MODE 0x0009
#define AN_CMD_ALLOC_MEM 0x000A
#define AN_CMD_TX 0x000B
#define AN_CMD_DEALLOC_MEM 0x000C
#define AN_CMD_NOOP2 0x0010
#define AN_CMD_ACCESS 0x0021
#define AN_CMD_ALLOC_BUF 0x0028
#define AN_CMD_PSP_NODES 0x0030
#define AN_CMD_SET_PHYREG 0x003E
#define AN_CMD_TX_TEST 0x003F
#define AN_CMD_SLEEP 0x0085
#define AN_CMD_SAVECFG 0x0108
#define AN_RECLAIM 0x0100
#define AN_ACCESS_READ 0x0000
#define AN_ACCESS_WRITE 0x0100
#define AN_PROGRAM_DISABLE 0x0000
#define AN_PROGRAM_ENABLE_RAM 0x0100
#define AN_PROGRAM_ENABLE_NVRAM 0x0200
#define AN_PROGRAM_NVRAM 0x0300
#define AN_STAT_CMD_CODE 0x003F
#define AN_STAT_CMD_RESULT 0x7F00
#define AN_LINKSTAT_ASSOCIATED 0x0400
#define AN_LINKSTAT_AUTHFAIL 0x0300
#define AN_LINKSTAT_ASSOC_FAIL 0x8400
#define AN_LINKSTAT_DISASSOC 0x8200
#define AN_LINKSTAT_DEAUTH 0x8100
#define AN_LINKSTAT_SYNCLOST_TSF 0x8004
#define AN_LINKSTAT_SYNCLOST_HOSTREQ 0x8003
#define AN_LINKSTAT_SYNCLOST_AVGRETRY 0x8002
#define AN_LINKSTAT_SYNCLOST_MAXRETRY 0x8001
#define AN_LINKSTAT_SYNCLOST_MISSBEACON 0x8000
#define AN_RX_FID 0x20
#define AN_ALLOC_FID 0x22
#define AN_TX_CMP_FID 0x24
#define AN_SEL0 0x18
#define AN_SEL1 0x1A
#define AN_OFF0 0x1C
#define AN_OFF1 0x1E
#define AN_DATA0 0x36
#define AN_DATA1 0x38
#define AN_BAP0 AN_DATA0
#define AN_BAP1 AN_DATA1
#define AN_OFF_BUSY 0x8000
#define AN_OFF_ERR 0x4000
#define AN_OFF_DONE 0x2000
#define AN_OFF_DATAOFF 0x0FFF
#define AN_EVENT_STAT 0x30
#define AN_INT_EN 0x32
#define AN_EVENT_ACK 0x34
#define AN_EV_CLR_STUCK_BUSY 0x4000
#define AN_EV_WAKEREQUEST 0x2000
#define AN_EV_MIC 0x1000
#define AN_EV_TX_CPY 0x0400
#define AN_EV_AWAKE 0x0100
#define AN_EV_LINKSTAT 0x0080
#define AN_EV_CMD 0x0010
#define AN_EV_ALLOC 0x0008
#define AN_EV_TX_EXC 0x0004
#define AN_EV_TX 0x0002
#define AN_EV_RX 0x0001
#define AN_SW0 0x28
#define AN_SW1 0x2A
#define AN_SW2 0x2C
#define AN_SW3 0x2E
#define AN_CNTL 0x14
#define AN_CNTL_AUX_ENA 0xC000
#define AN_CNTL_AUX_ENA_STAT 0xC000
#define AN_CNTL_AUX_DIS_STAT 0x0000
#define AN_CNTL_AUX_ENA_CNTL 0x8000
#define AN_CNTL_AUX_DIS_CNTL 0x4000
#define AN_AUX_PAGE 0x3A
#define AN_AUX_OFFSET 0x3C
#define AN_AUX_DATA 0x3E
#define AN_RID_GENCONFIG 0xFF10
struct an_rid_genconfig {
u_int16_t an_opmode;
u_int16_t an_rxmode;
u_int16_t an_fragthresh;
u_int16_t an_rtsthresh;
u_int8_t an_macaddr[6];
u_int8_t an_rates[8];
u_int16_t an_shortretry_limit;
u_int16_t an_longretry_limit;
u_int16_t an_tx_msdu_lifetime;
u_int16_t an_rx_msdu_lifetime;
u_int16_t an_stationary;
u_int16_t an_ordering;
u_int16_t an_devtype;
u_int16_t an_rsvd0[5];
u_int16_t an_scanmode;
u_int16_t an_probedelay;
u_int16_t an_probe_energy_timeout;
u_int16_t an_probe_response_timeout;
u_int16_t an_beacon_listen_timeout;
u_int16_t an_ibss_join_net_timeout;
u_int16_t an_auth_timeout;
u_int16_t an_authtype;
u_int16_t an_assoc_timeout;
u_int16_t an_specified_ap_timeout;
u_int16_t an_offline_scan_interval;
u_int16_t an_offline_scan_duration;
u_int16_t an_link_loss_delay;
u_int16_t an_max_beacon_lost_time;
u_int16_t an_refresh_interval;
u_int16_t an_rsvd1;
u_int16_t an_psave_mode;
u_int16_t an_sleep_for_dtims;
u_int16_t an_listen_interval;
u_int16_t an_fast_listen_interval;
u_int16_t an_listen_decay;
u_int16_t an_fast_listen_decay;
u_int16_t an_rsvd2[2];
u_int16_t an_beacon_period;
u_int16_t an_atim_duration;
u_int16_t an_rsvd3;
u_int16_t an_ds_channel;
u_int16_t an_rsvd4;
u_int16_t an_dtim_period;
u_int16_t an_rsvd5[2];
u_int16_t an_radiotype;
u_int16_t an_diversity;
u_int16_t an_tx_power;
u_int16_t an_rss_thresh;
u_int16_t an_modulation_type;
u_int16_t an_short_preamble;
u_int16_t an_home_product;
u_int16_t an_rsvd6;
u_int8_t an_nodename[16];
u_int16_t an_arl_thresh;
u_int16_t an_arl_decay;
u_int16_t an_arl_delay;
u_int8_t an_rsvd7;
u_int8_t an_rsvd8;
u_int8_t an_magic_packet_action;
u_int8_t an_magic_packet_ctl;
u_int16_t an_rsvd9;
u_int16_t an_spare[24];
} __packed;
#define AN_OPMODE_IBSS_ADHOC 0x0000
#define AN_OPMODE_INFRASTRUCTURE_STATION 0x0001
#define AN_OPMODE_AP 0x0002
#define AN_OPMODE_AP_REPEATER 0x0003
#define AN_OPMODE_UNMODIFIED_PAYLOAD 0x0100
#define AN_OPMODE_AIRONET_EXTENSIONS 0x0200
#define AN_OPMODE_AP_EXTENSIONS 0x0400
#define AN_OPMODE_ANTENNA_ALIGN 0x0800
#define AN_OPMODE_ETHER_LLC 0x1000
#define AN_OPMODE_LEAF_NODE 0x2000
#define AN_OPMODE_CF_POLLABLE 0x4000
#define AN_OPMODE_MIC 0x8000
#define AN_RXMODE_BC_MC_ADDR 0x0000
#define AN_RXMODE_BC_ADDR 0x0001
#define AN_RXMODE_ADDR 0x0002
#define AN_RXMODE_80211_MONITOR_CURBSS 0x0003
#define AN_RXMODE_80211_MONITOR_ANYBSS 0x0004
#define AN_RXMODE_LAN_MONITOR_CURBSS 0x0005
#define AN_RXMODE_NO_8023_HEADER 0x0100
#define AN_RXMODE_NORMALIZED_RSSI 0x0200
#define AN_RATE_1MBPS 0x0002
#define AN_RATE_2MBPS 0x0004
#define AN_RATE_5_5MBPS 0x000B
#define AN_RATE_11MBPS 0x0016
#define AN_DEVTYPE_PC4500 0x0065
#define AN_DEVTYPE_PC4800 0x006D
#define AN_SCANMODE_ACTIVE 0x0000
#define AN_SCANMODE_PASSIVE 0x0001
#define AN_SCANMODE_AIRONET_ACTIVE 0x0002
#define AN_AUTHTYPE_NONE 0x0000
#define AN_AUTHTYPE_OPEN 0x0001
#define AN_AUTHTYPE_SHAREDKEY 0x0002
#define AN_AUTHTYPE_MASK 0x00ff
#define AN_AUTHTYPE_PRIVACY_IN_USE 0x0100
#define AN_AUTHTYPE_ALLOW_UNENCRYPTED 0x0200
#define AN_AUTHTYPE_LEAP 0x1000
#define AN_PSAVE_CAM 0x0000
#define AN_PSAVE_PSP 0x0001
#define AN_PSAVE_PSP_CAM 0x0002
#define AN_RADIOTYPE_80211_FH 0x0001
#define AN_RADIOTYPE_80211_DS 0x0002
#define AN_RADIOTYPE_LM2000_DS 0x0004
#define AN_DIVERSITY_FACTORY_DEFAULT 0x0000
#define AN_DIVERSITY_ANTENNA_1_ONLY 0x0001
#define AN_DIVERSITY_ANTENNA_2_ONLY 0x0002
#define AN_DIVERSITY_ANTENNA_1_AND_2 0x0003
#define AN_TXPOWER_FACTORY_DEFAULT 0x0000
#define AN_TXPOWER_50MW 50
#define AN_TXPOWER_100MW 100
#define AN_TXPOWER_250MW 250
#define AN_RID_SSIDLIST 0xFF11
struct an_rid_ssidlist {
struct an_rid_ssid_entry {
u_int16_t an_ssid_len;
char an_ssid[32];
} __packed an_entry[3];
} __packed;
#define AN_RID_APLIST 0xFF12
struct an_rid_aplist {
u_int8_t an_ap1[8];
u_int8_t an_ap2[8];
u_int8_t an_ap3[8];
u_int8_t an_ap4[8];
} __packed;
#define AN_RID_DRVNAME 0xFF13
struct an_rid_drvname {
u_int8_t an_drvname[16];
} __packed;
#define AN_RID_ENCAP 0xFF14
#define AN_ENCAP_NENTS 8
struct an_rid_encap {
struct an_rid_encap_entry {
u_int16_t an_ethertype;
u_int16_t an_action;
} __packed an_entry[AN_ENCAP_NENTS];
} __packed;
#define AN_ENCAP_ACTION_RX 0x0001
#define AN_ENCAP_ACTION_TX 0x0002
#define AN_RXENCAP_NONE 0x0000
#define AN_RXENCAP_RFC1024 0x0001
#define AN_TXENCAP_RFC1024 0x0000
#define AN_TXENCAP_80211 0x0002
#define AN_RID_ACTUALCFG 0xFF20
#define AN_RID_CAPABILITIES 0xFF00
struct an_rid_caps {
u_int8_t an_oui[3];
u_int8_t an_rsvd0;
u_int16_t an_prodnum;
u_int8_t an_manufname[32];
u_int8_t an_prodname[16];
u_int8_t an_prodvers[8];
u_int8_t an_oemaddr[6];
u_int8_t an_aironetaddr[6];
u_int16_t an_radiotype;
u_int16_t an_regdomain;
u_int8_t an_callid[6];
u_int8_t an_rates[8];
u_int8_t an_rx_diversity;
u_int8_t an_tx_diversity;
u_int16_t an_tx_powerlevels[8];
u_int16_t an_hwrev;
u_int16_t an_hwcaps;
u_int16_t an_temprange;
u_int16_t an_fwrev;
u_int16_t an_fwsubrev;
u_int16_t an_ifacerev;
u_int16_t an_softcaps;
u_int16_t an_bootblockrev;
u_int16_t an_req_hw_support;
u_int16_t an_ext_softcaps;
u_int16_t an_spare[34];
} __packed;
#define AN_REGDOMAIN_USA 0
#define AN_REGDOMAIN_EUROPE 1
#define AN_REGDOMAIN_JAPAN 2
#define AN_REGDOMAIN_SPAIN 3
#define AN_REGDOMAIN_FRANCE 4
#define AN_REGDOMAIN_BELGIUM 5
#define AN_REGDOMAIN_ISRAEL 6
#define AN_REGDOMAIN_CANADA 7
#define AN_REGDOMAIN_AUSTRALIA 8
#define AN_REGDOMAIN_JAPANWIDE 9
#define AN_SOFTCAPS_WEP 0x0002
#define AN_SOFTCAPS_RSSIMAP 0x0008
#define AN_SOFTCAPS_WEP128 0x0100
#define AN_EXT_SOFTCAPS_MIC 0x0001
#define AN_RID_APINFO 0xFF01
struct an_rid_apinfo {
u_int16_t an_tim_addr;
u_int16_t an_airo_addr;
} __packed;
#define AN_RID_RADIOINFO 0xFF02
#define AN_RID_STATUS 0xFF50
struct an_rid_status {
u_int8_t an_macaddr[6];
u_int16_t an_opmode;
u_int16_t an_errcode;
u_int16_t an_cur_signal_strength;
u_int16_t an_ssidlen;
u_int8_t an_ssid[32];
u_int8_t an_ap_name[16];
u_int8_t an_cur_bssid[6];
u_int8_t an_prev_bssid1[6];
u_int8_t an_prev_bssid2[6];
u_int8_t an_prev_bssid3[6];
u_int16_t an_beacon_period;
u_int16_t an_dtim_period;
u_int16_t an_atim_duration;
u_int16_t an_hop_period;
u_int16_t an_cur_channel;
u_int16_t an_channel_set;
u_int16_t an_hops_to_backbone;
u_int16_t an_ap_total_load;
u_int16_t an_our_generated_load;
u_int16_t an_accumulated_arl;
u_int16_t an_cur_signal_quality;
u_int16_t an_current_tx_rate;
u_int16_t an_ap_device;
u_int16_t an_normalized_rssi;
u_int16_t an_short_pre_in_use;
u_int8_t an_ap_ip_addr[4];
u_int16_t an_max_noise_prev_sec;
u_int16_t an_avg_noise_prev_min;
u_int16_t an_max_noise_prev_min;
u_int16_t an_spare[11];
} __packed;
#define AN_STATUS_OPMODE_CONFIGURED 0x0001
#define AN_STATUS_OPMODE_MAC_ENABLED 0x0002
#define AN_STATUS_OPMODE_RX_ENABLED 0x0004
#define AN_STATUS_OPMODE_IN_SYNC 0x0010
#define AN_STATUS_OPMODE_ASSOCIATED 0x0020
#define AN_STATUS_OPMODE_ERROR 0x8000
#define AN_RID_16BITS_CUM 0xFF60
#define AN_RID_16BITS_DELTA 0xFF61
#define AN_RID_16BITS_DELTACLR 0xFF62
#define AN_RID_32BITS_CUM 0xFF68
#define AN_RID_32BITS_DELTA 0xFF69
#define AN_RID_32BITS_DELTACLR 0xFF6A
struct an_rid_stats {
u_int16_t an_spacer;
u_int32_t an_rx_overruns;
u_int32_t an_rx_plcp_csum_errs;
u_int32_t an_rx_plcp_format_errs;
u_int32_t an_rx_plcp_len_errs;
u_int32_t an_rx_mac_crc_errs;
u_int32_t an_rx_mac_crc_ok;
u_int32_t an_rx_wep_errs;
u_int32_t an_rx_wep_ok;
u_int32_t an_retry_long;
u_int32_t an_retry_short;
u_int32_t an_retry_max;
u_int32_t an_no_ack;
u_int32_t an_no_cts;
u_int32_t an_rx_ack_ok;
u_int32_t an_rx_cts_ok;
u_int32_t an_tx_ack_ok;
u_int32_t an_tx_rts_ok;
u_int32_t an_tx_cts_ok;
u_int32_t an_tx_lmac_mcasts;
u_int32_t an_tx_lmac_bcasts;
u_int32_t an_tx_lmac_ucast_frags;
u_int32_t an_tx_lmac_ucasts;
u_int32_t an_tx_beacons;
u_int32_t an_rx_beacons;
u_int32_t an_tx_single_cols;
u_int32_t an_tx_multi_cols;
u_int32_t an_tx_defers_no;
u_int32_t an_tx_defers_prot;
u_int32_t an_tx_defers_energy;
u_int32_t an_rx_dups;
u_int32_t an_rx_partial;
u_int32_t an_tx_too_old;
u_int32_t an_rx_too_old;
u_int32_t an_lostsync_max_retries;
u_int32_t an_lostsync_missed_beacons;
u_int32_t an_lostsync_arl_exceeded;
u_int32_t an_lostsync_deauthed;
u_int32_t an_lostsync_disassociated;
u_int32_t an_lostsync_tsf_timing;
u_int32_t an_tx_host_mcasts;
u_int32_t an_tx_host_bcasts;
u_int32_t an_tx_host_ucasts;
u_int32_t an_tx_host_failed;
u_int32_t an_rx_host_mcasts;
u_int32_t an_rx_host_bcasts;
u_int32_t an_rx_host_ucasts;
u_int32_t an_rx_host_discarded;
u_int32_t an_tx_hmac_mcasts;
u_int32_t an_tx_hmac_bcasts;
u_int32_t an_tx_hmac_ucasts;
u_int32_t an_tx_hmac_failed;
u_int32_t an_rx_hmac_mcasts;
u_int32_t an_rx_hmac_bcasts;
u_int32_t an_rx_hmac_ucasts;
u_int32_t an_rx_hmac_discarded;
u_int32_t an_tx_hmac_accepted;
u_int32_t an_ssid_mismatches;
u_int32_t an_ap_mismatches;
u_int32_t an_rates_mismatches;
u_int32_t an_auth_rejects;
u_int32_t an_auth_timeouts;
u_int32_t an_assoc_rejects;
u_int32_t an_assoc_timeouts;
u_int32_t an_reason_outside_table;
u_int32_t an_reason1;
u_int32_t an_reason2;
u_int32_t an_reason3;
u_int32_t an_reason4;
u_int32_t an_reason5;
u_int32_t an_reason6;
u_int32_t an_reason7;
u_int32_t an_reason8;
u_int32_t an_reason9;
u_int32_t an_reason10;
u_int32_t an_reason11;
u_int32_t an_reason12;
u_int32_t an_reason13;
u_int32_t an_reason14;
u_int32_t an_reason15;
u_int32_t an_reason16;
u_int32_t an_reason17;
u_int32_t an_reason18;
u_int32_t an_reason19;
u_int32_t an_rx_mgmt_pkts;
u_int32_t an_tx_mgmt_pkts;
u_int32_t an_rx_refresh_pkts;
u_int32_t an_tx_refresh_pkts;
u_int32_t an_rx_poll_pkts;
u_int32_t an_tx_poll_pkts;
u_int32_t an_host_retries;
u_int32_t an_lostsync_hostreq;
u_int32_t an_host_tx_bytes;
u_int32_t an_host_rx_bytes;
u_int32_t an_uptime_usecs;
u_int32_t an_uptime_secs;
u_int32_t an_lostsync_better_ap;
u_int32_t an_rsvd[10];
} __packed;
#define AN_RID_WEP_VOLATILE 0xFF15
struct an_rid_wepkey {
u_int16_t an_key_index;
u_int8_t an_mac_addr[6];
u_int16_t an_key_len;
u_int8_t an_key[16];
} __packed;
#define AN_RID_WEP_PERSISTENT 0xFF16
#define AN_RID_LEAP_USER 0xFF23
#define AN_RID_LEAP_PASS 0xFF24
struct an_rid_leapkey {
u_int16_t an_key_len;
u_int8_t an_key[32];
} __packed;
#define AN_RID_MIC 0xFF57
struct an_rid_mic {
u_int16_t an_mic_state;
u_int16_t an_mic_mcast_valid;
u_int8_t an_mic_mcast[16];
u_int16_t an_mic_ucast_valid;
u_int8_t an_mic_ucast[16];
} __packed;
struct an_rxframe {
u_int32_t an_rx_time;
u_int16_t an_rx_status;
u_int16_t an_rx_payload_len;
u_int8_t an_rsvd0;
u_int8_t an_rx_signal_strength;
u_int8_t an_rx_rate;
u_int8_t an_rx_chan;
u_int8_t an_rx_assoc_cnt;
u_int8_t an_rsvd1[3];
u_int8_t an_plcp_hdr[4];
struct ieee80211_frame_addr4 an_whdr;
u_int16_t an_gaplen;
} __packed;
#define AN_RXGAP_MAX 8
struct an_txframe {
u_int32_t an_tx_sw;
u_int16_t an_tx_status;
u_int16_t an_tx_payload_len;
u_int16_t an_tx_ctl;
u_int16_t an_tx_assoc_id;
u_int16_t an_tx_retry;
u_int8_t an_tx_assoc_cnt;
u_int8_t an_tx_rate;
u_int8_t an_tx_max_long_retries;
u_int8_t an_tx_max_short_retries;
u_int8_t an_rsvd0[2];
struct ieee80211_frame_addr4 an_whdr;
u_int16_t an_gaplen;
} __packed;
#define AN_TXGAP_802_3 0
#define AN_TXGAP_802_11 6
struct an_802_3_hdr {
u_int16_t an_802_3_status;
u_int16_t an_802_3_payload_len;
u_int8_t an_dst_addr[6];
u_int8_t an_src_addr[6];
} __packed;
#define AN_TXSTAT_EXCESS_RETRY 0x0002
#define AN_TXSTAT_LIFE_EXCEEDED 0x0004
#define AN_TXSTAT_AID_FAIL 0x0008
#define AN_TXSTAT_MAC_DISABLED 0x0010
#define AN_TXSTAT_ASSOC_LOST 0x0020
#define AN_TXCTL_RSVD 0x0001
#define AN_TXCTL_TXOK_INTR 0x0002
#define AN_TXCTL_TXERR_INTR 0x0004
#define AN_TXCTL_HEADER_TYPE 0x0008
#define AN_TXCTL_PAYLOAD_TYPE 0x0010
#define AN_TXCTL_NORELEASE 0x0020
#define AN_TXCTL_NORETRIES 0x0040
#define AN_TXCTL_CLEAR_AID 0x0080
#define AN_TXCTL_STRICT_ORDER 0x0100
#define AN_TXCTL_USE_RTS 0x0200
#define AN_HEADERTYPE_8023 0x0000
#define AN_HEADERTYPE_80211 0x0008
#define AN_PAYLOADTYPE_ETHER 0x0000
#define AN_PAYLOADTYPE_LLC 0x0010
#define AN_TXCTL_80211 \
(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_80211| \
AN_PAYLOADTYPE_LLC|AN_TXCTL_NORELEASE)
#define AN_TXCTL_8023 \
(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023| \
AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
#define AN_STAT_BADCRC 0x0001
#define AN_STAT_UNDECRYPTABLE 0x0002
#define AN_STAT_ERRSTAT 0x0003
#define AN_STAT_MAC_PORT 0x0700
#define AN_STAT_1042 0x2000
#define AN_STAT_TUNNEL 0x4000
#define AN_STAT_WMP_MSG 0x6000
#define AN_RXSTAT_MSG_TYPE 0xE000
#define AN_ENC_TX_802_3 0x00
#define AN_ENC_TX_802_11 0x11
#define AN_ENC_TX_E_II 0x0E
#define AN_ENC_TX_1042 0x00
#define AN_ENC_TX_TUNNEL 0xF8
#define AN_TXCNTL_MACPORT 0x00FF
#define AN_TXCNTL_STRUCTTYPE 0xFF00
#endif