Doug Barton [Mon, 2 Jun 2008 20:37:11 +0000 (20:37 +0000)]
Add proper mime-types for files that they are relevant for.
This is useful for things like *.pdf files that svn needs
to know about, and will probably be useful down the road
for other things.
John Baldwin [Mon, 2 Jun 2008 19:58:48 +0000 (19:58 +0000)]
Make fe(4) MPSAFE:
- Add a mutex to the softc to protect the softc and device hardware.
- Don't leak bus resources if if_alloc() fails during attach.
- Setup the interrupt handler after calling ether_ifattach().
- Use a private timer to manage the transmit watchdog.
Tested by: WATANABE Kazuhiro CQG00620 of nifty.ne.jp
John Baldwin [Mon, 2 Jun 2008 19:43:24 +0000 (19:43 +0000)]
Add locking and make xe(4) MPSAFE:
- Add a mutex to protect the softc and device hardware.
- Use a callout rather than a callout_handle for the media timer.
- Use a dedicated timer for managing the tx watchdog rather than if_timer.
- Fix some resource leaks if xe_attach() fails.
- Shutdown the device before detaching the driver.
- Setup the interrupt handler after ether_ifattach().
John Baldwin [Mon, 2 Jun 2008 19:17:40 +0000 (19:17 +0000)]
Make ie(4) MPSAFE:
- Add a mutex to the softc and use it to protect the softc and device.
- Setup the interrupt handler in the common code instead of in each front
end and do it after ether_ifattach().
- Use ie_stop() and ieinit_locked() in iereset() rather than frobbing IFF_UP
and invoking ieioctl().
- Use DELAY() to implement a spin loop on a register with a timeout rather
than scheduling a timeout and then doing a tight spin on the register.
In the non-MPSAFE case this would never have worked because the spinning
code held Giant and the timeout routine would have been blocked on Giant
forever. The same approach would not worke in the MPSAFE case either for
the same reason, hence use a loop around DELAY().
- Clear IFF_DRV_(RUNNING|OACTIVE) in ie_stop() rather than in callers.
- Call ieinit_locked() directly rather than ieioctl(!) from ie_mc_reset().
- Don't leak the rx frame buffer on detach.
Tested by: Thierry Herbelot thierry of herbelot.com
Doug Rabson [Mon, 2 Jun 2008 15:59:10 +0000 (15:59 +0000)]
When attempting to use the NSM state number in a lock request to detect
a client reboot, do this check before performing the lock otherwise we
will trash the new lock along with any other old locks the client held
before rebooting.
Make sure nlm_check_idle always returns with nlm_global_lock held.
Robert Watson [Mon, 2 Jun 2008 14:20:26 +0000 (14:20 +0000)]
When allocating temporary storage to hold a TCP/IP packet header
template, use an M_TEMP malloc(9) allocation rather than an mbuf
with mtod(9) and dtom(9). This eliminates the last use of
dtom(9) in TCP.
Ed Schouten [Mon, 2 Jun 2008 08:40:06 +0000 (08:40 +0000)]
Push down the major/minor conversion for pts/%u to improve consistency.
In the mpsafetty branch, Linux sshd seems to work properly inside a
jail. Some small modifications had to be made to the Linux compatibility
layer.
The Linux PTY routines always expect the device major number to be 136
or higher. Our code always set the major/minor number pair to 136:0.
This makes routines like ttyname() and ptsname() fail, because we'll end
up having ambiguous device numbers.
The conversion was not performed on all *stat() routines, which meant in
some cases the numbers didn't get transformed. By pushing the conversion
into linux_driver_get_major_minor(), the transformation will take place
on all calls.
Warner Losh [Mon, 2 Jun 2008 04:50:47 +0000 (04:50 +0000)]
getopt returns an int, not a char. Make sure that we store the
variable in an int to avoid casting to an unsigned value which causes
the comparison with -1 to fail.
Warner Losh [Sun, 1 Jun 2008 20:55:34 +0000 (20:55 +0000)]
Slight simplification of the power parsing code, as well as using
autoincrement in some places where it makes sense. This makes this .o
about 180 bytes smaller on x86 and amd64 with no apparent functional
changes.
Alexander Motin [Sun, 1 Jun 2008 18:34:58 +0000 (18:34 +0000)]
Increase LINK_TABLE_OUT_SIZE from 101 to 4001 like LINK_TABLE_IN_SIZE
to reduce performance degradation under heavy outgoing scan/flood.
Scalability is now much more important then several kilobytes of RAM.
Remove unneded TCP-specific expiration handeling. Before this connected
TCP sessions could never expire. Now connected TCP sessions will expire
after 24hours of inactivity.
Simplify HouseKeeping() to avoid several mul/div-s per packet. Taking into
account increased LINK_TABLE_OUT_SIZE, precision is still much more then
required.
Alexander Motin [Sun, 1 Jun 2008 17:52:40 +0000 (17:52 +0000)]
Make m_megapullup() more intelligent:
- to increase performance do not reallocate mbuf when possible,
- to support up to 16K packets (was 2K max) use mbuf cluster of proper size.
This change depends on recent ng_nat and ip_fw_nat changes.
Alexander Motin [Sun, 1 Jun 2008 15:13:32 +0000 (15:13 +0000)]
Pass really available buffer size to libalias instead of MCLBYTES constant.
MCLBYTES constant were used with believe that m_megapullup() always moves
date into a fresh cluster that may become not so.
Philip Paeps [Sun, 1 Jun 2008 13:44:51 +0000 (13:44 +0000)]
Try to detect a Synaptics touchpad before IntelliMouse. Some touchpads will
pretend to be IntelliMouse (which have a few more features than generic mice)
causing the IntelliMouse probe to work and the Synaptics code never to be
called.
This should not break "real" IntelliMouse because the Synaptics detection code
is fairly specific.
Alexander Motin [Sun, 1 Jun 2008 12:29:23 +0000 (12:29 +0000)]
PKT_ALIAS_FOUND_HEADER_FRAGMENT result is not an error, so pass that packet.
This fixes packet fragmentation handeling.
Pass really available buffer size to libalias instead of MCLBYTES constant.
MCLBYTES constant were used with believe that m_megapullup() always moves
date into a fresh cluster that sometimes may become not so.
Alan Cox [Sun, 1 Jun 2008 07:36:59 +0000 (07:36 +0000)]
Correct an error in pmap_promote_pde() that may result in an errant
promotion within the kernel's address space. Specifically,
pmap_promote_pde() is only called when the page table page (PTP) that
is referenced by the given PDE has a full "use count", i.e., its
wire_count is 512. Although this guarantees for a user address space
that all 512 PTEs in the PTP hold valid mappings, the same is not true
of the kernel's address space. A kernel PTP always has a use count of
512 regardless of the state of the PTEs. Therefore,
pmap_promote_pde() should not assume (or assert) that the first PTE in
the PTP is valid.
John Birrell [Sun, 1 Jun 2008 01:46:37 +0000 (01:46 +0000)]
Merge a recent change from the OpenSolaris source tree.
(Don't ask for a vendor import of this yet, we're in the early days of svn)
Instead of using cyclic timers to call the state clean and deadman callbacks,
use a callout on FreeBSD to avoid the deadlock on FreeBSD due to trying to
send interprocessor interrupts with interrupts disabled.
Sam Leffler [Sat, 31 May 2008 22:44:06 +0000 (22:44 +0000)]
5416 and similar chips grew another region in the pci clock domain
where register accesses do not pass through the byte-lane hardware;
extend the register op macros to deal with this
Ed Schouten [Sat, 31 May 2008 14:06:37 +0000 (14:06 +0000)]
Merge back devfs changes from the mpsafetty branch.
In the mpsafetty branch, PTY's are allocated through the posix_openpt()
system call. The controller side of a PTY now uses its own file
descriptor type (just like sockets, vnodes, pipes, etc).
To remain compatible with existing FreeBSD and Linux C libraries, we can
still create PTY's by opening /dev/ptmx or /dev/ptyXX. These nodes
implement d_fdopen(). Devfs has been slightly changed here, to allow
finit() to be called from d_fdopen().
The routine grantpt() has also been moved into the kernel. This routine
is a little odd, because it needs to bypass standard UNIX permissions.
It needs to change the owner/group/mode of the slave device node, which
may often not be possible. The old implementation solved this by
spawning a setuid utility.
When VOP_SETATTR() is called with NOCRED, devfs_setattr() dereferences
ap->a_cred, causing a kernel panic. Change the de_{uid,gid,mode} code to
allow changes when a->a_cred is set to NOCRED.
Hiroki Sato [Sat, 31 May 2008 13:27:16 +0000 (13:27 +0000)]
New release notes:
syscons(4) Colemak keyboard layout support,
jme(4) for JMicron JMC250 Gigabit/JMC260 Fast Ethernet controllers,
ISDN4BSD and netatm removal,
libarchive-based cpio added and GNU cpio renamed as gcpio,
jexec(8) -j option added,
ping6(8) return value is now the same as ping(8),
tar(1) --numeric-owner, -S, and -s options added, and
pkg_create(1) -n option added.
John Baldwin [Fri, 30 May 2008 22:01:09 +0000 (22:01 +0000)]
After probing the available frequency settings, restore the CPU to run at
whatever frequency it started at instead of always picking the highest
frequency. The first version of this driver attempted to do this, but it
set the speed to the first frequency in the list rather than the value it
had saved.
Qing Li [Fri, 30 May 2008 09:34:35 +0000 (09:34 +0000)]
When RADIX_MPATH is enabled, the route selection is not rotating
through the multipath entries. The hash value was a signed integer
and was always giving a -1 value.
Doug Rabson [Fri, 30 May 2008 09:34:08 +0000 (09:34 +0000)]
Don't rely on NSM to help us forget about RPC client handles for
clients that have rebooted (or otherwise changed port numbers). If the
client is broken or has no active locks, it won't notify us. Fall back
on the two minute timeout logic used by the userland rpc.lockd code.
Weongyo Jeong [Fri, 30 May 2008 07:17:51 +0000 (07:17 +0000)]
Fix a panic that it's occurred when NDIS init handler returned a error
by unknown reasons. In this case, sc->ifp is still NULL so it will
cause a page fault during calling ndis_detach()
Weongyo Jeong [Fri, 30 May 2008 06:31:55 +0000 (06:31 +0000)]
Fix a panic that a priority value which is passed to cv_broadcastpri(9)
can be < 0. We don't ignore a `increment' argument but at least we keep
a priority value of NDIS threads over PRI_MIN_KERN.
Benno Rice [Fri, 30 May 2008 01:57:13 +0000 (01:57 +0000)]
The XScale PXA255 has three generally ns16x50 compatible UARTs. One of the
variations from normal 16x50 behaviour however is the the use of a normally
unused bit of IER to control RX timeout interrupts independently of the
generally used RXRDY bit. If this bit is not enabled, we only ever get
interrupts when the FIFO is full, never before. This is not very useful when
the UART is being used as a console.
In order to support this without causing potential problems on more "normal"
16x50 variants, this change introduces two hints for the uart device, ier_mask
and ier_rxbits. These can be used to override which bits get set and cleared
when we're enabling and disabling RX interrupts.
Fix some bugs/complaints:
- make addr2jid static
- add -h Flag for hostname/ip-number search
- s,strncmp,strcmp, in addr2jid
- return jid only if found once
Robert Watson [Thu, 29 May 2008 14:28:26 +0000 (14:28 +0000)]
Read lock rather than write lock TCP inpcbs in monitoring sysctls. In
some cases, add explicit inpcb locking rather than relying on the global
lock, as we dereference inp_socket, but also allowing us to drop the
global lock more quickly.
Ed Schouten [Thu, 29 May 2008 12:50:46 +0000 (12:50 +0000)]
Remove the distinction between device minor and unit numbers.
Even though we got rid of device major numbers some time ago, device
drivers still need to provide unique device minor numbers to make_dev().
These numbers are only used inside the kernel. They are not related to
device major and minor numbers which are visible in devfs. These are
actually based on the inode number of the device.
It would eventually be nice to remove minor numbers entirely, but we
don't want to be too agressive here.
Because the 8-15 bits of the device number field (si_drv0) are still
reserved for the major number, there is no 1:1 mapping of the device
minor and unit numbers. Because this is now unused, remove the
restrictions on these numbers.
The MAXMAJOR definition was actually used for two purposes. It was used
to convert both the userspace and kernelspace device numbers to their
major/minor pair, which is why it is now named UMINORMASK.
minor2unit() and unit2minor() have now become useless. Both minor() and
dev2unit() now serve the same purpose. We should eventually remove some
of them, at least turning them into macro's. If devfs would become
completely minor number unaware, we could consider using si_drv0 directly,
just like si_drv1 and si_drv2.
Robert Watson [Thu, 29 May 2008 08:27:14 +0000 (08:27 +0000)]
Employ read locks on UDP inpcbs, rather than write locks, when
monitoring UDP connections using sysctls. In some cases, add
previously missing locking of inpcbs, as inp_socket is followed,
which also allows us to drop global locks more quickly.
David Xu [Thu, 29 May 2008 07:57:33 +0000 (07:57 +0000)]
- Reduce function call overhead for uncontended case.
- Remove unused flags MUTEX_FLAGS_* and their code.
- Check validity of the timeout parameter in mutex_self_lock().
Kirk McKusick [Thu, 29 May 2008 07:15:52 +0000 (07:15 +0000)]
The SIIG 4 port serial card based on the Oxford OX16PCI954 is
clocked at 10x normal speed. That is, when you set it for 9600
baud, it actually does 96000 baud. In order to make it plug and
play with other serial ports, it has to have its clock rate
reduced by a factor of 10.
David E. O'Brien [Thu, 29 May 2008 02:43:05 +0000 (02:43 +0000)]
Bring these back to HEAD.
(I thought ncvs@ had rm'ed these MIPS files a long time ago... SVN had
better work out - else 7 more files off the vendor branch.)
Sam Leffler [Thu, 29 May 2008 00:10:48 +0000 (00:10 +0000)]
Cleanup power handling and fix suspend/resume:
o do not put the chip into full sleep in ath_stop as it gains
nothing and causes many parts to hang in ath_detach because we
may touch the chip during vap teardown; this may also fix issues
with unloading the module
o add a note in ath_detach to explain ath_hal_detach puts the
chip in low power mode; this is useful to know as it means
unloading the module will place a pci device in the lowest
possible power state
o leave an #ifdef notyet marker for powering down the chip when
a device is marked down; we can't do that until we handle all
the ways the driver may be entered and touch the chip
o fix resume by reloading the h/w key cache as it's been clobbered
(for pci) by the socket being powered off; for station mode we
directly stop+init the chip and then simulate a beacon miss to
get the upper layers sync'd up; for other configs we must brute
force stop+start the vaps so they go through the state machine
Sam Leffler [Wed, 28 May 2008 23:33:29 +0000 (23:33 +0000)]
Add ieee80211_crypto_reload_keys to push all keys known
to net80211 back into the device; intended for use on resume
by devices that lose the contents of their h/w key table.
Sam Leffler [Wed, 28 May 2008 23:32:00 +0000 (23:32 +0000)]
Add a mac address to the key definition as otherwise we lose the
address specified in the ioctl and for drivers that need the address
to locate a key (e.g. for delete).
Note this changes net80211-private api's but not the driver callback;
may want to change that in the future.
Doug Ambrisko [Wed, 28 May 2008 23:19:27 +0000 (23:19 +0000)]
Add support to talk to the LSI ioctl path on with FreeBSD 32 bit app's
on amd64. Note the only difference is the iovec32 part so I use the
native structure for everything else.
Also I plan to MFC all the changes in -current to 7-stable and 6-stable
shortly since I've been running them. This does not include the cam
changes.
Sam Leffler [Wed, 28 May 2008 23:10:53 +0000 (23:10 +0000)]
Revise lock name handling:
o construct a name for the com lock as done for other locks
o pass the device name to IEEE80211_LOCK_INIT so the mtx name
is constructed as foo_com_lock
o introduce *_LOCK_OBJ macro's to hide the lock contents and
minimize redundant code
Fix checking if a variable name is LINENO. As STPUTC changes the pointer if it
needs to enlarge the buffer, we must not keep a pointer to the beginning.
Ed Schouten [Wed, 28 May 2008 20:25:19 +0000 (20:25 +0000)]
Remove redundant checks from fcntl()'s F_DUPFD.
Right now we perform some of the checks inside the fcntl()'s F_DUPFD
operation twice. We first validate the `fd' argument. When finished,
we validate the `arg' argument. These checks are also performed inside
do_dup().
The reason we need to do this, is because fcntl() should return different
errno's when the `arg' argument is out of bounds (EINVAL instead of
EBADF). To prevent the redundant locking of the PROC_LOCK and
FILEDESC_SLOCK, patch do_dup() to support the error semantics required
by fcntl().
Marcel Moolenaar [Wed, 28 May 2008 16:41:02 +0000 (16:41 +0000)]
Work-around a compiler optimization bug, that broke libthr. Massive
inlining resulted in constant propagation to the extend that cmpval
was known to the compiler to be URWLOCK_WRITE_OWNER (= 0x80000000U).
Unfortunately, instead of zero-extending the unsigned constant, it
was sign-extended. As such, the cmpxchg instruction was comparing
0x0000000080000000LU to 0xffffffff80000000LU and obviously didn't
perform the exchange.
But, since the value returned by cmpxhg equalled cmpval (when zero-
extended), the _thr_rtld_lock_release() function thought the exchange
did happen and as such returned as if having released the lock. This
was not the case. Subsequent locking requests found rw_state non-zero
and the thread in question entered the kernel and block indefinitely.
The work-around is to zero-extend by casting to uint64_t.
Bjoern A. Zeeb [Tue, 27 May 2008 21:05:49 +0000 (21:05 +0000)]
To both the (formerly) 'temporarily disconnected' netatm and I4B modules
add a comment "(removed 20080525)" to make clear that it is no longer
temporary.
Antoine Brodin [Tue, 27 May 2008 19:04:31 +0000 (19:04 +0000)]
- Increase the size of the salt in pw(8) from 8 to 32 (same as in pam_unix(8)).
This makes blowfish password hashes look normal when set using
pw(8)/adduser(8). [1]
- Make it possible to have a '/' in the salt.
Maksim Yevmenkin [Tue, 27 May 2008 17:46:32 +0000 (17:46 +0000)]
Bluetooth SIG is being difficult and keep moving specification
documents away from being public accessible. Replace link to
the Bluetooth specification document with the document name.
Pointed out by: SoftLover < slserg at uic dot tula dot ru >
MFC after: 3 days
Plug a memory leak which can occur when multiple MAC policies are loaded
which label mbufs. This leak can occur if one policy successfully allocates
label storage and subsequent allocations from other policies fail.
Ed Schouten [Tue, 27 May 2008 06:41:50 +0000 (06:41 +0000)]
Rename `tty_subr.c' to `subr_clist.c'.
Because clists are also used outside the TTY layer, rename the file
containing the clist routines to something more accurate.
The mpsafetty TTY layer doesn't use clists. It uses its own buffers,
which also implement the unbuffered copying to userspace. We cannot
simply remove the clist routines then, because this would break various
drivers that are present within the kernel.
Add a -n option to pkg_create(1), to inhibit duplicate work.
When run without this option, multiple runs of `pkg_create -Rb' will
recreate common packages multiple times. This can take a lot of time
for large packages. With the -n option `pkg_create -b' checks with
stat(2) and skips packages that already exist.
Note that this may *not* be safe of the existing output file is not
really a package, or if it has been corrupted, modified or otherwise
tinkered with between subsequent pkg_create runs. For this and POLA
reasons, the default behavior is to *rebuild* the packages, and the -n
option can be used when we know it is `safe' to run in no-regenerate
mode.
Inspired by: A post to freebsd-questions
by Matthias Apitz < matthias.apitz at oclc.org >
Reviewed by: marcus, flz
Approved by: marcus
MFC after: 2 weeks