Xin LI [Sat, 28 Mar 2009 07:31:02 +0000 (07:31 +0000)]
Minor changes from Berkeley DB 1.86 and further improvements from OpenBSD.
This does not include the new hash routines since they will cause problems
when reading old hash files.
Since mpool(3) has been changed, provide a compatibility shim for older
binaries.
Xin LI [Sat, 28 Mar 2009 07:09:51 +0000 (07:09 +0000)]
Simplify the logic when determining whether to zero out a db file to after
open(). The previous logic only initializes the database when O_CREAT is
set, but as long as we can open and write the database, and the database
is empty, we should initialize it anyway.
Xin LI [Sat, 28 Mar 2009 06:47:05 +0000 (06:47 +0000)]
- If (keysize+datasize)%(bsize=14)==0, insertion of a `big key' would cause
an invariant (actually, an ugly hack) to fail, and all Hell would break
loose.
When deleting a big key, the offset of an empty page should be bsize, not
bsize-1; otherwise an insertion into the empty page will cause the new key to
be elongated by 1 byte.
Make the packing more dense in a couple of cases.
- fix NULL dereference exposed on big bsize values;
Warner Losh [Sat, 28 Mar 2009 06:22:11 +0000 (06:22 +0000)]
When reading via memory, read in (amount + 1) / 2 (to properly round
up) rather than amount + 1 / 2, which is the same as amount, or 2x too
many words which leads to data corruption.
# This fixes the sbdrop panics I was seeing with the Toshiba LANCT00A.
Warner Losh [Sat, 28 Mar 2009 04:56:56 +0000 (04:56 +0000)]
It turns out that the Toshiba LANCT00A PC Card is really like the
Toshiba PCETC ISA card, and even has the same board type code in the
card ID (0x14). So, for this card, call ed_probe_WD80x3_generic after
setting things up apropriately. This makes the card attach and kinda
work (I'm seeing panics in sbdrop). Since history has shown that the
WD80x3 probe routine is dangerous, only do it for this card. Also,
disable the memory range check to make sure it is an valid ISA memory.
I think that it is bogus, but I'm not 100% sure, for these cards.
I removed probing for the WD80x3 in 2005 when I added support for the
AX88x90 and DL100xx cards since none of my cards had ever matched it
and PAO3 removed it and none of the cards in their database died.
It is possible there are other quirks about this card too, since no
other open source OS supports it, or even claims to support it. But
it was a fun half hour hack...
Xin LI [Sat, 28 Mar 2009 04:00:46 +0000 (04:00 +0000)]
When allocating memory, zero out them if we don't intend to overwrite them
all; before freeing memory, zero out them before we release it as free
heap. This will eliminate some potential information leak issue.
While there, remove the PURIFY option. There is a slight difference between
the new behavior and the old -DPURIFY behavior, with the latter initializes
memory with 0xff's. The difference between old and new approach does not
generate observable difference.
Warner Losh [Fri, 27 Mar 2009 19:15:28 +0000 (19:15 +0000)]
Add bromax axnet based cards to the mix. This was harvested from the linux
driver. Not sure who sold it/rebadged it.
Add stub entries for Mitsubishi B8895 and Toshiba LANCT00A to the
driver with a comment that they don't work /* NG */.[*] These are
DP83902A based cards, which should work, but don't seem to. Likely
they are from the days before the ne2000 roamed the earth and use a
non-standard hookup (see if_ed_isa or if_ed_cbus for some examples).
Unless I happen to stumble into the right one, these may never work,
but I'm tired of omitting them from commits.
[*] The Japanese adopted OK from English, but also use NG for its
opposite.
Ed Schouten [Fri, 27 Mar 2009 19:13:36 +0000 (19:13 +0000)]
Don't strip TTY device name to the last '/'.
We've seen this bug in other applications before: we have some
applications that use strrchr(tty, '/') on the TTY device name. This
isn't valid when using pts(4), because the device name will be stripped
to "0" instead of "pts/0".
This fixes issues with login(1) ignoring /etc/ttys and missing utmp
records.
Doug Ambrisko [Fri, 27 Mar 2009 17:00:49 +0000 (17:00 +0000)]
Revert 190445 change to this file restoring:
typedef l_long l_off_t;
Change l_mmap_argv's to l_ulong for pgoff. This restores prior behaviour
to consumers of l_off_t but allows mmap to mmap a 32bit position which a
Linux application requires to access SMBIOS data via /dev/mem.
Juli Mallett [Fri, 27 Mar 2009 05:44:53 +0000 (05:44 +0000)]
Put the "%d retries" debug message in the transmit path behind WPI_DEBUG_TX
rather than behind a seemingly accidental constant likely left over from one of
the related drivers which uses log levels rather than per-facility debugging
flags. This should get rid of contextless messages on the console for people
who have not set (or cleared the default) debugging flags.
Marcel Moolenaar [Fri, 27 Mar 2009 05:35:12 +0000 (05:35 +0000)]
Sharpen the saw:
o Don't create an APM scheme underneath another scheme when
the probe doesn't allow it.
o APM uses 32-bit block numbers. Limit the scheme to 2^32-1
blocks when the media is larger.
Juli Mallett [Fri, 27 Mar 2009 03:17:25 +0000 (03:17 +0000)]
o) Check that no overrun or CRC errors were encountered in receiving a
packet. Linux, OpenBSD and our iwn(4) all do this. It also results in
a huge performance improvement (and the rejection of a fair number of
apparently-bad packets on receive) on my hardware.
o) Like the wpi(4) driver in OpenBSD, and like our iwn(4), also drop runt
packets.
o) Don't bother doing IFQ_POLL and then IFQ_DRV_DEQUEUE, just do
IFQ_DRV_DEQUEUE outright. This is more similar to how OpenBSD and our
iwn(4) work.
Sam Leffler [Thu, 26 Mar 2009 21:29:03 +0000 (21:29 +0000)]
o move tdma+superg protocol defs out of public view
o add #ifdef _KERNEL to superg+tdma include files so they can be used
by user code to get the protocol defs
John Baldwin [Thu, 26 Mar 2009 21:10:35 +0000 (21:10 +0000)]
Move the code to update cpu_cx_count out of acpi_cpu_generic_cx_probe() and
into acpi_cpu_startup() which is where all the other code to update this
global variable lives. This fixes a bug where cpu_cx_count was not updated
correctly if acpi_cpu_generic_cx_probe() returned early.
PR: kern/108581
Debugged by: Bruce Cran
Reviewed by: avg, njl, sepotvin
MFC after: 3 days
Sam Leffler [Thu, 26 Mar 2009 19:13:11 +0000 (19:13 +0000)]
Fix enough bits so that fast frames work again:
o include ath ie in beacon frames
o fix probe response check for including ath ie
o add ieee80211_add_athcap shorthand for ap-side ie additions
Doug Ambrisko [Thu, 26 Mar 2009 17:14:22 +0000 (17:14 +0000)]
Add stuff to support upcoming BMC/IPMI flashing of newer Dell machine
via the Linux tool.
- Add Linux shim to ipmi(4)
- Create a partitions file to linprocfs to make Linux fdisk see
disks. This file is dynamic so we can see disks come and go.
- Convert msdosfs to vfat in mtab since Linux uses that for
msdosfs.
- In the Linux mount path convert vfat passed in to msdosfs
so Linux mount works on FreeBSD. Note that tasting works
so that if da0 is a msdos file system
/compat/linux/bin/mount /dev/da0 /mnt
works.
- fix a 64it bug for l_off_t.
Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to
/compat/linux/etc/mtab and then some careful unpacking of the Linux bmc
update tool and hacking makes it work on newer Dell boxes. Note, probably
if you can't figure out how to do this, then you probably shouldn't be
doing it :-)
Warner Losh [Wed, 25 Mar 2009 22:12:07 +0000 (22:12 +0000)]
It appears that the TDK LAK CD011 works with fe driver. I don't have
a dongle for the card, but it passes the sanity testsin the
probe/attach routines and returns the correct MAC address.
John Baldwin [Wed, 25 Mar 2009 22:08:30 +0000 (22:08 +0000)]
Fix a few nits in the earlier changes to prevent local information leakage
in AMD FPUs:
- Do not clear the affected state in the case that the FPU registers for
the thread that already owns the FPU are changed via fpu_setregs(). The
only local information the thread would see is its own state in that
case.
- Fix a type mismatch for the dummy variable used in a "fld". It accepts
a float, not a double.
Ivan Voras [Wed, 25 Mar 2009 20:38:57 +0000 (20:38 +0000)]
Create GEOM labels from UFS IDs, e.g. /dev/ufsid/49c97b1faa2adc43. UFS IDs
are always present and can be used to identify file systems (useful if
hardware devices move often).
Ulf Lilleengen [Wed, 25 Mar 2009 20:15:48 +0000 (20:15 +0000)]
- Add proper error checking and printing to the CVSMode code when reading and
writing from/to streams, as leaving them out stops csup from cleaning up on
SIGINT and friends properly.
Luigi Rizzo [Wed, 25 Mar 2009 18:48:46 +0000 (18:48 +0000)]
This config file uses dynamically linked binaries, which is more
convenient when you want to import other programs because the
libraries will not be replicated.
Given that there are no floppies around anymore, I have bumped
the fd size to 4MB (which is more than reasonable even for
embedded platforms) and gives some room for other utilities.
Robert Watson [Wed, 25 Mar 2009 17:47:22 +0000 (17:47 +0000)]
Move dtnfsclient.c in the cddl tree to nfs_kdtrace.c in the nfsclient
directory, since it's under a BSD license, and this keeps NFS internals-
aware tracing parts close to NFS.
Hajimu UMEMOTO [Wed, 25 Mar 2009 16:23:43 +0000 (16:23 +0000)]
Add support for SCTP to getaddrinfo(3).
Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and
IPPROTO_SCTP. It confuses some programs. If getaddrinfo(3) returns
IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at
least Apache doesn't work. So, I made getaddrinfo(3) to return
IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified
explicitly by hints.ai_protocol.
David Schultz [Wed, 25 Mar 2009 05:10:32 +0000 (05:10 +0000)]
Merge an important change that I mistakenly left out when merging C99
inline function support. This should fix instances where gcc
spuriously reports the following error:
error: nested function 'foo' declared but never defined
Nathan Whitehorn [Wed, 25 Mar 2009 03:42:49 +0000 (03:42 +0000)]
Disable ATA DMA for ATAPI devices for now. Apparently, certain revisions
of this controller, in combination with certain ATAPI devices and phases
of the moon, will cause DMA operations for ATAPI to fail.
Robert Noland [Wed, 25 Mar 2009 01:50:56 +0000 (01:50 +0000)]
Rework the management of vblank interrupts a bit.
When a vt switch occurs the irq handler is uninstalled. Interrupts
and the state tracking of what was enabled/disabled wasn't working
properly. This should resolve the reports of "slow windows" after a
vt switch, among other things. The radeon 2d driver seems to work a
bit more correctly than the Intel driver. With the Intel driver,
vblank interrupts will be enabled at system startup and will only
be disabled after an additional modeset (vt switch, dpms, randr event).
With this patch, I am able to run glxgears synced to vblank and
vt switch while it is running without ill effects.
Robert Watson [Tue, 24 Mar 2009 23:16:48 +0000 (23:16 +0000)]
Fix two bugs in DTrace tracing of accesscache and attrcache load events:
- Trace non-error loads into the access cache once, not zero times or
twice.
- Sometimes attr cache loads fail due to a race, in which case they are
aborted leading to an invalidation; in this case, trace only the flush,
not a load.
John Baldwin [Tue, 24 Mar 2009 18:10:22 +0000 (18:10 +0000)]
Fall back to using configuration type 1 accesses for PCI config requests if
the requested PCI bus falls outside of the bus range given in the ACPI
MCFG table. Several BIOSes seem to not include all of the PCI busses in
systems in their MCFG tables. It maybe that the BIOS is simply buggy and
does support all the busses, but it is more conservative to just fall back
to the old method unless it is certain that memory accesses will work.