dragonfly.git
16 years agoReparse device specifications. The slice is no longer optional.
Matthew Dillon [Fri, 13 Jul 2007 18:36:32 +0000 (18:36 +0000)]
Reparse device specifications.  The slice is no longer optional.
Also handle slice 0 specifications.

Do not try to write-enable the label area.  Any vinum headers must
occur outside any reserved label area.

16 years agopccardd was removed a long time ago.
Sascha Wildner [Fri, 13 Jul 2007 08:12:45 +0000 (08:12 +0000)]
pccardd was removed a long time ago.

16 years agoAdd some words about rtsold_{enable,flags}.
Sascha Wildner [Fri, 13 Jul 2007 07:36:26 +0000 (07:36 +0000)]
Add some words about rtsold_{enable,flags}.

16 years agoUpdate to include info on last update.
Matthew Dillon [Fri, 13 Jul 2007 07:04:39 +0000 (07:04 +0000)]
Update to include info on last update.

16 years agoMerge from vendor branch LIBARCHIVE:
Matthew Dillon [Fri, 13 Jul 2007 06:59:51 +0000 (06:59 +0000)]
Merge from vendor branch LIBARCHIVE:
Synchronous libarchive to 2.2.4 from FreeBSD, including fixes related to
FreeBSD Security Advisory FreeBSD-SA-07:05.libarchive.

16 years agoSynchronous libarchive to 2.2.4 from FreeBSD, including fixes related to
Matthew Dillon [Fri, 13 Jul 2007 06:59:51 +0000 (06:59 +0000)]
Synchronous libarchive to 2.2.4 from FreeBSD, including fixes related to
FreeBSD Security Advisory FreeBSD-SA-07:05.libarchive.

16 years agoSynchronous libarchive to 2.2.4 from FreeBSD, including fixes related to
Matthew Dillon [Fri, 13 Jul 2007 06:59:49 +0000 (06:59 +0000)]
Synchronous libarchive to 2.2.4 from FreeBSD, including fixes related to
FreeBSD Security Advisory FreeBSD-SA-07:05.libarchive.

16 years agoBe more verbose in the bad-opencount assertion.
Matthew Dillon [Fri, 13 Jul 2007 01:20:10 +0000 (01:20 +0000)]
Be more verbose in the bad-opencount assertion.

16 years agoFix LWP support on exec. exec now properly kills all LWPs.
Matthew Dillon [Thu, 12 Jul 2007 21:56:22 +0000 (21:56 +0000)]
Fix LWP support on exec.  exec now properly kills all LWPs.

16 years agoAdd an sc_maxiosize field which the ccd driver now needs.
Matthew Dillon [Thu, 12 Jul 2007 00:25:57 +0000 (00:25 +0000)]
Add an sc_maxiosize field which the ccd driver now needs.

Submitted-by: Peter Avalos <pavalos@theshell.com>
16 years agoAdd SHUTDOWN_PRI_DRIVER and move all driver shutdown functions from
Matthew Dillon [Wed, 11 Jul 2007 23:46:58 +0000 (23:46 +0000)]
Add SHUTDOWN_PRI_DRIVER and move all driver shutdown functions from
SHUTDOWN_PRI_DEFAULT to SHUTDOWN_PRI_DRIVER.  This allows the CAM subsystem
to shutdown SCSI before individual SCSI drivers shutdown.

Reported-by: Peter Avalos <pavalos@theshell.com>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue713>

16 years agoUse I/O size limits in underlying devices to govern I/O chunk
Matthew Dillon [Wed, 11 Jul 2007 23:42:16 +0000 (23:42 +0000)]
Use I/O size limits in underlying devices to govern I/O chunk
sizes.  This fixes issues with NATA which does not break up large
requests like the old ATA driver did.

Reported-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
16 years agoUse TAILQ_FOREACH to enhance readibility.
Peter Avalos [Wed, 11 Jul 2007 22:53:21 +0000 (22:53 +0000)]
Use TAILQ_FOREACH to enhance readibility.

16 years agoFix path.
Simon Schubert [Wed, 11 Jul 2007 21:12:50 +0000 (21:12 +0000)]
Fix path.

Noticed-by: Noah Yan <noah.yan@gmail.com>
16 years agoRemove some /usr/freebsd_pkg remains.
Sascha Wildner [Wed, 11 Jul 2007 08:21:14 +0000 (08:21 +0000)]
Remove some /usr/freebsd_pkg remains.

16 years agoBump .Dd for -l and fix markup.
Sascha Wildner [Wed, 11 Jul 2007 00:49:05 +0000 (00:49 +0000)]
Bump .Dd for -l and fix markup.

16 years agoAdd units to offset adjustment messages.
Sascha Wildner [Wed, 11 Jul 2007 00:18:00 +0000 (00:18 +0000)]
Add units to offset adjustment messages.

16 years agoAdd a wpa_supplicant rc script and bring in code to handle "WPA" in an
Sascha Wildner [Tue, 10 Jul 2007 22:36:01 +0000 (22:36 +0000)]
Add a wpa_supplicant rc script and bring in code to handle "WPA" in an
ifconfig_blah0="..." line in rc.conf. It should now be possible to bring
up a wireless interface with a line similar to:

ifconfig_iwi0="up WPA DHCP"

This commit also removes the restriction that when "DHCP" was specified,
the rest of the arguments were ignored. So the following should work now:

ifconfig_rl0="DHCP media 10baseT/UTP"

The commit also adds rc settings for interface renaming, e.g.:

ifconfig_iwi0_name="net0"
ifconfig_net0="up WPA DHCP"

Obtained-from: FreeBSD

16 years agoDo not synchronously waitmsg in the unix domain socket's custom putport
Matthew Dillon [Tue, 10 Jul 2007 20:24:57 +0000 (20:24 +0000)]
Do not synchronously waitmsg in the unix domain socket's custom putport
function.  This prevents us from being able to abort an accept() when
a process takes a signal.

Clean up some other stuff.  MSGF_DONE should already be clear.

Reported-by: Peter Avalos <pavalos@theshell.com>
16 years agoAdd support to vkernel for locking virtual CPUs to real CPUs.
Joe Talbott [Tue, 10 Jul 2007 18:35:38 +0000 (18:35 +0000)]
Add support to vkernel for locking virtual CPUs to real CPUs.

Adds a '-l' option to vkernel to specify CPU locking.  The choices are:

1. No locking.
2. Lock all virtual CPUs to one real CPU.
3. Map each virtaul CPU to a real CPU starting with CPU0.  The starting CPU
   can be overridden.

16 years agoKQueueFd is declared static in sys/platform/vkernel/platform/kqueue.c and
Sascha Wildner [Tue, 10 Jul 2007 13:19:08 +0000 (13:19 +0000)]
KQueueFd is declared static in sys/platform/vkernel/platform/kqueue.c and
is only used there (fixes VKERNEL build with gcc41).

16 years agoUpdate the CCD and disklabel documentation to reflect changes in
Matthew Dillon [Mon, 9 Jul 2007 17:51:30 +0000 (17:51 +0000)]
Update the CCD and disklabel documentation to reflect changes in
requirements for CCD disks, which is basically that CCD components be
set to type 'ccd' instead of 4.2BSD.

