History log of /freebsd-10-stable/sys/dev/an/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
303177 22-Jul-2016 sbruno

MFC r300612
Reject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greater
than sc->areq. This is a bounds check to ensure we're not just cramming
arbitrarily sized nonsense into the driver and overflowing the heap.

PR: 209545

265614 07-May-2014 gavin

Merge r259393 from head:

Fix several panics when initialization of an ISA or PC-CARD device fails:

o Assign sc->an_dev in an_probe() (which isn't really a probe function in
the standard newbus sense) as we may need it for printing errors.
o Use device_printf() rather than if_printf() in an_reset() - this is
called from an_probe() long before the ifp structure is initialised
in an_attach().
o Initialize the ifp structure early in an_attach() as we use if_printf()
in cases where allocation of descriptors etc fails.

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


254263 12-Aug-2013 scottl

Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI
command register. The lazy BAR allocation code in FreeBSD sometimes
disables this bit when it detects a range conflict, and will re-enable
it on demand when a driver allocates the BAR. Thus, the bit is no longer
a reliable indication of capability, and should not be checked. This
results in the elimination of a lot of code from drivers, and also gives
the opportunity to simplify a lot of drivers to use a helper API to set
the busmaster enable bit.

This changes fixes some recent reports of disk controllers and their
associated drives/enclosures disappearing during boot.

Submitted by: jhb
Reviewed by: jfv, marius, achadd, achim
MFC after: 1 day


243857 04-Dec-2012 glebius

Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.


232854 12-Mar-2012 scottl

Convert a number of drivers to obtaining their parent DMA tag from their
PCI device attachment.


229767 07-Jan-2012 kevlo

ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again

Reviewed by: yongari


228621 17-Dec-2011 bschmidt

Fix some net80211 enum nits:
- ic_vap_create() uses an ieee80211_opmode argument
- ieee80211_rate2media() takes an ieee80211_phymode argument
- ieee80211_plcp2rate() takes an ieee80211_phytype argument
- cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
compiler warnings

Submitted by: arundel@


227309 07-Nov-2011 ed

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.


223624 28-Jun-2011 kevlo

Remove duplicate header includes


207554 03-May-2010 sobomax

Add new tunable 'net.link.ifqmaxlen' to set default send interface
queue length. The default value for this parameter is 50, which is
quite low for many of today's uses and the only way to modify this
parameter right now is to edit if_var.h file. Also add read-only
sysctl with the same name, so that it's possible to retrieve the
current value.

MFC after: 1 month


199757 24-Nov-2009 jhb

- For 350 chips, don't set various INTR bits in TX control word; turning INTR
bits on seems to confuse hardware TX engine.
- For 350 chips, set TX desc's buffer physical address before turning on the
TX desc valid bit.

Submitted by: Jeremy O'Brien obrien654j | gmail, sephe
Obtained from: DragonFly BSD


199756 24-Nov-2009 jhb

Use bus_*() rather than bus_space_*().


199154 10-Nov-2009 jhb

- Locking fixes to not do silly things like drop the lock only to call a
function that immediately reacquires the lock. Also removes recursive
locking.
- Use the statistics timer to drive the transmit watchdog instead of using
if_watchdog and if_timer.

Tested by: gavin


198995 06-Nov-2009 jhb

- Use device_printf() instead of printf() with an explicit unit number
in the PCI attach routine.
- Simplify PCI probe.
- Remove no-longer-used 'unit' from an_attach() parameters.

PR: kern/126924
Submitted by: gavin


198987 06-Nov-2009 jhb

Use device_printf() and if_printf() instead of printf() with an explicit
unit number and remove 'unit' members from softc.


188128 04-Feb-2009 imp

Shutdown routine returns int.


184708 06-Nov-2008 bz

In case INET is not defined, then ANCACHE is not defined and
the sc does not have 'an_have_rssimap' variable.
Add an ANCACHE check to poperly hide the case and make an(4)
compile without INET.

MFC after: 2 months


175446 18-Jan-2008 ambrisko

