Commit Graph

66067 Commits

Author SHA1 Message Date
rwatson
5873924368 Add a new DDB(4) facility, output capture. Input and output from DDB may be
captured to a memory buffer for later inspection using sysctl(8), or in the
future, to a textdump.

A new DDB command, "capture", is added, which accepts arguments "on", "off",
"reset", and "status".

A new DDB sysctl tree, debug.ddb.capture, is added, which can be used to
resize the capture buffer and extract buffer contents.

MFC after:	3 months
2007-12-25 23:06:51 +00:00
wkoszek
6bd00b2689 "vt" doesn't refer to any existing device anymore. Remove it.
Reviewed by:	cognet@ (mentor)
Approved by:	cognet@ (mentor)
2007-12-25 22:41:29 +00:00
wkoszek
2179e058f4 Rewrite kern.console handling in sbuf(9). My intention is to leave
kern.console format as is. Thus, no difference in output format should
appear after this commit.

Reviewed by:	cognet@ (mentor)
Approved by:	cognet@ (mentor)
2007-12-25 21:17:34 +00:00
remko
b1660070ea Add support for the BMC5722.
Reported by:		Chris Shenton <chris at shenton dot org> on current@
Approved by:		imp (mentor)
2007-12-25 19:51:18 +00:00
rwatson
bc4dd8b5c3 Bump __FreeBSD_version to 800007 to reflect kdb_enter change. 2007-12-25 18:40:05 +00:00
rwatson
5b880a7239 Add a new kernel startup event for DDB services, which will include DDB
output capture, scripting, and textdumps.
2007-12-25 18:36:43 +00:00
rwatson
82468f22a1 Add a new privilage category for DDB(4), and add PRIV_DDB_CAPTURE to
control access to the DDB capture buffer.
2007-12-25 18:36:12 +00:00
rwatson
bdee30611d Add a new 'why' argument to kdb_enter(), and a set of constants to use
for that argument.  This will allow DDB to detect the broad category of
reason why the debugger has been entered, which it can use for the
purposes of deciding which DDB script to run.

Assign approximate why values to all current consumers of the
kdb_enter() interface.
2007-12-25 17:52:02 +00:00
wkoszek
98e71c2ed5 Rename "mbuf_jumbo_pagesize" to "mbuf_jumbo_page". It makes it aligned correctly
within ddb(4) and in the vmstat(8) output.

This change requires netstat(8) to be recompiled.

Reviewed by:	rwatson@
  Tested by:	make LINT
2007-12-25 14:17:16 +00:00
rwatson
940f7f2284 Use __FBSDID() in the kernel BPF implementation.
MFC after:	3 days
2007-12-25 13:24:02 +00:00
wkoszek
a8e6c33502 Change "audit_pipe_preselect" to "audit_pipe_presel" to make it print
with proper alignment in ddb(4) and vmstat(8).

Reviewed by:	rwatson@
2007-12-25 13:23:19 +00:00
oleg
596323ba22 Workaround p->numbytes overflow, which can result in infinite loop inside
dummynet module (prerequisite is using queues with "fat" pipe).

PR:		kern/113548
2007-12-25 09:36:51 +00:00
ume
372f968dbe Add sysctl mibs for _TSP, _TC1 and _TC2 which is user overridable
but is blocked on user_override mib.
Not a few people want to use a passive cooling without their ACPI
BIOS support.

Reviewed by:	njl
2007-12-24 16:32:14 +00:00
kib
6d2bfd1ec9 Move the check for the snp device being already attached after the
fget() call, that is sleeping point, and possibly dropping Giant.

The snp_target == NULL implies the snp_tty == NULL. Remove the code
that is put under snp_target == NULL and snp_tty != NULL clause.

In snpclose(), do the snp_detach() before scheduling the snp device
destruction. Otherwise, after the return from snpclose(), the snp
device is already removed from the snp_list, but tty is still in
snooped state. Any attempt to do i/o on such tty cause panic because
ttytosnp() returns NULL.

Tested by:	Peter Holm
MFC after:	1 week
2007-12-24 13:47:16 +00:00
marcel
5817fa6edc Various fixes:
o  BSD disklabels have relative offsets. Even for the BSD in MBR slice
   setup, except when the mbroffset ioctl is supported. Since we don't
   support that ioctl, bsdlabel(8) expects relative offsets. So, when
   reading an existing disklabel, correct for disklabels that mistakenly
   have the mbroffset offsets.
o  Don't take the geometry seriously, because it's untrustworthy. We do
   expect the numbers to be within range. This means that the secperunit
   field will not be computed from secpercyl and ncyls, but simply is
   the mediasize in sectors.
o  Don't enforce partitions to be aligned to track boundaries. The
   default label, constructed by bsdlabel(8), puts partition a at offset
   BBSIZE bytes, which commonly means sector 16.
2007-12-24 01:01:59 +00:00
stas
cf2788b769 - Fix a typo in comments.
MFC after:	1 week
Approved by:	cognet
2007-12-23 23:31:27 +00:00
ticso
2d76c8dccf - remove code from oroginal file, which is not required on BWCT boards
- Be more chatty on startup, since we have enough code space on
  AT91RM9200
- init DS1672 charging
- init USART GPIO
2007-12-23 14:57:35 +00:00
ticso
be62f6be4e BWCT boards uses two different SPI flash chips
check for both status codes
2007-12-23 14:46:30 +00:00
rwatson
d2a56e1c39 Remove trailing whitespace from lines in BPF.
MFC after:	3 days
2007-12-23 14:10:33 +00:00
rwatson
f558a6bfd8 When IPSEC fails to allocate policy state for an inpcb, and MAC is in use,
free the MAC label on the inpcb before freeing the inpcb.

MFC after:	3 days
Submitted by:	tanyong <tanyong at ercist dot iscas dot ac dot cn>,
		zhouzhouyi
2007-12-22 10:06:11 +00:00
julian
265714a11e give thread0 the tid 100000 and bumpt the others to start at 100001
MFC after:	1 week
2007-12-22 04:56:48 +00:00
wkoszek
7d4fbe3a46 Make SCHED_ULE buildable with gcc3.
Reviewed by:	cognet (mentor), jeffr
Approved by:	cognet (mentor), jeffr
2007-12-21 23:30:18 +00:00
jhb
ca17618420 More properly handle links who only have 1 valid IRQ in their bitmask. The
old code special cased them too early which caused a few differences for
these sort of links relative to other PCI links:

- They were always re-routed via the BIOS call instead of assuming that
  they were already routed if the BIOS had programmed the IRQ into a
  matching device during POST.
- If the BIOS did route that link to a different IRQ that was marked as
  invalid, we trusted the $PIR table rather than the BIOS IRQ.

This change moves the special casing for "unique IRQ" links to only take
that into account when picking an IRQ for an unrouted link so that these
links will now not be routed if the BIOS appears to have routed it already
(some BIOSen have problems with that) and so that if the BIOS uses a
different IRQ than the $PIR, we trust the BIOS routing instead (this is
what we do for all other links as well).

Reported by:	Bruce Walter  walter of fortean com
MFC after:	1 week
2007-12-21 16:53:27 +00:00
alc
c6d4b1ee92 Update the comment describing vm_phys_unfree_page(). 2007-12-21 02:44:31 +00:00
marcel
ad8ce572c1 Apply missing s/rv/res/g in previous commit. 2007-12-21 00:23:23 +00:00
alc
4518d14d23 Modify vm_phys_unfree_page() so that it no longer requires the given
page to be in the free lists.  Instead, it now returns TRUE if it
removed the page from the free lists and FALSE if the page was not
in the free lists.

This change is required to support superpage reservations.  Specifically,
once reservations are introduced, a cached page can either be in the
free lists or a reservation.
2007-12-20 22:45:54 +00:00
jhb
de6536e34d MFamd64/ia64/i386: Only set the rman bus tags and handles in
bus_activate_resource() methods instead of splitting it up between
bus_alloc_resource() and bus_activate_resource().

