When a link-layer address changes (e.g., ifconfig ex0 link
02🇩🇪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.
opencrypto by CoyotePoint Systems. The FreeBSD driver source was recently
made available by NBMK Encryption Technologies.
The port includes some currently unused code which implements kernel and
user space interfaces for the driver in FreeBSD. These are left in at this
time to facilitate the port of these interface to NetBSD if they are of
interest.
mfi_scsi_io does. Do not tsleep in mfi_mgmt waiting for completion;
let the caller handle it. If mfi_mgmt() is called with a non-NULL scsipi_xfer
have mfi_mgmt_done() wake it up, else wake up the mfi_ccb.
mfi_poll()/mfi_post() is up to the caller.
mfi_scsipi_request(): handle SCSI_SYNCHRONIZE_CACHE_10 as we do for other
commmands: have mfi_mgmt() fill in the ccb, queue of poll the ccb and
return.
Introduce mfi_mgmt_internal() which behaves like mfi_mgmt() did (tsleep
waiting for completion). Use it for internal and ioctl management
requests.
Fix kern/39297 from Greg Oster (mfi calls tsleep() from mfi_intr()),
tested by Mark Davies.
80x25 mode.
XXX This doesn't handle odd modes like 80x30 on 640x480, but the driver
didn't allow that selection previously so at least it's an improvement
over the previous behaviour.
Bump CISS_MAX_CDB from 12 to 16 bytes. For volumes larger than 2TB,
the scsipi layer will have to use 16 bytes SCSI commands, which would be
rejected by ciss. The cdb buffer already 16 bytes long, and a look at the
FreeBSD driver shows there's no reasons to limit SCSI commands to 12 bytes.
From Jeremy Morse:
* Serialize access to the ehci intrlist.
* Change the ehci intrlist to a tailq so xfers are not queued out of order.
* In ehci_check_itd_intr, don't treat a transfer error as an indication
that the xfer is no longer active.
JME260 Fast Ethernet PCI Express controllers.
Written with a lot of cut-n-paste from the FreeBSD jme(4) driver.
No support for jumbo ethernet frames yet (but should come soon).
Thanks to JMicron Technologies for providing me sample boards and
documentation for this work.
1. Trange sysctl's belong to the temp sensors, not to the fan controllers
2. Trange really describes a slope on many chips, so modify the description
3. Most of the sysctl's are read/write even if the chip's config is
locked; reflect that in the CTLFLAGs
4. Apply correct 'nominal' values for voltage sensors/limits, specify
them in microVolts, and calculate once rather than each time needed
5. Be more consistent in register names - for example, use VCC instead of
SUPPLY_VOLTAGE, to match VCC_LOWLIM & VCC_HIGHLIM
6. Type of dbcool_islocked() should be bool, not int
7. Reduce some unnecessary code indentation
8. Define Vtt and Imon, and add ADT7490 support (excluding PECI sensors)
9. Split the huge (250+ lines) dbcool_setup() function into a few smaller
routines for better readability
10. Update sensor tables for ADT7476 and ADT7468 - these chips have five
voltage sensors, not two
11. Adjust flags for ADT7463 and ADM1027 - these chips can monitor CPU
VID data bits
12. Update man page
Supported chips: ADM1027, ADM1030, ADT7463, ADT7466, ADT7467, ADT7468,
ADT7473, ADT7475, and ADT7476. Notably missing is the ADT7490, and fan
controller support on the ADT7466 is still on the to-do list.
Tested by myself and njoly@
Reviewed by garbled@
Commit approved by christos@, bouyer@, cube@, and matt@
- Use the device lock to protect fss_open(), fss_close() and fss_unmount_hook().
- Make sure fss_bs_thread() does not call biodone() with locks held.
Reviewd by: Andrew Doran <ad@netbsd.org>
i2c Alert Response Address. Skipping this won't hurt (the address is
allegedly reserved), and it might avoid the lock-ups that have been
seen by others.
1. Use proper CRc check for FB-DIMMs rather than simple checksum
2. Provide access to entire SPD ROM contents via sysctl, rather than
only the first 64 bytes
3. Use macros to define i2c bus address checking
4. General fix-up for RAMBUS memory (not that anyone I know has one)
OK garbled@
with other drivers (notably adt7463).
NOTE: The verify routine in _both_ drivers might better be placed in-line
in the _match() routine. But these drivers will soon be superseded by the
dbcool driver any way.
OK gmcgarry@
fssvar.h: struct device * -> device_t.
fss.c: establish unmount hook on first attach, remove on last detach.
vfs_syscalls.c: remove the call of fss_umount_hook().
vfs_trans.c: destroy cow handlers on unmount as fstrans_unmount() will be
called before vfs_hooks.
Don't set infinite burst on SBus cards.
Changes based on information in the `Sbus GEM Specification':
http://mediacast.sun.com/users/Barton808/media/gem_sbus-1.pdf
SBus-based GEM cards (i.e. Sun X1140A) now work!
Tested with a X1140A card in a U1 and in a U2.
Thanks for martin@ for testing.
No functional changes intended (except maybe un-reseting the chip a bit later
in attach).
- pass fewer arguments to local functions where arguments can be derived from
an existing argument
- some coding style fixes
- more abstraction for PRB activation and deactivation
- bus_dma(9) properification in error cases
- undefine SIISATA_DEBUG, and cleanup variables used only for DEBUG_PRINT()s
unconfigured device. That removes the compile-time constant number
of useable devices.
While here, add disk_busy()/disk_unbusy() instrumentation.
Reviewed by: Quentin Garnier <cube@netbsd.org>
cgd inadvertently encrypts blkno eight times to generate IV
Add "encblkno1" IV type to encrypt only once, rename old "encblkno" to
"encblkno8" for clarity, and make "encblkno" an alias for "encblkno8"
for backward compatibility.
- Replace malloc/free with kmem_alloc/kmem_free.
- Use bdev_ioctl() instead of bdevsw_lookup()/(*d_ioctl)().
- Be more fair to readers by cleaning the cache one slot at a time.
particular event being monitored. This avoids duplicate reporting for
sensors that monitor both a normal/critical state and value-within-limits
state as reported by Simon Burge on current-users.
While we're here, clean-up some stair-stepping if's.
OK garbled@