Submitted-by: Chris Turner <c.turner@199technologies.org>
16 years agoFinally retire ports pkg_* tools.
Simon Schubert [Sun, 8 Jul 2007 22:20:04 +0000 (22:20 +0000)]
Finally retire ports pkg_* tools.

16 years ago* s/cpu/CPU/
Sascha Wildner [Sat, 7 Jul 2007 22:57:19 +0000 (22:57 +0000)]
* s/cpu/CPU/

* Bump date for -n.

* Minor mdoc cleanup.

16 years agoSync ahc(4) and ahd(4) with FreeBSD 6.
Sascha Wildner [Sat, 7 Jul 2007 18:31:59 +0000 (18:31 +0000)]
Sync ahc(4) and ahd(4) with FreeBSD 6.

16 years agoRemove trailing whitespace.
Sascha Wildner [Sat, 7 Jul 2007 17:42:48 +0000 (17:42 +0000)]
Remove trailing whitespace.

16 years agoFix comment.
Sepherosa Ziehau [Sat, 7 Jul 2007 12:25:26 +0000 (12:25 +0000)]
Fix comment.

16 years agoParameters of icu_{set,get}var() are used.
Sepherosa Ziehau [Sat, 7 Jul 2007 12:13:47 +0000 (12:13 +0000)]
Parameters of icu_{set,get}var() are used.

16 years agoUpdate README.
Sascha Wildner [Sat, 7 Jul 2007 12:01:00 +0000 (12:01 +0000)]
Update README.

16 years agoFix typo.
Peter Avalos [Sat, 7 Jul 2007 01:55:11 +0000 (01:55 +0000)]
Fix typo.

Obtained-from: FreeBSD

16 years agoFix typos.
Peter Avalos [Sat, 7 Jul 2007 01:47:51 +0000 (01:47 +0000)]
Fix typos.

Obtained-from: FreeBSD

16 years agoinitialize some variables before potential use.
Peter Avalos [Sat, 7 Jul 2007 01:36:02 +0000 (01:36 +0000)]
initialize some variables before potential use.

Obtained-from: FreeBSD

16 years ago-Wundef fix.
Peter Avalos [Sat, 7 Jul 2007 01:12:01 +0000 (01:12 +0000)]
-Wundef fix.

Obtained-from: FreeBSD

16 years ago-Wundef fix.
Peter Avalos [Sat, 7 Jul 2007 01:09:42 +0000 (01:09 +0000)]
-Wundef fix.

Obtained-from: FreeBSD

16 years ago-Wundef fixes.
Peter Avalos [Sat, 7 Jul 2007 01:06:07 +0000 (01:06 +0000)]
-Wundef fixes.

Obtained-from: FreeBSD

16 years agoUse the AHC_DISABLE_PCI_PERR flag to silence parity error reporting on
Peter Avalos [Sat, 7 Jul 2007 00:49:51 +0000 (00:49 +0000)]
Use the AHC_DISABLE_PCI_PERR flag to silence parity error reporting on
chips where setting the FAILDIS bit is not effective.  While here,
try again to make it clear that reported parity errors indicate
a failure of some PCI device *other than* the aic7xxx controller.

Obtained-from: FreeBSD

16 years agoEnhance diagnostic printfs for the chains of free lists used to
Peter Avalos [Sat, 7 Jul 2007 00:37:46 +0000 (00:37 +0000)]
Enhance diagnostic printfs for the chains of free lists used to
avoid SCB ID collissions to non-packetized targets.

Obtained-from: FreeBSD

16 years agoCorrect bug that caused the completed "recovery" scb to have its
Peter Avalos [Sat, 7 Jul 2007 00:28:32 +0000 (00:28 +0000)]
Correct bug that caused the completed "recovery" scb to have its
timer reset rather than the timer of an SCB still pending on the
controller after recovery completed.  This should correct timeout
loops.

Obtained-from: FreeBSD

16 years agoSet allow_memio to 1 if fetching the allow_memio hint fails. This
Peter Avalos [Sat, 7 Jul 2007 00:10:39 +0000 (00:10 +0000)]
Set allow_memio to 1 if fetching the allow_memio hint fails.  This
is the default behavior according the the bootverbose printf in the
failure case.

Obtained-from: FreeBSD

16 years agoremove useless ptr check; cur_column can never be null.
Peter Avalos [Fri, 6 Jul 2007 23:51:23 +0000 (23:51 +0000)]
remove useless ptr check; cur_column can never be null.

Obtained-from: FreeBSD

16 years agoUse BUS_PROBE_DEFAULT for pci probe return value.
Peter Avalos [Fri, 6 Jul 2007 23:48:20 +0000 (23:48 +0000)]
Use BUS_PROBE_DEFAULT for pci probe return value.

Obtained-from: FreeBSD

16 years agoAllow print_reg() to be called with a NULL column.
Peter Avalos [Fri, 6 Jul 2007 23:44:54 +0000 (23:44 +0000)]
Allow print_reg() to be called with a NULL column.

Obtained-from: FreeBSD

16 years agoAfter lwkt_waitmsg/lwkt_waitport splitting, the second parameter of
Sepherosa Ziehau [Fri, 6 Jul 2007 11:59:03 +0000 (11:59 +0000)]
After lwkt_waitmsg/lwkt_waitport splitting, the second parameter of
lwkt_waitport() is tsleep flags instead of msg pointer.

16 years agoMake SEE ALSO section a bit nicer.
Sascha Wildner [Fri, 6 Jul 2007 11:22:23 +0000 (11:22 +0000)]
Make SEE ALSO section a bit nicer.

16 years agoQuick mdoc cleanup of the new usched_set(2) manual page.
Sascha Wildner [Fri, 6 Jul 2007 07:09:44 +0000 (07:09 +0000)]
Quick mdoc cleanup of the new usched_set(2) manual page.

16 years agoOn Rev. B silicon, we disabled the enhanced busfree detection logic to
Peter Avalos [Fri, 6 Jul 2007 06:35:41 +0000 (06:35 +0000)]
On Rev. B silicon, we disabled the enhanced busfree detection logic to
close holes in detecting busfrees that occur after a packetized target
transitions to a non-packetized phase.  The most common case where this
occurs is when a target is externally reset so the controller believes
a packetzied negotiation agreement is still in effect.  Unfortunately,
disabling this feature seems to cause problems for the 7901B.  Re-enable
ehanced busfree detection for this part.

Obtained-from: FreeBSD

16 years ago Explicitly initialize timedout_scb lists, use SCB_TAG for all access
Peter Avalos [Fri, 6 Jul 2007 06:27:00 +0000 (06:27 +0000)]
  Explicitly initialize timedout_scb lists, use SCB_TAG for all access
      to the hardware_scb->tag field, limit max lun reported to CAM to 63,
      return after a panic to silence a warning.

Obtained-from: FreeBSD

16 years agoAdd some useful target mode diagnostics for incoming commands
Peter Avalos [Fri, 6 Jul 2007 06:09:20 +0000 (06:09 +0000)]
Add some useful target mode diagnostics for incoming commands
under the AHC_SHOW_TQIN debug flag.