Glanced at by:	marcel
2007-12-20 21:42:43 +00:00
emaste
3dd5f00397 Avoid holding the aac_io_lock over copyout.
Submitted by: Achim Leubner @ Adaptec.
2007-12-20 21:13:58 +00:00
yongari
4717ca2cc6 By definition promiscuous mode should see all unicast frames as well
as multicast/broadcast frames. Previously re(4) ignored multicast
frames in promiscuous mode. The RTL8169 datasheet was not clear
how it handles multicast frames in promiscuous mode.

PR:	kern/118572
MFC after:	3 days
2007-12-20 07:26:20 +00:00
marius
2b9c38a67a In openprom_ioctl() ensure appropriate permissions and that data isn't
NULL and doesn't point to a NULL pointer before dereferencing it. This
fixes a panic triggered by Xorg 7.3.

Reported and tested by:	Bill Green
MFC after:		3 days
2007-12-20 00:31:04 +00:00
alc
af99f17cda Correct one half of a loop continuation condition in vm_phys_unfree_page().
At present, this error is inconsequential; the other half of the loop
continuation condition is sufficient to achieve correct execution.
2007-12-19 23:09:45 +00:00
mav
f381ac2711 Add option to set packets per second limits instead of default
bits per second ones.
2007-12-19 22:50:14 +00:00
imp
46b79678a8 When devclass_get_maxunit is passed a NULL, return -1 to indicate that
there's nothing allocated at all yet.
2007-12-19 22:05:07 +00:00
marcel
c932130a31 Redefine bus_space_tag_t on PowerPC from a 32-bit integral to
a pointer to struct bus_space. The structure contains function
pointers that do the actual bus space access.

The reason for this change is that previously all bus space
accesses were little endian (i.e. had an explicit byte-swap
for multi-byte accesses), because all busses on Macs are little
endian.
The upcoming support for Book E, and in particular the E500
core, requires support for big-endian busses because all
embedded peripherals are in the native byte-order.

With this change, there's no distinction between I/O port
space and memory mapped I/O. PowerPC doesn't have I/O port
space. Busses assign tags based on the byte-order only.
For that purpose, two global structures exist (bs_be_tag and
bs_le_tag), of which the address can be taken to get a valid
tag.

