]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoAdd KASSERTs to make it easier to debug problems like the one fixed
trasz [Fri, 6 Feb 2009 18:16:01 +0000 (18:16 +0000)]
Add KASSERTs to make it easier to debug problems like the one fixed
in r188141.

Reviewed by: kib,attilio
Approved by: rwatson (mentor)
Tested by: pho
Sponsored by: FreeBSD Foundation

15 years agoWhen a device containing mounted UFS filesystem disappears, the type
trasz [Fri, 6 Feb 2009 17:14:07 +0000 (17:14 +0000)]
When a device containing mounted UFS filesystem disappears, the type
of devvp becomes VBAD, which UFS incorrectly interprets as snapshot
vnode, which in turns causes panic.  Fix it by replacing '!= VCHR'
with '== VREG'.

With this fix in place, you should no longer be able to panic the system
by removing a device with an UFS filesystem mounted from it - assuming
you don't use softupdates.

Reviewed by: kib
Tested by: pho
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation

15 years agoIn urtw_init() call urtw_stop(ifp, 0) rather than urtw_stop(ifp, 1)
kevlo [Fri, 6 Feb 2009 15:27:40 +0000 (15:27 +0000)]
In urtw_init() call urtw_stop(ifp, 0) rather than urtw_stop(ifp, 1)
to stop the device.

15 years agoNote that the slave address passed to smb(4) commands must be left-justified
jhb [Fri, 6 Feb 2009 15:09:31 +0000 (15:09 +0000)]
Note that the slave address passed to smb(4) commands must be left-justified
(LSB is 0).  The iic(4) manpage probably needs similar language to describe
the format it expects.

15 years agoRegen
kevlo [Fri, 6 Feb 2009 15:04:06 +0000 (15:04 +0000)]
Regen

15 years agoAdd the Buffalo WLI-U2-SG54HG
kevlo [Fri, 6 Feb 2009 15:03:17 +0000 (15:03 +0000)]
Add the Buffalo WLI-U2-SG54HG

15 years agoAdd a note to document that ichsmb(4) now uses left-justified SMBus slave
jhb [Fri, 6 Feb 2009 15:03:14 +0000 (15:03 +0000)]
Add a note to document that ichsmb(4) now uses left-justified SMBus slave
addresses.

15 years agoExpand the scope of the sysctllock sx lock to protect the sysctl tree itself.
jhb [Fri, 6 Feb 2009 14:51:32 +0000 (14:51 +0000)]
Expand the scope of the sysctllock sx lock to protect the sysctl tree itself.
Back in 1.1 of kern_sysctl.c the sysctl() routine wired the "old" userland
buffer for most sysctls (everything except kern.vnode.*).  I think to prevent
issues with wiring too much memory it used a 'memlock' to serialize all
sysctl(2) invocations, meaning that only one user buffer could be wired at
a time.  In 5.0 the 'memlock' was converted to an sx lock and renamed to
'sysctl lock'.  However, it still only served the purpose of serializing
sysctls to avoid wiring too much memory and didn't actually protect the
sysctl tree as its name suggested.  These changes expand the lock to actually
protect the tree.

Later on in 5.0, sysctl was changed to not wire buffers for requests by
default (sysctl_handle_opaque() will still wire buffers larger than a single
page, however).  As a result, user buffers are no longer wired as often.
However, many sysctl handlers still wire user buffers, so it is still
desirable to serialize userland sysctl requests.  Kernel sysctl requests
are allowed to run in parallel, however.

- Expose sysctl_lock()/sysctl_unlock() routines to exclusively lock the
  sysctl tree for a few places outside of kern_sysctl.c that manipulate
  the sysctl tree directly including the kernel linker and vfs_register().
- sysctl_register() and sysctl_unregister() require the caller to lock
  the sysctl lock using sysctl_lock() and sysctl_unlock().  The rest of
  the public sysctl API manage the locking internally.
- Add a locked variant of sysctl_remove_oid() for internal use so that
  external uses of the API do not need to be aware of locking requirements.
- The kernel linker no longer needs Giant when manipulating the sysctl
  tree.
- Add a missing break to the loop in vfs_register() so that we stop looking
  at the sysctl MIB once we have changed it.

