Ed Schouten [Thu, 5 Jun 2008 17:46:32 +0000 (17:46 +0000)]
Make ppp use <termios.h>, not <sys/tty.h>.
ppp's physical.c is filled with calls to termios. For some reason, it
includes <sys/tty.h>, not <termios.h>. Even though this works with the
current version of FreeBSD, we'd better follow the standards.
Ed Schouten [Thu, 5 Jun 2008 17:44:18 +0000 (17:44 +0000)]
Fix faulty character to control-character conversion for CTRL().
The CTRL() macro seems to perform character to control-character
conversion (i.e. 'A' to 0x01) to lowercase characters. This is actually
not valid. If we use lowercase characters, conversions such as
CTRL('\\') and CTRL('?') will result to invalid conversions.
Because we must still support old source code that uses CTRL() (bad!),
we make CTRL() accept both forms. When the character is a lowercase
character, we perform the old style conversion.
Brooks Davis [Thu, 5 Jun 2008 17:26:47 +0000 (17:26 +0000)]
Fix the wait for default route change I made a few weeks ago by creating
a new defaultroute script that just does the wait. The previous attempt
created a circular dependency through network_ipv6.
John Baldwin [Thu, 5 Jun 2008 14:49:35 +0000 (14:49 +0000)]
Make the cs(4) driver MPSAFE:
- Add a mutex to the softc to protect the softc and the device hardware.
- Add a private timer to manage transmit watchdogs rather than using
if_timer/if_watchdog.
- Setup the interrupt handler after ether_ifattach().
John Baldwin [Thu, 5 Jun 2008 14:45:32 +0000 (14:45 +0000)]
Rename the ie_EE16 module to just 'ie' so that at least one of the modules
for this driver is called 'ie'. Otherwise, ifconfig(8) doesn't recognize
any of the modules as being the ie(4) driver and will always try to kldload
the driver even when it is already present in the kernel.
When devfs_allocv() committed to create new vnode, since de_vnode is NULL,
the dm_lock is held while the newly allocated vnode is locked. Since no
other threads may try to lock the new vnode yet, the LOR there cannot
result in the deadlock.
Warner Losh [Thu, 5 Jun 2008 05:51:19 +0000 (05:51 +0000)]
Fix the media auto code by breaking it :-). Auto now just means 'use
10BaseT' since it required 10BaseT to have carrier to switch to it.
This chip makes it hard to do proper auto, so we don't do it. We
can't test carrier on things easily.
Don't insist on carrier when we set the media. Don't report failures.
Remove a 1s! delay that appears to not be needed.
With these patches, and John Baldwin's patches, I'm able to pass
packets on my IBM EtherJet card again.
John Baldwin [Wed, 4 Jun 2008 20:26:57 +0000 (20:26 +0000)]
Style(9) xe(4). The MD5 sums are different, but comparing the dissassemblies
the only changes are from gcc moving some global variables around slightly.
Replace checks for RESCUE in sources with checks for STATIC_GEOM_CLASSES
and define STATIC_GEOM_CLASSES when building the rescue binary. This way
geom can more easily be part of other crunched binaries, as it requires
only a Makefile change.
John Baldwin [Wed, 4 Jun 2008 15:19:58 +0000 (15:19 +0000)]
- Split the interrupt handler up into separate subroutines for rx, tx, and
MAC events.
- Use bus_*() rather than bus_space_*() and remove the bus space tag and
handle from the softc.
- Retire unused macros for examining CIS tuples.
Warner Losh [Wed, 4 Jun 2008 06:07:13 +0000 (06:07 +0000)]
o Improve the probe code dealing with interrupts.
o When forced to be 10baseT, don't require that the 10baseT interface
have link to succeed. Still require it for IFM_AUTO, however, since it
appears that there's no way to tell if a specific type of interface
worked. I'm doing a web search for a datasheet now to see if there's
anything obvious.
o Minor incidental formatting nits, including collapsing code of the form
if (foo) {
bar();
} else {
if (baz)
bing();
}
into:
if (foo) {
bar();
} else if (baz) {
bing();
}
to save an indentation level.
o Remove stray reference to 3.x config file syntax.
# I believe John's patches still apply after this...
Jung-uk Kim [Tue, 3 Jun 2008 22:34:52 +0000 (22:34 +0000)]
- Replace rcsid with __FBSDID.
- Remove paths.h and embed it in the source.
- Remove stale alpha support.
- Clean up compiler warnings and fix style(9) bugs.
John Baldwin [Tue, 3 Jun 2008 20:40:33 +0000 (20:40 +0000)]
- Change the watchdog timer logic to match other drivers that use their own
timer by keeping a once-a-second timer running that decrements a counter
similar to if_timer and reset the chip if it gets down to zero via the
decrement.
- Use IFQ_SET_MAXLEN().
Ed Schouten [Tue, 3 Jun 2008 12:38:00 +0000 (12:38 +0000)]
Remove unneeded Giant locking of /dev/tty.
The Giant lock is acquired in two places in tty_tty.c. In both places,
it is unneeded.
There is no reason to specify D_NEEDGIANT on this device node. The
device node has only been designed to return ENXIO when opened. It
doesn't make any sense to lock/unlock Giant, just to return this error.
D_TTY is also unneeded. The unimplemented functions don't need to be
patched by devfs.
We don't need to lock Giant when we want to lookup the proper TTY vnode.
s_ttyvp is already protected by proctree_lock (see devfs_vnops.c).
Robert Watson [Tue, 3 Jun 2008 11:06:34 +0000 (11:06 +0000)]
Add an XXX comment regarding a bug I introduced when modifying the behavior
of audit log vnode rotation: on shutdown, we may not properly drain all
pending records, which could lead to lost records during system shutdown.
Warner Losh [Tue, 3 Jun 2008 05:47:28 +0000 (05:47 +0000)]
Correct logic error that would prevent cs pccards from working on
systems where the CardBus bridge was connected to a APIC. The case
where the probe routine is told to not setup the IRQ was mishandled
but the error was masked in the case where the IRQ was a valid one
for the card.
Coleman Kane [Tue, 3 Jun 2008 00:55:48 +0000 (00:55 +0000)]
Update if_ndis to remove the legacy if_watchdog interface and
bring it more up to date. The watchdog timer, and its
associated code, is all collapsed into the ndis_tick function
that was implemented for the NDIS-subsystem watchdog. This
implementation is similar to what numerous other drivers use
to implement the watchdog.
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.)