Obtained from: Juniper, Semihalf
2007-12-19 18:00:50 +00:00
imp
93ea7f3594 Actually program the interrupt controller for priorities. As we
support more AT91 platforms, we'll need to move this into some
platform init routine.
2007-12-19 17:34:17 +00:00
ambrisko
c805d7131a Add Dell's sub-vendor id to identify PERC6 RAID controller which has LSI
vendor id's.
2007-12-19 17:23:47 +00:00
ambrisko
a41ac17851 I incorrectly assumed the log buffer started from the beginning when it
is actually a circular log.  Deal with it rolling around.  Fortunately,
the log area is big and I haven't seen any roll over yet.  Update and
get rid of the obsolete comment.
2007-12-19 17:22:07 +00:00
ambrisko
edee84f0a7 Allow negative values to be specified in the loader. 2007-12-19 17:06:32 +00:00
ru
82b21d0858 Fix bugs in the TCP syncache timeout code. including:
When system ticks are positive, for entries in the cache
bucket, syncache_timer() ran on every tick (doing nothing
useful) instead of the supposed 3, 6, 12, and 24 seconds
later (when it's time to retransmit SYN,ACK).

When ticks are negative, syncache_timer() was scheduled
for the too far future (up to ~25 days on systems with
HZ=1000), no SYN,ACK retransmits were attempted at all,
and syncache entries added in that period that correspond
to non-established connections stay there forever.

Only HEAD and RELENG_7 are affected.

Reviewed by:	silby, kmacy (earlier version)
Submitted by:	Maxim Dounin, ru
2007-12-19 16:56:28 +00:00
emaste
a9a3bcada9 Do not recursively acquire aac_io_lock in aac_ioctl_event.
MFC After: 3 days
2007-12-19 14:33:40 +00:00
alc
3c2abd13fb Eliminate redundant code from vm_page_startup(). 2007-12-19 05:47:50 +00:00
kmacy
fad994205a Remove extraneous debug statements.
Noticed by: Andrey Chernov
2007-12-19 05:17:40 +00:00
kmacy
17d5d1f3fc Don't overload tcp_usrreqs unless the kernel doesn't provide offload support. 2007-12-18 23:00:25 +00:00
kmacy
7a03620a3b Incorporate TCP offload hooks in to core TCP code.
- Rename output routines tcp_gen_* -> tcp_output_*.
  - Rename notification routines that turn in to no-ops in the absence of TOE
    from tcp_gen_* -> tcp_offload_*.
  - Fix some minor comment nits.
  - Add a /* FALLTHROUGH */

Reviewed by: Sam Leffler, Robert Watson, and Mike Silbersack
2007-12-18 22:59:07 +00:00
obrien
ee337f2c34 Be more exact with sigaction SA_SIGINFO handling.
Reviewed by:	marcel
2007-12-18 20:39:13 +00:00
thompsa
dbcd24960c Simplify the error handling and use the dereferenced sc->sc_ifp pointer. 2007-12-18 09:13:04 +00:00
thompsa
c0871871de When the bridge has an address and a packet comes in for it then drop it if the
link has been marked discarding by Spanning Tree. This would cause the bridge
to see duplicate packets to itself even if STP has correctly calculated the
topology and blocked redundant links.

Reported by:	trasz
Tested by:	trasz
MFC after:	3 days
2007-12-18 07:04:50 +00:00
thompsa
3b94f3069c - Use the macro to check the port status has it will also test if its
administratively down (!IFF_UP)
 - Use the same parameters to lagg_link_active() to get the backup port as in
   the output path, this didnt actually matter in practice as sc_primary is
   always the first on the port list.

MFC after:	3 days
2007-12-18 02:12:03 +00:00
rrs
285c9ed214 - sctp-iterator should run at PI_NET priority ...not 0.
MFC after:	1 week
2007-12-18 01:24:15 +00:00
kmacy
9fc024313f only include intr_machdep.h when it is needed for intr_bind
ia64 doesn't have an intr_machdep.h
2007-12-17 23:39:28 +00:00
marcel
d7ca70a3f7 Remove file after being repocopied to ../ofw, where it lives on.
Repocopy by: simon@
2007-12-17 22:50:39 +00:00
marcel
91afcd2b37 Build the OFW loader from its new location after the sources
were repocopied from ./loader to ./ofw.
2007-12-17 22:19:44 +00:00
thompsa
1321a9c9d1 Add myself to the copyright. 2007-12-17 18:49:44 +00:00
rwatson
658a0a8d45 Fix a MAC label leak for POSIX semaphores, in which per-policy labels
would be properly disposed of, but the global label structure for the
semaphore wouldn't be freed.

MFC after:	3 days
Reported by:	tanyong <tanyong at ercist dot iscas dot ac dot cn>,
		zhouzhouyi
2007-12-17 17:26:32 +00:00
rwatson
4a0d85f1d4 Fix leaking MAC labels for IPv6 inpcbs by adding missing MAC label
destroy call; this transpired because the inpcb alloc path for IPv4/IPv6
is the same code, but IPv6 has a separate free path.  The results was
that as new IPv6 TCP connections were created, kernel memory would
gradually leak.

MFC after:	3 days
Reported by:	tanyong <tanyong at ercist dot iscas dot ac dot cn>,
		zhouzhouyi
2007-12-17 17:20:57 +00:00
kmacy
f0dbf05ef2 disable update in place on transmit 2007-12-17 10:02:29 +00:00
kmacy
41d59439f8 Add SB_NOCOALESCE flag to disable socket buffer update in place 2007-12-17 10:02:01 +00:00
kmacy
a541ef6e7d Make TCP offload work on HEAD (modulo negative interaction between sbcompress
and t3_push_frames).
 - Import latest changes to cxgb_main.c and cxgb_sge.c from toestack p4 branch
 - make driver local copy of tcp_subr.c and tcp_usrreq.c and override tcp_usrreqs so
   TOE can also functions on versions with unmodified TCP

- add cxgb back to the build
2007-12-17 08:17:51 +00:00
davidxu
496a3a2c52 Check NULL pointer. 2007-12-17 08:09:37 +00:00
kmacy
6742ef6138 build tcp_offload.c instead of tcp_ofld.c 2007-12-17 08:00:08 +00:00
kmacy
b45a98500c incorporate feedback since initial commit
- rename tcp_ofld.[ch] to tcp_offload.[ch]
- document usage and locking conventions of the functions in the
  toe_usrreqs function vector
- document tcpcb, inpcb, and socket fields used by toe
- widen the listen interface into 2 functions
- rename DISABLE_TCP_OFFLOAD to TCP_OFFLOAD_DISABLE
- shrink conditional compilation to reduce the likelihood of bitrot
- replace sc->sc_toepcb checks in tcp_syncache.c with TOEPCB_ISSET
2007-12-17 07:56:27 +00:00
kmacy
5d9e84762f widen the routing event interface (arp update, redirect, and eventually pmtu change)
into separate functions

revert previous commit's changes to arpresolve and add a new interface
arpresolve2 which does arp resolution without an mbuf
2007-12-17 07:40:34 +00:00
davidxu
747bbe486b Add missing changes for fixing LOR of umtx lock and thread lock, follow
the committing of files:
	kern_resource.c revision 1.181
	sched_4bsd.c	revision 1.111
	sched_ule.c	revision 1.218
2007-12-17 05:55:07 +00:00
kevlo
f3f1d0b3a5 Use M_NOWAIT instead of M_WAITOK to cause malloc() to return NULL
Reviewed by: imp
2007-12-17 05:08:54 +00:00
kmacy
139d7c3fb1 Don't panic in arpresolve if we're given a null mbuf. We could
insist that the caller just pass in an initialized mbuf even
if didn't have any data - but that seems rather contrived.
2007-12-17 04:19:25 +00:00
kmacy
ab4dffd44a Include cdefs.h and param.h for architectures with less header pollution 2007-12-16 21:22:24 +00:00
phk
d97768bb7c Add the magic word 0 value for CFA compliant devices. 2007-12-16 21:18:13 +00:00
rpaulo
b3d67d43ff Fix previous commit. The code ended up in the wrong function.
Approved by:	     njl (mentor)
2007-12-16 20:37:27 +00:00
phk
f0debf860a Chop DIOCGDELETE from userland up in 1024 sector chunks to give geom_disk
or any other bio chopping geom a reasonable size of work.

Check for delivered signals between chunks, because the request size
and service time is unbounded.
2007-12-16 19:38:26 +00:00
kmacy
707b3f65a7 Add back in cxgb now that the includes are believed to be fixed 2007-12-16 18:45:23 +00:00
kmacy
9bec876a09 Use the vm include convention of busdma 2007-12-16 18:43:57 +00:00
kmacy
74fb05ec40 need M_IOVEC define 2007-12-16 18:36:57 +00:00
kmacy
da6c45e051 Don't globally include mvec.h its only needed by cxgb_sge.c 2007-12-16 18:26:04 +00:00
phk
e8d782d36d Don't limit BIO_DELETE requests to MAXPHYS, they perform no data
transfers, so they are not subject to the VM system limitation.
2007-12-16 18:03:31 +00:00
kmacy
fa3f9f75ec Remove cxgb module from build until I can compensate for the lack of header
pollution on architectures other than amd64
2007-12-16 17:43:40 +00:00
stas
10ac9b50a2 - Don't return 0xffff if PHY id isn't equal 0. This allows PHYs with
non-zero addresses to be used.

Approved by:	cognet
MFC after:	2 weeks
2007-12-16 12:57:12 +00:00
stas
beccb3754c - Add quirk for the TrendNet TU-S9 adapter, which uses new version of PL2303
chip (revision 0x400). This allows it to be correctly identified as PL2303X.

Approved by:	maxim
MFC after:	1 week
2007-12-16 12:39:50 +00:00
scottl
9d644f65df Add a missing mutex unlock.
Reported by: Michael Jung
2007-12-16 07:49:44 +00:00
kmacy
ee178ec997 turn off building of cxgb properly ... sigh 2007-12-16 07:44:08 +00:00
kmacy
e4b7a1f0cc Don't use old-style mbuf iovecs 2007-12-16 07:41:57 +00:00
kmacy
fe47295d85 Update tod_connect call to reflect updated interface 2007-12-16 07:37:48 +00:00
kmacy
f6dbdffb16 disable cxgb build to prevent tinderbox whining 2007-12-16 07:36:35 +00:00
kmacy
60377b3fbd Move arp update upcall to always be called for ARP replies - previous invocation
would not always get called at the appropriate times
2007-12-16 06:42:33 +00:00
jeff
4ec9caf00c Refactor select to reduce contention and hide internal implementation
details from consumers.

 - Track individual selecters on a per-descriptor basis such that there
   are no longer collisions and after sleeping for events only those
   descriptors which triggered events must be rescaned.
 - Protect the selinfo (per descriptor) structure with a mtx pool mutex.
   mtx pool mutexes were chosen to preserve api compatibility with
   existing code which does nothing but bzero() to setup selinfo
   structures.
 - Use a per-thread wait channel rather than a global wait channel.
 - Hide select implementation details in a seltd structure which is
   opaque to the rest of the kernel.
 - Provide a 'selsocket' interface for those kernel consumers who wish to
   select on a socket when they have no fd so they no longer have to
   be aware of select implementation details.

Tested by:	kris
Reviewed on:	arch
2007-12-16 06:21:20 +00:00
jeff
436e8270eb - Don't depend on header pollution to declare struct thread. 2007-12-16 06:12:53 +00:00
kmacy
7ac7bd84d8 Fix tinderbox on sun4v
include cpufunc.h so that nanoseconds(void) is defined
2007-12-16 06:07:34 +00:00
kmacy
d9e4e752a4 Makefile for the TCP offload module 2007-12-16 05:40:18 +00:00
kmacy
ae8220ee1b Don't use old style mbuf iovec interface 2007-12-16 05:34:18 +00:00
kmacy
4b1ded755c Update the toedev's connect interface to reflect the fact that the inpcb
doesn't cache the rtentry in HEAD.
2007-12-16 05:30:21 +00:00
kmacy
f96fe5e169 Add driver for TCP offload
Sponsored by: Chelsio Inc.
2007-12-16 05:27:26 +00:00
kmacy
f04336e4cb Update the buffer management support code needed by the tcp offload module 2007-12-16 05:19:48 +00:00
kmacy
8befa00c4d Sanitize of a routine that is going away 2007-12-16 05:14:25 +00:00
kmacy
ad0e83b9a6 overlead mbuf fields for use by toe 2007-12-16 05:11:42 +00:00
kmacy
020b8241bb Add system includes for mvec.h 2007-12-16 05:11:10 +00:00
kmacy
93f8e2674a Add socket option for setting and retrieving the congestion control algorithm.
The name used is to allow compatibility with Linux.
2007-12-16 03:30:07 +00:00
marcel
91f33512f8 Make files under src/sys/powerpc/aim, as well as Open Firmware related
files dependent upon option/cpu AIM. This is in preparation of adding
support for Book-E (e500) support.

Obtained from: Juniper, Semihalf
2007-12-16 01:02:47 +00:00
jeff
b87f315314 - Define lpohead even if userspace includes this file. 2007-12-16 00:52:32 +00:00
marcel
bdb53a4ffa Rename OEA to AIM. The former means nothing as it applies to all
processors (it's the PowerPC Operating Environment Architecture).
AIM designates the processors made by the Apple-IBM-Motorola
alliance and those we typically support.

While here, remove the NetBSD option IPKDB. It's not an option
used by us. Also, PPC_HAVE_FPU is not used by us either. Remove
that too.

Obtained from: Juniper, Semihalf
2007-12-16 00:45:56 +00:00
rrs
edce837b8c - fix tab to space issue, hmm maybe I should use vi. 2007-12-15 23:14:53 +00:00
jeff
12adc443d6 - Re-implement lock profiling in such a way that it no longer breaks
the ABI when enabled.  There is no longer an embedded lock_profile_object
   in each lock.  Instead a list of lock_profile_objects is kept per-thread
   for each lock it may own.  The cnt_hold statistic is now always 0 to
   facilitate this.
 - Support shared locking by tracking individual lock instances and
   statistics in the per-thread per-instance lock_profile_object.
 - Make the lock profiling hash table a per-cpu singly linked list with a
   per-cpu static lock_prof allocator.  This removes the need for an array
   of spinlocks and reduces cache contention between cores.
 - Use a seperate hash for spinlocks and other locks so that only a
   critical_enter() is required and not a spinlock_enter() to modify the
   per-cpu tables.
 - Count time spent spinning in the lock statistics.
 - Remove the LOCK_PROFILE_SHARED option as it is always supported now.
 - Specifically drop and release the scheduler locks in both schedulers
   since we track owners now.

In collaboration with:	Kip Macy
Sponsored by:	Nokia
2007-12-15 23:13:31 +00:00
kmacy
96bf4f5295 fix bonehead cut and paste error in last commit 2007-12-15 22:06:23 +00:00
kmacy
ebf6b543da Move NIC driver (cxgb) into its own directory. Add toecore to support
registering different TOMs.
2007-12-15 22:03:19 +00:00
kmacy
62acf9d037 Import updated support code for the TOM (tcp offload module). 2007-12-15 21:54:59 +00:00
kmacy
d568417c8a Create separate capability flags for TCP over IPv4 and TCP over IPv6 2007-12-15 21:01:48 +00:00
kmacy
755846c8cc add interface capability for TOE 2007-12-15 20:22:09 +00:00
kmacy
4925764ba9 make naming prefixes consistent across tom_info 2007-12-15 20:20:08 +00:00
kmacy
cfc088f4f3 add compile option to remove extra branch introduced by tcp offload support code 2007-12-15 19:53:35 +00:00
scottl
442c0b4cf6 Add the 'hptrr' driver for supporting the following Highpoint RocketRAID
cards:

     o   RocketRAID 172x series
     o   RocketRAID 174x series
     o   RocketRAID 2210
     o   RocketRAID 222x series
     o   RocketRAID 2240
     o   RocketRAID 230x series
     o   RocketRAID 231x series
     o   RocketRAID 232x series
     o   RocketRAID 2340
     o   RocketRAID 2522

Many thanks to Highpoint for their continued support of FreeBSD.

Submitted by: Highpoint
2007-12-15 00:56:17 +00:00
marcel
e6b7f7a385 Sort. 2007-12-14 23:47:39 +00:00
marcel
e1d637468a This file was repocopied to src/sys/powerpc/aim, where it will
live on -- an afterlife.
2007-12-14 23:03:48 +00:00
marcel
c8b672d408 Update file list after repocopying select files from
src/sys/powerpc/powerpc to src/sys/powerpc/aim.
2007-12-14 23:00:15 +00:00
marcel
98c080364c Forced commit to record that this file was repocopied from
src/sys/powerpc/powerpc and modified for its new location.
2007-12-14 22:39:35 +00:00
obrien
3da8d31817 Add comment to pc_cp_time. 2007-12-14 22:20:10 +00:00
obrien
56e498fb3b style.Makefile(5) 2007-12-14 21:30:51 +00:00
marcel
6d9ac95311 Remove unused file. 2007-12-14 19:59:53 +00:00
rwatson
13249770e7 Minor style consistency improvements. 2007-12-14 12:19:40 +00:00
ariff
76dde6b4fa Limit total hardware playback channels to just 1. The reliability of
it's multi DAC / playback channels is not that good. Enabling vchans
make the bug more visible since playback allocation will look for
possible free hardware channels first (i.e: the next DAC, the very first
has been consumed by vchan mixer) which in this case has been proven faulty.

Tested by:	Dominic Fandrey <LoN_Kamikaze at gmx dot de>
URL:		http://lists.freebsd.org/pipermail/freebsd-stable/2007-December/039022.html
2007-12-14 02:16:26 +00:00
ariff
ebfb37b283 Add speaker/headphone controls for HP Compaq DC7700 Small Form Factor PC
@ ALC262.

Submitted by:	Carlos A. M. dos Santos <unixmania at gmail dot com>
2007-12-13 15:48:45 +00:00
ariff
cb78c6c574 nid 28 for Acer @ ALC268 should be identified as analog CD input pin,
though it doesn't provides proper (sane, valid, usable, etc) analog CD
playback due to its stripped down nature.
2007-12-13 15:44:53 +00:00
sos
cd8dd509e5 Implement a workaround of the datacorruption problem on serverworks HT1000 chipsets.
The HT1000 DMA engine seems to not always like 64K transfers and sometimes barfs data all over memory leading to instant chrash and burn.
Also fix 48bit adressing issues, apparently newer chips needs 16bit writes and not the usual fifo thing.

HW donated by: Travis Mikalson at TerraNovaNet
2007-12-13 11:47:36 +00:00
kmacy
225412214c Fix error in previous commit - the style fix changed flag name without
changing references to the flag
2007-12-13 01:24:20 +00:00
sam
40492a0edf update channel flag defs to match _ieee80211.h so cpp doesn't complain
about redefinitions

MFC after:	1 week
2007-12-13 01:23:40 +00:00
kmacy
facc60167b Fix style issues with initial TCP offload commit
Requested by: rwatson
Submitted by: rwatson
2007-12-12 23:31:49 +00:00
kmacy
50706577a4 add interface for allowing consumers to register for ARP updates,
redirects, and path MTU changes

Reviewed by: silby
2007-12-12 20:53:25 +00:00
kmacy
dcdbd55c9a Add interface for tcp offload to syncache:
- make neccessary changes to release offload resources when a syncache
   entry is removed before connection establishment
 - disable checks for offloaded connection where insufficient information
   is available

Reviewed by: silby
2007-12-12 20:35:59 +00:00
rpaulo
59ef90c02d Disallow the legacy USB circuit to generate an SMI# via an ICH
register (MacBooks only).
This allows MacBooks to boot in SMP mode without any trick and solves
the timer problems with HZ=1000.

MFC after:	   1 week

Reviewed by:	   njl (mentor), jhb
Approved by:	   njl (mentor), jhb
2007-12-12 20:24:06 +00:00
kmacy
95a448c7cb Add driver independent interface to offload active established TCP connections
Reviewed by: silby
2007-12-12 20:21:39 +00:00
mav
a1921d35de Increase control channel xmit queue to 128 packets.
Previous value 16 was too small for real LAC as temporal activity
spike cound easily overflow queue demanding tunnel disconnection due
to possible state inconsistency.
2007-12-12 19:04:30 +00:00
ariff
6989ea14ce Disable AC97 microphone channel. Due to the channel allocation priority
that favours true hardware channel, the first instance of recording
request will grab this channel (the first channel is being used as
vchan master). In many cases, it is not really work as intended and give
false impression of broken recording.

PR:		kern/118546
MFC after:	3 days
2007-12-12 18:21:05 +00:00
kmacy
a571860f41 Remove spurious timestamp check. RFC 1323 explicitly states that timestamps MAY
be transmitted if negotiated.
2007-12-12 06:11:50 +00:00
scottl
08536bf155 Rewrite the DMA code paths from being an impenitrable maze of special cases
to a much saner and simplier unified code path.  Along the way, fix various
CAM nits and bugs so that the passthrough works correctly for all cases.
2007-12-12 05:55:03 +00:00
alc
5929e7ecb6 Simplify vm_page_free_toq(). 2007-12-11 21:20:34 +00:00
cognet
eb33bdbe0e There's no need to call pmap_vac_me_harder() in pmap_protect(), as it
already happened in pmap_modify_pv().

Submitted by:	Mark Tinguely <tinguely AT casselton DOT net>
2007-12-11 20:35:44 +00:00
markus
042cca2ff9 Fix calculation of descriptor tag checksums. According to ECMA-167, Part 4,
7.2.3, bytes 0-3 and 5-15 are used to calculate the checksum of a descriptor
tag.

PR:		kern/90521
Submitted by:	Björn König <bkoenig@cs.tu-berlin.de>
Reviewed by:	scottl
Approved by:	emax (mentor)
2007-12-11 19:49:40 +00:00
davidxu
3695a78889 Fix LOR of thread lock and umtx's priority propagation mutex due
to the reworking of scheduler lock.

MFC: after 3 days
2007-12-11 08:25:36 +00:00
davidxu
0a2e825ebb Add quirks for Netac Onlydisk 2000 USB disk. 2007-12-11 06:41:38 +00:00
jhb
95c5027710 Bah, remove last vestiges of some statfs conversion fixes that aren't quite
ready for CVS yet that snuck into 1.68.

Pointy hat to:	jhb
2007-12-10 19:42:23 +00:00
obrien
0d684d927b Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
sam
08954540f8 Wake On Lan (WOL) infrastructure
Submitted by:	Stefan Sperling <stsp@stsp.name>
Reviewed by:	brooks
2007-12-10 02:31:00 +00:00
marcel
2f8a94b8fe Decode as many or as few partition entries as the label claims there
are. We have already checked it against the caller provided maxpart.
2007-12-09 22:44:22 +00:00
marcel
3d56eaad5f Fix a bug in the add verb, where we failed to keep the list
of partitions in index-order. This is assumed by the APM, MBR
and BSD partitioning schemes.
2007-12-09 22:26:42 +00:00
alc
fed3c18cd6 Eliminate compilation warnings due to the use of non-static inlines
through the introduction and use of the __gnu89_inline attribute.

Submitted by: bde (i386)
MFC after: 3 days
2007-12-09 21:00:36 +00:00
thompsa
228f20a1fe Fix spelling.
Obtained from:	OpenBSD
2007-12-09 20:47:12 +00:00
thompsa
8b2f43475d sc->ndis_tq variable is only initialized when a driver module is for wireless
NICs.

PR:		kern/118439
Submitted by:	Weongyo Jeong
2007-12-09 20:14:01 +00:00
scottl
9a48b755d2 Fix an incorrect FreeBSD version test. 2007-12-09 19:24:27 +00:00
scottl
7f4a636cb7 Modify locking so that a single version of the driver src can be used on 6.x
and beyond.
2007-12-09 19:22:25 +00:00
rwatson
cce7cfdaf5 Check for P_WEXIT before PHOLD() on a process in kstack and vm query
sysctls, as PHOLD() asserts !P_WEXIT.

Reported by:	Michael Plass <mfp49_freebsd at plass-family dot net>
2007-12-09 17:22:27 +00:00
dwmalone
f0253dbb16 If we are walking the IPv6 header chain and we hit an IPPROTO_NONE
header, then don't try to pullup anything, because there is no next
header if we hit IPPROTO_NONE. Set ulp to a non-NULL value so the
search for an upper layer header terinates.

This is based on Pekka's diagnosis, but I chose a simpler fix.

PR:		115261
Submitted by:	Pekka Savola <pekkas@netcore.fi>
Reviewed by:	mlaier
MFC after:	2 weeks
2007-12-09 15:35:09 +00:00
marcel
534092d0a2 Internal partitions can not be deleted or modified. 2007-12-08 23:08:42 +00:00
marcel
fd024cb2be Skip internal partitions in the check for (user) partitions for
the destroy command. Previously a freshly created BSD disklabel
could not be destroyed because of the internal partition.
2007-12-08 22:06:17 +00:00
alc
785a20bb5f Use 1GB virtual pages to implement the direct map on architectures that
support this feature.

Wrap a nearby line that is too long.

MFC after: 6 weeks
2007-12-08 21:48:27 +00:00
alc
23d5cf5443 Recognize architectural support for 1GB virtual pages.
MFC after: 6 weeks
2007-12-08 21:13:01 +00:00
scottl
f9e173d72a Support new ARC120x family of controllers. Many thanks for Areca's continued
support of FreeBSD.

Submitted by: Erich Chen @ Areca
2007-12-08 20:48:26 +00:00
marcel
7827a1496a Add support for FS_ZFS. 2007-12-08 07:01:10 +00:00
marcel
489bd36fff Add a file system type for ZFS (FS_ZFS). 2007-12-08 06:47:48 +00:00
marcel
80494145a2 Sync with NetBSD rev 1.101.
This also fixes fstypenames being short an entry.
2007-12-08 06:44:27 +00:00
scottl
4570db7ea2 Grrr, remove an unused variable missed in the last commit. 2007-12-08 01:41:31 +00:00
yongari
c60450024e Add another RTL8168 revision 3 which is found on RTL8111-GR Gigabit
Ethernet Controller. Multicast filtering wasn't tested and needs more
expore. While I'm here change complex if statements with switch
statement which would improve readability.

Reported by:	Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca >
Tested by:	Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca >
2007-12-08 00:14:09 +00:00
scottl
38b1bc6f6b Don't expect a return value from statfs_scale_blocks(). 2007-12-07 22:32:09 +00:00
emaste
2b0d22f644 Merge from Adaptec a 64 bit fix and a workaround for luns != 0 returning
CAM_SEL_TIMEOUT on SAS controllers, which prevented passthrough devices
from being created.
2007-12-07 20:37:12 +00:00
emaste
54fed38dbc Add family support to allow the driver to attach to new devices that
share the same interface.

Submitted by:	Achim Leubner at Adaptec
2007-12-07 18:05:41 +00:00
jkoshy
2cccff443f Add stub functions to unbreak LINT. 2007-12-07 17:21:53 +00:00
jkoshy
39d4b4accf Add stubs to unbreak LINT. 2007-12-07 13:45:47 +00:00
sos
9bc486376b Fix speed report on Intel SATA chips in compat mode.
Fix broken detect of JMicron 368.
2007-12-07 13:14:31 +00:00
cognet
b76f135a28 Fix style in previous commit.
Pointed out by:	njl
2007-12-07 10:42:11 +00:00
thompsa
e4ece2b010 Preallocate some space to return the scan results, some drivers do not properly
pass back the desired buffer length. This fixes scanning with the Marvell
88W8335 and BCM4328 wireless cards.

PR:		kern/118370
Submitted by:	Weongyo Jeong
Tested by:	Ed Schouten
2007-12-07 10:37:25 +00:00
jkoshy
fcb44f0caf Increment FreeBSD_version to mark the addition of callchain support
to hwpmc.
2007-12-07 08:36:38 +00:00
jkoshy
72c27d71d8 Kernel and hwpmc(4) support for callchain capture.
Sponsored by:	FreeBSD Foundation and Google Inc.
2007-12-07 08:20:17 +00:00
kmacy
12b5f9c8c9 Add padding for anticipated functionality
- vimage
 - TOE
 - multiq
 - host rtentry caching

Rename spare used by 80211 to if_llsoftc

Reviewed by: rwatson, gnn
MFC after: 1 day
2007-12-07 01:46:13 +00:00
rrs
fad90600c1 - More fixes for lock misses on the transfer of data to
the sent_queue. Sometimes I wonder why any code
  ever works :-)
- Fix the pad of the last mbuf routine, It was working improperly
  on non-4 byte aligned chunks which could cause memory overruns.

MFC after:	1 week
2007-12-07 01:32:14 +00:00
emaste
e85902857b Allow simultaneous opens of the device for issuing commands to the
controller.  This is merged from Adaptec driver build 11669.
2007-12-07 00:22:23 +00:00
delphij
e93a39275f Turn MPASS(0) into panic with more obvious reason why the assertion
is failed.
2007-12-07 00:00:21 +00:00
jhb
f05fcb702a Regen. 2007-12-06 23:37:26 +00:00
jhb
d675d97b05 Add freebsd32 compat wrappers for msgctl() and __semctl() using
kern_msgctl() and kern_semctl().

MFC after:	1 week
2007-12-06 23:36:57 +00:00
jhb
f4e63ed7ac Add freebsd32 compat wrappers for msgctl() and _semctl() using
kern_msgctl() and kern_semctl().

MFC after:	1 week
2007-12-06 23:35:29 +00:00
jhb
eb9403bc51 Move 32-bit SYSV IPC structure definitions into freebsd32_ipc.h.
MFC after:	1 week
2007-12-06 23:23:16 +00:00
delphij
17d10d92fe size_max should be unsigned, as such, use size_t here. 2007-12-06 23:19:05 +00:00
cognet
f919b8c32d Erm, add a missing else, we do not want to increase the mapping counters for
both kernel and userland when we create a pv for pmap_kernel.

Reported by:	Mark Tinguely <tinguely AT casselton DOT net>
MFC After:	3 days
2007-12-06 23:17:24 +00:00
jhb
0373a29045 Move several data structure definitions out of freebsd32_misc.c and into
freebsd32.h instead.

MFC after:	1 week
2007-12-06 23:11:27 +00:00
julian
e38fed7fb7 Remove more dup'd code
MFC After: 1 week
2007-12-06 22:48:24 +00:00
julian
87a49d3e6e remove duped code
Reviewed By: gnn
MRC after: 1 week
2007-12-06 22:44:24 +00:00
julian
bad03ab89c No need to assert that a == b when we just set a = b. 2007-12-06 22:40:17 +00:00
kmacy
dce7a4b1a7 Change uint8_t to equivalent base language type and add line break where 80
characters is exceeded in bit macros

Requested by: Bruce Evans
2007-12-06 19:11:14 +00:00
emaste
533e87bb7c Add more PCI ID's from Adaptec's driver, including two requested
by Daniel Kamm.

  Adaptec RAID 51245
  Adaptec RAID 51645
  Adaptec RAID 52445
  Adaptec RAID 5405
  Sun STK RAID REM
  Sun STK RAID EM
  SG-XPCIESAS-R-IN
  SG-XPCIESAS-R-EX
2007-12-06 18:25:29 +00:00
des
90c2422b90 Simpler version of the previous commit. 2007-12-06 09:31:13 +00:00
jhb
82ec005a0a Only attach to a GPT partition if it has the GPT_ENT_TYPE_FREEBSD type.
XXX: This only works currently with GEOM_GPT which only exists in 6.x.
XXX: I didn't add 'mbroffset' support for a GPT partition holding a BSD
label as I'm not sure if they use relative or absolute offsets.

MFC after:	3 days
2007-12-06 09:20:27 +00:00
kmacy
7b59d90c86 Respect the fact that the value a may be constant so cast to const uint8_t * 2007-12-06 04:00:59 +00:00
marcel
5f073f2789 Add a BSD disklabel backend to g_part:
o  Disklabels can have between 8 and 20 partitions (inclusive).
o  No device special file is created for the raw partition.
o  Switch ia64 to use this backend.
o  No support for boot code yet.
2007-12-06 02:32:42 +00:00
emaste
444bd6eea2 Add PCI IDs for additional cards:
AOC-USAS-S4i
AOC-USAS-S8i
AOC-USAS-S4iR
AOC-USAS-S8iR
AOC-USAS-S8i-LP
AOC-USAS-S8iR-LP
2007-12-06 02:10:07 +00:00
njl
2a12030949 Hold Giant over the entire execution of the suspend path instead of
dropping it after each call into newbus.  This doesn't fix any known
problems but seems more correct.

Submitted by:	Marko Zec <zec / icir.org>
2007-12-06 01:39:23 +00:00
rrs
475b561655 - optimize the initialization of the SB max variables.
- Missing lock when sending data and moving it to the
  outqueue.
- If a mbuf alloc fails during moving to outqueue the
  reassembly of the old mbuf chain was incorrect.
- some_taken becomes a counter in sctputil.c instead of a set to 1.
- Fix a panic to be only under invarients and have a proper recovery.
- msg_flags needed to be set.to the value collected not or'd.

MFC after:	1 week
2007-12-06 00:22:55 +00:00
kmacy
e9665dcb0a Fix bit macros to work on multi-byte types
MFC after: 1 day
2007-12-05 23:48:03 +00:00
philip
f6fdf45e34 Fix a use-after-free.
Submitted by:	Ilja van Sprundel <ilja -at- netric.org>
Reviewed by:	secteam
MFC after:	1 day
2007-12-05 19:32:59 +00:00
philip
c2ee5917b0 Plug two potential (root-only, local) information leaks. buf is not
initialized before use and returned integrally instead of up to size.

Submitted by:	Ilja van Sprundel <ilja -at- netric.org>
Reviewed by:	secteam
MFC after:	1 day
2007-12-05 19:32:07 +00:00
rrs
28889e11f4 - Puts default limits on 4k/9k and 16k zones for mbufs all based
on 1/2 of each of the successive limits tied to the limit for
  2k clusters.
- Adds real functionality in so that doing a sysctl to change these
  actually changes them :-)

