Commit Graph

67392 Commits

Author SHA1 Message Date
John Birrell
5ed1b46b36 Add a couple of files which depend of the KDTRACE_HOOKS option.
The syscall names are required by KDTRACE_HOOKS too.

And the unzip
2008-05-18 19:47:49 +00:00
John Birrell
80544aebe3 Add support for the DTrace struct proc and struct thread extended
data via ctor and dtor event handlers.

The size of the extra data is allocated opaquely and this file
contains a function which the dtrace module can call to check
that the kernel supports at least the amount of data that it needs.

This file is optionally compiled into nthe kernel if the KDTRACE_HOOKS
kernel option is defined.
2008-05-18 19:43:52 +00:00
John Birrell
5572901b33 Add kernel support for the Statically Defined Trace provider.
This is BSD licensed code written specifically for FreeBSD.

It initialises using SYSINIT so that the SDT provider, probe and
argument description linkage is done whenever a module is loaded,
regardless of whether the DTrace modules are loaded or not.

This file is optionally compiled into the kernel if the KDTRACE_HOOKS
option is defined.
2008-05-18 19:32:36 +00:00
John Birrell
c7d1b0ec0a Add two kernel options:
- KDTRACE_HOOKS for the shim layer of hooks which separate BSD licensed
                code from CDDL code.
- DDB_CTF       for the code that parses the CTF (compact C type format)
                data for use by the DTrace Function Boundary Trace
                provider and (possibly) ddb if we plan to do that.
2008-05-18 19:28:51 +00:00
Rui Paulo
221351b7a5 devctl_process_running(): Check for devsoftc.inuse == 1 instead of
devsoftc.async_proc != NULL because the latter might not be true
sometimes.
This way /etc/rc.suspend gets executed.

Reviwed	by:	njl
Submitted by:	Mitsuru IWASAKI <iwasaki at jp.FreeBSD.org>
Tested also by:	Andreas Wetzel <mickey242 at gmx.net>
MFC after:	1 week
2008-05-18 13:55:51 +00:00
John Birrell
fdd5d90980 Remove the unknown device that is breaking the tinderbox build. 2008-05-18 11:08:26 +00:00
Alan Cox
1ec1304bdb Retire pmap_addr_hint(). It is no longer used. 2008-05-18 04:16:57 +00:00
Remko Lodder
5d6ab21196 Add support for the Epson 4800 scanner.
PR:		118391
Submitted by:	"Pedro F. Giffuni" <giffunip at tutopia dot com>
Approved by:	imp (mentor, implicit)
MFC after:	3 days
Committed at:	BSDCan 2008
2008-05-18 03:07:40 +00:00
Remko Lodder
6e535f6e5b Resort the if_ti driver to match the PCI Network cards instead of placing
it under the mii devices list.

PR:		kern/123147
Submitted by:	gavin
Approved by:	imp (mentor, implicit)
MFC after:	3 days
2008-05-17 23:50:00 +00:00
Alan Cox
d0a83a83bf In order to map device memory using superpages, mmap(2) must find a
superpage-aligned virtual address for the mapping.  Revision 1.65
implemented an overly simplistic and generally ineffectual method for
finding a superpage-aligned virtual address.  Specifically, it rounds
the virtual address corresponding to the end of the data segment up to
the next superpage-aligned virtual address.  If this virtual address
is unallocated, then the device will be mapped using superpages.
Unfortunately, in modern times, where applications like the X server
dynamically load much of their code, this virtual address is already
allocated.  In such cases, mmap(2) simply uses the first available
virtual address, which is not necessarily superpage aligned.

This revision changes mmap(2) to use a more robust method,
specifically, the VMFS_ALIGNED_SPACE option that is now implemented by
vm_map_find().
2008-05-17 19:32:48 +00:00
Alan Cox
e46cd4132c Preset a device object's alignment ("pg_color") based upon the
physical address of the device's memory.  This enables
pmap_align_superpage() to propose a virtual address for mapping the
device memory that permits the use of superpage mappings.
2008-05-17 16:26:34 +00:00
George V. Neville-Neil
4b4b5fb6b8 Remove last bits of OS adaptation code from the IPSec code.
Reviewed By: bz
2008-05-17 04:00:11 +00:00
Brooks Davis
d94ccb096b The if_check() function performed three actions:
- verified that the ifp->if_snd.ifq_mtx was initalized for
   all attached interfaces.  This was pointless because it was
   initalized for all interfaces in if_attach() so I've removed it.
 - Checked that ifp->if_snd.ifq_maxlen is initalized and set it to
   ifqmaxlen if unset.  This makes more sense in if_attach() so
   I moved it there.
 - The first call of if_slowtimo().  Delete if_check() and call
   if_slowtimo() directly from the SYSINIT().
2008-05-17 03:38:13 +00:00
John Birrell
b8915e90a2 Add the DTrace kernel module makefiles. 2008-05-17 02:31:19 +00:00
John Birrell
385db7fe8f Add the DTrace shim layer definitions.
All shim hooks are defined here. This is the interface between BSD
code in FreeBSD and CDDL code from OpenSolaris.

The hooks defined here are pre-processed out from the source files
when the KDTRACE_HOOKS kernel option isn't defined.
2008-05-17 02:16:58 +00:00
John Birrell
80f4e2cb4c Add the statically defined tracing header.
Note that this implementation differs from the one in OpenSolaris, so
it is BSD licensed and can be included anywhere.

The kernel definitions defined here are dependent on the kernel option
KDTRACE_HOOKS so that macros added to the sources are pre-processed
out completely when the DTrace kernel hooks aren't compiled in.
2008-05-17 02:14:19 +00:00
Markus Brueffer
9c2bf69d32 Fix and speedup timestamp calculations which is roughly based on the patch in
the mentioned PR:

- bounds check time->month as it is used as an array index
- fix usage of time->month as array index (month is 1-12)
- fix calculation based on time->day (day is 1-31)
- fix the speedup code as it doesn't calculate correct timestamps before
  the year 2000 and reduce the number of calculation in the year-by-year code
- speedup month calculations by replacing the array content with cumulative
  values
- add microseconds calculation
- fix an endian problem

PR:		kern/97786
Submitted by:	Andriy Gapon <avg@topspin.kiev.ua>
Reviewed by:	scottl (earlier version)
Approved by:	emax (mentor)
MFC after:	1 week
2008-05-16 22:31:17 +00:00
Remko Lodder
6b8b4a6618 Add support for the Nikon D300 camera
PR:		usb/118741
Submitted by:	Yuri <yuri at tsoft dot com>
Approved by:	imp (mentor, implicit)
MFC after:	3 days
2008-05-16 19:47:15 +00:00
Jack F Vogel
9ca4041b6c This is driver version 1.4.4 of the Intel ixgbe driver.
-It has new hardware support
  -It uses a new method of TX cleanup called Head Write Back
  -It includes the provisional generic TCP LRO feature contributed
   by Myricom and made general purpose by me. This should move into
   the stack upon approval but for this driver drop its in here.
  -Also bug fixes and etc...

MFC in a week if no serious issues arise.
2008-05-16 18:46:30 +00:00
Robert Watson
8e230e30b7 Attempt to improve convergence of POSIX semaphore code with style(9).
MFC after:	3 days
2008-05-16 18:10:07 +00:00
Marcel Moolenaar
c1163871f6 Fix RID calculation. The RID is really the BAR for PCI cards,
so the index needs to be translated into an offset. While we
did add the offset (0x10), we forgot to account for the width.

Tested by: Thomas Vogt
MFC after: 3 days
2008-05-16 14:57:48 +00:00
Attilio Rao
13d4b2b0bc Removed unused assembly offsets for structures digging. 2008-05-16 13:23:47 +00:00
Paul Saab
17e8474976 Remove a check that didn't allow > 12 byte CDB's to be issued to
ciss.  This should allow volumes > 2TB to work.

