Home | History | Annotate | Download | only in qbus
History log of /src/sys/dev/qbus/if_dmc.c
RevisionDateAuthorComments
 1.30  05-Jul-2024  rin sys: Drop redundant NULL check before m_freem(9)

m_freem(9) safely has accepted NULL argument at least since 4.2BSD:
https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/sys/uipc_mbuf.c

Compile-tested on amd64/ALL.

Suggested by knakahara@
 1.29  04-Apr-2022  andvar branches: 1.29.8; 1.29.10;
fix various typos, mainly in comments.
 1.28  05-Feb-2020  skrll Adopt <net/if_stats.h>
 1.27  04-Feb-2020  skrll Adopt <net/if_stats.h>
 1.26  20-Jul-2016  ozaki-r branches: 1.26.16; 1.26.24;
Apply pserialize to some iterations of IP address lists
 1.25  07-Jul-2016  ozaki-r branches: 1.25.2;
Switch the address list of intefaces to pslist(9)

As usual, we leave the old list to avoid breaking kvm(3) users.
 1.24  20-Apr-2016  knakahara IFQ_ENQUEUE refactor (3/3) : eliminate pktattr argument from IFQ_ENQUEUE caller
 1.23  05-Jun-2014  rmind branches: 1.23.4;
- Implement pktqueue interface for lockless IP input queue.
- Replace ipintrq and ip6intrq with the pktqueue mechanism.
- Eliminate kernel-lock from ipintr() and ip6intr().
- Some preparation work to push softnet_lock out of ipintr().

Discussed on tech-net.
 1.22  15-May-2014  msaitoh Save a NETISR_* value in a variable and call schednetisr() after enqueue
a packet for readability and future modification.
 1.21  27-Oct-2012  chs branches: 1.21.2; 1.21.10;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.20  12-May-2009  cegger branches: 1.20.12; 1.20.22;
struct device * -> device_t, no functional changes intended.
 1.19  12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.18  16-Dec-2008  christos branches: 1.18.2;
replace bitmask_snprintf(9) with snprintb(3)
 1.17  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.16  05-Apr-2008  cegger branches: 1.16.4; 1.16.10; 1.16.12;
use aprint_*_dev and device_xname
 1.15  19-Oct-2007  ad branches: 1.15.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.14  04-Mar-2007  christos branches: 1.14.2; 1.14.14; 1.14.16; 1.14.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13  29-Mar-2006  thorpej branches: 1.13.14;
Use device_private().
 1.12  29-Mar-2006  thorpej Use device_cfdata().
 1.11  25-Mar-2006  thorpej Use device_parent().
 1.10  11-Dec-2005  christos branches: 1.10.4; 1.10.6; 1.10.8; 1.10.10; 1.10.12;
merge ktrace-lwp.
 1.9  26-Feb-2005  simonb branches: 1.9.4;
White space nits.
 1.8  24-Jan-2005  matt branches: 1.8.2;
Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them.
 1.7  07-Aug-2003  agc branches: 1.7.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6  02-Oct-2002  thorpej branches: 1.6.6;
Add trailing ; to CFATTACH_DECL.
 1.5  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.4  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3  05-Mar-2002  itojun bring in latest ALTQ from kjc. ALTQify some of the drivers.
 1.2  13-Nov-2001  lukem add RCSIDs
 1.1  06-May-2001  ragge branches: 1.1.2; 1.1.4;
Driver for the DMC-11/DMR-11 DDCMP interface, (untested) from 4.4BSD.
 1.1.4.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.1.4.2  16-Mar-2002  jdolecek Catch up with -current.
 1.1.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.5  18-Oct-2002  nathanw Catch up to -current.
 1.1.2.4  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.1.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1  06-May-2001  nathanw file if_dmc.c was added on branch nathanw_sa on 2001-06-21 20:05:26 +0000
 1.6.6.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.6.4  04-Feb-2005  skrll Sync with HEAD.
 1.6.6.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.2  18-Sep-2004  skrll Sync with HEAD.
 1.6.6.1  03-Aug-2004  skrll Sync with HEAD
 1.7.8.1  29-Apr-2005  kent sync with -current
 1.8.2.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.4.3  27-Oct-2007  yamt sync with head.
 1.9.4.2  03-Sep-2007  yamt sync with head.
 1.9.4.1  21-Jun-2006  yamt sync with head.
 1.10.12.2  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.10.12.1  28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.10.10.1  19-Apr-2006  elad sync with head.
 1.10.8.1  01-Apr-2006  yamt sync with head.
 1.10.6.1  22-Apr-2006  simonb Sync with head.
 1.10.4.1  09-Sep-2006  rpaulo sync with head
 1.13.14.1  12-Mar-2007  rmind Sync with HEAD.
 1.14.20.1  25-Oct-2007  bouyer Sync with HEAD.
 1.14.16.1  06-Nov-2007  matt sync with HEAD
 1.14.14.1  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.14.2.1  23-Oct-2007  ad Sync with head.
 1.15.16.2  17-Jan-2009  mjf Sync with HEAD.
 1.15.16.1  02-Jun-2008  mjf Sync with HEAD.
 1.16.12.1  19-Jan-2009  skrll Sync with HEAD.
 1.16.10.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.16.4.2  16-May-2009  yamt sync with head
 1.16.4.1  04-May-2009  yamt sync with head.
 1.18.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.22.3  03-Dec-2017  jdolecek update from HEAD
 1.20.22.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.22.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.20.12.1  30-Oct-2012  yamt sync with head
 1.21.10.1  10-Aug-2014  tls Rebase.
 1.21.2.1  18-May-2014  rmind sync with head
 1.23.4.3  05-Oct-2016  skrll Sync with HEAD
 1.23.4.2  09-Jul-2016  skrll Sync with HEAD
 1.23.4.1  22-Apr-2016  skrll Sync with HEAD
 1.25.2.1  26-Jul-2016  pgoyette Sync with HEAD
 1.26.24.1  29-Feb-2020  ad Sync with head.
 1.26.16.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.29.10.1  02-Aug-2025  perseant Sync with HEAD
 1.29.8.1  16-Nov-2023  thorpej IFQ_CLASSIFY() -> ifq_classify_packet().

RSS XML Feed