MFC after: 1 month

15 years agoConsistently use <TAB> instead of spaces as option name and file
wkoszek [Fri, 6 Feb 2009 10:30:46 +0000 (10:30 +0000)]
Consistently use <TAB> instead of spaces as option name and file
separator.

15 years agofix spelling error
imp [Fri, 6 Feb 2009 09:34:17 +0000 (09:34 +0000)]
fix spelling error

Submitted by: trasz

15 years agoStore the entire funce for disk type functions (eg CF cards and the
imp [Fri, 6 Feb 2009 07:49:03 +0000 (07:49 +0000)]
Store the entire funce for disk type functions (eg CF cards and the
like).

15 years agoSet NFSMNT_ACDIRMAX flag in fallback_mount() function.
rodrigc [Fri, 6 Feb 2009 07:47:53 +0000 (07:47 +0000)]
Set NFSMNT_ACDIRMAX flag in fallback_mount() function.

15 years agoSet NFSMNT_ACREGMIN, NFSMNT_ACREGMAX, and NFSMNT_ACDIRMIN flags
rodrigc [Fri, 6 Feb 2009 07:42:21 +0000 (07:42 +0000)]
Set NFSMNT_ACREGMIN, NFSMNT_ACREGMAX, and NFSMNT_ACDIRMIN flags
in fallback_mount() function.
Add a comment to indicate that the fallback_mount() function
should eventually go away.

Submitted by: Jaakko Heinonen <jh saunalahti fi>

15 years agoRemove unused variable.
wkoszek [Fri, 6 Feb 2009 00:55:19 +0000 (00:55 +0000)]
Remove unused variable.

Found with: Coverity Prevent(tm)
CID: 4138

15 years agoMake config -x <kernel> only return non-zero characters,
wkoszek [Fri, 6 Feb 2009 00:50:21 +0000 (00:50 +0000)]
Make config -x <kernel> only return non-zero characters,
so that:

config -x <kernel> | grep <something>

just works.

Reported by: Danny Braniss <danny@cs.huji.ac.il>

15 years agoadd PSB channels to the calibration list
sam [Fri, 6 Feb 2009 00:48:56 +0000 (00:48 +0000)]
add PSB channels to the calibration list

15 years agoBring consistent debugging output for all values that are supposed
wkoszek [Thu, 5 Feb 2009 23:51:11 +0000 (23:51 +0000)]
Bring consistent debugging output for all values that are supposed
to be printed in a hexadecimal format. Otherwise, '270' doesn't say
much.

Reviewed by: imp

15 years agofor adhoc and ahdemo modes try to find the "bss node": use the bssid
sam [Thu, 5 Feb 2009 23:15:39 +0000 (23:15 +0000)]
for adhoc and ahdemo modes try to find the "bss node": use the bssid
unless it's not setup or zero's; this may not work as the bssid of
the ibss isn't certain to the "right mac address" but for many cases
it is

15 years agoDrop the kernel linker lock while running SYSUNINIT routines and removing
jhb [Thu, 5 Feb 2009 23:01:36 +0000 (23:01 +0000)]
Drop the kernel linker lock while running SYSUNINIT routines and removing
sysctls during a linker file unload.  We drop the lock when doing similar
operations during a linker file load.  To close races, clear the LINKED
flag before dropping the lock so that the linker file is no longer visible
to userland.

MFC after: 1 week

15 years agomake -o handling like athstats
sam [Thu, 5 Feb 2009 22:17:10 +0000 (22:17 +0000)]
make -o handling like athstats

15 years agounbreak -o
sam [Thu, 5 Feb 2009 22:16:09 +0000 (22:16 +0000)]
unbreak -o

15 years agohalt APs on reboot
kmacy [Thu, 5 Feb 2009 21:41:27 +0000 (21:41 +0000)]
halt APs on reboot

15 years agoreboot instance on reset
kmacy [Thu, 5 Feb 2009 21:35:40 +0000 (21:35 +0000)]
reboot instance on reset

15 years agofix non-witness compile
kmacy [Thu, 5 Feb 2009 21:18:39 +0000 (21:18 +0000)]
fix non-witness compile

15 years agoeliminate gainFCorrection; just have ar5212GetGainFCorrection return
sam [Thu, 5 Feb 2009 21:13:31 +0000 (21:13 +0000)]
eliminate gainFCorrection; just have ar5212GetGainFCorrection return
the calculated value as it's only used in one place

15 years agoadd new stats and missing tx_raw stat
sam [Thu, 5 Feb 2009 21:09:46 +0000 (21:09 +0000)]
add new stats and missing tx_raw stat

15 years agoMinor packet drop improvements:
sam [Thu, 5 Feb 2009 21:02:40 +0000 (21:02 +0000)]
Minor packet drop improvements:
o change tdma packet drop msg when ack required to ATH_DEBUG_TDMA
  (ATH_DEBUG_XMIT is too noisy)
o add a debug msg for raw packet drop due to interface down/invalid
o add stats for these two cases
o explain how another drop case is handled

15 years agoimprove IQ cal debug msgs; in particular don't scare people by screaming
sam [Thu, 5 Feb 2009 20:56:33 +0000 (20:56 +0000)]
improve IQ cal debug msgs; in particular don't scare people by screaming
"MISGATED IQ CAL!" when it's not

15 years agofill in ar5212ResetCalValid; reset the IQ valid flag on the channel
sam [Thu, 5 Feb 2009 20:51:53 +0000 (20:51 +0000)]
fill in ar5212ResetCalValid; reset the IQ valid flag on the channel
so IQ calibration will be started on the next periodic cal

15 years agostyle
sam [Thu, 5 Feb 2009 20:49:13 +0000 (20:49 +0000)]
style

15 years agoreplace r/w idiom with OS_REG_SET_BIT (to match other code)
sam [Thu, 5 Feb 2009 20:48:30 +0000 (20:48 +0000)]
replace r/w idiom with OS_REG_SET_BIT (to match other code)

15 years agoDon't check for mapping above 4GB on 32-bit platforms.
imp [Thu, 5 Feb 2009 20:44:06 +0000 (20:44 +0000)]
Don't check for mapping above 4GB on 32-bit platforms.

15 years agoo fix identification of ahdemo mode
sam [Thu, 5 Feb 2009 20:39:53 +0000 (20:39 +0000)]
o fix identification of ahdemo mode
o split out code to get the bssid for use in the future
o include more information in error diags when unable to collect sta info/stats

15 years agoo change _db_show_key to always dump the contents instead of checking
sam [Thu, 5 Feb 2009 20:26:53 +0000 (20:26 +0000)]
o change _db_show_key to always dump the contents instead of checking
  IEEE80211_KEY_DEVKEY
o fix channel power printing (they are signed values)
o add show statab to dump a node table and automatically dump the sta
  table of a com structure with /s

15 years agodo_product_lookup should return a const struct pccard_product *.
imp [Thu, 5 Feb 2009 19:39:07 +0000 (19:39 +0000)]
do_product_lookup should return a const struct pccard_product *.

15 years agoFix parameter types for set_res_flags and read_ivars
imp [Thu, 5 Feb 2009 19:38:31 +0000 (19:38 +0000)]
Fix parameter types for set_res_flags and read_ivars

15 years agoshutdown returns an int
imp [Thu, 5 Feb 2009 19:37:49 +0000 (19:37 +0000)]
shutdown returns an int

15 years agoshutdown returns an int
imp [Thu, 5 Feb 2009 19:36:14 +0000 (19:36 +0000)]
shutdown returns an int

15 years agowritereg returns an int.
imp [Thu, 5 Feb 2009 19:33:35 +0000 (19:33 +0000)]
writereg returns an int.

15 years agowritereg returns an int.
imp [Thu, 5 Feb 2009 19:33:20 +0000 (19:33 +0000)]
writereg returns an int.

15 years agoMake iclear return int, since that matches all function definitions of it.
imp [Thu, 5 Feb 2009 19:32:34 +0000 (19:32 +0000)]
Make iclear return int, since that matches all function definitions of it.

15 years agoreset_epp and ecp_sync both return int.
imp [Thu, 5 Feb 2009 19:31:55 +0000 (19:31 +0000)]
reset_epp and ecp_sync both return int.

15 years agoShutdown returns an int.
imp [Thu, 5 Feb 2009 19:30:55 +0000 (19:30 +0000)]
Shutdown returns an int.

15 years agoidentify routine takes driver_t *, not device_t *.
imp [Thu, 5 Feb 2009 19:30:28 +0000 (19:30 +0000)]
identify routine takes driver_t *, not device_t *.

15 years agoo add IEEE80211_KEY_BITS for %b printing of wk_flags
sam [Thu, 5 Feb 2009 19:20:34 +0000 (19:20 +0000)]
o add IEEE80211_KEY_BITS for %b printing of wk_flags
o replace hand-rolled code to print wk_flags
o add display of ni_ucastkey in show sta
o fix \n in _db_show_key

15 years agoAdd some additional debugging for the memory code.
imp [Thu, 5 Feb 2009 18:51:14 +0000 (18:51 +0000)]
Add some additional debugging for the memory code.

15 years agodevice_shutdown returns an int.
imp [Thu, 5 Feb 2009 18:43:13 +0000 (18:43 +0000)]
device_shutdown returns an int.

15 years agopcib_read_config and pcib_write_config take u_int params.
imp [Thu, 5 Feb 2009 18:40:42 +0000 (18:40 +0000)]
pcib_read_config and pcib_write_config take u_int params.

15 years agodevice_shutdown returns int.
imp [Thu, 5 Feb 2009 18:39:33 +0000 (18:39 +0000)]
device_shutdown returns int.

15 years agobus_add_child takes a const char *.
imp [Thu, 5 Feb 2009 18:38:39 +0000 (18:38 +0000)]
bus_add_child takes a const char *.

15 years agoadd cfi test tool
sam [Thu, 5 Feb 2009 18:15:20 +0000 (18:15 +0000)]
add cfi test tool

Sponsored by: Carlson Wireless
Reviewed by: imp, Chris Andreson

15 years agoAdd support for frobbing Intel StrataFlash Protection Registers:
sam [Thu, 5 Feb 2009 18:12:07 +0000 (18:12 +0000)]
Add support for frobbing Intel StrataFlash Protection Registers:
o add CFI_SUPPORT_STRATAFLASH compile option to enable support
o add new ioctls to get/set the factory and user/oem segments of the PR
  and to get/set Protection Lock Register that fuses the user segment
o add #defines for bits in the status register
o update cfi_wait_ready to take an offset so it can be used to wait for
  PR write completion and replace constants w/ symbolic names

Note: writing the user segment isn't correct; committing now to get review.

Sponsored by: Carlson Wireless
Reviewed by: imp, Chris Anderson

15 years agoadd support for max antenna gain (not used at the moment)
sam [Thu, 5 Feb 2009 17:51:46 +0000 (17:51 +0000)]
add support for max antenna gain (not used at the moment)

15 years agoFix return type for detach routine (should be int)
imp [Thu, 5 Feb 2009 17:43:12 +0000 (17:43 +0000)]
Fix return type for detach routine (should be int)
Fix first parameter for identify routine (should be driver_t *)

15 years agoRemove the assertive KA_HELD and KA_UNHELD as long as they are dangerous,
attilio [Thu, 5 Feb 2009 15:09:04 +0000 (15:09 +0000)]
Remove the assertive KA_HELD and KA_UNHELD as long as they are dangerous,
and not really helpful.

15 years agoDon't bother null-checking the thread pointer before the prison checks
jamie [Thu, 5 Feb 2009 15:04:23 +0000 (15:04 +0000)]
Don't bother null-checking the thread pointer before the prison checks
in udp6_connect (td is already dereferenced elsewhere without such a
check).  This makes the conversion from a sockaddr to a sockaddr_in6
always happen, so convert once at the beginning of the function rather
than twice in the middle.

Approved by: bz (mentor)

15 years agoAdd more KTR_VFS logging point in order to have a more effective tracing.
attilio [Thu, 5 Feb 2009 15:03:35 +0000 (15:03 +0000)]
Add more KTR_VFS logging point in order to have a more effective tracing.

Reviewed by: brueffer, kib
Tested by: Gianni Trematerra <giovanni D trematerra A gmail D com>

15 years agoCall prison_if from rtm_get_jailed, instead of splitting it out into
jamie [Thu, 5 Feb 2009 14:58:16 +0000 (14:58 +0000)]
Call prison_if from rtm_get_jailed, instead of splitting it out into
prison_check_ip4 and prison_check_ip6.  As prison_if includes a jailed()
check, remove that check before calling rtm_get_jailed.

Approved by: bz (mentor)

15 years agoRemove redundant calls of prison_local_ip4 in in_pcbbind_setup, and of
jamie [Thu, 5 Feb 2009 14:25:53 +0000 (14:25 +0000)]
Remove redundant calls of prison_local_ip4 in in_pcbbind_setup, and of
prison_local_ip6 in in6_pcbbind.

Approved by: bz (mentor)

15 years agoDon't leave the console TTY constantly open.
ed [Thu, 5 Feb 2009 14:21:09 +0000 (14:21 +0000)]
Don't leave the console TTY constantly open.

When we leave the console TTY constantly open, we never reset the
termios attributes. This causes output processing, echoing, etc. not to
be reset to the proper values when going into single user mode after the
system has booted. It also causes nl-to-crnl-conversion not to take
place during shutdown, which causes a `staircase effect'.

This patch adds a new TTY flag, TF_OPENED_CONS, which is set when the
TTY is opened through /dev/console. Because the flags are only used by
the kernel and the pstat(8) utility, I've decided to renumber the TTY
flags. This shouldn't be an issue, because the TTY layer is not yet part
of a stable release.

Reported by: Mark Atkinson <atkin901 yahoo com>
Tested by: sepotvin

15 years agoDon't allow creating a socket with a protocol family that the current
jamie [Thu, 5 Feb 2009 14:15:18 +0000 (14:15 +0000)]
Don't allow creating a socket with a protocol family that the current
jail doesn't support.  This involves a new function prison_check_af,
like prison_check_ip[46] but that checks only the family.

With this change, most of the errors generated by jailed sockets
shouldn't ever occur, at least until jails are changeable.

Approved by: bz (mentor)

15 years agoStandardize the various prison_foo_ip[46] functions and prison_if to
jamie [Thu, 5 Feb 2009 14:06:09 +0000 (14:06 +0000)]
Standardize the various prison_foo_ip[46] functions and prison_if to
return zero on success and an error code otherwise.  The possible errors
are EADDRNOTAVAIL if an address being checked for doesn't match the
prison, and EAFNOSUPPORT if the prison doesn't have any addresses in
that address family.  For most callers of these functions, use the
returned error code instead of e.g. a hard-coded EADDRNOTAVAIL or
EINVAL.

Always include a jailed() check in these functions, where a non-jailed
cred always returns success (and makes no changes).  Remove the explicit
jailed() checks that preceded many of the function calls.

Approved by: bz (mentor)

15 years agoUse the correct creds when reconnecting so that we have enough privilege to
dfr [Thu, 5 Feb 2009 11:48:10 +0000 (11:48 +0000)]
Use the correct creds when reconnecting so that we have enough privilege to
bind reserved ports (if necessary).

Submitted by: Jaakko Heinonen <jh at saualaht dot fi>

15 years agoIn some situations, mnt_lockref could go negative due to vfs_unbusy() being
trasz [Thu, 5 Feb 2009 08:46:18 +0000 (08:46 +0000)]
In some situations, mnt_lockref could go negative due to vfs_unbusy() being
called without calling vfs_busy() first.  This made umount(8) hang waiting
for mnt_lockref to become zero, which would never happen.

Reviewed by: kib
Approved by: rwatson (mentor)
Reported by: pho
Found with: stress2
Sponsored by: FreeBSD Foundation

15 years agopass in smp_processor_id to identify the cpu in use
kmacy [Thu, 5 Feb 2009 04:00:55 +0000 (04:00 +0000)]
pass in smp_processor_id to identify the cpu in use

15 years agoadjust the way that idle happens so as to avoid missing timer interrupts
kmacy [Thu, 5 Feb 2009 02:01:18 +0000 (02:01 +0000)]
adjust the way that idle happens so as to avoid missing timer interrupts

15 years agoAllow unprivileged users to run l2ping(8).
emax [Wed, 4 Feb 2009 22:44:09 +0000 (22:44 +0000)]
Allow unprivileged users to run l2ping(8).

MFC after: 1 month

15 years agoFix bm_shutdown() KOBJ method to correspond to return int, as it should.
nwhitehorn [Wed, 4 Feb 2009 22:16:27 +0000 (22:16 +0000)]
Fix bm_shutdown() KOBJ method to correspond to return int, as it should.

Found by: Andriy Gapon

15 years agoClenup code a bit and do not call fork(2) before dameon(3) where not needed.
emax [Wed, 4 Feb 2009 22:04:06 +0000 (22:04 +0000)]
Clenup code a bit and do not call fork(2) before dameon(3) where not needed.

MFC after: 1 month

15 years agoCorrect signatures to match kobj function definitions.
imp [Wed, 4 Feb 2009 21:11:31 +0000 (21:11 +0000)]
Correct signatures to match kobj function definitions.

15 years agoShutdown routine returns int.
imp [Wed, 4 Feb 2009 20:39:45 +0000 (20:39 +0000)]
Shutdown routine returns int.

15 years agodetach doesn't return an unsinged int, but returns an int.
imp [Wed, 4 Feb 2009 20:35:22 +0000 (20:35 +0000)]
detach doesn't return an unsinged int, but returns an int.

15 years agoFix shutdown routine to return 0 and change signature from void return
imp [Wed, 4 Feb 2009 20:26:27 +0000 (20:26 +0000)]
Fix shutdown routine to return 0 and change signature from void return
to int.

15 years agoCorrect signature for the identify routine. The bad parameter wasn't
imp [Wed, 4 Feb 2009 20:23:42 +0000 (20:23 +0000)]
Correct signature for the identify routine.  The bad parameter wasn't
used at all, so this is just a tidiness excersize.

15 years agoRemove local variable 'ddp' from DDP's attach and detach routines; they
rwatson [Wed, 4 Feb 2009 20:04:32 +0000 (20:04 +0000)]
Remove local variable 'ddp' from DDP's attach and detach routines; they
were used only for assertions, and rather than ifdef'ing them
INVARIANTS and using local variables, just directly access so_pcb.

Submitted by: Christoph Mallon <christoph dot mallon at gmx dot de>
MFC after: 1 week

15 years agoRemove written-to but never read local variable 'offset' from
rwatson [Wed, 4 Feb 2009 20:00:17 +0000 (20:00 +0000)]
Remove written-to but never read local variable 'offset' from
soreceive_dgram().

Submitted by: Christoph Mallon <christoph dot mallon at gmx dot de>
MFC after: 1 week

15 years agoEliminate the local variable 'ape' in audit_pipe_kqread(), as it's only
rwatson [Wed, 4 Feb 2009 19:56:37 +0000 (19:56 +0000)]
Eliminate the local variable 'ape' in audit_pipe_kqread(), as it's only
used for an assertion that we don't really need anymore.

MFC after: 1 week
Reported by: Christoph Mallon <christoph dot mallon at gmx dot de>

15 years agoTweak the ia64 machine check handling code to not register new sysctl nodes
jhb [Wed, 4 Feb 2009 18:44:29 +0000 (18:44 +0000)]
Tweak the ia64 machine check handling code to not register new sysctl nodes
while holding a spin mutex.  Instead, it now shoves the machine check
records onto a queue that is later drained to add sysctl nodes for each
record.  While a routine to drain the queue is present, it is not currently
called.

Reviewed by: marcel

15 years agoCheck for NOAUTO on child interfaces (eg wlanX) so they can be created via
thompsa [Wed, 4 Feb 2009 18:20:27 +0000 (18:20 +0000)]
Check for NOAUTO on child interfaces (eg wlanX) so they can be created via
rc.conf but not necessarily started.

15 years agoGet the right system makefiles for make distribution.
phk [Wed, 4 Feb 2009 18:14:30 +0000 (18:14 +0000)]
Get the right system makefiles for make distribution.

15 years agoRemove slush space from clists.
ed [Wed, 4 Feb 2009 17:10:01 +0000 (17:10 +0000)]
Remove slush space from clists.

Right now we only have a very small amount of drivers that use clists,
but we still allocate 50 cblocks as slush space, which allows drivers to
temporarily overcommit their storage. Most of the drivers don't allow
this anyway.

I've performed the following changes:

- We don't allocate any cblocks on startup.

- I've removed the DDB command, because it has nothing useful to print
  now. You can obtain the amount of allocated blocks by running `vmstat
  -m | grep clist'.

- I've removed cfreecount, which is now unused.

- The old code first tries to allocate using M_NOWAIT, followed by
  M_WAITOK. This doesn't make any sense, so just remove this logic. It
  seems the drivers allow us to sleep anyway.

We can even remove ccmax from clist_alloc_cblocks and c_cbmax from
struct clist, but this breaks binary compatibility.

This reduces the amount of allocated cblocks on my system from 54 to 4.

15 years agoWhen iterating through the list trying to find a router in
bz [Wed, 4 Feb 2009 10:35:27 +0000 (10:35 +0000)]
When iterating through the list trying to find a router in
defrouter_select(), NULL the cached llentry after unlocking
as we are no longer interested in it and with the second
iteration would try to unlock it again resulting in
panic: Lock (rw) lle not locked @ ...

Reported by: Mark Atkinson <m.atkinson@f5.com>
Tested by: Mark Atkinson <m.atkinson@f5.com>
PR: kern/128247 (in follow-up, unrelated to original report)

15 years agoErm... Report the buffer as being bounced even when it's the entire buffer,
cognet [Wed, 4 Feb 2009 01:14:06 +0000 (01:14 +0000)]
Erm... Report the buffer as being bounced even when it's the entire buffer,
or we would end up invalidating the cache line for what we just copied...

Reported by: thompsa
Pointy at to: cognet

MFC after: 3 days

15 years agoUpdate the actions previously attempted by the -D option to make them
mckusick [Wed, 4 Feb 2009 01:02:56 +0000 (01:02 +0000)]
Update the actions previously attempted by the -D option to make them
robust. With these changes fsck is now able to detect and reliably
rebuild corrupted cylinder group maps. The -D option is no longer
necessary as it has been replaced by a prompt asking whether the
corrupted cylinder group should be rebuilt and doing so when requested.
These actions are only offered and taken when running fsck in manual
mode. Corrupted cylinder groups found during preen mode cause the fsck
to fail.

Add the -r option to free up excess unused inodes. Decreasing the
number of preallocated inodes reduces the running time of future
runs of fsck and frees up space that can allocated to files. The -r
option is ignored when running in preen mode.

Reviewed by: Xin LI <delphij@>
Sponsored by: Rsync.net

15 years agoWhen crafting a media setting w/ an auto (non-fixed) rate mask out the
sam [Tue, 3 Feb 2009 22:32:26 +0000 (22:32 +0000)]
When crafting a media setting w/ an auto (non-fixed) rate mask out the
turbo option in addition to the mode bits; otherwise if the current
channel is a turbo mode channel we'll form an invalid media setting
and the ifmedia_set operation in vap_attach will panic.

While here use C99-style initialization for an array indexed by mode;
this makes it consistent w/ other usage and avoids breakage if we
should ever change the set of modes.

15 years agoReflect adding_user.8 -> adding_user.7 rename
gabor [Tue, 3 Feb 2009 20:46:05 +0000 (20:46 +0000)]
Reflect adding_user.8 -> adding_user.7 rename

Reminded by: kib

15 years agoLOR fix - Lock only when calling the actual code that
rrs [Tue, 3 Feb 2009 20:33:28 +0000 (20:33 +0000)]
LOR fix - Lock only when calling the actual code that
          is messing with the UDP tunnel. This means
          that if two users actually tried to change the
          tunnel port at the same time interesting things COULD
          result, but its probably very unlikely to happen :-)