Style changes from avatar.

Submitted by: avatar


175445 18-Jan-2008 ambrisko

First real attempt at proper locking. The locking is a little complicated
since the the command and data that is being built to be sent to or read
from the HW lives in the softc. Commands are later run via an_setdef etc.
In the ioctl path various references are kept to the data stored in
the softc so it needs to be protected. Almost think of the command
in the softc a global variable since it essentially is. Since locking
wasn't done in this type of context the commands would get corrupted.

Thanks to avatar@ for catching some lock issues and dhw@ for testing.

Things are a lot more stable except for the MPI-350 cards. My an(4)
remote laptop stays on the network now.

The driver should be changed so that it uses private memory that is passed
to the functions that talk to the card. Then only those functions would
really need to grab locks.

Reviewed by: avatar@


173975 27-Nov-2007 avatar

MFP4(129048): Eliminating an unnecessary check on an_gone inside
an_stats_update() since a properly locked callout_stop(9) does do the
right thing.

Reviewed by: ambrisko, jhb
MFC after: 3 days


173668 16-Nov-2007 avatar

MFP4(128855, 129015):
- Trying to eliminate another racing by replacing the timeout(9) with
callout APIs. In addition to that, the callout_drain() in an_detach()
help us to avoid a possible panic-on-free due to the callout API tries
to lock a destroyed mutex.
- In an_stats_update(), check the return value of an_read_record(). This
should reduce the chance of device removal(PCCARD) panic [2].
- Adding a comment to state the fact that an_stats_update() is now called
via callout(9) with a lock held [2].

Submitted by: jhb [1], ambrisko [2]
Reviewed by: jhb, ambrisko
Reported by: dhw
Tested by: dhw
MFC after: 3 days


172112 10-Sep-2007 avatar

Fixing invalid channel display in ifconfig(8) by implementing required
ioctl().

Note that other information provided by ifconfig(8) such like "list chan"
or "list ap" are still not available at this moment.

Before an(4) is connected to wlan(4), users are encouraged to use
ancontrol(8) to retrieve aforementioned information.

