]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoTweak the ia64 machine check handling code to not register new sysctl nodes
John Baldwin [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
Andrew Thompson [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.
Poul-Henning Kamp [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 Schouten [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
Bjoern A. Zeeb [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,
Olivier Houchard [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
Kirk 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 Leffler [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 Kovesdan [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
Randall Stewart [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 Schouten [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
Warner Losh [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 Schouten [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
John Baldwin [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 Leffler [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 Leffler [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 Leffler [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 Leffler [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 Leffler [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 Leffler [Tue, 3 Feb 2009 19:00:56 +0000 (19:00 +0000)]
fix compilation w/ AH_DEBUG

15 years ago- ANSIfy function definitions
Daniel Gerzo [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
Sean Bruno [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
John Baldwin [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.

15 years ago- Change ichsmb(4) to follow the format of all the other smbus controllers
John Baldwin [Tue, 3 Feb 2009 16:14:37 +0000 (16:14 +0000)]
- Change ichsmb(4) to follow the format of all the other smbus controllers
  for slave addressing by using left-adjusted slave addresses (i.e.
  xxxxxxx0b).
- Require the low bit of the slave address to always be zero in smb(4) to
  help catch broken applications.
- Adjust some code in the IPMI driver to not convert the slave address for
  SSIF to a right-adjusted address.  I (or possibly ambrisko@) added this in
  the past to (unknowingly) work around the bug in ichsmb(4).

Submitted by:  Andriy Gapon <avg of icyb.net.ua> (1,2)
MFC after: 1 month

15 years ago- Keep the same sorting on usb_errstr_table as the enum.
Andrew Thompson [Tue, 3 Feb 2009 16:00:20 +0000 (16:00 +0000)]
- Keep the same sorting on usb_errstr_table as the enum.
- Use c99 array initializers for usb_quirk_str so the indexing isnt critical.

15 years agoPartially revert r186559.
David E. O'Brien [Tue, 3 Feb 2009 15:27:29 +0000 (15:27 +0000)]
Partially revert r186559.

15 years agoAdd missing string table for the usb quirk enum.
Andrew Thompson [Tue, 3 Feb 2009 15:24:00 +0000 (15:24 +0000)]
Add missing string table for the usb quirk enum.

Pointy hat: me
Submitted by: rrs

15 years ago- Cleanup checksum code.
Randall Stewart [Tue, 3 Feb 2009 11:04:03 +0000 (11:04 +0000)]
- Cleanup checksum code.
- Prepare for CRC offloading, add MIB counters (RS/MT).
- Bugfix: Disable CRC computation for IPv6 addresses with local scope (MT).
- Bugfix: Handle close() with SO_LINGER correctly when notifications
          are generated during the close() call(MT).
- Bugfix: Generate DRY event when sender is dry during subscription.
          Only for 1-to-1 style sockets (RS/MT)
- Bugfix: Put vtags for the correct amount of time into time-wait (MT).
- Bugfix: Clear vtag entries correctly on expiration (MT).
- Bugfix: shutdown() indicates ENOTCONN when called for unconnected
          1-to-1 style sockets (MT).
- Bugfix: In sctp Auth code (PL).
- Add support for devices that support SCTP csum offload (igb).
- Add missing sctp_associd to mib sysctl xsctp_tcb structure (RS)
Obtained from: With help from Peter Lei and Michael Tuexen

15 years agoAdds support for SCTP checksum offload. This means
Randall Stewart [Tue, 3 Feb 2009 11:00:43 +0000 (11:00 +0000)]
Adds support for SCTP checksum offload. This means
we, like TCP and UDP, move the checksum calculation
into the IP routines when there is no hardware support
we call into the normal SCTP checksum routine.

The next round of SCTP updates will use
this functionality. Of course the IGB driver needs
a few updates to support the new intel controller set
that actually does SCTP csum offload too.

Reviewed by: gnn, rwatson, kmacy

15 years agoImprove robustness of NMI handling, for NMIs recognized in kernel
Joseph Koshy [Tue, 3 Feb 2009 09:01:45 +0000 (09:01 +0000)]
Improve robustness of NMI handling, for NMIs recognized in kernel
mode.

- Make the NMI handler run on its own stack (TSS_IST2).
- Store the GSBASE value for each CPU just before the start of
  each NMI stack, permitting efficient retrieval using %rsp-relative
  addressing.
- For NMIs taken from kernel mode, program MSR_GSBASE explicitly
  since one or both of MSR_GSBASE and MSR_KGSBASE can be potentially
  invalid.  The current contents of MSR_GSBASE are saved and restored
  at exit.
- For NMIs handled from user mode, continue to use 'swapgs' to
  load the per-CPU GSBASE.

Reviewed by: jeff
Debugging help: jeff
Tested by: gnn, Artem Belevich <artemb at gmail dot com>

15 years agoUse NULL in preference to 0 in pointer contexts.
Warner Losh [Tue, 3 Feb 2009 07:54:42 +0000 (07:54 +0000)]
Use NULL in preference to 0 in pointer contexts.

15 years agoMake bioq_disksort have a ANSI-C definition rather than a K&R definition.
Warner Losh [Tue, 3 Feb 2009 07:53:51 +0000 (07:53 +0000)]
Make bioq_disksort have a ANSI-C definition rather than a K&R definition.

15 years agorman_debug should be static, so make it static.
Warner Losh [Tue, 3 Feb 2009 07:53:08 +0000 (07:53 +0000)]
rman_debug should be static, so make it static.

15 years agoUse ANSI function definition for profil.
Warner Losh [Tue, 3 Feb 2009 07:52:36 +0000 (07:52 +0000)]
Use ANSI function definition for profil.

15 years agoPrefer ANSI function definitions to K&R ones.
Warner Losh [Tue, 3 Feb 2009 07:52:07 +0000 (07:52 +0000)]
Prefer ANSI function definitions to K&R ones.

15 years agoUse NULL in preference to 0 for pointers.
Warner Losh [Tue, 3 Feb 2009 07:51:41 +0000 (07:51 +0000)]
Use NULL in preference to 0 for pointers.

15 years agoUse NULL in preference to 0 for pointers.
Warner Losh [Tue, 3 Feb 2009 07:51:11 +0000 (07:51 +0000)]
Use NULL in preference to 0 for pointers.

15 years agoo Use unsigned for bit fields.
Warner Losh [Tue, 3 Feb 2009 07:50:41 +0000 (07:50 +0000)]
o Use unsigned for bit fields.
o Use NULL for pointers in preference to 0.

15 years agoint foo(void) is the proper ANSI function definition when there's no
Warner Losh [Tue, 3 Feb 2009 07:50:01 +0000 (07:50 +0000)]
int foo(void) is the proper ANSI function definition when there's no
parameters.  Use it for resettodr().

15 years agoIn g_handleattr(), set bp->bio_completed also for the case
Marcel Moolenaar [Tue, 3 Feb 2009 07:07:13 +0000 (07:07 +0000)]
In g_handleattr(), set bp->bio_completed also for the case
where len is 0. Otherwise g_getattr() will never succeed
when it is handled by g_handleattr_str().

15 years agoIntroduce a C type representing the header for GNU-style hash table
Joseph Koshy [Tue, 3 Feb 2009 06:12:13 +0000 (06:12 +0000)]
Introduce a C type representing the header for GNU-style hash table
sections.  These ELF sections are generated by newer versions of
GNU binutils.

Reviewed by: kaiw, Ali Bahrami <ali dot bahrami at sun dot com>

15 years agoMove away from autogenerated enums, these values never change and its helpful
Andrew Thompson [Tue, 3 Feb 2009 05:50:36 +0000 (05:50 +0000)]
Move away from autogenerated enums, these values never change and its helpful
to be able to look them up.

15 years agoo Define some symbols for a few items that are bare constants in the
Warner Losh [Tue, 3 Feb 2009 04:28:45 +0000 (04:28 +0000)]
o Define some symbols for a few items that are bare constants in the
  code.
o Use NULL in preference to 0 for a few pointers.
o default to bus timing normal, like we default to bus_width_1.

15 years agomake sure that interrupts are disabled when handling page faults et al
Kip Macy [Tue, 3 Feb 2009 03:43:00 +0000 (03:43 +0000)]
make sure that interrupts are disabled when handling page faults et al

15 years agoUse NULL in preference to 0 for pointers.
Warner Losh [Tue, 3 Feb 2009 01:17:34 +0000 (01:17 +0000)]
Use NULL in preference to 0 for pointers.

15 years agoUse NULL in preference to '0' for pointers.
Warner Losh [Tue, 3 Feb 2009 01:17:17 +0000 (01:17 +0000)]
Use NULL in preference to '0' for pointers.

15 years agoUse %u instead of %zu when we intend to print integer constant.
Xin LI [Tue, 3 Feb 2009 00:15:19 +0000 (00:15 +0000)]
Use %u instead of %zu when we intend to print integer constant.

15 years agoDeclare bus_data_devices to be static: it isn't used elsewhere.
Warner Losh [Tue, 3 Feb 2009 00:10:21 +0000 (00:10 +0000)]
Declare bus_data_devices to be static: it isn't used elsewhere.
Use NULL in a couple of places rather than 0 in the context of
pointers to be consistent with the rest of the file.

15 years agobreak out of loop if we run out of mbufs
Kip Macy [Mon, 2 Feb 2009 23:04:20 +0000 (23:04 +0000)]
break out of loop if we run out of mbufs

15 years agoGoof, catch up to constant rename (I renamed it to match the overall PCI
John Baldwin [Mon, 2 Feb 2009 22:06:20 +0000 (22:06 +0000)]
Goof, catch up to constant rename (I renamed it to match the overall PCI
style of having register offsets start with PCIR_* rather than PCI_*).

Submitted by: rss

15 years ago- Add a new ioctl to /dev/pci to fetch details on an individual BAR of a
John Baldwin [Mon, 2 Feb 2009 22:04:40 +0000 (22:04 +0000)]
- Add a new ioctl to /dev/pci to fetch details on an individual BAR of a
  device.  The details include the current value of the BAR (including all
  the flag bits and the current base address), its length, and whether or not
  it is enabled.  Since this operation is not invasive, non-root users are
  allowed to use it (unlike manual config register access which requires
  root).  The intention is that userland apps (such as Xorg) will use this
  interface rather than dangerously frobbing the BARs from userland to
  obtain this information.
- Add a new sub-mode to the 'list' mode of pciconf.  The -b flag when used
  with -l will now list all the active BARs for each device.

(Missed in previous commit)

MFC after: 1 week

15 years agoProvide a type for the argument.
Roman Divacky [Mon, 2 Feb 2009 21:51:52 +0000 (21:51 +0000)]
Provide a type for the argument.

Approved by: kib (mentor)

15 years agoProperly retun error core from kbdmux_modevent()
Maksim Yevmenkin [Mon, 2 Feb 2009 21:34:04 +0000 (21:34 +0000)]
Properly retun error core from kbdmux_modevent()

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

15 years agoBegin basic improvements to fwcontrol in the area of handling
Sean Bruno [Mon, 2 Feb 2009 21:05:12 +0000 (21:05 +0000)]
Begin basic improvements to fwcontrol in the area of handling
video streams from cameras.

This patch changes the displayed timer to a time stamp and corrects
one or two mishandled errors.

Submitted by: imp

15 years agoMove a comment to where it belongs.
Olivier Houchard [Mon, 2 Feb 2009 20:24:29 +0000 (20:24 +0000)]
Move a comment to where it belongs.

Spotted out by: Christoph Mallon <christoph d0t mallon AT gmx d0t de>

15 years agoRemove unused variables.
Olivier Houchard [Mon, 2 Feb 2009 20:09:14 +0000 (20:09 +0000)]
Remove unused variables.

Spotted out by: Christoph Mallon <christoph d0t mallon AT gmx d0t de>

15 years ago- Add a new ioctl to /dev/pci to fetch details on an individual BAR of a
John Baldwin [Mon, 2 Feb 2009 19:54:16 +0000 (19:54 +0000)]
- Add a new ioctl to /dev/pci to fetch details on an individual BAR of a
  device.  The details include the current value of the BAR (including all
  the flag bits and the current base address), its length, and whether or not
  it is enabled.  Since this operation is not invasive, non-root users are
  allowed to use it (unlike manual config register access which requires
  root).  The intention is that userland apps (such as Xorg) will use this
  interface rather than dangerously frobbing the BARs from userland to
  obtain this information.
- Add a new sub-mode to the 'list' mode of pciconf.  The -b flag when used
  with -l will now list all the active BARs for each device.

MFC after: 1 month

15 years ago- Use a separate pointer to the allocated memory for freeing, as strsep may
Ulf Lilleengen [Mon, 2 Feb 2009 19:22:53 +0000 (19:22 +0000)]
- Use a separate pointer to the allocated memory for freeing, as strsep may
  modify the pointer argument passed to it. This triggered an assert in malloc
  when a geom command being run under the livefs environment.

PR: bin/130632
Submitted by: Dimitry Andric <dimitry -at- andric.com>
Pointy hat to: me
MFC after: 2 days

15 years agoHook up btpand(8) to the build
Maksim Yevmenkin [Mon, 2 Feb 2009 18:10:51 +0000 (18:10 +0000)]
Hook up btpand(8) to the build

MFC after: 1 month

15 years agoFix client mode. Pick up service availability changes.
Maksim Yevmenkin [Mon, 2 Feb 2009 18:08:22 +0000 (18:08 +0000)]
Fix client mode. Pick up service availability changes.

Obtained from: NetBSD
MFC after: 1 month

15 years agoo make SAVE_CCK slightly less error prone by always writing the _flag
Sam Leffler [Mon, 2 Feb 2009 16:56:58 +0000 (16:56 +0000)]
o make SAVE_CCK slightly less error prone by always writing the _flag
  value used later by RESTORE_CCK
o swap arg order in RESTORE_CCK to slightly reduce cost

15 years agorestore variable initialization removed in r187831; this broke
Sam Leffler [Mon, 2 Feb 2009 16:55:57 +0000 (16:55 +0000)]
restore variable initialization removed in r187831; this broke
the horrible SAVE/RESTORE_CCK macros used by swan/nala cards to
implement 11b using 11g

15 years agoSince, rc.d/defaultroute has the ability to wait for a
Mike Makonnen [Mon, 2 Feb 2009 15:38:24 +0000 (15:38 +0000)]
Since, rc.d/defaultroute has the ability to wait for a
default route to show up we can turn this knob back on
without screwing subsequent daemons that expect to be
able to talk to the outside world.

15 years agoThe 30 second wait for network interfaces to show up effectively makes the
Mike Makonnen [Mon, 2 Feb 2009 15:33:22 +0000 (15:33 +0000)]
The 30 second wait for network interfaces to show up effectively makes the
time to boot an unplugged system 30 sec. longer for no good reason. Therefore,
add a check to make sure that any DHCP interfaces are plugged in before
waiting.

15 years agoThe last sector in the first segment might just be a sync, increment before
Poul-Henning Kamp [Mon, 2 Feb 2009 14:30:07 +0000 (14:30 +0000)]
The last sector in the first segment might just be a sync, increment before
checking validity of segment two.

15 years agoDon't overwrite it, if only one sector is written yet.
Poul-Henning Kamp [Mon, 2 Feb 2009 14:29:15 +0000 (14:29 +0000)]
Don't overwrite it, if only one sector is written yet.

Discovered by: "Dewayne Geraghty" <dewayne.geraghty@heuristicsystems.com.au>

15 years agoAlow dirname(1) to accept multiple arguments in the same way that
Robert Watson [Mon, 2 Feb 2009 11:19:56 +0000 (11:19 +0000)]
Alow dirname(1) to accept multiple arguments in the same way that
basename(1) does.

(Two different PRs contained identical patches, both cited below)

PR: 121520, 86148
Submitted by: Ighighi <ighighi at gmail dot com>
Submitted by: Leif Neland <leif at neland dot dk>
MFC after: 3 days

15 years agoExplain that we assume AF_INET and only use the addr and port field
Luigi Rizzo [Mon, 2 Feb 2009 11:02:19 +0000 (11:02 +0000)]
Explain that we assume AF_INET and only use the addr and port field
from a struct sockaddr_in, so there is no need to initialize sin_len

15 years agoremove duplicate #include
Luigi Rizzo [Mon, 2 Feb 2009 10:58:05 +0000 (10:58 +0000)]
remove duplicate #include

15 years agoRemove duplicate OPTFLAGS definition.
Max Khon [Mon, 2 Feb 2009 06:25:57 +0000 (06:25 +0000)]
Remove duplicate OPTFLAGS definition.

15 years agoFix select on platforms where sizeof(long) != sizeof(int). This used
Stephane E. Potvin [Mon, 2 Feb 2009 03:34:40 +0000 (03:34 +0000)]
Fix select on platforms where sizeof(long) != sizeof(int). This used
to work by accident before the cleanup done in revision 187693.

Approved by: kan (mentor)

15 years agoSort the options, per style(9).
Warner Losh [Mon, 2 Feb 2009 02:05:58 +0000 (02:05 +0000)]
Sort the options, per style(9).

Reviewed by: obrien@

15 years agosrc/usr.bin/usbhidaction/usbhidaction.c
Alfred Perlstein [Mon, 2 Feb 2009 00:49:39 +0000 (00:49 +0000)]
src/usr.bin/usbhidaction/usbhidaction.c
src/usr.bin/usbhidctl/usbhid.c
src/sys/dev/usb2/include/usb2_hid.h
src/sys/dev/usb2/input/uhid2.c
src/lib/libusbhid/Makefile
src/lib/libusbhid/descr.c
src/lib/libusbhid/descr_compat.c
src/lib/libusbhid/usbhid.3
src/lib/libusbhid/usbhid.h
src/lib/libusbhid/usbvar.h

Patches to make libusbhid and HID userland utilities compatible with
the new USB stack. All HID ioctls should go through the libusbhid
library to ensure compatibility. I have found at least one piece of
software in /usr/ports which needs to get updated before USB HID
devices will work. This is the X joystick input driver.

Reported and tested by:

Daichi GOTO and Masanori OZAWA.

src/sys/dev/usb2/core/usb2_process.c

Correct USB process names.

Reported by:

Andre Guibert de Bruet

src/sys/dev/usb2/serial/uftdi2.c

Integrate changes from old USB stack.

Submitted by: hps

15 years agoSome updates and bug squashing in the firewire stack.
Sean Bruno [Sun, 1 Feb 2009 23:28:52 +0000 (23:28 +0000)]
Some updates and bug squashing in the firewire stack.

Move the interupt handler to a driver_intr_t type function as it was trying
to do way to much for a lightweight filter interrupt function.

Introduce much more locking around fc->mtx.  Tested this for lock reversals
and other such lockups.  Locking seems to be working better, but there
is much more to do with regard to locking.  The most significant lock is
in the BUS RESET handler.  It was possible, before this checkin, to set
a bus reset via "fwcontrol -r" and have the BUS RESET handler fire before
the code responsible for asserting BUS RESET was complete.  This locking
fixes that issue.

Move some of the memory allocations in the fc struct to the attach function
in firewire.c

Rework the businfo.generation indicator to be merely a on/off bit now.
It's purpose according to spec is to notify the bus that the config ROM
has changed.  That's it.

Catch and squash a possible panic in SBP where in the SBP_LOCK was held
during a possible error case.  The error handling code would definitely
panic as it would try to acquire the SBP_LOCK on entrance.

Catch and squash a camcontrol/device lockup when firewire drives go away.
When a firewire device was powered off or disconnected from the firewire
bus, a "camcontrol rescan all" would hang trying to poll removed devices
as they were not properly detached.  Don't do that.

Approved by: scottl
MFC after: 2 weeks

15 years agowhen promoting an 11b channel to 11g do not accept a ``pure G'' (OFDM only)
Sam Leffler [Sun, 1 Feb 2009 22:24:08 +0000 (22:24 +0000)]
when promoting an 11b channel to 11g do not accept a ``pure G'' (OFDM only)
channel, only accept a real 11g channel; this fixes a problem where we were
wrongly promoting 11b to a Dynamic Turbo G channel which broke scanning on
channel 6

15 years agoRemove the single global unlocked route cache ip6_forward_rt
Bjoern A. Zeeb [Sun, 1 Feb 2009 21:11:08 +0000 (21:11 +0000)]
Remove the single global unlocked route cache ip6_forward_rt
from the inet6 stack along with statistics and make sure we
properly free the rt in all cases.

While the current situation is not better performance wise it
prevents panics seen more often these days.
After more inet6 and ipsec cleanup we should be able to improve
the situation again passing the rt to ip6_forward directly.

Leave the ip6_forward_rt entry in struct vinet6 but mark it
for removal.

PR: kern/128247, kern/131038
MFC after: 25 days
Committed from: Bugathon #6
Tested by: Denis Ahrens <denis@h3q.com> (different initial version)

15 years agoput the altq-related functions into a separate file.
Luigi Rizzo [Sun, 1 Feb 2009 16:00:49 +0000 (16:00 +0000)]
put the altq-related functions into a separate file.
Minor cleanup of the includes used by the various source files,
including annotations of why certain headers are used.

15 years agoBefore this fix, pax would stop the restore sequence for
Tim Kientzle [Sun, 1 Feb 2009 06:15:46 +0000 (06:15 +0000)]
Before this fix, pax would stop the restore sequence for
symlinks after setting the owner.  As a result, mode
and timestamp were not restored.  This patch corrects the
problem by simply removing the short-circuit for symlinks
and using lchown()/lchmod()/lutimes() always for restoring
metadata.

PR: bin/91316
Submitted by: Jaakko Heinonen
Reviewed by: Joerg Sonnenberger
MFC after: 14 days

15 years agoPermit ` as a pad character in the filename table.
Tim Kientzle [Sun, 1 Feb 2009 02:33:02 +0000 (02:33 +0000)]
Permit ` as a pad character in the filename table.
This seems to fix the devel/zziplib port, which distributes
its man pages in an ar archive.

15 years agoConstify val in g_handleattr() and str in g_handleattr_str().
Marcel Moolenaar [Sun, 1 Feb 2009 01:50:09 +0000 (01:50 +0000)]
Constify val in g_handleattr() and str in g_handleattr_str().
This allows passing string constants to g_handleattr_str().

15 years agoRevert part of r187970, the NULL check was removed from
Andrew Thompson [Sun, 1 Feb 2009 01:07:15 +0000 (01:07 +0000)]
Revert part of r187970, the NULL check was removed from
udbp_bulk_read_complete() as well as udbp_attach.

15 years agoRemove check for null softc in attach, it can never happen.
Andrew Thompson [Sun, 1 Feb 2009 00:51:25 +0000 (00:51 +0000)]
Remove check for null softc in attach, it can never happen.

15 years agoAlso un-split _PATH_STDPATH for grepability.
David E. O'Brien [Sun, 1 Feb 2009 00:50:46 +0000 (00:50 +0000)]
Also un-split _PATH_STDPATH for grepability.
While I'm here, fix other style bugs reported to me.

15 years agoDavid doesn't consider the prior -s behavior a bug. Back out this
Warner Losh [Sat, 31 Jan 2009 23:17:33 +0000 (23:17 +0000)]
David doesn't consider the prior -s behavior a bug.  Back out this
change.

15 years agoBring over the code from sys/i386/i386/mp_machdep.c, r187880
Bjoern A. Zeeb [Sat, 31 Jan 2009 21:40:27 +0000 (21:40 +0000)]
Bring over the code from sys/i386/i386/mp_machdep.c, r187880
to make XEN config compile again:
- Allocate apic vectors on a per-cpu basis.

15 years agoFix the inconsistent tabbing.
David E. O'Brien [Sat, 31 Jan 2009 20:46:01 +0000 (20:46 +0000)]
Fix the inconsistent tabbing.

Noticed by: bde

15 years agoTest wprintf() in addition to printf().
David Schultz [Sat, 31 Jan 2009 18:32:39 +0000 (18:32 +0000)]
Test wprintf() in addition to printf().

15 years agoAdd tests for conj{,f,l}() that I wrote some time ago. These test the
David Schultz [Sat, 31 Jan 2009 18:31:57 +0000 (18:31 +0000)]
Add tests for conj{,f,l}() that I wrote some time ago. These test the
versions in libm, not the gcc builtins.

15 years agoAdd a function attribute called `__malloc_like', which informs gcc
David Schultz [Sat, 31 Jan 2009 18:27:02 +0000 (18:27 +0000)]
Add a function attribute called `__malloc_like', which informs gcc
that the annotated function returns a pointer that doesn't alias any
extant pointer. This results in a 50%+ speedup in microbenchmarks such
as the following:

    char *cp = malloc(1), *buf = malloc(BUF);
    for (i = 0; i < BUF; i++) buf[i] = *cp;

In real programs, your mileage will vary. Note that gcc already
performs this optimization automatically for any function called
`malloc', `calloc', `strdup', or `strndup' unless -fno-builtins is
used.

15 years agoAfter r186194 the *fs_strategy() functions always return 0.
Bjoern A. Zeeb [Sat, 31 Jan 2009 18:06:34 +0000 (18:06 +0000)]
After r186194 the *fs_strategy() functions always return 0.
So we are no longer interested in the error returned from
the *fs_doio() functions. With that we can remove the
error variable as its value is unused now.

Submitted by: Christoph Mallon christoph.mallon@gmx.de

15 years agoRemove unused local variables.
Bjoern A. Zeeb [Sat, 31 Jan 2009 17:36:22 +0000 (17:36 +0000)]
Remove unused local variables.

Submitted by: Christoph Mallon christoph.mallon@gmx.de
Reviewed by: kib
MFC after: 2 weeks

15 years agoRemove unused local MACROs.
Bjoern A. Zeeb [Sat, 31 Jan 2009 17:35:44 +0000 (17:35 +0000)]
Remove unused local MACROs.

Submitted by: Christoph Mallon christoph.mallon@gmx.de
MFC after: 2 weeks

15 years agoThere is no need to initialize the variable here.
Bjoern A. Zeeb [Sat, 31 Jan 2009 17:34:55 +0000 (17:34 +0000)]
There is no need to initialize the variable here.

Submitted by: Christoph Mallon christoph.mallon@gmx.de
Reviewed by: kib (as part of a larger patch)
MFC after: 2 weeks

15 years agoRemove and unused variable.
Bjoern A. Zeeb [Sat, 31 Jan 2009 13:48:15 +0000 (13:48 +0000)]
Remove and unused variable.

Submitted by: Christoph Mallon christoph.mallon@gmx.de
MFC after: 2 weeks

15 years agoCoalesce two consecutive #ifdef IPSEC blocks.
Bjoern A. Zeeb [Sat, 31 Jan 2009 12:24:53 +0000 (12:24 +0000)]
Coalesce two consecutive #ifdef IPSEC blocks.
Move the skip_ipsec: label below the goto as we can never have
ipsecrt set if we get to that label so there is no need to check.

MFC after: 2 weeks

15 years agoChange some movl's to mov's. Newer GAS no longer accept 'movl' instructions
David E. O'Brien [Sat, 31 Jan 2009 11:37:21 +0000 (11:37 +0000)]
Change some movl's to mov's.  Newer GAS no longer accept 'movl' instructions
for moving between a segment register and a 32-bit memory location.

Looked at by: jhb

15 years agoRemove dead code from #if 0:
Bjoern A. Zeeb [Sat, 31 Jan 2009 11:19:20 +0000 (11:19 +0000)]
Remove dead code from #if 0:
we do not have an ipsrcchk_rt anywhere else.

MFC after: 2 weeks

15 years agoLike with r185713 make sure to not leak a lock as rtalloc1(9) returns
Bjoern A. Zeeb [Sat, 31 Jan 2009 10:48:02 +0000 (10:48 +0000)]
Like with r185713 make sure to not leak a lock as rtalloc1(9) returns
a locked route. Thus we have to use RTFREE_LOCKED(9) to get it unlocked
and rtfree(9)d rather than just rtfree(9)d.

Since the PR was filed, new places with the same problem were added
with new code.  Also check that the rt is valid before freeing it
either way there.

PR: kern/129793
Submitted by: Dheeraj Reddy <dheeraj@ece.gatech.edu>
MFC after: 2 weeks
Committed from: Bugathon #6

15 years agoFix a typo in a comment.
Tom Rhodes [Sat, 31 Jan 2009 10:04:36 +0000 (10:04 +0000)]
Fix a typo in a comment.

15 years agoFix bug in hint.hdac.X.config parsing.
Alexander Motin [Sat, 31 Jan 2009 08:24:09 +0000 (08:24 +0000)]
Fix bug in hint.hdac.X.config parsing.