15 years agoRemove NUMCDEVSW, which is unused since RELENG_5.
ed [Tue, 3 Feb 2009 20:31:26 +0000 (20:31 +0000)]
Remove NUMCDEVSW, which is unused since RELENG_5.

Discussed with: kib

15 years agoFix the functions to match prototypes. The K&R definitions differ
imp [Tue, 3 Feb 2009 20:25:36 +0000 (20:25 +0000)]
Fix the functions to match prototypes.  The K&R definitions differ
from the ANSI-C prototype due to the 'int promotion' rule.

15 years agoSlightly improve the design of the TTY buffer.
ed [Tue, 3 Feb 2009 19:58:28 +0000 (19:58 +0000)]
Slightly improve the design of the TTY buffer.

The TTY buffers used the standard <sys/queue.h> lists. Unfortunately
they have a big shortcoming. If you want to have a double linked list,
but no tail pointer, it's still not possible to obtain the previous
element in the list. Inside the buffers we don't need them. This is why
I switched to custom linked list macros. The macros will also keep track
of the amount of items in the list. Because it doesn't use a sentinel,
we can just initialize the queues with zero.

In its simplest form (the output queue), we will only keep two
references to blocks in the queue, namely the head of the list and the
last block in use. All free blocks are stored behind the last block in
use.

