Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/atw.c
RevisionDateAuthorComments
 1.172  21-Sep-2021  christos don't opencode kauth_cred_get()
 1.171  16-Jun-2021  riastradh if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around. And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail. (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint. This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken. However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.
 1.170  29-Jan-2020  thorpej branches: 1.170.10;
Adopt <net/if_stats.h>.
 1.169  10-Nov-2019  chs branches: 1.169.2;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.168  28-May-2019  msaitoh Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.167  23-May-2019  msaitoh Whitespace fix (mainly tabify).
 1.166  23-May-2019  msaitoh -No functional change:
- KNF
- u_int*_t -> uint*_t.
 1.165  05-Feb-2019  msaitoh Remove very old IFF_NOTRAILERS flag.
 1.164  26-Jun-2018  msaitoh branches: 1.164.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.163  01-May-2018  maya GC private 802.11 rateset declarations, use the standard ones.

Build tested only.
 1.162  23-Oct-2017  msaitoh branches: 1.162.2;
- Free resources correctly on some errors in atw_attach().
- Use apint*() insread of printf() in the attach function.
 1.161  02-Feb-2017  nonaka branches: 1.161.6;
wlan interfaces make interrupt routine running on softint context.

see http://mail-index.netbsd.org/tech-kern/2016/12/06/msg021281.html

tested device:
* ath at pci: AR5212, AR5424
* athn at pci: AR9287
* ipw at pci: 2100BG
* iwi at pci: 2915ABG
* iwm at pci: 3165, 7260, 8260
* iwn at pci: 4945, 6235
* ral at pci: RT2560
* rtwn at pci: RTL8192CE
 1.160  10-Jun-2016  ozaki-r branches: 1.160.2; 1.160.4;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.159  26-May-2016  ozaki-r Introduce M_CLEARCTX and use it instead of open-coding rcvif

No functional change.
 1.158  26-May-2016  ozaki-r Use M_GETCTX

No functional change.
 1.157  26-Jan-2016  christos PR/50692: David Binderman: Set the right wake up bits.
 1.156  22-Nov-2013  riz branches: 1.156.6;
Put back and properly mark a variable which is used iff ATW_DEBUG.
 1.155  17-Oct-2013  christos - remove unused variables
- move variables inside ifdef sections
- ifdef notdef unused code
- use __USE for debugging variables
 1.154  14-Sep-2013  joerg Don't include atw_hw_decrypted, it is not used. Keep it for
documentation purposes.
 1.153  02-Apr-2011  mbalmer branches: 1.153.4; 1.153.14; 1.153.18;
Fix misplaced parenthesis. From henning.petersen@t-online.de, thanks.
 1.152  13-Nov-2010  uebayasi branches: 1.152.2;
Include sys/proc.h for curproc.
 1.151  05-Apr-2010  joerg Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.150  24-Feb-2010  dyoung branches: 1.150.2;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
 1.149  19-Jan-2010  pooka branches: 1.149.2;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.148  08-Jan-2010  dyoung Expand PMF_FN_* macros.
 1.147  12-Nov-2009  dyoung Simplify activation hook.
 1.146  16-Sep-2009  dyoung In pmf(9), improve the implementation of device self-suspension
and make suspension by self, by drvctl(8), and by ACPI system sleep
play nice together. Start solidifying some temporary API changes.

1. Extract a new header file, <sys/device_if.h>, from <sys/device.h> and
#include it from <sys/pmf.h> instead of <sys/device.h> to break the
circular dependency between <sys/device.h> and <sys/pmf.h>.

2. Introduce pmf_qual_t, an aggregate of qualifications on a PMF
suspend/resume call. Start to replace instances of PMF_FN_PROTO,
PMF_FN_ARGS, et cetera, with a pmf_qual_t.

3. Introduce the notion of a "suspensor," an entity that holds a
device in suspension. More than one suspensor may hold a device
at once. A device stays suspended as long as at least one
suspensor holds it. A device resumes when the last suspensor
releases it.

Currently, the kernel defines three suspensors,

3a the system-suspensor: for system suspension, initiated
by 'sysctl -w machdep.sleep_state=3', by lid closure, by
power-button press, et cetera,

3b the drvctl-suspensor: for device suspension by /dev/drvctl
ioctl, e.g., drvctl -S sip0.

3c the system self-suspensor: for device drivers that suspend
themselves and their children. Several drivers for network
interfaces put the network device to sleep while it is not
administratively up, that is, after the kernel calls if_stop(,
1). The self-suspensor should not be used directly. See
the description of suspensor delegates, below.

A suspensor can have one or more "delegates". A suspensor can
release devices that its delegates hold suspended. Right now,
only the system self-suspensor has delegates. For each device
that a self-suspending driver attaches, it creates the device's
self-suspensor, a delegate of the system self-suspensor.

Suspensors stop a system-wide suspend/resume cycle from waking
devices that the operator put to sleep with drvctl before the cycle.
They also help self-suspension to work more simply, safely, and in
accord with expectations.

4. Add the notion of device activation level, devact_level_t,
and a routine for checking the current activation level,
device_activation(). Current activation levels are DEVACT_LEVEL_BUS,
DEVACT_LEVEL_DRIVER, and DEVACT_LEVEL_CLASS, which respectively
indicate that the device's bus is active, that the bus and device are
active, and that the bus, device, and the functions of the device's
class (network, audio) are active.

Suspend/resume calls can be qualified with a devact_level_t.
The power-management framework treats a devact_level_t that
qualifies a device suspension as the device's current activation
level; it only runs hooks to reduce the activation level from
the presumed current level to the fully suspended state. The
framework treats a devact_level_t qualifying device resumption
as the target activation level; it only runs hooks to raise the
activation level to the target.

5. Use pmf_qual_t, devact_level_t, and self-suspensors in several
drivers.

6. Temporarily add an unused power-management workqueue that I will
remove or replace, soon.
 1.145  13-Sep-2009  dyoung Experimental support for fragmentation and RTS/CTS.

Delete unused atw_voodoo and constants.

Export Tx/Rx statistics with evcnt(9).

Correct the Short Inter-Frame Space (SIFS) that we write to ADM8211's
registers; I do not recall if that corrected the SIFS that I observed
"on the air." Use the constant IEEE80211_DUR_DS_EIFS to configure
the ADM8211's EIFS, instead of writing the same "magic" number,
0x64, that my reference driver wrote.

Do not clear OACTIVE in atw_init(), because atw_stop() cleared it
previously by calling atw_txdrain().

Use the net80211 short-preamble flag and instead of ATW_SHPREAMBLE.

Add an ADM8211 workaround from the reference driver, atw_workaround1(),
but don't compile it right now.

In at_intr(), don't stop processing the interrupt status after
restarting the receive ring, but process Tx interrupt status. If
a packet's Tx lifetime is exceeded, reinitialize the device to get
packets moving again. If the Tx FIFO underflows, restart the
transmitter, not the receiver!

Avoid losing synchronization with the Rx ring by replicating one
of Charles Hannum's fixes to rtw(4) here: receiving a management
packet may, as a side-effect, reset the Rx ring, so refer to the
softc's Rx ring pointer, sc_rxptr, every time through the loop in
atw_rxintr(), instead of refering to a pointer on the stack, i.

Re-synchronize DMA after reading the OWN bit on an Rx/Tx descriptor.
XXX This needs more work.

Reset sc_tx_timer as Tx descriptors are reclaimed from the device.

Shorten staircases in atw_watchdog().

Remove from softc an unused member, sc_intr_ack.
 1.144  05-Sep-2009  tsutsui Invert logic around nested pmf(9) registrations for readability.
 1.143  26-May-2009  dyoung Wrap some long lines. No functional change intended.
 1.142  16-Dec-2008  christos branches: 1.142.2;
replace bitmask_snprintf(9) with snprintb(3)
 1.141  07-Nov-2008  dyoung *** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability. KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:

switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
 1.140  09-Jul-2008  joerg branches: 1.140.2;
- device/softc split
 1.139  30-Apr-2008  ad branches: 1.139.2; 1.139.4; 1.139.6;
Make various bits of debug code compile again.
 1.138  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.137  08-Apr-2008  cegger branches: 1.137.2; 1.137.4;
use aprint_*_dev and device_xname
 1.136  11-Mar-2008  dyoung Prepare for PMF self-suspension: in the if_stop() methods, clear
IFF_UP and IFF_RUNNING before running the 'disable' step, instead
of after. Soon I will handle the 'disable' step by calling into
PMF, which may call if_stop(, 0). Ordinarily, that is harmless.
This change lets the if_stop() routines exit early when they find
on entry that IFF_RUNNING is not set.
 1.135  07-Mar-2008  dyoung Use device_t and accessors. Use PMF instead of legacy power
management. Establish the shutdown hook using PMF.
 1.134  16-Nov-2007  dyoung branches: 1.134.10; 1.134.14;
Count received frames, Rx PLCP errors, Rx FCS (CRC32) errors, and
Rx ICV errors using evcnt(9).

In promiscuous mode, and when scanning (hmm), ask the NIC for bad
packets (e.g., those that do not pass CRC32). Pass bad packets to
radiotap listeners. Pass packets to radiotap listeners before
stripping FCS. Re-order operations in atw_rxintr() to accomplish
all of this without passing bad packets up to net80211.

Set radiotap channel once in atw_tune() instead of in atw_rxintr().

Fix an endianness bug: it_len is little-endian, but bpf_mtap2()'s
argument needs to be in host order.
 1.133  16-Nov-2007  dyoung Cosmetic: rename some variables and constants. Move some constants
from atw.c to atwreg.h.
 1.132  16-Nov-2007  dyoung Replace some magic numbers with HFA3861A register names.

Do not alias the Rx descriptor word ar_ctl to ar_rssi with a #define.
Instead, call the member ar_ctlrssi.

Convert the ugly macro ATW_RXDESC_INIT() to an inline subroutine,
atw_rxdesc_init().

Do not load an empty IEEE80211_RADIOTAP_FLAGS field into the Tx
radiotap header.
 1.131  15-Nov-2007  dyoung Use __arraycount().
 1.130  19-Oct-2007  ad branches: 1.130.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.129  29-Sep-2007  scw branches: 1.129.2;
s/NPBFILTER/NBPFILTER/ in some #endif comments. No functional change.
 1.128  01-Sep-2007  dyoung branches: 1.128.2;
Change a bazillion occurrences of code resembling this,

error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ec) :
ether_delmulti(ifr, &sc->sc_ec);

