Home | History | Annotate | Download | only in scsipi
History log of /src/sys/dev/scsipi/if_se.c
RevisionDateAuthorComments
 1.119  20-Dec-2023  skrll Remove unnecssary #include
 1.118  29-Aug-2022  skrll Make this build again. Sorry about that.
 1.117  28-Aug-2022  skrll se(4): don't set if_watchdog as it's not used.

if_timer is never set in this driver and so if_watchdog will never be
called.
 1.116  07-Jul-2022  skrll Trailing whitespace
 1.115  01-Jan-2022  msaitoh s/sytem/system/
 1.114  19-Sep-2021  andvar fix various typos in comments, messages and documentation.
 1.113  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.112  29-Sep-2020  msaitoh branches: 1.112.6;
s/occurence/occurrence/
 1.111  27-Jul-2020  jdc Improve the workqueue and callout handling. Prompted by riastradh@.
 1.110  22-Jul-2020  riastradh Sort #includes. Nix trailing whitespace.

No functional change intended.
 1.109  22-Jul-2020  riastradh Omit needless <sys/pcq.h>.
 1.108  29-Jun-2020  riastradh Nix trailing whitespace.
 1.107  22-Jun-2020  jdc Add sedetach() and also use it to remove duplicate code from seattach().
Correct a comment about sedone().
 1.106  22-Jun-2020  jdc Use workqueues so that we don't call into the scsipi subsystem via
a softint from the network stack.
Don't recurse through scsipi_command() when we have multiple packets
in the send queue - use a loop instead. This means that we no longer
need sestart(), as we can now handle everything in sedone().
Fix a couple of XXX's.
Rework the locking logic slightly from the previous revision.
Now this works with DIAGNOSTIC+LOCKDEBUG.
 1.105  19-Jun-2020  jdc First pass at making this work again.
Remove spl and add some locking around network access (needs more work).
Make sure that we consistently use the channel lock for scsipi commands.
Remove the preference for send over receive, as this can lead to deadlocks
- we only advertise 1 opening, but we can try to send before the receive is
complete in this case.
Don't use XS_CTL_ASYNC because we don't provide a buffer.
Tested on UP sparc and compile-tested on atari.
Tested with LOCKDEBUG.
Still fails with DIAGNOSTIC because we can call into the scsipi routines
from a softint.
 1.104  29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.103  10-Nov-2019  chs branches: 1.103.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.102  28-May-2019  msaitoh Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.101  23-May-2019  msaitoh Whitespace fix (mainly tabify).
 1.100  23-May-2019  msaitoh No functional change:
- Change ac(was arpcom) to ec(ethercom)
- Simplify MII structure initialization.
- u_int*_t -> uint*_t.
- KNF
 1.99  05-Feb-2019  msaitoh Remove very old IFF_NOTRAILERS flag.
 1.98  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.97  26-Jun-2018  msaitoh branches: 1.97.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.96  22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.95  23-Oct-2017  msaitoh branches: 1.95.2;
If if_initialize() failed in the attach function, free resources and return.
 1.94  15-Dec-2016  ozaki-r branches: 1.94.8;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.93  20-Nov-2016  mlelstv Make scsipi framework MPSAFE.

Data structures are now protected by a per-adapter mutex at IPL_BIO
that is created by the scsibus or atapibus instance when the adapter
is configured.
The enable reference counter and the channel freeze counter which are
currently used by HBA code before the adapter is configured, are made
atomic.
The target drivers are now all tagged as D_MPSAFE.

Almost all HBA drivers still require the kernel lock to present,
so all callbacks into HBA code are still protected by kernel lock
unless the driver is tagged as SCSIPI_ADAPT_MPSAFE.