MFC after:	1 week
2007-12-05 15:29:44 +00:00
remko
60d2f6bdf5 Bring in support for: Marvell Yukon 8039
PR:		118401
Submitted by:	Skip Ford <skip at menantico dot com>
Approved by:	imp (mentor), yongari
MFC After:	3 days
2007-12-05 09:41:58 +00:00
kib
53229c8ee9 Use curthread instead of the FIRST_THREAD_IN_PROC for vnlru and syncer,
when applicable.

Aquire Giant slightly later for vnlru.

In the syncer, aquire the Giant only when a vnode belongs to the
non-MPsafe fs.

In both speedup_syncer() and syncer_shutdown(), remove the syncer thread from
the lbolt sleep queue after the syncer state is modified, not before.

Herded by:	attilio
Tested by:	Peter Holm
Reviewed by:	ups
MFC after:	1 week
2007-12-05 09:34:04 +00:00
julian
58e4738b79 Stop serial console and gdb serial port from getting all screwed up.
PR: 65278
MFC in: 3 days
Submitted by: ups@
2007-12-05 05:16:56 +00:00
rodrigc
ca18adc0b5 In nmount(), internally convert the mount option: "rdonly" to "ro".
This makes updates mounts such as:
 "mount -u -o rdonly" work more like, "mount -u -o ro".