Reported by: dhw (http://lists.freebsd.org/pipermail/freebsd-current/2007-July/074848.html)
Reviewed by: ambrisko
Tested by: dhw
Approved by: re (bmah)


171775 07-Aug-2007 avatar

MFP4(123687): Closing another LOR by dropping the driver lock around calls
to if_input().

Reviewed by: ambrisko
Tested by: dhw
Approved by: re (kensmith)


171692 02-Aug-2007 avatar

MFP4(123686): Fixing various ancontrol(8) related panics by dropping locks
around copyin()/copyout().

Reviewed by: sam, thompsa
Tested by: dhw
Approved by: re (kensmith)


170409 08-Jun-2007 mjacob

Remove assignment to uninitialized variable that wasn't then used anyway.


166901 23-Feb-2007 piso

o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@


164033 06-Nov-2006 rwatson

Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges. These may
require some future tweaking.

Sponsored by: nCircle Network Security, Inc.
Obtained from: TrustedBSD Project
Discussed on: arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
Alex Lyashkov <umka at sevcity dot net>,
Skip Ford <skip dot ford at verizon dot net>,
Antoine Brodin <antoine dot brodin at laposte dot net>


158651 16-May-2006 phk

Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.


155321 04-Feb-2006 imp

Silence the strict-alias warnings. Make a trip through (void *) when
casting a structure to a uint32_t *. Many drivers in the tree do this, but
I'll not update them until these changes can be reviewed by the pedantic
standards folks.


154866 26-Jan-2006 njl

Since the A-Z range is contained in the previous check, the else-if is
dead code. Clean up both by using isprint() instead, since that's what
it really wants.

Coverity ID: 100
Found by: Coverity Prevent


154394 15-Jan-2006 rwatson

Don't leak mbufs and mbuf clusters in several error-handling situations
in the if_an receive routine.

Found with: Coverity Prevent (tm)
MFC after: 1 week


154393 15-Jan-2006 rwatson

If frame length is excessive, don't leak an mbuf and cluster when
abandoning processing.

Found with: Coverity Prevent (tm)
MFC after: 1 week


152315 11-Nov-2005 ru

- Store pointer to the link-level address right in "struct ifnet"
rather than in ifindex_table[]; all (except one) accesses are
through ifp anyway. IF_LLADDR() works faster, and all (except
one) ifaddr_byindex() users were converted to use ifp->if_addr.

- Stop storing a (pointer to) Ethernet address in "struct arpcom",
and drop the IFP2ENADDR() macro; all users have been converted
to use IF_LLADDR() instead.


152296 11-Nov-2005 ru

- Make IFP2ENADDR() a pointer to IF_LLADDR() rather than another
copy of Ethernet address.

- Change iso88025_ifattach() and fddi_ifattach() to accept MAC
address as an argument, similar to ether_ifattach(), to make
this work.


150448 22-Sep-2005 imp

MFp4: Remove OLDCARD shims


150447 22-Sep-2005 imp

MFp4: trivial KNF nits


150446 22-Sep-2005 imp

MFp4: KNF (mostly remove K&R function definitions). Fix some spaces left
over from de__Ping.

# Didn't fix the -Exxxx return statements that appaer to be linuxisms
# (and wrong) since I don't have hardware to test with.


150306 19-Sep-2005 imp

Make sure that we call if_free(ifp) after bus_teardown_intr. Since we
could get an interrupt after we free the ifp, and the interrupt
handler depended on the ifp being still alive, this could, in theory,
cause a crash. Eliminate this possibility by moving the if_free to
after the bus_teardown_intr() call.


148887 09-Aug-2005 rwatson

Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags. Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags. This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.

Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.

Reviewed by: pjd, bz
MFC after: 7 days


148680 03-Aug-2005 imp

Minor style nits.


148639 02-Aug-2005 emax

Do not lock an to check gone flag. Only need to hold the lock to set
the gone flag.

Reviewed by: imp
MFC after: 1 day


148454 27-Jul-2005 emax

Reorganize an_detach() a bit. Make sure ether_ifdetach() and if_free()
are called outside of AN_LOCK()/AN_UNLOCK. This fixes the following
WITNESS warning (produced when an(4) PCMCIA card is detached).

taskqueue_drain with the following non-sleepable locks held:
exclusive sleep mutex an0 (network driver) r = 0 (0xc59af168) locked @ /usr/src/sys/dev/an/if_an.c:2836

MFC after: 3 days
Silence from: current@


147580 24-Jun-2005 imp

Eliminate unused argument in PCMCIA_CARD macro.

Provide a backwards compatible way to have the extra macro by defining
PCCARD_API_LEVEL 5 before including pccarddevs for driver writers that
want/need to have the same driver on 5 and 6 with pccard attachments.

Approved by: re (dwhite)


147380 14-Jun-2005 delphij

Initialize sc->an_ifp when doing if_alloc(). This prevents an(4)
from being panic when attaching.

Approved by: re (scottl)


147256 10-Jun-2005 brooks

Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
- Struct arpcom is no longer referenced in normal interface code.
Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
To enforce this ac_enaddr has been renamed to _ac_enaddr.
- The second argument to ether_ifattach is now always the mac address
from driver private storage rather than sometimes being ac_enaddr.

Reviewed by: sobomax, sam


144242 28-Mar-2005 sam

check copyin/copyout return values

Noticed by: Coverity Prevent analysis tool


143163 05-Mar-2005 imp

Use BUS_PROBE_DEFAULT for pci probe return value


139749 06-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


132986 01-Aug-2004 mlaier

Second part of ALTQ driver modifications, covering:
an(4), ath(4), hme(4), ndis(4), vr(4) and wi(4)

Please help testing: http://people.freebsd.org/~mlaier/ALTQ_driver/

Tested by: Vaidas Damosevicius (an, ath, wi)
Roman Divacky (vr)
Submitted by: yongari (hme)


130620 17-Jun-2004 ambrisko

While setting up a transmit packet disable interupts on the card then
re-enable them after we are done setting up the packet. This seems
to fix the MPI350 newer firmware hangs.


129764 27-May-2004 imp

Fix disordering of pccarddevs.h noticed by bde. Also remove a few
redundant includes and fix some of the include disordering.

Submitted by: bde


129740 26-May-2004 imp

Move to generating pccarddevs.h on the fly, both for the kernel and
the modules.

Also generate usbdevs.h automatically now, but a non-kernel file is
stopping that at the moment.


129616 23-May-2004 mux

We don't need to initialize if_output, ether_ifattach() does it
for us.


129046 08-May-2004 imp

It turns out that the module dependency on pccard is in error. Since
there's not dependencies on pccard symboles, such a dependency is not
necessary. This means that drivers that have multiple attachments can
not drag bogus devices into the kernel at load time.

We can't (yet) do this with pci and isa. Drivers written for them
actually do seem to have symbols that depend on these busses'
implementation code.

ndis not touched until other things can be tested.


127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


126966 14-Mar-2004 mdodd

Announce ethernet MAC addresss in ether_ifattach().


124324 10-Jan-2004 ambrisko

Remove the HACK section it breaks the older firmware and doesn't totally
fix the new firmware so remove it.


123978 30-Dec-2003 ambrisko

- Bump up the general and status RID sizes
- Clear out an_dma_vaddr on free so we can test to see if dma is
setup when the card is kldunloaded/kldloaded etc. only for MPI350
- Use a common detach like wi(4)
- Notify on RID read overflow and truncate this currently causes
a panic in -stable when the stack during an ifconfig an0 is done
with newer firmware
- Convert from UNLOCK/tsleep/LOCK to msleep. I thought I did that
a while ago.


122689 14-Nov-2003 sam

Drop the driver lock around calls to if_input to avoid a LOR when
the packets are immediately returned for sending (e.g. when bridging
or packet forwarding). There are more efficient ways to do this
but for now use the least intrusive approach.

Reviewed by: imp, rwatson


121816 31-Oct-2003 brooks

Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By: re (in principle)
Reviewed By: njl, imp
Tested On: i386, amd64, sparc64
Obtained From: NetBSD (if_xname)


120900 08-Oct-2003 imp

Xircom Wireless Ethernet card is a rebadged Cisco 340, but with a
different vendor id/product id.

Submitted by: Keith Davis


119690 02-Sep-2003 jhb

Use PCIR_BAR(x) instead of PCIR_MAPS.

Glanced over by: imp, gibbs
Tested by: i386 LINT


119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


119277 22-Aug-2003 imp

Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.


119163 20-Aug-2003 ambrisko

Fix panic from having multiple locks held when updating firmware. AN_LOCK
was asserted during a tsleep resulting in a panic in tsleep.


119156 20-Aug-2003 ambrisko

- Add support for Cisco latest firmware RID sizes that supports 25 SSIDs!
- Fix up TX speed changes.
- Make mpi-350 cards sort-of work with new firmware. It RXs okay but TXs
only work for about 14 packets then fails to get an interrupt. The
TX watchdog fires. It has been reported that my hack for now doesn't
break cards with the older firmware. It appears my card has lost
the ability to RX or TX at all but other peoples cards work. I assume
it got damaged in tansport.

MFC: 1 week.


117126 01-Jul-2003 scottl

Mega busdma API commit.

Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma. At the moment, this is used for the
asynchronous busdma_swi and callback mechanism. Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg. dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create(). The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms. The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by: tmm, gibbs


116951 28-Jun-2003 sam

update for new 802.11 support


115615 01-Jun-2003 phk

Remove break after return.
Add XXX comment where intent is unclear.

Found by: FlexeLint


113506 15-Apr-2003 mdodd

- Express hard dependencies on bus (pci, isa, pccard) and
network layer (ether).
- Don't abuse module names to facilitate ifconfig module loading;
such abuse isn't really needed. (And if we do need type information
associated with a module then we should make it explicit and not
use hacks.)