TODO: refactor sd and cd to use dksubr.
 1.92  02-Oct-2016  christos MFREE -> m_free
 1.91  07-Sep-2016  jakllsch '#if 0' a static inline function used only by an already #if 0 function.
 1.90  10-Jun-2016  ozaki-r branches: 1.90.2;
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.89  09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.88  24-Aug-2015  pooka would you like some freshly ground _KERNEL_OPT with that?
yes? excellent choice, sir/madam.
 1.87  25-Jul-2014  dholland branches: 1.87.4;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.86  16-Mar-2014  dholland branches: 1.86.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.85  27-Oct-2012  chs branches: 1.85.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.84  03-Feb-2012  christos branches: 1.84.6;
ansi prototypes
 1.83  02-Apr-2011  mbalmer branches: 1.83.4; 1.83.8;
Fix misplaced parenthesis. From henning.petersen@t-online.de, thanks.
 1.82  27-Jul-2010  jakllsch branches: 1.82.2;
Use %zu instead of %d for size_t.
Just in case anyone ever debugs se(4) on LP64.
 1.81  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.80  19-Jan-2010  pooka branches: 1.80.2; 1.80.4;
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.79  21-Oct-2009  rmind Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.78  12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.77  12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.76  14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.75  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.74  11-Jan-2009  cegger branches: 1.74.2;
make this compile
 1.73  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.72  08-Jun-2008  tsutsui branches: 1.72.4; 1.72.6;
Use device_lookup_private() rather than using cd_devs[] directly to get softc.

XXX maybe we should change a type of cd_devs[] in struct cfdriver
from (void *) to device_t.
 1.71  05-Apr-2008  cegger branches: 1.71.2; 1.71.4; 1.71.6;
use aprint_*_dev and device_xname
 1.70  20-Dec-2007  dyoung branches: 1.70.6;
Constify struct ifnet->if_sadl and every use throughout the tree.
Add if_set_sadl() that both sets the link-layer address length and
replaces the current link-layer address with a new one, and use it
throughout the tree.
 1.69  01-Sep-2007  dyoung branches: 1.69.8; 1.69.12;
Remark that the data-length argument passed to se_scsipi_cmd() is
questionable.
 1.68  01-Sep-2007  dyoung Create a temporary, non-const copy of a sockaddr. Pass that to
se_set_multi() or se_remove_multi(), because neither is easily
constified. Thanks jmmv@ for reporting the issue.
 1.67  01-Sep-2007  dyoung 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.66  09-Jul-2007  ad branches: 1.66.2; 1.66.6; 1.66.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.65  04-Mar-2007  yamt branches: 1.65.2; 1.65.4;
fix fallout from caddr_t changes.
 1.64  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.63  13-Jan-2007  cube branches: 1.63.2;
Complete initializers so those files compile.
 1.62  07-Sep-2006  dogcow branches: 1.62.2;
remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.
 1.61  30-Mar-2006  thorpej Use device_private().
 1.60  24-Dec-2005  perry branches: 1.60.4; 1.60.6; 1.60.8; 1.60.10; 1.60.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.59  11-Dec-2005  christos merge ktrace-lwp.
 1.58  03-Jun-2005  jdc branches: 1.58.2;
Remove cast to non-const and make this compile again.
 1.57  27-Feb-2005  perry nuke trailing whitespace
 1.56  04-Feb-2005  perry de-__P
 1.55  01-Feb-2005  reinoud Backing out changes to clean up scsipi. I was pointed out there were
problems i hadn't seen. To prevent lossage i'd decided to back off all
changes and let them be reviewed on tech-kern.
 1.54  31-Jan-2005  simonb Revert incorrect u_long->uint32_t conversion.
 1.53  31-Jan-2005  reinoud Part of the cleanup of sys/scsipi's use of types; rename all u_int* to
uint* and change the u_long's to uint32_t's where possible. Note that the
iocl definitions/hooks have to be ulong (or u_long) or they'll bomb out.
 1.52  31-Jan-2005  reinoud As part of cleaning up sys/scsipi, replace all u_char by uint8_t and
