Commit graph

41676 commits

Author SHA1 Message Date
Sam Leffler 0a915fad5d MFp4 changes to fix locking issues and correct reference
count handling of station entries in hostap mode:

Input path:

o driver is now expected to find the node associated with the
  sender of a received frame; use ic_bss if none is located
o driver passes the (referenced) node into ieee80211_input for
  use within the wlan module and is responsible for cleaning up
  on return
o the antenna state is no longer passed up with each frame; this
  is now considered driver-private state and drivers are responsible
  for keeping it in the driver-private part of a node

Output path:

Revamp output path for management frames to eliminate redundant
locking that causes problems and to correct reference counting
bogosity that occurs when stations are timed out due to inactivity
(in AP mode).  On output the refcnt'd node is stashed in the pkthdr's
recvif field (yech) and retrieved by the driver.  This eliminates
an unref/ref scenario and related node table unlock/lock due to the
driver looking up the node.  This is particularly important when
stations are timed out as this causes a lock order reversal that
can result in a deadlock.  As a byproduct we also reduce the overhead
for sending management frames (minimal).  Additional fallout from
this is a change to ieee80211_encap to return a refcn't node for
tieing to the outbound frame.  Node refcnts are not reclaimed until
after a frame is completely processed (e.g. in the tx interrupt
handler).  This is especially important for timed out stations as
this deref will be the final one causing the node entry to be
reclaimed.

Additional semi-related changes:
o replace m_copym use with m_copypacket (optimization)
o add assert to verify ic_bss is never free'd during normal operation
o add comments explaining calling conventions by drivers for frames
  going in each direction
o remove extraneous code that "cannot be executed" (e.g. because
  pointers may never be null)
2003-08-19 22:17:04 +00:00
David E. O'Brien 05ca5d4af2 Enable OFW_NEWPCI until jmg's 2003/06/21 18:26:08 PDT bus commit is fixed
that caused a 3-4 times slow down in performance.
(the primary Sparc64 developers are all using OFW_NEWPCI already, so it is
the best code path for users)
2003-08-19 21:57:29 +00:00
Sam Leffler d1d0cf62fe o pass control frames up the stack when in monitor mode (the 802.11 layer will
quietly discard them; this just permits them to be collected with bpf)
o add a counter for the number of rate control frames discarded when not in
  monitor mode
o move the rx "too short" statistic in the stat structure so non-error rx stats
  are together (NB: ABI change to apps that collect stats via driver ioctl)
2003-08-19 21:35:08 +00:00
Scott Long b88ffdc860 Make aac(4) compile cleanly on 64-bit machines. The code was already 64-bit
safe, but some (unneeded and/or harmless) downcasts were generating warnings.
The driver still is not endian-clean.
2003-08-19 21:31:45 +00:00
Sam Leffler 9cccabebd7 o correct beacon frame length calculation and add an assert to catch any future
mistakes (this mistake was not an issue because the length is only used to
  decide whether or not to allocate a cluster)
o while here, move a beacon length comment to the "right place"
2003-08-19 21:28:45 +00:00
Sam Leffler 1b1a8e411e maintain a table for mapping hardware rate codes to 802.11 rates for
calculating the rate for each rx'd frame
2003-08-19 21:24:16 +00:00
Sam Leffler 2274d8c885 mark the scan and calibrate callouts MPSAFE 2003-08-19 21:05:47 +00:00
Sam Leffler 91a2b886de remove unneeded include files 2003-08-19 21:03:30 +00:00
Alan Cox 1e584e46be Eliminate a possible race condition for multithreaded applications in
_pmap_allocpte(): Guarantee that the page table page is zero filled before
adding it to the directory.  Otherwise, a 2nd, 3rd, etc. thread could
access a nearby virtual address and use garbage for the address
translation.

Discussed with:	peter, tegge
2003-08-19 18:20:34 +00:00
Sam Leffler c06eb4e293 Change instances of callout_init that specify MPSAFE behaviour to
use CALLOUT_MPSAFE instead of "1" for the second parameter.  This
does not change the behaviour; it just makes the intent more clear.
2003-08-19 17:51:11 +00:00
Sam Leffler 91a9d708ba add R_Zalloc definition that returns pre-zero'd memory 2003-08-19 17:23:07 +00:00
Jeffrey Hsu 9ba208b413 * Bug fix in bw_meter_process(): the periodically processed bins
of bw_meter entries were processed up to one second ahead.
  After an unappropriate rescheduling of some of the bw_meter
  entries, the upcalls weren't delivered.

