]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agos/u_intXX_t/uintXX_t/g
yongari [Mon, 14 Dec 2009 19:53:57 +0000 (19:53 +0000)]
s/u_intXX_t/uintXX_t/g

14 years agoRemove unnecessary return statement.
yongari [Mon, 14 Dec 2009 19:49:20 +0000 (19:49 +0000)]
Remove unnecessary return statement.

14 years agoUse ANSI function definations.
yongari [Mon, 14 Dec 2009 19:44:54 +0000 (19:44 +0000)]
Use ANSI function definations.

14 years agoDon't panic on failure to attach if we fail before or during the
gavin [Mon, 14 Dec 2009 19:18:02 +0000 (19:18 +0000)]
Don't panic on failure to attach if we fail before or during the
if_alloc() of ifp.  This fixes the panic reported in the PR, but
not the attach failure.

PR: kern/139079
Tested by:      Steven Noonan <steven uplinklabs.net>
Reviewed by: thompsa
Approved by: ed (mentor)
MFC after: 2 weeks`

14 years agoClear VGE_TXDESC_Q bit for transmitted frames. The VGE_TXDESC_Q bit
yongari [Mon, 14 Dec 2009 19:08:11 +0000 (19:08 +0000)]
Clear VGE_TXDESC_Q bit for transmitted frames. The VGE_TXDESC_Q bit
seems to work like a tag that indicates 'not list end' of queued
frames. Without having a VGE_TXDESC_Q bit indicates 'list end'. So
the last frame of multiple queued frames has no VGE_TXDESC_Q bit.
The hardware has peculiar behavior for VGE_TXDESC_Q bit handling.
If the VGE_TXDESC_Q bit of descriptor was set the controller would
fetch next descriptor. However if next descriptor's OWN bit was
cleared but VGE_TXDESC_Q was set, it could confuse controller.
Clearing VGE_TXDESC_Q bit for transmitted frames ensure correct
behavior.

14 years agoAdd old read_mac_addr routine to this module since
jfv [Mon, 14 Dec 2009 19:05:16 +0000 (19:05 +0000)]
Add old read_mac_addr routine to this module since
a customer report of an Invalid MAC Address has occurred.

14 years agoFix typo in register definition.
yongari [Mon, 14 Dec 2009 18:50:26 +0000 (18:50 +0000)]
Fix typo in register definition.

14 years agoUse PCIR_BAR instead of hard-coded value.
yongari [Mon, 14 Dec 2009 18:49:16 +0000 (18:49 +0000)]
Use PCIR_BAR instead of hard-coded value.

14 years agoOverhaul bus_dma(9) usage and fix various things.
yongari [Mon, 14 Dec 2009 18:44:23 +0000 (18:44 +0000)]
Overhaul bus_dma(9) usage and fix various things.
 o Separate TX/RX buffer DMA tag from TX/RX descriptor ring DMA tag.
 o Separate RX buffer DMA tag from common buffer DMA tag. RX DMA
   tag has different restriction compared to TX DMA tag.
 o Add 40bit DMA address support.
 o Adjust TX/RX descriptor ring alignment to 64 bytes from 256
   bytes as documented in datasheet.
 o Added check to ensure TX/RX ring reside within a 4GB boundary.
   Since TX/RX ring shares the same high address register they
   should have the same high address.
 o TX/RX side bus_dmamap_load_mbuf_sg(9) support.
 o Add lock assertion to vge_setmulti().
 o Add RX spare DMA map to recover from DMA map load failure.
 o Add optimized RX buffer handler, vge_discard_rxbuf which is
   activated when vge(4) sees bad frames.
 o Don't blindly update VGE_RXDESC_RESIDUECNT register. Datasheet
   says the register should be updated only when number of
   available RX descriptors are multiple of 4.
 o Use __NO_STRICT_ALIGNMENT instead of defining VGE_FIXUP_RX which
   is only set for i386 architecture. Previously vge(4) also
   performed expensive copy operation to align IP header on amd64.
   This change should give RX performance boost on amd64
   architecture.
 o Don't reinitialize controller if driver is already running. This
   should reduce number of link state flipping.
 o Since vge(4) drops a driver lock before passing received frame
   to upper layer, make sure vge(4) is still running after
   re-acquiring driver lock.
 o Add second argument count to vge_rxeof(). The argument will
   limit number of packets could be processed in RX handler.
 o Rearrange vge_rxeof() not to allocate RX buffer if received
   frame was bad packet.
 o Removed if_printf that prints DMA map failure. This type of
   message shouldn't be used in fast path of driver.
 o Reduce number of allowed TX buffer fragments to 6 from 7. A TX
   descriptor allows 7 fragments of a frame. However the CMZ field
   of descriptor has just 3bits and the controller wants to see
   fragment + 1 in the field. So if we have 7 fragments the field
   value would be 0 which seems to cause unexpected results under
   certain conditions. This change should fix occasional TX hang
   observed on vge(4).
 o Simplify vge_stat_locked() and add number of available TX
   descriptor check.
 o vge(4) controllers lack padding short frames. Make sure to fill
   zero for the padded bytes. This closes unintended information
   disclosure.
 o Don't set VGE_TDCTL_JUMBO flag. Datasheet is not clear whether
   this bit should be set by driver or write-back status bit after
   transmission. At least vendor's driver does not set this bit so
   remove it. Without this bit vge(4) still can send jumbo frames.
 o Don't start driver when vge(4) know there are not enough RX
   buffers.
 o Remove volatile keyword in RX descriptor structure. This should
   be handled by bus_dma(9).
 o Collapse two 16bits member of TX/RX descriptor into single 32bits
   member.
 o Reduce number of RX descriptors to 252 from 256. The
   VGE_RXDESCNUM is 16bits register but only lower 8bits are valid.
   So the maximum number of RX descriptors would be 255. However
   the number of should be multiple of 4 as controller wants to
   update 4 RX descriptors at a time. This limits the maximum
   number of RX descriptor to be 252.

Tested by: Dewayne Geraghty (dewayne.geraghty <> heuristicsystems dot com dot au)
Carey Jones (m.carey.jones <> gmail dot com)
Yoshiaki Kasahara (kasahara <> nc dor kyushu-u dot ac dotjp)

14 years agoPass all IEs to net80211.
rpaulo [Mon, 14 Dec 2009 18:43:27 +0000 (18:43 +0000)]
Pass all IEs to net80211.

PR: 141376
Submitted by: Paul <onemda at gmail.com>
MFC after: 1 week

14 years agoRemove the MTX_SPIN flag to the shared code MUTEX
jfv [Mon, 14 Dec 2009 18:43:18 +0000 (18:43 +0000)]
Remove the MTX_SPIN flag to the shared code MUTEX
as it was causing a panic, also took the opportunity
to rename the lock for clarity.

14 years agoPrefer bus_alloc_resource_any(9) to bus_alloc_resource(9).
yongari [Mon, 14 Dec 2009 18:27:34 +0000 (18:27 +0000)]
Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9).

14 years agoFix spelling in comment.
yongari [Mon, 14 Dec 2009 18:19:56 +0000 (18:19 +0000)]
Fix spelling in comment.

14 years agoPrefer device_printf(9) to printf(9).
yongari [Mon, 14 Dec 2009 18:00:08 +0000 (18:00 +0000)]
Prefer device_printf(9) to printf(9).

14 years agoRemove register keyword.
yongari [Mon, 14 Dec 2009 17:53:10 +0000 (17:53 +0000)]
Remove register keyword.

14 years agoAdd an option to specify that the received ZFS should not be automatically
delphij [Mon, 14 Dec 2009 17:04:44 +0000 (17:04 +0000)]
Add an option to specify that the received ZFS should not be automatically
mounted (receive -u).

Obtained from: OpenSolaris (onnv revision 8584:327a1b6dd944)
Approved by: pjd

14 years agoStyle improvements:
delphij [Mon, 14 Dec 2009 16:54:39 +0000 (16:54 +0000)]
Style improvements:

 - Sort function prototypes;
 - Apply static on all function bodies.  To quote bde@:

> It is a good obfuscation to declare functions as static only in the
> prototype, so that you can't see the static for the actual function.
> The reverse obfuscation (with static only in the function definition)
> would make more sense, but is a constraint error.

Reviewed by: bde

14 years agoRemove comment claiming that building acpi into the kernel is deprecated.
jhb [Mon, 14 Dec 2009 15:32:32 +0000 (15:32 +0000)]
Remove comment claiming that building acpi into the kernel is deprecated.

PR: docs/141353
Submitted by: Bruce Cran
MFC after: 1 week

14 years agoProperly fix callout handling by putting all the per-cpu info in
luigi [Mon, 14 Dec 2009 12:23:46 +0000 (12:23 +0000)]
Properly fix callout handling by putting all the per-cpu info in
struct callout_cpu. From the comment in the file:

+ * There is one struct callout_cpu per cpu, holding all relevant
+ * state for the callout processing thread on the individual CPU.
+ * In particular:
+ *     cc_ticks is incremented once per tick in callout_cpu().
+ *     It tracks the global 'ticks' but in a way that the individual
+ *     threads should not worry about races in the order in which
+ *     hardclock() and hardclock_cpu() run on the various CPUs.
+ *     cc_softclock is advanced in callout_cpu() to point to the
+ *     first entry in cc_callwheel that may need handling. In turn,
+ *     a softclock() is scheduled so it can serve the various entries i
+ *     such that cc_softclock <= i <= cc_ticks .

Together with a smaller patch committed in september, this fixes a
bug that affects 8.0 with apps that rely on callouts to fire exactly
in the number of ticks specified (qemu among them).
Right now, callouts in 8.0 fire one tick late.

This was discussed in september with JeffR and jhb

MFC after: 3 days

14 years agoRevert the xterm terminal behavior to NOT clear the screen after
dougb [Mon, 14 Dec 2009 07:18:31 +0000 (07:18 +0000)]
Revert the xterm terminal behavior to NOT clear the screen after
exiting a pager, vi, etc.

Add some example xterm*-clear entries to the termcap files to make
it easier for people to enable that behavior.

Document the examples in the man page to make them easier to find.

14 years agoFix one spelling and one copy&paste error in comments.
kan [Mon, 14 Dec 2009 01:51:23 +0000 (01:51 +0000)]
Fix one spelling and one copy&paste error in comments.

14 years agoWork-around a race condition on ia64 while unlocking a contested lock.
marcel [Mon, 14 Dec 2009 01:26:01 +0000 (01:26 +0000)]
Work-around a race condition on ia64 while unlocking a contested lock.
The race condition is believed to be in UMTX_OP_MUTEX_WAKE. On ia64,
we simply go to the kernel to unlock.
The big question is why this is only a race condition on ia64...

MFC after: 3 days

14 years agoOnly set ATA_CHECKS_CABLE for chip versions that actually support
marius [Sun, 13 Dec 2009 20:36:42 +0000 (20:36 +0000)]
Only set ATA_CHECKS_CABLE for chip versions that actually support
cable detection, i.e. neither for ALI_OLD nor for ALI_NEW revisions
>= 0xc7.

MFC after: 1 week

14 years agoMake admsw(4) compile again fixing typos and adding the missing variable
bz [Sun, 13 Dec 2009 20:27:59 +0000 (20:27 +0000)]
Make admsw(4) compile again fixing typos and adding the missing variable
after r199762.

14 years agoAdd Mark Heily's libkqueue test suite as a general kqueue test suite to
rwatson [Sun, 13 Dec 2009 20:27:46 +0000 (20:27 +0000)]
Add Mark Heily's libkqueue test suite as a general kqueue test suite to
tools/regression.  It tests a number of aspects of kqueue behavior,
although not all currently pass (possibly bugs in the test suite?).

Submitted by: Mark Heily <mark at heily.com>
Obtained from: svn://mark.heily.com/libkqueue/trunk/test (r114)

14 years agoProperly support M5229 revision 0xc7 and 0xc8:
marius [Sun, 13 Dec 2009 18:42:06 +0000 (18:42 +0000)]
Properly support M5229 revision 0xc7 and 0xc8:
- These revisions no longer have cable detection capability.
- The UDMA support bit of register 0x4b has been dropped without an
  replacement.
- According to Linux it's crucial for working ATAPI DMA support to
  also set the reserved bit 1 of regsiter 0x53 with these revisions.

MFC after: 1 week

14 years agoSpecify the capability and media bits of the capabilities page in
marius [Sun, 13 Dec 2009 18:26:19 +0000 (18:26 +0000)]
Specify the capability and media bits of the capabilities page in
native, i.e. big-endian, format and convert as appropriate like we
also do with the multibyte fields of the other pages. This fixes
the output of acd_describe() to match reality on big-endian machines
without breaking it on little-endian ones. While at it, also convert
the remaining multibyte fields of the pages read although they are
currently unused for consistency and in order to prevent possible
similar bugs in the future.

MFC after: 1 week

14 years ago- Fix main() to use two separated sockets for the two transports
hrs [Sun, 13 Dec 2009 15:19:01 +0000 (15:19 +0000)]
- Fix main() to use two separated sockets for the two transports
  when "-P port" is specified.  It invoked svc{tcp,udp}_create()
  for only one of the two allocated sockets, and prevented the
  TCP socket from binding to as the result.

- Use TI-RPC functions and handle sockets in a
  transport-independent way.  At this moment only AF_INET ("udp"
  and "tcp") is supported because others need rewrites of ACL
  handling and yp clients.

- Add '-h addr' to specify addresses to bind to.

- Convert _msgout() to use variable argument lists and remove
  asprintf() for error strings.

- Remove register storage class specifier.

Discussed with: kuriyama
MFC after: 1 week

14 years agoThroughout the network stack we have a few places of
bz [Sun, 13 Dec 2009 13:57:32 +0000 (13:57 +0000)]
Throughout the network stack we have a few places of
if (jailed(cred))
left.  If you are running with a vnet (virtual network stack) those will
return true and defer you to classic IP-jails handling and thus things
will be "denied" or returned with an error.

Work around this problem by introducing another "jailed()" function,
jailed_without_vnet(), that also takes vnets into account, and permits
the calls, should the jail from the given cred have its own virtual
network stack.

We cannot change the classic jailed() call to do that,  as it is used
outside the network stack as well.

Discussed with: julian, zec, jamie, rwatson (back in Sept)
MFC after: 5 days

14 years agoAdd a few more V_hacks to nfsclient to allow machines with a VIMAGE
bz [Sun, 13 Dec 2009 11:06:39 +0000 (11:06 +0000)]
Add a few more V_hacks to nfsclient to allow machines with a VIMAGE
kernel to boot from NFS. [1]

Note: this is not a full virtualization of nfsclient. It is only does
what advertised above and nothing more.

Requested by: public demand [1]
Tested by: kris, ..
MFC after: 5 days

14 years ago - Remove times.h from C programs that does not manipulate with time at
delphij [Sun, 13 Dec 2009 04:50:11 +0000 (04:50 +0000)]
 - Remove times.h from C programs that does not manipulate with time at
   all.
 - Remove pathnames.h from all but io.c since it's the only module that
   used these definations.

14 years agoegetopt.c does not use any stdlib.h definations, nor it referenced any
delphij [Sun, 13 Dec 2009 04:34:51 +0000 (04:34 +0000)]
egetopt.c does not use any stdlib.h definations, nor it referenced any
symbol from other module, so remove reference of stdlib.h and extern.h.

Verified with: md5(1)

14 years agoUse ANSI prototype for foldit().
delphij [Sun, 13 Dec 2009 04:14:55 +0000 (04:14 +0000)]
Use ANSI prototype for foldit().

14 years agoWe use gmt2local code from tcpdump and gnuc.h is no longer being used
delphij [Sun, 13 Dec 2009 04:08:04 +0000 (04:08 +0000)]
We use gmt2local code from tcpdump and gnuc.h is no longer being used
there, so remove this dummy header.

14 years agoxinstall.c does not require ctype functions, so ctype.h is not
delphij [Sun, 13 Dec 2009 03:53:15 +0000 (03:53 +0000)]
xinstall.c does not require ctype functions, so ctype.h is not
necessary here.

Note: this would change the md5 checksum due to change caused
by different register layout.

14 years agoStaticify internal functions and make usage() a prototype.
delphij [Sun, 13 Dec 2009 03:34:19 +0000 (03:34 +0000)]
Staticify internal functions and make usage() a prototype.

14 years agoExplicitly say that this is an internal library which is intended to be
delphij [Sun, 13 Dec 2009 03:29:05 +0000 (03:29 +0000)]
Explicitly say that this is an internal library which is intended to be
used within FreeBSD base system only, and discourage user applications
from using it.  User applications should use the expat version from the
ports/package collection.

Reviewed by: simon (earlier version)
MFC after: 2 weeks

14 years agoUse prototype for usage().
delphij [Sun, 13 Dec 2009 03:18:37 +0000 (03:18 +0000)]
Use prototype for usage().

14 years agoRevert most part of 200420 as requested, as more review and polish is
delphij [Sun, 13 Dec 2009 03:14:06 +0000 (03:14 +0000)]
Revert most part of 200420 as requested, as more review and polish is
needed.

14 years agoAdd support for memory disk (md). The size of the memory disk
marcel [Sun, 13 Dec 2009 01:20:32 +0000 (01:20 +0000)]
Add support for memory disk (md). The size of the memory disk
is determined by MD_IMAGE_SIZE. A file system can be embedded
into the loader with /sys/tools/embed_mfs.sh.
Note that md.c is not included when MD_IMAGE_SIZE is not set.

14 years agoUnbreak the ata_atapi() usage. Since r200171 the mode setting functions
marius [Sun, 13 Dec 2009 00:13:21 +0000 (00:13 +0000)]
Unbreak the ata_atapi() usage. Since r200171 the mode setting functions
get a ata_device type device passed instead of a ata_channel one, thus
ata_atapi() has to be adjusted accordingly.

Reviewed by: mav
MFC after: 3 days

14 years agoDocument PBDRY and SLEEPQ_STOP_ON_BDRY.
kib [Sat, 12 Dec 2009 22:08:37 +0000 (22:08 +0000)]
Document PBDRY and SLEEPQ_STOP_ON_BDRY.

Requested and reviewed by: attilio
MFC after: 3 days

14 years agoDon't free jail parameter values after printing them - jail_param_get
jamie [Sat, 12 Dec 2009 21:59:30 +0000 (21:59 +0000)]
Don't free jail parameter values after printing them - jail_param_get
expects them to be there for the next jail in the list.

PR: bin/141359
MFC after: 1 week

14 years agoSince the change to rc.subr in r198162 it's not necessary to specify
dougb [Sat, 12 Dec 2009 21:51:50 +0000 (21:51 +0000)]
Since the change to rc.subr in r198162 it's not necessary to specify
command in the rc.d script if we have a corresponding ${name}_program
entry, which we do for named.

Rename named_precmd to named_prestart to make it more clear and match
convention.

Move the command_args definition related to -u up into _prestart().
It (and the associated $named_uid value) are only used there, and
unlike required_* and pidfile don't need to be used until this stage.

Fix a silly bug that would only have affected people who were using
the new named_wait or named_auto_forward features, AND had set up an
rndc.conf file instead of using the automatically generated rndc.key.

For named_conf:
Add "-c $named_conf" to command_args if it's not set to the
default. If it is set to the default and we're using the base
BIND it's not necessary. If we're using BIND from the ports
the user is likely to have included it in _flags (due to long
necessity for doing so) so don't duplicate that if it's set.

Add $named_conf to required_files

14 years agoIn current code, threads performing an interruptible sleep (on both
attilio [Sat, 12 Dec 2009 21:31:07 +0000 (21:31 +0000)]
In current code, threads performing an interruptible sleep (on both
sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr), will
leave the waiters flag on forcing the owner to do a wakeup even when if
the waiter queue is empty.
That operation may lead to a deadlock in the case of doing a fake wakeup
on the "preferred" (based on the wakeup algorithm) queue while the other
queue has real waiters on it, because nobody is going to wakeup the 2nd
queue waiters and they will sleep indefinitively.

A similar bug, is present, for lockmgr in the case the waiters are
sleeping with LK_SLEEPFAIL on.  In this case, even if the waiters queue
is not empty, the waiters won't progress after being awake but they will
just fail, still not taking care of the 2nd queue waiters (as instead the
lock owned doing the wakeup would expect).

In order to fix this bug in a cheap way (without adding too much locking
and complicating too much the semantic) add a sleepqueue interface which
does report the actual number of waiters on a specified queue of a
waitchannel (sleepq_sleepcnt()) and use it in order to determine if the
exclusive waiters (or shared waiters) are actually present on the lockmgr
(or sx) before to give them precedence in the wakeup algorithm.
This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In order to
cope with it, add the tracking of how many exclusive LK_SLEEPFAIL waiters
a lockmgr has and if all the waiters on the exclusive waiters queue are
LK_SLEEPFAIL just wake both queues.

The sleepq_sleepcnt() introduction and ABI breakage require
__FreeBSD_version bumping.

Reported by: avg, kib, pho
Reviewed by: kib
Tested by: pho

14 years agoFor ia32 syscall(), call cpu_set_syscall_retval(). Update comment inside
kib [Sat, 12 Dec 2009 20:11:31 +0000 (20:11 +0000)]
For ia32 syscall(), call cpu_set_syscall_retval(). Update comment inside
cpu_set_syscall_retval() accordingly.

MFC after: 1 week

14 years agoDon't read the newline character to line buffer because lines are passed
jh [Sat, 12 Dec 2009 18:18:46 +0000 (18:18 +0000)]
Don't read the newline character to line buffer because lines are passed
to wcscoll(3). Newline characters could cause incorrect results when
comparing lines.

Also, if an input line didn't contain a newline character, it was
omitted from the output. According to my interpretation, SUSv3 requires
that the newline is always printed.

Add regression tests for the cases. [1]

PR: bin/140976
Submitted by: D'Arcy Cain (original version) [1]
Approved by: trasz (mentor)

14 years agoThe input line length limit mentioned on the manual page was removed by
jh [Sat, 12 Dec 2009 18:04:50 +0000 (18:04 +0000)]
The input line length limit mentioned on the manual page was removed by
r179374.

Approved by: trasz (mentor)

14 years agoInstall firmware(9) examples.
antoine [Sat, 12 Dec 2009 17:04:36 +0000 (17:04 +0000)]
Install firmware(9) examples.

MFC after: 1 month

14 years agoMake the code buildable in userland so it is easier to test it:
luigi [Sat, 12 Dec 2009 15:49:28 +0000 (15:49 +0000)]
Make the code buildable in userland so it is easier to test it:
this requires a small reordering of headers and a few #defines to
map functions not available in userland.

Remove a useless #ifndef block at the beginning of the file.

Introduce (temporarily) rn_init2(), see the comment in the code
for the proper long term change.

No ABI or functional change.

MFC after: 7 days

14 years agoOver time things that used to be files/directories/links can change
dougb [Sat, 12 Dec 2009 02:19:41 +0000 (02:19 +0000)]
Over time things that used to be files/directories/links can change
to something else. So add code to detect when things don't match and
give the user choices about how to fix it.

If we're using -P and something in the above check needs to be moved
we need to have the directory there for it, so create it at the
beginning and delete empty versions of it at the end.

The case where something used to be a file or link and now is supposed
to be a directory (e.g., /etc/security) is especially dangerous, so
make failure to install a necessary directory in $DESTDIR a fatal error.

14 years agoFix libusb_open_device_with_vid_pid() to return a NULL if no device is
scf [Sat, 12 Dec 2009 00:24:30 +0000 (00:24 +0000)]
Fix libusb_open_device_with_vid_pid() to return a NULL if no device is
found instead of the last device in its search list.

Reviewed by: thompsa
MFC after: 5 days

14 years agoRemove a dead store.
scf [Sat, 12 Dec 2009 00:11:40 +0000 (00:11 +0000)]
Remove a dead store.

MFC after: 5 days

14 years agoRemove driver lock assertion in MII register access. This change
yongari [Sat, 12 Dec 2009 00:06:43 +0000 (00:06 +0000)]
Remove driver lock assertion in MII register access. This change
was made in r199543 to remove MTX_RECURSE. These routines can be
called in device attach phase(e.g. mii_phy_probe()) so checking
assertion here is not right as caller does not hold a driver lock.

14 years agoThe hostname passed to ulog_login(3) may be optional.
ed [Fri, 11 Dec 2009 23:52:42 +0000 (23:52 +0000)]
The hostname passed to ulog_login(3) may be optional.

Don't trip on a null pointer being passed to this function when
performing a local login.

Noticed by: dougb

14 years agoRemove unneeded header includes from usr.bin/ except contributed code.
delphij [Fri, 11 Dec 2009 23:35:38 +0000 (23:35 +0000)]
Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe

14 years agoRemove unnecessary termcap.h includes inherited from extern.h and other
delphij [Fri, 11 Dec 2009 23:30:22 +0000 (23:30 +0000)]
Remove unnecessary termcap.h includes inherited from extern.h and other
unneeded headers.  While I'm there, make function definations ANSI
prototypes.

14 years agoMove unistd.h includes to individual .c files and remove unnecessary
delphij [Fri, 11 Dec 2009 23:23:57 +0000 (23:23 +0000)]
Move unistd.h includes to individual .c files and remove unnecessary
includes.

14 years agoRemove unnecessary includes.
delphij [Fri, 11 Dec 2009 23:20:02 +0000 (23:20 +0000)]
Remove unnecessary includes.

Reviewed by: rodrigc

14 years agoSimplify handling of MTREEFILE relative to DESTDIR
dougb [Fri, 11 Dec 2009 23:03:35 +0000 (23:03 +0000)]
Simplify handling of MTREEFILE relative to DESTDIR

Make the message about a missing MTREEFILE combined with -U
more informative

14 years agoReference the correct man page for firmware(9).
bcr [Fri, 11 Dec 2009 19:36:10 +0000 (19:36 +0000)]
Reference the correct man page for firmware(9).

PR:             docs/140985
Submitted by:   Glen Barber (glen dot j dot barber at gmail dot com)
MFC after:      7 days
Reviewed by:    rpaulo
Approved by:    rpaulo, jkois (mentor)

14 years agoCFA support doesn't exclude FLUSH support.
mav [Fri, 11 Dec 2009 16:32:59 +0000 (16:32 +0000)]
CFA support doesn't exclude FLUSH support.

Submitted by: Grzegorz Bernacki

14 years agoConvert pam_lastlog(8) to libulog.
ed [Fri, 11 Dec 2009 14:15:55 +0000 (14:15 +0000)]
Convert pam_lastlog(8) to libulog.

The information used by the "Last login:"-line is obtained by using
ulog_setutxfile(3) to switch to the lastlog database. Login and logout
are performed using the utility functions ulog_login(3) and
ulog_logout(3).

This also means we must build libulog during bootstrap.

Approved by: des

14 years agoBump the man page date to the date of the last update.
syrinx [Fri, 11 Dec 2009 13:05:09 +0000 (13:05 +0000)]
Bump the man page date to the date of the last update.

Noticed by: bz

14 years agoCleanups the boot2 for pc98. There is no functional change.
nyan [Fri, 11 Dec 2009 12:36:59 +0000 (12:36 +0000)]
Cleanups the boot2 for pc98.  There is no functional change.
  - Make setting machine type and getting geom conditional for future.
  - Remove unused RAWBOOT and CDBOOT supports.
  - Remove unneeded include.
  - Fix warnings.

MFC after: 1 week

14 years agoonly export bio_cmd and flags to userland (bio_cmd are
luigi [Fri, 11 Dec 2009 10:35:58 +0000 (10:35 +0000)]
only export bio_cmd and flags to userland (bio_cmd are
used by ggatectl, flags are potentially useful).
Other parts are internal kernel data structures and should
not be visible to userland.

No API change involved.

MFC after: 3 days

14 years agoAdd support for TACACS+ accounting to libtacplus(3).
syrinx [Fri, 11 Dec 2009 07:53:44 +0000 (07:53 +0000)]
Add support for TACACS+ accounting to libtacplus(3).

Submitted by: Michael Pounov misho@aitbg.com
OKed by: emaste

14 years agoFix interrupt handling. It started off broken and grew worse over time.
marcel [Fri, 11 Dec 2009 03:08:07 +0000 (03:08 +0000)]
Fix interrupt handling. It started off broken and grew worse over time.
The rewrite of the interrupt handler includes:
o   loop until all pending interrupts are handled. This closes a
    race condition.
o   count the number of interrupt sources we handled so that we can
    properly return FILTER_HANDLED or FILTER_STRAY when we break out
    of the loop.
o   When matching the interrupt source to the devices that have that
    source pending, check only from the set of devices we found to
    have a pending interrupt.

PR: kern/140947
MFC after: 3 days

14 years agoWrap long lines.
thompsa [Fri, 11 Dec 2009 02:52:14 +0000 (02:52 +0000)]
Wrap long lines.

14 years agoAdd a quirk for the Curitel UM175 where setting multiplexing for call
thompsa [Fri, 11 Dec 2009 02:44:15 +0000 (02:44 +0000)]
Add a quirk for the Curitel UM175 where setting multiplexing for call
management over the data endpoint causes communication to die.

Take this one step further and model it on the existing NetBSD quirk and import
other device IDs from them.

Obtained from: NetBSD

14 years agoApply two vendor fixes for CVE-2009-3720.
delphij [Fri, 11 Dec 2009 02:09:46 +0000 (02:09 +0000)]
Apply two vendor fixes for CVE-2009-3720.

Security: CVE-2009-3720
MFC after: 3 days

14 years agoUpdate to the December 12, 2008 version of this file. The one
dougb [Fri, 11 Dec 2009 01:06:04 +0000 (01:06 +0000)]
Update to the December 12, 2008 version of this file. The one
substantive change is to add the IPv6 address of L. The other
changes are all CAPS LOCK related.

14 years agoRevert r199331, the UM175 is in fact a cdc-acm device handled by umodem(4).
thompsa [Fri, 11 Dec 2009 00:57:30 +0000 (00:57 +0000)]
Revert r199331, the UM175 is in fact a cdc-acm device handled by umodem(4).

14 years agoAdd one more set of codec IDs.
mav [Fri, 11 Dec 2009 00:38:13 +0000 (00:38 +0000)]
Add one more set of codec IDs.

14 years agoUpdate termcap entries for xterm.
ed [Thu, 10 Dec 2009 22:25:53 +0000 (22:25 +0000)]
Update termcap entries for xterm.

It turns out these entries do make Terminal.app behave a little better.
According to Thomas Dickey, Terminal.app should use TERM=nsterm anyway,
but we don't support this yet. Already having an improved termcap entry
helps, so I am going to MFC this change after all.

Suggested by: Leonidas Tsampros <ltsampros upnet gr>
MFC after: 1 month

14 years agoAdd a missing else that negated the truncation of ki_ngroups to
brooks [Thu, 10 Dec 2009 21:16:16 +0000 (21:16 +0000)]
Add a missing else that negated the truncation of ki_ngroups to
NGROUPS.

Submitted by: Dmitry Pryanishnikov <lynx dot ripe at gmail dot com>

14 years agouse div64 when converting back the burst value for userland
luigi [Thu, 10 Dec 2009 18:37:14 +0000 (18:37 +0000)]
use div64 when converting back the burst value for userland

14 years agowhen draining a flowset free the entire chain, not just one packet.
luigi [Thu, 10 Dec 2009 18:34:07 +0000 (18:34 +0000)]
when draining a flowset free the entire chain, not just one packet.

14 years agoAdd module dependency for cam if configured as ATA_CAM.
takawata [Thu, 10 Dec 2009 16:55:16 +0000 (16:55 +0000)]
Add module dependency for cam if configured as ATA_CAM.

14 years agocentralize the code to free a packet (or a chain) while in dummynet.
luigi [Thu, 10 Dec 2009 15:17:34 +0000 (15:17 +0000)]
centralize the code to free a packet (or a chain) while in dummynet.
Remove an old macro and its stale comment.

14 years agoDon't warn about an RSDP with a corrupt checksum. The kernel does a better
jhb [Thu, 10 Dec 2009 14:54:29 +0000 (14:54 +0000)]
Don't warn about an RSDP with a corrupt checksum.  The kernel does a better
job about warning about these things later and this message can be
confusing.

Submitted by: infofarmer
MFC after: 1 week

14 years agoRecord part of history I participated in.
kib [Thu, 10 Dec 2009 14:41:47 +0000 (14:41 +0000)]
Record part of history I participated in.

No objections from: ed, pho

14 years agoNo functional changes (who dares to touch this code!) but:
luigi [Thu, 10 Dec 2009 10:34:30 +0000 (10:34 +0000)]
No functional changes (who dares to touch this code!) but:

- cast the result of LEN() to int as this is the main usage.
- use LEN() in one place where it was forgotten.
- Document the use of a static variable in rw mode.

More small changes to follow.

MFC after: 7 days

14 years agoLimit maximum I/O size, depending on command set supported by device.
mav [Thu, 10 Dec 2009 09:26:56 +0000 (09:26 +0000)]
Limit maximum I/O size, depending on command set supported by device.
It is required to suppot non-LBA48 devices with MAXPHYS above 128K.
Same is done in ada(4).

14 years agofor PV XEN translate page table entries from machine (real) to physical (logical...
kmacy [Thu, 10 Dec 2009 07:48:47 +0000 (07:48 +0000)]
for PV XEN translate page table entries from machine (real) to physical (logical) addresses so that kgdb can
translate them to the correct coredump offsets

14 years agoMerge two cpio fixes from libarchive.googlecode.com:
kientzle [Thu, 10 Dec 2009 06:42:28 +0000 (06:42 +0000)]
Merge two cpio fixes from libarchive.googlecode.com:
 1) Avoid an infinite loop in the header resync for certain malformed
    archives.
 2) Don't try to match hardlinks if the nlinks count is < 2.   This
    reduces the likelihood of a false hardlink match due to ino truncation.

MFC after: 7 days

14 years ago- revert pmap_kenter_temporary to taking a physical address
kmacy [Thu, 10 Dec 2009 03:09:35 +0000 (03:09 +0000)]
- revert pmap_kenter_temporary to taking a physical address
- make minidump work

14 years agoSimplify arena_run_reg_dalloc(), and remove a bug that was due to incorrect
jasone [Thu, 10 Dec 2009 02:51:40 +0000 (02:51 +0000)]
Simplify arena_run_reg_dalloc(), and remove a bug that was due to incorrect
initialization of ssize_invs.

14 years agoImplement a rudimentary suspend/resume methods for PCI P2P bridge.
jkim [Thu, 10 Dec 2009 01:01:53 +0000 (01:01 +0000)]
Implement a rudimentary suspend/resume methods for PCI P2P bridge.

Reviewed by: jhb, imp

14 years agoFix the posix_memalign() changes in r196861 to actually return a NULL pointer
jasone [Thu, 10 Dec 2009 00:16:11 +0000 (00:16 +0000)]
Fix the posix_memalign() changes in r196861 to actually return a NULL pointer
as intended.

PR: standards/138307

14 years agoAdd my birthday.
gavin [Wed, 9 Dec 2009 22:03:57 +0000 (22:03 +0000)]
Add my birthday.

Approved by: ed (mentor)

14 years agoFor some buses, devices may have active resources assigned even though they
jhb [Wed, 9 Dec 2009 21:52:53 +0000 (21:52 +0000)]
For some buses, devices may have active resources assigned even though they
are not allocated by the device driver.  These resources should still appear
allocated from the system's perspective so that their assigned ranges are
not reused by other resource requests.  The PCI bus driver has used a hack
to effect this for a while now where it uses rman_set_device() to assign
devices to the PCI bus when they are first encountered and later assigns
them to the actual device when a driver allocates a BAR.  A few downsides of
this approach is that it results in somewhat confusing devinfo -r output as
well as not being very easily portable to other bus drivers.

This commit adds generic support for "reserved" resources to the resource
list API used by many bus drivers to manage the resources of child devices.
A resource may be reserved via resource_list_reserve().  This will allocate
the resource from the bus' parent without activating it.
resource_list_alloc() recognizes an attempt to allocate a reserved resource.
When this happens it activates the resource (if requested) and then returns
the reserved resource.  Similarly, when a reserved resource is released via
resource_list_release(), it is deactivated (if it is active) and the
resource is then marked reserved again, but is left allocated from the
bus' parent.  To completely remove a reserved resource, a bus driver may
use resource_list_unreserve().  A bus driver may use resource_list_busy()
to determine if a reserved resource is allocated by a child device or if
it can be unreserved.

The PCI bus driver has been changed to use this framework instead of
abusing rman_set_device() to keep track of reserved vs allocated resources.

Submitted by: imp (an older version many moons ago)
MFC after: 1 month

14 years agoAdd myself, and show ed@ as my mentor.
gavin [Wed, 9 Dec 2009 21:39:43 +0000 (21:39 +0000)]
Add myself, and show ed@ as my mentor.

Approved by: ed (mentor)

14 years agoAdd missing relation between philip and I.
ed [Wed, 9 Dec 2009 21:18:56 +0000 (21:18 +0000)]
Add missing relation between philip and I.

It seems I forgot this when I became a committer last year.

14 years agoFix a confusing typo in the EDD packet structure used in gptboot and
jhb [Wed, 9 Dec 2009 21:09:32 +0000 (21:09 +0000)]
Fix a confusing typo in the EDD packet structure used in gptboot and
gptzfsboot.  I got the segment and offset fields reversed in the structure,
but I also succeeded in crossing the assignments so the actual EDD packet
ended up correct.

MFC after: 1 week

14 years ago- Port bios_getmem() from libi386 to {gpt,}zfsboot() and use it to
jhb [Wed, 9 Dec 2009 20:36:56 +0000 (20:36 +0000)]
- Port bios_getmem() from libi386 to {gpt,}zfsboot() and use it to
  safely allocate a heap region above 1MB.  This enables {gpt,}zfsboot()
  to allocate much larger buffers than before.
- Use a larger buffer (1MB instead of 128K) for temporary ZFS buffers.  This
  allows more reliable reading of compressed files in a raidz/raidz2 pool.

Submitted by: Matt Reimer  mattjreimer of gmail
MFC after: 1 week

14 years agoFix hardware issue with FTDI chips: avoid sending a zero length packet due to
thompsa [Wed, 9 Dec 2009 20:28:33 +0000 (20:28 +0000)]
Fix hardware issue with FTDI chips: avoid sending a zero length packet due to
hardware sending garbage on ZLPs.

Reported by: Corey Smith
Submitted by: HPS

14 years agoFix dwSignature for NCM mode and add extra debug output.
thompsa [Wed, 9 Dec 2009 20:27:06 +0000 (20:27 +0000)]
Fix dwSignature for NCM mode and add extra debug output.

Submitted by: HPS

14 years agoAdd new device ids.
thompsa [Wed, 9 Dec 2009 20:24:49 +0000 (20:24 +0000)]
Add new device ids.

PR: usb/140951, usb/140923
Submitted by: Romain Tartiere, Brett Glass

14 years agoCorrect name, 82801IJ -> 82801JI
thompsa [Wed, 9 Dec 2009 20:17:22 +0000 (20:17 +0000)]
Correct name, 82801IJ -> 82801JI

Submitted by: mitya_cabletv.dp.ua