replace all `short' with int16_t.
 1.51  30-Oct-2004  thorpej branches: 1.51.4; 1.51.6;
When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.50  18-Sep-2004  mycroft Standardize some variable names and the calling pattern for scsipi_command().
Use void pointer casts.
 1.49  17-Sep-2004  mycroft Remove the "xfer" argument to scsipi_command().
 1.48  17-Sep-2004  mycroft Do not manipulate xs->bp in "generic" code -- do it only in the psw_done
routine. As part of this, pass down our pre-parsed error code -- though this
interface will probably change later to accomodate better error handling.
 1.47  09-Sep-2004  bouyer Make the xxstart() functions reentrant again, as some drivers HBA can call
scsipi_done() from their scsipi_request().
For this, add a struct scsipi_xfer * argument to scsipi_command().
If not NULL scsipi_command() will use this to enqueue this xfer, otherwise
it'll try to allocate a new one. This scsipi_xfer has to be allocated
and initialised by scsipi_make_xs() or equivalent.
In xxstart(), allocate a scsipi_xfer using scsipi_make_xs(), and if not NULL,
dequeue the buffer before calling scsipi_command(). This makes sure that
scsipi_command() will not fail, and also makes sure that xxstart() won't
be called again between the BUFQ_PEEK() and BUFQ_GET().

Fix "dequeued wrong buf" panics reported by Juergen Hannken-Illjes in
private mail and Andreas Wrede on current-users@.
Thanks to Jason Thorpe and Chuck Silver for review, and Andreas Wrede for
testing the patch.
 1.46  23-Apr-2004  itojun use bounded string ops
 1.45  08-Sep-2003  mycroft branches: 1.45.2;
Use the const shaker.
 1.44  23-Oct-2002  jdolecek branches: 1.44.6;
merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.43  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.42  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.41  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.40  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.39  15-Nov-2001  lukem branches: 1.39.8;
don't need <sys/types.h> when including <sys/param.h>
 1.38  13-Nov-2001  lukem add RCSIDs
 1.37  18-Jul-2001  thorpej branches: 1.37.2;
bcmp -> memcmp
 1.36  18-Jul-2001  thorpej bcopy -> memcpy
 1.35  18-Jul-2001  thorpej bzero -> memset
 1.34  25-Apr-2001  bouyer branches: 1.34.2;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.33  14-Dec-2000  thorpej branches: 1.33.2;
ALTQ'ify.
 1.32  15-Nov-2000  thorpej Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.31  01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.30  09-Jun-2000  enami Prevent a process being swapped out during I/O if the data buffer is
allocated on stack. This potential problem is noticed by Noriyuki Soda
and the idea and sample code to fix is given by Jason R. Thorpe.
 1.29  30-Mar-2000  augustss branches: 1.29.2;
Get rid of register declarations.
 1.28  23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.27  13-Mar-2000  soren Fix doubled 'the's in comments.
 1.26  13-Nov-1999  matthias Make this work again by adding XS_CTL_ASYNC to the SCSI requests in
se_ifstart and se_recv.
 1.25  30-Sep-1999  thorpej branches: 1.25.2; 1.25.4; 1.25.8;
Cleanup the scsipi_xfer flags:
- `flags' is now gone, replaced with `xs_control' and `xs_status'.
- Massive cleanup of the control flags. Now we explicitly say that
a job is to complete asynchronously, rather than relying on side-effects,
and use a new flag to now that device discovery is being performed.
- Do SCSI device discovery interrupt-driven.
 1.24  18-May-1999  thorpej Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.23  12-Dec-1998  mycroft branches: 1.23.4;
Simplify the copy loops a bit.
 1.22  08-Dec-1998  thorpej When closing, wait for pending xfers to drain before deleting the reference
to the adapter.
 1.21  20-Nov-1998  thorpej Add adapter reference counting for SCSI and ATAPI devices.
 1.20  13-Oct-1998  kim Use ETHERTYPE_ATALK instead of ETHERTYPE_AT. The former seems more common.
Our other constants also use "ATALK".

Added many new ETHERTYPE constants to sys/net/ethertypes.h, including the
ones from libpcap and tcpdump "ethertype.h" files.
 1.19  25-Sep-1998  is correct obvious typo
 1.18  31-Aug-1998  cgd kill the last remnants of __BROKEN_INDIRECT_CONFIG. (only the pica port
used it, and it's non-working and apparently slated for replacement.)
 1.17  05-Jul-1998  jonathan defopt NS, NSIP.
 1.16  05-Jul-1998  jonathan defopt LLC
 1.15  05-Jul-1998  jonathan defopt CCITT.
 1.14  05-Jul-1998  jonathan defopt INET, NETATALK.
 1.13  12-Jan-1998  thorpej Adjust for changes to config.
 1.12  18-Oct-1997  thorpej Implement two macros, scsipi_command() and scsipi_command_direct(), and
use them to hide the structure of the function pointers we jump through
to issue a command.
 1.11  14-Oct-1997  matthias Apply Ian Dall's patch from kern/4004. Ian's comment:
The following patch employs a smarter adaptive polling
scheme. It also improves the comments, in particular giving
due credit to Phil Budne for his efforts in nunderstanding
the device. It also relaxes the pattern for auto config so
more devices match.
 1.10  01-Oct-1997  enami Cosmetic changes to keep coding style consistency in this directory;

- Indent with tab of width 8.
- Use four column to indent continuation line.
- Fold long line if possible.
- Use return (xx) instead of return xx.
- Compare pointer against NULL instead of testing like boolean.
- Delete whitespace at the end of line.
- Delete whitespace in front of function call operator.
- Delete whitespace after cast.
- Dereference a pointer to function explicitly.
- Add an empty line after local variable declaration.
- Use NULL instead of (char *)0.
- Dont use block for single statement.
 1.9  27-Aug-1997  bouyer branches: 1.9.2;
Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.8  28-Apr-1997  mycroft Oops; forgot to GC the last mbuf allocated when out of clusters.
 1.7  24-Apr-1997  mycroft Fix typo in previous.
 1.6  24-Apr-1997  mycroft If we fail to allocate a cluster to hold a large packet, simply
drop it rather than using a chain of tiny mbufs.
Do not force the initial part of a packet into a separate mbuf.
 1.5  04-Apr-1997  matthias * Do some KNFing.
* Make all local functions static.
* Add some untested netatalk support.
 1.4  02-Apr-1997  mycroft Push the buffer cleanup code into scsi_done(), and split it so that biodone()
is called *after* the driver `done' routine. This fixes disk I/O statistics
on SCSI devices.