113316 10-Apr-2003 imp

Don't lock in the attach routine. It isn't required. Register the
interrupt handler last. This gets rid of the sleep while locked
messages.

Reviewed by: ambrisko


113315 10-Apr-2003 imp

Make sure that pp_name is non-null before setting the device
description. This allows us to rely entirely on the CIS entries if
necessary...


113038 03-Apr-2003 obrien

Use __FBSDID rather than rcsid[].


111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


111051 17-Feb-2003 imp

an driver now needs wlan, so put the required explicit depends
into the source.

Reviewed by: ambrisko


110531 08-Feb-2003 ambrisko

- Fixes for suspend/resume code (MPI-350)
- Cache temp. keys so they are preserved across suspend/resume (MPI-350)
- Reads and writes are real fast to the MPI-350 causing early timeouts so
wait do some DELAYs to slow things down in the spin loops.
- Stream line setting RIDs when they are better to be set via another
function
- Add better support for setting home key via "ifconfig an0 wepkey 9:<key>"

Tested by: Peter Radcliffe <pir@pir.net> (in -stable)
myself in -current & -stable
MFC in: 3 days


110362 05-Feb-2003 ambrisko

Support for suspend/resume in laptops. Loosely based on the wi(4) patches
but not quite. The memory descriptors and most of the card parameters
need to be writen to the card.