References to "-o rdonly" were changed to "-o ro" in revision 1.60 of
the mount(8) man page,
but some people still like to use "-o rdonly" since it was documented
in earlier versions of FreeBSD.

Requested by:	rwatson
MFC after:	1 week
2007-12-05 03:26:14 +00:00
thompsa
36f039142a Apply a workaround for the unkillable jail problem where some devices created
within the jail are never freed. si_cred is only used by the MAC framework so
make the cred reference conditional on it being compiled in, this is not a fix
and will need to be reviewed for any new consumers of si_cred.

This will quell some user complaint when using jails with a default kernel.

Reviewed by:	rwatson
MFC after:	3 days
2007-12-05 01:22:03 +00:00
thompsa
a3cd956d35 Support monitor mode where the frame is discarded after bpf and stats processing. 2007-12-05 00:42:28 +00:00
wkoszek
bc73f21841 Remove obsolete comment on a way of getting kernel configuration file from
INCLUDE_CONFIG_FILE. Make a user to look at what config(8) actually does,
and how can one fetch actual configuration file.

Reported by:	many
Reviewed by:	cognet (mentor)
Approved by:	cognet (mentor)
2007-12-04 21:01:55 +00:00
wkoszek
ec7b100d6f Cast address of 'bssid' to uint8_t since printf() expects to get unsigned
argument in %6D case.