Also, calling the `done' routine with a `complete' argument of 0 and actually
having it do anything meaningful loses in at least 3 ways, so just nuke the
argument altogether and don't call it this way. If the driver needs to do
some error handling, that's what `err_handler' is for.
 1.3  24-Mar-1997  thorpej Fix a screwup (my fault, oops) that caused the stack to get corrupted.
From Ian Dall <Ian.Dall@dsto.defence.gov.au> on port-pc532.
 1.2  18-Mar-1997  cgd add appropriate includes so that this deals properly with NS and CCITT+LLC.
(Includes stolen from dev/ic/am7990.c, because it's a (the?) canonical
networking hardware driver.)
 1.1  18-Mar-1997  thorpej Driver for the Cabletron EA41x SCSI Ethernet Adaptor, written by
Ian Dall <ian.dall@dsto.defence.gov.au>. Converted to "new arp"
and some other (very) minor changes by me.
 1.9.2.4  15-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.2.3  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.2.2  27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.9.2.1  27-Aug-1997  thorpej file if_se.c was added on branch marc-pcmcia on 1997-08-27 23:33:07 +0000
 1.23.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.25.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.25.4.1  15-Nov-1999  fvdl Sync with -current
 1.25.2.5  05-Jan-2001  bouyer Sync with HEAD
 1.25.2.4  22-Nov-2000  bouyer Sync with HEAD.
 1.25.2.3  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