if (error == ENETRESET) {

to this,

if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number. This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
 1.127  09-Jul-2007  ad branches: 1.127.2; 1.127.6; 1.127.8;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.126  04-Mar-2007  christos branches: 1.126.2; 1.126.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.125  24-Nov-2006  christos branches: 1.125.4;
fix spelling of accommodate; from Zapher.
 1.124  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.123  13-Nov-2006  dyoung Stop using typeof() in the bit-twiddling macros, per yamt@'s
suggestion. This change requires that I use the __PRIuBITS format
string in atw and rtw, so do that.
 1.122  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.121  04-Oct-2006  christos prevent empty if.
 1.120  24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.119  31-Aug-2006  dyoung branches: 1.119.2; 1.119.4;
Per discussion on tech-kern and tech-userlevel, move the bit-twiddling
macros, __BIT, __BITS, SHIFTIN, SHIFTOUT, and __arraycount() from
lib/libkern/libkern.h to sys/cdefs.h. Add a __-prefix to SHIFTIN
and SHIFTOUT, and add a manual page for the bit-twiddling macros,
bits(3).

Make the __BIT and __BITS macros "widthless," as best I can, by
changing their type to uintmax_t from uint32_t. XXX The manual
page lags this change by a bit.

Define __PRIxBIT and __PRIxBITS printf(3) format strings.
 1.118  17-Aug-2006  christos Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
 1.117  06-Apr-2006  dyoung In atw_start, do not initialize lasttx with -1, but initialize it
with the next free transmit descriptor. Now, it is more obvious
that lasttx is not an illegal negative index into the descriptor
ring. Remove a superfluous assertion.

Addresses Coverity CID 1319.
 1.116  06-Apr-2006  dyoung Correct sc_bbptype, sc_rftype bounds checks. Fixes Coverity CID
1541.
 1.115  28-Mar-2006  dyoung Revamp ieee80211_get_rate. Now it does not use the rateset in the
ic->ic_bss, but it uses the rateset in its new ieee80211_node
argument, instead. If the rate is fixed by ic->ic_fixed_rate, but
the fixed rate is not in the node's rateset, choose a reasonable
default: prefer the lowest basic rate or, if there is no basic
rate, prefer the lowest rate, period.

Change a printf complaint to a debug message.

Adapt drivers to suit new ieee80211_get_rate calling convention.

XXX I really need to replace ieee80211_get_rate with a bitrate
XXX adaptation algorithm. Soon, soon....
 1.114  12-Mar-2006  dyoung branches: 1.114.2;
Note in radiotap header file and manual page that radiotap fields
are little-endian. Fix wi(4) and atw(4) to reflect this fact.
 1.113  08-Mar-2006  lukem Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.112  08-Mar-2006  dyoung Change macro names to avoid collisions:

BIT -> __BIT
BITS -> __BITS
 1.111  08-Mar-2006  dyoung Straggler from previous commit: rename macro LSHIFT->SHIFTIN.
 1.110  08-Mar-2006  dyoung Move my bit-twiddling macros to libkern.h from my drivers, where
I had duplicated them. Improve the macros' names. Simplify their
implementation.

A brief description of each macro is below.

BIT(n): Return a bitmask with bit m set, where the least
significant bit is bit 0.

BITS(m, n): Return a bitmask with bits m through n, inclusive,
set. It does not matter whether m>n or m<=n.
The least significant bit is bit 0.

A "bitfield" is a span of consecutive bits defined by a
bitmask, where 1s select the bits in the bitfield. SHIFTIN,
SHIFTOUT, and SHIFTOUT_MASK help read and write bitfields
from device registers.

SHIFTIN(v, mask): Left-shift bits `v' into the bitfield
defined by `mask', and return them. No
side-effects.

SHIFTOUT(v, mask): Extract and return the bitfield selected
by `mask' from `v', right-shifting the
bits so that the rightmost selected bit
is at bit 0. No side-effects.

SHIFTOUT_MASK(mask): Right-shift the bits in `mask' so that
the rightmost non-zero bit is at bit
0. This is useful for finding the
greatest unsigned value that a bitfield
can hold. No side-effects. Note that
SHIFTOUT_MASK(m) = SHIFTOUT(m, m).

Examples:

/*
* Register definitions taken from the RFMD RF3000 manual.
*/
#define RF3000_GAINCTL 0x11 /* TX variable gain control */
#define RF3000_GAINCTL_TXVGC_MASK BITS(7, 2)
#define RF3000_GAINCTL_SCRAMBLER BIT(1)

/*
* Shift the transmit power into the transmit-power field of the
* gain-control register and write it to the baseband processor.
*/
atw_rf3000_write(sc, RF3000_GAINCTL,
SHIFTIN(txpower, RF3000_GAINCTL_TXVGC_MASK));


/*
* Register definitions taken from the ADMtek ADM8211 manual.
*
*/
#define ATW_RXSTAT_OWN BIT(31) /* 1: NIC may fill descriptor */
/* ... */
#define ATW_RXSTAT_DA1 BIT(17) /* DA bit 1, admin'd address */
#define ATW_RXSTAT_DA0 BIT(16) /* DA bit 0, group address */
#define ATW_RXSTAT_RXDR_MASK BITS(15,12) /* RX data rate */
#define ATW_RXSTAT_FL_MASK BITS(11,0) /* RX frame length, last
* descriptor only
*/

/* Extract the frame length from the Rx descriptor's
* status field.
*/
len = SHIFTOUT(rxstat, ATW_RXSTAT_FL_MASK);
 1.109  20-Feb-2006  thorpej branches: 1.109.2; 1.109.4;
Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
 1.108  19-Feb-2006  dyoung ADM8211 hardware WEP is not working (probably due to a bug in 802.11
Duration / PLCP Length calculation), so temporarily switch to
software WEP, which is working.
 1.107  18-Feb-2006  dyoung When atw_enable is called, power may have been removed and re-applied,
so invalidate the WEP SRAM to force us to write the keys back to
the hardware.
 1.106  18-Feb-2006  dyoung Fix serious regression in AP-client mode: program adapter's BSSID
as we enter the IEEE80211_S_AUTH and IEEE80211_S_ASSOC states, so
that we don't send 802.11 Authentication and Association frames
with BSSID=00:00:00:00:00:00.
 1.105  29-Dec-2005  dyoung branches: 1.105.2; 1.105.4; 1.105.6;
Remove declaration of deleted subroutine, atw_change_ibss().
 1.104  29-Dec-2005  dyoung Extract subroutine is_running().

If ieee80211_ioctl() returns ERESTART, reinitialize interface with
atw_init().

Don't discard the error returned by atw_init() in atw_media_change().
 1.103  29-Dec-2005  dyoung atw_start() need not update IFF_OACTIVE if it hasn't put a new
packet on the transmit ring, so don't do that.
 1.102  29-Dec-2005  dyoung Assert consistency of IFF_OACTIVE / out of sw/hw transmit descriptors
state.
 1.101  29-Dec-2005  dyoung Always tickle the Receive Demand Register (ATW_RDR) after re-enabling
the receiver.
 1.100  29-Dec-2005  dyoung A couple changes to the hardware reset:

Wait for the SWR bit in ATW_PAR to turn to 0, instead of waiting
for the whole register to turn to 0.

For ease of comparison with a reference driver, re-order operations.
 1.99  29-Dec-2005  dyoung Cosmetic: make a three-step staircase out of a four-step staircase.
 1.98  29-Dec-2005  dyoung Revamp state machine:

1 Only stop beacon generation on an ->INIT transition.

2 Merge AUTH and ASSOC cases, they do the same thing (tune
a new channel).

3 Start beacon generation in IBSS, AP, *and* "adhoc demo"
mode.

Cosmetic tweak: rewrap a statement.
 1.97  29-Dec-2005  dyoung Adapt atw(4) to the new IBSS merge idiom, where ieee80211_ibss_merge()
does not return ENETRESET to indicate the station should adopt a
new BSSID, but it triggers a RUN->RUN transition, instead.
 1.96  29-Dec-2005  dyoung Delete atw_media_status(). Let SIOCGIFMEDIA call ieee80211_media_status()
directly for media status.
 1.95  29-Dec-2005  dyoung Use the fragmentation threshold in the ieee80211com.

XXX Need to condition on frame type = data.
 1.94  29-Dec-2005  dyoung In atw_init(), always call atw_write_wep() to write the WEP state
to the h/w. This prevents a spurious call to atw_write_wep() later,
in IEEE80211_S_RUN state, when net80211 times-out ieee80211_nodes.
It is important to avoid a spurious atw_write_wep() call because
in IBSS mode, at least, WEP re-initialization reliably locks up
the transmitter.

XXX There must be a bug in atw_write_wep() that causes it to lock
XXX up the transmitter. I will revisit it later.
 1.93  29-Dec-2005  dyoung In atw(4), use ieee80211_compute_duration() to compute IEEE 802.11
Duration and PLCP Length fields, and delete the abominable
atw_frame_setdurs() subroutine.

Make rtw(4) use the new ieee80211_compute_duration() calling
convention.

Add an ieee80211_key argument to ieee80211_compute_duration() and
lightly constify arguments. Get the crypto header length from the
key argument instead of blithely assuming a WEP header. Add some
inline documentation. Account for data padding (IEEE80211_F_DATAPAD).
 1.92  24-Dec-2005  perry Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.91  23-Nov-2005  dyoung Misc. bug fixes:

1 Reset both IFF_OACTIVE and the transmit watchdog timer in
appropriate places to avoid both wedging the transmit section
and spurious transmit timeouts.

2 Reset IFF_ALLMULTI at the top of atw_filter_setup so that the
NIC will filter the multicast packets we are not interested in
after we come out of promiscuous mode.

3 In atw_txdrain, count drained transmit descriptors to avoid
descriptor exhaustion.
 1.90  18-Nov-2005  skrll Adapt drivers to the new net80211(9).

Most of this is from dyoung@. Thanks!
 1.89  07-Jul-2005  dyoung branches: 1.89.6;
Don't write WEP keys to the chip unless it is enabled.

Suspend and restart the transmit/receive engines while writing WEP
keys.
 1.88  06-Jul-2005  dyoung Historically, an(4), ath(4), atw(4), rtw(4), and wi(4) have printed
out their modes and rates at boot. Revert to the historical
behavior.
 1.87  26-Jun-2005  dyoung branches: 1.87.2;
Do not build AP support if 'options IEEE80211_NO_HOSTAP' is in the
kernel configuration.
 1.86  25-Jun-2005  dyoung Cosmetic: join lines.
 1.85  22-Jun-2005  dyoung Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD. Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]). Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.
 1.84  27-Feb-2005  perry nuke trailing whitespace
 1.83  31-Jan-2005  thorpej Eliminate use of M_HASFCS.
 1.82  04-Jan-2005  dyoung branches: 1.82.2; 1.82.4;
IBSS-merge clean-up, inspired by some Linux patches from Jon Anderson
(mail@janderson.ca): remove ieee80211_ibss_merge's TSFT argument.
Do the TSFT comparison in the drivers (ath, atw). Remove a lot of
extraneous debug statements from ieee80211_ibss_merge.

Set the ieee80211_node's state to IEEE80211_STA_BSS after it's been
copied to the ic_bss, not before.

In struct ieee80211_node, make the ni_tstamp field a union of a
uint64_t and the 8 TSF octets so that it's easier to compare a
neighbor's TSF with the local TSF.

Log IBSS merges (Greg Troxel's suggestion). Also log IBSS creation.
These are rare and important events that deserve to be logged.
 1.81  27-Dec-2004  mycroft Replace d_plcp_svc with d_residue. The latter is the number of whole
empty/unused octets to fill out the data time slot. The value is constrained
by math to 0 for <= 5.5Mb, 0-1 for 11Mb, and 0-2 for 22Mb. It is used to
signal to the MAC that there is residue.
 1.80  30-Oct-2004  thorpej When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.79  10-Aug-2004  dyoung Make the node table into an LRU cache: least-recently used nodes
are at the end of the node queue. Change the reference-counting
discipline: ni->ni_refcnt indicates how many times net80211 has
granted ni to the driver. Every node in the table with ni_refcnt=0
is eligible to be garbage-collected. The mere presence of a node
in the table does not any longer indicate its auth/assoc state;
nodes have a ni_state variable, now. A sysctl,
net.link.ieee80211.maxnodecache, controls the maximum LRU cache
size.

While I am here, patch ieee80211_find_node_for_beacon to do a "best
match" by bssid/ssid/channel, not a "perfect match." This keeps
net80211 from caching duplicate nodes in the table.
 1.78  28-Jul-2004  dyoung branches: 1.78.2;
Vastly simplify ieee80211_ibss_merge, eliminating the needless
callbacks. Change the reference IBSS-merge implementation in atw
to match.
 1.77  27-Jul-2004  dyoung Cancel scan callout when the device detaches. Pointed out by Todd
Miller.
 1.76  24-Jul-2004  dyoung Pull the IBSS merge logic out of atw and into net80211, since ath
will eventually share it.

In the IBSS merge logic, check conditions in a different order so
that they run faster in the common case---no merge. Fix the
rate-limiting on the debug outputs (enabled by IFF_LINK0).
 1.75  24-Jul-2004  dyoung Doh, we really do need to set bit ATW_NAR_MM in ATW_NAR, or else
no multicast packets are let through.
 1.74  24-Jul-2004  dyoung Add atw_nar_init, atw_next_scan prototypes (thanks Todd Miller)
and sort prototypes.

In-line atw_tsft.
 1.73  23-Jul-2004  mycroft Cleanup of ieee80211_node from madwifi:
* Don't use ifp pointers; use ieee80211com.
* Implement the locking macros that are used under FreeBSD and Linux.
 1.72  23-Jul-2004  mycroft Fix mismerge.
 1.71  23-Jul-2004  mycroft IEEE80211_F_WEPON -> IEEE80211_F_PRIVACY
 1.70  23-Jul-2004  dyoung Instrument atw(4) delays so that I can experiment and shorten the
conservative delays that I derived from the reference driver.
 1.69  23-Jul-2004  dyoung Print and store Cardbus/PCI revision number.

Begin conditioning device configuration on revision number. Four
revisions are known:

1.1/1.5 -> ADM8211A,
2.0 -> ADM8211B,
3.0 -> ADM8211C.

The B and C parts, which are not supported yet, have AP capability.
 1.68  23-Jul-2004  dyoung Fix IBSS merges in atw(4).
 1.67  23-Jul-2004  dyoung Use the new SRAM size constants.
 1.66  16-Jul-2004  dyoung The RSSI field in the Rx descriptor is the unadulterated content
of the DIVCTL/RSSI register on the RF3000 baseband. Mask all but
the RSSI bits.
 1.65  15-Jul-2004  dyoung Insist that callers use atw_write_sram to copy even-length buffers
to even offsets in the ADM8211 SRAM.

assert->KASSERT
 1.64  15-Jul-2004  dyoung Totally revamp device initialization using clue from the reference
driver. I also have re-organized the code a lot.
 1.63  15-Jul-2004  dyoung Totally revamp device resets using clue from the reference driver.
 1.62  15-Jul-2004  dyoung Make atw_read_srom static.
 1.61  15-Jul-2004  dyoung Re-organize, add new, and remove old prototypes.
 1.60  15-Jul-2004  dyoung Once again, stop calling the bus front-end's interrupt-acknowledgement
callback.
 1.59  15-Jul-2004  dyoung Totally revamp the way that I program the synthesizer and baseband.
 1.58  15-Jul-2004  dyoung Take the paranoia out of the code for writing baseband registers.
 1.57  15-Jul-2004  dyoung Simplify the Rx filter setup, following the AL981 code in tlp(4).
 1.56  15-Jul-2004  dyoung Countdown correctly to the Target Beacon Transmission Time.
Borrowing an idea from the reference driver, use no 64-bit arithmetic.
 1.55  15-Jul-2004  dyoung In atw_start_beacon, set CAP0 as well as BCNT and CAP1.
 1.54  15-Jul-2004  dyoung Simplify IBSS merge code.
 1.53  15-Jul-2004  dyoung Only write the SSID buffer to the ADM8211 SRAM up to the end of
the SSID, not up to the end of the buffer. Given the (too
conservative?) delays involved, this should save some time when we
join a new network.
 1.52  15-Jul-2004  dyoung Change the order in which I write the BSSID registers on the ADM8211,
to match the reference driver. This probably does not make any
functional difference.
 1.51  15-Jul-2004  dyoung Set up the Tx descriptor ring more safely. Fix an endianness bug.
"It's a wonder this ever worked." (Actually, it's not.)
 1.50  15-Jul-2004  dyoung Re-synchronize TSFT after an IBSS merge.
 1.49  15-Jul-2004  dyoung Delay for tens of milliseconds lot after writing the Network Access
Register. I am slavishly imitating the reference driver, here.
I will come back and lower the delays later.
 1.48  15-Jul-2004  dyoung In the transmit interrupt handler, do not unnecessarily synchronize
all the descriptors for a buffer chain. Just synchronize the last
one, which has the interesting stuff.

I still synchronize all the descriptors for the buffer chain if
super-verbose debugging is enabled, since the driver will print
all the descriptors for the chain.
 1.47  15-Jul-2004  dyoung Remove a less-than-helpful comment.
 1.46  15-Jul-2004  dyoung Clamp the length of a received packet, just in case the chip lies.
 1.45  15-Jul-2004  dyoung When super-verbose debugging is enabled, convert Rx descriptors'
endianness before printing them.
 1.44  15-Jul-2004  dyoung Delete some dead code.

Don't call back into the bus-specific code for resets any longer.
It does not seem to be necessary.
 1.43  15-Jul-2004  dyoung During scans, initialize the BSSID to ff:ff:ff:ff:ff:ff before
sending the first probe request.
 1.42  15-Jul-2004  dyoung Clear dead code out of atw_clear_sram.
 1.41  15-Jul-2004  dyoung Don't send data packets until the interface is in state RUN. This
stops ARP and IPv6 Neighbor Discovery packets from trickling out
the interface before it is time.
 1.40  15-Jul-2004  dyoung I'm not treating the lost beacon count specially any more. It is
kind of a dumb way to track the link condition, anyway....
 1.39  15-Jul-2004  dyoung Rid atw of some dead code and some test instrumentation.
 1.38  15-Jul-2004  dyoung In ad hoc mode, don't set the mysterious EA bit in the Network
Access Register. ADMtek's reference driver does not use it at all,
and it does not seem to make any difference whether I leave it in
or take it out.
 1.37  23-Jun-2004  dyoung Only drain the transmit queue if we are idling the transmit section.
 1.36  23-Jun-2004  dyoung After we wait for the MAC's transmit section to idle, drain the
transmit queue and cancel the watchdog timer. This ends the annoying
"atw0: transmit timeout" messages that disrupted my WiFi tonight.
 1.35  23-Jun-2004  dyoung Fix a commit-o: handle all cases in the switch-statement.
 1.34  23-Jun-2004  dyoung Don't skip the reset! atw was not getting reset at device attachment.
atw seems to work better now that it gets this right: for one thing,
the RSSI can be seen to change as I walk around the office with my
laptop.

Thanks to Todd C. Miller for pointing out my mistake.
 1.33  23-Jun-2004  dyoung Fix typo: change ATW_RFTYPE_RFMD and family to ATW_BBPTYPE_RFMD.

This does not make any functional difference: each manufacturer's
RF type-number is the same as its BBP type-number.
 1.32  06-Jun-2004  dyoung In ad hoc mode, ignore the MAC's link up/down indication, since it
does not appear to be reliable.
 1.31  05-Jun-2004  dyoung No need to detect and exit on short 802.11 packets, since
ieee80211_input will do that (and tap the packet).
 1.30  31-May-2004  dyoung It's only necessary to set do_encrypt in one place, so do that.
 1.29  31-May-2004  dyoung Cosmetic: fix comment typo, change bit-test style.
 1.28  31-May-2004  dyoung Name the shift, txpower << 2 -> LSHIFT(txpower, RF3000_GAINCTL_TXVGC_MASK).
 1.27  31-May-2004  dyoung Wrap a line. Remove a useless comment.
 1.26  31-May-2004  dyoung Describe Tx/Rx state a little better using clue from the ADM8211C/CR
datasheet.
 1.25  31-May-2004  dyoung Use bpf_mtap2.
 1.24  17-Feb-2004  dyoung branches: 1.24.2;
Move the RF Microdevices RF3000 & Silicon Laboratories SI4126/SI4136
register sets into their own header files for re-use by future
drivers.
 1.23  29-Jan-2004  dyoung Get rid of __P.
 1.22  29-Jan-2004  dyoung Only pass 802.11 frames up if they are greater than the minimum
size or else if monitor mode is enabled.
 1.21  29-Jan-2004  dyoung Avoid division by zero when computing the link-lost lost-beacons
threshold.
 1.20  29-Jan-2004  dyoung Deal with the RSSI as an unsigned value.
 1.19  13-Jan-2004  dyoung NetBSD's KASSERT takes just one argument while FreeBSD's takes two,
so I have added IASSERT(cond, complaint) to the compatibility header
file and s/KASSERT/IASSERT/'d.
 1.18  10-Jan-2004  dyoung Rounding to the nearest multiple of 2 with roundup(constant, 2) is
easier to read than `constant + 1'.
 1.17  10-Jan-2004  dyoung In atw_rf3000_tune, enable I/O with the modem and RF front-end
"just in time" instead of at the top of the function.
 1.16  10-Jan-2004  dyoung Do not set IEEE80211_F_IBSSON in hostap mode. Treat hostap-mode
when the link condition changes by returning.

Note that hostap mode still does not work in atw, and ADMtek has
told me that the hardware will not support it, but I remain hopeful.
 1.15  10-Jan-2004  dyoung Report received-early interrupt with a debug printf.

Print the Serial EEPROM and the MAC address it contains when
atw_debug > 0, because atw_debug > 1 is a little too strict.
 1.14  10-Jan-2004  dyoung Misc. cosmetic changes.

Add a debug printf to the input path.
 1.13  10-Jan-2004  dyoung Use new docs provided by RFMD to give some meaning to
previously-undocumented registers and magic numbers on the RF3000
baseband.
 1.12  16-Nov-2003  dyoung Add data-link type DLT_IEEE802_11_RADIO to wi and atw. DLT_IEEE802_11_RADIO
lets you monitor radio stats like received signal strength, which
diversity antenna was used, channel/frequency, modulation, and data
rate.
 1.11  02-Nov-2003  dyoung No need to check which state we're changing FROM when we deactivate
the scan callout.
 1.10  02-Nov-2003  dyoung Get a clue from ath(4) and move the ieee80211_new_state() calls in
atw_init to one place.
 1.9  02-Nov-2003  dyoung Fix thinko that breaks IBSS merges in atw(4). sc->sc_opmode !=
ic->ic_opmode!
 1.8  02-Nov-2003  dyoung Use ieee80211_find_rxnode to attribute Rx packets to the write
ieee80211_node. This reduces code duplication. It will help us
support passive scanning and rate adaptation.
 1.7  25-Oct-2003  christos make this compile again. I should really rename the FreeBSD KASSERT to
KASSERT2 or something.
 1.6  25-Oct-2003  christos KASSERT takes 2 arguments here.
 1.5  25-Oct-2003  christos Fix uninitialized variable warnings
 1.4  16-Oct-2003  dyoung Cosmetic change: shorten 6 lines to 2.
 1.3  13-Oct-2003  dyoung Adapt atw(4) to the new 802.11 layer.

Simplify atw_start, atw_newstate.

Synchronize access to atw_start by bracketing the call to
ieee80211_next_scan in atw_next_scan with splnet()/splx().
 1.2  20-Sep-2003  dyoung Allow channels 1-14 in MMK2, for real. Fixes PR 22530 from
FUKAUMI Naoki.
 1.1  06-Jul-2003  dyoung Oops. Add the atw(4) sources, too.
 1.24.2.2  27-Jun-2004  jdc branches: 1.24.2.2.2;
Pull up revisions 1.36-1.37 (requested by dyoung in ticket #552).

After we wait for the MAC's transmit section to idle, drain the
transmit queue and cancel the watchdog timer. This ends the annoying
"atw0: transmit timeout" messages that disrupted my WiFi tonight.


Only drain the transmit queue if we are idling the transmit section.
 1.24.2.1  27-Jun-2004  jdc Pull up revision 1.34 (requested by dyoung in ticket #551).

Don't skip the reset! atw was not getting reset at device attachment.
atw seems to work better now that it gets this right: for one thing,
the RSSI can be seen to change as I walk around the office with my
laptop.

Thanks to Todd C. Miller for pointing out my mistake.
 1.24.2.2.2.1  24-Jan-2005  he Pull up revision 1.80 (requested by thorpej in ticket #939):
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#27678.
 1.78.2.11  11-Dec-2005  christos Sync with head.
 1.78.2.10  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.78.2.9  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.78.2.8  04-Feb-2005  skrll Sync with HEAD.
 1.78.2.7  17-Jan-2005  skrll Sync with HEAD.
 1.78.2.6  02-Nov-2004  skrll Sync with HEAD.
 1.78.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.78.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.78.2.3  12-Aug-2004  skrll Sync with HEAD.
 1.78.2.2  03-Aug-2004  skrll Sync with HEAD
 1.78.2.1  28-Jul-2004  skrll file atw.c was added on branch ktrace-lwp on 2004-08-03 10:46:11 +0000
 1.82.4.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.82.4.1  12-Feb-2005  yamt sync with head.
 1.82.2.1  29-Apr-2005  kent sync with -current
 1.87.2.6  17-Mar-2008  yamt sync with head.
 1.87.2.5  07-Dec-2007  yamt sync with head
 1.87.2.4  27-Oct-2007  yamt sync with head.
 1.87.2.3  03-Sep-2007  yamt sync with head.
 1.87.2.2  30-Dec-2006  yamt sync with head.
 1.87.2.1  21-Jun-2006  yamt sync with head.
 1.89.6.2  29-Nov-2005  yamt sync with head.
 1.89.6.1  22-Nov-2005  yamt sync with head.
 1.105.6.1  22-Apr-2006  simonb Sync with head.
 1.105.4.1  09-Sep-2006  rpaulo sync with head
 1.105.2.1  01-Mar-2006  yamt sync with head.
 1.109.4.1  19-Apr-2006  elad sync with head.
 1.109.2.4  03-Sep-2006  yamt sync with head.
 1.109.2.3  11-Apr-2006  yamt sync with head
 1.109.2.2  01-Apr-2006  yamt sync with head.
 1.109.2.1  13-Mar-2006  yamt sync with head.
 1.114.2.2  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.114.2.1  28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.119.4.2  10-Dec-2006  yamt sync with head.
 1.119.4.1  22-Oct-2006  yamt sync with head
 1.119.2.2  12-Jan-2007  ad Sync with head.
 1.119.2.1  18-Nov-2006  ad Sync with head.
 1.125.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.126.4.1  11-Jul-2007  mjf Sync with head.
 1.126.2.3  23-Oct-2007  ad Sync with head.
 1.126.2.2  09-Oct-2007  ad Sync with head.
 1.126.2.1  01-Jul-2007  ad Adapt to callout API change.
 1.127.8.3  23-Mar-2008  matt sync with HEAD
 1.127.8.2  09-Jan-2008  matt sync with HEAD
 1.127.8.1  06-Nov-2007  matt sync with HEAD
 1.127.6.4  21-Nov-2007  joerg Sync with HEAD.
 1.127.6.3  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.127.6.2  02-Oct-2007  joerg Sync with HEAD.
 1.127.6.1  03-Sep-2007  jmcneill Sync with HEAD.
 1.127.2.1  03-Sep-2007  skrll Sync with HEAD.
 1.128.2.1  06-Oct-2007  yamt sync with head.
 1.129.2.2  18-Nov-2007  bouyer Sync with HEAD
 1.129.2.1  25-Oct-2007  bouyer Sync with HEAD.
 1.130.2.1  19-Nov-2007  mjf Sync with HEAD.
 1.134.14.4  17-Jan-2009  mjf Sync with HEAD.
 1.134.14.3  28-Sep-2008  mjf Sync with HEAD.
 1.134.14.2  02-Jun-2008  mjf Sync with HEAD.
 1.134.14.1  03-Apr-2008  mjf Sync with HEAD.
 1.134.10.1  24-Mar-2008  keiichi sync with head.
 1.137.4.6  11-Aug-2010  yamt sync with head.
 1.137.4.5  11-Mar-2010  yamt sync with head
 1.137.4.4  16-Sep-2009  yamt sync with head
 1.137.4.3  20-Jun-2009  yamt sync with head
 1.137.4.2  04-May-2009  yamt sync with head.
 1.137.4.1  16-May-2008  yamt sync with head.
 1.137.2.1  18-May-2008  yamt sync with head.
 1.139.6.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.139.6.1  19-Oct-2008  haad Sync with HEAD.
 1.139.4.1  18-Jul-2008  simonb Sync with head.
 1.139.2.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.140.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.142.2.1  23-Jul-2009  jym Sync with HEAD.
 1.149.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.150.2.3  21-Apr-2011  rmind sync with head
 1.150.2.2  05-Mar-2011  rmind sync with head
 1.150.2.1  30-May-2010  rmind sync with head
 1.152.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.153.18.1  18-May-2014  rmind sync with head
 1.153.14.2  03-Dec-2017  jdolecek update from HEAD
 1.153.14.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.153.4.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.156.6.4  05-Feb-2017  skrll Sync with HEAD
 1.156.6.3  09-Jul-2016  skrll Sync with HEAD
 1.156.6.2  29-May-2016  skrll Sync with HEAD
 1.156.6.1  19-Mar-2016  skrll Sync with HEAD
 1.160.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.160.2.1  20-Mar-2017  pgoyette Sync with HEAD
 1.161.6.1  10-Dec-2017  snj Pull up following revision(s) (requested by msaitoh in ticket #427):
sys/arch/amiga/dev/if_bah_zbus.c: 1.17
sys/arch/arm/broadcom/bcm53xx_eth.c: 1.30
sys/arch/powerpc/booke/dev/pq3etsec.c: 1.32
sys/arch/usermode/dev/if_veth.c: 1.9
sys/dev/ic/an.c: 1.66
sys/dev/ic/athn.c: 1.17
sys/dev/ic/atw.c: 1.162
sys/dev/ic/bwi.c: 1.33
sys/dev/ic/dwc_gmac.c: 1.41-1.42
sys/dev/ic/malo.c: 1.10
sys/dev/ic/rt2560.c: 1.31
sys/dev/ic/rt2661.c: 1.36
sys/dev/ic/rt2860.c: 1.29
sys/dev/ic/rtw.c: 1.127
sys/dev/ic/rtwvar.h: 1.46
sys/dev/ic/smc90cx6.c: 1.71
sys/dev/ic/smc90cx6var.h: 1.12
sys/dev/ic/wi.c: 1.244
sys/dev/pci/if_ipw.c: 1.66
sys/dev/pci/if_iwi.c: 1.104
sys/dev/pci/if_iwm.c: 1.76
sys/dev/pci/if_iwn.c: 1.86
sys/dev/pci/if_rtwn.c: 1.13
sys/dev/pci/if_wm.c: 1.541
sys/dev/pci/if_wpi.c: 1.79
sys/dev/pci/ixgbe/ixgbe.c: 1.106
sys/dev/pci/ixgbe/ixv.c: 1.73 via patch
sys/dev/pcmcia/if_malo_pcmcia.c: 1.15
sys/dev/scsipi/if_se.c: 1.95
sys/dev/usb/if_upl.c: 1.60
sys/net/if.c: 1.396
sys/net/if.h: 1.241
sys/net/if_arc.h: 1.23
sys/net/if_arcsubr.c: 1.78
sys/net/if_bridge.c: 1.136-1.137
sys/net/if_etherip.c: 1.39
sys/net/if_faith.c: 1.56
sys/net/if_gif.c: 1.131
sys/net/if_loop.c: 1.96
sys/net/if_mpls.c: 1.30
sys/net/if_pppoe.c: 1.129
sys/net/if_srt.c: 1.27
sys/net/if_stf.c: 1.102
sys/net/if_tap.c: 1.100
sys/net/if_vlan.c: 1.105
sys/netinet/ip_carp.c: 1.91
sys/rump/net/lib/libshmif/if_shmem.c: 1.73-1.74
sys/rump/net/lib/libvirtif/if_virt.c: 1.55-1.56
if_initalize() and if_attach() failed when resource allocation failed
(e.g. allocating softint). Without this change, it panics. It's bad because
resource shortage really occured when a lot of pseudo interface is created.
To avoid this problem, don't panic and change return value of if_initialize()
and if_attach() to int. Caller fanction will be recover from error cleanly by
checking the return value.
Return if bah_attach_subr() failed.
If if_attach() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add some missing frees in bridge_clone_destroy().
- KNF
If error occured in bcmeth_ccb_attach(), free resources and return.
If error occured in pq3etsec_attach(), free resources and return.
If error occured in the attach function, free resources and return.
- If if_initialize() failed in athn_attach(), free resources and return.
- Add missing pmf_event_deregister() in athn_detach().
- Free resources correctly on some errors in atw_attach().
- Use apint*() insread of printf() in the attach function.
If if_initialize() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add missing dwc_gmac_free_dma_rings() and mutex_destroy() when attach
failed.
- If if_initialize() failed in the attach function, free resources and return.
- ifp is always not NULL in iwi_detach(). Check correctly with ifp->if_softc.
- If if_initialize() failed in the attach function, free resources and return.
- Fix error path in the attach function correctly.
If if_initialize() failed in the attach function, free resources and return.
If if_attach() failed in the attach function, free resources and return.
- If if_initialize() failed in the attach function, free resources and return.
- KNF
- If if_attach() failed in the attach function, free resources and return.
- KNF
Fix compile error.
Fix compile error.
We don't need '&mii', but just 'mii' for mii_detach().
Don't free sc_rthash twice
 1.162.2.2  28-Jul-2018  pgoyette Sync with HEAD
 1.162.2.1  02-May-2018  pgoyette Synch with HEAD
 1.164.2.3  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.164.2.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.164.2.1  10-Jun-2019  christos Sync with HEAD
 1.169.2.1  29-Feb-2020  ad Sync with head.
 1.170.10.1  17-Jun-2021  thorpej Sync w/ HEAD.

RSS XML Feed