Submitted by:	thompsa
Compile-tested:	wkoszek
Reviewed by:	cognet (mentor)
Approved by:	cognet (mentor)
2007-12-04 20:48:32 +00:00
wkoszek
e12f989849 Cast 'data' to 'u_char', as printf() requires this type to be unsigned. This
is what gcc3 complains about.

Without this change, it's impossible to build the kernel with gcc3.

Tested by:	cognet@ (mentor)
Approved by:	cognet@ (mentor)
2007-12-04 20:33:58 +00:00
jkim
7c00aa0ce7 Remove redundant checks for msgsnd(3) and msgrcv(3).
COMPAT_IA32 (implicitly) requires SYSVSEM, SYSVSHM and SYSVMSG in kernel.

Pointed out by:	jhb
2007-12-04 20:25:41 +00:00
wkoszek
354f6f4c2e Explicitly initialize 'ret' to 0'. It lets one to build tmpfs from the
latest source tree with older compiler--gcc3.

Approved by:	cognet (mentor)
2007-12-04 20:20:59 +00:00
rrs
9e75c558ad - More fixes for the non-blocking msg send, had the skip of the pre-block
test incorrect.
- Fix the initial buf calculation to be more friendly, calc is the same
  but we use different variable to make it easier amongst the different
  code versions.