MFC in: 3 days


110253 02-Feb-2003 ambrisko

Some small enhancments
- Implement TX power control with hints to code in Linux driver
by Douglas S. J. De Couto <decouto@lcs.mit.edu>
- Update ifmedia support to use ieee80211_rate2media and
ieee80211_media2rate. Note doesn't work with stock ifconfig
since there seems to be an issue with the setmedia code.
"ancontrol -t" works now, before it did nothing.
- Fix spelling error in header.


110104 30-Jan-2003 ambrisko

Fix some style and incorrect indentation level bugs.

Questioned by: phk (for the indentation problem)


109623 21-Jan-2003 alfred

Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


108401 29-Dec-2002 ambrisko

Add support for MPI-350 the mini-pci Cisco Aironet card. This needs more
work. The interface was gleaned from the Linux driver. Currently only
one RX & one TX buffer are used. Firmware support is not tested so for the
MPI-350 so it is disabled. Signal cache and monitor mode are not supported
yet. Signal cache is not supported since in encapsulation mode ethernet
frames are returned by the chip. LAN monitor mode support will be added
shortly. Thanks to Warner for the MPI-350 card he sent me.

Add support for RSSI map from PR kern/32880 which was incomplete. Enhanced
with the ability to select the cache mode of raw, dbm or per-cent.

Clean up Signal/Noise/Quality structures and units with help from
Marco Molteni.

Change flash to use a malloc'ed buffer when needed.

PR: kern/32880
Submitted by: Douglas S. J. De Couto decouto@pdos.lcs.mit.edu,
Marco Molteni
MFC: 3 weeks


108259 24-Dec-2002 rwatson

Require privilege to flush the signal cache on if_an and if_wi 802.11
cards.

Reviewed by: imp (if_wi)


106937 14-Nov-2002 sam

network interface driver changes:

o don't strip the Ethernet header from inbound packets; pass packets
up the stack intact (required significant changes to some drivers)
o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN)
o track ether_ifattach/ether_ifdetach API changes
o track bpf changes (use BPF_TAP and BPF_MTAP)
o track vlan changes (ifnet capabilities, revised processing scheme, etc.)
o use if_input to pass packets "up"
o call ether_ioctl for default handling of ioctls

Reviewed by: many
Approved by: re


106512 06-Nov-2002 jhb

Fix warning where sizeof(size_t) != sizeof(int).


104094 28-Sep-2002 phk

Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by: FlexeLint warning #512


103870 23-Sep-2002 alfred

use __packed.


100770 27-Jul-2002 fenner

Fix location and name of if_an_pci.c in comment.


93818 04-Apr-2002 jhb

Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on: i386, alpha, sparc64