Main changes to the scsipi code itself:
- add a scsipi_channel->type to allow umass to attach to both atapibus and
scsibus. Will die when IDE is converted from ata_atapi_attach to
scsipi_channel/scsipi_adapter
- Add a chan_defquirks to scsipi_channel so that adapters can pass a default
set of quirks to be set for each device attached
- add adapt_getgeom and adapt_accesschk callbacks
 1.25.2.2  01-Nov-1999  thorpej Fixup the SC_DEBUG() stuff for the new world order.
 1.25.2.1  19-Oct-1999  thorpej Completely rewritten scsipi_xfer execution engine:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).

There is a lot more work to do, but this correctly functions for the most
part on several file servers I run.
 1.29.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.33.2.7  11-Nov-2002  nathanw Catch up to -current
 1.33.2.6  18-Oct-2002  nathanw Catch up to -current.
 1.33.2.5  17-Sep-2002  nathanw Catch up to -current.
 1.33.2.4  08-Jan-2002  nathanw Catch up to -current.
 1.33.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.33.2.2  24-Aug-2001  nathanw Catch up with -current.
 1.33.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.34.2.3  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.34.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.34.2.1  03-Aug-2001  lukem update to -current
 1.37.2.2  26-Sep-2001  fvdl * add a VCLONED vnode flag that indicates a vnode representing a cloned
device.
* rename REVOKEALL to REVOKEALIAS, and add a REVOKECLONE flag, to pass
to VOP_REVOKE
* the revoke system call will revoke all aliases, as before, but not the
clones
* vdevgone is called when detaching a device, so make it use REVOKECLONE
to get rid of all clones as well
* clean up all uses of VOP_OPEN wrt. locking.
* add a few VOPS to spec_vnops that need to do something when it's a
clone vnode (access and getattr)
* add a copy of the vnode vattr structure of the original 'master' vnode
to the specinfo of a cloned vnode. could possibly redirect getattr to
the 'master' vnode, but this has issues with revoke
* add a vdev_reassignvp function that disassociates a vnode from its
original device, and reassociates it with the specified dev_t. to be
used by cloning devices only, in case a new minor is allocated.
* change all direct references in drivers to v_devcookie and v_rdev
to vdev_privdata(vp) and vdev_rdev(vp). for diagnostic purposes
when debugging race conditions that still exist wrt. locking and
revoking vnodes.
* make the locking state of a vnode consistent when passed to
d_open and d_close (unlocked). locked would be better, but has
some deadlock issues
 1.37.2.1  07-Sep-2001  thorpej Commit my "devvp" changes to the thorpej-devvp branch. This
replaces the use of dev_t in most places with a struct vnode *.

This will form the basic infrastructure for real cloning device
support (besides being architecurally cleaner -- it'll be good
to get away from using numbers to represent objects).
 1.39.8.1  16-May-2002  gehenna Add the character device switch.
 1.44.6.8  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.44.6.7  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.44.6.6  04-Feb-2005  skrll Sync with HEAD.
 1.44.6.5  21-Nov-2004  skrll Adapt to branch. Alpha kernels now compile.
 1.44.6.4  02-Nov-2004  skrll Sync with HEAD.
 1.44.6.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.44.6.2  18-Sep-2004  skrll Sync with HEAD.
 1.44.6.1  03-Aug-2004  skrll Sync with HEAD
 1.45.2.1  11-Sep-2004  he branches: 1.45.2.1.2;
