Commit Graph

51598 Commits

Author SHA1 Message Date
John Baldwin
42f0ddd465 Tweak the ELCR support slightly. Explicitly probe the ELCR during boot
instead of burying that in the atpic(4) code as atpic(4) is not the only
user of elcr(4).  Change the elcr(4) code to export a global elcr_found
variable that other code can check to see if a valid ELCR was found.

MFC after:	1 month
2005-01-18 20:24:47 +00:00
John Baldwin
b0977ecfd7 Don't create new-bus resources for ACPI extended IRQ resources that are
producers rather than consumers as new-bus resources only handle consumed
resources.  We already do this for the other ACPI resource types that
support the producer/consumer attribute.
2005-01-18 20:21:36 +00:00
Sam Leffler
3fcfbbfa76 Simplify the logic for checking the scan candidates at the end of a scan.
Hold a lock on the table instead of futzing with reference counts which
was potentially dangerous except drivers were quiescent while we did this
so the table contents never changed.  Disable the hack logic for removing
scan candidates with multiple association failures; it's never done the
right thing and will be fixed correctly with background scanning goes in.
2005-01-18 20:21:29 +00:00
John Baldwin
5e15a08100 For the sake of consistency, look up link devices relative to the root
object (/) rather than the pci bus object when walking the _PRT to force
attach devices.  We already look up relative to the root object when doing
interrupt routing.

Suggested by:	njl
2005-01-18 20:20:32 +00:00
John Baldwin
94b3af82c1 - Add support for link devices where _CRS just outright fails to execute.
For such devices, we require _PRS to exist and we warn if any of the
  resources in _PRS are not IRQ resources (since we'll have no way of knowing
  which of those resources to use without a working _CRS).  When it does
  come time to set resources, we build up a resource buffer from scratch
  as we do for devices with _CRS that only have IRQ resources.
- Fix a bug with setting extended IRQ resources where we set the IRQ value
  in the wrong resource structure meaning that whichever IRQ was listed in
  _PRS was used instead.  This might fix some weird issues on certain boxes
  where IRQs > 16 don't seem to work when using ACPI.
- Fix a bug with how we walked the resource buffer after _SRS to call
  config_intr() in that the 'end' variable was not properly updated, so we
  could either terminate the loop early or loop after the end of the
  buffer.

Tested by:	pjd
2005-01-18 20:18:46 +00:00
Sam Leffler
5784a3714a correct logic that caused beacon frames received in ibss mode to be
discarded when not scanning
2005-01-18 20:07:44 +00:00
Sam Leffler
44c72e4299 move beacon/probe response counting down to after we've decided whether or
not we're going to process the frame; this makes the counters reflect frames
actually processes instead of received (discarded frames were already counted)
2005-01-18 20:04:51 +00:00
Sam Leffler
c75ac46947 when scanning is interrupted reset state so table entries go in the station
table and not the scan table

Noticed by:	Tai-hwa Liang
2005-01-18 19:59:40 +00:00
Sam Leffler
98ff62638d do fixed rate check when considering if a scan candidate is suitable so when
it's time to join the bss we can't get an error
2005-01-18 19:52:36 +00:00
Alan Cox
986b43f845 Add checks to vm_map_findspace() to test for address wrap. The conditions
where this could occur are very rare, but possible.

Submitted by: Mark W. Krentel
MFC after: 2 weeks
2005-01-18 19:50:09 +00:00
Sam Leffler
c4dc6d1307 adjust tx buffer allocation based on empirical testing:
o increase the max per-frame tx descriptor count and the number of tx
  buffers for forthcoming fast frame support
o correct the max scatter/gather count; it cannot be larger than the
  max(tx,rx,beacon) descriptor counts
2005-01-18 19:42:17 +00:00
Sam Leffler
aab26fb481 add missing statistic 2005-01-18 19:33:06 +00:00
Sam Leffler
4c24deac20 disable interrupts when transitioning to INIT state so we don't rx frames 2005-01-18 19:31:31 +00:00
Sam Leffler
f6b8ec160d replace hand-rolled code to compact an mbuf chain with m_defrag; this is
suboptimal but needed for fast frames which won't fit in a single cluster
2005-01-18 19:28:49 +00:00
Sam Leffler
80d2765fe2 setup the beacon xmit queue to not interrupt; we don't use them and
they make the led's flash unnecessarily in adhoc mode
2005-01-18 19:10:17 +00:00
Sam Leffler
3e50ec2c95 better led blinking 2005-01-18 19:03:04 +00:00
Sam Leffler
0a1b94c44c add paren's so we can supply a|b as a debug mask 2005-01-18 18:11:04 +00:00
Sam Leffler
0b19ce1eb7 o disable pci retry timeout to avoid problems when operating in C3 state
(fix imported from madwifi by Takanori Watanabe)
o eliminate save/restore of pci registers handled by the system
o eliminate duplicate zero of the softc (noted by njl)
o consolidate common code