93593 01-Apr-2002 jhb

Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API. The entire API now consists of two functions
similar to the pre-KSE API. The suser() function takes a thread pointer
as its only argument. The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0. The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on: smp@


92739 20-Mar-2002 alfred

Remove __P.


92292 14-Mar-2002 ambrisko

Only allow super user to perform the Linux compatible ioctls since some
of the things they do, shouldn't be done by normal users.

MFC after: 2 days


91283 26-Feb-2002 ambrisko

In ad-hoc mode, the "associate" bit is valid to check to see if it is
part of an ad-hoc network. This means another station needs to be
around so they can both associate.

MFC after: 1 week


90990 20-Feb-2002 brooks

Add missing m_free() so we actually drain the send buffer in monitor mode.

Submitted by: Kenjiro Cho <kjc@csl.sony.co.jp>


89063 08-Jan-2002 msmith

Staticise the flash buffer, since it isn't needed anywhere else.


88749 31-Dec-2001 ambrisko

Save stack space by converting areq in sc->areq.

Reviewed by: Brooks Davis <brooks@freebsd.org>
Warner Losh <imp@freebsd.org>
Approved by: Brooks Davis <brooks@freebsd.org>
Warner Losh <imp@freebsd.org>


88748 31-Dec-2001 ambrisko

Fix bugs in the structure for rx_frame by making gap length one byte and
a packed array so sizeof work. This broke RFMON mode and passing
up 802.11 packets.

The Linux emulation code was derived from the open source Linux driver to
maintain compatibility.

LEAP support is added, hints from Richard Johnson. I've verified this
locally with PC350v42510.img firmware. More bug fixing from Marco to
fix long passwords.

Change DELAYs in flash part of driver to FLASH_DELAY which uses tsleep
so it doesn't look like your system died during a flash update.

Install header files in /usr/include/dev/an

Cleanup some ifmedia bugs add "Home" key mode to ifmedia and ancontrol.
This way you can manage 2 keys a little easier. Map the home mode into
key 5. Enhance ifconfig to dump the various configured SSIDs. I use
a bunch of different ones and roam between them. Use the syntax similar
to the WEP keys to deal with setting difference SSIDs.

Bump up up the Card capabilities RID since they added 2 bytes to it
in the latest firmware. Thankfully we changed it from a terminal
failure so the card still worked but the driver whined.

Some cleanup patches from Marco Molteni.

Submitted by: Richard Johnson <raj@cisco.com>
Marco Molteni <molter@tin.it>
and myself
Various checks: David Wolfskill <david@catwhisker.org>
Reviewed by: Brooks Davis <brooks@freebsd.org>
Warner Losh <imp@freebsd.org>
Approved by: Brooks Davis <brooks@freebsd.org>
Warner Losh <imp@freebsd.org>
Obtained from: Linux emulation API's from Aironet driver.


86386 15-Nov-2001 imp

Minor style problem I introduced recently


86385 15-Nov-2001 imp

Hoist the Card/Card2 macros that I invented for the wi driver into
pccard layer and rename them PCMCIA_CARD and PCMCIA_CARD2 respectively
(note, this is being done with an eye towards NetBSD integreation so
it is easier to keep lists of cards between us and them in sync).

Use this in the an and wi drivers.


86384 15-Nov-2001 imp

Add PC4500 and 350 for newer cards in this line.

Obtained from: NetBSD's an driver (and FreeBSD's /etc/defaults/pccard.conf)


86382 15-Nov-2001 imp

Add NEWCARD support for aironet stuff.

PR: 24854
Submitted by: "Sam Habash" <the+xp@llama.com>
(with the mtx fix by Jonathan Chen)


86381 15-Nov-2001 imp

Fix comments about 'current' state of hardware/software


86259 11-Nov-2001 phk

fix typo.

PR: 31898
Submitted by: Michael Lyngbøl <lyngbol@bifrost.lyngbol.dk>


84811 11-Oct-2001 jhb

Add missing includes of sys/lock.h.


83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


