Commit Graph

51498 Commits

Author SHA1 Message Date
tackerman
e6938cd35d Corrected a workaround that should only be applied to one adapter. Workaround
was causing device hangs when incorrectly applied to other adapters.

PR:		kern/66634
2005-01-01 19:57:23 +00:00
tackerman
e01f208ae1 Added device id support for Intel 82541ER and 82546GB dual port PCIE adapter.
PR:		 None
2005-01-01 19:54:39 +00:00
sos
f2c733ccbe Further update to the Promise code.
Support should now cover all old and current products.
2005-01-01 19:24:25 +00:00
se
7fcc15c5a8 Attempt to fix Symbios driver on amd64. The private memory allocation
function provided by the driver limits allocations to the page size,
i.e. 4KB on i385 and 8KB on typical 64 bit processors. Since amd64
has 64 bit pointers, but only 4KB pages, an array of pointers that
just fits into one page on all the other processors, does require
2 pages on amd64.

In order to make this driver useful on amd64, the allocation unit
has been increased to 2 pages on amd64 and contigmalloc() is used
instead of malloc(). All other processor types are unaffected by
this change. This modification has only been compile-tested on
amd64, yet, but should just work (FLW).
2005-01-01 19:05:46 +00:00
sam
8af7e8df05 Correct scan candidate selection logic for dual-band devices: prefer
candidate on 5Ghz channel to candidate on 2Ghz channel only when the
rssi are comparable (wasn't considering rssi).
2005-01-01 17:48:27 +00:00
sam
b89a9aca30 Eliminate some of the egregious bypass of the 802.11 state
machine; instead use the intended entry points.  There's still
too much incestuous knowledge about the internals of the
802.11 layer but this at least fixes adhoc mode.
2005-01-01 17:45:11 +00:00
wilko
2356f43f20 - make machine model list more comprehensive, the whole Alpha family tree
should now be present
- clean up comment a bit

MFC after: 1 week
2005-01-01 16:11:53 +00:00
imp
4272399838 Fix last second typos that crept in :-(. 2004-12-31 23:59:24 +00:00
sam
c5bfbdb959 remove netbsd rcsid lines; they are way out of date and we appear to be
diverging too much to make tracking these files worthwhile
2004-12-31 22:44:26 +00:00
sam
14fee97914 bump copyright for 2005 2004-12-31 22:42:38 +00:00
sam
141330c912 fixup inactivity timers:
o ic_inact_auth is a bad name, it's the inactivity threshold
  for being associated but not authorized; use it that way
o reset ni_inact when switching inactivity thresholds to
  minimize the race against the timer (don't want to lock
  for this stuff)
o change the inactivity probe threshold from a one-shot to
  cover a range: when below this threshold but not expired
  send a probe each inactivity interval; should probably
  guard against the interval being turned way down as this
  could cause us to spam the net with probes
2004-12-31 22:05:13 +00:00
sam
7c448457f6 Relearn how WPA keying is supposed to work and fix WPA+WME while
we're at it:
o WPA/802.11i has a unicast key and a group key; in station mode
  everything is sent with the unicast key--we were consulting the
  destination mac address and incorrectly using the group key
o (perpetuate fallback use of the default tx key to maintain
  compatibility with the way wpa_supplicant works)
o correct EAPOL encryption logic to check unicast key instead
  of assuming other state implies this
o move QoS encapsulation up to before enmic work so TKIP has the
  information required to calculate the pseudo-header
o do not do QoS-encapsulation of EAPOL frames as some ap's do the
  wrong thing with such frames (may need to revisit this if ap's
  start dropping non-QoS frames from stations assoc'd with QoS)
o move ieee80211_mbuf_adjust closer to its caller
2004-12-31 21:54:53 +00:00
sam
5a21ccb974 disable default use of wme until we can sort out interoperability issues;
users that want it can explicitly enable it
2004-12-31 21:48:15 +00:00
sam
fe8d9eb613 s/inline/__inline/ 2004-12-31 21:30:42 +00:00
sam
fe545f4516 compare pointers against NULL 2004-12-31 21:28:41 +00:00
sam
bb13d71061 make ap mode sta association debug msg as informative as sta mode 2004-12-31 21:27:53 +00:00
sam
95f27e450d do 11g erp station management in turboG mode too 2004-12-31 21:25:28 +00:00
sam
2cf886f5dc check if the node/station table is already present before creating one; this
can happen on an ibss merge
2004-12-31 21:22:12 +00:00
sam
886afd7287 include phy mode in scan debug msg 2004-12-31 21:19:59 +00:00
sam
e1832f531b accept IEEE80211_KEYIX_NONE for a default tx key 2004-12-31 21:13:35 +00:00
imp
0ccfc318ae dheader and hheader were the same function, really, so rename one of
them to header, kill the other and use both with a different arg...
2004-12-31 21:12:17 +00:00
sam
d54bd57731 don't return prematurely from processing a beacon or probe response frame
when associated; this corrects a problem where doing a scan while associated
caused the associated ap to sometimes not be included in the scan set
2004-12-31 21:11:59 +00:00
sam
f249744499 change ieee80211_parse_wmeparams to return a unique value when the ie
is invalid so we can distinguish this from needing a parameter update;
fixes dynamic update of wme parameters
2004-12-31 21:09:43 +00:00
sam
59c07f15bb remove stray \n from debug msg 2004-12-31 21:05:05 +00:00
sam
d5e5ef7858 clear wep bit in 802.11 header after crypto decap so packet
capture doesn't see it
2004-12-31 21:04:05 +00:00
imp
a4077d797e Use functions to make the program clearer. 2004-12-31 21:02:43 +00:00
sam
8c3a1cf5aa o add net.wlan.X.driver_caps mib variable for setting the driver capabilities
flags for testing
o debug msg consistency fixups
2004-12-31 21:01:41 +00:00
sam
e508073ee6 correct pseudo-mic header calculation for QoS frames 2004-12-31 20:59:03 +00:00
sam
4327f1ee6e whitespace/debug msg fixups 2004-12-31 20:58:06 +00:00
sam
83e6bc9990 add ieee80211_hdrspace and ieee80211_anyhdrspace to calculate the space
for an ieee80211 header taking into account padding requirements
2004-12-31 20:56:32 +00:00
sam
886a744d99 correct header length calculations on tx path for QoS-encapsulated frames
when IEEE80211_F_DATAPAD is set (e.g. ath); must use ieee80211_hdrspace
instead of ieee80211_hdrsize
2004-12-31 20:51:41 +00:00
imp
58871563b4 Implement device_quiesce. This method means 'you are about to be
unloaded, cleanup, or return ebusy of that's inconvenient.'  The
default module hanlder for newbus will now call this when we get a
MOD_QUIESCE event, but in the future may call this at other times.

This shouldn't change any actual behavior until drivers start to use it.
2004-12-31 20:47:51 +00:00
sam
0b07314057 const'ify ivp reference 2004-12-31 20:44:15 +00:00
imp
941b82eb40 Implement mimimum system software delays, per PCI PM 1.1 spec, as
suggested by Peter Edwards.  This seems to fix my fxp problems and
likely will fix his as well.  Use DELAY rather than *sleep because we
can be called from any context.
2004-12-31 20:43:46 +00:00
sam
ae02e9bff7 add/fixup debug msgs 2004-12-31 20:42:51 +00:00
sam
dfe3a547e6 s/inline/__inline/ 2004-12-31 20:39:41 +00:00
sam
11042819f1 expose ieee80211_phymode_name for use in debug msgs 2004-12-31 20:38:48 +00:00
sam
96c2d6273d correct some typos
Submitted by:	Tai-hwa Liang
2004-12-31 20:35:05 +00:00
sam
341ffa612f Radiotap fixups:
o catch one place where we were not using ath_chan_change to
  switch channels; this fixes a problem where the channel
  settings were not being correctly reported in captured packets
o return unique channel identification in the channel flags;
  ethereal gets confused if you return merged flags (e.g. ofdm,
  cck, and 2Ghz) (this is workaround and should be removed if
  we can ever cleanup radiotap consumers)
o correct short/long preamble flag state for rx and treat tx
  the same--use a new hwflags array that gives us the data
  based on the h/w rate index/cookie
o add gross hack to handle radiotap capture of frames that
  come in with hardware padding; should be replaced by a
  flag in the radiotap header and more smarts in the apps
  that decode radiotap data
2004-12-31 20:32:40 +00:00
sam
186275ec87 for parts that require split keycache entries report the
the index of the first entry on a mic error so we're
consistent with parts that don't have split keycache
2004-12-31 20:21:31 +00:00
sam
498543a7bd Correct beacon timer setup logic:
o lintval is in ms; must convert to TU's for passing to the hal
o roundup to calculate nexttbtt (should look at current tsf and pull the
  calculated nextbtt forward but this'll do for now)
o don't or- in HAL_BEACON_RESET_TSF when doing station timer setup; this
  is not needed and messes up the sleep timer calcs, though it's unclear
  if it mattered as the hal masks these values before use

Submitted by:	Thorsten von Eicken
2004-12-31 20:20:02 +00:00
sam
4f85af0286 no need to sweep the tx q's for node references in ath_node_free; we know
there are none since we're only called when the ref count goes to zero
2004-12-31 20:13:58 +00:00
sam
206e5f6044 cleanup some assertions 2004-12-31 20:11:23 +00:00
alc
db7aa8b882 Assert that page allocations during an interrupt specify
VM_ALLOC_INTERRUPT.

Assert that pages removed from the cache queue are not busy.
2004-12-31 19:50:45 +00:00
imp
702123653d First pass at shortening names. Likely more can be done. Generally
prefer ethernet and serial to \1 adapter.
2004-12-31 19:10:33 +00:00
imp
6c6ac1163b Eliminate the redundant/verbose portion of the company names.
Generally omit semiconductor, electronics, inc, corp, pny, ltd and the
like.

This saves almost 3k for the usb module.
2004-12-31 18:59:38 +00:00
imp
0a39eafc47 Finish merging usb vendors from NetBSD. 2004-12-31 18:37:49 +00:00
imp
09c78b5b33 Bump to 2005 for the new year. 2004-12-31 18:06:45 +00:00
rwatson
a2b4c64d17 Marginally reformat copyright statements to remove an excess ','. 2004-12-31 17:05:37 +00:00
jhb
33a905889d Add usbdevs_data.h to the SRCS list since usb_subr.c needs it. This forces
old usbdevs_data.h files to be updated as well as fixing the standalone
usb module build.
2004-12-31 16:05:07 +00:00
pjd
09d675e003 Be consistent and always use form 'return (value);' instead of 'return value;'.
We had (before this change) 84 lines where it was style(9)-clean and 15 lines
where it was not.
2004-12-31 14:52:53 +00:00
rwatson
942a2a4682 Add 'struct ipxpcb' forward declaration to ipx_var.h. I had this in
the netperf branch but for some reason didn't trigger a build failure
locally when I merged to CVS and omitted it.  Presumably driver error.

Pointed out by:	cperciva, tinderbox
2004-12-31 11:54:39 +00:00
julian
d00c78c192 Roger is away, note that his maintainership is
on vacation until he gets back. (hopefully next year)

Submitted by:	linimon
2004-12-31 09:18:29 +00:00
imp
f9d4c165ab Remove special case from *devs2h loop for usb
Move usb out of the loop since the other devs2h programs don't grok -h
Add new rule for usbdevs_data.h
2004-12-30 23:22:08 +00:00
imp
df030c4bd4 Call usbdevs2h with -h for .h file
Explicitly generate usbdevs_data.h for usb kernels with new -d switch
2004-12-30 23:19:40 +00:00
imp
ed702d58de Allow -d and -h as command line flags. These are used to generate
only the .h or _data.h files respectively.  Restructure code to allow
for this.
2004-12-30 23:18:34 +00:00
jhb
ad4d00347b Fix a typo and two whitespace nits. 2004-12-30 22:17:00 +00:00
jhb
3f307e93e3 Rework the interface between priority propagation (lending) and the
schedulers a bit to ensure more correct handling of priorities and fewer
priority inversions:
- Add two functions to the sched(9) API to handle priority lending:
  sched_lend_prio() and sched_unlend_prio().  The turnstile code uses these
  functions to ask the scheduler to lend a thread a set priority and to
  tell the scheduler when it thinks it is ok for a thread to stop borrowing
  priority.  The unlend case is slightly complex in that the turnstile code
  tells the scheduler what the minimum priority of the thread needs to be
  to satisfy the requirements of any other threads blocked on locks owned
  by the thread in question.  The scheduler then decides where the thread
  can go back to normal mode (if it's normal priority is high enough to
  satisfy the pending lock requests) or it it should continue to use the
  priority specified to the sched_unlend_prio() call.  This involves adding
  a new per-thread flag TDF_BORROWING that replaces the ULE-only kse flag
  for priority elevation.
- Schedulers now refuse to lower the priority of a thread that is currently
  borrowing another therad's priority.
- If a scheduler changes the priority of a thread that is currently sitting
  on a turnstile, it will call a new function turnstile_adjust() to inform
  the turnstile code of the change.  This function resorts the thread on
  the priority list of the turnstile if needed, and if the thread ends up
  at the head of the list (due to having the highest priority) and its
  priority was raised, then it will propagate that new priority to the
  owner of the lock it is blocked on.

Some additional fixes specific to the 4BSD scheduler include:
- Common code for updating the priority of a thread when the user priority
  of its associated kse group has been consolidated in a new static
  function resetpriority_thread().  One change to this function is that
  it will now only adjust the priority of a thread if it already has a
  time sharing priority, thus preserving any boosts from a tsleep() until
  the thread returns to userland.  Also, resetpriority() no longer calls
  maybe_resched() on each thread in the group. Instead, the code calling
  resetpriority() is responsible for calling resetpriority_thread() on
  any threads that need to be updated.
- schedcpu() now uses resetpriority_thread() instead of just calling
  sched_prio() directly after it updates a kse group's user priority.
- sched_clock() now uses resetpriority_thread() rather than writing
  directly to td_priority.
- sched_nice() now updates all the priorities of the threads after the
  group priority has been adjusted.

Discussed with:	bde
Reviewed by:	ups, jeffr
Tested on:	4bsd, ule
Tested on:	i386, alpha, sparc64
2004-12-30 20:52:44 +00:00
jhb
e3adf38617 Whitespace fix. 2004-12-30 20:30:58 +00:00
jhb
7b611b0cb2 Stop explicitly touching td_base_pri outside of the scheduler and simply
set a thread's priority via sched_prio() when that is the desired action.
The schedulers will start managing td_base_pri internally shortly.
2004-12-30 20:29:58 +00:00
jhb
5624553de4 Use NULL instead of 0 in a few places as well as various whitespace fixes. 2004-12-30 19:26:23 +00:00
jhb
a610dc93b7 Call tty_close() at the very end of ttyclose() since otherwise NULL
deferences can occur since tty_close() may end up freeing the tty structure
if it drops the last reference to it.

Glanced at by:	phk
2004-12-30 19:24:49 +00:00
jhb
e11d37605f Small whitespace fixes. 2004-12-30 19:14:48 +00:00
jhb
908aa564cb Minor sync to i386 GENERIC in the form of comments and whitespace. 2004-12-30 18:51:23 +00:00
jhb
4371c82dde Minor sync to alpha and i386:
- Add ADAPTIVE_GIANT and AHC_REG_PRETTY_PRINT.
- Indent SMP to match other options.
2004-12-30 18:31:53 +00:00
rwatson
a163a92e00 Use a global variable, ipxpcb_lport_cache, to cache the most recently
used IPX port number, rather than using the global ipxpcb list head.
2004-12-30 17:54:53 +00:00
rwatson
767b9c0b3e Convert netipx to use queue(9) doubly-linked lists instead of home-brew
linked lists for ipxpcb's.
2004-12-30 17:49:40 +00:00
rwatson
547414a25a Garbage collect unused (and incompletely implemented) functions:
- ipx_pcbnotify(), which is never called.
- ipx_rtchange(), which is never called, is incomplete inplemented, and
  also #ifdef notdef.
- spx_fixmtu(), which is never called, is incompletely implemented, and
  also #ifdef notdef.
2004-12-30 17:21:07 +00:00
rwatson
a0561a7c8f Constify ipx_zeronet, ipx_zerohost, ipx_broadnet, ipx_broadhost.
Remove 'allones' since the values of the broadcast network and
host variables are set statically.
2004-12-30 16:56:07 +00:00
rwatson
0e408bd381 Enable NCP build in NOTES so that it is visible in LINT. 2004-12-30 16:53:20 +00:00
jhb
e2efa66bd8 Sync with i386 GENERIC some:
- Update comments to newer style (space after #)
- Bring across various comment updates.
- Add AHC_REG_PRETTY_PRINT, ADAPTIVE_GIANT, and rue(4).
2004-12-30 15:32:31 +00:00
jhb
5011de5445 - Indent the comments beside the SMP options to the same level as all the
other comments.  Clarify that the next two things needed for SMP are
  two lines.
- Expand mii abbreviation to miibus for clarity in the USB ethernet
  comment.
2004-12-30 15:30:23 +00:00
rwatson
44386c7719 Make the sysctls kern.ipc.msgmnb and kern.ipc.msgtql into tunables as
is the case for most other sysctls in the System V IPC message queue
implementation.

PR:		75541
Submitted by:	Sergiy Vyshnevetskiy <serg at vostok dot net>
MFC after:	2 weeks
2004-12-30 13:56:34 +00:00
rwatson
21914e7845 mac_portacl.c no longer references vnode_if.h. 2004-12-30 13:49:01 +00:00
glebius
98b3df98e5 Remove a check that never returns true, because in this case we have panic
before the check.
2004-12-30 12:22:51 +00:00
anholt
39536d3f83 [1] Remove the generic bridge support from those drivers that had it. The
generic bridge support was biting us more than it helped, whenever a new chipset
came out from a vendor and misprogramming it caused strange hangs or corruption.
[2] Add a large number of PCI IDs based on what the linux drivers support.
Note that the new PCI IDs haven't been tested, they're just *likely* to work.
In particular the VIA AGP 8x chipsets are concerning, due to lack of testing,
possible issues (kern/69953), and not having a nice "does this bridge say it
would do 8x" function.  However, this shouldn't make the situation worse, since
these chips would have probed in the past anyway.
2004-12-30 07:18:58 +00:00
davidxu
6724b46563 Make umtx_wait and umtx_wake more like linux futex does, it is
more general than previous. It also lets me implement cancelable point
in thread library. Also in theory, umtx_lock and umtx_unlock can
be implemented by using umtx_wait and umtx_wake, all atomic operations
can be done in userland without kernel's casuptr() function.
2004-12-30 02:56:17 +00:00
obrien
642faa49fb Remove vnode_if.h for rev 1.14. 2004-12-29 21:50:44 +00:00
julian
7d4c614c90 Don't call ugen_destroy_devnodes(). it is called from ugen_set_config()
which is the very next line.

Submitted by:	stefanf
MFC after: 3 days
2004-12-29 21:36:43 +00:00
grehan
533c627057 Correctly initialise the 2nd kernel segment, and don't
forget to actually install it in the segment register.
This may fix some of the weird panics seen when kernel VM
is heavily used.
2004-12-29 09:41:40 +00:00
imp
b4eda5e471 We don't need to generate vnode_if.h anymore 2004-12-29 08:50:35 +00:00
imp
ec37c0493e No need to generate vnode_if.h anymore 2004-12-29 08:44:30 +00:00
imp
9f520936d6 Move WINBOND 4 port hub to its proper location in the file. It belongs
in a section of its own, not arbitrarily grouped in the hawking section
just because hawking sells it...
2004-12-29 06:21:41 +00:00
alc
f5297a787e Eliminate (now) unnecessary acquisition and release of the global page
queues lock.
2004-12-29 04:49:10 +00:00
alc
ec1a7d072a Access to the page's busy field is (now) synchronized by the containing
object's lock.  Therefore, the assertion that the page queues lock is held
can be removed from vm_page_io_start().
2004-12-29 04:18:22 +00:00
obrien
2287d5020d Add the Winbond made Hawking UH104 4-port hub.
Add a note where to find the offical USB assigned numbers.
2004-12-29 02:09:19 +00:00
julian
ad31868542 Rewrite ehci_abort_xfer() to use the method hinted at in the EHCI spec.
to remove a transaction from the async schedule. The previous method didn't
work well and led to the hardware writing to free'd buffers etc, as
it didn't always know that the transaction had been aborted.

Written after consultation with David Brownell who wrote the Linux
EHCI driver.

As part of this give the sqh structure a "previous" pointer.

MFC after:	1 week
2004-12-29 01:21:18 +00:00
jb
08d2181db1 Pass an explicit pointer to the bus structure in the 'usb' device ivar
rather than a softc pointer (with the bus structure at the start).

This is a non-functional change. It just helps when reading the code to
know that the ehci, ohci and uhci drivers share the bus structure, not the
entire softc.
2004-12-28 22:17:10 +00:00
pjd
1955652326 Remove debug code. 2004-12-28 21:52:45 +00:00
jhb
38cd373d81 - Up the WITNESS_COUNT macro from 200 to 1024 to support the growing number
of lock types in the kernel.  This results in an increase of witness
  data usage from ~145k to ~280k on i386 for kernels with
  'options WITNESS'.
- Remove the unused witness malloc bucket.

Submitted by:	Michal Mertl mime at traveller dot cz (1)
2004-12-28 21:21:27 +00:00
glebius
dde029219c - Plug a memory leak in ng_netflow_cache_init().
- Initialize error to 0 in ng_netflow_flow_add() (a nop change).
- Update cache statistics holding workqueue mutex.

MFC after:	3 days
2004-12-28 12:11:32 +00:00
grehan
4215504a99 Don't probe for a disk unless explicitly enabled by a tunable.
This allows boot to proceed on a real system until the issue
of calling back into certain OpenFirmware calls (e.g. finddevice)
in thread context is understood.

(this commit only affects psim users, of which I think I am the
only one...)
2004-12-28 05:07:49 +00:00
rik
43775c98bd Add FR support to sppp (MFCronyx).
Silence on: net@, current@, hackers@.
No objections: joerg

Requested by: by many (mostly Cronyx) users for a long long time.
MFC after:	10 days

PR:		kern/21771, kern/66348
2004-12-28 00:07:57 +00:00
imp
695c7fd8be nos->now typo reported by njl 2004-12-27 18:58:57 +00:00
imp
d40b0cfe4b Add note about where major numbers are now assigned 2004-12-27 18:21:39 +00:00
imp
ffb690487c Formatting nits 2004-12-27 18:18:38 +00:00
pjd
b19cea505c Rewrite piece of code which I committed some time ago that allows to
show file name for 'mdconfig -l -u <x>' command.
This allows to preserve API/ABI compatibility with version 0 (that's why
I changed version number back to 0) and will allow to merge this change
to RELENG_5.

MFC after:	5 days
2004-12-27 17:20:06 +00:00
pjd
c06a300010 Fix mbuf leak.
Submitted by:	Johnny Eriksson <bygg@cafax.se>
MFC after:	5 days
2004-12-27 15:53:44 +00:00
rwatson
c2459d7b3f Attempt to slightly refine the print out from "show alllocks" -- list
the process and thread numbers/names on the same line rather than on
separate lines, and print the thread pointer not just the tid.
2004-12-27 10:47:08 +00:00
imp
5acf0361de Remove duplicate CHPRODUCTS entry.
Use tab religiously in the vendor section.
2004-12-27 06:58:05 +00:00
njl
35afd29392 MFi386: Restore cpu_reset proxy code to enable reset from ddb on an AP. 2004-12-27 06:42:25 +00:00
njl
ab65e3f13a Reduce diffs to i386. 2004-12-27 06:35:42 +00:00
njl
e8a219f1fc Restore the cpu_reset proxy code. It is needed if you want to reset the
system from an AP at runtime (i.e., calling cpu_reset from ddb).  Someday,
if we move to an NMI for stopping cpus instead, we can do away with this.

Requested by:	jhb
2004-12-27 06:15:03 +00:00
njl
c69ef42c38 Minor cleanup: Reduce stack usage in probe method. Outdent probe. Use
TRUE/FALSE instead of 1/0 for booleans.  Remove trailing and extra whitespace.
2004-12-27 05:42:32 +00:00
njl
827b202183 Remove trailing whitespace. 2004-12-27 05:36:47 +00:00
alc
1e5940b06a Note that access to the page's busy count is synchronized by the containing
object's lock.
2004-12-27 05:27:59 +00:00
kan
afd7d6f06b Do not vput(9) unlocked vnode and do not VREF it with the sole purpose
of vputting it back immediately.

Complained by:	DEBUG_VFS_LOCKS
2004-12-27 05:17:11 +00:00
jeff
94a75d08c3 - Unintentionally checked in a debugging panic. Remove that. 2004-12-26 23:21:48 +00:00
jeff
862fb71e5e - Remove a 4BSD specific hack since this will work on ULE too. 2004-12-26 22:56:51 +00:00
jeff
ceca9b8f9e - Fix a long standing problem where an ithread would not honor sched_pin().
- Remove the sched_add wrapper that used sched_add_internal() as a backend.
   Its only purpose was to interpret one flag and turn it into an int.  Do
   the right thing and interpret the flag in sched_add() instead.
 - Pass the flag argument to sched_add() to kseq_runq_add() so that we can
   get the SRQ_PREEMPT optimization too.
 - Add a KEF_INTERNAL flag.  If KEF_INTERNAL is set we don't adjust the SLOT
   counts, otherwise the slot counts are adjusted as soon as we enter
   sched_add() or sched_rem() rather than when the thread is actually placed
   on the run queue.  This greatly simplifies the handling of slots.
 - Remove the explicit prevention of migration for ithreads on non-x86
   platforms.  This was never shown to have any real benefit.
 - Remove the unused class argument to KSE_CAN_MIGRATE().
 - Add ktr points for thread migration events.
 - Fix a long standing bug on platforms which don't initialize the cpu
   topology.  The ksg_maxid variable was never correctly set on these
   platforms which caused the long term load balancer to never inspect
   more than the first group or processor.
 - Fix another bug which prevented the long term load balancer from working
   properly.  If stathz != hz we can't expect sched_clock() to be called
   on the exact tick count that we're anticipating.
 - Rearrange sched_switch() a bit to reduce indentation levels.
2004-12-26 22:56:08 +00:00
rwatson
b864ac486c Add "show alllocks" command to DDB, which dumps a list of processes
and threads currently holding sleep mutexes (and spin mutexes for
curthread).  This can be quite useful in looking for a lock condition
summary for a system, as it avoids manually iterating through threads
and processes to find all the interesting locks.

NB: "alllocks" is up there with "lockedvnods" for a bad argument for
show.

MFC after:	2 weeks
2004-12-26 22:52:24 +00:00
alc
5c1258faf6 Assert that the vm object is locked on entry to vm_page_sleep_if_busy();
remove some unneeded code.
2004-12-26 21:46:44 +00:00
rik
9df64a1b0d tsleep => msleep
read sys/kern/kern_synch.c, msleep ():

	KASSERT(timo != 0 || mtx_owned(&Giant) || mtx != NULL,
	    ("sleeping without a mutex"));

MFC after:	3 days
2004-12-26 20:47:41 +00:00
wilko
a992d5a728 LCA is 21066 and 21068. Add EV7 (bloody optimist.. :) 2004-12-26 13:23:01 +00:00
darrenr
7138e15544 * Remove some code that's in a #ifndef FreeBSD that's no longer used. 2004-12-26 09:09:29 +00:00
darrenr
7994bf8513 * The #ifdef's to cause mutex's for freebsd to be declared were meant to pick
up on USE_MUTEX being defined, but this patch
* Remove some code that's in a #ifndef FreeBSD that's no longer used.
2004-12-26 09:08:42 +00:00
imp
8aa567b09d More minor diff reduction against netbsd:
ADVANCELOGIC->AVANCELOGIC (nothing in the tree uses it, so safe to do)
sort HAGIWARA vendor entry
sort ACTIONTAR vendor entry
Minor change to SYSTEMTALKS vendor entry.
2004-12-26 07:48:46 +00:00
jeff
4739ea6908 - Run sched_userret() after thread_userret(). Before, sched_userret() would
lower the priority of the returning thread to a user priority before
   calling into thread_userret() which would call wakeup() which in turn would
   cause the returning thread to eventually context switch rather than
   completing its slice.  Allowing this thread to complete its slice first
   yields a 15% performance improvement in super-smack on my dual opteron with
   4BSD.
2004-12-26 07:30:35 +00:00
imp
be8bad5c95 Minor merges from NetBSD (up through 1.388):
Add $NetBSD$ in a comment at the top
Update copyright dates
Update header comment
Add some of the entries not present in FreeBSD's usbdevs file
Harmonize some descriptions with NetBSD where NetBSD's were shorter

More work needs to happen here, as there's many conflicting vendor
names.  There's also more harmonization that can happen before that
problem is tackled.

This was inspired by recent discussions, but none of the patches
posted were consulted to produce this commit.  Other, similar ones
will follow.
2004-12-26 07:14:55 +00:00
bmilekic
764e80eed7 Add my copyright and update Jeff's copyright on UMA source files,
as per his request.

Discussed with: Jeffrey Roberson
2004-12-26 00:35:12 +00:00
jeff
a5c50b5ce9 - Wrap the thread count adjustment in sched_load_add() and sched_load_rem()
so that we may place some ktr entries nearby.
 - Define other KTR_SCHED tracepoints so that we may graph the operation
   of the scheduler.
2004-12-26 00:16:24 +00:00
jeff
d378b46f4e - Remove earlier KTR_ULE tracepoints.
- Define new KTR_SCHED points so that we can graph the operation of the
   scheduler.
2004-12-26 00:15:33 +00:00
jeff
c2b9649e7a - Define KTR points for KTR_SCHED. 2004-12-26 00:14:21 +00:00
jeff
209356fff4 - Add KTR_SCHED to produce ktr data for sys/tools/sched/schedgraph.py. 2004-12-26 00:13:38 +00:00
rwatson
ed28e446cc Remove an errant blank line apparently introduced in
ip_output.c:1.194.
2004-12-25 22:59:42 +00:00
rwatson
894710c942 In the dropafterack case of tcp_input(), it's OK to release the TCP
pcbinfo lock before calling tcp_output(), as holding just the inpcb
lock is sufficient to prevent garbage collection.
2004-12-25 22:26:13 +00:00
rwatson
203f380ce7 Revert parts of tcp_input.c:1.255 associated with the header predicted
cases for tcp_input():

While it is true that the pcbinfo lock provides a pseudo-reference to
inpcbs, both the inpcb and pcbinfo locks are required to free an
un-referenced inpcb.  As such, we can release the pcbinfo lock as
long as the inpcb remains locked with the confidence that it will not
be garbage-collected.  This leads to a less conservative locking
strategy that should reduce contention on the TCP pcbinfo lock.

Discussed with: sam
2004-12-25 22:23:13 +00:00
phk
c2be0afd64 fix comment 2004-12-25 21:30:41 +00:00
pjd
0bb72c3b00 - Add genid field to the metadata which will allow to improve reliability a bit.
After this change, when component is disconnected because of an I/O error,
  it will not be connected and synchronized automatically, it will be logged
  as broken and skipped. Autosynchronization can occur, when component is
  disconnected (on orphan event) and connected again - there were no I/O
  error, so there is no need to not connected the component, but when there were
  writes while it wasn't connected, it will be synchronized.
  This fix cases, when component is disconnected because of I/O error and can be
  connected again and again.
- Bump version number.
- Implement backward compatibility mechanism. After this change when metadata in
  old version is detected, it is automatically upgraded to the new (current)
  version.
2004-12-25 19:17:47 +00:00
davidxu
9476ffbed8 Make _umtx_op() as more general interface, the final parameter needn't be
timespec pointer, every parameter will be interpreted by its opcode.
2004-12-25 13:02:50 +00:00
davidxu
7b03c7ecc4 1. introduce umtx_owner to get an owner of a umtx.
2. add const qualifier to umtx_timedlock and umtx_timedwait.
3. add missing blackets in umtx do_unlock_and_wait.
2004-12-25 12:49:35 +00:00
julian
aa3fdaa2ef Allow selection of a recording source on USB audio devices.
PR:		75316
Submitted by:	Kazuhito HONDA <kazuhito at ph dot noda dot tus dot ac dot jp>
Obtained from:	NetBSD plus changes
MFC after:	2 weeks
2004-12-25 08:55:52 +00:00
julian
88c3963f83 Allow recording on at least some USB audio devices.
PR:		75311
Submitted by:	Kazuhito HONDA <kazuhito at ph dot noda dot tus dot ac dot jp>
Obtained from:	NetBSD plus changes
MFC after:	2 weeks
2004-12-25 08:51:47 +00:00
julian
8f174b6991 Allow volume control on more channels/inputs
PR:		75276
Submitted by:	Kazuhito HONDA <kazuhito at ph dot noda dot tus dot ac dot jp>
Obtained from:	NetBSD  with changes
MFC after:	2 weeks
2004-12-25 08:46:03 +00:00
julian
3efa4df5f0 MFNetBSD:
One of a set of patches submitted by  Kazuhito HONDA
	to make the usb audio driver a lot more capable.

PR:	75274
Submitted by:	Kazuhito HONDA (kazuhito at ph dot noda dot tus dot ac dot jp)
Obtained from:	NetBSD (indirectly)
MFC after:	2 weeks
2004-12-25 06:20:49 +00:00
scottl
a5d798fc39 Darnit, through a maze of twisty passages, ipfilter needs to have PFIL_HOOKS
defined.  Revert part of the previous commit to fix this.
2004-12-25 00:48:27 +00:00
scottl
55b47ae071 Don't define PFIL_HOOKS. It's no longer required in RELENG_5 or HEAD. 2004-12-25 00:23:36 +00:00
scottl
86ae6cb590 Sprinkle in some __FreeBSD_version checks so that this compiles again. Don't
define PFIL_HOOKS anymore.

Submitted by: keramida
2004-12-25 00:22:25 +00:00
imp
74b159d497 Get rid of #ifdef for legacy system. Move that into the MD code.
Export minimal symbols to allow this to happen.
2004-12-24 23:03:17 +00:00
imp
5076ddfeb9 A few style(9) changes before more extensive changes:
o u_intXX_t -> uintXX_t
o use 8 character tabs
o proper wrapping
o return (value);
2004-12-24 22:31:47 +00:00
imp
bf7a1b0a6a Make the other pnp messages more explicit as well... 2004-12-24 22:18:19 +00:00
imp
ab05481bf9 Note when we're done probing PNP. There's been several reports over the
years of hangs that turned out to be in the PNP code.  Add an explicit end
marker so such hangs are more apparent.
2004-12-24 22:16:06 +00:00
imp
5c50c1723c Various style(9) items before of some more extensive work:
o return (value);
o u_intXX_t -> uintXX_t
o break lines
o consistantly use 8 space tab stops
o minor grammar nits in a few printfs
2004-12-24 22:08:57 +00:00
imp
97f535dc1f GC #if 0'd code. It can go away now... 2004-12-24 21:53:21 +00:00
alc
f16b9f1b30 Continue the transition from synchronizing access to the page's PG_BUSY
flag and busy field with the global page queues lock to synchronizing their
access with the containing object's lock.  Specifically, acquire the
containing object's lock before reading the page's PG_BUSY flag and busy
field in vm_fault().

Reviewed by: tegge@
2004-12-24 19:31:54 +00:00
scottl
4beab3afdd Identify USIIIi processors.
Submitted by: Gavin Atkinson
PR: 75468
2004-12-24 16:21:46 +00:00
mlaier
daae8e9dd0 Enable sk(4) for ATLQ.
Thoroughly tested by:	Ender <ender NO tog SPAM net>
MFC after:		4 weeks
2004-12-24 14:13:38 +00:00
sos
35197bc60b Loosen the probe a bit.
Try to get out of probing as early as possible on (hopefully) vacant
channels.
2004-12-24 13:38:25 +00:00
sos
ad59528a79 Update the Promise support for combo (SATA+PATA) controllers. 2004-12-24 13:36:04 +00:00
davidxu
da86559777 Add umtxq_lock/unlock around umtx_signal, fix debug kernel compiling,
let umtx_lock returns EINTR when it returns ERESTART, this lets
userland have chance to back off mtx lock code when needed.
2004-12-24 11:59:20 +00:00
davidxu
85fe4cfe89 1. Fix race condition between umtx lock and unlock, heavy testing
on SMP can explore the bug.
2. Let umtx_wake returns number of threads have been woken.
2004-12-24 11:30:55 +00:00
darrenr
f49c00bce2 Enable fine grained locking within IPFilter, using mtx(9) and sx(9) allowing
the the "needs giant" flag to be removed from the driver.
2004-12-24 09:14:26 +00:00
rik
9cd8396061 Fix creation on "dlciX" hook in ng_sample.
Approved by:	julian
MFC after:	3 days
2004-12-23 22:03:32 +00:00
ps
ad001884ff Turn NFS directio off until the stability issues are resolved. 2004-12-23 21:30:30 +00:00
pjd
9efcf672b9 Update disk->d_genid field when increasing sc->sc_genid. 2004-12-23 21:15:15 +00:00
jhb
f79ca8546c - Give the timer, thermal, and error LVT entries an interrupt vector even
though these aren't used yet.
- Add missing function prototypes for some static functions.
- Allow lvt_mode() to handle an LVT entry with a delivery mode of fixed.
- Consolidate code duplicated in lapic_init() and lapic_setup() to program
  the spurious vector register of a local APIC in a static lapic_enable()
  function.
- Dump the timer, thermal, error, and performance counter LVT entries
  during lapic_dump().
- Program LVT pins (currently only LINT0 and LINT1) after the local
  APIC has been software enabled via lapic_enable() since otherwise the
  LVT programming will not be able to unmask LVT sources.
2004-12-23 20:42:53 +00:00
jhb
59abe64294 Some small style fixes. 2004-12-23 20:35:51 +00:00
jhb
1666faecb2 Add some constants for the local APIC timer. 2004-12-23 20:35:07 +00:00
jhb
b74bf1946f Add a simple 'intrcnt_add' function that other MD code can use to add a
single named counter to the interrupt counts without having to fake up an
entire interrupt source.
2004-12-23 20:34:18 +00:00
alc
a618275b13 Modify pmap_enter_quick() so that it expects the page queues to be locked
on entry and it assumes the responsibility for releasing the page queues
lock if it must sleep.

Remove a bogus comment from pmap_enter_quick().

Using the first change, modify vm_map_pmap_enter() so that the page queues
lock is acquired and released once, rather than each time that a page
is mapped.
2004-12-23 20:16:11 +00:00
jhb
8aad935790 - Add a function to set the Task Priority Register (TPR) of the local APIC.
Currently this is only used to initiailize the TPR to 0 during initial
  setup.
- Reallocate vectors for the local APIC timer, error, and thermal LVT
  entries.  The timer entry is allocated from the top of the I/O interrupt
  range reducing the number of vectors available for hardware interrupts
  to 191.  Linux happens to use the same exact vector for its timer
  interrupt as well.  If the timer vector shared the same priority queue
  as the IPI handlers, then the frequency that the timer vector will
  eventually be firing at can interact badly with the IPIs resulting in
  the queue filling and the dreaded IPI stuck panics, hence it being located
  at the top of the previous priority queue instead.
- Fixup various minor nits in comments.
2004-12-23 19:47:59 +00:00
rik
508621c9df Fix counting length of leadin for hook name (sizeof () => strlen ()).
Approved by:    julian
MFC after:      3 days
2004-12-23 18:39:13 +00:00
glebius
0c4ff7ff77 Move systm.h up, since it is required by mbuf.h.
Requested by:	ru
2004-12-23 13:09:37 +00:00
glebius
1df5c03e4b - sort includes
- remove duplicate include sys/sysctl.h
2004-12-23 10:48:10 +00:00
imp
296ed3d95d Add recognition of O2Micro 711M1.
Submitted by: Gordon Bergling
2004-12-23 05:28:36 +00:00
rwatson
649bb26a69 Assert the sem lock in sem_ref() and sem_rel(), as it is required to
safely manipulate the reference count.
2004-12-23 02:22:47 +00:00
rwatson
986c9c7827 Attempt to consistently use () around return values in calls to
return() in newer code (sysctl, ISN, timewait).
2004-12-23 01:34:26 +00:00
rwatson
037f7c7ade Remove an XXXRW comment relating to whether or not the TCP timers are
MPSAFE: they are now believed to be.

Correct a typo in a second comment.

MFC after:	2 weeks
2004-12-23 01:27:13 +00:00
rwatson
44b000390e Remove the now unused tcp_canceltimers() function. tcpcb timers are
now stopped as part of tcp_discardcb().

MFC after:	2 weeks
2004-12-23 01:25:59 +00:00
rwatson
f55e651b25 Remove an annotation of a minor race relating to the update of
multiple MIB entries using sysctl in short order, which might
result in unexpected values for tcp_maxidle being generated by
tcp_slowtimo.  In practice, this will not happen, or at least,
doesn't require an explicit comment.

MFC after:	2 weeks
2004-12-23 01:21:54 +00:00
rwatson
e1ce7eb9ce Remove temporary debugging printf that was used to detect the presence
of a race that had previously caused a panic in order to determine if
the fix was for the right problem.  It was.

MFC after:	2 weeks
2004-12-23 01:19:27 +00:00
rwatson
f1732152a7 In sonewconn(), the s/if/while/ change to wait for room at the tail of
the accept queue is a feature, not a bug/issue, so remove the XXXRW
from the comment.
2004-12-23 01:16:21 +00:00
rwatson
5728709bda Remove an XXXRW indicating atomic operations might be used as a
substitute for a global mutex protecting the socket count and
generation number.

The observation that soreceive_rcvoob() can't return an mbuf
chain is a property, not a bug, so remove the XXXRW.

In sorflush, s/existing/previous/ for code when describing prior
behavior.

For SO_LINGER socket option retrieval, remove an XXXRW about why
we hold the mutex: this is correct and not dubious.

MFC after:	2 weeks
2004-12-23 01:07:12 +00:00
rwatson
fd297e3939 In soalloc(), simplify the mac_init_socket() handling to remove
unnecessary use of a global variable and simplify the return case.
While here, use ()'s around return values.

In sodealloc(), remove a comment about why we bump the gencnt and
decrement the socket count separately.  It doesn't add
substantially to the reading, and clutters the function.

MFC after:	2 weeks
2004-12-23 00:59:43 +00:00
pjd
b58db25ebe - Add genid field to the metadata which will allow to improve reliability a bit.
After this change, when component is disconnected because of an I/O error,
  it will not be connected and synchronized automatically, it will be logged
  as broken and skipped. Autosynchronization can occur, when component is
  disconnected (on orphan event) and connected again - there were no I/O
  error, so there is no need to not connected the component, but when there were
  writes while it wasn't connected, it will be synchronized.
  This fix cases, when component is disconnected because of I/O error and can be
  connected again and again.
- Bump version number.
- Add version change history.
- Implement backward compatibility mechanism. After this change when metadata in
  old version is detected, it is automatically upgraded to the new (current)
  version.
2004-12-22 23:09:32 +00:00
alc
04b2362b0f Add send buffer locking to uipc_send(). Without this locking a race can
occur between a reader and a writer that results in a panic upon close,
e.g.,
	"panic: sbflush_locked: cc 4 || mb 0xffffff0052afa400 || mbcnt 0"

Reviewed by: rwatson@
MFC after: 2 weeks
2004-12-22 20:28:46 +00:00
phk
cc0d4329c3 Include fcntl.h
Include selinfo.h (don't rely on vnode.h to do so)
Check O_NONBLOCK instead of IO_NELAY
Don't include vnode.h
2004-12-22 17:39:21 +00:00
phk
3fdb7bea32 Don't include filedesc.h
Include fcntl.h
Include selinfo.h (don't rely on vnode.h to do so)
Check O_NONBLOCK instead of IO_NDELAY
Don't include vnode.h
2004-12-22 17:38:43 +00:00
phk
0970167e88 Include fcntl.h
Check O_NONBLOCK instead of IO_NDELAY
Include uio.h
Don't include vnode.h
Don't include filedesc.h
2004-12-22 17:37:57 +00:00
phk
fbe7293f5a Include uio.h
Check O_NONBLOCK instead if IO_NDELAY
Don't include vnode.h
2004-12-22 17:37:14 +00:00
phk
66e2363925 Include fcntl.h
Check O_NONBLOCK instead of IO_NDELAY.
Include selinfo.h instead of relying on vnode.h to do so.
Don't include vnode.h
2004-12-22 17:36:38 +00:00
phk
8deec74094 Include fcntl.h
check O_NONBLOCK instead of IO_NDELAY
Don't include vnode.h.
2004-12-22 17:35:52 +00:00
phk
1273b3575c Include fcntl.h
check O_NONBLOCK instead of IO_NDELAY
don't include vnode.h
2004-12-22 17:34:53 +00:00
phk
52fb0f35d0 Include fcntl.h
Check O_NONBLOCK instead of IO_NDELAY
Don't include vnode.h
2004-12-22 17:34:25 +00:00
phk
76e8599a69 Check O_NONBLOCK instead of IO_NDELAY.
Don't include <sys/vnode.h>
2004-12-22 17:32:53 +00:00
phk
55f52615a8 Fix comment. 2004-12-22 17:32:27 +00:00
phk
9fa6e5be50 Don't include vnode.h.
Check O_NONBLOCK instead of IO_NDELAY
2004-12-22 17:31:44 +00:00
phk
bff8bad9d3 Don't include vnode.h 2004-12-22 17:31:10 +00:00
phk
56253832a8 Include fcntl.h not vnode.h.
Include uio.h instead of relying on vnode.h to do so.
Check O_NONBLOCK not IO_NDELAY.
2004-12-22 17:30:38 +00:00
phk
6ab1262cc8 Check O_NONBLOCK not IO_NDELAY.
Don't include vnode.h
2004-12-22 17:29:37 +00:00
phk
a7cd5bffca #include fcntl.h not vnode.h. Check O_NONBLOCK not IO_NDELAY. 2004-12-22 17:29:02 +00:00
phk
8e1e714930 #include of <sys/vnode.h> not necesary. 2004-12-22 17:28:34 +00:00
phk
c13e70487f Be consistent about flag values passed to device drivers read/write
methods:

Read can see O_NONBLOCK and O_DIRECT.

Write can see O_NONBLOCK, O_DIRECT and O_FSYNC.

In addition O_DIRECT is shadowed as IO_DIRECT for now for backwards
compatibility.
2004-12-22 17:05:44 +00:00
phk
4e6a1d00d2 Shuffle numeric values of the IO_* flags to match the O_* flags from
fcntl.h.

This is in preparation for making the flags passed to device drivers be
consistently from fcntl.h for all entrypoints.

Today open, close and ioctl uses fcntl.h flags, while read and write
uses vnode.h flags.
2004-12-22 16:25:50 +00:00
pjd
968f03faa7 Now, when force device destruction is done on shutdown, hide warning,
that device cannot be destroyed immediately, under debug=1.

Suggested by:	simon
2004-12-21 19:50:18 +00:00
pjd
c18c5197dc Improve reliability and clean up code a bit.
For more details check src/sys/geom/mirror/g_mirror.c rev.1.47,1.48,1.49,1.50.
2004-12-21 19:30:59 +00:00
alc
6e5db3a043 Use vtopde() instead of pmap_pde() in pmap_kextract(); vtopde() is smaller
and faster in cases, such as pmap_kextract(), where the pde is known to
exist.
2004-12-21 19:25:56 +00:00
pjd
c5ff5344f3 This should not be permitted, but some GEOM classes held the topology lock
while doing g_(read|write)_data() (e.g. BSD). This can cause a deadlock
in MIRROR class. Not sure if this is safe to drop the topology lock in BSD
class, so change the code in MIRROR class to avoid this deadlock.
2004-12-21 18:42:51 +00:00
pjd
27d828652f Implement g_topology_try_lock().
No objection from:	phk
2004-12-21 18:32:46 +00:00
ru
bb6ad7dcac NOFORTH -> NO_FORTH 2004-12-21 12:32:15 +00:00