Commit Graph

101103 Commits

Author SHA1 Message Date
marcel
22ad156e94 Assign thread IDs to kernel threads. The purpose of the thread ID (tid)
is twofold:
1. When a 1:1 or M:N threaded process dumps core, we need to put the
   register state of each of its kernel threads in the core file.
   This can only be done by differentiating the pid field in the
   respective note. For this we need the tid.
2. When thread support is present for remote debugging the kernel
   with gdb(1), threads need to be identified by an integer due to
   limitations in the remote protocol. This requires having a tid.

To minimize the impact of having thread IDs, threads that are created
as part of a fork (i.e. the initial thread in a process) will inherit
the process ID (i.e. tid=pid). Subsequent threads will have IDs larger
than PID_MAX to avoid interference with the pid allocation algorithm.
The assignment of tids is handled by thread_new_tid().

The thread ID allocation algorithm has been written with 3 assumptions
in mind:
1. IDs need to be created as fast a possible,
2. Reuse of IDs may happen instantaneously,
3. Someone else will write a better algorithm.
2004-04-03 15:59:13 +00:00
ru
c6b258b9f0 Recharge the watchdog timer if there's still some TX work left. 2004-04-03 15:55:21 +00:00
nectar
627777410a Correct a potential panic condition that could be caused when getting or
setting the VGA palette.

Reported by:	Christer Öberg <christer.oberg@texonet.com>
Reviewed by:	bde
2004-04-03 15:28:25 +00:00
peadar
38767798a3 Before MFC'ing the previous commit, I noticed I'd left out a case.
Add in missing case for i845G in the attach routine. I'll MFC this
with the rest of the change after the 4.10 codefreeze lifts.

Reviewed By: Doug Rabson
2004-04-03 13:24:37 +00:00
le
34e7a4a835 mdoc fix: put the end-of-list macro after the last list element.
Approved by:   grog (mentor)
2004-04-03 12:14:30 +00:00
alc
7da6088e9c In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it
should not.  Add a new parameter so that the caller can specify which is
the case.

Reported by:	dillon
2004-04-03 09:16:27 +00:00
alc
1eb591f7bd Microoptimize pagezero() based upon something that I learned writing the
optimized pagecopy().  This also has the virtual of making these two
functions more similar in style.
2004-04-03 05:33:10 +00:00
bms
37190ad339 This file was erroneously removed from HEAD when TCP-MD5 support was MFC'd;
correct this lameness.
2004-04-03 05:31:38 +00:00
sam
636c145e6d do proper subclassing of node free+copy; the previous hack falls apart when
the 802.11 layer does useful work

Obtained from:	madwifi
2004-04-03 03:33:02 +00:00
ru
f011572243 Fixed a few bugs in the rl(4) driver:
Under polling(4), we counted non-existent output packets and wasted
CPU cycles, corrected.  (PR kern/64975.)

The fix in revision 1.71 to correct resetting of the watchdog timer
was wrong.

In rl(4), the TX list does not have a gap between the consumer and
producer, so the "empty TX list" test was wrong, corrected.

Also, resetting the timer to five each time we know there is still
some TX work to do was a bad idea -- under polling(4), if the chip
goes out to lunch, this results in the watchdog routine to _never_
be called.  Instead, let the timer downgrade to zero and fire the
watchdog, then reset it to five when it is zero AND there is some
TX work left.  (Most other network drivers need this fix too.)

MFC after:	3 days
2004-04-03 00:42:33 +00:00
sam
49f5fd0acf do proper subclassing of node free+copy; the previous hack falls apart when
the 802.11 layer does useful work

Obtained from:	madwifi
2004-04-03 00:06:23 +00:00
sam
b668450d9b transmit beacon frames directly instead of defering them to a swi; there
was too much delay

Obtained from:	madwifi
2004-04-03 00:02:17 +00:00
sam
3a4f45cb3b update copyright notice for 2004 2004-04-02 23:57:10 +00:00
sam
48c4143215 add new statistics
Obtained from:	madwifi
2004-04-02 23:55:45 +00:00
sam
4ea284ad34 check more quickly (and directly) if an interrupt is pending; this reduces
work done in ath_intr when the irq is shared