MFC after:	1 week
2007-12-04 20:20:42 +00:00
wkoszek
411cf00f62 Explicitly initialize 'error' to 0 (two places). It lets one to build tmpfs
from the latest source tree with older compiler--gcc3.

Reviewed by:	kib@ (on freebsd-current@)
Approved by:	cognet@ (mentor)
2007-12-04 20:14:15 +00:00
alc
954e8dafee Increment __FreeBSD_version on account of changes to the jumbo frames
allocator.  (See revision 1.35 of kern/kern_mbuf.c.)

Requested by: Andrew Gallatin
2007-12-04 17:57:41 +00:00
rrs
a6029f7726 - Opps, signedness issue with one of the new var's (this is an issue
mainly in apple but with the right -Wall it could effect us too).

MFC after:	1 week
2007-12-04 14:47:39 +00:00
rrs
f08a32ba97 - Found a problem in non-blocking sends. When
sending, once the locks are all unlocked to
  do the copy's in, its possible that other
  events could then raise the number of bytes
  outstanding pushing it so not all the message
  would fit. This would then cause us to send
  only part of the message. This fix makes it
  so we keep a "reserved" amount that can be
  kept in mind when making calculations to send.
- rcv msg args with a NULL/NULL for to/tolen will return an error incorrectly
  for the 1-2-1 model.
- We were not doing 0 len return correctly and not setting cantrcv more
  correctly. Previouly we "fixed" this area by taking out the socantrcv
  since we then could not get the data out. The correct rix is to still
  flag the socket but alow a by-pass route to continue to read until
  all data is consumed.

MFC after:	1 week
2007-12-04 14:41:48 +00:00
yar
6e65a1fee2 For the sake of convenience, print the name of the network interface
IPv4 address duplication was detected on.

Idea by:	marck
2007-12-04 13:01:12 +00:00
kib
3e8ae081b2 Fix the ABI change of the signal delivered on the access to the page
with insufficient protection mode.

For the i386 and amd64, create the tunable, machdep.prot_fault_translation,
with the following behaviour:
	0 = autodetect the signal to be delivered on KERN_PROTECTION_FAILURE
	    from vm_fault based on the ELF OSABI note:
		no note or __FreeBSD_version < 700004 - SIGBUS/BUS_PAGE_FAULT
		note, and __FreeBSD_version >= 700004 - SIGSEGV/SEGV_ACCERR
	1 = always SIGBUS/BUS_PAGE_FAULT
	2 = always SIGSEGV/SEGV_ACCERR

This would do mostly automatic correction of ABI breakage, with the exception
of the untaged binaries for 7-CURRENT/RELENG_7 before the note is fixed. For
them, sysctl would allow to run the binary with manual settings.

Discussed with:	portmgr (kris)
PR:		kern/118304
MFC after:	3 days
2007-12-04 12:33:03 +00:00
kib
feb2aba5b6 Implement fetching of the __FreeBSD_version from the ELF ABI-tag note.
The value is read into the p_osrel member of the struct proc. p_osrel
is set to 0 for the binaries without the note.

MFC after:	3 days
2007-12-04 12:28:07 +00:00
kib
dbef1afd93 Check for the program headers alignment of the ELF images before
dereferencing. Unaligned access could cause panic on strict alignment
architectures.

Reviewed by:	marcel, marius (also tested on sparc64, thanks !)
MFC after:	3 days
2007-12-04 12:21:27 +00:00
alc
8cda75e035 Correct an error under COUNT_IPIS within pmap_lazyfix_action(): Increment
the counter that the pointer refers to, not the pointer.

MFC after: 3 days
2007-12-04 09:06:08 +00:00
alc
10142e95b9 Style change: Use NULL rather than 0 where appropriate. 2007-12-04 08:17:04 +00:00
silby
e548183f0a Fix SACK negotiation that was broken in rev 1.105.
Before this fix, FreeBSD would negotiate SACK on outgoing
connections, but would always fail to negotiate it on incoming
connections.

Discovered by: James Healy and Lawrence Stewart
Submitted by: James Healy and Lawrence Stewart
MFC after: 3 days
2007-12-04 07:11:13 +00:00
alc
200640eacf Introduce an UMA backend page allocator for the jumbo frame zones that
allocates physically contiguous memory.

MFC after: 3 months
Requested and reviewed by: Kip Macy
Tested by: Andrew Gallatin and Pyun YongHyeon
2007-12-04 07:06:08 +00:00
thompsa
b56e8f172a Implement functions required by some ndis drivers.
NdisIMCopySendPerPacketInfo [1]
 KeQuerySystemTime [1]
 KeTickCount [1]
 strncat [1]
 KeBugCheckEx

Submitted by:	Marcin Simonides [1]
2007-12-03 23:43:58 +00:00
thompsa
6e7c2e0556 Remove compatibilty defines to simplify reading the code, this is around 10% of
the total LOC. These are mostly for the 6.x branch and it will be easier to
cherrypick any changes (if at all).
2007-12-03 21:51:28 +00:00
rwatson
0c4e2d79d0 When a symbol name can't be resolved, return "??" as the name, rather
than "Unknown func", in order to avoid putting spaces in what ideally
is a string separated by white space.
2007-12-03 14:44:35 +00:00
ariff
b629c07846 Fix audio playback aborted with SNDCTL_DSP_SETTRIGGER, affecting
PortAudio version 19.

PR:		kern/118395
Submitted by:	Henrik Gulbrandsen <henrik at gulbra dot net>
MFC after:	3 days
2007-12-03 14:26:56 +00:00
kib
4be0c75a36 Do not allow the SNPSTTY ioctl for the snoop device that has a tty
attached. Otherwise, the snp->snp_tty would be overwritten, while the
tty line discipline still set to the snpdisc. Then snplwrite() causes
panic because ttytosnp() cannot find the snp.

MFC after:	1 week
2007-12-03 14:02:27 +00:00
rwatson
633b64a51d Catch up pc98 for i386 stack(9) changes:
Add stub stack.h for pc98 that includes i386 pc98.

  Add i386 stack_machdep.c to files.pc98.

Spotted by:	tinderbox
2007-12-03 11:38:28 +00:00
jkoshy
8304a663db Add userland definitions for parsing callchain records.
Sponsored by:	FreeBSD Foundation and Google Inc.
2007-12-03 11:11:08 +00:00
yongari
bfeab92a37 Always honor promiscuous flag prior to programming Rx multicast
filter. This fixes a regression introduced in rev 1.89.

PR:	114632
MFC after:	3 days
2007-12-03 01:28:08 +00:00
rwatson
e891688481 Add another new sysctl in support of the forthcoming procstat(1) to
support its -k argument:

kern.proc.kstack - dump the kernel stack of a process, if debugging
  is permitted.