I noticed there was a very subtle bug in the previous code: in a very
uncommon corner case, it would uma_zfree() a block in the queue before
calling memcpy() to extract the data from the block.

15 years agoTrim what we expose to userland in <dev/ppbus/ppbconf.h> to just the
jhb [Tue, 3 Feb 2009 19:49:21 +0000 (19:49 +0000)]
Trim what we expose to userland in <dev/ppbus/ppbconf.h> to just the
constants used for the ppi(4) ioctls for bits in the control and status
registers.

Reviewed by: db

15 years agoadd Roel's copyright as he did the initial version
sam [Tue, 3 Feb 2009 19:21:15 +0000 (19:21 +0000)]
add Roel's copyright as he did the initial version

15 years agoAdd support for the StrataFlash on 2348 boards:
sam [Tue, 3 Feb 2009 19:16:04 +0000 (19:16 +0000)]
Add support for the StrataFlash on 2348 boards:
o add bus shim for cfi driver
o add static mapping for CS0 (we map all 16M as the cfi driver doesn't
  support demand mapping)

Note this needs some tweaking to work for 2358 boards which is why the
CAMBRIA config is not touched.

15 years agohonor any interface width (e.g. setup by the bus shim) and don't probe;
sam [Tue, 3 Feb 2009 19:09:16 +0000 (19:09 +0000)]
honor any interface width (e.g. setup by the bus shim) and don't probe;
this is needed for the moment to workaround bus shim issues