Obtained from:	madwifi
2004-04-02 23:49:15 +00:00
sam
16cd6e700e cleanup descriptor allocation if attach fails
Obtained from:	madwifi
2004-04-02 23:47:39 +00:00
sam
ba407118dc remove use IEEE80211_C_RCVMGT 2004-04-02 23:37:00 +00:00
ru
b6778a99f6 Performance tuning.
Moved the RX ring resyncing code to ste_rxeoc(), and only run it
if we were asked to POLL_AND_CHECK_STATUS, under DEVICE_POLLING.
(This significantly reduces the CPU load.)

Improved the RX ring resyncing code by re-checking if the head
is still empty before doing resyncing.  This mostly affects the
DEVICE_POLLING mode, where we run this code periodically.  We
could start checking with an empty head (well, an empty ring
even), and after doing a few iterations, the chip might write
a few entries, including the head, and we would bogusly consider
this case as requiring resyncing.  On a test box, this reduced
the number of resyncs done by a factor of 10.

In ste_txeof(sc), only reset the watchdog timer to zero when
the TX list is completely empty.

Converted ste_tx_prev_idx to a pointer -- faster.

Removed some bitrot.
2004-04-02 23:36:49 +00:00
sam
4e8c6bb0d1 Change handling of probe response frames. Previously we always dropped the
refcnt on the node but left it in the node table.  This allows the node table
to hold the results of scanned ap's but for ibss scans left nodes w/o any
driver-private state setup and/or a bad refcnt (when the nodes were timed
out they were prematurely discarded).  Now we treat nodes identified for ap
scanning as before but force nodes discovered when scanning for ibss neighbors
to have complete/proper state and hold the refcnt on the node.  Any other
nodes created because of these frames are discarded directly (need to optimize
this case to eliminate various work that's immediately discarded).
2004-04-02 23:35:24 +00:00
sam
272d043fc1 Note previous commit also purges all node table entries collected while
do scanning when operating in adhoc mode.  This is necessary to insure
nodes in the table have a correct refcnt and driver-private state but is
suboptimal. A better solution is to probe undiscovered neighbors and use
the probe response to do the right thing (support for that comming in a
separate commit).
2004-04-02 23:28:38 +00:00
sam
2535ce0f9e fix adhoc/ibss operation for drivers that require host support (e.g. ath):
o remove IEEE80211_C_RCVMGT capability
o on transmit craft new nodes as needed using new ieee80211_find_txnode routine
o add ieee80211_find_txnode routine to lookup a node by mac address and
  if not present create one when operating in ibss/ahdemo mode; new nodes
  are dup'd from bss and the driver is told to treat the node as if a new
  association has been created so driver-private state (e.g. rate control
  handling) is setup

Obtained from:	netbsd (basic idea)
2004-04-02 23:25:39 +00:00
sam
dabc82c307 always free node reference when processing a probe request frame; was
conditionally doing an unref if operating in adhoc mode which turns
out to be wrong
2004-04-02 23:12:45 +00:00
sam
6af4964b13 o change ieee80211_dup_bss to inherit explicit data from ic_bss instead of
blindy copying the node contents; this turns out to be a bad idea as we
  add more state in the node for things like WPA
o track node allocation failures in ieee80211_dup_bss instead of the callers

Obtained from:	madwifi
2004-04-02 23:09:24 +00:00
sam
67e9e4cc26 track node allocation failure stats in ieee80211_alloc_node instead
of each caller

Obtained from:	madwifi
2004-04-02 23:06:41 +00:00
sam
55f7b47b2e replace explicit malloc/free with MALLOC/FREE for portability
Obtained from:	madwifi
2004-04-02 23:02:24 +00:00
sam
0a0736da0e extract node matching logic into new ieee80211_match_bss routine for use
in background/incremental scanning

Obtained from:	madwifi
2004-04-02 23:00:30 +00:00
sam
7cb4355e65 diff reduction against madwifi 2004-04-02 22:56:09 +00:00
sam
9f8d04a7dd when processing beacon/probe response frames capture "is probe" in a
variable to improve code legibility since we're going to use it more
in forthcoming mods

Obtained from:	madwifi
2004-04-02 22:54:07 +00:00
sam
aa1cae012e add a case of IEEE80211_ELEMID_IBSSPARMS so the statistic on unknown
elements is more meaningful (will add more with WPA merge)

Obtained from:	madwifi
2004-04-02 22:50:31 +00:00
sam
c09c9ffb05 when doing internal bridging free the node instead of just dropping the
reference for consistency (explicit refcounting is discouraged)

Obtained from:	madwifi
2004-04-02 22:48:52 +00:00
sam
0b28f0e554 when receiving a frame w/ a bad version number don't unref the node; the
driver is responsible for that

Obtained from:	madwifi
2004-04-02 22:47:11 +00:00
sam
168f14e271 insure basic rate bit is set in derived rate set; this
works around a protocol/firmware problem with some versions found
in hermes/prism cards
2004-04-02 20:22:25 +00:00
sam
e05e13fb3d diff reduction against madwifi/p4 2004-04-02 20:19:20 +00:00
mlaier
f83ee02957 Add rc.d script to start pflogd and add rcvars etc. Also document vars in
rc.conf(5) and put a sample entry to newsyslog.conf

Reviewed by:	-current
Approved by:	bms(mentor)
2004-04-02 19:25:27 +00:00
vkashyap
f00610d84d Moved 3ware 9000 driver (twa) stuff from sys/conf/NOTES to /sys/i386/conf/NOTES. 2004-04-02 18:50:56 +00:00
deischen
61ab102676 Unbreak natd.
Reported and submitted by:	Sean McNeil (sean at mcneil.com)
2004-04-02 17:57:57 +00:00
rik
8f3c139807 Add Cronyx-Tau entry. 2004-04-02 17:35:53 +00:00
rik
6500eb518f Add Cronyx-Tau entry. 2004-04-02 17:19:59 +00:00
des
ee704d129e style(9): return foo -> return (foo)
also fix a continuation indent I missed in the previous commit.
2004-04-02 16:41:16 +00:00
des
21cac99ba3 Clean up whitespace, fix continuation indents, wrap some long lines. 2004-04-02 16:39:12 +00:00
des
ef61af58e4 Unbreak LINT on 64-bit platforms. Note that this code is not style(9)-
compliant, but I'll leave that for someone else.

Noticed by:	tinderbox
Pointy hat to:	the usual suspects
2004-04-02 15:09:57 +00:00
kensmith
c0e9575587 Rearrangements needed for syscons(4) to be used as a console device
on architectures that need to call cninit() before the machine is
ready to support mutexes (required by make_dev()).

	- Remove make_dev() call from scinit() when flags indicate
	  unit is the system console, rely on sc_attach_unit() to
	  handle it.
	- When trying to access current screen's status (scr_stat
	  structure) use the static one provided for the initial
	  system console if no dev_t is available.
	- When calling make_dev() in sc_attach_unit() catch special
	  case of system's initial console and set up dev_t structure
	  to include pointer to console's scr_stat struct.