* pim_register_prepare() uses the appropriate sw_csum flag to
  call ip_fragment() so the IP checksum is computed properly.

* Modify pim_register_prepare() to take care of IP packets that
  don't need fragmentation.

* Add-back in_delayed_cksum() to encap_send(), because it seems it
  should be there.

Submitted by:	Pavlin Radoslavov <pavlin@icir.org>
2003-08-19 17:22:51 +00:00
Sam Leffler d5882c1117 remove #define no longer used 2003-08-19 17:12:21 +00:00
Sam Leffler 53b57cd1ab add missing unlock when in_pcballoc returns an error 2003-08-19 17:11:46 +00:00
Sam Leffler 588523fae3 use ETHER_IS_MULTICAST instead of explicit check 2003-08-19 17:04:13 +00:00
Sam Leffler 0143cfd730 "short cable" fix for DP8315
Derived from:	netbsd and tech note at soekris web site
MFC after:	1 week
2003-08-19 16:57:00 +00:00
Sam Leffler e540880d41 correct typo in comment 2003-08-19 16:41:12 +00:00
Olivier Houchard a7e15683be Use bus_child_present() to make sure the card is still there before calling
epstop() in ep_detach().
This fixes a freeze that happens when ejecting a ep(4) pcmcia card.
2003-08-19 14:06:42 +00:00
Paul Saab ad8fc00c75 Don't tsleep on NULL 2003-08-19 12:22:17 +00:00
Dag-Erling Smørgrav 134ce0f9cc Add pfs_visible() checks to pfs_getattr() and pfs_getextattr(). This
also fixes pfs_access() since it relies on VOP_GETATTR() which will call
pfs_getattr().  This prevents jailed processes from discovering the
existence, start time and ownership of processes outside the jail.

PR:		kern/48156
2003-08-19 10:26:41 +00:00
Hidetoshi Shimokawa 98b8dc587d Remove unused code. 2003-08-19 08:59:07 +00:00
Hidetoshi Shimokawa 29b187dc39 Drop too short packets. 2003-08-19 08:50:35 +00:00
Hidetoshi Shimokawa f9c8c31d33 Allow to access phy registers via ioctl(). 2003-08-19 08:47:49 +00:00
Eric Anholt 7a0f4bee0d Update DRM from DRI CVS as of today. Notable changes include Radeon
suspend/resume support and Rage 128 pageflipping support (both of which require
XFree86 from CVS), along with miscellaneous cleanups.
2003-08-19 02:57:31 +00:00
Takanori Watanabe f09e4e876e Update my mail address on copyright notice.
Noticed by: njl
2003-08-19 01:54:34 +00:00
Cameron Grant a527dbc77c handle locking when creating or destroying vchans better 2003-08-18 23:20:39 +00:00
Cameron Grant a5dc588839 try to make really sshort sounds actually play 2003-08-18 23:18:47 +00:00
Warner Losh f2d72e24b3 The CD bits in the CBB_SOCKET_STATE register are 0 when the card is
present, and non-zero when it is (or may be) absent.  The test
cbb_child_present was backwards.  However, typical usage in the tree
would cause it to do the right thing because the card really wasn't
there the OK flag would be turned on.

Also, assume that if any of these bits are turned on we don't have a
card, rather than requiring both of them in the suspend/resume
routines.

Noticed by: cognet
2003-08-18 21:59:24 +00:00
Poul-Henning Kamp 6a4b58230c Replace a homegrown bdone()/bwait() implementation by the real thing 2003-08-18 19:47:16 +00:00
John Baldwin d49ebea58c Spell the name of the lock right in addition to getting the type right.
Submitted by:	Kim Culhan <kimc@w8hd.org>
2003-08-18 19:23:01 +00:00
John Baldwin cda369cac4 The allproc lock is a sx lock, not a mutex, so fix the assertion. This
asserts that the sx lock is held, but does not specify if the lock is held
shared or exclusive, thus either type of lock satisfies the assertion.
2003-08-18 18:02:33 +00:00
Alan Cox 9cf8f2f707 The previous change necessitates the addition of a new #include. Otherwise,
there is a compilation warning.
2003-08-18 17:27:08 +00:00
John Baldwin f13ba3ccc0 Add missing header include for MSR macros.
Submitted by:	bde
2003-08-18 17:01:04 +00:00
David E. O'Brien 4f4a104ee8 style.Makefile(5) 2003-08-18 15:25:39 +00:00
Dag-Erling Smørgrav 653fae1761 Rework pfs_iterate() a bit to eliminate a bug related to process
directories.  Previously, pfs_iterate() would return -1 when it
reached the end of the process list while processing a process
directory node, even if the parent directory contained further nodes
(which is the case for the linprocfs root directory, where the process
directory node is actually first in the list).  With this patch,
pfs_iterate() will continue to traverse the parent directory's node
list after exhausting the process list (as was the intention all
along).  The code should hopefully be easier to read as well.