15 years agoreorg ioctl code to simplify adding new requests
sam [Tue, 3 Feb 2009 19:07:41 +0000 (19:07 +0000)]
reorg ioctl code to simplify adding new requests

15 years agoforce atomic_cmpset_ptr types to match atomic_cmpset_32;
sam [Tue, 3 Feb 2009 19:06:12 +0000 (19:06 +0000)]
force atomic_cmpset_ptr types to match atomic_cmpset_32;
this matches what powerpc does

Submitted by: stass
MFC after: 2 weeks

15 years agofix compilation w/ AH_DEBUG
sam [Tue, 3 Feb 2009 19:00:56 +0000 (19:00 +0000)]
fix compilation w/ AH_DEBUG

15 years ago- ANSIfy function definitions
danger [Tue, 3 Feb 2009 17:58:20 +0000 (17:58 +0000)]
- ANSIfy function definitions
- use nul when we are looking for a terminating character where appropriate

Approved by: imp

15 years agoDelete fwohci_filt() as it is now unused
sbruno [Tue, 3 Feb 2009 17:13:37 +0000 (17:13 +0000)]
Delete fwohci_filt() as it is now unused

Obtained from: Marius Strobl <marius@alchemy.franken.de>
MFC after: 2 weeks

15 years agoDon't right-adjust the SMBus slave address for SSIF IPMI BMCs enumerated
jhb [Tue, 3 Feb 2009 16:39:51 +0000 (16:39 +0000)]
Don't right-adjust the SMBus slave address for SSIF IPMI BMCs enumerated
via ACPI either.  This is somewhat academic since we don't currently
support such devices though.