83270 10-Sep-2001 brooks

Lots of style(9) related white space fixes. Mostly missing spaces
after if, for, while, switch, '{', and '}' plus a bunch of bogus
whitespace at the end of lines.


83269 10-Sep-2001 brooks

Add support for monitor mode. This means that after enabling the
correct mode via ancontrol, you can use bpf to sniff raw 802.11 frames.
Who want's to port AirSnort. ;-)

Submitted by: Doug Ambrisko <ambrisko@ambrisko.com> (author)
David Wolfskill <david@catwhisker.org> (port to current)


83130 06-Sep-2001 jlemon

Wrap array accesses in macros, which also happen to be lvalues:

ifnet_addrs[i - 1] -> ifaddr_byindex(i)
ifindex2ifnet[i] -> ifnet_byindex(i)

This is intended to ease the conversion to SMPng.


81221 06-Aug-2001 brooks

Add PCI ID for Cisco Aironet 350 Series cards. The patch differs
slightly from the submitted one.

PR: kern/29415
Submitted by: Bob Fleck <rfleck@cigital.com>


80449 27-Jul-2001 brooks

Cleanup duplication in Aironet headers

PR: kern/29210
Submitted by: Doug Ambrisko <ambrisko@ambrisko.com>
MFC after: 3 days


78639 22-Jun-2001 brooks

Fix a number of bugs in the implementation of the WEP related status
functions in ifconfig. "ifconfig an0" should output the correct
status now. Also, make the read and write functions both more
robust and more consistant. This should stop most of the incorrect
size complaints and eliminate the possiability of panics from firmware
that increases resource sizes.

PR: kern/27826
Reviewed by: imp, jlemon
Submitted by: Doug Ambrisko <ambrisko@ambrisko.com>
David Wolfskill <dhw@whistle.com>


78232 15-Jun-2001 peter

Fix warnings:
1831: warning: unused variable `noise'
1831: warning: unused variable `sig'


77217 26-May-2001 phk

Currently, each wireless networking driver has it's own control program
despite the fact that most people want to set exactly the same settings
regardless of which card they have. It has been repeatidly suggested
that this configuration should be done via ifconfig. This patch
implements the required functionality in ifconfig and add support to the
wi and an drivers. It also provides partial, untested support for the
awi driver.

PR: 25577
Submitted by: Brooks Davis <brooks@one-eyed-alien.net>


74914 28-Mar-2001 jhb

Catch up to header include changes:
- <sys/mutex.h> now requires <sys/systm.h>
- <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>


74698 23-Mar-2001 archie

A few fixes..

1 Make promiscuous mode work
2 A few header additions
3 Allow device config before IFF_UP

These were (respectively)...

Submitted by: Allan Saddi <asaddi@philosophysw.com>
Submitted by: Dave Cornejo <dave@dogwood.com>
Submitted by: Doug Ambrisko <ambrisko@ambrisko.com>
Tested by: David Wolfskill <dhw@whistle.com>


74144 12-Mar-2001 assar

change the default mode from adhoc to bss (infrastructure)

Reviewed by: Brooks Davis <brooks@one-eyed-alien.net>


72200 09-Feb-2001 bmilekic

Change and clean the mutex lock interface.

mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)


71228 19-Jan-2001 bmilekic

Implement MTX_RECURSE flag for mtx_init().
All calls to mtx_init() for mutexes that recurse must now include
the MTX_RECURSE bit in the flag argument variable. This change is in
preparation for an upcoming (further) mutex API cleanup.
The witness code will call panic() if a lock is found to recurse but
the MTX_RECURSE bit was not set during the lock's initialization.

The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to
MTX_RECURSED, which is more appropriate given its meaning.

The following locks have been made "recursive," thus far:
eventhandler, Giant, callout, sched_lock, possibly some others declared
in the architecture-specific code, all of the network card driver locks
in pci/, as well as some other locks in dev/ stuff that I've found to
be recursive.

Reviewed by: jhb


69771 08-Dec-2000 archie

Fixes to the Aironet driver to clear up some WEP issues.