Obtained-from: FreeBSD

16 years agoRevert to basing all timeout/timer values in ms rather than us. The switch
Peter Avalos [Fri, 6 Jul 2007 05:58:26 +0000 (05:58 +0000)]
Revert to basing all timeout/timer values in ms rather than us.  The switch
to us was to help out the Linux port, but really just invited overflow.
In fact, the request sense timer was overflowing prior to this change making
it much shorter than intended.

aic_osm_lib.h:
        Be more careful about overflow in all timer/timeout primitives.

Obtained-from: FreeBSD

16 years agoaic7xxx.h:
Peter Avalos [Fri, 6 Jul 2007 05:45:52 +0000 (05:45 +0000)]
aic7xxx.h:
        Add constants for SPI protocol delays that are needed for
        target mode.

aic7xxx.c:
        Correct a target mode issue that caused an occassional
        spurious REQ to be seen on the bus when performing manual
        message processing (e.g. transfer rate negotiation).

        Enforce phase change bus settle rules with explicit
        delays when performing manual message processing in
        target mode.  The sequencer already did this for
        "fast-path", target mode message processing.

Obtained-from: FreeBSD

16 years agoIn the PCI error interrupt handler, specify the width of the PCI configuration
Peter Avalos [Fri, 6 Jul 2007 05:40:41 +0000 (05:40 +0000)]
In the PCI error interrupt handler, specify the width of the PCI configuration
cycle using the correct argument.  The location and width were reversed.

Obtained-from: FreeBSD

16 years agoSet AHD_BUSFREEREV_BUG in the bug field for Rev B chips, not the
Peter Avalos [Fri, 6 Jul 2007 05:20:00 +0000 (05:20 +0000)]
Set AHD_BUSFREEREV_BUG in the bug field for Rev B chips, not the
feature field.

Obtained-from: FreeBSD

16 years agoInvert the polarity of two tests in the recovery code that could cause
Peter Avalos [Fri, 6 Jul 2007 05:17:17 +0000 (05:17 +0000)]
Invert the polarity of two tests in the recovery code that could cause
the driver to issue a bus reset more quickly than intended.  We want to
*wait* if we find another SCB that could be the cause of this timeout,
not proceed to a bus reset.

Obtained-from: FreeBSD

16 years agoRemove spurious EISA definitions left over from the initial port of the
Peter Avalos [Fri, 6 Jul 2007 05:07:58 +0000 (05:07 +0000)]
Remove spurious EISA definitions left over from the initial port of the
aic7xxx driver to U320 hardware.

Obtained-from: FreeBSD

16 years agoAdd an ISA attachement to the aic7xxx driver to handle 284X controllers.
Peter Avalos [Fri, 6 Jul 2007 04:56:22 +0000 (04:56 +0000)]
Add an ISA attachement to the aic7xxx driver to handle 284X controllers.
The ISA probe uses an identify routine to probe all slot locations from
1 to 14 that do not conflict with other allocated resources.  This required
making aic7770.c part of the driver core when compiled as a module.

aic7xxx.c:
aic79xx.c:
aic_osm_lib.c:
        Use aic_scb_timer_start() consistently to start the watchdog timer.
        This removes a few places that verbatum copied the code in
        aic_scb_timer_start().

        During recovery processing, allow commands to still be queued to
        the controller.  The only requirement we have is that our recovery
        command be queued first - something the code already guaranteed.
        The only other change required to make this work is to prevent
        timers from being started for these newly queued commands.

Obtained-from: FreeBSD

16 years agoExtend critical section protection around portions of selection processing
Peter Avalos [Fri, 6 Jul 2007 02:46:40 +0000 (02:46 +0000)]
Extend critical section protection around portions of selection processing
that cannot tolerate changes to the waiting for selection queue by the
host or the host canceling an active selection.

Obtained-from: FreeBSD

16 years agoFix an off by one in the critical section clearing code. The
Peter Avalos [Fri, 6 Jul 2007 02:44:30 +0000 (02:44 +0000)]
Fix an off by one in the critical section clearing code.  The
code was adjusting twice for the instruction pointer indicating
the *next* instruction to execute.  The aic79xx driver had a similar
bug, but was already fixed.

Obtained-from: FreeBSD

16 years agoCorrect a very rare case where command ordering could be compromised
Peter Avalos [Fri, 6 Jul 2007 02:40:58 +0000 (02:40 +0000)]
Correct a very rare case where command ordering could be compromised
by a transaction performing a driver handled message sequence (an
scb with the MK_MESSAGE flag set).

SCBs that perform host managed messaging must always be
at the head of their per-target selection queue so that
the firmware knows to manually assert ATN if the current
negotiation agreement is packetized.  In the past we
guaranteed this by queuing these SCBs separarately in
the execution queue.  This exposes the system to potential
command reordering in two cases:

1) Another SCB for the same ITL nexus is queued that does
   not have the MK_MESSAGE flag set.  This SCB will be
   queued to the per-target list which can be serviced
   before the MK_MESSAGE scb that preceeded it.

2) If the target cannot accept all of the commands in the
   per-target selection queue in one selection, the remainder
   is queued to the tail of the selection queues so as to
   effect round-robin scheduling.  This could allow the
   MK_MESSAGE scb to be sent to the target before the
   requeued commands.

This commit changes the firmware policy to defer queuing
MK_MESSAGE SCBs into the selection queues until this can
be done without affecting order.  This means that the
target's selection queue is either empty, or the last
SCB on the execution queue is also a MK_MESSAGE SCB.
During any wait, the firmware halts the download of new
SCBs so only a single "holding location" is required.

Luckily, MK_MESSAGE SCBs are rare and typically occur only
during CAM's bus probe where only one command is outstanding
at a time.  However, during some recovery scenarios, the
reordering *could* occur.

aic79xx.c:
Update ahd_search_qinfifo() and helper routines to
search for pending MK_MESSAGE scbs and properly
restitch the execution queue if either the MK_MESSAGE
SCB is being aborted, or the MK_MESSAGE SCB can be
queued due to the execution queue draining due to
aborts.

Enable LQOBUSFREE status to assert an interrupt.
This should be redundant since a BUSFREE interrupt
should always occur along with an LQOBUSFREE event,
but on the Rev A, this doesn't seem to be guaranteed.

When a PPR request is rejected when a previously
existing packetized agreement is in place, assume
that the target has been reset without our knowledge
and revert to async/narrow transfers.  This corrects
two issues: the stale ENATNO setting that was used
to send the PPR is cleared so the firmware is not
confused by a future packetized selection with
ATN asserted but no MK_MESSAGE flag in the SCB and
it speeds up recovery by aborting any pending
packetized transactions that by definition are now
dead.

When re-queueing SCBs after a failed negotiation
attempt, ensure command ordering by freezing the
device queue first.

Traverse the list of pending SCBs rather than the
whole SCB array on the controller when pushing
MK_MESSAGE flag changes out to the controller.
The original code was optimized for the aic7xxx
controllers where there are fewer controller slots
then pending SCBs and the firmware picks SCB
slots.  For the U320 controller, the hope is
that we have fewer pending SCBs then the 512
slots on the controller.