MFC after:	1 week
2005-01-18 18:08:16 +00:00
Olivier Houchard
12a58da422 Start to support the big endian case as well. 2005-01-18 15:51:50 +00:00
David Xu
a2cc61fa6e Revert my previous errno hack, that is certainly an issue,
and always has been, but the system call itself returns
errno in a register so the problem is really a function of
libc, not the system call.

Discussed with : Matthew Dillion <dillon@apollo.backplane.com>
2005-01-18 13:53:10 +00:00
Scott Long
9580b6766e Fix compile errors. Bah. 2005-01-18 11:06:34 +00:00
Scott Long
a4d629e32d Fix an incorrect cast.
Submitted by: Andriy Gapon
MFC-after: 3 days.
2005-01-18 10:15:23 +00:00
Poul-Henning Kamp
9fc6aa0618 Detect sign-extension bugs in the ioctl(2) command argument: Truncate
to 32 bits and print warning.
2005-01-18 07:37:05 +00:00
John Baldwin
bb5d43ae2a Unbreak stack traces across double faults. In a particular edge case
(calling a __dead2 function such as panic() at the end of a function), the
saved %eip on the stack will actually not be part of the function that
executed a call instruction but instead will be the first instruction of
the next function in the text.  This happens with dblfault_handler() and
syscall() for example.  Work around this in the one place it matters by
looking at the saved %eip - 1 to determine the calling function when we
check for "magic" frames.

MFC after:	2 weeks
2005-01-18 03:48:02 +00:00
David E. O'Brien
9196a9005e While we're building kernels -g (ie, makeoptions DEBUG=-g), use -O as it
provides truer debugger stack traces.  For those that want to stick with
-O2 kernel builds, one should probably add -fno-optimize-sibling-calls
so that each stack frame as a frame pointer.
It is semi-promissed by the Release Engineers that when RELENG_6 is
created we go back to -O2.

Desired by:	scottl, jhb
2005-01-18 03:32:53 +00:00
Sam Leffler
6e0da4f753 Fix building for non-i386 platforms.
Submitted by:	Coleman Kane
2005-01-18 03:28:08 +00:00
Ruslan Ermilov
80c424cd2b MFi386: fix a comment. 2005-01-17 08:36:46 +00:00
Ruslan Ermilov
5c5d348b7c Fix a comment to match reality. 2005-01-17 08:35:50 +00:00
Mike Silbersack
6792415119 Rearrange the kninit calls for both directions of a pipe so that
they both happen before pipe backing allocation occurs.  Previously,
a pipe memory shortage would cause a panic due to a KNOTE call
on an uninitialized si_note.

