bde [Tue, 2 Dec 2003 12:36:00 +0000 (12:36 +0000)]
Fixed breakage of the pci case of the cy driver by the new interrupt
code. Both the driver and the new code were wrong. Driver interrupt
handlers are supposed to take "void *vsc" arg, but some including all
COMPAT_ISA drivers and the pci part of the cy driver want an "int unit"
arg. They got this using bogus casts of function pointers which should
have kept working despite their bogusness. However, the new interrupt
code doesn't honor requests to pass an arg of ((void *)0), so things
are very broken if the arg is actually a representation of unit 0.
The fix is to use a normal "void *vsc" arg for the pci case and a
wrapper for the COMPAT_ISA case (of the cy driver). This cleans up
new-busification of the pci case but takes the COMPAT_ISA case a little
further from new-bus. The corresponding bug for the COMPAT_ISA case
has already been fixed similarly using a wrapper in compat_isa.c and
we need another wrapper just to undo that.
Fixed some directly related style bugs (mainly by removing compatibility
cruft).
cy.c:
Fixed an indirectly related old bug in cyattach_common(). A wrong status
was returned in the unlikely event that malloc() failed.
After extensive QA cycles at 3ware, bring the driver in-line with all the
issues which they found and asked to be changed so 3ware can offcially
support the driver.
Summary of the most significant changes:
- TWE_OVERRIDE is no longer supported
- If twe_getparam failed, bogus data would be returned to the caller
- Cache the device unit in the twe_drive structure to aid debugging
- Add the 3ware driver version.
- Proper return error codes for many functions.
- Track the minimum queue length statistics
- 4.x compat: use the cached unit number from the twe_drive structure
instead of the the cached si_drv2. 3ware found that after many loads
and unloads that si_drv2 became corrupted. This did not happen in
-current.
Submitted by: Vinod Kashyap (with modifications by me)
Approved by: re (rwatson)
bmah [Tue, 2 Dec 2003 07:13:03 +0000 (07:13 +0000)]
Trim wi(4) devices from the hardware notes. Also add a listing of the
various chipsets supported by this driver as there are only a few and
this seems to be useful information.
imp [Tue, 2 Dec 2003 04:59:59 +0000 (04:59 +0000)]
Fix Lucent cards.
o Back out workaround for not resetting lucent cards more than once. With
these fixes, it appaers they are no longer necessary.
o Set wi_gone when the card goes awol: typically when we get 0xffff back from
the card. Also, don't interact with a card that's gone, so we fail in
seconds rather than minutes. Also reduce amount of time we wait to .5s
in wi_cmd.
o clear wi_gone on ifconfig down to give some cards a chance after they wedge
(this appears to unwedge one of my prism cards with old firmware). ifconfig
up will fail quickly enough if the card really is out to lunch.
o Add delay in wi_init of 100ms.
o wi_stop(ifp, 0->1) changes so that we clear sc_enabled so that we
exit out of the interrupt routine by just acking the interrupt
Submitted by: iedowse
Approved by: re@ (scottl)
# after the freeze I'll fix some of the minor style issues that reviewers
# of this patch have told me about.
sam [Tue, 2 Dec 2003 00:23:45 +0000 (00:23 +0000)]
Include opt_ipsec.h so IPSEC/FAST_IPSEC is defined and the appropriate
code is compiled in to support the O_IPSEC operator. Previously no
support was included and ipsec rules were always matching. Note that
we do not return an error when an ipsec rule is added and the kernel
does not have IPsec support compiled in; this is done intentionally
but we may want to revisit this (document this in the man page).
PR: 58899
Submitted by: Bjoern A. Zeeb
Approved by: re (rwatson)
Fixed a bug in sendfile(2) where the sent data would be corrupted due
to sendfile(2) being erroneously automatically restarted after a signal
is delivered. Fixed by converting ERESTART to EINTR prior to exiting.
Updated manual page to indicate the potential EINTR error, its cause
and consequences.
truckman [Mon, 1 Dec 2003 19:03:50 +0000 (19:03 +0000)]
Use a mutex to synchronize the driver top and bottom halves instead of
using critcal_enter() and critical_exit() to attempt to replace spl*()
calls. The critical section was calling selrecord(), which locks an
MTX_DEF mutex, which is not legal in a critical section.
Tested by: Stefan Ehmann <shoesoft@gmx.net> and "make universe"
Approved by: re (scottl)
iedowse [Sun, 30 Nov 2003 23:30:09 +0000 (23:30 +0000)]
In dounmount(), only call checkdirs() prior to VFS_UNMOUNT() in the
forced unmount case. Otherwise, a file system that is referenced
only by process fd_cdir/fd_rdir references to the file system root
vnode will be successfully unmounted without the MNT_FORCE flag.
The previous behaviour was not compatible with the unmount semantics
required by amd(8), so file systems could be unexpectedly unmounted
while there were still references to the file system root directory.
Reported by: Erez Zadok <ezk@cs.sunysb.edu>
Approved by: re (scottl)
jeff [Sun, 30 Nov 2003 22:20:40 +0000 (22:20 +0000)]
- Make mp_maxid reflect the same meaning as it does on other architectures.
It is one past the last valid cpuid. This relied on a different bug in
UMA to work properly.
jeff [Sun, 30 Nov 2003 22:18:14 +0000 (22:18 +0000)]
- Unbreak UP. mp_maxid is not defined on uni-processor machines, although
I believe it and the other MP variables should be. For now, just define it
here and wait for jhb to clean it up later.
phk [Sun, 30 Nov 2003 18:06:02 +0000 (18:06 +0000)]
The new "spec against spec" comparison code was yet another time
victim of the special sort order employed where files come before
directories and alphabetic inside these two groups.
sos [Sun, 30 Nov 2003 16:27:59 +0000 (16:27 +0000)]
Fix ata-card.
The altio resource magic no longer worked probably due to other changes
in the kernel. Redo that part so it also fits better into ATAng.
Fix detach so it doesn't panic the system when a pccard device is
yanked.
jeff [Sun, 30 Nov 2003 08:04:01 +0000 (08:04 +0000)]
- Replace the local maxcpu with mp_maxid. Previously, if mp_maxid
was equal to MAXCPU, we would overrun the pcpu_mtx array because maxcpu
was calculated incorrectly.
- Add some more debugging code so that memory leaks at the time of
uma_zdestroy() are more easily diagnosed.
rwatson [Sat, 29 Nov 2003 21:44:51 +0000 (21:44 +0000)]
Add a Securelevel sub-menu to the Security configuration menu,
permitting the administrator to select a securelevel top operate
at. Include a helpfile summarizing some of the information from
init(8). This allows for explicit configuration of securelevels,
which was previously implicit in Security Profile selection.
Currently, there are no checkboxes for the active securelevel,
because sysinstall's facilities for deriving "current settings"
from rc.conf may use only one variable, not two, and I opted for
the simplest approach at this point.
davidxu [Sat, 29 Nov 2003 14:22:29 +0000 (14:22 +0000)]
1.Macro optimizing KSE_LOCK_ACQUIRE and THR_LOCK_ACQUIRE to use static fall
through branch predict as suggested in INTEL IA32 optimization guide.
2.Allocate siginfo arrary separately to avoid pthread to be allocated at
2K boundary, which hits L1 address alias problem and causes context
switch to be slow down.
3.Simplify context switch code by removing redundant code, code size is
reduced, so it is expected to run faster.
davidxu [Sat, 29 Nov 2003 14:10:02 +0000 (14:10 +0000)]
Remove surplus mmap() call for stack guard page in init_private, it is done
in init_main_thread. Also don't initialize lock and lockuser again for initial
thread, it is already done by _thr_alloc().
sam [Sat, 29 Nov 2003 01:23:59 +0000 (01:23 +0000)]
o track API change for HAL v0.9.6.1
o fix race condition when processing rx descriptors: because we use
a self-linked descriptor at the end of the rx descriptor list to
avoid rx overruns (which can easily happen for 5212 parts that enable
PHY errors) we must carefully check that a descriptor is "done" by
looking ahead to the next descriptor before believing the done bit
in the current descriptor (this is all handled in the HAL since the
rx descriptor format is chip-specific so we need to pass in two
additional parameters--the physical address of the current descriptor
and the virtual address of the next descriptor in the list)
o check copyout return status for SIOCGATHSTATS ioctl
sam [Sat, 29 Nov 2003 01:11:48 +0000 (01:11 +0000)]
Version 0.9.6.1:
o support for 5112 and 2112 radios on 5212-based products
o revised interface for ah_procRxDesc needed to handle a race
condition created with the use of self-linked rx descriptors
o support for setting the MAC address
o remove some unused methods from the public API
o revised diagnostic API (replace dump* methods with getDiagState)
o const'ify set key cache method parameters
o support for optional 32khz sleep clock
o implement ah_setSlotTime for 5211 parts
o ANI improvements for 5212 parts
rwatson [Fri, 28 Nov 2003 18:47:45 +0000 (18:47 +0000)]
Remove security profiles from sysinstall. Currently, security profile
selection is used to drive two configuration parameters:
(1) Default enable/disable for sshd
(2) Default enable/disable for securelevels
Replace this with an explicit choice to enable/disable sshd. A
follow-up commit will add a configuration option to the Security
post-install configuration menu to set the securelevel in rc.conf
explicitly. This should reduce the level of foot-shooting associated
with accidental enabling of securelevels, make the nature and
implications of the securelevel configuration options more explicit,
as well as make the choice to enable/disable sshd more explicit.
marcel [Fri, 28 Nov 2003 18:03:22 +0000 (18:03 +0000)]
Do not adjust to the pagesize at runtime. Besides for the one-time
initialization overhead, there's a problem in that we never call
imalloc() and thus malloc_init() for zero-sized allocations. As a
result, malloc(0) returns NULL when it's the first or only malloc in
the program. Any non-zero allocation will initialize the malloc code
with the side-effect that subsequent zero-sized allocations return a
non-NULL pointer. This is because the pointer we return for zero-
sized allocations is calculated from malloc_pageshift, which needs
to be initialized at runtime on ia64.
The result of the inconsistent behaviour described above is that
configure scripts failed the test for a GNU compatible malloc. This
resulted in a lot of broken ports.
Other, even simpler, solutions were possible as well:
1. initialize malloc_pageshift with some non-zero value (say 13 for
8KB pages) and keep the runtime adjustment.
2. Stop using malloc_pageshift to calculate ZEROSIZEPTR.
Removal of the runtime adjustment was chosen because then ia64 is the
same as any other platform. It is not to say that using a page size
obtained at runtime is bad per se. It's that there's currently a high
level of gratuity for its existence and the moment it causes problems
is the moment you need to get rid of it. Hence, it's not unthinkable
that this commit is (partially) reverted some time in the future when
we do have a good reason for it and a good way to achieve it.
Approved by: re@ (rwatson)
Reported by: kris (portmgr@) -- may the ports be with you
bms [Fri, 28 Nov 2003 17:34:23 +0000 (17:34 +0000)]
Fix some minor nits in netstat whereby large interface names would be
truncated. In environments where many tunnel or vlan interfaces are created,
interface names have high numbers which overflow the field width.
PRs: bin/52349, bin/35838
Submitted by: Mike Tancsa, Scot W. Hetzel
Approved by: re (rwatson)
bms [Fri, 28 Nov 2003 17:28:42 +0000 (17:28 +0000)]
Add a means of starting an IKE daemon from the rc system at an appropriate
time during the boot process. This is needed in the case where NFS mounts
from servers reachable only via IPSEC are in /etc/fstab.
PR: conf/42497
Submitted by: Volker Stolz
Approved by: re (rwatson)
andre [Fri, 28 Nov 2003 16:33:03 +0000 (16:33 +0000)]
Fix an optimization where I made an ifdef'd out section to broad.
When the hostcache bucket limit is reached the last bucket wasn't
removed from the bucket row but inserted a few lines later at the
bucket row head again. This leads to infinite loop when the same
bucket row is accessed the next time for a lookup/insert or purge
action.
Tested by: imp, Matt Smith
Approved by: re (rwatson)
imp [Fri, 28 Nov 2003 05:28:29 +0000 (05:28 +0000)]
Sometimes cardbus attachments don't attach, so while we track down
this problem put these lines back in. While they should be
unnecessary, they appear to be sometimes necessary.
Reviewed in concept: dfr
Approved by: re (scottl@)
sam [Fri, 28 Nov 2003 04:19:41 +0000 (04:19 +0000)]
Eliminate a duplicate free when deleting an interface address. This
caused crashes, typically during shutdown, because the second free
referenced a mutex that had been destroyed.
phk [Thu, 27 Nov 2003 20:27:29 +0000 (20:27 +0000)]
Refactor AMD Elan 520 CPU support.
Make it possible to configure GPIO pins as led(4) devices, PPS inputs
and PPS-echo outputs with a sysctl. Led(4) and PPS-echo can be configured
for active-high or active-low.
Be more complete in initialization of timecounter hardware.
peter [Thu, 27 Nov 2003 18:38:39 +0000 (18:38 +0000)]
Mention that floppy based installs are not supported on amd64 systems
rather than leaving the section blank. This was left out of the last
commit by accident.
njl [Thu, 27 Nov 2003 16:32:46 +0000 (16:32 +0000)]
* If a processor's softc is NULL, use C1 since there is no ACPI
processor object for this CPU. This occurs for logical CPUs which
do not have an associated processor object (e.g., HTT).
andre [Thu, 27 Nov 2003 09:40:13 +0000 (09:40 +0000)]
Fix verify_rev_path() function. The author of this function tried to
cut corners which completely broke down when the routing table locking
was introduced.
Reviewed by: sam (mentor)
Approved by: re (rwatson)
mbr [Thu, 27 Nov 2003 08:37:36 +0000 (08:37 +0000)]
ServeRaid (at least 5i) didn't initialize correctly. To get
them working (cache, automatic rebuild and hotswap) the FFDC
info (First Failure Data Capture) on the adapter must be
initialised.
Logical drives in critical/degraded states weren't added to
the drive list. FreeBSD was not able to see a degraded array
after a reboot. Degraded drives are now also added to the drivelist
and the state of the logical drive is given at boottime.
The adapter type is detected from informations in nvram page 5
and displayed at boottime.
Change IPS_OS_FREEBSD definition from 10 to 8 according to IBM
specs.
andre [Wed, 26 Nov 2003 20:31:13 +0000 (20:31 +0000)]
Make sure all uses of stack allocated struct route's are properly
zeroed. Doing a bzero on the entire struct route is not more
expensive than assigning NULL to ro.ro_rt and bzero of ro.ro_dst.
Reviewed by: sam (mentor)
Approved by: re (scottl)
njl [Wed, 26 Nov 2003 19:01:33 +0000 (19:01 +0000)]
* Add acpi_pcpu_get_id(idx, *acpi_id, *cpu_id) which fetches the
idx'th present CPU with pc_acpi_id equal to *acpi_id. If *acpi_id
does not match that processor's pc_acpi_id, return the value for
ProcId derived from the MADT in *acpi_id. If pc_acpi_id is 0xffffffff,
always override it with the value of *acpi_id. Finally, return
pc_cpuid in *cpu_id and use that as our primary key.
* Use pc_cpuid as our unique key because we know it is valid since
MD code set it. The values for ProcId in the ASL and MADT don't
match up on some machines (!), forcing us to fall back to ordered
probing in that case.
* Remove some #ifdef SMP since the refcount doesn't hurt performance
and will be needed for dynamic _CST objects. Only one #ifdef SMP
(for smp_rendezvous) remains.
* Hook up SMP in the compile flags in the Makefile.
Tested by: marcel, truckman
Approved by: re (scottl)
scottl [Tue, 25 Nov 2003 04:51:35 +0000 (04:51 +0000)]
Move mly, plip, and slip back into the kernel so floppy 3 can fit again. I'm
not sure why it exploded in the last 10 days, though I suspect nfsclient.ko.
imp [Tue, 25 Nov 2003 04:12:43 +0000 (04:12 +0000)]
Turns out that building modules with the kernel opt files is
uncovering some interesting problems. Be conservative and effecitvely
disable this by default. Interested parties may still define
KERNBUILDDIR by hand to achive the same effect.
I plan on referting this change after 5.2 is released, or sooner if
the issues with building releases are resolved and re@ approves.
iedowse [Tue, 25 Nov 2003 02:23:29 +0000 (02:23 +0000)]
Write the correct value to `td_be' for the second and further
transfer descriptors when a large request needs to be split into
more than one 8k chunk. The bug was that the calculation did not
take into account the offset of the chunk within the overall request.
This is reported to fix crashes and data corruption on ohci
controllers.
sam [Mon, 24 Nov 2003 03:57:03 +0000 (03:57 +0000)]
Correct a problem where ipfw-generated packets were being returned
for ipfw processing w/o an indication the packets were generated
by ipfw--and so should not be processed (this manifested itself
as a LOR.) The flag bit in the mbuf that was used to mark the
packets was not listed in M_COPYFLAGS so if a packet had a header
prepended (as done by IPsec) the flag was lost. Correct this by
defining a new M_PROTO6 flag and use it to mark packets that need
this processing.
sam [Sun, 23 Nov 2003 18:13:41 +0000 (18:13 +0000)]
Use MPSAFE callouts only when debug.mpsafenet is 1. Both timer routines
potentially transmit packets that may enter KAME IPsec w/o Giant if the
callouts are marked MPSAFE.