Enhance some diagnostics.

Factor out some common code.

aic79xx.h:
Add prototype for new ahd_done_with_status() that is
used to factor out some commone code.

aic79xx.reg:
Add definisions for the pending MK_MESSAGE SCB.

aic79xx.seq:
Defer MK_MESSAGE SCB queing to the execution queue
so as to preserve command ordering.  Re-arrange some
of the selection processing code so the above change
had no performance impact on the common code path.

Close a few critical section holes.

When entering a non-packetized phase, manually enable
busfree interrupts, since the controller hardware
does not do this automatically.

aic79xx_inline.h:
Enhance logging for queued SCBs.

aic79xx_osm.c:
Add new a new DDB ahd command, ahd_dump, which
invokes the ahd_dump_card_state() routine on the
unit specified with the ahd_sunit DDB command.

aic79xx_pci.c:
Turn on the BUSFREEREV bug for the Rev B. controller.
This is required to close the busfree during non-packetized
phase hole.

Obtained-from: FreeBSD

16 years agoaic79xx.c:
Peter Avalos [Fri, 6 Jul 2007 02:23:32 +0000 (02:23 +0000)]
aic79xx.c:
Allow 500us between pauses in ahd_pause_and_flushwork().
The maximum we will wait is now 500ms.

In the same routine, remove any attempt to clear ENSELO.
Let the firmware do it once the current selection has
completed.  This avoids some race conditions having to
do with non-packetized completions and the auto-clearing
of ENSELO on packetized completions.

Also avoid attempts to clear critical sections when
interrups are pending.  We are going to loop again
anyway, so clearing critical sections is a waste of
time.  It also may not be possible to clear a critical
section if the source of the interrupt was a SEQINT.

aic79xx_pci.c:
Use the Generic 9005 mask when looking for generic 7901B
parts.  This allows the driver to attach to 7901B parts
on motherboards using a non-Adaptec subvendor ID.

aic79xx_inline.h:
Test for the SCBRAM_RD_BUG against the bugs
field, not the flags field in the softc.

aic79xx.c:
Cancel pending transactions on devices that
respond with a selection timeout.  This decreases
the duration of timeout recovery when a device
disappears.

aic79xx.c:
Don't bother forcing renegotiation on a selection
timeout now that we use the device reset handler
to abort any pending commands on the target.
The device reset handler already takes us down
to async narrow and forces a renegotiation.

In the device reset handlers, only send a
BDR sent async event if the status is not
CAM_SEL_TIMEOUT.  This avoids sending this
event in the selection timeout case

aic79xx.c:
Modify the Core timeout handler to verify that another
command has the potential to timeout before passing off
a command timeout as due to some other command.  This
safety measure is added in response to a timeout recovery
failure on H2B where it appears that incoming reselection
status was lost during a drive pull test.  In that case,
the recovery handler continued to wait for the command
that was active on the bus indefinetly.  While the root
cause of the above issue is still being determined seems
a prudent safeguard.

aic79xx_pci.c:
Add a specific probe entry for the Dell OEM 39320(B).

aic79xx.c:
aic79xx.h:
aic79xx.reg:
aic79xx.seq:
Modify the aic79xx firmware to never cross a cacheline or
ADB boundary when DMA'ing completion entries to the host.
In PCI mode, at least in 32/33 configurations, the SCB
DMA engine may lose its place in the data-stream should
the target force a retry on something other than an
8byte aligned boundary. In PCI-X mode, we do this to
avoid split transactions since many chipsets seem to be
unable to format proper split completions to continue
the data transfer.

The above change allows us to drop our completion entries
from 8 bytes to 4.  We were using 8 byte entries to ensure
that PCI retries could only occur on an 8byte aligned
boundary.  Now that the sequencer guarantees this by splitting
up completions, we can safely drop the size to 4 bytes (2
byte tag, one byte SG_RESID, one byte pad).

Both the split-completion and PCI retry problems only show
up under high tag load when interrupt coalescing is being
especially effective.  The switch from a 2byte completion
entry to an 8 byte entry to solve the PCI problem increased
the chance of incurring a split in PCI-X mode when multiple
transactions were completed at once.  Dropping the completion
size to 4 bytes also means that we can complete more commands
in a single DMA (128byte FIFO -> 32 commands instead of 16).

aic79xx.c:
Modify the SCSIINT handler to defer clearing
sequencer critical sections to the individual
interrupt handlers.  This allows us to
immediately disable any outgoing selections in
the case of an unexpected busfree so we don't
inadvertantly clear ENSELO *after* a new selection
has started.  Doing so may cause the sequencer
to miss a successful selection.

In ahd_update_pending_scbs(), only clear ENSELO if
the bus is currently busy and a selection is not
already in progress or the sequencer has yet to
handle a pending selection.  While we want to ensure
that the selection for the SCB at the head of the
selection queue is restarted so that any change in
negotiation request can take effect, we can't clobber
pending selection state without confusing the sequencer
into missing a selection.

Obtained-from: FreeBSD

16 years agoo When restarting the sequencer, clear any pending
Peter Avalos [Fri, 6 Jul 2007 02:04:20 +0000 (02:04 +0000)]
o When restarting the sequencer, clear any pending
  sequencer interrupt codes.  These codes are only
  relevant to the code that was last being executed
  and that context is cleared when we reset the
  program counter.  This addresses a race condition
  between a sequencer interrupt and any SCSI event
  that causes us to restart the sequencer.

o When running the untagged-Q, we must start the
  timer for any transaction we queue.

o Give the firmware half a millisecond between
  pauses to flush work out.  This should give us
  around half a second of total delay before flagging
  an issue with pausing and flushing controller work.

  Only attempt to clear critical sections if there
  are no pending interrupts in the pause and flush
  loop.  If the sequencer has issued an INTSTAT, we
  may not be able to step out of the critical section.

o Cancel pending transactions on devices that
  respond with a selection timeout.  This decreases
  the duration of timeout recovery when a device
  disappears.

  Don't bother forcing renegotiation on a selection
  timeout now that we use the device reset handler
  to abort any pending commands on the target.
  The device reset handler already takes us down
  to async narrow and forces a renegotiation.

o In the device reset handlers, only send a
  BDR sent async event if the status is not
  CAM_SEL_TIMEOUT.  This avoids sending this
  event in the selection timeout case.

o Modify the Core timeout handler to verify that another
  command has the potential to timeout before passing off
  a command timeout as due to some other command.

Obtained-from: FreeBSD

16 years agoAdd aic_scb_timer_start() which will be used in the aic7xxx driver to
Peter Avalos [Fri, 6 Jul 2007 01:42:34 +0000 (01:42 +0000)]
Add aic_scb_timer_start() which will be used in the aic7xxx driver to
start the timer on SCBs queued in the untagged SCB queue.

The core treats timeouts in usecs to satisfy Linux requirements.  Multiply
accordingly.

Obtained-from: FreeBSD

16 years agobus_alloc_resource -> bus_alloc_resource_any
Peter Avalos [Fri, 6 Jul 2007 01:11:07 +0000 (01:11 +0000)]
bus_alloc_resource -> bus_alloc_resource_any