This sysctl is present if either "options DDB" or "options STACK" is
compiled into the kernel.  Having support for tracing the kernel
stacks of processes from user space makes it much easier to debug
(or understand) specific wmesg's while avoiding the need to enter
DDB in order to determine the path by which a process came to be
blocked on a particular wait channel or lock.
2007-12-02 21:52:18 +00:00
rwatson
47c0478314 Remove duplicate $FreeBSD$ tag. 2007-12-02 21:07:49 +00:00
rwatson
99285f7544 Break out stack(9) from ddb(4):
- Introduce per-architecture stack_machdep.c to hold stack_save(9).
- Introduce per-architecture machine/stack.h to capture any common
  definitions required between db_trace.c and stack_machdep.c.
- Add new kernel option "options STACK"; we will build in stack(9) if it is
  defined, or also if "options DDB" is defined to provide compatibility
  with existing users of stack(9).

Add new stack_save_td(9) function, which allows the capture of a stacktrace
of another thread rather than the current thread, which the existing
stack_save(9) was limited to.  It requires that the thread be neither
swapped out nor running, which is the responsibility of the consumer to
enforce.

Update stack(9) man page.

Build tested:	amd64, arm, i386, ia64, powerpc, sparc64, sun4v
Runtime tested:	amd64 (rwatson), arm (cognet), i386 (rwatson)
2007-12-02 20:40:35 +00:00
scottl
e6e32be1d5 Provide unqiue malloc types instead of using M_DEVBUF. 2007-12-02 19:54:45 +00:00
scottl
8497469369 Refactor completion handlers so that they can be combined into a single
function.  Add missing locking.
2007-12-02 19:50:01 +00:00
scottl
93b6867794 Make a pass at style.9 compliance 2007-12-02 18:48:17 +00:00
scottl
acca560de6 Fix a typo that was hidden by AMR_DEBUG. 2007-12-02 18:47:31 +00:00
scottl
4ab6a743b6 Fix printf format bugs that where hidden by AMR_DEBUG. 2007-12-02 18:45:37 +00:00
scottl
d277ab6960 The AR_SCSI_PASSTHROUGH conditional no longer exists, remove it from the
makefile.
2007-12-02 18:39:38 +00:00
ariff
27cd3dfe0d Headphone / speakers automute fixup for Acer Aspire 4710 @ ALC268 laptop.
Tested by:	Liyu, She
2007-12-02 16:38:28 +00:00
cognet
9e1fb6a88b Fix a potential bug in pmap :
We used to allocate the domains 0-14 for userland, and leave the domain 15
for the kernel. Now supersections requires the use of domain 0, so we
switched the kernel domain to 0, and use 1-15 for userland.
How it's done currently, the kernel domain could be allocated for a
userland process.
So switch back to the previous way we did things, set the first available
domain to 0, and just add 1 to get the real domain number in the struct pmap.

Reported by:	Mark Tinguely <tinguely AT casselton DOT net>
MFC After:	3 days
2007-12-02 15:26:30 +00:00
cognet
375dcebc07 Move the strongarm-specific files from conf/files.arm to sa11x0/files.sa11xO.
Submitted by:	Rafal Jaworowski <raj AT semihalf DOT com>
2007-12-02 13:12:21 +00:00
cognet
507e28d936 Cleanup : make nexus standard, as it is mandatory anyway.
Garbage-collect unused nexus_io.c and nexus_io_asm.S

Submitted by:	Rafal Jaworowski <raj AT semihalf DOT com>
2007-12-02 13:10:42 +00:00
guido
e371eead9f Consider the following situation:
1. A packet comes in that is to be forwarded
2. The destination of the packet is rewritten by some firewall code
3. The next link's MTU is too small
4. The packet has the DF bit set

Then the current code is such that instead of setting the next
link's MTU in the ICMP error, ip_next_mtu() is called and a guess
is sent as to which MTU is supposed to be tried next. This is because
in this case ip_forward() is called with srcrt set to 1. In that
case the ia pointer remains NULL but it is needed to get the MTU
of the interface the packet is to be sent out from.
Thus, we always set ia to the outgoing interface.

MFC after:	2 weeks
2007-12-02 13:00:47 +00:00
cognet
db18da5d15 Close a race.
The RAS implementation would set the end address, then the start
address.  These were used by the kernel to restart a RAS sequence if
it was interrupted.  When the thread switching code ran, it would
check these values and adjust the PC and clear them if it did.

However, there's a small flaw in this scheme.  Thread T1, sets the end
address and gets preempted.  Thread T2 runs and also does a RAS
operation.  This resets end to zero.  Thread T1 now runs again and
sets start and then begins the RAS sequence, but is preempted before
the RAS sequence executes its last instruction.  The kernel code that
would ordinarily restart the RAS sequence doesn't because the PC isn't
between start and 0, so the PC isn't set to the start of the sequence.
So when T1 is resumed again, it is at the wrong location for RAS to
produce the correct results.  This causes the wrong results for the
atomic sequence.

The window for the first race is 3 instructions.  The window for the
second race is 5-10 instructions depending on the atomic operation.
This makes this failure fairly rare and hard to reproduce.

Mutexs are implemented in libthr using atomic operations.  When the
above race would occur, a lock could get stuck locked, causing many
downstream problems, as you might expect.

Also, make sure to reset the start and end address when doing a syscall, or
a malicious process could set them before doing a syscall.

Reviewed by: imp, ups (thanks guys)
Pointy hat to:	cognet
MFC After:	3 days
2007-12-02 12:49:28 +00:00
rwatson
c25458da37 Add two new sysctls in support of the forthcoming procstat(1) to support
its -f and -v arguments:

kern.proc.filedesc - dump file descriptor information for a process, if
  debugging is permitted, including socket addresses, open flags, file
  offsets, file paths, etc.

kern.proc.vmmap - dump virtual memory mapping information for a process,
  if debugging is permitted, including layout and information on
  underlying objects, such as the type of object and path.

These provide a superset of the information historically available
through the now-deprecated procfs(4), and are intended to be exported
in an ABI-robust form.
2007-12-02 10:10:27 +00:00
thompsa
663523e681 Hide a debug printf, NDIS_DEBUG is always defined and we test the sysctl.
MFC after:	3 days
2007-12-02 09:03:43 +00:00
thompsa
200d23553e Correct the calculation for the number of 100ns intervals since
January 1, 1601. The 1601 - 1970 period was in seconds rather than 100ns
units.

Remove duplication by having NdisGetCurrentSystemTime call ntoskrnl_time.
2007-12-02 08:54:50 +00:00
alc
cf47268b02 Correct a comment. 2007-12-02 07:43:42 +00:00
thompsa
3f699c4d4e Correct the nwbx_ies field type in struct ndis_wlan_bssid_ex.
PR:		kern/118369
Submitted by:	Weongyo Jeong
2007-12-02 04:04:42 +00:00
alc
ed1f1ac93c Eliminate vfs_page_set_valid()'s unused argument. 2007-12-02 01:28:35 +00:00
jb
fb73d97ef1 Add extra visibility definitions.
See: <http://groups.google.com/group/generic-abi/browse_thread/thread/1a84adc15666164>

These are already in OpenSolaris and DTrace uses STV_ELIMINATE.
2007-12-02 00:05:18 +00:00
rwatson
090235e567 Modify stack(9) stack_print() and stack_sbuf_print() routines to use new
linker interfaces for looking up function names and offsets from
instruction pointers.  Create two variants of each call: one that is
"DDB-safe" and avoids locking in the linker, and one that is safe for
use in live kernels, by virtue of observing locking, and in particular
safe when kernel modules are being loaded and unloaded simultaneous to
their use.  This will allow them to be used outside of debugging
contexts.

Modify two of three current stack(9) consumers to use the DDB-safe
interfaces, as they run in low-level debugging contexts, such as inside
lockmgr(9) and the kernel memory allocator.

Update man page.
2007-12-01 22:04:16 +00:00