Home | History | Annotate | Download | only in tc
History log of /src/sys/dev/tc/if_le_ioasic.c
RevisionDateAuthorComments
 1.35  29-May-2022  rin Audit unload/unmap v.s. free against DMA buffer for sys/dev;
make sure that bus_dmamap_unload(9) [or bus_dmamap_destroy(9)] or
bus_dmamem_unmap(9) are preceding to freeing DMA buffer, if it is
loaded or mapped, respectively.

This is mandatory for some archs. See, e.g.:

http://www.nerv.org/netbsd/?q=id:20210511T013030Z.013443cc790088147e4beed43f53dedabeaf9312
http://www.nerv.org/netbsd/?q=id:20220511T172220Z.561179f0b6fcc5b9cd73e274f69d74e2ce9e4c93

For some drivers, resource leaks for error paths are fixed at
the same time.

XXX XXX XXX
Compile test only (at least one arch per driver).
 1.34  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.33  18-Apr-2009  tsutsui branches: 1.33.62; 1.33.64;
Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
 1.32  18-Mar-2009  cegger bcopy -> memcpy
 1.31  18-Mar-2009  cegger bzero -> memset
 1.30  04-Apr-2008  tsutsui branches: 1.30.4; 1.30.12; 1.30.18;
Split device_t/softc for le(4) and variants and misc cosmetic changes.
 1.29  04-Mar-2007  yamt branches: 1.29.36;
fix fallout from caddr_t changes.

XXX what "volatile caddr_t" in if_le_ioasic.c was for?
 1.28  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.27  31-Mar-2006  thorpej branches: 1.27.14;
Use ANSI function decls, apply static.
 1.26  30-Mar-2006  thorpej Use device_private() more.
 1.25  30-Mar-2006  thorpej Use device_private().
 1.24  11-Dec-2005  christos branches: 1.24.4; 1.24.6; 1.24.8; 1.24.10; 1.24.12;
merge ktrace-lwp.
 1.23  27-Feb-2005  perry branches: 1.23.4;
nuke trailing whitespace
 1.22  04-Feb-2005  perry de-__P
 1.21  02-Oct-2002  thorpej branches: 1.21.6; 1.21.14; 1.21.16;
Add trailing ; to CFATTACH_DECL.
 1.20  01-Oct-2002  thorpej Use CFATTACH_DECL().
 1.19  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.18  13-Nov-2001  lukem add/cleanup RCSIDs
 1.17  17-Jul-2000  thorpej branches: 1.17.2; 1.17.4;
Use the IOASIC_DMA_ADDR() macro now that it is fixed.
 1.16  11-Jul-2000  nisimura - Use PMAD-BA name for device match logic. It's not a real TURBOchannel
device and the id string is not found in option ROM string, but
ULTRIX/OSF1 call it so anyway.
- Squash IOASIC DMA buffer allocation into device attach() sequence.
 1.15  30-Mar-2000  augustss Remove register declarations.
 1.14  01-Oct-1999  nisimura branches: 1.14.2;
- Remove defunct codes and arrange consistency between pmax and alpha.
- Reduce 'ioasic_base' expose.
 1.13  09-Sep-1999  nisimura Use bus_dmamap_load() to obtain 128KB chunk for LANCE merging codes from
NetBSD/alpha. Tested ok with DEC3000 and DECstation.
 1.12  21-Jul-1998  drochner adapt to LANCE driver split
 1.11  05-Jul-1998  jonathan defopt INET, NETATALK.
 1.10  19-Jan-1998  thorpej Make sure the LANCE DMA area has been allocated, and don't call
ioasic_lance_dma_setup() on the Alpha; the DMA area is allocated differently
on that platform now.
 1.9  26-Aug-1997  jonathan Set KERNEL_RCSID to identify previous change.
 1.8  26-Aug-1997  jonathan rewrite and hand-tune copy_gap16 loops:
* hoist code to deal with fragments of a 16-byte chunk outside
main copy loop.
* over 98% of dynamic calls are 2-byte-algnied but not 4-byte-aligned
(due to 14-byte Ether headers). kernel bcopy is poorly tune for this.
Replace bcopy() with inline code tuned to minimize accesses
to DMA buffers, which aren't uncached on mips.

Tested on 5000/240 (3MAXPLUS) and 3000/700 (sandpiper) (mjacob@feral.com)
 1.7  22-Jul-1997  jonathan branches: 1.7.2;
Garbage-collect __BROKEN_INDIRECT_CONFIG from /sys/dev/tc
 1.6  17-Mar-1997  thorpej #include <net/if_media.h>
 1.5  15-Mar-1997  cgd fix botches in is's new ARP changes
 1.4  15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.3  05-Dec-1996  cgd branches: 1.3.6;
update these so they compile whether or not __BROKEN_INDIRECT_CONFIG
is defined.
 1.2  07-May-1996  thorpej Make the MI LANCE driver standalone, and use cfattach to resolve
naming conflicts between bus attachments on ports that can have
multiple instances of the LANCE.

Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
 1.1  18-Apr-1996  cgd restructure to take advantage of config's (relatively) new 'attach'
specifiers. Many #ifdefs and much other nastiness removed.
 1.3.6.1  09-Mar-1997  is netinet/if_ether.h -> netinet/if_inarp.h
 1.7.2.1  27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.14.2.1  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.
 1.17.4.2  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.17.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.17.2.2  18-Oct-2002  nathanw Catch up to -current.
 1.17.2.1  14-Nov-2001  nathanw Catch up to -current.
 1.21.16.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.21.16.1  12-Feb-2005  yamt sync with head.
 1.21.14.1  29-Apr-2005  kent sync with -current
 1.21.6.2  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.21.6.1  04-Feb-2005  skrll Sync with HEAD.
 1.23.4.2  03-Sep-2007  yamt sync with head.
 1.23.4.1  21-Jun-2006  yamt sync with head.
 1.24.12.2  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.24.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.24.10.1  19-Apr-2006  elad sync with head.
 1.24.8.1  01-Apr-2006  yamt sync with head.
 1.24.6.1  22-Apr-2006  simonb Sync with head.
 1.24.4.1  09-Sep-2006  rpaulo sync with head
 1.27.14.1  12-Mar-2007  rmind Sync with HEAD.
 1.29.36.1  02-Jun-2008  mjf Sync with HEAD.
 1.30.18.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.30.12.1  28-Apr-2009  skrll Sync with HEAD.
 1.30.4.1  04-May-2009  yamt sync with head.
 1.33.64.1  10-Jun-2019  christos Sync with HEAD
 1.33.62.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

RSS XML Feed