Commit Graph

97272 Commits

Author SHA1 Message Date
dyoung
de87fe677d *** Summary ***
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.
2008-11-07 00:20:01 +00:00
joerg
220377354c Don't use do {} while(0) for a single function call. 2008-11-07 00:15:42 +00:00
joerg
ecbfc2933c Remove XXXUBC code for ffs_reallocblks, that has been conditionalized in
2002 and #if 0'ed in 2005. It would need a considerable amount of work
to bring back and obscures the more important block allocation.
2008-11-06 22:31:08 +00:00
macallan
9263b0c23b add a couple more registers 2008-11-06 22:16:03 +00:00
macallan
61277fe87d install crmfbreg.h 2008-11-06 22:15:39 +00:00
cegger
4b9b87ae5b Link cpus in the order they are attaching and not in inverse order. 2008-11-06 19:29:46 +00:00
cegger
1f7782b4ba wrap lines. no functional change. 2008-11-06 17:50:59 +00:00
abs
96dc40fee6 Add the following note to README:
Please commit changes to 'GENERIC.in' and other source files *first*, then
 run 'makeconf' and commit the generated files to ensure the 'Created from:'
 tags are correct.

Then follow it. Noted by tsutsui@
2008-11-06 17:12:20 +00:00
rmind
9d3a4ed2de cpuctl_ioctl: use cpu_index(), instead of cpuid.
Fixes cpuctl(8) on some processors.
2008-11-06 16:48:51 +00:00
blymn
3286a94bad Move init of essid to the attach code. 2008-11-06 12:03:43 +00:00
darrenr
552614e264 38456 ipf mostly ignores locking in NetBSD 2008-11-06 09:51:57 +00:00
darrenr
60886a044c 38456 ipf mostly ignores locking in NetBSD
...plus some cleanup of fastroute code.
2008-11-06 09:49:59 +00:00
dyoung
41215a0ab5 Use DVUNIT_ANY instead of the anonymous constant -1. 2008-11-06 03:40:04 +00:00
dyoung
44a13e6f88 Cosmetic: change (type *)0 to NULL. 2008-11-06 03:34:37 +00:00
dyoung
0703ab0f27 Fix typo: IEEE80211_DUR_DIFS -> IEEE80211_DUR_DS_DIFS. 2008-11-06 03:28:59 +00:00
dyoung
5c0c1b5199 Use NULL instead of (bus_dma_tag_t)0. 2008-11-06 01:17:24 +00:00
dyoung
557e8919c2 Compute tags over the ACPI sources. 2008-11-06 00:41:52 +00:00
abs
09149f66a7 Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
2008-11-05 23:55:06 +00:00
bouyer
b9e39927ac evtchn_do_event(): in our C implementation of spllower(), if a handler fails
to restore the spl (shouldn't happen, but ...), we could end up with a
higther pending ipl set and never cleared because iplbit already
handled this level. while (iplmask != 0) {} would then never be true,
and we'd end up triggering KASSERT(iplbit != 0).
Now print the faultly handler and reset the IPL, and start the whole
pending IPL handling again if needed.
2008-11-05 21:04:05 +00:00
hannken
a797621996 fss_bs_thread: initialize b_error and b_resid.
Before it was possible for fss reads to return bogus b_resid values
leading to "delta > 0" panics from physio().
2008-11-05 19:30:57 +00:00
blymn
57e1492b11 * Disable aborting the scan for the moment - it causes a firmware error if
a scan was never initiated which breaks WEP and open wireless connections
* Make sure the ESSID is cleared.
2008-11-05 09:42:20 +00:00
pgoyette
287fe7d56d Fix cut&paste error in prev 2008-11-04 22:16:15 +00:00
pgoyette
3880525312 Restore previous behavior concerning CRITICAL events. Send an event
whenever state enters or exits CRITICAL, or whenever value of sensor
changes while the state is CRITICAL.
2008-11-04 22:06:10 +00:00
darrenr
7f27612b9c wakeup is not the macro WAKEUP everywhere 2008-11-04 21:41:11 +00:00
cliff
477562543e use device_private(self) instead of cast to get sc 2008-11-04 19:47:00 +00:00
abs
d36d67412b Another fix from Tuomo Makinen - Use brelse() to unbusy bp buffer
to allow user to swap floppy disks when prompted.
2008-11-04 17:08:45 +00:00
abs
7bb734ab12 Move tc_init(&clk_timecounter); to stop the "timecounter:" message
appearing in the middle of the clock0 attach message. Tested by
Tuomo Makinen
2008-11-04 16:43:47 +00:00
reinoud
97c1950356 Don't dereference bp->b_vp->v_mount if its vnode type is VT_VNON. I dont
know if this masks a bug but with a machine having a ffs+wapbl mount, NFS
mounts and a ntfs mount this paniced the machine on suspend.
2008-11-04 16:08:41 +00:00
reinoud
3a0f6cde46 Implement powersave for ixpide(4). Tested it on an Asus IXP250 with IGP.
It seems to sleep and awake fine now without errors or warnings.
2008-11-04 16:05:29 +00:00
joerg
47066a311f Make x86 installation use tmpfs. 2008-11-04 14:21:39 +00:00
cegger
bae2482c7f regen. 2008-11-04 13:23:41 +00:00
cegger
982f9b9410 fix typo in previous: prodcut -> product 2008-11-04 13:22:29 +00:00
cegger
b8c4e4c3fe regen. 2008-11-04 12:30:54 +00:00
cegger
2fdc34ba95 add ATI RD790 and RD890 chipset ids 2008-11-04 12:30:07 +00:00
matt
631af3647b Just move the mutex ops into the DEV_MEM case. 2008-11-04 07:31:44 +00:00
matt
420b992a4b Use a mutex to control access DEV_MEM. 2008-11-04 07:21:24 +00:00
matt
2e462089c1 Protect some code with if (pg) { .. } 2008-11-04 07:10:01 +00:00
bjs
bedd1969ee Allow writing to register R300_VAP_PVS_WAITIDLE; allows
r300 driver to work with Mesa-7.2!
2008-11-04 02:26:44 +00:00
christos
b8b90de20c If ipmi failed to attach we would crash because we would end up using callouts
while cold. If cold, wait 10 times longer, and if we spinout fail instead of
trying to poll. Makes my machine boot again.
2008-11-03 22:44:42 +00:00
rjs
d2f451aa63 Use aprint_* instead of printf, device_t/softc split. 2008-11-03 15:13:16 +00:00
cegger
cbc3aa97ef unbreak previous. this change wasn't intended. 2008-11-03 12:33:08 +00:00
cegger
cfeb108e60 The functions called from ipmi_match use the DEVNAME macro. But the softc is allocated on the stack and the accessed sc_dev member is not initialized.
Initialize the sc_dev.dv_xname in ipmi_match, which is enough to make DEVNAME work. Finally this also allows the device_t/softc split.
2008-11-03 12:25:53 +00:00
cegger
3c17eae58b ipmi_match: remove one indentation level 2008-11-03 12:19:06 +00:00
tls
ccd72c0274 Remove include of useless i386/include/clock.h which broke builds on
other architectures.
2008-11-03 04:31:01 +00:00
hans
844d9a4743 call pmf_device_deregister in detach functions. requested by jmcneill. 2008-11-03 00:52:07 +00:00
hans
32ffdb16fe Add NULL pmf handlers. OK by cube. 2008-11-02 14:46:55 +00:00
reinoud
69f1577429 Introduce an extra state to wich all pushed ecclines are pushed on. This
extra state has a holding time in wich no writeouts will be done
effectively collecting more sectors before its even sheduled for writing.
2008-11-01 23:51:25 +00:00
hans
f8681c958c Initialize sc->sc_dev before using it, and use it as argument for the
interrupt handler. Makes this work again. OK by christos.
2008-11-01 20:31:26 +00:00
reinoud
e9d599f49d Explicitly set buffer's block numbers. Blocks were always read/written
correctly only the sheduling could go less than optimal.
2008-11-01 19:50:32 +00:00
hans
f86fa4502c Make the driver work (except for setting display brightness) on older
machines by removing the check for the CMOS method from thinkpad_match.
OK by jmcneill.
2008-11-01 19:22:25 +00:00