Obtained-from: FreeBSD

16 years agoaic7xxx.c:
Peter Avalos [Fri, 6 Jul 2007 01:03:17 +0000 (01:03 +0000)]
aic7xxx.c:
        Shorten a diagnostic printf to fit in 80 columns.

        In ahc_abort_scbs() remove an incorrect diagnostic test
        that printed a spurious warning.

Obtained-from: FreeBSD

16 years agoaic79xx.c:
Peter Avalos [Fri, 6 Jul 2007 00:56:38 +0000 (00:56 +0000)]
aic79xx.c:
aic79xx.seq:
Convert the COMPLETE_DMA_SCB list to an "stailq".  This allows us to
safely keep the SCB that is currently being DMA'ed back the host on
the head of the list while processing completions off of the bus.  The
newly completed SCBs are appended to the tail of the queue.   In the
past, we just dequeued the SCB that was in flight from the list, but
this could result in a lost completion should the host perform certain
types of error recovery that must cancel all in-flight SCB DMA operations.

Switch from using a 16bit completion entry, holding just the tag and the
completion valid bit, to a 64bit completion entry that also contains a
"status packet valid" indicator.  This solves two problems:
  o The SCB DMA engine on at least Rev B. silicon does not properly deal
    with a PCI disconnect that occurs at a non-64bit aligned offset in the
    chips "source buffer".  When the transfer is resumed, the DMA engine
    continues at the correct offset, but may wrap to the head of the buffer
    causing duplicate completions to be reported to the host.  By using a
    completion buffer in host memory that is 64bit aligned and using 64bit
    completion entries, such disconnects should only occur at aligned addresses.
    This assumes that the host bridge will only disconnect on cache-line
    boundaries and that cache-lines are multpiles of 64bits.

  o By embedding the status information in the completion entry we can avoid
    an extra memory reference to the HSCB for commands that complete without
    error.

Use the comparison of a "host freeze count" and a "sequencer freeze count"
to allow the host to process most SCBs that complete with non-zero status
without having to clear critical sections.  Instead the host can just pause the
sequencer, performs any necessary cleanup in the waiting for selection list,
increments its freeze count on the controller, and unpauses.  This is only
possible because the sequencer defers completions of SCBs with bad status
until after all pending selections have completed.  The sequencer then avoids
referencing any data structures the host may touch during completion of the
SCB until the freeze counts match.

aic79xx.c:
Change the strategy for allocating our sentinal HSCB for the QINFIFO.  In
the past, this allocation was tacked onto the QOUTFIFO allocation.  Now that
the qoutfifo has grown to accomodate larger completion entries, the old
approach will result in a 64byte allocation that costs an extra page of
coherent memory.  We now do this extra allocation via ahd_alloc_scbs()
where the "unused space" can be used to allocate "normal" HSCBs.

In our packetized busfree handler, use the ENSELO bit to differentiate
between packetized and non-packetized unexpected busfree events that
occur just after selection, but before the sequencer has had the oportunity
to service the selection.

When cleaning out the waiting for selection list, use the SCSI mode
instead of the command channel mode.  The SCB pointer in the command
channel mode may be referenced by the SCB dma engine even while the
sequencer is paused, whereas the SCSI mode SCB pointer is only accessed
by the sequencer.

Print the "complete on qfreeze" sequencer SCB completion list in
ahd_dump_card_state().  This list holds all SCB completions that are deferred
until a pending select-out qfreeze event has taken effect.

aic79xx.h:
Add definitions and structures to handle the new SCB completion scheme.

Add a controller flag that indicates if the controller is in HostRAID
mode.

aic79xx.reg:
Remove macros used for toggling from one data fifo mode to the other.
They have not been in use for some time.

Add scratch ram fields for our new qfreeze count scheme, converting
the complete dma list into an "stailq", and providing for the "complete
on qfreeze" SCB completion list.  Some other fields were moved to retain
proper field alignment (alignment >= field size in bytes).

aic79xx.seq:
Add code to our idle loop to:
  o Process deferred completions once a qfreeze event has taken full
    effect.
  o Thaw the queue once the sequencer and host qfreeze counts match.

Generate 64bit completion entries passing the SCB_SGPTR field as the
"good status" indicator.  The first bit in this field is only set if
we have a valid status packet to send to the host.

Convert the COMPLETE_DMA_SCB list to an "stailq".

When using "setjmp" to register an idle loop handler, do not combine
the "ret" with the block move to pop the stack address in the same
instruction.  At least on the A, this results in a return to the setjmp
caller, not to the new address at the top of the stack.  Since we want
the latter (we want the newly registered handler to only be invoked from
the idle loop), we must use a separate ret instruction.

Add a few missing critical sections.

Close a race condition that can occur on Rev A. silicon.  If both FIFOs
happen to be allocated before the sequencer has a chance to service the
FIFO that was allocated first, we must take special care to service the
FIFO that is not active on the SCSI bus first.  This guarantees that a
FIFO will be freed to handle any snapshot requests for the FIFO that is
still on the bus.  Chosing the incorrect FIFO will result in deadlock.

Update comments.

aic79xx_inline.h
Correct the offset calculation for the syncing of our qoutfifo.

Update ahd_check_cmdcmpltqueues() for the larger completion entries.

aic79xx_pci.c:
Attach to HostRAID controllers by default.

Obtained-from: FreeBSD

16 years agoahc_eisa.c:
Peter Avalos [Fri, 6 Jul 2007 00:01:16 +0000 (00:01 +0000)]
ahc_eisa.c:
ahc_pci.c:
ahd_pci.c:
aic7xxx.c:
aic79xx.c:
aic_osm_lib.c:
aic_osm_lib.h:
Use common OSM routines from aic_osm_lib for bus dma operations,
delay routines, accessing CCBs, byte swapping, etc.

aic7xxx_pci.c:
Provide a better description for the 2915/30LP on attach.

aic79xx.h:
aic79xx_pci.c:
aic79xx.seq:
To speed up non-packetized CDB delivery in Rev B, all CDB
acks are "released" to the output sync as soon as the
command phase starts.  There is only one problem with this
approach.  If the target changes phase before all data are
sent, we have left over acks that can go out on the bus in
a data phase.  Due to other chip contraints, this only
happens if the target goes to data-in, but if the acks go
out before we can test SDONE, we'll think that the transfer
has completed successfully.  Work around this by taking
advantage of the 400ns or 800ns dead time between command
phase and the REQ of the new phase.  If the transfer has
completed successfully, SCSIEN should fall *long* before we
see a phase change.  We thus treat any phasemiss that
occurs before SCSIEN falls as an incomplete transfer.

aic79xx.h:
Add the AHD_FAST_CDB_DELIVERY feature.

aic79xx_pci.c:
Set AHD_FAST_CDB_DELIVERY for all Rev. B parts.

aic79xx.seq:
Test for PHASEMIS in the command phase for
all AHD_FAST_CDB_DELIVERY controlelrs.

ahd_pci.c:
ahc_pci.c:
aic7xxx.h:
aic79xx.h:
Move definition of controller BAR offsets to core header files.