Pull up revision 1.47 (via patch, requested by bouyer in ticket #837):
Improve handling of memory shortage, to fix problems like:
sd3(mpt0:0:1:0): unable to allocate scsipi_xfer
sd3: not queued, error 12
The theory is that other consumers of pool memory is causing
this memory shortage in certain somewhat hard to reproduce
situations.
This is done by giving scsipi_command an extra argument to
optionally pass a preallocated scsipi_xfer, and allocating a
scsipi_xfer before dequeueing a buffer in the various *start()
functions. If the allocation of a scsipi_xfer fails, schedule
a callout for delayed invocation of the start function. Also
reserve one page for scsipi_xfer structs, to ensure that we will
eventually have some available once pending commands complete.
Should fix PR#25670.
 1.45.2.1.2.1  24-Jan-2005  he Pull up revision 1.51 (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.51.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.51.6.1  12-Feb-2005  yamt sync with head.
 1.51.4.1  29-Apr-2005  kent sync with -current
 1.58.2.5  21-Jan-2008  yamt sync with head
 1.58.2.4  03-Sep-2007  yamt sync with head.
 1.58.2.3  26-Feb-2007  yamt sync with head.
 1.58.2.2  30-Dec-2006  yamt sync with head.
 1.58.2.1  21-Jun-2006  yamt sync with head.
 1.60.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.60.10.1  19-Apr-2006  elad sync with head.
 1.60.8.2  14-Sep-2006  yamt sync with head.
 1.60.8.1  01-Apr-2006  yamt sync with head.
 1.60.6.1  22-Apr-2006  simonb Sync with head.
 1.60.4.1  09-Sep-2006  rpaulo sync with head
 1.62.2.1  01-Feb-2007  ad Sync with head.
 1.63.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.65.4.1  11-Jul-2007  mjf Sync with head.
 1.65.2.2  09-Oct-2007  ad Sync with head.
 1.65.2.1  01-Jul-2007  ad Adapt to callout API change.
 1.66.8.2  09-Jan-2008  matt sync with HEAD
 1.66.8.1  06-Nov-2007  matt sync with HEAD
 1.66.6.1  03-Sep-2007  jmcneill Sync with HEAD.
 1.66.2.1  03-Sep-2007  skrll Sync with HEAD.
 1.69.12.1  02-Jan-2008  bouyer Sync with HEAD
 1.69.8.1  26-Dec-2007  ad Sync with head.
 1.70.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.70.6.2  29-Jun-2008  mjf Sync with HEAD.
 1.70.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.71.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.71.4.4  11-Aug-2010  yamt sync with head.
 1.71.4.3  11-Mar-2010  yamt sync with head
 1.71.4.2  16-May-2009  yamt sync with head
 1.71.4.1  04-May-2009  yamt sync with head.
 1.71.2.1  17-Jun-2008  yamt sync with head.
 1.72.6.2  28-Apr-2009  skrll Sync with HEAD.
 1.72.6.1  19-Jan-2009  skrll Sync with HEAD.
 1.72.4.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.74.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.80.4.3  21-Apr-2011  rmind sync with head
 1.80.4.2  05-Mar-2011  rmind sync with head
 1.80.4.1  30-May-2010  rmind sync with head
 1.80.2.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.80.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.82.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.83.8.1  18-Feb-2012  mrg merge to -current.
 1.83.4.3  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.83.4.2  30-Oct-2012  yamt sync with head
 1.83.4.1  17-Apr-2012  yamt sync with head
 1.84.6.3  03-Dec-2017  jdolecek update from HEAD
 1.84.6.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.84.6.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.85.2.1  18-May-2014  rmind sync with head
 1.86.2.1  10-Aug-2014  tls Rebase.
 1.87.4.6  05-Feb-2017  skrll Sync with HEAD
 1.87.4.5  05-Dec-2016  skrll Sync with HEAD
 1.87.4.4  05-Oct-2016  skrll Sync with HEAD
 1.87.4.3  09-Jul-2016  skrll Sync with HEAD
 1.87.4.2  19-Mar-2016  skrll Sync with HEAD
 1.87.4.1  22-Sep-2015  skrll Sync with HEAD
 1.90.2.2  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.90.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.94.8.2  26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.94.8.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.95.2.3  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.95.2.2  28-Jul-2018  pgoyette Sync with HEAD
 1.95.2.1  25-Jun-2018  pgoyette Sync with HEAD
 1.97.2.3  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.97.2.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.97.2.1  10-Jun-2019  christos Sync with HEAD
 1.103.2.1  29-Feb-2020  ad Sync with head.
 1.112.6.1  17-Jun-2021  thorpej Sync w/ HEAD.

RSS XML Feed