Commit Graph

45 Commits

Author SHA1 Message Date
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos b64edcaded fix empty if 2006-10-04 15:53:24 +00:00
xtraeme 05670fe773 Remove unused variable to make this build again. 2006-09-02 09:26:47 +00:00
christos 9f681d6f65 comment out impossible code 2006-09-02 07:00:23 +00:00
perry 93124077ae Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:27:29 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
tsutsui 1d25696d75 u_intNN_t -> uintNN_t 2005-01-02 12:22:18 +00:00
tsutsui 036acd9295 Use ANSI function decls. 2004-09-25 11:58:19 +00:00
tsutsui a5c60861e8 Sprinkle DELAY(1)'s in several busy loops to avoid excessive bus access.
Inspired by OpenBSD.
2004-09-25 10:47:29 +00:00
tsutsui 30e4125256 On manual xfer via TEMP register, set PCTL_BFINT_ENAB and check
bus free by INTS register. spc_intr() also checks the INTS_DISCON bit.
2004-09-25 10:36:15 +00:00
tsutsui 45d871e0fb In spc_intr(), return 0 if the interrupt is not for spc(4). 2004-09-25 10:32:15 +00:00
tsutsui dc28263470 Use manual xfer via TEMP register in status phase even on x68k.
Some devices do not transfer data with proper way on status phase
and it causes bus error in spc_datain_pio() which uses auto xfer
via DREG register on weird x68k hardware.
2004-09-25 10:15:36 +00:00
mycroft d24f7ca79e Close a race condition in the datain loop. If we receive another byte between
reading the FIFO status and reading the interrupt status, we could end up
leaving it in the FIFO.  Force another round through the loop after reading the
interrupt status until the FIFO reads empty again.

Also, there is no point in having the extra loop to wait for the transfer
command to the controller to be acknowledged, because the transfer loop handles
that just fine -- and getting rid of it fixes another race condition.
2004-08-12 03:39:11 +00:00
mycroft c6c0aabf57 Correct the overrun loop while I'm at it. 2004-08-11 14:28:44 +00:00
mycroft 0ef13a458b Recode the datain_pio loop. This improves performance substantially (almost
2x) with my spc@pcmcia.
2004-08-11 14:22:34 +00:00
mycroft 4e92489373 Add detach support for spc@pcmcia, modeled after aic@pcmcia. 2004-08-09 14:07:57 +00:00
mycroft 0553444712 Fix a printf() format for Alpha. 2004-08-07 20:04:44 +00:00
tsutsui f71b2096d2 On manual transfer via TEMP register, data should be read
before asserting ACK.
2004-08-07 07:17:09 +00:00
tsutsui 47c4c87d2c Fix bus error trap on X68030/25MHz on-board SPC, which may have some quirk.
Problem reported by Yasushi Oshima.
2004-01-06 18:07:17 +00:00
wiz c5670263e0 Fix some typos. From Tom Cosgrove via jmc@openbsd. 2003-11-02 11:07:44 +00:00
isaki 515af69254 Delete strange ifdef x68k.
Requested by tsutsui@
2003-09-07 05:26:30 +00:00
isaki 05e2e8b5b9 Delete unnecessary #ifndef for x68k.
approved by tsutsui@
2003-08-29 02:45:57 +00:00
tsutsui 1a4743265a - Add hooks for MD DMA transfers.
- Prepare ADAPTER_REQ_SET_XFER_MODE function.
  (currently sync xfer is not supported)
2003-08-01 00:38:38 +00:00
tsutsui fddebe9b9c There is a report that x68k SCSI no longer works after the previous changes.
It seems x68k SPC SCSI has several hardware quirks, so add some (a bit ugly)
#ifdefs for workaround.  (XXX - needs revisiting)
2003-07-27 03:51:28 +00:00
tsutsui c42dcc7de8 More misc fixes for forthcoming hp300 MI SCSI support:
- Don't use SCMD_XFR command in message-in phase and status phase.
   It causes unexpected hangs on heavy load. Instead transfer data
   manually via TEMP register by SCMD_SET_ACK and SCMD_RST_ACK.
 - Don't set SCMD_ICPT_XFR in spc_dataout_pio() and spc_msgout().
 - Rewrite spc_datain_pio() to handle FIFO more properly.
2003-07-05 19:50:17 +00:00
tsutsui e30199e1ff Misc cleanup:
- disable debug code by default
 - use MI minphys()
 - add proper delay in spc_find()
 - initialize TMOD register in spc_reset()
 - wrap a sanity check with #ifdef DIAGNOSTIC (sync with aic6360.c)
 - no need to set LUN bits in SCSI command which should be done in mid-layer
 - set proper resid even in error case
 - fix/remove some bogus comments
2003-07-05 19:31:11 +00:00
tsutsui cfa57f87aa Use bus_space_{read,write}_multi_1() for PIO data transfers. 2003-07-05 19:04:48 +00:00
tsutsui 6615ddefa9 Rename some MI mb89352 functions for consistency:
spcintr() -> spc_intr()
 spcattach() -> spc_attach()
2003-07-05 19:00:16 +00:00
tsutsui 443eeab7de Some cosmetics:
- Remove useless macro.
 - Remove ^L characters.
 - KNF a comment.
2003-07-05 18:56:55 +00:00
tsutsui 09d1921299 Misc cosmetics:
- some KNF and wrap long lines
- use TAILQ macro
- replace some magic numbers with macro
- use #if 0/#endif pair to disable code
2003-05-19 14:56:03 +00:00
tsutsui 0ff49f9f99 hz -> Hz 2003-02-21 17:14:04 +00:00
thorpej 34820075d5 Statements must follow labels. 2002-05-30 21:09:54 +00:00
bouyer e5727031fb Implement mstohz() as discussed on tech-kern, and use it in SCSI drivers
to convert xs->timeout to callout() parameter.
2002-04-05 18:27:45 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem a4bae8b066 add/cleanup RCSID 2001-11-13 13:14:31 +00:00
tsutsui 064be15283 Use common macro to check message length. 2001-11-04 12:03:41 +00:00
thorpej 0884f20bf7 bzero -> memset 2001-07-07 16:13:44 +00:00
thorpej 7711ad565b bcopy -> memcpy 2001-07-07 15:53:13 +00:00
bouyer 937a7a3ed9 Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
  ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
  to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
  peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
  recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
  scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
  (no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
  set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
  the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
  will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
2001-04-25 17:53:04 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
thorpej 63b8530b4e Update for SCSPI changes. 1999-09-30 23:04:39 +00:00
minoura 1ff51fea1a Some x68k conditionals (I don't know why these are needed...). 1999-03-14 16:14:54 +00:00
minoura 38803874bb Translated Japanese comments. 1999-02-19 16:19:53 +00:00
minoura 4d5a04afc4 MI version of the Fujitsu MB89352 SCSI Protocol Controler (SPC) driver.
Based on experimental NetBSD/pc98 ISA/PISA version, which was derived
from the MD /sys/arch/x68k/dev/spc.c.
1999-02-13 17:33:14 +00:00