aic7xxx.c:
aic79xx.c:
In the softc free routine, leave removal of a softc from the
global list of softcs to the OSM (the caller of this routine).
This allows us to avoid holding the softc list_lock during device
destruction where we may have to sleep waiting for our recovery
thread to halt.

ahc_pci.c:
Use ahc_pci_test_register access to validate I/O mapped in
addition to the tests already performed for memory mapped
access.

Remove unused ahc_power_state_change() function.

ahd_pci.c:
Remove reduntant definition of controller BAR offsets.  These
are also defined in aic79xx.h.

Remove unused ahd_power_state_change() function.

aic7xxx.c:
aic79xx.c:
aic79xx.h:
aic7xxx.h:
aic7xxx_osm.c:
aic79xx_osm.c:
Move timeout handling to the driver cores.  In the case
of the aic79xx driver, the algorithm has been enhanced
to try target resets before performing a bus reset.  For
the aic7xxx driver, the algorithm is unchanged.  Although
the drivers do not currently sleep during recovery (recovery
is timeout driven), the cores do expect all processing to
be performed via a recovery thread.  Our timeout handlers
are now little stubs that wakeup the recovery thread.

aic79xx.c:
aic79xx.h:
aic79xx_inline.h:
Change shared_data allocation to use a map_node so
that the sentinel hscb can use this map node in
ahd_swap_with_next_hscb.  This routine now swaps
the hscb_map pointer in additon to the hscb
contents so that any sync operations occur on
the correct map.

physaddr -> busaddr

Pointed out by: Jason Thorpe <thorpej@wasabisystems.com>

aic79xx.c:
Make more use of the in/out/w/l/q macros for accessing
byte registers in the chip.

Correct some issues in the ahd_flush_qoutfifo() routine.
    o Run the qoutfifo only once the command channel
      DMA engine has been halted.  This closes a window
      where we might have missed some entries.
    o Change ahd_run_data_fifo() to not loop to completion.
      If we happen to start on the wrong FIFO and the other
      FIFO has a snapshot savepointers, we might deadlock.
      This required our delay between FIFO tests to be
      moved to the ahd_flush_qoutfifo() routine.
    o Update/add comments.
    o Remove spurious test for COMPLETE_DMA list being empty
      when completing transactions from the GSFIFO with
      residuals.  The SCB must be put on the COMPLETE_DMA
      scb list unconditionally.
    o When halting command channel DMA activity, we must
      disable the DMA channel in all cases but an update
      of the QOUTFIFO.  The latter case is required so
      that the sequencer will update its position in the
      QOUTFIFO.  Previously, we left the channel enabled
      for all "push" DMAs.  This left us vulnerable to
      the sequencer handling an SCB push long after that
      SCB was already processed manually by this routine.
    o Correct the polarity of tests involving
      ahd_scb_active_in_fifo().  This routine returns
      non-zero for true.

Return to processing bad status completions through
the qoutfifo.  This reduces the time that the sequencer
is kept paused when handling transactions with bad
status or underruns.

When waiting for the controller to quiece selections,
add a delay to our loop.  Otherwise we may fail to wait
long enough for the sequencer to comply.

On H2A4 hardware, use the slow slewrate for non-paced
transfers.  This mirrors what the Adaptec Windows
drivers do.

On the Rev B. only slow down the CRC timing for
older U160 devices that might need the slower timing.
We define "older" as devices that do not support
packetized protocol.

Wait up to 5000 * 5us for the SEEPROM to become unbusy.
Write ops seem to take much longer than read ops.

aic79xx.seq:
For controllers with the FAINT_LED bug, turn the diagnostic
led feature on during selection and reselection.  This covers
the non-packetized case.  The LED will be disabled for
non-packetized transfers once we return to the top level idle
loop.  Add more comments about the busy LED workaround.

Extend a critical section around the entire
command channel idle loop process.  Previously
the portion of this handler that directly manipulated
the linked list of completed SCBs was not protected.
This is the likely cause of the recent reports of
commands being completed twice by the driver.

Extend critical sections across the test for,
and the longjump to, longjump routines.  This
prevents the firmware from trying to jump to
a longjmp handler that was just cleared by the
host.

Improve the locations of several critical section
begin and end points.  Typically these changes
remove instructions that did not need to be
inside a critical section.

Close the "busfree after selection, but before busfree
interrupts can be enabled" race to just a single sequencer
instruction.  We now test the BSY line explicitly before
clearing the busfree status and enabling the busfree
interrupt.

Close a race condition in the processing of HS_MAILBOX
updates.  We now clear the "updated" status before the
copy.  This ensures that we don't accidentally clear
the status incorrectly when the host sneaks in an update
just after our last copy, but before we clear the status.
This race has never been observed.

Don't re-enable SCSIEN if we lose the race to disable SCSIEN
in our interrupt handler's workaround for the RevA data-valid
too early issue.

aic79xx_inline.h:
Add comments indicating that the order in which bytes are
read or written in ahd_inw and ahd_outw is important.  This
allows us to use these inlines when accessing registers with
side-effects.

aic79xx_pci.c:
The 29320 and the 29320B are 7902 not 7901 based products.
Correct the driver banner.

aic7xxx.h:
Enable the use of the auto-access pause feature
on the aic7870 and aic7880.  It was disabled due
to an oversight.

aic7xxx.reg:
Move TARG_IMMEDIATE_SCB to alias LAST_MSG to
avoid leaving garbage in MWI_RESIDUAL.  This
prevents spurious overflows whn operating target
mode on controllers that require the MWI_RESIDUAL
work-around.

aic7xxx.seq:
AHC_TMODE_WIDEODD_BUG is a bug, not a softc flag.
Reference the correct softc field when testing
for its presence.

Set the NOT_IDENTIFIED and NO_CDB_SENT bits
in SEQ_FLAGS to indicate that the nexus is
invalid in await busfree.

aic7xxx_93cx6.c:
Add support for the C56/C66 versions of the EWEN and EWDS
commands.

aic7xxx.c:
aic7xxx_pci.c:
Move test for the validity of left over BIOS data
to ahc_test_register_access().  This guarantees that
any left over CHIPRST value is not clobbered by our
register access test and lost to the test that was
in ahc_reset.

Obtained-from: FreeBSD

16 years agoAdd usched_set() manpage.
Joe Talbott [Thu, 5 Jul 2007 17:36:46 +0000 (17:36 +0000)]
Add usched_set() manpage.

16 years agoUpdate cardbus/pccard support.
Sepherosa Ziehau [Thu, 5 Jul 2007 12:08:54 +0000 (12:08 +0000)]
Update cardbus/pccard support.

The original patch was done by joerg@; I seemed to "maintain"
it for quite a long time :P

Obtained-from: FreeBSD
Tested-by: many (intermittently tho)
16 years agoCorrection to my commit from yesterday:
Sascha Wildner [Thu, 5 Jul 2007 11:54:10 +0000 (11:54 +0000)]
Correction to my commit from yesterday:

ipw(4) and iwi(4) don't support hostap mode.