Reported by:	Emil Mikulic
2008-05-16 08:27:02 +00:00
Benno Rice
eead3ae9fc Document BOOTP_BLOCKSIZE. 2008-05-16 06:50:40 +00:00
Benno Rice
aea75fde62 Allow the block size used when booting over NFS to be overridden. It defaults
to 8192 bytes which is the size currently used.
2008-05-16 06:27:03 +00:00
Andrew Thompson
6d107591b2 The beacon miss notification must run without locks held has it calls back into
wpi_raw_xmit();
2008-05-16 04:15:54 +00:00
Sean Farley
99cba684fe Spelling and capitalization fixes.
MFC after:	3 days
2008-05-16 03:13:36 +00:00
Attilio Rao
295624f56a LO_ENROLLPEND is no more existing so just axe it (it was left out by the
original commit axing it).
2008-05-16 02:09:13 +00:00
Attilio Rao
58c5a5eb70 lockinit() can't accept LK_EXCLUSIVE as an initializaiton flag, so just
drop it.

Reported by:	Josh Carroll <josh dot carroll at gmail dot com>
Submitted by:	jhb
2008-05-15 21:39:25 +00:00
Marius Strobl
d7405474ea - Const'ify firmware and lookup-tables.
- Obsolete redundant inst_name and unit members of struct sym_hcb.
- Fix three more NULL vs. 0 confusions.
- Use device_set_softc(9) to tell the bus layer that this driver
  allocates a instance of struct sym_hcb itself.
2008-05-15 20:27:18 +00:00
George V. Neville-Neil
49f287f8c5 Update the kernel to count the number of mbufs and clusters
(all types) used per socket buffer.

Add support to netstat to print out all of the socket buffer
statistics.

Update the netstat manual page to describe the new -x flag
which gives the extended output.

Reviewed by:	rwatson, julian
2008-05-15 20:18:44 +00:00
Attilio Rao
90356491d7 - Embed the recursion counter for any locking primitive directly in the
lock_object, using an unified field called lo_data.
- Replace lo_type usage with the w_name usage and at init time pass the
  lock "type" directly to witness_init() from the parent lock init
  function.  Handle delayed initialization before than
  witness_initialize() is called through the witness_pendhelp structure.
- Axe out LO_ENROLLPEND as it is not really needed.  The case where the
  mutex init delayed wants to be destroyed can't happen because
  witness_destroy() checks for witness_cold and panic in case.
- In enroll(), if we cannot allocate a new object from the freelist,
  notify that to userspace through a printf().
- Modify the depart function in order to return nothing as in the current
  CVS version it always returns true and adjust callers accordingly.
- Fix the witness_addgraph() argument name prototype.
- Remove unuseful code from itismychild().

This commit leads to a shrinked struct lock_object and so smaller locks,
in particular on amd64 where 2 uintptr_t (16 bytes per-primitive) are
gained.

Reviewed by:	jhb
2008-05-15 20:10:06 +00:00
Alan Cox
f578838754 Don't call vm_reserv_alloc_page() on device-backed objects. Otherwise, the
system may panic because there is no reservation structure corresponding to
the physical address of the device memory.

Reported by: Giorgos Keramidas
2008-05-15 18:52:31 +00:00
Weongyo Jeong
d9585f801b Fix a panic when it occurred during initializing the ndis driver because
it try to read network address through ifnet structure which is NULL
until the ndis driver's initialization is finished.

Reviewed by:	thompsa
2008-05-15 04:29:28 +00:00
John Baldwin
ccd3953e5f Go back to using the process command name (p_comm) for the file name and
command line arguments stored in the note at the beginning of a core dump
instead of the current thread name.

Reviewed by:	julian
2008-05-15 03:07:34 +00:00
Poul-Henning Kamp
338c585e38 Move speaker a lot closer to style(9)
Submitted by:	Martin Voros <martin_voros@yahoo.com>
2008-05-15 01:22:48 +00:00
Marius Strobl
5fea260f19 Improve the integration of BCM5906[M] support:
- Rename BGE_FLAG_EEPROM to BGE_FLAG_EADDR to underline it's absence means
  "there's no chip containing an Ethernet address fitted to the BGE chip
  so we have to get it from the firmware instead" rather than "there's no
  EEPROM, but maybe NVRAM or something else".
- Don't treat BCM5906[M] generally like chips w/o BGE_FLAG_EADDR set, just
  in the two cases really necessary. This gets us line with the original
  patch for DragonFlyBSD.
- For sparc64 restore the intended behavior of obtaining the Ethernet
  address from the firmware in case BGE_FLAG_EADDR is not set, even for
  BCM5906[M].
- Fix some style(9) bugs introduced with rev. 1.208 of if_bge.c

Approved by:		jhb
Additional testing by:	Thomas Nystroem (BCM5906)
2008-05-14 21:00:27 +00:00
Konstantin Belousov
48504cc25b Add the devctl notifications for the cdev create/destroy events.
Based on the submission by: Andriy Gapon <avg icyb net ua>
MFC after:	2 weeks
2008-05-14 14:29:54 +00:00
Rui Paulo
c4cbf0b605 style(9): remove FreeBSD CVS ID from the initial license comment.
MFC after:	1 day
2008-05-14 10:02:25 +00:00
Rui Paulo
dab9b0941d Actually, don't rely on the unsafe MAX() macro. Use imax() as provided
in the PR patch.

Pointed out by:		bde
PR:			123542
2008-05-14 09:57:21 +00:00
Marius Strobl
a893539e95 Don't let hacksync() call bus_dmamap_sync(9) on DMA maps which
are not initialized. This fixes a panic on sparc64 where calling
bus_dmamap_sync(9) on NULL DMA maps is fatal.

Approved by:	sam
2008-05-13 20:58:08 +00:00
Roman Divacky
7c0cc5f941 Regen.
Approved by:	kib (mentor)
2008-05-13 20:02:26 +00:00
Roman Divacky
4732e446fb Implement robust futexes. Most of the code is modelled after
what Linux does. This is because robust futexes are mostly
userspace thing which we cannot alter. Two syscalls maintain
pointer to userspace list and when process exits a routine
walks this list waking up processes sleeping on futexes
from that list.

Reviewed by:	kib (mentor)
MFC after:	1 month
2008-05-13 20:01:27 +00:00
Olivier Houchard
1e4ef54501 From the OpenBSD commit log :
Add support for the Apple USB Ethernet adapter.
Work around the "latch in at the first working PHY address hack",
that fails for this adapter because it returns 0xffff when reading
from lower PHY addresses. Also add more debugging printfs

Obtained from:	OpenBSD
MFC After:	3 days
2008-05-13 14:00:09 +00:00
John Baldwin
d07a0d1d4c - Set sc->dev to the new-bus device_t so all the device_printf()s work.
- Add a missing newline to a printf.

MFC after:	1 week
Submitted by:	Andriy Gapon  avg <> icyb.net.ua
2008-05-12 21:34:52 +00:00
Scott Long
0929b66905 Add support for management apps. Work around an apparent firmware bug that
results in hung i/o if more than 128 commands are scheduled for an array.
2008-05-12 14:09:19 +00:00
Julian Elischer
681e40627d fix typo in runz_fuzz
noticed by:Elijah Buck
2008-05-12 06:42:06 +00:00
George V. Neville-Neil
fff0ededf8 Fix the loopback interface. Cleaning up some code with new macros
was a tad too aggressive.

PR:		kern/123568
Submitted by:	Vladimir Ermakov <samflanker at gmail dot com>
Obtained from:	antoine
2008-05-12 02:44:53 +00:00
Sam Leffler
e8f5c7a839 declare ieee80211_phymode_name with an array size 2008-05-12 00:34:28 +00:00
Sam Leffler
8215d906ff Update PLCP<->rate mapping support:
o correct mapping of CCK rates to PLCP; was using nonstandard Ralink
  values which just happened to also be used by Zydas (so went unnoticed)