While I'm here, have pfs_iterate() assert that the allproc lock is
held.
2003-08-18 13:36:09 +00:00
Dag-Erling Smørgrav 9a69494e8b Whitespace cleanup. 2003-08-18 13:30:15 +00:00
Warner Losh da245931e3 Put the clearing of the socket cd interrupt and setting of it under
protection of sc->mtx.  Sometimes multiple insert/ejections could
cause further insertion/removals to not happen due to racing an ISR...
2003-08-18 03:15:44 +00:00
Warner Losh 4aef3fb1c3 Put a band-aide(tm) on the CIS panic problem. This is a similar fix
to what is in NetBSD.  I have a few cards that tickles this bug, and
this just keeps us from panicing.  It doesn't actually fix the problem
(that will happen once I figure out why some cards hate the address
their CIS is mapped to high memory).
2003-08-18 03:07:09 +00:00
Alan Cox ef13663bb6 Three unrelated changes to vm_proc_new(): (1) add vm object locking on the
U pages object; (2) reorganize such that the U pages object is created and
filled in one block; and (3) remove an unnecessary clearing of PG_ZERO.
2003-08-18 01:31:43 +00:00
Poul-Henning Kamp 29796304f8 Do not call VOP_BMAP() on our own vnodes.
It is particularly silly when all it does is a minor piece of math.
2003-08-17 23:00:30 +00:00
Alan Cox 90ca070d69 Acquire the pte object's mutex when performing vm_page_grab(). Note: It is
my long-term objective to eliminate the pte object.  In the near term, this
does, however, enable the addition of some vm object locking assertions.
2003-08-17 22:27:30 +00:00
Poul-Henning Kamp b103854847 Don't use a VOP_*() function on our own vnodes, go directly to the
relevant internal function, in this case ufs_bmaparray().
2003-08-17 19:26:03 +00:00
Paul Saab f53579cfaa Fix a typo. BGE_HCC_TX_MAX_COAL_BDS_INT is at offset 0x3C24, not 0x3C34 2003-08-17 19:14:02 +00:00
Poul-Henning Kamp ec7948490b Use NULL for 3rd argument of VOP_BMAP() rather than custom cast.
Eliminate unused variable.
2003-08-17 18:54:23 +00:00
Poul-Henning Kamp 037c3d0fb0 It is not an error to have no devices in the kernel: Return the
generation number and start it from one instead of zero.
2003-08-17 12:06:19 +00:00
Gordon Tetlow 0a855c3431 Bump __FreeBSD_version due to movement of libraries to /lib and rtld to
/libexec.
2003-08-17 09:10:13 +00:00
Gordon Tetlow 41d8423f71 Stage 3 of dynamic root support. Make all the libraries needed to run
binaries in /bin and /sbin installed in /lib. Only the versioned files
reside in /lib, the .so symlink continues to live /usr/lib so the
toolchain doesn't need to be modified.
2003-08-17 08:28:46 +00:00
Gordon Tetlow df3d69c217 Fixup the ELF branding information to point to the new home of rtld. 2003-08-17 08:08:38 +00:00
Marcel Moolenaar 3e25ce2310 Cleanup <machine/cpu.h> by moving MD prototypes to <machine/md_var.h>
like we have on other platforms. Move savectx() to <machine/pcb.h>.
A lot of files got these MD prototypes through the indirect inclusion
of <machine/cpu.h> and now need to include <machine/md_var.h>. The
number of which is unexpectedly large...

osf1_misc.c especially is tricky because szsigcode is redefined in
one of the osf1 header files. Reordering of the include files was
needed.

linprocfs.c now needs an explicit extern declaration.

Tested with: LINT
2003-08-17 06:42:08 +00:00
Alan Cox 365b27ea29 In pmap_copy(), since we have the page table page's physical address
in hand, use PHYS_TO_VM_PAGE() rather than vm_page_lookup().
2003-08-17 04:48:21 +00:00