Pointed-out-by: sephe
16 years agoWhen outputing a code listing, properly display
Peter Avalos [Thu, 5 Jul 2007 05:46:33 +0000 (05:46 +0000)]
When outputing a code listing, properly display
macros that expand to multiple instructions.

Obtained-from: FreeBSD

16 years agoModify assembler to ignore carriage returns in input.
Peter Avalos [Thu, 5 Jul 2007 05:41:50 +0000 (05:41 +0000)]
Modify assembler to ignore carriage returns in input.

Obtained-from: FreeBSD

16 years agoWhen performing our register test, be careful
Peter Avalos [Thu, 5 Jul 2007 05:17:39 +0000 (05:17 +0000)]
When performing our register test, be careful
to avoid resetting the chip when pausing the
controller.  The test reads the HCNTRL register
and then writes it back with the PAUSE bit
explicitly set.  If the last write to the controller
before our probe is to reset it, the CHIPRST
bit will still be set, so we must mask it off
before the PAUSE operation.  On some chip versions,
we cannot access registers for a few 100us after
a reset, so this inadvertant reset was causing PCI
errors to occur on the read to check for paused
status.

Obtained-from: FreeBSD

16 years agoUse PCIR_BAR(x) instead of PCIR_MAPS.
Peter Avalos [Thu, 5 Jul 2007 05:08:32 +0000 (05:08 +0000)]
Use PCIR_BAR(x) instead of PCIR_MAPS.

Obtained-from: FreeBSD

16 years agoRemove extraneous line in comment.
Peter Avalos [Thu, 5 Jul 2007 04:56:38 +0000 (04:56 +0000)]
Remove extraneous line in comment.

Obtained-from: FreeBSD

16 years agoFix a race condition in the flushing of commands that
Peter Avalos [Thu, 5 Jul 2007 04:39:25 +0000 (04:39 +0000)]
Fix a race condition in the flushing of commands that
have completed across the bus but not to the host before
processing of an exception condition (busfree, bus reset,
etc.).  When flushing the controller of completed commands,
we also look for packetized commands that have completed
with good status and are stored in the "good status fifo".
The hardware will post to the good status fifo even if
data for that command is still active in a FIFO.  In
one particular failure case, a command outstanding on the
bus reconnected, transferred data into a FIFO, and provided
good status while the host driver was processing an expected
busfree event (PPR message negotiation).  This resulted in
an entry in the good status fifo that we completed, but
since the sequencer was paused, the data in the data FIFO
for this command had never been transferred to the host.
Once the busfree processing was complete, the sequencer
was unpaused, and the data completed its transfer to the
host.  In some instances, the client for the data was notified
of the completion and attempted to view the data before
it arrived.  This case only occurred during the
multi-target probe of the SCSI bus while some devices are
negotiating to go packetized and some devices are already
running in packetized.

The fix is to run and FIFOs active with a context in the
good status fifo to completion before completing the command
to the SCSI layer.  This requies duplicating the FIFO rundown
operations in the host driver that would usually be handled
by the firmware, but there is no other alternative.

Don't blindly shutdown the SCB dma engine when restarting
the sequencer.  We may be killing an operation that is
not supposed to be cancelled.  The cases where we need to
shutdown these dma engines are already handled elsewhere in
the driver.

Fix a few more ahd_in?() -> ahd_in?_scbram() instances.

Obtained-from: FreeBSD

16 years agoaic79xx.h:
Peter Avalos [Thu, 5 Jul 2007 02:47:43 +0000 (02:47 +0000)]
aic79xx.h:
Add softc flag to indicate that we have seen at
least one selection since the last bus reset or
SE/LVD bus change.

aic79xx.c:
Fix a few style nits.

In ahd_update_pending_scbs(), only touch card registers
once we have found an SCB that needs to be updated.
This removes lots of clutter from PCI traces taken of
error recovery performed by the driver.

Short circuit the first selection iocell workaround handler
if we've run once since the last bus reset or iocell change.
This also removes clutter from PCI traces.

Note if completions are pending in the qoutfifo when we dump
card state.

Obtained-from: FreeBSD

16 years agoUse clr instead of an explicit mov from ALLZEROS
Peter Avalos [Thu, 5 Jul 2007 01:21:56 +0000 (01:21 +0000)]
Use clr instead of an explicit mov from ALLZEROS
to clear SCB_FIFO_USE_COUNT.  This is just a
syntactic change.

Obtained-from: FreeBSD

16 years agoImplement ahd_inq_scbram() and change the implemention
Peter Avalos [Thu, 5 Jul 2007 01:13:05 +0000 (01:13 +0000)]
Implement ahd_inq_scbram() and change the implemention
of ahd_inl_scbram to use ahd_inw_scbram instead of
ahd_inb_scbram().

Obtained-from: FreeBSD

16 years agoCorrect a typo in a comment.
Peter Avalos [Wed, 4 Jul 2007 23:52:04 +0000 (23:52 +0000)]
Correct a typo in a comment.

Add a comment in ahd_clear_critical_sections() about
our need to leave ENBUSFREE set in SIMODE1 while single
stepping.

Re-arrange some delay loops so that we always perform
a read after any register write and before the delay.
This should make the delay loop more accurate.

When completing message processing for a packetized
commention, return the controller to a state where
invalid non-packetized phases will still cause protocol
violations.  These are the same operations as those
performed in the clear_target_state routine in the
firmware.

Now that we have a chip with working ABORTPENDING
support (the 7901B), comment out the automatic use
of this feature until we can adequately test it.
The previous checkin updated the bug mask for the
7901B so this code was exercised.

When resetting the bus, perform an ahd_flush_device_writes()
call so that our reset assertion delay is acurately
timed from when the reset bit is written to the controller.

Obtained-from: FreeBSD

16 years agoFix an insufficient test of the message flags when determining whether
Matthew Dillon [Wed, 4 Jul 2007 23:36:26 +0000 (23:36 +0000)]
Fix an insufficient test of the message flags when determining whether
an abortable request has already completed or not.

Abort requests are sent to the same port as the original message which
means that the original message will have been processes and either replied
to or queued before the abort message is acted upon.  However, when an
abort message is replied the MSGF_DONE bit is *NOT* set until the reply
reaches the reply port, potentially requiring an IPI.

This can lead to a race where the code processing an abort request
incorrectly determines that the message has not yet been replied when in
fact it has, leading to a double-reply and a panic.

The solution is to test the MSGF_REPLY bit, which is set by the target
cpu (the one processing the original message) when replying to the message
prior to issuing any IPI.

Reported-by: Peter Avalos <pavalos@crater.dragonflybsd.org>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue717>

16 years agoRemove an old comment that no longer applies.
Peter Avalos [Wed, 4 Jul 2007 23:04:13 +0000 (23:04 +0000)]
Remove an old comment that no longer applies.

Fix a jump in our unexpected non-packetized phase
handler to use an explicit label.  The old code
had a hardcoded jump offset that was off by one
instruction.

Obtained-from: FreeBSD

16 years agoaic79xx.h:
Peter Avalos [Wed, 4 Jul 2007 22:56:30 +0000 (22:56 +0000)]
aic79xx.h:
Add a 7901A specific feature definition.