PR: 23097
Submitted by: Doug Ambrisko <ambrisko@whistle.com>


69399 30-Nov-2000 alfred

remove unneded sys/ucred.h includes


68692 13-Nov-2000 wpaul

Close PR# 21843 and PR# 21864. This adds support for WEP and updates some
of the data structures to include new members that weren't defined in the
manual I have.

I opted to use Doug Ambrisko's WEP patches since David Cornejo's patches
did not include the necessary changes to ancontrol(8) to actually enable
and use WEP.

NOTE: I don't currently have access to an Aironet card, so I can't test
any of this. Everything compiles and close scrutiny doesn't reveal any
obvious problems, but Murphy's Law applies. This means I will probably
leave these changes in -current for a bit longer than usual until I'm
sure they work right.


67893 29-Oct-2000 phk

Move suser() and suser_xxx() prototypes and a related #define from
<sys/proc.h> to <sys/systm.h>.

Correctly document the #includes needed in the manpage.

Add one now needed #include of <sys/systm.h>.
Remove the consequent 48 unused #includes of <sys/proc.h>.


67365 20-Oct-2000 jhb

Catch up to moving headers:
- machine/ipl.h -> sys/ipl.h
- machine/mutex.h -> sys/mutex.h


67164 15-Oct-2000 phk

Remove unneeded #include <machine/clock.h>


67096 13-Oct-2000 wpaul

Remember to assign an_dev to device_t before calling an_attach().


67094 13-Oct-2000 wpaul

Convert the Aironet driver to use mutexes instead of spls.


64429 08-Aug-2000 peter

MF4: fix style(9) whitespace breakage.


63090 13-Jul-2000 archie

Make all Ethernet drivers attach using ether_ifattach() and detach using
ether_ifdetach().

The former consolidates the operations of if_attach(), ng_ether_attach(),
and bpfattach(). The latter consolidates the corresponding detach operations.

Reviewed by: julian, freebsd-net


61816 18-Jun-2000 roberto

- Add suser check before SIOCSAIRONET.
- Fix a splimp() w/o splx bug in the ioctl routine while I'm here.

Submitted by: Aaron Campbell <aaron@openbsd.org>


61048 28-May-2000 peter

Oops, nearly forgot to commit this one. Use correct register names, or
this will not compile without COMPAT_OLDPCI.


60536 14-May-2000 archie

Move code to handle BPF and bridging for incoming Ethernet packets out
of the individual drivers and into the common routine ether_input().
Also, remove the (incomplete) hack for matching ethernet headers
in the ip_fw code.

The good news: net result of 1016 lines removed, and this should make
bridging now work with *all* Ethernet drivers.

The bad news: it's nearly impossible to test every driver, especially
for bridging, and I was unable to get much testing help on the mailing
lists.

Reviewed by: freebsd-net


59391 19-Apr-2000 phk

Remove ~25 unneeded #include <sys/conf.h>
Remove ~60 unneeded #include <sys/malloc.h>


59313 17-Apr-2000 imp

Remove unloaded printf. We do this now in the newbus layer.


56094 16-Jan-2000 wpaul

Fix an instance of rman_get_start() than should be rman_get_bushandle().


56051 15-Jan-2000 wpaul

Actually read the PCI device ID when testing the device ID value against
the supported devices list.


55992 14-Jan-2000 wpaul

Add driver support for the Aironet 4500/4800 series wireless 802.11
NICs. (Finally!) The PCMCIA, ISA and PCI varieties are all supported,
though only the ISA and PCI ones will work on the alpha for now.
PCCARD, ISA and PCI attachments are all provided. Also provided an
ancontrol(8) utility for configuring the NIC, man pages, and updated
pccard.conf.sample. ISA cards are supported in both ISA PnP and hard-wired
mode, although you must configure the kernel explicitly to support the
hardwired mode since you have to know the I/O address and port ahead
of time.

Special thanks to Doug Ambrisko for doing the initial newbus hackery
and getting it to work in infrastructure mode.