marius [Sun, 25 Feb 2007 18:25:14 +0000 (18:25 +0000)]
MFC: 1.21, 1.22
- Probe Davicom DM9102 PHYs.
- Don't set MIIF_NOISOLATE so amphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
AM79c873 and workalikes per se nor in combination with the NICs they're
used with and amphy(4) was already adding IFM_NONE anyway.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix a whitespace nit.
Obtained from: NetBSD dmphy(4) (except for the last item)
marius [Sun, 25 Feb 2007 18:22:30 +0000 (18:22 +0000)]
MFC: 1.21
Set MIIF_HAVE_FIBER and add IFM_100_FX media when the AC_MCTL_FX_SEL
and thus the FX_DIS pin indicates fibre media. This is part 1/2 of
adding support for the 100baseFX interface/port of AT-2700 series
adaptors.
marius [Sun, 25 Feb 2007 18:20:28 +0000 (18:20 +0000)]
MFC: 1.20
- In acphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- Fix a whitespace nit.
- Probe another Altima PHY, which is a AC101 workalike and integrated
in at least ADMtek ADM8511 but apparently is not mentioned in any
publically available data sheet so the actual identifier is unknown.
- Don't set MIIF_NOISOLATE so acphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
AC101 and workalikes per se nor in combination with the NICs they're
used with.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
Obtained from: NetBSD (except for the first and second item)
marius [Sun, 25 Feb 2007 18:16:31 +0000 (18:16 +0000)]
MFC: 1.35
- Add another Altima PHY, which is a AC101 workalike and integrated
in at least ADMtek ADM8511 but apparently is not mentioned in any
publically available data sheet so the actual identifier is unknown.
- Add Davicom DM9102 PHY.
- Add DM9101 to the description of AMD 79C873 as at least some Davicom
DM9101F identify identical to AMD 79C873.
marius [Sun, 25 Feb 2007 18:13:14 +0000 (18:13 +0000)]
MFC: 1.22
- Don't set MIIF_NOISOLATE so tdkphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
78Q2120 per se nor in combination with the NICs they're used with and
tdkphy(4) was already adding IFM_NONE anyway.
- Set MIIF_NOLOOP as loopback doesn't work with this PHY. The MIIF_NOLOOP
flag currently triggers nothing but hopefully will be respected by
mii_phy_setmedia() later on.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
Thanks to Hans-Joerg Sirtl for lending me test hardware.
marius [Sun, 25 Feb 2007 18:11:00 +0000 (18:11 +0000)]
MFC: 1.9 (partial), 1.14, 1.15
- Remove the first rgephy_reset() invocation in rgephy_attach(). This
seems to have been missed when merging rev. 1.9, which actually moves
the rgephy_reset() invocation further down, in rev. 1.6.2.1.
- Don't set MIIF_NOISOLATE so rgephy(4) can be used in configurations
with multiple PHYs and un-comment case IFM_NONE in case MII_MEDIACHG
rgephy_service(). There doesn't seem to be a problem with isolating
RTL8169S and their internal PHY.
- Take advantage of mii_phy_add_media(). [1]
Some style changes to a couple of PHY drivers:
- Fix some whitespace nits.
- Fix some spelling in comments.
- Use MII_ANEGTICKS instead of 5.
- Don't define variables in nested scope.
- Remove superfluous returns at the end of void functions.
- Remove unused static global rgephy_mii_model.
- Remove dupe $FreeBSD$ in ciphy(4) and dupe $Id$ in tdkphy(4).
- Sort brgphys table.
Add a helper function mii_phy_dev_probe(), which wraps around the
mii_phy_match() API and takes care of the PHY device probe based on
the struct mii_phydesc array and the match return value provided.
Convert PHY drivers to take advantage of mii_phy_dev_probe(),
converting drivers to provide a mii_phydesc table in the first
place where necessary.
bms [Sun, 25 Feb 2007 14:48:29 +0000 (14:48 +0000)]
MFC rev 1.163:
Clean up after tun(4) properly; remove routes whose ifp is set to
that of the tun instance even for the !AF_INET case, and properly
remove configured addresses by calling if_purgeaddrs().
Maintain the TUN_DSTADDR behaviour for compatibility with the OS/390
emulator.
bde [Sun, 25 Feb 2007 05:01:05 +0000 (05:01 +0000)]
MFC (1.80: style fixes and 1.81: fix high resolution kernel profiling).
I was reminded of the brokenness when attempting to profile sendto()
to compare RELENG_6 with -current. Just configuring high res profiling
made sendto() with profiling inactive almost twice as slow in RELENG_6,
and actual profiles were almost unusable due to multiple copies of
non-inlined inline functions like curthread().
bms [Sat, 24 Feb 2007 11:11:36 +0000 (11:11 +0000)]
MFC rev 1.68:
Drop unicast Ethernet frames not destined for the configured address
of a tap(4) instance, if IFF_PROMISC is not set.
In tap(4), we should emulate the effect IFF_PROMISC would have on
hardware, otherwise we risk introducing layer 2 loops if tap(4) is
used with bridges. This means not even bpf(4) gets to see them.
This patch has been tested in a variety of situations. Multicast and
broadcast frames are correctly allowed through. I have observed this
behaviour causing problems with multiple QEMU instances hosted on
the same FreeBSD machine.
The checks in in ether_demux() [if_ethersubr.c, rev 1.222, line 638]
are insufficient to prevent this bug from occurring, as ifp->if_vlantrunk
will always be NULL for the non-vlan case.
PR: 86429
Submitted by: Pieter de Boer (with changes)
luigi [Thu, 22 Feb 2007 19:10:48 +0000 (19:10 +0000)]
MFC: sync firmware(9) and iwi(4) with the version in HEAD (the changes
are related and this is why the MFC is done together).
In detail:
firmware(9):
Cleanup and document the implementation of firmware(9) based on
a version that i posted earlier on the -current mailing list,
and subsequent feedback received. See the commit log
luigi 2007-02-15 17:21:31 UTC
The core of the change is just in sys/firmware.h and kern/subr_firmware.c,
while other files are just adaptation of the clients to the ABI change
(const-ification of some parameters and hiding of internal info,
so this is fully compatible at the binary level).
Note that in RELENG_6 sys/arm/xscale/ixp425, sys/dev/ipw and
sys/dev/mxge do not exist or have not been updated to use firmware(9).
iwi(4)
+ add debugging code IWI_LOCK_CHECK() to print (under sysctl debug.iwi)
missing locks;
+ make sure that iwi_ioctl() wait until the previous iwi_cmd() terminates.
n_hibma [Tue, 20 Feb 2007 22:56:28 +0000 (22:56 +0000)]
MFC the following commits:
Align the interfaces for the various watchdogs and make the interface
behave as expected.
Also:
- Return an error if WD_PASSIVE is passed in to the ioctl as only
WD_ACTIVE is implemented at the moment. See sys/watchdog.h for an
explanation of the difference between WD_ACTIVE and WD_PASSIVE.
- Remove the I_HAVE_TOTALLY_LOST_MY_SENSE_OF_HUMOR define. If you've
lost your sense of humor, than don't add a define.
Specific changes:
i80321_wdog.c
Don't roll your own passive watchdog tickle as this would defeat the
purpose of an active (userland) watchdog tickle.
ichwd.c / ipmi.c:
WD_ACTIVE means active patting of the watchdog by a userland process,
not whether the watchdog is active. See sys/watchdog.h.
kern_clock.c:
(software watchdog) Remove a check for WD_ACTIVE as this does not make
sense here. This reverts r1.181.
Don't exit from watchdogd on receiving a signal if we cannot stop the watchdog.
That'll require -KILL. This avoids resetting your system on one of the
watchdogs that you cannot disable.
cognet [Tue, 20 Feb 2007 18:03:28 +0000 (18:03 +0000)]
MFC rev 1.2 and 1.5:
revision 1.2
date: 2005/10/03 14:18:21; author: cognet; state: Exp; lines: +12 -2
Make mem.c know about the pages allocated with ARM_USE_SMALL_ALLOC.
revision 1.5
date: 2007/02/13 15:35:57; author: cognet; state: Exp; lines: +13 -0
Make sure the address is valid before mapping it.
mohans [Fri, 16 Feb 2007 03:53:33 +0000 (03:53 +0000)]
MFC:
Backing out an earlier change. It seems harmless for NFS to miss the "force
unmount" flag, making the acquisition of the MNT_ILOCK in nfs_request() and
nfs_sigintr() unnecessary. Pointed out by tegge@.
luigi [Thu, 15 Feb 2007 19:49:27 +0000 (19:49 +0000)]
MFC kern_linker.c 1.133 and related changes:
- push Giant into linker_reference_module();
- introduce linker_release_module(), which also takes care of
proper locking.
The latter also fixes a missing mtx_loc/unlock in subr_firmware.c .
Apparently, digi.c is the only external client of linker_reference_module()
which is a bit suspicious - perhaps dev/digi/ could make with a bit
of review from someone knowledgeable to check how the function is used,
and whether it could be replaced by something else.
jhb [Wed, 14 Feb 2007 17:04:05 +0000 (17:04 +0000)]
Add a couple of missing breaks that are harmless, though the first one
missing meant that a PCI-PCI bridge that supported MSI but didn't support
PCIY_SUBVENDOR (or the MSI capability came after the subvendor cap) would
have garbage in its subvendor ID.
bms [Wed, 14 Feb 2007 13:39:01 +0000 (13:39 +0000)]
MFC rev 1.98:
Import macros IN_LINKLOCAL(), IN_PRIVATE(), IN_LOCAL_GROUP(), IN_ANY_LOCAL().
This is not a functional change.
IN_LINKLOCAL() tests if an address falls within the IPv4 link-local prefix.
IN_PRIVATE() tests if an address falls within an RFC 1918 private prefix.
IN_LOCAL_GROUP() tests if an address falls within the statically assigned
link-local multicast scope specified in RFC 2365.
IN_ANY_LOCAL() tests for either of IN_LINKLOCAL() or IN_LOCAL_GROUP().
As with the existing macros in the FreeBSD netinet stack, comparisons
are performed in host-byte order.
bms [Wed, 14 Feb 2007 13:35:11 +0000 (13:35 +0000)]
MFC rev 1.75:
In the ICMP6 path to handle FQDN 'who-are-you' queries, check that the
packet header mbuf is non-NULL before trying to create a duplicate of it.
pav [Wed, 14 Feb 2007 09:29:33 +0000 (09:29 +0000)]
MFC 1.63:
Rewrite the udf_read() routine to use a file vnode instead of the devvp vnode.
The code is modelled after cd9660, including support for simple read-ahead
courtesy of clustered read.
Fix udf_strategy to DTRT.
This change fixes sendfile(2) not to send out garbage.
maxim [Tue, 13 Feb 2007 15:38:17 +0000 (15:38 +0000)]
MFC rev. 1.158: increment requests counter right before send out
an ARP query actually. Otherwise the code could lead to the
spurious EHOSTDOWN errors.
cperciva [Tue, 13 Feb 2007 07:31:22 +0000 (07:31 +0000)]
MFC archive_read.c rev. 1.29:
Don't reference a NULL pointer.
MFC archive_read_support_compression_none.c rev. 1.14:
Print off_t by casting to intmax_t and using %jd.
Ask the client skipper to handle requests > SSIZE_MAX if the API works.
rodrigc [Tue, 13 Feb 2007 05:56:43 +0000 (05:56 +0000)]
MFC: New unionfs implementation from Daichi GOTO and Masanori OZAWA,
which fixes many locking and crashing problems in the previous
implementation. kib@ helped a lot by eliminating a source
of deadlocks encountered with unionfs with these commits:
rev. 1.50 of src/sys/fs/deadfs/dead_vnops.c
rev. 1.97 of src/sys/kern/vfs_lookup.c
Submitted by: daichi, Masanori OZAWA <ozawa ongs co jp>
jhb [Mon, 12 Feb 2007 19:08:29 +0000 (19:08 +0000)]
MFC: Do not set B_NOCACHE on buffers when releasing them in flushbuflist().
If B_NOCACHE is set the pages of vm backed buffers will be invalidated.
However clean buffers can be backed by dirty VM pages so invalidating them
can lead to data loss.
Add support for flush dirty page in the data invalidation function
of some network file systems.
This fixes data losses during vnode recycling (and other code paths
using invalbuf(*,V_SAVE,*,*)) for data written using an mmaped file.
jhb [Mon, 12 Feb 2007 17:57:14 +0000 (17:57 +0000)]
MFC: Sync up bus_dma(9) to rev 1.39 (except for rev 1.37 since 6.x doesn't
have a real bus_get_dma_tag()) and add MLINK for bus_dmamap_load_mbuf_sg().
Prompted by a user who noticed the bus_dmamap_sync ops stuff was still
wrong in 6.x.
Reported by: Jason Harmening <jason.harmening at gmail>
marius [Sun, 11 Feb 2007 18:10:58 +0000 (18:10 +0000)]
MFC: 1.24, 1.26
- In rlphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- In rlphy_status() just use if_dname instead of determining the name
of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)).
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix some whitespace nits and remove commented out code that just can't
be used with RealTek PHYs.
marius [Sun, 11 Feb 2007 18:05:42 +0000 (18:05 +0000)]
MFC: 1.17
- In qsphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- Don't set MIIF_NOISOLATE so qsphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
QS6612 per se nor in combination with the NICs they're used with.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
marius [Sun, 11 Feb 2007 18:03:22 +0000 (18:03 +0000)]
MFC: 1.26, 1.28
- Don't add IFM_NONE when used in combination with pcn(4) as for MII
loopback to work PCnet chips additionally need to be placed into
external loopback mode which pcn(4) doesn't do so far.
- In nsphy_service() just use if_dname instead of determining the name
of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)).
- Don't set MIIF_NOISOLATE, except for when used in combination with a
NIC that wedges when isolating the PHYs, so nsphy(4) can be used in
configurations with multiple PHYs.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia() (requires the MIIF_FORCEANEG
added in sys/dev/mii/mii_physubr.c 1.22.2.3, sys/dev/mii/miivar.h
1.15.14.2).
- Implement a separate nsphy_reset(). There are two reasons for this:
1) This PHY can take an inordinate amount of time to reset if media
is attached; under fairly normal circumstances up to nearly one
second. This is because it appears to go through an implicit auto-
negotiation cycle as part of the reset.
2) During reset and auto-negotiation, the BMCR will clear the reset
bit before the process is complete. It will return 0 until the
process is complete and it's safe to access the PHY again.
This is the first of two changes required to make the combination of
Am79c971 and DP83840A found on certain HP cards and on-board in IBM
machines work.
- Fix some whitespace nits.
Based on: NetBSD (except for the first and second item)
- Fix obsolete comment.
- Extend references to lnc(4) by references to le(4) as the constraint
described in the comment applies to the latter as well.
- Don't bother to include IDs of PCnet chips which are not supported
by this driver and largely are not even PCI devices in pcn_chipid.
- Use device_printf(9)/if_printf(9) rather than implementing their
functionality with printf(9).
- Sprinkle some const.
marius [Sun, 11 Feb 2007 16:09:11 +0000 (16:09 +0000)]
MFC: 1.17, 1.19
- Don't set MIIF_NOISOLATE so lxtphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
LXT970 per se nor in combination with the NICs they're used with and
lxtphy(4) was already adding IFM_NONE anyway.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix some whitespace nits.
Analogous to mii_add_media(), factor out the code for checking whether
the BMSR contains any media at all to mii_phy_add_media(). The majority
of the drivers currently using mii_phy_add_media() were missing such a
check anyway though.
marius [Sun, 11 Feb 2007 15:09:50 +0000 (15:09 +0000)]
MFC: mii_physubr.c 1.26, miivar.h 1.19
- Add a MIIF_FORCEANEG flag which forces an auto-negotiation to always
take place if IFM_AUTO is selected. This allows drivers like nsphy(4),
which need to force writing the ANAR according to the BMSR, to take
advantage of mii_phy_setmedia(). [1]
- In mii_phy_reset() once the current media is set don't isolate the PHY
corresponding to the instance of the currently selected media rather
than unconditionally not isolating the PHY corresponding to instance 0.
This saves a isolation-unisolation-cycle of the PHY corresponding to
the currently selected media for the case were it isn't instance 0.
- Fix some whitespace nits. [1]
mohans [Sun, 11 Feb 2007 03:31:19 +0000 (03:31 +0000)]
MFC:
Fix for problems that occur when all mbuf clusters migrate to the mbuf packet
zone. Cluster allocations fail when this happens. Also processes that may have
blocked on cluster allocations will never be woken up. Thanks to rwatson for
an overview of the issue and pointers to the mbuma paper and his tool to dump
out UMA zones.
mohans [Sun, 11 Feb 2007 03:13:54 +0000 (03:13 +0000)]
MFC :
Fix for a bug where only one process (of multiple) blocked on
maxpages on a zone is woken up, with the rest never being woken up as
a result of the ZFLAG_FULL flag being cleared. Wakeup all such blocked
procsses instead. This change introduces a thundering herd, but since
this should be relatively infrequent, optimizing this (by introducing
a count of blocked processes, for example) may be premature.
mohans [Sun, 11 Feb 2007 03:07:46 +0000 (03:07 +0000)]
MFC:
Fixes up the handling of shared vnode lock lookups in the NFS client,
adds a FS type specific flag indicating that the FS supports shared
vnode lock lookups, adds some logic in vfs_lookup.c to test this flag
and set lock flags appropriately.
This change fixes the general problem of cascading vnode locks when an
NFS server goes down.
Ideally, we wouldn't need these changes, as enabling shared vnode lock
lookups globally would work. Unfortunately, UFS, for example isn't
ready for shared vnode lock lookups, crashing pretty quickly.
This change is the result of discussions with Stephan Uphoff (ups@).
Thanks to Kris for shaking out several bugs in NFS with shared vnode
lock lookups in current. MFC'ed per Kris' request.
brooks [Fri, 9 Feb 2007 03:11:32 +0000 (03:11 +0000)]
Sync dhclient and supporting code with CURRENT. In particular:
- Introduce per-interface dhclient_flags_<ifn> and
background_dhclient_<ifn> rc.conf variables.
- Default to sending a client identifer.
- When an invalid host name option is sent, delete it and accept the
lease.
- Fix usage, the call to getopt, and a typo in rc.d/dhclient.
ade [Wed, 7 Feb 2007 09:15:04 +0000 (09:15 +0000)]
MFC: rev 1.71/1.72
Remove hard-coded limit (200) on maximum number of packages that can be
added with a single invocation of pkg_add, replacing it with something
rather more dynamic.