an: Remove driver
Last an(4) devices have been End Of Life and End Of Sale in 2007. Time to remove this driver. Differential Revision: https://reviews.freebsd.org/D30679 Reviewed by: imp (earlier version), emaste (earlier version) Sponsored by: Diablotin Systems
This commit is contained in:
parent
ab30bb8270
commit
663b174b5b
@ -40,6 +40,11 @@
|
||||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20210607: remove an(4)
|
||||
OLD_FILES+=usr/include/dev/an/if_aironet_ieee.h
|
||||
OLD_FILES+=usr/include/dev/an/if_anreg.h
|
||||
OLD_FILES+=usr/share/man/man4/an.4.gz
|
||||
|
||||
# 20210426: remove unused libexec/rc.d/addswap
|
||||
OLD_FILES+=etc/rc.d/addswap
|
||||
|
||||
|
@ -41,7 +41,7 @@ LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \
|
||||
LDIRS= geom net net80211 netgraph netinet netinet6 \
|
||||
netipsec netsmb nfs nfsclient nfsserver sys vm
|
||||
|
||||
LSUBDIRS= dev/acpica dev/agp dev/an dev/ciss dev/filemon dev/firewire \
|
||||
LSUBDIRS= dev/acpica dev/agp dev/ciss dev/filemon dev/firewire \
|
||||
dev/hwpmc dev/hyperv \
|
||||
dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \
|
||||
dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \
|
||||
|
@ -1,142 +0,0 @@
|
||||
.\" Copyright (c) 1997, 1998, 1999
|
||||
.\" Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the following acknowledgement:
|
||||
.\" This product includes software developed by Bill Paul.
|
||||
.\" 4. Neither the name of the author nor the names of any co-contributors
|
||||
.\" may be used to endorse or promote products derived from this software
|
||||
.\" without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
|
||||
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
.\" THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd July 16, 2005
|
||||
.Dt AN 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm an
|
||||
.Nd "Aironet Communications 4500/4800 wireless network adapter driver"
|
||||
.Sh SYNOPSIS
|
||||
To compile this driver into the kernel,
|
||||
place the following lines in your
|
||||
kernel configuration file:
|
||||
.Bd -ragged -offset indent
|
||||
.Cd "device an"
|
||||
.Cd "device wlan"
|
||||
.Ed
|
||||
.Pp
|
||||
Alternatively, to load the driver as a
|
||||
module at boot time, place the following line in
|
||||
.Xr loader.conf 5 :
|
||||
.Bd -literal -offset indent
|
||||
if_an_load="YES"
|
||||
.Ed
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
driver provides support for Aironet Communications 4500 and 4800
|
||||
wireless network adapters and variants, including the following:
|
||||
.Pp
|
||||
.Bl -bullet -compact -offset indent
|
||||
.It
|
||||
Aironet Communications 4500 and 4800 series
|
||||
.It
|
||||
Cisco Aironet 340 and 350 series
|
||||
.El
|
||||
.Pp
|
||||
Support for these devices include the ISA and PCI
|
||||
varieties.
|
||||
The Aironet 4500 series adapters operate at 1 and 2Mbps while
|
||||
the Aironet 4800 series and Cisco adapters can operate at 1, 2, 5.5 and 11Mbps.
|
||||
The ISA and PCI
|
||||
devices are all based on the same core PCMCIA hardware
|
||||
and all have the same programming interface.
|
||||
The ISA and PCI cards appear to the
|
||||
host as normal ISA and PCI devices.
|
||||
.Pp
|
||||
ISA cards can either be configured to use ISA Plug and Play
|
||||
or to use a particular I/O address and IRQ
|
||||
by properly setting the DIP switches on the board.
|
||||
(The default
|
||||
switch setting is for Plug and Play.)
|
||||
The
|
||||
.Nm
|
||||
driver has Plug and Play support and will work in either configuration,
|
||||
however when using a hard-wired I/O address and IRQ, the driver
|
||||
configuration and the NIC's switch settings must agree.
|
||||
PCI cards
|
||||
require no switch settings of any kind and will be automatically
|
||||
probed and attached.
|
||||
.Pp
|
||||
All host/device interaction with the Aironet cards is via programmed I/O.
|
||||
The Aironet devices support 802.11 and 802.3 frames, power management,
|
||||
BSS (infrastructure) and IBSS (ad-hoc) operation modes.
|
||||
The
|
||||
.Nm
|
||||
driver encapsulates all IP and ARP traffic as 802.11 frames, however
|
||||
it can receive either 802.11 or 802.3 frames.
|
||||
Transmit speed is
|
||||
selectable between 1Mbps, 2Mbps, 5.5Mbps, 11Mbps or
|
||||
"auto" (the NIC automatically chooses the best speed).
|
||||
.Pp
|
||||
By default, the
|
||||
.Nm
|
||||
driver configures the Aironet card for infrastructure operation.
|
||||
.Pp
|
||||
For more information on configuring this device, see
|
||||
.Xr ifconfig 8 .
|
||||
.Sh DIAGNOSTICS
|
||||
.Bl -diag
|
||||
.It "an%d: init failed"
|
||||
The Aironet card failed to become ready after an initialization command was
|
||||
issued.
|
||||
.It "an%d: failed to allocate %d bytes on NIC"
|
||||
The driver was unable to allocate memory for transmit frames in the
|
||||
NIC's on-board RAM.
|
||||
.It "an%d: device timeout"
|
||||
The Aironet card failed to generate an interrupt to acknowledge a transmit
|
||||
command.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr altq 4 ,
|
||||
.Xr arp 4 ,
|
||||
.Xr miibus 4 ,
|
||||
.Xr netintro 4 ,
|
||||
.Xr wlan 4 ,
|
||||
.Xr ancontrol 8 ,
|
||||
.Xr ifconfig 8
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
device driver first appeared in
|
||||
.Fx 4.0 .
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
device driver was removed in
|
||||
.Fx 14.0 .
|
||||
.Sh AUTHORS
|
||||
The
|
||||
.Nm
|
||||
driver was written by
|
||||
.An Bill Paul Aq Mt wpaul@ee.columbia.edu .
|
@ -916,9 +916,6 @@ dev/amr/amr_cam.c optional amrp amr
|
||||
dev/amr/amr_disk.c optional amr
|
||||
dev/amr/amr_linux.c optional amr compat_linux
|
||||
dev/amr/amr_pci.c optional amr pci
|
||||
dev/an/if_an.c optional an
|
||||
dev/an/if_an_isa.c optional an isa
|
||||
dev/an/if_an_pci.c optional an pci
|
||||
#
|
||||
dev/ata/ata_if.m optional ata | atacore
|
||||
dev/ata/ata-all.c optional ata | atacore
|
||||
|
@ -1,798 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1997, 1998, 1999
|
||||
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Bill Paul.
|
||||
* 4. Neither the name of the author nor the names of any co-contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _IF_AIRONET_IEEE_H
|
||||
#define _IF_AIRONET_IEEE_H
|
||||
|
||||
/*
|
||||
* This header defines a simple command interface to the FreeBSD
|
||||
* Aironet driver (an) driver, which is used to set certain
|
||||
* device-specific parameters which can't be easily managed through
|
||||
* ifconfig(8). No, sysctl(2) is not the answer. I said a _simple_
|
||||
* interface, didn't I.
|
||||
*/
|
||||
|
||||
#ifndef SIOCSAIRONET
|
||||
#define SIOCSAIRONET SIOCSIFGENERIC
|
||||
#endif
|
||||
|
||||
#ifndef SIOCGAIRONET
|
||||
#define SIOCGAIRONET SIOCGIFGENERIC
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is a make-predend RID value used only by the driver
|
||||
* to allow the user to set the speed.
|
||||
*/
|
||||
#define AN_RID_TX_SPEED 0x1234
|
||||
|
||||
/*
|
||||
* Technically I don't think there's a limit to a record
|
||||
* length. The largest record is the one that contains the CIS
|
||||
* data, which is 240 words long, so 256 should be a safe
|
||||
* value.
|
||||
*/
|
||||
#define AN_MAX_DATALEN 4096
|
||||
|
||||
struct an_req {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
u_int16_t an_val[AN_MAX_DATALEN];
|
||||
};
|
||||
|
||||
/*
|
||||
* Private LTV records (interpreted only by the driver). This is
|
||||
* a minor kludge to allow reading the interface statistics from
|
||||
* the driver.
|
||||
*/
|
||||
#define AN_RID_IFACE_STATS 0x0100
|
||||
#define AN_RID_MGMT_XMIT 0x0200
|
||||
#ifdef ANCACHE
|
||||
#define AN_RID_ZERO_CACHE 0x0300
|
||||
#define AN_RID_READ_CACHE 0x0400
|
||||
#endif
|
||||
|
||||
#define AN_FCTL_VERS 0x0002
|
||||
#define AN_FCTL_FTYPE 0x000C
|
||||
#define AN_FCTL_STYPE 0x00F0
|
||||
#define AN_FCTL_TODS 0x0100
|
||||
#define AN_FCTL_FROMDS 0x0200
|
||||
#define AN_FCTL_MOREFRAGS 0x0400
|
||||
#define AN_FCTL_RETRY 0x0800
|
||||
#define AN_FCTL_PM 0x1000
|
||||
#define AN_FCTL_MOREDATA 0x2000
|
||||
#define AN_FCTL_WEP 0x4000
|
||||
#define AN_FCTL_ORDER 0x8000
|
||||
|
||||
#define AN_FTYPE_MGMT 0x0000
|
||||
#define AN_FTYPE_CTL 0x0004
|
||||
#define AN_FTYPE_DATA 0x0008
|
||||
|
||||
#define AN_STYPE_MGMT_ASREQ 0x0000 /* association request */
|
||||
#define AN_STYPE_MGMT_ASRESP 0x0010 /* association response */
|
||||
#define AN_STYPE_MGMT_REASREQ 0x0020 /* reassociation request */
|
||||
#define AN_STYPE_MGMT_REASRESP 0x0030 /* reassociation response */
|
||||
#define AN_STYPE_MGMT_PROBEREQ 0x0040 /* probe request */
|
||||
#define AN_STYPE_MGMT_PROBERESP 0x0050 /* probe response */
|
||||
#define AN_STYPE_MGMT_BEACON 0x0080 /* beacon */
|
||||
#define AN_STYPE_MGMT_ATIM 0x0090 /* announcement traffic ind msg */
|
||||
#define AN_STYPE_MGMT_DISAS 0x00A0 /* disassociation */
|
||||
#define AN_STYPE_MGMT_AUTH 0x00B0 /* authentication */
|
||||
#define AN_STYPE_MGMT_DEAUTH 0x00C0 /* deauthentication */
|
||||
|
||||
/*
|
||||
* Aironet IEEE signal strength cache
|
||||
*
|
||||
* driver keeps cache of last
|
||||
* MAXANCACHE packets to arrive including signal strength info.
|
||||
* daemons may read this via ioctl
|
||||
*
|
||||
* Each entry in the wi_sigcache has a unique macsrc.
|
||||
*/
|
||||
#ifdef ANCACHE
|
||||
#define MAXANCACHE 10
|
||||
|
||||
struct an_sigcache {
|
||||
char macsrc[6]; /* unique MAC address for entry */
|
||||
int ipsrc; /* ip address associated with packet */
|
||||
int signal; /* signal strength of the packet */
|
||||
int noise; /* noise value */
|
||||
int quality; /* quality of the packet */
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The card provides an 8-bit signal strength value (RSSI), which can
|
||||
* be converted to a dBm power value (or a percent) using a table in
|
||||
* the card's firmware (when available). The tables are slightly
|
||||
* different in individual cards, even of the same model. If the
|
||||
* table is not available, the mapping can be approximated by dBm =
|
||||
* RSSI - 100. This approximation can be seen by plotting a few
|
||||
* tables, and also matches some info on the Intersil web site (I
|
||||
* think they make the RF front end for the cards. However, the linux
|
||||
* driver uses the approximation dBm = RSSI/2 - 95. I think that is
|
||||
* just wrong.
|
||||
*/
|
||||
|
||||
struct an_rssi_entry {
|
||||
u_int8_t an_rss_pct;
|
||||
u_int8_t an_rss_dbm;
|
||||
};
|
||||
|
||||
struct an_ltv_key {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
u_int16_t kindex;
|
||||
u_int8_t mac[6];
|
||||
u_int16_t klen;
|
||||
u_int8_t key[16]; /* 128-bit keys */
|
||||
};
|
||||
|
||||
struct an_ltv_stats {
|
||||
u_int16_t an_fudge;
|
||||
u_int16_t an_len; /* 0x00 */
|
||||
u_int16_t an_type; /* 0xXX */
|
||||
u_int16_t an_spacer; /* 0x02 */
|
||||
u_int32_t an_rx_overruns; /* 0x04 */
|
||||
u_int32_t an_rx_plcp_csum_errs; /* 0x08 */
|
||||
u_int32_t an_rx_plcp_format_errs; /* 0x0C */
|
||||
u_int32_t an_rx_plcp_len_errs; /* 0x10 */
|
||||
u_int32_t an_rx_mac_crc_errs; /* 0x14 */
|
||||
u_int32_t an_rx_mac_crc_ok; /* 0x18 */
|
||||
u_int32_t an_rx_wep_errs; /* 0x1C */
|
||||
u_int32_t an_rx_wep_ok; /* 0x20 */
|
||||
u_int32_t an_retry_long; /* 0x24 */
|
||||
u_int32_t an_retry_short; /* 0x28 */
|
||||
u_int32_t an_retry_max; /* 0x2C */
|
||||
u_int32_t an_no_ack; /* 0x30 */
|
||||
u_int32_t an_no_cts; /* 0x34 */
|
||||
u_int32_t an_rx_ack_ok; /* 0x38 */
|
||||
u_int32_t an_rx_cts_ok; /* 0x3C */
|
||||
u_int32_t an_tx_ack_ok; /* 0x40 */
|
||||
u_int32_t an_tx_rts_ok; /* 0x44 */
|
||||
u_int32_t an_tx_cts_ok; /* 0x48 */
|
||||
u_int32_t an_tx_lmac_mcasts; /* 0x4C */
|
||||
u_int32_t an_tx_lmac_bcasts; /* 0x50 */
|
||||
u_int32_t an_tx_lmac_ucast_frags; /* 0x54 */
|
||||
u_int32_t an_tx_lmac_ucasts; /* 0x58 */
|
||||
u_int32_t an_tx_beacons; /* 0x5C */
|
||||
u_int32_t an_rx_beacons; /* 0x60 */
|
||||
u_int32_t an_tx_single_cols; /* 0x64 */
|
||||
u_int32_t an_tx_multi_cols; /* 0x68 */
|
||||
u_int32_t an_tx_defers_no; /* 0x6C */
|
||||
u_int32_t an_tx_defers_prot; /* 0x70 */
|
||||
u_int32_t an_tx_defers_energy; /* 0x74 */
|
||||
u_int32_t an_rx_dups; /* 0x78 */
|
||||
u_int32_t an_rx_partial; /* 0x7C */
|
||||
u_int32_t an_tx_too_old; /* 0x80 */
|
||||
u_int32_t an_rx_too_old; /* 0x84 */
|
||||
u_int32_t an_lostsync_max_retries;/* 0x88 */
|
||||
u_int32_t an_lostsync_missed_beacons;/* 0x8C */
|
||||
u_int32_t an_lostsync_arl_exceeded;/*0x90 */
|
||||
u_int32_t an_lostsync_deauthed; /* 0x94 */
|
||||
u_int32_t an_lostsync_disassociated;/*0x98 */
|
||||
u_int32_t an_lostsync_tsf_timing; /* 0x9C */
|
||||
u_int32_t an_tx_host_mcasts; /* 0xA0 */
|
||||
u_int32_t an_tx_host_bcasts; /* 0xA4 */
|
||||
u_int32_t an_tx_host_ucasts; /* 0xA8 */
|
||||
u_int32_t an_tx_host_failed; /* 0xAC */
|
||||
u_int32_t an_rx_host_mcasts; /* 0xB0 */
|
||||
u_int32_t an_rx_host_bcasts; /* 0xB4 */
|
||||
u_int32_t an_rx_host_ucasts; /* 0xB8 */
|
||||
u_int32_t an_rx_host_discarded; /* 0xBC */
|
||||
u_int32_t an_tx_hmac_mcasts; /* 0xC0 */
|
||||
u_int32_t an_tx_hmac_bcasts; /* 0xC4 */
|
||||
u_int32_t an_tx_hmac_ucasts; /* 0xC8 */
|
||||
u_int32_t an_tx_hmac_failed; /* 0xCC */
|
||||
u_int32_t an_rx_hmac_mcasts; /* 0xD0 */
|
||||
u_int32_t an_rx_hmac_bcasts; /* 0xD4 */
|
||||
u_int32_t an_rx_hmac_ucasts; /* 0xD8 */
|
||||
u_int32_t an_rx_hmac_discarded; /* 0xDC */
|
||||
u_int32_t an_tx_hmac_accepted; /* 0xE0 */
|
||||
u_int32_t an_ssid_mismatches; /* 0xE4 */
|
||||
u_int32_t an_ap_mismatches; /* 0xE8 */
|
||||
u_int32_t an_rates_mismatches; /* 0xEC */
|
||||
u_int32_t an_auth_rejects; /* 0xF0 */
|
||||
u_int32_t an_auth_timeouts; /* 0xF4 */
|
||||
u_int32_t an_assoc_rejects; /* 0xF8 */
|
||||
u_int32_t an_assoc_timeouts; /* 0xFC */
|
||||
u_int32_t an_reason_outside_table;/* 0x100 */
|
||||
u_int32_t an_reason1; /* 0x104 */
|
||||
u_int32_t an_reason2; /* 0x108 */
|
||||
u_int32_t an_reason3; /* 0x10C */
|
||||
u_int32_t an_reason4; /* 0x110 */
|
||||
u_int32_t an_reason5; /* 0x114 */
|
||||
u_int32_t an_reason6; /* 0x118 */
|
||||
u_int32_t an_reason7; /* 0x11C */
|
||||
u_int32_t an_reason8; /* 0x120 */
|
||||
u_int32_t an_reason9; /* 0x124 */
|
||||
u_int32_t an_reason10; /* 0x128 */
|
||||
u_int32_t an_reason11; /* 0x12C */
|
||||
u_int32_t an_reason12; /* 0x130 */
|
||||
u_int32_t an_reason13; /* 0x134 */
|
||||
u_int32_t an_reason14; /* 0x138 */
|
||||
u_int32_t an_reason15; /* 0x13C */
|
||||
u_int32_t an_reason16; /* 0x140 */
|
||||
u_int32_t an_reason17; /* 0x144 */
|
||||
u_int32_t an_reason18; /* 0x148 */
|
||||
u_int32_t an_reason19; /* 0x14C */
|
||||
u_int32_t an_rx_mgmt_pkts; /* 0x150 */
|
||||
u_int32_t an_tx_mgmt_pkts; /* 0x154 */
|
||||
u_int32_t an_rx_refresh_pkts; /* 0x158 */
|
||||
u_int32_t an_tx_refresh_pkts; /* 0x15C */
|
||||
u_int32_t an_rx_poll_pkts; /* 0x160 */
|
||||
u_int32_t an_tx_poll_pkts; /* 0x164 */
|
||||
u_int32_t an_host_retries; /* 0x168 */
|
||||
u_int32_t an_lostsync_hostreq; /* 0x16C */
|
||||
u_int32_t an_host_tx_bytes; /* 0x170 */
|
||||
u_int32_t an_host_rx_bytes; /* 0x174 */
|
||||
u_int32_t an_uptime_usecs; /* 0x178 */
|
||||
u_int32_t an_uptime_secs; /* 0x17C */
|
||||
u_int32_t an_lostsync_better_ap; /* 0x180 */
|
||||
u_int32_t an_rsvd[15];
|
||||
};
|
||||
|
||||
/*
|
||||
* General configuration information.
|
||||
*/
|
||||
struct an_ltv_genconfig {
|
||||
/* General configuration. */
|
||||
u_int16_t an_len; /* 0x00 */
|
||||
u_int16_t an_type; /* XXXX */
|
||||
u_int16_t an_opmode; /* 0x02 */
|
||||
u_int16_t an_rxmode; /* 0x04 */
|
||||
u_int16_t an_fragthresh; /* 0x06 */
|
||||
u_int16_t an_rtsthresh; /* 0x08 */
|
||||
u_int8_t an_macaddr[6]; /* 0x0A */
|
||||
u_int8_t an_rates[8]; /* 0x10 */
|
||||
u_int16_t an_shortretry_limit; /* 0x18 */
|
||||
u_int16_t an_longretry_limit; /* 0x1A */
|
||||
u_int16_t an_tx_msdu_lifetime; /* 0x1C */
|
||||
u_int16_t an_rx_msdu_lifetime; /* 0x1E */
|
||||
u_int16_t an_stationary; /* 0x20 */
|
||||
u_int16_t an_ordering; /* 0x22 */
|
||||
u_int16_t an_devtype; /* 0x24 */
|
||||
u_int16_t an_rsvd0[5]; /* 0x26 */
|
||||
/* Scanning associating. */
|
||||
u_int16_t an_scanmode; /* 0x30 */
|
||||
u_int16_t an_probedelay; /* 0x32 */
|
||||
u_int16_t an_probe_energy_timeout;/* 0x34 */
|
||||
u_int16_t an_probe_response_timeout;/*0x36 */
|
||||
u_int16_t an_beacon_listen_timeout;/*0x38 */
|
||||
u_int16_t an_ibss_join_net_timeout;/*0x3A */
|
||||
u_int16_t an_auth_timeout; /* 0x3C */
|
||||
u_int16_t an_authtype; /* 0x3E */
|
||||
u_int16_t an_assoc_timeout; /* 0x40 */
|
||||
u_int16_t an_specified_ap_timeout;/* 0x42 */
|
||||
u_int16_t an_offline_scan_interval;/*0x44 */
|
||||
u_int16_t an_offline_scan_duration;/*0x46 */
|
||||
u_int16_t an_link_loss_delay; /* 0x48 */
|
||||
u_int16_t an_max_beacon_lost_time;/* 0x4A */
|
||||
u_int16_t an_refresh_interval; /* 0x4C */
|
||||
u_int16_t an_rsvd1; /* 0x4E */
|
||||
/* Power save operation */
|
||||
u_int16_t an_psave_mode; /* 0x50 */
|
||||
u_int16_t an_sleep_for_dtims; /* 0x52 */
|
||||
u_int16_t an_listen_interval; /* 0x54 */
|
||||
u_int16_t an_fast_listen_interval;/* 0x56 */
|
||||
u_int16_t an_listen_decay; /* 0x58 */
|
||||
u_int16_t an_fast_listen_decay; /* 0x5A */
|
||||
u_int16_t an_rsvd2[2]; /* 0x5C */
|
||||
/* Ad-hoc (or AP) operation. */
|
||||
u_int16_t an_beacon_period; /* 0x60 */
|
||||
u_int16_t an_atim_duration; /* 0x62 */
|
||||
u_int16_t an_rsvd3; /* 0x64 */
|
||||
u_int16_t an_ds_channel; /* 0x66 */
|
||||
u_int16_t an_rsvd4; /* 0x68 */
|
||||
u_int16_t an_dtim_period; /* 0x6A */
|
||||
u_int16_t an_rsvd5[2]; /* 0x6C */
|
||||
/* Radio operation. */
|
||||
u_int16_t an_radiotype; /* 0x70 */
|
||||
u_int16_t an_diversity; /* 0x72 */
|
||||
u_int16_t an_tx_power; /* 0x74 */
|
||||
u_int16_t an_rss_thresh; /* 0x76 */
|
||||
u_int16_t an_modulation_type; /* 0x78 */
|
||||
u_int16_t an_short_preamble; /* 0x7A */
|
||||
u_int16_t an_home_product; /* 0x7C */
|
||||
u_int16_t an_rsvd6; /* 0x7E */
|
||||
/* Aironet extensions. */
|
||||
u_int8_t an_nodename[16]; /* 0x80 */
|
||||
u_int16_t an_arl_thresh; /* 0x90 */
|
||||
u_int16_t an_arl_decay; /* 0x92 */
|
||||
u_int16_t an_arl_delay; /* 0x94 */
|
||||
u_int8_t an_rsvd7; /* 0x96 */
|
||||
u_int8_t an_rsvd8; /* 0x97 */
|
||||
u_int8_t an_magic_packet_action; /* 0x98 */
|
||||
u_int8_t an_magic_packet_ctl; /* 0x99 */
|
||||
u_int16_t an_rsvd9;
|
||||
u_int16_t an_spare[19];
|
||||
};
|
||||
|
||||
#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_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_ENABLE 0x0100
|
||||
#define AN_AUTHTYPE_PRIVACY_IN_USE 0x0100
|
||||
#define AN_AUTHTYPE_ALLOW_UNENCRYPTED 0x0200
|
||||
#define AN_AUTHTYPE_LEAP 0x1000
|
||||
|
||||
#define AN_PSAVE_NONE 0x0000
|
||||
#define AN_PSAVE_CAM 0x0001
|
||||
#define AN_PSAVE_PSP 0x0002
|
||||
#define AN_PSAVE_PSP_CAM 0x0003
|
||||
|
||||
#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_HOME_NETWORK 0x0001
|
||||
#define AN_HOME_INSTALL_AP 0x0002
|
||||
|
||||
/*
|
||||
* Valid SSID list. You can specify up to three SSIDs denoting
|
||||
* the service sets that you want to join. The first SSID always
|
||||
* defaults to "tsunami" which is a handy way to detect the
|
||||
* card.
|
||||
*/
|
||||
|
||||
struct an_ltv_ssidlist {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
u_int16_t an_ssid1_len;
|
||||
char an_ssid1[32];
|
||||
u_int16_t an_ssid2_len;
|
||||
char an_ssid2[32];
|
||||
u_int16_t an_ssid3_len;
|
||||
char an_ssid3[32];
|
||||
};
|
||||
|
||||
struct an_ltv_ssid_entry{
|
||||
u_int16_t an_len;
|
||||
char an_ssid[32];
|
||||
};
|
||||
|
||||
#define MAX_SSIDS 25
|
||||
struct an_ltv_ssidlist_new {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
struct an_ltv_ssid_entry an_entry[MAX_SSIDS];
|
||||
};
|
||||
|
||||
/*
|
||||
* Valid AP list.
|
||||
*/
|
||||
struct an_ltv_aplist {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
u_int8_t an_ap1[8];
|
||||
u_int8_t an_ap2[8];
|
||||
u_int8_t an_ap3[8];
|
||||
u_int8_t an_ap4[8];
|
||||
};
|
||||
|
||||
/*
|
||||
* Driver name.
|
||||
*/
|
||||
struct an_ltv_drvname {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
u_int8_t an_drvname[16];
|
||||
};
|
||||
|
||||
/*
|
||||
* Frame encapsulation.
|
||||
*/
|
||||
struct an_rid_encap {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
u_int16_t an_ethertype_default;
|
||||
u_int16_t an_action_default;
|
||||
u_int16_t an_ethertype0;
|
||||
u_int16_t an_action0;
|
||||
u_int16_t an_ethertype1;
|
||||
u_int16_t an_action1;
|
||||
u_int16_t an_ethertype2;
|
||||
u_int16_t an_action2;
|
||||
u_int16_t an_ethertype3;
|
||||
u_int16_t an_action3;
|
||||
u_int16_t an_ethertype4;
|
||||
u_int16_t an_action4;
|
||||
u_int16_t an_ethertype5;
|
||||
u_int16_t an_action5;
|
||||
u_int16_t an_ethertype6;
|
||||
u_int16_t an_action6;
|
||||
};
|
||||
|
||||
#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
|
||||
|
||||
/*
|
||||
* Card capabilities (read only).
|
||||
*/
|
||||
struct an_ltv_caps {
|
||||
u_int16_t an_len; /* 0x00 */
|
||||
u_int16_t an_type; /* XXXX */
|
||||
u_int8_t an_oui[3]; /* 0x02 */
|
||||
u_int8_t an_rsvd0; /* 0x05 */
|
||||
u_int16_t an_prodnum; /* 0x06 */
|
||||
u_int8_t an_manufname[32]; /* 0x08 */
|
||||
u_int8_t an_prodname[16]; /* 0x28 */
|
||||
u_int8_t an_prodvers[8]; /* 0x38 */
|
||||
u_int8_t an_oemaddr[6]; /* 0x40 */
|
||||
u_int8_t an_aironetaddr[6]; /* 0x46 */
|
||||
u_int16_t an_radiotype; /* 0x4C */
|
||||
u_int16_t an_regdomain; /* 0x4E */
|
||||
u_int8_t an_callid[6]; /* 0x50 */
|
||||
u_int8_t an_rates[8]; /* 0x56 */
|
||||
u_int8_t an_rx_diversity; /* 0x5E */
|
||||
u_int8_t an_tx_diversity; /* 0x5F */
|
||||
u_int16_t an_tx_powerlevels[8]; /* 0x60 */
|
||||
u_int16_t an_hwrev; /* 0x70 */
|
||||
u_int16_t an_hwcaps; /* 0x72 */
|
||||
u_int16_t an_temprange; /* 0x74 */
|
||||
u_int16_t an_fwrev; /* 0x76 */
|
||||
u_int16_t an_fwsubrev; /* 0x78 */
|
||||
u_int16_t an_ifacerev; /* 0x7A */
|
||||
u_int16_t an_softcaps; /* 0x7C */
|
||||
u_int16_t an_bootblockrev; /* 0x7E */
|
||||
u_int16_t an_req_hw_support; /* 0x80 */
|
||||
u_int16_t an_unknown[31]; /* 0x82 */
|
||||
};
|
||||
|
||||
/*
|
||||
* Access point (read only)
|
||||
*/
|
||||
struct an_ltv_apinfo {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
u_int16_t an_tim_addr;
|
||||
u_int16_t an_airo_addr;
|
||||
};
|
||||
|
||||
/*
|
||||
* Radio info (read only).
|
||||
*/
|
||||
struct an_ltv_radioinfo {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
/* ??? */
|
||||
};
|
||||
|
||||
/*
|
||||
* RSSI map. If available in the card's firmware, this can be used to
|
||||
* convert the 8-bit RSSI values from the card into dBm.
|
||||
*/
|
||||
struct an_ltv_rssi_map {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
struct an_rssi_entry an_entries[256];
|
||||
};
|
||||
|
||||
/*
|
||||
* Status (read only). Note: the manual claims this RID is 108 bytes
|
||||
* long (0x6A is the last datum, which is 2 bytes long) however when
|
||||
* this RID is read from the NIC, it returns a length of 110. To be
|
||||
* on the safe side, this structure is padded with an extra 16-bit
|
||||
* word. (There is a misprint in the manual which says the macaddr
|
||||
* field is 8 bytes long.)
|
||||
*
|
||||
* Also, the channel_set and current_channel fields appear to be
|
||||
* reversed. Either that, or the hop_period field is unused.
|
||||
*/
|
||||
struct an_ltv_status {
|
||||
u_int16_t an_len; /* 0x00 */
|
||||
u_int16_t an_type; /* 0xXX */
|
||||
u_int8_t an_macaddr[6]; /* 0x02 */
|
||||
u_int16_t an_opmode; /* 0x08 */
|
||||
u_int16_t an_errcode; /* 0x0A */
|
||||
u_int16_t an_signal_quality; /* 0x0C */
|
||||
u_int16_t an_ssidlen; /* 0x0E */
|
||||
u_int8_t an_ssid[32]; /* 0x10 */
|
||||
u_int8_t an_ap_name[16]; /* 0x30 */
|
||||
u_int8_t an_cur_bssid[6]; /* 0x40 */
|
||||
u_int8_t an_prev_bssid1[6]; /* 0x46 */
|
||||
u_int8_t an_prev_bssid2[6]; /* 0x4C */
|
||||
u_int8_t an_prev_bssid3[6]; /* 0x52 */
|
||||
u_int16_t an_beacon_period; /* 0x58 */
|
||||
u_int16_t an_dtim_period; /* 0x5A */
|
||||
u_int16_t an_atim_duration; /* 0x5C */
|
||||
u_int16_t an_hop_period; /* 0x5E */
|
||||
u_int16_t an_cur_channel; /* 0x62 */
|
||||
u_int16_t an_channel_set; /* 0x60 */
|
||||
u_int16_t an_hops_to_backbone; /* 0x64 */
|
||||
u_int16_t an_ap_total_load; /* 0x66 */
|
||||
u_int16_t an_our_generated_load; /* 0x68 */
|
||||
u_int16_t an_accumulated_arl; /* 0x6A */
|
||||
u_int16_t an_cur_signal_quality; /* 0x6C */
|
||||
u_int16_t an_current_tx_rate; /* 0x6E */
|
||||
u_int16_t an_ap_device; /* 0x70 */
|
||||
u_int16_t an_normalized_strength; /* 0x72 */
|
||||
u_int16_t an_short_pre_in_use; /* 0x74 */
|
||||
u_int8_t an_ap_ip_addr[4]; /* 0x76 */
|
||||
u_int8_t an_noise_prev_sec_pc; /* 0x7A */
|
||||
u_int8_t an_noise_prev_sec_db; /* 0x7B */
|
||||
u_int8_t an_avg_noise_prev_min_pc; /* 0x7C */
|
||||
u_int8_t an_avg_noise_prev_min_db; /* 0x7D */
|
||||
u_int8_t an_max_noise_prev_min_pc; /* 0x7E */
|
||||
u_int8_t an_max_noise_prev_min_db; /* 0x7F */
|
||||
u_int16_t an_spare[18];
|
||||
};
|
||||
|
||||
#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_LEAP 0x0040
|
||||
#define AN_STATUS_OPMODE_ERROR 0x8000
|
||||
|
||||
/*
|
||||
* WEP Key
|
||||
*/
|
||||
struct an_ltv_wepkey {
|
||||
u_int16_t an_len; /* 0x00 */
|
||||
u_int16_t an_type; /* 0xXX */
|
||||
u_int16_t an_key_index; /* 0x02 */
|
||||
u_int8_t an_mac_addr[6]; /* 0x04 */
|
||||
u_int16_t an_key_len; /* 0x0A */
|
||||
u_int8_t an_key[13]; /* 0x0C */
|
||||
};
|
||||
|
||||
/*
|
||||
* Receive frame structure.
|
||||
*/
|
||||
struct an_rxframe {
|
||||
u_int32_t an_rx_time; /* 0x00 */
|
||||
u_int16_t an_rx_status; /* 0x04 */
|
||||
u_int16_t an_rx_payload_len; /* 0x06 */
|
||||
u_int8_t an_rsvd0; /* 0x08 */
|
||||
u_int8_t an_rx_signal_strength; /* 0x09 */
|
||||
u_int8_t an_rx_rate; /* 0x0A */
|
||||
u_int8_t an_rx_chan; /* 0x0B */
|
||||
u_int8_t an_rx_assoc_cnt; /* 0x0C */
|
||||
u_int8_t an_rsvd1[3]; /* 0x0D */
|
||||
u_int8_t an_plcp_hdr[4]; /* 0x10 */
|
||||
u_int16_t an_frame_ctl; /* 0x14 */
|
||||
u_int16_t an_duration; /* 0x16 */
|
||||
u_int8_t an_addr1[6]; /* 0x18 */
|
||||
u_int8_t an_addr2[6]; /* 0x1E */
|
||||
u_int8_t an_addr3[6]; /* 0x24 */
|
||||
u_int16_t an_seq_ctl; /* 0x2A */
|
||||
u_int8_t an_addr4[6]; /* 0x2C */
|
||||
u_int8_t an_gaplen; /* 0x32 */
|
||||
} __packed;
|
||||
|
||||
/* Do not modify this unless you are modifying LEAP itself */
|
||||
#define LEAP_USERNAME_MAX 32
|
||||
#define LEAP_PASSWORD_MAX 32
|
||||
|
||||
/*
|
||||
* LEAP Username
|
||||
*/
|
||||
struct an_ltv_leap_username {
|
||||
u_int16_t an_len; /* 0x00 */
|
||||
u_int16_t an_type; /* 0xXX */
|
||||
u_int16_t an_username_len; /* 0x02 */
|
||||
u_int8_t an_username[LEAP_USERNAME_MAX]; /* 0x04 */
|
||||
};
|
||||
|
||||
/*
|
||||
* LEAP Password
|
||||
*/
|
||||
struct an_ltv_leap_password {
|
||||
u_int16_t an_len; /* 0x00 */
|
||||
u_int16_t an_type; /* 0xXX */
|
||||
u_int16_t an_password_len; /* 0x02 */
|
||||
u_int8_t an_password[LEAP_PASSWORD_MAX]; /* 0x04 */
|
||||
};
|
||||
|
||||
/*
|
||||
* These are all the LTV record types that we can read or write
|
||||
* from the Aironet. Not all of them are temendously useful, but I
|
||||
* list as many as I know about here for completeness.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Configuration (read/write)
|
||||
*/
|
||||
#define AN_RID_GENCONFIG 0xFF10 /* General configuration info */
|
||||
#define AN_RID_SSIDLIST 0xFF11 /* Valid SSID list */
|
||||
#define AN_RID_APLIST 0xFF12 /* Valid AP list */
|
||||
#define AN_RID_DRVNAME 0xFF13 /* ID name of this node for diag */
|
||||
#define AN_RID_ENCAPPROTO 0xFF14 /* Payload encapsulation type */
|
||||
#define AN_RID_WEP_TEMP 0xFF15 /* Temporary Key */
|
||||
#define AN_RID_WEP_PERM 0xFF16 /* Perminant Key */
|
||||
#define AN_RID_ACTUALCFG 0xFF20 /* Current configuration settings */
|
||||
|
||||
/*
|
||||
* Reporting (read only)
|
||||
*/
|
||||
#define AN_RID_CAPABILITIES 0xFF00 /* PC 4500/4800 capabilities */
|
||||
#define AN_RID_AP_INFO 0xFF01 /* Access point info */
|
||||
#define AN_RID_RADIO_INFO 0xFF02 /* Radio info */
|
||||
#define AN_RID_RSSI_MAP 0xFF04 /* RSSI <-> dBm table */
|
||||
#define AN_RID_STATUS 0xFF50 /* Current status info */
|
||||
#define AN_RID_BEACONS_HST 0xFF51
|
||||
#define AN_RID_BUSY_HST 0xFF52
|
||||
#define AN_RID_RETRIES_HST 0xFF53
|
||||
|
||||
/*
|
||||
* Statistics
|
||||
*/
|
||||
#define AN_RID_16BITS_CUM 0xFF60 /* Cumulative 16-bit stats counters */
|
||||
#define AN_RID_16BITS_DELTA 0xFF61 /* 16-bit stats (since last clear) */
|
||||
#define AN_RID_16BITS_DELTACLR 0xFF62 /* 16-bit stats, clear on read */
|
||||
#define AN_RID_32BITS_CUM 0xFF68 /* Cumulative 32-bit stats counters */
|
||||
#define AN_RID_32BITS_DELTA 0xFF69 /* 32-bit stats (since last clear) */
|
||||
#define AN_RID_32BITS_DELTACLR 0xFF6A /* 32-bit stats, clear on read */
|
||||
|
||||
/*
|
||||
* LEAP
|
||||
*/
|
||||
|
||||
#define AN_RID_LEAPUSERNAME 0xFF23 /* Username */
|
||||
#define AN_RID_LEAPPASSWORD 0xFF24 /* Password */
|
||||
|
||||
/*
|
||||
* OTHER Unknonwn for now
|
||||
*/
|
||||
|
||||
#define AN_RID_MOD 0xFF17
|
||||
#define AN_RID_OPTIONS 0xFF18
|
||||
#define AN_RID_FACTORY_CONFIG 0xFF18
|
||||
|
||||
/*
|
||||
* FreeBSD fake RID
|
||||
*/
|
||||
|
||||
#define AN_RID_MONITOR_MODE 0x0001 /* Set monitor mode for driver */
|
||||
#define AN_MONITOR 1
|
||||
#define AN_MONITOR_ANY_BSS 2
|
||||
#define AN_MONITOR_INCLUDE_BEACON 4
|
||||
#define AN_MONITOR_AIRONET_HEADER 8
|
||||
|
||||
#define DLT_AIRONET_HEADER 120 /* Has been allocated at tcpdump.org */
|
||||
|
||||
/*
|
||||
* from the Linux driver from Cisco ... no copyright header.
|
||||
* Removed duplicated information that already existed in the FreeBSD driver
|
||||
* provides emulation of the Cisco extensions to the Linux Aironet driver.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Ioctl constants to be used in airo_ioctl.command
|
||||
*/
|
||||
|
||||
#define AIROGCAP 0 /* Capability rid */
|
||||
#define AIROGCFG 1 /* USED A LOT */
|
||||
#define AIROGSLIST 2 /* System ID list */
|
||||
#define AIROGVLIST 3 /* List of specified AP's */
|
||||
#define AIROGDRVNAM 4 /* NOTUSED */
|
||||
#define AIROGEHTENC 5 /* NOTUSED */
|
||||
#define AIROGWEPKTMP 6
|
||||
#define AIROGWEPKNV 7
|
||||
#define AIROGSTAT 8
|
||||
#define AIROGSTATSC32 9
|
||||
#define AIROGSTATSD32 10
|
||||
|
||||
/*
|
||||
* Leave gap of 40 commands after AIROGSTATSD32
|
||||
*/
|
||||
|
||||
#define AIROPCAP AIROGSTATSD32 + 40
|
||||
#define AIROPVLIST AIROPCAP + 1
|
||||
#define AIROPSLIST AIROPVLIST + 1
|
||||
#define AIROPCFG AIROPSLIST + 1
|
||||
#define AIROPSIDS AIROPCFG + 1
|
||||
#define AIROPAPLIST AIROPSIDS + 1
|
||||
#define AIROPMACON AIROPAPLIST + 1 /* Enable mac */
|
||||
#define AIROPMACOFF AIROPMACON + 1 /* Disable mac */
|
||||
#define AIROPSTCLR AIROPMACOFF + 1
|
||||
#define AIROPWEPKEY AIROPSTCLR + 1
|
||||
#define AIROPWEPKEYNV AIROPWEPKEY + 1
|
||||
#define AIROPLEAPPWD AIROPWEPKEYNV + 1
|
||||
#define AIROPLEAPUSR AIROPLEAPPWD + 1
|
||||
|
||||
/*
|
||||
* Another gap of 40 commands before flash codes
|
||||
*/
|
||||
|
||||
#define AIROFLSHRST AIROPWEPKEYNV + 40
|
||||
#define AIROFLSHGCHR AIROFLSHRST + 1
|
||||
#define AIROFLSHSTFL AIROFLSHGCHR + 1
|
||||
#define AIROFLSHPCHR AIROFLSHSTFL + 1
|
||||
#define AIROFLPUTBUF AIROFLSHPCHR + 1
|
||||
#define AIRORESTART AIROFLPUTBUF + 1
|
||||
|
||||
/*
|
||||
* Struct to enable up to 65535 ioctl's
|
||||
*/
|
||||
|
||||
#define AIROMAGIC 0xa55a
|
||||
|
||||
typedef struct aironet_ioctl {
|
||||
unsigned short command; /* What to do */
|
||||
unsigned short len; /* Len of data */
|
||||
unsigned char *data; /* d-data */
|
||||
} airo_ioctl;
|
||||
|
||||
#endif
|
3820
sys/dev/an/if_an.c
3820
sys/dev/an/if_an.c
File diff suppressed because it is too large
Load Diff
@ -1,154 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1997, 1998, 1999
|
||||
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Bill Paul.
|
||||
* 4. Neither the name of the author nor the names of any co-contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
* Aironet 4500/4800 802.11 PCMCIA/ISA/PCI driver for FreeBSD.
|
||||
*
|
||||
* Written by Bill Paul <wpaul@ctr.columbia.edu>
|
||||
* Electrical Engineering Department
|
||||
* Columbia University, New York City
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
#ifdef INET
|
||||
#define ANCACHE
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <sys/module.h>
|
||||
#include <sys/bus.h>
|
||||
#include <machine/bus.h>
|
||||
#include <sys/rman.h>
|
||||
#include <machine/resource.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_media.h>
|
||||
|
||||
#include <isa/isavar.h>
|
||||
#include <isa/pnpvar.h>
|
||||
|
||||
#include <dev/an/if_aironet_ieee.h>
|
||||
#include <dev/an/if_anreg.h>
|
||||
|
||||
static struct isa_pnp_id an_ids[] = {
|
||||
{ 0x0100ec06, "Aironet ISA4500/ISA4800" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
static int an_probe_isa(device_t);
|
||||
static int an_attach_isa(device_t);
|
||||
|
||||
static int
|
||||
an_probe_isa(device_t dev)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
error = ISA_PNP_PROBE(device_get_parent(dev), dev, an_ids);
|
||||
if (error == ENXIO)
|
||||
return(error);
|
||||
|
||||
error = an_probe(dev);
|
||||
an_release_resources(dev);
|
||||
if (error == 0)
|
||||
return (ENXIO);
|
||||
|
||||
error = an_alloc_irq(dev, 0, 0);
|
||||
an_release_resources(dev);
|
||||
if (!error)
|
||||
device_set_desc(dev, "Aironet ISA4500/ISA4800");
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
an_attach_isa(device_t dev)
|
||||
{
|
||||
struct an_softc *sc = device_get_softc(dev);
|
||||
int flags = device_get_flags(dev);
|
||||
int error;
|
||||
|
||||
an_alloc_port(dev, sc->port_rid, 1);
|
||||
an_alloc_irq(dev, sc->irq_rid, 0);
|
||||
|
||||
sc->an_dev = dev;
|
||||
|
||||
error = an_attach(sc, flags);
|
||||
if (error) {
|
||||
an_release_resources(dev);
|
||||
return (error);
|
||||
}
|
||||
|
||||
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
|
||||
NULL, an_intr, sc, &sc->irq_handle);
|
||||
if (error) {
|
||||
an_release_resources(dev);
|
||||
return (error);
|
||||
}
|
||||
gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto");
|
||||
return (0);
|
||||
}
|
||||
|
||||
static device_method_t an_isa_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_probe, an_probe_isa),
|
||||
DEVMETHOD(device_attach, an_attach_isa),
|
||||
DEVMETHOD(device_detach, an_detach),
|
||||
DEVMETHOD(device_shutdown, an_shutdown),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t an_isa_driver = {
|
||||
"an",
|
||||
an_isa_methods,
|
||||
sizeof(struct an_softc)
|
||||
};
|
||||
|
||||
static devclass_t an_isa_devclass;
|
||||
|
||||
DRIVER_MODULE(an, isa, an_isa_driver, an_isa_devclass, 0, 0);
|
||||
MODULE_DEPEND(an, isa, 1, 1, 1);
|
||||
MODULE_DEPEND(an, wlan, 1, 1, 1);
|
||||
ISA_PNP_INFO(an_ids);
|
@ -1,280 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1997, 1998, 1999
|
||||
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Bill Paul.
|
||||
* 4. Neither the name of the author nor the names of any co-contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/*
|
||||
* This is a PCI shim for the Aironet PC4500/4800 wireless network
|
||||
* driver. Aironet makes PCMCIA, ISA and PCI versions of these devices,
|
||||
* which all have basically the same interface. The ISA and PCI cards
|
||||
* are actually bridge adapters with PCMCIA cards inserted into them,
|
||||
* however they appear as normal PCI or ISA devices to the host.
|
||||
*
|
||||
* All we do here is handle the PCI probe and attach and set up an
|
||||
* interrupt handler entry point. The PCI version of the card uses
|
||||
* a PLX 9050 PCI to "dumb bus" bridge chip, which provides us with
|
||||
* multiple PCI address space mappings. The primary mapping at PCI
|
||||
* register 0x14 is for the PLX chip itself, *NOT* the Aironet card.
|
||||
* The I/O address of the Aironet is actually at register 0x18, which
|
||||
* is the local bus mapping register for bus space 0. There are also
|
||||
* registers for additional register spaces at registers 0x1C and
|
||||
* 0x20, but these are unused in the Aironet devices. To find out
|
||||
* more, you need a datasheet for the 9050 from PLX, but you have
|
||||
* to go through their sales office to get it. Bleh.
|
||||
*/
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
#ifdef INET
|
||||
#define ANCACHE
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <sys/module.h>
|
||||
#include <sys/bus.h>
|
||||
#include <machine/bus.h>
|
||||
#include <sys/rman.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <machine/resource.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_media.h>
|
||||
|
||||
#include <dev/pci/pcireg.h>
|
||||
#include <dev/pci/pcivar.h>
|
||||
|
||||
#include <dev/an/if_aironet_ieee.h>
|
||||
#include <dev/an/if_anreg.h>
|
||||
|
||||
struct an_type {
|
||||
u_int16_t an_vid;
|
||||
u_int16_t an_did;
|
||||
char *an_name;
|
||||
};
|
||||
|
||||
#define AIRONET_VENDORID 0x14B9
|
||||
#define AIRONET_DEVICEID_35x 0x0350
|
||||
#define AIRONET_DEVICEID_4500 0x4500
|
||||
#define AIRONET_DEVICEID_4800 0x4800
|
||||
#define AIRONET_DEVICEID_4xxx 0x0001
|
||||
#define AIRONET_DEVICEID_MPI350 0xA504
|
||||
#define AN_PCI_PLX_LOIO 0x14 /* PLX chip iobase */
|
||||
#define AN_PCI_LOIO 0x18 /* Aironet iobase */
|
||||
|
||||
static struct an_type an_devs[] = {
|
||||
{ AIRONET_VENDORID, AIRONET_DEVICEID_35x, "Cisco Aironet 350 Series" },
|
||||
{ AIRONET_VENDORID, AIRONET_DEVICEID_MPI350, "Cisco Aironet MPI350" },
|
||||
{ AIRONET_VENDORID, AIRONET_DEVICEID_4500, "Aironet PCI4500" },
|
||||
{ AIRONET_VENDORID, AIRONET_DEVICEID_4800, "Aironet PCI4800" },
|
||||
{ AIRONET_VENDORID, AIRONET_DEVICEID_4xxx, "Aironet PCI4500/PCI4800" },
|
||||
{ 0, 0, NULL }
|
||||
};
|
||||
|
||||
static int an_probe_pci (device_t);
|
||||
static int an_attach_pci (device_t);
|
||||
static int an_suspend_pci (device_t);
|
||||
static int an_resume_pci (device_t);
|
||||
|
||||
static int
|
||||
an_probe_pci(device_t dev)
|
||||
{
|
||||
struct an_type *t;
|
||||
uint16_t vid, did;
|
||||
|
||||
t = an_devs;
|
||||
vid = pci_get_vendor(dev);
|
||||
did = pci_get_device(dev);
|
||||
|
||||
while (t->an_name != NULL) {
|
||||
if (vid == t->an_vid &&
|
||||
did == t->an_did) {
|
||||
device_set_desc(dev, t->an_name);
|
||||
return(BUS_PROBE_DEFAULT);
|
||||
}
|
||||
t++;
|
||||
}
|
||||
|
||||
return(ENXIO);
|
||||
}
|
||||
|
||||
static int
|
||||
an_attach_pci(dev)
|
||||
device_t dev;
|
||||
{
|
||||
struct an_softc *sc;
|
||||
int flags, error = 0;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
bzero(sc, sizeof(struct an_softc));
|
||||
flags = device_get_flags(dev);
|
||||
|
||||
/*
|
||||
* Setup the lock in PCI attachment since it skips the an_probe
|
||||
* function.
|
||||
*/
|
||||
mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
|
||||
MTX_DEF);
|
||||
|
||||
if (pci_get_vendor(dev) == AIRONET_VENDORID &&
|
||||
pci_get_device(dev) == AIRONET_DEVICEID_MPI350) {
|
||||
sc->mpi350 = 1;
|
||||
sc->port_rid = PCIR_BAR(0);
|
||||
} else {
|
||||
sc->port_rid = AN_PCI_LOIO;
|
||||
}
|
||||
error = an_alloc_port(dev, sc->port_rid, 1);
|
||||
|
||||
if (error) {
|
||||
device_printf(dev, "couldn't map ports\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Allocate memory for MPI350 */
|
||||
if (sc->mpi350) {
|
||||
/* Allocate memory */
|
||||
sc->mem_rid = PCIR_BAR(1);
|
||||
error = an_alloc_memory(dev, sc->mem_rid, 1);
|
||||
if (error) {
|
||||
device_printf(dev, "couldn't map memory\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Allocate aux. memory */
|
||||
sc->mem_aux_rid = PCIR_BAR(2);
|
||||
error = an_alloc_aux_memory(dev, sc->mem_aux_rid,
|
||||
AN_AUX_MEM_SIZE);
|
||||
if (error) {
|
||||
device_printf(dev, "couldn't map aux memory\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Allocate DMA region */
|
||||
error = bus_dma_tag_create(bus_get_dma_tag(dev),/* parent */
|
||||
1, 0, /* alignment, bounds */
|
||||
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
|
||||
BUS_SPACE_MAXADDR, /* highaddr */
|
||||
NULL, NULL, /* filter, filterarg */
|
||||
0x3ffff, /* maxsize XXX */
|
||||
1, /* nsegments */
|
||||
0xffff, /* maxsegsize XXX */
|
||||
BUS_DMA_ALLOCNOW, /* flags */
|
||||
NULL, /* lockfunc */
|
||||
NULL, /* lockarg */
|
||||
&sc->an_dtag);
|
||||
if (error) {
|
||||
device_printf(dev, "couldn't get DMA region\n");
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate interrupt */
|
||||
error = an_alloc_irq(dev, 0, RF_SHAREABLE);
|
||||
if (error) {
|
||||
device_printf(dev, "couldn't get interrupt\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
sc->an_dev = dev;
|
||||
error = an_attach(sc, flags);
|
||||
if (error) {
|
||||
device_printf(dev, "couldn't attach\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/*
|
||||
* Must setup the interrupt after the an_attach to prevent racing.
|
||||
*/
|
||||
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
|
||||
NULL, an_intr, sc, &sc->irq_handle);
|
||||
if (error)
|
||||
device_printf(dev, "couldn't setup interrupt\n");
|
||||
else
|
||||
gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto");
|
||||
fail:
|
||||
if (error)
|
||||
an_release_resources(dev);
|
||||
return(error);
|
||||
}
|
||||
|
||||
static int
|
||||
an_suspend_pci(device_t dev)
|
||||
{
|
||||
an_shutdown(dev);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
an_resume_pci(device_t dev)
|
||||
{
|
||||
an_resume(dev);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static device_method_t an_pci_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_probe, an_probe_pci),
|
||||
DEVMETHOD(device_attach, an_attach_pci),
|
||||
DEVMETHOD(device_detach, an_detach),
|
||||
DEVMETHOD(device_shutdown, an_shutdown),
|
||||
DEVMETHOD(device_suspend, an_suspend_pci),
|
||||
DEVMETHOD(device_resume, an_resume_pci),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t an_pci_driver = {
|
||||
"an",
|
||||
an_pci_methods,
|
||||
sizeof(struct an_softc),
|
||||
};
|
||||
|
||||
static devclass_t an_devclass;
|
||||
|
||||
DRIVER_MODULE(an, pci, an_pci_driver, an_devclass, 0, 0);
|
||||
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, an,
|
||||
an_devs, nitems(an_devs) - 1);
|
||||
MODULE_DEPEND(an, pci, 1, 1, 1);
|
||||
MODULE_DEPEND(an, wlan, 1, 1, 1);
|
@ -1,547 +0,0 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-4-Clause
|
||||
*
|
||||
* Copyright (c) 1997, 1998, 1999
|
||||
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by Bill Paul.
|
||||
* 4. Neither the name of the author nor the names of any co-contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#define AN_TIMEOUT 65536
|
||||
|
||||
/* Default network name: <empty string> */
|
||||
#define AN_DEFAULT_NETNAME ""
|
||||
|
||||
/* The nodename must be less than 16 bytes */
|
||||
#define AN_DEFAULT_NODENAME "FreeBSD"
|
||||
|
||||
#define AN_DEFAULT_IBSS "FreeBSD IBSS"
|
||||
|
||||
/*
|
||||
* register space access macros
|
||||
*/
|
||||
#define CSR_WRITE_2(sc, reg, val) bus_write_2(sc->port_res, reg, val)
|
||||
|
||||
#define CSR_READ_2(sc, reg) bus_read_2(sc->port_res, reg)
|
||||
|
||||
#define CSR_WRITE_1(sc, reg, val) bus_write_1(sc->port_res, reg, val)
|
||||
|
||||
#define CSR_READ_1(sc, reg) bus_read_1(sc->port_res, reg)
|
||||
|
||||
/*
|
||||
* memory space access macros
|
||||
*/
|
||||
#define CSR_MEM_WRITE_2(sc, reg, val) bus_write_2(sc->mem_res, reg, val)
|
||||
|
||||
#define CSR_MEM_READ_2(sc, reg) bus_read_2(sc->mem_res, reg)
|
||||
|
||||
#define CSR_MEM_WRITE_1(sc, reg, val) bus_write_1(sc->mem_res, reg, val)
|
||||
|
||||
#define CSR_MEM_READ_1(sc, reg) bus_read_1(sc->mem_res, reg)
|
||||
|
||||
/*
|
||||
* aux. memory space access macros
|
||||
*/
|
||||
#define CSR_MEM_AUX_WRITE_4(sc, reg, val) \
|
||||
bus_write_4(sc->mem_aux_res, reg, val)
|
||||
|
||||
#define CSR_MEM_AUX_READ_4(sc, reg) \
|
||||
bus_read_4(sc->mem_aux_res, reg)
|
||||
|
||||
#define CSR_MEM_AUX_WRITE_1(sc, reg, val) \
|
||||
bus_write_1(sc->mem_aux_res, reg, val)
|
||||
|
||||
#define CSR_MEM_AUX_READ_1(sc, reg) \
|
||||
bus_read_1(sc->mem_aux_res, reg)
|
||||
|
||||
/*
|
||||
* Size of Aironet I/O space.
|
||||
*/
|
||||
#define AN_IOSIZ 0x40
|
||||
|
||||
/*
|
||||
* Size of aux. memory space ... probably not needed DJA
|
||||
*/
|
||||
#define AN_AUX_MEM_SIZE (256 * 1024)
|
||||
|
||||
/*
|
||||
* Hermes register definitions and what little I know about them.
|
||||
*/
|
||||
|
||||
/* Hermes command/status registers. */
|
||||
#define AN_COMMAND(x) (x ? 0x00 : 0x00)
|
||||
#define AN_PARAM0(x) (x ? 0x04 : 0x02)
|
||||
#define AN_PARAM1(x) (x ? 0x08 : 0x04)
|
||||
#define AN_PARAM2(x) (x ? 0x0c : 0x06)
|
||||
#define AN_STATUS(x) (x ? 0x10 : 0x08)
|
||||
#define AN_RESP0(x) (x ? 0x14 : 0x0A)
|
||||
#define AN_RESP1(x) (x ? 0x18 : 0x0C)
|
||||
#define AN_RESP2(x) (x ? 0x1c : 0x0E)
|
||||
#define AN_LINKSTAT(x) (x ? 0x20 : 0x10)
|
||||
|
||||
/* Command register */
|
||||
#define AN_CMD_BUSY 0x8000 /* busy bit */
|
||||
#define AN_CMD_NO_ACK 0x0080 /* don't acknowledge command */
|
||||
#define AN_CMD_CODE_MASK 0x003F
|
||||
#define AN_CMD_QUAL_MASK 0x7F00
|
||||
|
||||
/* Command codes */
|
||||
#define AN_CMD_NOOP 0x0000 /* no-op */
|
||||
#define AN_CMD_ENABLE 0x0001 /* enable */
|
||||
#define AN_CMD_DISABLE 0x0002 /* disable */
|
||||
#define AN_CMD_FORCE_SYNCLOSS 0x0003 /* force loss of sync */
|
||||
#define AN_CMD_FW_RESTART 0x0004 /* firmware restart */
|
||||
#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 /* allocate NIC memory */
|
||||
#define AN_CMD_TX 0x000B /* transmit */
|
||||
#define AN_CMD_DEALLOC_MEM 0x000C
|
||||
#define AN_CMD_NOOP2 0x0010
|
||||
#define AN_CMD_ALLOC_DESC 0x0020
|
||||
#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
|
||||
|
||||
/*
|
||||
* MPI 350 DMA descriptor information
|
||||
*/
|
||||
#define AN_DESCRIPTOR_TX 0x01
|
||||
#define AN_DESCRIPTOR_RX 0x02
|
||||
#define AN_DESCRIPTOR_TXCMP 0x04
|
||||
#define AN_DESCRIPTOR_HOSTWRITE 0x08
|
||||
#define AN_DESCRIPTOR_HOSTREAD 0x10
|
||||
#define AN_DESCRIPTOR_HOSTRW 0x20
|
||||
|
||||
#define AN_MAX_RX_DESC 1
|
||||
#define AN_MAX_TX_DESC 1
|
||||
#define AN_HOSTBUFSIZ 1840
|
||||
|
||||
struct an_card_rid_desc
|
||||
{
|
||||
unsigned an_rid:16;
|
||||
unsigned an_len:15;
|
||||
unsigned an_valid:1;
|
||||
u_int64_t an_phys;
|
||||
};
|
||||
|
||||
struct an_card_rx_desc
|
||||
{
|
||||
unsigned an_ctrl:15;
|
||||
unsigned an_done:1;
|
||||
unsigned an_len:15;
|
||||
unsigned an_valid:1;
|
||||
u_int64_t an_phys;
|
||||
};
|
||||
|
||||
struct an_card_tx_desc
|
||||
{
|
||||
unsigned an_offset:15;
|
||||
unsigned an_eoc:1;
|
||||
unsigned an_len:15;
|
||||
unsigned an_valid:1;
|
||||
u_int64_t an_phys;
|
||||
};
|
||||
|
||||
#define AN_RID_BUFFER_SIZE AN_MAX_DATALEN
|
||||
#define AN_RX_BUFFER_SIZE AN_HOSTBUFSIZ
|
||||
#define AN_TX_BUFFER_SIZE AN_HOSTBUFSIZ
|
||||
/*#define AN_HOST_DESC_OFFSET 0xC sort of works */
|
||||
#define AN_HOST_DESC_OFFSET 0x800
|
||||
#define AN_RX_DESC_OFFSET (AN_HOST_DESC_OFFSET + \
|
||||
sizeof(struct an_card_rid_desc))
|
||||
#define AN_TX_DESC_OFFSET (AN_RX_DESC_OFFSET + \
|
||||
(AN_MAX_RX_DESC * sizeof(struct an_card_rx_desc)))
|
||||
|
||||
struct an_command {
|
||||
u_int16_t an_cmd;
|
||||
u_int16_t an_parm0;
|
||||
u_int16_t an_parm1;
|
||||
u_int16_t an_parm2;
|
||||
};
|
||||
|
||||
struct an_reply {
|
||||
u_int16_t an_status;
|
||||
u_int16_t an_resp0;
|
||||
u_int16_t an_resp1;
|
||||
u_int16_t an_resp2;
|
||||
};
|
||||
|
||||
/*
|
||||
* Reclaim qualifier bit, applicable to the
|
||||
* TX command.
|
||||
*/
|
||||
#define AN_RECLAIM 0x0100 /* reclaim NIC memory */
|
||||
|
||||
/*
|
||||
* ACCESS command qualifier bits.
|
||||
*/
|
||||
#define AN_ACCESS_READ 0x0000
|
||||
#define AN_ACCESS_WRITE 0x0100
|
||||
|
||||
/*
|
||||
* PROGRAM command qualifier bits.
|
||||
*/
|
||||
#define AN_PROGRAM_DISABLE 0x0000
|
||||
#define AN_PROGRAM_ENABLE_RAM 0x0100
|
||||
#define AN_PROGRAM_ENABLE_NVRAM 0x0200
|
||||
#define AN_PROGRAM_NVRAM 0x0300
|
||||
|
||||
/* Status register values */
|
||||
#define AN_STAT_CMD_CODE 0x003F
|
||||
#define AN_STAT_CMD_RESULT 0x7F00
|
||||
|
||||
/* Linkstat register */
|
||||
#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
|
||||
|
||||
/* memory handle management registers */
|
||||
#define AN_RX_FID 0x20
|
||||
#define AN_ALLOC_FID 0x22
|
||||
#define AN_TX_CMP_FID(x) (x ? 0x1a : 0x24)
|
||||
|
||||
/*
|
||||
* Buffer Access Path (BAP) registers.
|
||||
* These are I/O channels. I believe you can use each one for
|
||||
* any desired purpose independently of the other. In general
|
||||
* though, we use BAP1 for reading and writing LTV records and
|
||||
* reading received data frames, and BAP0 for writing transmit
|
||||
* frames. This is a convention though, not a rule.
|
||||
*/
|
||||
#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
|
||||
|
||||
/* Event registers */
|
||||
#define AN_EVENT_STAT(x) (x ? 0x60 : 0x30) /* Event status */
|
||||
#define AN_INT_EN(x) (x ? 0x64 : 0x32) /* Interrupt enable/
|
||||
disable */
|
||||
#define AN_EVENT_ACK(x) (x ? 0x68 : 0x34) /* Ack event */
|
||||
|
||||
/* Events */
|
||||
#define AN_EV_CLR_STUCK_BUSY 0x4000 /* clear stuck busy bit */
|
||||
#define AN_EV_WAKEREQUEST 0x2000 /* awaken from PSP mode */
|
||||
#define AN_EV_MIC 0x1000 /* Message Integrity Check*/
|
||||
#define AN_EV_AWAKE 0x0100 /* station woke up from PSP mode*/
|
||||
#define AN_EV_LINKSTAT 0x0080 /* link status available */
|
||||
#define AN_EV_CMD 0x0010 /* command completed */
|
||||
#define AN_EV_ALLOC 0x0008 /* async alloc/reclaim completed */
|
||||
#define AN_EV_TX_CPY 0x0400
|
||||
#define AN_EV_TX_EXC 0x0004 /* async xmit completed with failure */
|
||||
#define AN_EV_TX 0x0002 /* async xmit completed successfully */
|
||||
#define AN_EV_RX 0x0001 /* async rx completed */
|
||||
|
||||
#define AN_INTRS(x) \
|
||||
( x ? (AN_EV_RX|AN_EV_TX|AN_EV_TX_EXC|AN_EV_TX_CPY|AN_EV_ALLOC \
|
||||
|AN_EV_LINKSTAT|AN_EV_MIC) \
|
||||
: \
|
||||
(AN_EV_RX|AN_EV_TX|AN_EV_TX_EXC|AN_EV_ALLOC \
|
||||
|AN_EV_LINKSTAT|AN_EV_MIC) \
|
||||
)
|
||||
|
||||
/* Host software registers */
|
||||
#define AN_SW0(x) (x ? 0x50 : 0x28)
|
||||
#define AN_SW1(x) (x ? 0x54 : 0x2A)
|
||||
#define AN_SW2(x) (x ? 0x58 : 0x2C)
|
||||
#define AN_SW3(x) (x ? 0x5c : 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
|
||||
|
||||
/*
|
||||
* Length, Type, Value (LTV) record definitions and RID values.
|
||||
*/
|
||||
struct an_ltv_gen {
|
||||
u_int16_t an_len;
|
||||
u_int16_t an_type;
|
||||
u_int16_t an_val;
|
||||
};
|
||||
|
||||
#define AN_DEF_SSID_LEN 7
|
||||
#define AN_DEF_SSID "tsunami"
|
||||
|
||||
#define AN_RXGAP_MAX 8
|
||||
|
||||
/*
|
||||
* Transmit frame structure.
|
||||
*/
|
||||
struct an_txframe {
|
||||
u_int32_t an_tx_sw; /* 0x00 */
|
||||
u_int16_t an_tx_status; /* 0x04 */
|
||||
u_int16_t an_tx_payload_len; /* 0x06 */
|
||||
u_int16_t an_tx_ctl; /* 0x08 */
|
||||
u_int16_t an_tx_assoc_id; /* 0x0A */
|
||||
u_int16_t an_tx_retry; /* 0x0C */
|
||||
u_int8_t an_tx_assoc_cnt; /* 0x0E */
|
||||
u_int8_t an_tx_rate; /* 0x0F */
|
||||
u_int8_t an_tx_max_long_retries; /* 0x10 */
|
||||
u_int8_t an_tx_max_short_retries; /*0x11 */
|
||||
u_int8_t an_rsvd0[2]; /* 0x12 */
|
||||
u_int16_t an_frame_ctl; /* 0x14 */
|
||||
u_int16_t an_duration; /* 0x16 */
|
||||
u_int8_t an_addr1[6]; /* 0x18 */
|
||||
u_int8_t an_addr2[6]; /* 0x1E */
|
||||
u_int8_t an_addr3[6]; /* 0x24 */
|
||||
u_int16_t an_seq_ctl; /* 0x2A */
|
||||
u_int8_t an_addr4[6]; /* 0x2C */
|
||||
u_int8_t an_gaplen; /* 0x32 */
|
||||
} __packed;
|
||||
|
||||
struct an_rxframe_802_3 {
|
||||
u_int16_t an_rx_802_3_status; /* 0x34 */
|
||||
u_int16_t an_rx_802_3_payload_len;/* 0x36 */
|
||||
u_int8_t an_rx_dst_addr[6]; /* 0x38 */
|
||||
u_int8_t an_rx_src_addr[6]; /* 0x3E */
|
||||
};
|
||||
#define AN_RXGAP_MAX 8
|
||||
|
||||
struct an_txframe_802_3 {
|
||||
/*
|
||||
* Transmit 802.3 header structure.
|
||||
*/
|
||||
u_int16_t an_tx_802_3_status; /* 0x34 */
|
||||
u_int16_t an_tx_802_3_payload_len;/* 0x36 */
|
||||
u_int8_t an_tx_dst_addr[6]; /* 0x38 */
|
||||
u_int8_t an_tx_src_addr[6]; /* 0x3E */
|
||||
};
|
||||
|
||||
#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_HEADERTYPE_80211|AN_PAYLOADTYPE_LLC)
|
||||
|
||||
#define AN_TXCTL_8023 (AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER)
|
||||
|
||||
/*
|
||||
* Additions to transmit control bits for MPI350
|
||||
*/
|
||||
#define AN_TXCTL_HW(x) \
|
||||
( x ? (AN_TXCTL_NORELEASE) \
|
||||
: \
|
||||
(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_TXCTL_NORELEASE) \
|
||||
)
|
||||
|
||||
#define AN_TXGAP_80211 0
|
||||
#define AN_TXGAP_8023 0
|
||||
|
||||
struct an_802_3_hdr {
|
||||
u_int16_t an_8023_status;
|
||||
u_int16_t an_8023_payload_len;
|
||||
u_int8_t an_8023_dst_addr[6];
|
||||
u_int8_t an_8023_src_addr[6];
|
||||
u_int16_t an_8023_dat[3]; /* SNAP header */
|
||||
u_int16_t an_8023_type;
|
||||
};
|
||||
|
||||
struct an_snap_hdr {
|
||||
u_int16_t an_snap_dat[3]; /* SNAP header */
|
||||
u_int16_t an_snap_type;
|
||||
};
|
||||
|
||||
struct an_dma_alloc {
|
||||
u_int32_t an_dma_paddr;
|
||||
caddr_t an_dma_vaddr;
|
||||
bus_dmamap_t an_dma_map;
|
||||
bus_dma_segment_t an_dma_seg;
|
||||
bus_size_t an_dma_size;
|
||||
int an_dma_nseg;
|
||||
};
|
||||
|
||||
#define AN_TX_RING_CNT 4
|
||||
#define AN_INC(x, y) (x) = (x + 1) % y
|
||||
|
||||
struct an_tx_ring_data {
|
||||
u_int16_t an_tx_fids[AN_TX_RING_CNT];
|
||||
u_int16_t an_tx_ring[AN_TX_RING_CNT];
|
||||
int an_tx_prod;
|
||||
int an_tx_cons;
|
||||
int an_tx_empty;
|
||||
};
|
||||
|
||||
struct an_softc {
|
||||
struct ifnet *an_ifp;
|
||||
|
||||
int port_rid; /* resource id for port range */
|
||||
struct resource* port_res; /* resource for port range */
|
||||
int mem_rid; /* resource id for memory range */
|
||||
int mem_used; /* nonzero if memory used */
|
||||
struct resource* mem_res; /* resource for memory range */
|
||||
int mem_aux_rid; /* resource id for memory range */
|
||||
int mem_aux_used; /* nonzero if memory used */
|
||||
struct resource* mem_aux_res; /* resource for memory range */
|
||||
int irq_rid; /* resource id for irq */
|
||||
void* irq_handle; /* handle for irq handler */
|
||||
struct resource* irq_res; /* resource for irq */
|
||||
|
||||
bus_space_handle_t an_mem_aux_bhandle;
|
||||
bus_space_tag_t an_mem_aux_btag;
|
||||
bus_dma_tag_t an_dtag;
|
||||
struct an_ltv_genconfig an_config;
|
||||
struct an_ltv_caps an_caps;
|
||||
struct an_ltv_ssidlist_new an_ssidlist;
|
||||
struct an_ltv_aplist an_aplist;
|
||||
struct an_ltv_key an_temp_keys[4];
|
||||
int an_tx_rate;
|
||||
int an_rxmode;
|
||||
int an_gone;
|
||||
int an_if_flags;
|
||||
u_int8_t an_txbuf[1536];
|
||||
struct an_tx_ring_data an_rdata;
|
||||
struct an_ltv_stats an_stats;
|
||||
struct an_ltv_status an_status;
|
||||
u_int8_t an_associated;
|
||||
#ifdef ANCACHE
|
||||
int an_sigitems;
|
||||
struct an_sigcache an_sigcache[MAXANCACHE];
|
||||
int an_nextitem;
|
||||
int an_have_rssimap;
|
||||
struct an_ltv_rssi_map an_rssimap;
|
||||
#endif
|
||||
struct callout an_stat_ch;
|
||||
struct mtx an_mtx;
|
||||
device_t an_dev;
|
||||
struct ifmedia an_ifmedia;
|
||||
int an_monitor;
|
||||
int an_was_monitor;
|
||||
int an_timer;
|
||||
u_char buf_802_11[MCLBYTES];
|
||||
struct an_req areq;
|
||||
unsigned short* an_flash_buffer;
|
||||
int mpi350;
|
||||
struct an_dma_alloc an_rid_buffer;
|
||||
struct an_dma_alloc an_rx_buffer[AN_MAX_RX_DESC];
|
||||
struct an_dma_alloc an_tx_buffer[AN_MAX_TX_DESC];
|
||||
};
|
||||
|
||||
#define AN_LOCK(_sc) mtx_lock(&(_sc)->an_mtx)
|
||||
#define AN_UNLOCK(_sc) mtx_unlock(&(_sc)->an_mtx)
|
||||
#define AN_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->an_mtx, MA_OWNED)
|
||||
|
||||
void an_release_resources (device_t);
|
||||
int an_alloc_port (device_t, int, int);
|
||||
int an_alloc_memory (device_t, int, int);
|
||||
int an_alloc_aux_memory (device_t, int, int);
|
||||
int an_alloc_irq (device_t, int, int);
|
||||
int an_probe (device_t);
|
||||
int an_shutdown (device_t);
|
||||
void an_resume (device_t);
|
||||
int an_attach (struct an_softc *, int);
|
||||
int an_detach (device_t);
|
||||
void an_stop (struct an_softc *);
|
||||
|
||||
driver_intr_t an_intr;
|
||||
|
||||
#define AN_802_3_OFFSET 0x2E
|
||||
#define AN_802_11_OFFSET 0x44
|
||||
#define AN_802_11_OFFSET_RAW 0x3C
|
||||
|
||||
#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 /* RFC1042 encoded */
|
||||
#define AN_STAT_TUNNEL 0x4000 /* Bridge-tunnel encoded */
|
||||
#define AN_STAT_WMP_MSG 0x6000 /* WaveLAN-II management protocol */
|
||||
#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
|
||||
|
||||
/*
|
||||
* SNAP (sub-network access protocol) constants for transmission
|
||||
* of IP datagrams over IEEE 802 networks, taken from RFC1042.
|
||||
* We need these for the LLC/SNAP header fields in the TX/RX frame
|
||||
* structure.
|
||||
*/
|
||||
#define AN_SNAP_K1 0xaa /* assigned global SAP for SNAP */
|
||||
#define AN_SNAP_K2 0x00
|
||||
#define AN_SNAP_CONTROL 0x03 /* unnumbered information format */
|
||||
#define AN_SNAP_WORD0 (AN_SNAP_K1 | (AN_SNAP_K1 << 8))
|
||||
#define AN_SNAP_WORD1 (AN_SNAP_K2 | (AN_SNAP_CONTROL << 8))
|
||||
#define AN_SNAPHDR_LEN 0x6
|
@ -39,7 +39,6 @@ SUBDIR= \
|
||||
${_amdsmn} \
|
||||
${_amdtemp} \
|
||||
amr \
|
||||
${_an} \
|
||||
${_aout} \
|
||||
${_arcmsr} \
|
||||
${_allwinner} \
|
||||
@ -621,7 +620,6 @@ _sdhci_fdt= sdhci_fdt
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
|
||||
_agp= agp
|
||||
_an= an
|
||||
_aout= aout
|
||||
_bios= bios
|
||||
.if ${MK_SOURCELESS_UCODE} != "no"
|
||||
|
@ -1,9 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${SRCTOP}/sys/dev/an
|
||||
|
||||
KMOD= if_an
|
||||
SRCS= if_an.c if_an_pci.c if_an_isa.c
|
||||
SRCS+= opt_inet.h device_if.h bus_if.h pci_if.h isa_if.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
Loading…
x
Reference in New Issue
Block a user