Reported by:	Peter Holm
MFC after:	1 week
2005-01-17 07:56:28 +00:00
Poul-Henning Kamp
e8cde1ac6f Discontinue zero-length g_ctl arguments as "just give him this pointer"
transfers.  The necessary context for calling copyin() isn't available
anyway and automatic code-validation chokes on this.
2005-01-17 07:14:24 +00:00
Warner Losh
ddd8ec50b0 Go ahead and match on CIS3 and CIS4 strings as well. These are NULL
for the vast majority of our cards.  However, they are critically
needed to distinguish different fe based PC Cards (the FMV-182 from
the 182A) which need to be treated differently (the ethernet address
is loaded not from the standard CIS-based ethernet tuples, but from
differing locations in attribute space based on the version string in
CIS3.  This should have no impact for other users of this function.
2005-01-17 06:54:48 +00:00
Roman Kurakin
5e93f2e558 Ups, misprint, change and => add.
Submitted by: ru
2005-01-16 23:30:45 +00:00
Poul-Henning Kamp
7bf38aeae7 Fix a bug I introduced in 1.561 which has caused considerable filesystem
unhappiness lately.

As far as I can tell, no files that have made it safely to disk
have been endangered, but stuff in transit has been in peril.

Pointy hat:	phk
2005-01-16 21:09:39 +00:00
Roman Kurakin
67fb03d261 Fix comment. Code 0x95 means locking shift to codeset 5 according to
T1.617 AnnexD.
Locking shift procedure is described in ANSI T1.607.

MFC after:	3 days
2005-01-16 19:22:09 +00:00
Roman Kurakin
d62d2396c3 Fix variable name in comment num=>alen. (Lost part of commit rev 1.2)
MFC after:	3 days
2005-01-16 19:12:27 +00:00
Olivier Houchard
a9357c744c Add a new sysctl, hw.sevenseg.freq, to control the update frequency. 2005-01-16 13:18:52 +00:00
Olivier Houchard
fde8140fde Erm, don't forget to store the mbuf in the dmamap in bus_dmamap_load_mbuf_sg(),
so that bus_dmamap_sync() knows what to invalidate. This makes em(4) work again.
While I'm there, remove the unused "first" variable.
2005-01-16 13:15:16 +00:00
Gleb Smirnoff
28935658c4 - Reduce number of arguments passed to dummynet_io(), we already have cookie
in struct ip_fw_args itself.
- Remove redundant &= 0xffff from dummynet_io().
2005-01-16 11:13:18 +00:00
Scott Long
5b4a781b96 Lock the AMR driver:
- Introduce the amr_io_lock to control access to command queues, bio queues,
  and the hardware.
- Eliminate the taskqueue and do all completion processing in the ithread.
- Assign a static slot number to each command instead of doing a linear
  search for free slots each time a command is needed.
- Modify the interrupt handler to more closely match what Linux does, for
  safety.
2005-01-16 07:34:26 +00:00
David E. O'Brien
7c804097a4 Fix kernel builds with INVARIANTS. 2005-01-16 02:39:18 +00:00
Scott Long
bd1954cc37 Use bus_dmamap_load_mbuf_sg() for loading rx buffers. 2005-01-15 22:05:59 +00:00
Gleb Smirnoff
c31d24c37c Remove ip_fw.h and ip_dummynet.h from includes. 2005-01-15 22:04:17 +00:00
Alan Cox
d936694f09 Consider three objects, O, BO, and BBO, where BO is O's backing object
and BBO is BO's backing object.  Now, suppose that O and BO are being
collapsed.  Furthermore, suppose that BO has been marked dead
(OBJ_DEAD) by vm_object_backing_scan() and that either
vm_object_backing_scan() has been forced to sleep due to encountering
a busy page or vm_object_collapse() has been forced to sleep due to
memory allocation in the swap pager.  If vm_object_deallocate() is
then called on BBO and BO is BBO's only shadow object,
vm_object_deallocate() will collapse BO and BBO.  In doing so, it adds
a necessary temporary reference to BO.  If this collapse also sleeps
and the prior collapse resumes first, the temporary reference will
cause vm_object_collapse to panic with the message "backing_object %p
was somehow re-referenced during collapse!"

Resolve this race by changing vm_object_deallocate() such that it
doesn't collapse BO and BBO if BO is marked dead.  Once O and BO are
collapsed, vm_object_collapse() will attempt to collapse O and BBO.
So, vm_object_deallocate() on BBO need do nothing.

Reported by: Peter Holm on 20050107
URL: http://www.holm.cc/stress/log/cons102.html

In collaboration with: tegge@
Candidate for RELENG_4 and RELENG_5
MFC after: 2 weeks
2005-01-15 21:12:47 +00:00
Scott Long
0ab6412830 Convert if_em to the new bus_dmamap_load_sg() interface. The old callback
was really just a waste of cycles, so this streamlines it considerably.
2005-01-15 20:52:15 +00:00
Scott Long
2f69affe36 Add bus_dmamap_load_mbuf_sg() to alpha. 2005-01-15 20:11:25 +00:00
Scott Long
a9e9b7e47b Fix an assignment that I missed in the last commit. 2005-01-15 20:03:59 +00:00
Scott Long
9751303e1c Add bus_dmamap_load_mbuf_sg() to powerpc. 2005-01-15 19:55:25 +00:00
Olivier Houchard
de76196323 Add support for KTR_BUSDMA. 2005-01-15 19:42:28 +00:00
Olivier Houchard
34c8913825 Add the prototype for bus_dmamap_load_mbuf_sg().
Spotted out by:	scottl
2005-01-15 19:31:08 +00:00
Scott Long
33072f4de7 Add bus_dmamap_load_mbuf_sg() to ia64 2005-01-15 19:26:17 +00:00