Reviewed by:	marcel
Tested by:	marcel, grehan (ppc), others on current@
Approved by:	rwatson (mentor)
2004-04-02 15:02:44 +00:00
krion
3918ff5d5d - Use "/bin/hostname" explicitly instead of "hostname".
Approved by:	tobez
MFC after:	1 week
2004-04-02 12:18:40 +00:00
marcel
7f0e754b61 In ns8250_putc() insert a barrier between writing the character and
checking for transmitter empty.
2004-04-02 07:37:28 +00:00
marcel
6b169c6f2f Allow the selection of a debug port with hw.uart.dbgport. Unlike
other architectures (like ia64), the variable has to be set to
an OpenFirmware device name.
2004-04-02 07:33:35 +00:00
marcel
a0dc48ec80 Call kbd_attach() only when KBD_INSTALL_CDEV is enabled as the function
is only defined in that case.
2004-04-02 05:59:06 +00:00
kris
3c01977ff1 Add missing comment terminator. 2004-04-02 04:57:40 +00:00
julian
a7eb128756 The comment complained about not having a thread_unlink()
and did the work itself, but thread_unink() has existed for a while... use it.
2004-04-02 01:01:34 +00:00
rwatson
ead5652856 For now, restore an splx(s) I removed when introducing slisunitfree(). 2004-04-01 23:54:49 +00:00
ache
bc125771e6 Simplify one condition in prev. commit:
short_too already assumes FLAG_LONGONLY
2004-04-01 22:32:28 +00:00