aic79xx_pci.c:
Split out the general aic790X setup into it's own
setup handler that works on single and dual controllers.
Adjust all other PCI setup handlers to initialize the
chips basic features and type before calling the generic
handler.

Turn off a few Rev B workarounds that are not required
on the 7901B.

Obtained-from: FreeBSD

16 years agoTry to catch double-replies a little earlier so we get a more meaningful
Matthew Dillon [Wed, 4 Jul 2007 19:40:35 +0000 (19:40 +0000)]
Try to catch double-replies a little earlier so we get a more meaningful
backtrace.

16 years agoUpdate list of supported drivers in hostapd(8).
Sascha Wildner [Wed, 4 Jul 2007 16:52:40 +0000 (16:52 +0000)]
Update list of supported drivers in hostapd(8).

Add references to hostapd(8) on the pages of supported drivers.

16 years agoAdd a hostapd rc script.
Sascha Wildner [Wed, 4 Jul 2007 16:28:45 +0000 (16:28 +0000)]
Add a hostapd rc script.

Obtained-from: FreeBSD

16 years agoFix stupid mistake. Sorry.
Hasso Tepper [Wed, 4 Jul 2007 06:06:48 +0000 (06:06 +0000)]
Fix stupid mistake. Sorry.

16 years agoFix logic to avoid a potential deadlock in ahd_run_qoutfifo()
Peter Avalos [Tue, 3 Jul 2007 21:13:35 +0000 (21:13 +0000)]
Fix logic to avoid a potential deadlock in ahd_run_qoutfifo()
if we happen to catch the DMA engine in just the right state.

Obtained-from:  FreeBSD

16 years agoConvert to use cam_calc_geometry().
Peter Avalos [Tue, 3 Jul 2007 20:55:42 +0000 (20:55 +0000)]
Convert to use cam_calc_geometry().

Obtained-from:  FreeBSD

16 years agoRemove last usb_port.h defines usages from the tree - selwakeuppri(),
Hasso Tepper [Tue, 3 Jul 2007 19:28:16 +0000 (19:28 +0000)]
Remove last usb_port.h defines usages from the tree - selwakeuppri(),
config_pending_*(), config_detach(), clalloc(), clfree(), usb_malloc_type
and usb_proc_ptr.

Move some defines to bus/usb/usb.h and remove bus/usb/usb_port.h include
from there. Drivers that want to use portability macros have to include
<bus/usb/usb_port.h> directly.

16 years agoFrom FreeBSD's log:
Peter Avalos [Tue, 3 Jul 2007 18:51:45 +0000 (18:51 +0000)]
From FreeBSD's log:

Log:
Fixed about 50 million errors of infinity ulps and about 3 million errors
of between 1.0 and 1.8509 ulps for lgammaf(x) with x between -2**-21 and
-2**-70.

As usual, the cutoff for tiny args was not correctly translated to
float precision.  It was 2**-70 but 2**-21 works.  Not as usual, having
a too-small threshold was worse than a pessimization.  It was just a
pessimization for (positive) args between 2**-70 and 2**-21, but for
the first ~50 million (negative) args below -2**-70, the general code
overflowed and gave a result of infinity instead of correct (finite)
results near 70*log(2).  For the remaining ~361 million negative args
above -2**21, the general code gave almost-acceptable errors (lgamma[f]()
is not very accurate in general) but the pessimization was larger than
for misclassified tiny positive args.

Now the max error for lgammaf(x) with |x| < 2**-21 is 0.7885 ulps, and
speed and accuracy are almost the same for positive and negative args
in this range.  The maximum error overall is still infinity ulps.

A cutoff of 2**-70 is probably wastefully small for the double precision
case.  Smaller cutoffs can be used to reduce the max error to nearly
0.5 ulps for tiny args, but this is useless since the general algrorithm
for nearly-tiny args is not nearly that accurate -- it has a max error of
about 1 ulp.

Obtained-from:  FreeBSD

16 years agoAdd a section on how to build the world inside a virtual kernel.
Matthew Dillon [Tue, 3 Jul 2007 18:05:55 +0000 (18:05 +0000)]
Add a section on how to build the world inside a virtual kernel.

16 years agoFix an issue which arises with the TAP interface when the highly
Matthew Dillon [Tue, 3 Jul 2007 17:40:51 +0000 (17:40 +0000)]
Fix an issue which arises with the TAP interface when the highly
experimental kern.intr_mpsafe is set.  TAP has to obtain the MP lock
when handling SIGIO.

Reported-by: Pawel Biernacki <kaktus@acn.pl>
16 years agoFix a number of races in the controlling terminal open/close code.
Matthew Dillon [Tue, 3 Jul 2007 17:22:14 +0000 (17:22 +0000)]
Fix a number of races in the controlling terminal open/close code.
This does not completely fix issue 715 but it should help reduce the
problem set.

* Integrate the revoke into ttyclosesession() so it can be issued as part
  of the same locking op.
* Check for races after acquiring the vnode lock and retry if necessary.
* Use vhold/vdrop to prevent destruction of the vnode during a possible
  race while we are attempting to obtain the lock.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk> added the comment:
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue715>

16 years agoFix typo.
Hasso Tepper [Tue, 3 Jul 2007 07:21:08 +0000 (07:21 +0000)]
Fix typo.

16 years agoNuke USB_DO_ATTACH and remove device_t dv, since it is no longer needed.
Hasso Tepper [Tue, 3 Jul 2007 06:58:50 +0000 (06:58 +0000)]
Nuke USB_DO_ATTACH and remove device_t dv, since it is no longer needed.

Obtained-from: FreeBSD

16 years agoNuke the code specific to other BSDs.
Hasso Tepper [Tue, 3 Jul 2007 06:38:36 +0000 (06:38 +0000)]
Nuke the code specific to other BSDs.

16 years agoOptimizations, expanded comments, and accuracy fixes.
Peter Avalos [Tue, 3 Jul 2007 04:54:07 +0000 (04:54 +0000)]
Optimizations, expanded comments, and accuracy fixes.

For in-depth comments, see the FreeBSD cvs logs:
s_cbrt.c:  1.8-1.14
s_sbrtf.c: 1.8-1.17

Obtained-from:  FreeBSD

16 years agoNuke USB_DECLARE_DRIVER and USB_DECLARE_DRIVER_INIT macros.
Hasso Tepper [Mon, 2 Jul 2007 23:52:05 +0000 (23:52 +0000)]
Nuke USB_DECLARE_DRIVER and USB_DECLARE_DRIVER_INIT macros.

16 years agoOops, forgot space.
Sascha Wildner [Mon, 2 Jul 2007 19:32:34 +0000 (19:32 +0000)]
Oops, forgot space.

16 years agoAdd break after parsing the -n option.
Joe Talbott [Mon, 2 Jul 2007 17:44:00 +0000 (17:44 +0000)]
Add break after parsing the -n option.

16 years agoIf more then 2 virtual cpus are present, dedicate one to handle I/O
Matthew Dillon [Mon, 2 Jul 2007 17:15:10 +0000 (17:15 +0000)]
If more then 2 virtual cpus are present, dedicate one to handle I/O
processing.