o change ieee80211_plcp2rate api to take a phy type instead of a flag
  that indicates ofdm/!ofdm
o update drivers to match (restore per-driver code to map rate->PLCP)

Reviewed by:	sephe, weongyo, thompsa
2008-05-12 00:32:52 +00:00
Sam Leffler
c43feede8b Minor cleanup of vap create work:
o add IEEE80211_C_STA capability to indicate sta mode is supported
  (was previously assumed) and mark drivers as capable
o add ieee80211_opcap array to map an opmode to the equivalent capability bit
o move IEEE80211_C_OPMODE definition to where capabilities are defined so it's
  clear it should be kept in sync (on future additions)
o check device capabilities in clone create before trying to create a vap;
  this makes driver checks unneeded
o make error codes return on failed clone request unique
o temporarily add console printfs on clone request failures to aid in
  debugging; these will move under DIAGNOSTIC or similar before release
2008-05-12 00:15:30 +00:00
Sam Leffler
fb39d28da5 we have a DFS capability now so enable check 2008-05-11 23:36:58 +00:00
Sam Leffler
bb77492f68 use c99-style initialization for ieee80211_phymode_name 2008-05-11 23:33:56 +00:00
Sam Leffler
82fd2577a8 add DFS capability bit and use it to auto-enable DFS support 2008-05-11 23:32:07 +00:00
Sam Leffler
7f5144364e use the current left edge of the BA window when forming ADDBA request
so an existing session is re-established with the correct seq#
2008-05-11 23:27:57 +00:00
Sam Leffler
e5d6bfc3c9 add PLCP service bit definitions 2008-05-11 23:20:26 +00:00
Sam Leffler
f4488925ad move inline keyword to silence compiler complaints 2008-05-11 23:18:11 +00:00
Rui Paulo
3684e5b004 Change the check for cpu_high to actually match CPUID 0x06.
Submitted by:	Arthur Hartwig <arthur.hartwig at nokia.com>
PR:		122878
MFC after:	3 days
2008-05-11 23:17:57 +00:00
Rui Paulo
563f8fc088 Don't use libkern's max() function as that's for unsigned numbers only.
Instead use the worldwide known MAX() function.
This should fix problems with negative values showing up on
dev.cpu.%d.temperature.
This is slightly different from the fix in the PR.

Submitted by:	KOIE Hidetaka <hide at koie.org>
PR:		123542
2008-05-11 23:14:07 +00:00
Sam Leffler
6c5c43974e fix typo's that broke duration calculation on protection frames 2008-05-11 22:11:01 +00:00
Alan Cox
ef4d480ced Correct an error in pmap_align_superpage(). Specifically, correctly
handle the case where the mapping is greater than a superpage in size
but the alignment of the physical pages spans a superpage boundary.
2008-05-11 20:33:47 +00:00
Alan Cox
6ac3ab7f98 Provide the new argument to kmem_suballoc(). 2008-05-10 23:39:27 +00:00
Alan Cox
3202ed7523 Introduce a new parameter "superpage_align" to kmem_suballoc() that is
used to request superpage alignment for the submap.

Request superpage alignment for the kmem_map.

Pass VMFS_ANY_SPACE instead of TRUE to vm_map_find().  (They are currently
equivalent but VMFS_ANY_SPACE is the new preferred spelling.)

Remove a stale comment from kmem_malloc().
2008-05-10 21:46:20 +00:00
Andrey A. Chernov
64982acf50 Add -mno-sse3 for amd64 case too
PR:             123518
Submitted by:   Marc Olzheim <marcolz@stack.nl>
2008-05-10 20:46:07 +00:00
Andrew Thompson
77197f9ce4 Only start the vaps if the init routine completed. 2008-05-10 20:25:59 +00:00
Andrew Thompson
6ba643ce87 - Associate from a taskq as we can deadlock on the ndis hal and the com lock.
- Remove double vap init (ieee80211_start_all)
- Keep ic_curchan in sync with the scan results.
2008-05-10 20:12:43 +00:00
Andrew Thompson
517b468a5d Partially revert the last rev. Do call ndis_setstate_80211() when we up the
interface but break out the associate code into a separate function. This fixes
association with an 11b Apple Airport.

Reported by:	Ted Lindgreen
2008-05-10 20:07:00 +00:00
Alan Cox
26c538ffcd Generalize vm_map_find(9)'s parameter "find_space". Specifically, add
support for VMFS_ALIGNED_SPACE, which requests the allocation of an
address range best suited to superpages.  The old options TRUE and FALSE
are mapped to VMFS_ANY_SPACE and VMFS_NO_SPACE, so that there is no
immediate need to update all of vm_map_find(9)'s callers.

While I'm here, correct a misstatement about vm_map_find(9)'s return
values in the man page.
2008-05-10 18:55:35 +00:00
Antoine Brodin
933dad75e3 Add missing braces in #if 0ed code.
Approved by:	rwatson (mentor)
MFC after:	1 month
2008-05-10 18:33:38 +00:00
Hidetoshi Shimokawa
d219022c4c - Fix panic on detach.
- Fix a comment.

MFC after: 2 weeks
2008-05-10 13:40:42 +00:00
Konstantin Belousov
e15864efd8 Kqueue_scan() may sleep when encountered the influx knotes. On the other
hand, it may cause other threads to sleep since kqueue_scan() may mark
some knotes as infux. This could lead to the deadlock.

Before kqueue_scan() sleeps, wakeup the threads that are waiting for the
influx knotes produced by this thread.

Tested by:	pho (previous version)
Reviewed by:	jmg
MFC after:	2 weeks
2008-05-10 11:37:05 +00:00
Konstantin Belousov
2e711e4d0d The kqueue_close() encountering the KN_INFLUX knotes on the kq being
closed is the legitimate situation. For instance, filedescriptor with
registered events may be closed in parallel with closing the kqueue.
Properly handle the case instead of asserting that this cannot happen.

Reported and tested by:	pho
Reviewed by:	jmg
MFC after:	2 weeks
2008-05-10 11:35:32 +00:00
Hidetoshi Shimokawa
5f3fa23423 - Disable interrupts on suspend to eliminate excessive
'device physically ejected?' message on resume.
- Fix memory leak on resume reported by kiyohara at netbsd.org.

MFC after: 2 weeks
2008-05-10 09:22:06 +00:00
Julian Elischer
6f95a5ebd9 move a #define from a place it shouldn't have been to a place it should
have been.  Basically my testign didn't ocver one case that this broke.
thanks tinderbox!
2008-05-10 04:32:58 +00:00
Julian Elischer
9ac7366921 undef MAXFIBS before redefining it 2008-05-10 04:15:21 +00:00
Xin LI
18b2a6d976 Add support for LSI 1078DE (ServeRAID-AR10is SAS/SATA
Controller)

MFC after:	2 weeks
2008-05-10 01:27:23 +00:00
Alan Cox
2d17f90775 Add a stub for pmap_align_superpage() on machines that don't (yet)
implement pmap-level support for superpages.
2008-05-09 23:31:42 +00:00
Julian Elischer
1d60f0ffa3 bump __FreeBSD_version 2008-05-09 23:15:56 +00:00
Julian Elischer
8b07e49a00 Add code to allow the system to handle multiple routing tables.
This particular implementation is designed to be fully backwards compatible
and to be MFC-able to 7.x (and 6.x)

Currently the only protocol that can make use of the multiple tables is IPv4
Similar functionality exists in OpenBSD and Linux.

From my notes:

-----

  One thing where FreeBSD has been falling behind, and which by chance I
  have some time to work on is "policy based routing", which allows
  different
  packet streams to be routed by more than just the destination address.

  Constraints:
  ------------

  I want to make some form of this available in the 6.x tree
  (and by extension 7.x) , but FreeBSD in general needs it so I might as
  well do it in -current and back port the portions I need.

  One of the ways that this can be done is to have the ability to
  instantiate multiple kernel routing tables (which I will now
  refer to as "Forwarding Information Bases" or "FIBs" for political
  correctness reasons). Which FIB a particular packet uses to make
  the next hop decision can be decided by a number of mechanisms.
  The policies these mechanisms implement are the "Policies" referred
  to in "Policy based routing".

  One of the constraints I have if I try to back port this work to
  6.x is that it must be implemented as a EXTENSION to the existing
  ABIs in 6.x so that third party applications do not need to be
  recompiled in timespan of the branch.

  This first version will not have some of the bells and whistles that
  will come with later versions. It will, for example, be limited to 16
  tables in the first commit.
  Implementation method, Compatible version. (part 1)
  -------------------------------
  For this reason I have implemented a "sufficient subset" of a
  multiple routing table solution in Perforce, and back-ported it
  to 6.x. (also in Perforce though not  always caught up with what I
  have done in -current/P4). The subset allows a number of FIBs
  to be defined at compile time (8 is sufficient for my purposes in 6.x)
  and implements the changes needed to allow IPV4 to use them. I have not
  done the changes for ipv6 simply because I do not need it, and I do not
  have enough knowledge of ipv6 (e.g. neighbor discovery) needed to do it.

  Other protocol families are left untouched and should there be
  users with proprietary protocol families, they should continue to work
  and be oblivious to the existence of the extra FIBs.

  To understand how this is done, one must know that the current FIB
  code starts everything off with a single dimensional array of
  pointers to FIB head structures (One per protocol family), each of
  which in turn points to the trie of routes available to that family.

  The basic change in the ABI compatible version of the change is to
  extent that array to be a 2 dimensional array, so that
  instead of protocol family X looking at rt_tables[X] for the
  table it needs, it looks at rt_tables[Y][X] when for all
  protocol families except ipv4 Y is always 0.
  Code that is unaware of the change always just sees the first row
  of the table, which of course looks just like the one dimensional
  array that existed before.

  The entry points rtrequest(), rtalloc(), rtalloc1(), rtalloc_ign()
  are all maintained, but refer only to the first row of the array,
  so that existing callers in proprietary protocols can continue to
  do the "right thing".
  Some new entry points are added, for the exclusive use of ipv4 code
  called in_rtrequest(), in_rtalloc(), in_rtalloc1() and in_rtalloc_ign(),
  which have an extra argument which refers the code to the correct row.

  In addition, there are some new entry points (currently called
  rtalloc_fib() and friends) that check the Address family being
  looked up and call either rtalloc() (and friends) if the protocol
  is not IPv4 forcing the action to row 0 or to the appropriate row
  if it IS IPv4 (and that info is available). These are for calling
  from code that is not specific to any particular protocol. The way
  these are implemented would change in the non ABI preserving code
  to be added later.

  One feature of the first version of the code is that for ipv4,
  the interface routes show up automatically on all the FIBs, so
  that no matter what FIB you select you always have the basic
  direct attached hosts available to you. (rtinit() does this
  automatically).

  You CAN delete an interface route from one FIB should you want
  to but by default it's there. ARP information is also available
  in each FIB. It's assumed that the same machine would have the
  same MAC address, regardless of which FIB you are using to get
  to it.

  This brings us as to how the correct FIB is selected for an outgoing
  IPV4 packet.

  Firstly, all packets have a FIB associated with them. if nothing
  has been done to change it, it will be FIB 0. The FIB is changed
  in the following ways.

  Packets fall into one of a number of classes.

  1/ locally generated packets, coming from a socket/PCB.
     Such packets select a FIB from a number associated with the
     socket/PCB. This in turn is inherited from the process,
     but can be changed by a socket option. The process in turn
     inherits it on fork. I have written a utility call setfib
     that acts a bit like nice..

         setfib -3 ping target.example.com # will use fib 3 for ping.

     It is an obvious extension to make it a property of a jail
     but I have not done so. It can be achieved by combining the setfib and
     jail commands.

  2/ packets received on an interface for forwarding.
     By default these packets would use table 0,
     (or possibly a number settable in a sysctl(not yet)).
     but prior to routing the firewall can inspect them (see below).
     (possibly in the future you may be able to associate a FIB
     with packets received on an interface..  An ifconfig arg, but not yet.)

  3/ packets inspected by a packet classifier, which can arbitrarily
     associate a fib with it on a packet by packet basis.
     A fib assigned to a packet by a packet classifier
     (such as ipfw) would over-ride a fib associated by
     a more default source. (such as cases 1 or 2).

  4/ a tcp listen socket associated with a fib will generate
     accept sockets that are associated with that same fib.

  5/ Packets generated in response to some other packet (e.g. reset
     or icmp packets). These should use the FIB associated with the
     packet being reponded to.

  6/ Packets generated during encapsulation.
     gif, tun and other tunnel interfaces will encapsulate using the FIB
     that was in effect withthe proces that set up the tunnel.
     thus setfib 1 ifconfig gif0 [tunnel instructions]
     will set the fib for the tunnel to use to be fib 1.

  Routing messages would be associated with their
  process, and thus select one FIB or another.
  messages from the kernel would be associated with the fib they
  refer to and would only be received by a routing socket associated
  with that fib. (not yet implemented)

  In addition Netstat has been edited to be able to cope with the
  fact that the array is now 2 dimensional. (It looks in system
  memory using libkvm (!)). Old versions of netstat see only the first FIB.

  In addition two sysctls are added to give:
  a) the number of FIBs compiled in (active)
  b) the default FIB of the calling process.

  Early testing experience:
  -------------------------

  Basically our (IronPort's) appliance does this functionality already
  using ipfw fwd but that method has some drawbacks.

  For example,
  It can't fully simulate a routing table because it can't influence the
  socket's choice of local address when a connect() is done.

  Testing during the generating of these changes has been
  remarkably smooth so far. Multiple tables have co-existed
  with no notable side effects, and packets have been routes
  accordingly.

  ipfw has grown 2 new keywords:

  setfib N ip from anay to any
  count ip from any to any fib N

  In pf there seems to be a requirement to be able to give symbolic names to the
  fibs but I do not have that capacity. I am not sure if it is required.

  SCTP has interestingly enough built in support for this, called VRFs
  in Cisco parlance. it will be interesting to see how that handles it
  when it suddenly actually does something.

  Where to next:
  --------------------

  After committing the ABI compatible version and MFCing it, I'd
  like to proceed in a forward direction in -current. this will
  result in some roto-tilling in the routing code.

  Firstly: the current code's idea of having a separate tree per
  protocol family, all of the same format, and pointed to by the
  1 dimensional array is a bit silly. Especially when one considers that
  there is code that makes assumptions about every protocol having the
  same internal structures there. Some protocols don't WANT that
  sort of structure. (for example the whole idea of a netmask is foreign
  to appletalk). This needs to be made opaque to the external code.

  My suggested first change is to add routing method pointers to the
  'domain' structure, along with information pointing the data.
  instead of having an array of pointers to uniform structures,
  there would be an array pointing to the 'domain' structures
  for each protocol address domain (protocol family),
  and the methods this reached would be called. The methods would have
  an argument that gives FIB number, but the protocol would be free
  to ignore it.

  When the ABI can be changed it raises the possibilty of the
  addition of a fib entry into the "struct route". Currently,
  the structure contains the sockaddr of the desination, and the resulting
  fib entry. To make this work fully, one could add a fib number
  so that given an address and a fib, one can find the third element, the
  fib entry.

  Interaction with the ARP layer/ LL layer would need to be
  revisited as well. Qing Li has been working on this already.

  This work was sponsored by Ironport Systems/Cisco

Reviewed by:    several including rwatson, bz and mlair (parts each)
Obtained from:  Ironport systems/Cisco
2008-05-09 23:03:00 +00:00
Robert Watson
da47740afb Trim trailing whitespace at ends of lines. 2008-05-09 20:38:25 +00:00
John Baldwin
7fb547c7f5 Set D_TRACKCLOSE to avoid a race in devfs that could lead to orphaned bpf
devices never getting fully closed.

MFC after:	3 days
2008-05-09 19:29:08 +00:00
Alan Cox
d3249b142b Introduce pmap_align_superpage(). It increases the starting virtual
address of the given mapping if a different alignment might result in more
superpage mappings.
2008-05-09 16:48:07 +00:00
Doug Rabson
06c85cef9d When blocking on an F_FLOCK style lock request which is upgrading a
shared lock to exclusive, drop the shared lock before deadlock
detection.

MFC after: 2 days
2008-05-09 10:34:23 +00:00
Pawel Jakub Dawidek
b109dd74fe - Export HZ value via kern.hz sysctl (this is the same name as for the
loader tunable).
- Document other sysctls in this file and also mark them as loader tunable
  via CTLFLAG_RDTUN flag.

Reviewed by:	roberto
2008-05-09 07:42:02 +00:00
John Baldwin
790fce68dd Always bump tcpstat.tcps_badrst if we get a RST for a connection in the
syncache that has an invalid SEQ instead of only doing it when we suceed
in mallocing space for the log message.

MFC after:	1 week
Reviewed by:	sam, bz
2008-05-08 22:21:09 +00:00
Xin LI
7ed8ac61e6 Add ID for HTC PPC6700 Modem.
Submitted by:	Kris Moore <kris pcbsd com>
MFC after:	3 days
2008-05-08 21:22:27 +00:00
Marius Strobl
0352f67204 - Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro;
for UPA it should have fulfilled its purpose by now and Fireplane-
  and JBus-based machines are way to messy in organization to implement
  something equivalent.
- Fix a bunch of style(9) bugs.
2008-05-08 21:10:39 +00:00
Marius Strobl
505fa17d15 Remove #if 0'ed code referencing no longer existent ecache_flush(). 2008-05-08 21:02:07 +00:00
Marius Strobl
745335b24d Use <machine/intr_machdep.h> directly instead of depending on header
pollution in the otherwise unused <sys/pcpu.h>.
2008-05-08 20:57:08 +00:00
Peter Grehan
a384947e92 Fix panic and breakage for non-DMA ATA devices e.g. powermac macio cells.
Handle cases where dma function pointers may be NULL, and where
the max_iosize can't be derived from a DMA data structure. For
the latter, revert to the prior behaviour of using DFLTPHYS for
the max i/o size when there is no other data.

Reviewed by:		marcel
No objection by:	sos
2008-05-08 17:55:44 +00:00
Scott Long
9fc852229b The BCE chips appear to have an undocumented requirement that RX frames be
aligned on an 8 byte boundary.  Prior to rev 1.36 this wasn't a problem
because mbuf clusters tend be naturally aligned.  The switch to using
split buffers with the first buffer being the embedded data area of the
mbuf has broken this assumption, at least on i386, causing a complete
failure of RX functionality.  Fix this for now by using a full cluster for
the first RX buffer.  A more sophisticated approach could be done with the
old buffer scheme to realign the m_data pointer with m_adj(), but I'm also
not clear on performance benefits of this old scheme or the performance
implications of adding an m_adj() call to every allocation.
2008-05-08 15:05:38 +00:00
Attilio Rao
688b98135c Add a new witness sysctl which returns the relations between any lock
and its children in the form:
"parent","child"
so that head and bottom of an oriented graph can be easilly detected and
various form of diagrams can be build.
The sysctl is called debug.witness.graphs and it is read-only; in order
to get the list of relations, a simple:
#sysctl debug.witness.graphs
will do the trick.

This approach has been choosen in order to support easilly things like
the DOT format and such.  Soon, an auto-explicative awk script, which
filters simple informations returned by the sysctl and converts them into
a real DOT script, will be committed to the repository between examples.

Discussed with:	rwatson
2008-05-07 21:41:36 +00:00
Marius Strobl
083b2bd41a - Use the name returned by device_get_nameunit(9) for the name of the
counter-timer timecounter so the associated SYSCTL nodes don't clash on
  machines having multiple U2P and U2S bridges as well as establishing a
  clear mapping between these bridges and their timecounter device.
- Don't bother setting up a "nice" name for the IOMMU, just use the name
  returned by device_get_nameunit(9), too.
- Fix some minor style(9) bugs.
- Use __FBSDID in counter.c

MFC after:	1 week
2008-05-07 21:22:15 +00:00
John Baldwin
06d0d0e274 Don't explicitly drop Giant around d_open/d_fdopen/d_close for MPSAFE
drivers.  Since devfs is already marked MPSAFE it shouldn't be held
anyway.

MFC after:	2 weeks
Discussed with:	phk
2008-05-07 19:03:57 +00:00
Daichi GOTO
3af387c9d2 - change function name from *_vdir to *_vnode because
VSOCK has been added as cache target. Now they process
  not only VDIR but also VSOCK.
- fixed panic issue caused by cache incorrect free process
  by "umount -f"

Submitted by:	Masanori OZAWA <ozawa@ongs.co.jp>
MFC after:	1 week
2008-05-07 05:32:55 +00:00
Julian Elischer
4e77d2552e Fix spelling in comment. 2008-05-06 22:41:23 +00:00
John Baldwin
ee98c4a50e Add a new personality to mpt(4) devices to allow userland applications to
perform various operations on a controller.  Specifically, for each mpt(4)
device, create a character device in devfs which accepts ioctl requests for
reading and writing configuration pages and performing RAID actions.

MFC after:	1 week
Reviewed by:	scottl
2008-05-06 20:49:53 +00:00
Kip Macy
77c4b91b9b fix build 2008-05-06 17:45:54 +00:00
Kip Macy
e7989722c0 only build iw_cxgb on i386 and amd64 2008-05-06 02:31:27 +00:00
Robert Watson
7d8ab8bafb When testing whether to enter the audit argument gathering code, rather
than checking whether audit is enabled globally, instead check whether
the current thread has an audit record.  This avoids entering the audit
code to collect argument data if auditing is enabled but the current
system call is not of interest to audit.

MFC after:	1 week
Sponsored by:	Apple, Inc.
2008-05-06 00:32:23 +00:00
Kip Macy
8ab7ce7c61 replace spaces added in last change with tabs 2008-05-05 23:13:27 +00:00
Kip Macy
71dba7f30c conditionally define PANIC_IF, remove 'unlikely' 2008-05-05 22:37:21 +00:00
Kip Macy
53d68f000f add rdma to build for i386 and amd64 2008-05-05 20:41:54 +00:00
Kip Macy
713edd3a06 LINT fixes 2008-05-05 20:41:10 +00:00
Kip Macy
7df01cd583 add iw_cxgb to the build 2008-05-05 20:21:20 +00:00
Kip Macy
d9d41e2780 add makefiles for rdma 2008-05-05 20:19:33 +00:00
Kip Macy
535fbad68f add rcv_nxt, snd_nxt, and toe offload id to FreeBSD-specific
extension fields for tcp_info
2008-05-05 20:13:31 +00:00
Kip Macy
c8c7ad9260 add malloc flag to blist so that it can be used in ithread context
Reviewed by: alc, bsdimp
2008-05-05 19:48:54 +00:00
Kip Macy
805dc5adca conditionally define PANIC_IF 2008-05-05 19:39:20 +00:00
John Baldwin
be00f6053b Fix a few edge cases with error handling in cpufreq(4)'s CPUFREQ_GET()
method:
- If the last of the child cpufreq drivers returns an error while trying to
  fetch its list of supported frequencies but an earlier driver found the
  requested frequency, don't return an error to the caller.
- If all of the child cpufreq drivers fail and the attempt to match the
  frequency based on 'cpu_est_clockrate()' fails, return ENXIO rather than
  returning success and returning a frequency of CPUFREQ_VAL_UNKNOWN.

MFC after:	3 days
PR:		kern/121433
Reported by:	Eugene Grosbein  eugen ! kuzbass dot ru
2008-05-05 19:13:52 +00:00
Kip Macy
66f645e768 import support for iwarp on Chelsio T3 card
Supported by Chelsio Inc.
2008-05-05 18:46:18 +00:00
Bjoern A. Zeeb
4f0794ff96 Use a better approach to force the interrupt which should work for
all cards/modes.
In addition to the intr forcing added with rev. 1.205 adopt the other
places to use the same logic.

We need to exclude a few chips/revisions (5700, 5788) from using the
enhanced version and fall back to the old way as that is the only
method they support.

Tested by:	phk
Suggested by:	davidch, Broadcom (thanks a lot for the help!)
MFC after:	16 days
2008-05-05 18:42:17 +00:00
Kip Macy
e68ff39887 Import basic common and iwarp kernel RDMA infrastructure.
Supported by: Chelsio Inc.
2008-05-05 18:35:55 +00:00
Peter Wemm
f2db8876a0 Spell KDB_REQ_REBOOT correctly. 2008-05-05 08:25:46 +00:00
Kip Macy
ed0fb18dc6 MFSVN:
- add / remove clients from cxgb_main.c now
 - change ifdef TOE_ENABLED to TCP_OFFLOAD_DISABLE
 - update copyrights
 - fix transmit data mismatch bug caused by not setting SB_NOCOALESCE
   on tx sockbuf on passive connections
 - fix receive sequence mismatch bug caused by not setting SB_NOCOALESCE
   on rx sockbuf on passive connections
 - don't sleep without checking SBS_CANTRCVMORE first
 - various ddp ordering fixes

Supported by: Chelsio Inc.
2008-05-05 01:41:53 +00:00
Peter Wemm
43d7128c14 Expand kdb_alt_break a little, most commonly used with the option
ALT_BREAK_TO_DEBUGGER.  In addition to "Enter ~ ctrl-B" (to enter the
debugger), there is now "Enter ~ ctrl-P" (force panic) and
"Enter ~ ctrl-R" (request clean reboot, ala ctrl-alt-del on syscons).

We've used variations of this at work.  The force panic sequence is
best used with KDB_UNATTENDED for when you just want it to dump and
get on with it.

The reboot request is a safer way of getting into single user than
a power cycle.  eg: you've hosed the ability to log in (pam, rtld, etc).
It gives init the reboot signal, which causes an orderly reboot.

I've taken my best guess at what the !x86 and non-sio code changes
should be.

This also makes sio release its spinlock before calling KDB/DDB.
2008-05-04 23:29:38 +00:00
Marius Strobl
10eee905ca Restore SUBDIR+= accidentally removed in the previous revision.
Pointed out by:	ariff
2008-05-04 16:02:45 +00:00
Marius Strobl
07f35f4b9a Don't build unused SBus front-ends for sun4v, don't build EBus front-ends
which are also likely to be irrelevant for sun4v (there's no SBus on sun4v
and only some EBus devices). While at it fix some style bugs according to
style.Makefile(5) where appropriate.

MFC after:	3 days
2008-05-04 14:59:25 +00:00
Attilio Rao
60e2edce55 sync_vnode() has some messy code about locking in order to deal with
mount fs needing Giant to be held when processing bufobjs.
Use a different subqueue for pending workitems on filesystems requiring
Giant. This simplifies the code notably and also reduces the number of
Giant acquisitions (and the whole processing cost).

Suggested by:	jeff
Reviewed by:	kib
Tested by:	pho
2008-05-04 13:54:55 +00:00
Sam Leffler
72d9df0aa4 o unbreak handling of TKIP tx-only keys for splitmic chips
o yank compat support for hal's older than 0.9.20.3; leave a
  CTASSERT in place just in case
2008-05-03 21:55:02 +00:00
Sam Leffler
ca8769184c add back sysctl's to display the regdomain and country code from eeprom;
useful for debugging
2008-05-03 21:52:05 +00:00
Oleksandr Tymoshenko
956bb0e01e Add FLT_EVAL_METHOD and DECIMAL_DIG, required by C99 standard.
Approved by:	cognet (mentor)
2008-05-03 21:04:21 +00:00
Warner Losh
957d0a092d A couple of cameras that I recently bought 2008-05-03 20:06:15 +00:00
Warner Losh
71a36ddcef These files are unused, so remove them for now. If they turn out to
be needed later, they can be restored.
2008-05-03 19:57:45 +00:00
Sam Leffler
74c9465320 enable IEEE80211_AMDPU_AGE by default 2008-05-03 17:06:59 +00:00
Sam Leffler
6c26723b19 enable IEEE80211_DEBUG and IEEE80211_AMPDU_AGE by default 2008-05-03 17:05:38 +00:00
Dmitry Morozovsky
03bc210eb9 Fix build, together with a bit of style breakage. 2008-05-02 18:54:36 +00:00
Warner Losh
8710c0c16e This file is unused, so remove it for now. 2008-05-02 18:03:00 +00:00
Marius Strobl
0b5a77c6a4 Remove an header which is unused for sun4v.
MFC after:	3 days
2008-05-02 17:44:18 +00:00
Marius Strobl
4755eb6411 Don't built the unused counter-timer abstraction.
MFC after:	3 days
2008-05-02 17:41:52 +00:00
Jung-uk Kim
a41aabe249 Restore multi-release tradition of the driver.
Reviewed by:	mjacob
2008-05-02 17:02:35 +00:00
Rui Paulo
029b1a164a Remove unused variable saved_id16.
Pointy hat to:	me
Pointed out by:	jhb
MFC after:	1 week
2008-05-02 10:16:41 +00:00
Sam Leffler
92172ed85a fix build w/ IEEE80211_DEBUG_REFCNT enabled 2008-05-01 20:26:25 +00:00
Bjoern A. Zeeb
63ccfe30a1 Use the correct bit when trying to force an interrupt through the HCC reg.
It's not a problem as this is a #ifdef notyet.
2008-05-01 13:10:03 +00:00
Andrew Thompson
3fec7550c6 Do not call ndis_setstate_80211() until we are ready to associate, the vap may
not have been created yet and will panic. This requires ndis_scan() to always
set the SSID.

Reported by:	Ben Kaduk
2008-05-01 05:11:33 +00:00
Andrew Thompson
31a8c1edd8 Unify all the wifi *_ioctl routines
- Limit grabbing the lock to SIOCSIFFLAGS.
 - Move ieee80211_start_all() to SIOCSIFFLAGS.
 - Remove SIOCSIFMEDIA as it is not useful.
 - Limit ether_ioctl to only SIOCGIFADDR. SIOCSIFADDR and SIOCSIFMTU have no
   affect as there is no input/output path in the vap parent.  The vap code
   will handle the reinit of the mac address changes.
 - Split off ndis_ioctl_80211 as it was getting too different to wired devices.

This fixes a copyout while locked and a lock recursion.

Reviewed by:		sam
2008-05-01 04:55:00 +00:00
Sam Leffler
a239061a54 re-enable WME by default; after a full day of testing on iwi I see no
issues and the only way we'll identify them is for people to use it
2008-05-01 03:49:59 +00:00
Julian Elischer
2182c0cfbf Attempt to make the print types more friendly to other architectures.
Prodded by: Max Laier
Help from: BMS, jhb
2008-04-30 20:00:30 +00:00
Kai Wang
8319f315be Add support for Microsoft Notebook Optical Mouse 3000 Model 1049.
Reviewed by:		imp
(RELENG-7) Tested by:	Oliver Herold <oliver@akephalos.de>
PR:			usb/121052
MFC after:		1 month
2008-04-30 19:37:54 +00:00
Sam Leffler
00389c7060 remove old code to handle mcast address changes; this is all done through
net80211 and pushed into the driver through non-ioctl callbacks
2008-04-30 17:00:32 +00:00
Sam Leffler
bfa82ae8b0 disable default enabling of WME until we resolve driver regressions 2008-04-30 16:05:57 +00:00
Oleksandr Tymoshenko
3600563911 Make ld use tradmips for output formats since we migrated to it.
Approved by:	cognet (mentor)
2008-04-30 12:44:58 +00:00
Alan Cox
5c1eb1ac80 Eliminate an unused field from the pmap. 2008-04-30 06:05:36 +00:00
Pyun YongHyeon
49b2d728a8 Don't panic even if bus_dmamap_load(9) was failed. Just return
ENOBUFS so callers can reuse previous mbuf.

Submitted by:	Oleg  (agile.quad AT gmail DOT com)
MFC after:	1 week
2008-04-30 02:49:24 +00:00
Marcel Moolenaar
1c17588fda mp_machdep.c is only conditional upon smp, not aim. If booke grows
support for smp, mp_machdep.c needs to be included as well.
2008-04-30 00:50:50 +00:00
Sam Leffler
549596aeaf fix build
Submitted by:	delphij
2008-04-30 00:11:08 +00:00
Julian Elischer
c59b9a7659 Document the kproc_kthread_add() call
and fix a small detail of its implementation.
MFC after: 1 week
2008-04-29 22:43:15 +00:00
Sam Leffler
a577a180db disable HT capabilities until we sort out firmware issues 2008-04-29 21:43:16 +00:00
Roman Divacky
d6891277a4 Lock filedesc exclusively when modifying fd_[cr]dir.
This is probably harmless but it's better to lock it
correctly.

Approved by:	kib (mentor)
2008-04-29 21:40:11 +00:00
Sam Leffler
3971d07be7 Intel 4965 wireless driver (derived from openbsd driver of the same name) 2008-04-29 21:36:17 +00:00
Julian Elischer
6eeac1d921 Add an option (compiled out by default)
to profile outoing packets for a number of mbuf chain
related parameters
e.g. number of mbufs, wasted space.
probably will do with further work later.

Reviewed by: various
2008-04-29 21:23:21 +00:00
Robert Watson
bcf5b9fa38 Fix a comment typo.
MFC after:	3 days
2008-04-29 21:21:15 +00:00
John Baldwin
38cc658ff6 Add support for the BCM5906[M] adapters. These adapters only support
10/100 operation and place the mailbox registers at a different offset.
They also do not have an EEPROM, so the MAC address must be read from
NVRAM instead.

MFC after:	1 month
PR:		kern/118975
Submitted by:	benjsc, Thomas Nyström  thn at saeab dot se
Submitted by:	sephe (original patch for DragonflyBSD)
2008-04-29 19:47:13 +00:00
Oleksandr Tymoshenko
578328c977 Define INLINE_LIMIT and additional CFLAGS for mips.
Approved by:	cognet (mentor)
2008-04-29 11:28:10 +00:00
Oleksandr Tymoshenko
ac0ddd0bc4 Define KINFO_PROC_SIZE for mips.
Approved by:	cognet (mentor)
2008-04-29 11:17:45 +00:00
David Xu
3bba58f287 Fix compiling problem. 2008-04-29 05:48:05 +00:00
David Xu
727158f6f6 Introduce command UMTX_OP_WAIT_UINT_PRIVATE and UMTX_OP_WAKE_PRIVATE
to allow userland to specify that an address is not shared by multiple
processes.
2008-04-29 03:48:48 +00:00
Warner Losh
8c3fa7a2c8 Add Epson DX8400 scanner.
PR: 123148
Submitted by: Bill Squire
2008-04-29 00:51:20 +00:00
Jung-uk Kim
f81a2a4956 Check packet directions more properly instead of just checking received
interface is null.

PR:		kern/123138
Submitted by:	Dmitry (hanabana at mail dot ru)
MFC after:	1 week
2008-04-28 19:42:11 +00:00
Alan Cox
2bc24aa956 Eliminate pointless casts from kmem_suballoc(). 2008-04-28 17:25:27 +00:00
Alan Cox
b8ca4ef2e3 vm_map_fixed(), unlike vm_map_find(), does not update "addr", so it can be
passed by value.
2008-04-28 05:30:23 +00:00
Marcel Moolenaar
01d8aa0d31 The first argment of mtdbatu or mtibatu is part of the encoding.
It needs to be constant, so eliminate the loop and "hand-unroll".
2008-04-28 03:04:41 +00:00
Marcel Moolenaar
12640815f8 MFp4: SMP support 2008-04-27 22:33:43 +00:00
Sam Leffler
7de3bc26a5 restore the hal's channel list when doing getradiocaps so it's in sync with
the 802.11 layer's list
2008-04-27 22:03:56 +00:00
Marcel Moolenaar
b66bd41daa Eliminate track_modified_needed(), better known as pmap_track_modified()
on other platforms.  We no longer need it because we do not create managed
mappings within the clean submap.

Pointed out by: alc
2008-04-27 21:04:54 +00:00
Marcel Moolenaar
9d5a22b928 MFp4: SMP support 2008-04-27 19:51:34 +00:00
Marcel Moolenaar
5f99a64689 Make sure tmpstk is aligned and make it 8KB in size -- not 8KB+16. 2008-04-27 19:03:14 +00:00
Marcel Moolenaar
6937461ee9 Remove mfsvr():
o  The function is defined unconditionally but depends on SPR_SVR,
   which is defined conditionally.
o  spr.h defines mfspr() and mtspr(), which is no worse to use.
2008-04-27 17:13:22 +00:00
Robert Watson
fa9e0a18af Fix include guard spelling.
MFC after:	3 days
Submitted by:	diego
2008-04-27 15:51:49 +00:00
Robert Watson
ae11a989e6 When writing trailers in sendfile(2), don't call kern_writev()
while holding the socket buffer lock.  These leads to an
immediate panic due to recursing the socket buffer lock.  This
bug was introduced in uipc_syscalls.c:1.240, but masked by
another bug until that was fixed in uipc_syscalls.c:1.269.

Note that the current fix isn't perfect, but better than
panicking: normally we guarantee that simultaneous invocations
of a system call to write on a stream socket won't be
interlaced, which is ensured by use of the socket buffer sleep
lock.  This is guaranteed for the sendfile headers, but not
trailers.  In practice, this is likely not a problem, but
should be fixed.

MFC after:	3 days
Pointy hat to:	andre (1.240), cperciva (1.269)
2008-04-27 15:50:00 +00:00
Alan Cox
d72d204094 Remove two unused declarations. These variables are now fields within
vm.h's struct kva_md_info.
2008-04-27 00:10:45 +00:00
Alan Cox
d239bfe45a Remove an XXX comment. sys/amd64/amd64/pmap.c revision 1.516 explains why
"pmap_initialized" no longer exists.
2008-04-27 00:06:01 +00:00
Alan Cox
3086a7a9b4 MFamd64 revision 1.544/i386 revision 1.549
Retire pmap_track_modified().  We no longer need it because we do not
  create managed mappings within the clean submap.  To prevent regressions,
  add assertions blocking the creation of managed mappings within the clean
  submap.

Approved by: imp
2008-04-26 22:39:58 +00:00
Marcel Moolenaar
46c00da6b5 Include the QUICC bus front-end in the module for PowerPC. 2008-04-26 18:41:42 +00:00
Marcel Moolenaar
6239f9e5f1 With rev 1.24 of sys/powerpc/powermac/macio.c, we now get a
total of 6 interrupt resources for scc(4) on macio(4). This
is 3 per channel, of which the 1st of each channel is the
interrupt associated with the SCC. The other 2 are for DMA
operation.
Change scc_bfe_attach() to accept an argument that's the
number of interrupts per channel (ipc) and change each bus
front-end (bfe) to pass that argument through a wrapper
for the device_attach method.

For now, we only allocate the 1st interrupt of each channel
to perserve behaviour.
2008-04-26 18:40:59 +00:00
Marcel Moolenaar
4924db935d Take into account the size of the interrupt cell. It's determined
by the parent for interrupt resources. This corrects parsing of
the interrupts property.

With parsing of the property fixed, add all interrupts to the
resource list. Bump the max. number of interrupts from 5 to 6
as scc(4) attached to macio(4) has 6 interrupts (3 per channel).

Submitted by: Nathan Whitehorn <nathanw@uchicago.edu>
2008-04-26 18:35:44 +00:00
Rafal Jaworowski
324eb73387 Recognize Cicada CS8244 phy chip (among others, can be found on MPC8572DS
development systems).

Obtained from:	Freescale, Semihalf
2008-04-26 18:07:24 +00:00
Rafal Jaworowski
8b79898eb7 Use RSTCR for resetting the MPC8572 (the old way does not apply).
Obtained from:	Freescale, Semihalf
2008-04-26 18:03:00 +00:00
Rafal Jaworowski
a1cd472a40 Introduce a dedicated file for MPC85xx-specific routines. Move cpu_reset()
there, as it's not relevant to Book-E specification, but is an implementation
detail, directly dependent on the given SoC version.
2008-04-26 17:57:29 +00:00
Rafal Jaworowski
8464af7949 Improve handling of Local Access Windows on MPC85xx systems:
- detect number of LAWs in run time and initalize accordingly
- introduce decode windows target IDs used in MPC8572
- other minor updates

Obtained from:	Freescale, Semihalf
2008-04-26 17:47:28 +00:00
Rafal Jaworowski
653b7b4943 Move System Revision defines to a bit better place, add MPC8572 systems IDs. 2008-04-26 17:39:55 +00:00
Rafal Jaworowski
90a37a5a28 Enable NFSLOCKD for MPC85XX kernel to comply with recent NFS rework. 2008-04-26 17:37:13 +00:00
Marius Strobl
c15fccb8f2 - Use the revamped code from the gem(4) PCI front-end, which
doesn't require parts of the Expansion ROM to be copied around,
  for obtaining the MAC address on !OFW platforms.
- Don't unnecessarily cache bus space tag and handle nor RIDs
  in the softcs of the front-ends.
- Don't use function calls in initializers.
- Let the SBus front-end depend on sbus(4).
2008-04-26 14:17:21 +00:00
Marius Strobl
44f8f2fc05 Remove some remnant alpha hacks.
Approved by:	PCI-maintainers (imp, jhb)
2008-04-26 14:13:48 +00:00
Kris Kennaway
5894445dad * Correct a mis-merge that leaked the PROC_LOCK [1]
* Return ENOENT on error instead of 0 [2]

Submitted by: rdivacky [1], kib [2]
2008-04-26 13:16:55 +00:00
Pawel Jakub Dawidek
3800322fe2 Implement 'show mount' command in DDB. Without argument, it prints short
info about all currently mounted file systems. When an address is given
as an argument, prints detailed info about the given mount point.

MFC after:	2 weeks
2008-04-26 13:04:48 +00:00
Marius Strobl
b7ee09f7b0 Remove the MD isa_irq_pending() and the underlying PCI-specific
infrastructure. Its only consumer ever was sio(4) and thus was
unused on sparc64 since removing the last traces of sio(4) in
sparc64 configuration files in favor for uart(4) over three
years ago. If similar functionality is required again it should
be brought back as an MD intr_pending() which works for all
busses by using for example interrupt controller hooks.
2008-04-26 11:01:38 +00:00
Marius Strobl
4eee14cb27 - Use more appropriate maxsize, nsegments and maxsegsize parameters
when creating the parent bus DMA tag. While at it correct the style
  and a nearby comment.
- Take advantage of m_collapse(9) for performance reasons.

MFC after:	2 weeks
2008-04-26 10:54:17 +00:00
Warner Losh
f601da1ce8 Add support for the Davicom DM9601.
Submitted by: William Grzybowski
2008-04-26 05:46:28 +00:00
Jack F Vogel
fff19d607b Opps,missed line in the fix... 2008-04-26 02:15:40 +00:00
Jack F Vogel
2056b4037c A change got dropped in the merge, add back 2008-04-25 23:22:01 +00:00
Jack F Vogel
20e8415eb4 This delta has a few important items:
PR 122839 is fixed in both em and in igb

Second, the issue on building modules since the static kernel
build changes is now resolved. I was not able to get the fancier
directory hierarchy working, but this works, both em and igb
build as modules now.

Third, there is now support in em for two new NICs, Hartwell
(or 82574) is a low cost PCIE dual port adapter that has MSIX,
for this release it uses 3 vectors only, RX, TX, and LINK. In
the next release I will add a second TX and RX queue. Also, there
is support here for ICH10, the followon to ICH9. Both of these are
early releases, general availability will follow soon.

Fourth: On Hartwell and ICH10 we now have IEEE 1588 PTP support,
I have implemented this in a provisional way so that early adopters
may try and comment on the functionality. The IOCTL structure may
change. This feature is off by default, you need to edit the Makefile
and add the EM_TIMESYNC define to get the code.

Enjoy all!!
2008-04-25 21:19:41 +00:00
Sam Leffler
d74e3f17f5 add rules for statically embedding ipw, iwi, ral, and wpi firmware modules 2008-04-25 20:42:48 +00:00
Sam Leffler
0095127918 hookup the parent device's if_input and if_output to stub routines
to catch unintended use (one might argue about if_output but it's
behaviour is ill-defined without vap context)

Noticed by:	Paul B. Mahol
2008-04-25 19:45:42 +00:00
Sam Leffler
48c89a5a29 remove scan task on state change so it doesn't unexpectedly fire
Noticed by:	Paul B. Mahol
2008-04-25 19:13:38 +00:00
Rui Paulo
edbb029388 Initialize tz_active to a new constant TZ_ACTIVE_UNKNOWN and make no
assumptions about the state of the cooling devices. Instead, switch them
off on init and, only after that, we are in TZ_ACTIVE_NONE.

Submited by:	Andriy Gapon <avg at icyb.net.ua>
Reviewed by:	njl
2008-04-25 16:45:13 +00:00
Marcel Moolenaar
fe39c042ca Unbreak previous commit. While here, refactor the code a bit. 2008-04-25 16:09:03 +00:00
Alan Cox
26b77ff3b1 Always use PG_PS_FRAME to extract the physical address of a 2/4MB page
from a PDE.
2008-04-25 16:00:39 +00:00
Robert Watson
92e6c2fd6d Rename debug.ddb.capture.bytes sysctl to debug.ddb.capture.bufoff in
order to match the internal variable name.

Add a new sysctl debug.ddb.capture.inprogress to export the inprogress
variable.

MFC after:	3 days
2008-04-25 13:23:36 +00:00
Daichi GOTO
fe5f08cda3 o Fixed multi thread access issue reported by Alexander V. Chernikov
(admin@su29.net)
  fixed: kern/109950

PR:		kern/109950
Submitted by:	Alexander V. Chernikov (admin@su29.net)
Reviewed by:	Masanori OZAWA (ozawa@ongs.co.jp)
MFC after:	1 week
2008-04-25 11:37:20 +00:00