Commit Graph

105 Commits

Author SHA1 Message Date
sommerfeld 851de295eb Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
2000-12-28 22:59:06 +00:00
jdolecek 5fea96167f use new generic bootverbose instead of local definition 2000-09-24 12:37:03 +00:00
mrg 7c15053eed remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-28 16:08:42 +00:00
mrg f4e210fb2c remove redundant vm includes 2000-06-26 15:26:35 +00:00
tsutsui 909b096cf8 Remove #ifdef __NetBSD__ code inside !__NetBSD__ part. 2000-04-08 13:49:43 +00:00
tsutsui de19673726 Add vaddr_t cast to vtophys() arg. (for powerpc) 2000-04-08 13:44:12 +00:00
tsutsui cae6a3d2a4 Fix bogus byte-swap code in ncr_snooptest().
XXX This snoop test is not needed if ncr had real bus_dma(9) support...
2000-04-06 14:42:06 +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
cgd 638726b0db * rework the quirk table ('device_tab'):
* QUIRK_NOMSG only has any meaning when NCR_GETCC_WITHMSG
      is defined.  Therefore, there's no harm in using it when
      NCR_GETCC_WITHMSG is not defined.  so, simplify the table
      by removing the #ifdef.
    * there's really no point in having table entries after
      an entry which will match everything.
    * add some comments, clean up spacing.

* add an entry for "QUANTUM"/"ATLAS IV" drives with flags
  QUIRK_NOTAGS|QUIRK_NOMSG.  (I included the latter flag only
  because everything else had it before! ... which means that
  all the functionality added with the NCR_GETCC_WITHMSG define
  would never get used! *sigh*)  The latter fixes the problems
  I was having on an Atlas, and should fix the problems mentioned
  by Hans Hoppe <hopha@casema.net> in comments on PR#7694.
2000-03-18 06:59:02 +00:00
cgd 52b7212c58 undo the non-script changes from rev 1.87. They caused problems in
1.4.x and i have concerns (but no concrete proof) they will cause/have caused
problems in -current as well.  Really, the right way to fix this is to
rewrite the driver, and push up tagged queueing handling into a common
middle layer that'll do it right in a low-level-driver-independent manner.
I'll fix my particular issues by using the ncr driver quirk mechanism.
2000-03-18 06:47:28 +00:00
soren bd1cc85c63 Use a kvtophys() hack for mips like for alpha. No idea if it actually works.. 2000-03-17 11:30:14 +00:00
sommerfeld 3a76270201 deal with a DELAY vs. delay issue 2000-02-20 22:19:29 +00:00
tsutsui f1a6ac445d Use htole32() and le32toh() instead of SCR_BO().
XXX Should we still keep non-NetBSD part?
1999-12-26 10:41:22 +00:00
tsutsui 2f3ba68db9 Add more SCR_BO(). NCR53c875 now works on macppc.
XXX All SCR_BO() macros should be replaced with htole32() or le32toh().
1999-12-20 03:37:06 +00:00
thorpej 9eea13a674 Mark exactly 3 uses of the SCR_BO() macro as being bogus; these 3 uses
already involve byte swapping on big-endian systems due to bus_space_*().

However, the use is self-consistent, and the value is not interpreted
by the chip, so it probably does not matter.  Leave them in for now; we
can always look at their removal later.
1999-12-05 19:40:18 +00:00
thorpej 8c1cbdbed5 Slight change to previous, to make it more obvious as to what's going on. 1999-12-05 19:33:13 +00:00
thorpej d06db4b7da I have the feeling that OpenBSD has never tried the 53c825a, 53c875, 53c875j,
53c885, 53c895, or 53c896 on big-endian systems.
1999-12-05 18:40:46 +00:00
thorpej 389c599f35 Changes from the OpenBSD `ncr' driver to byte-swap the script on big-endian
systems.  Should make this go on e.g. the Apple Network Server.
1999-12-05 18:25:18 +00:00
cgd c3d5267629 Don't burst into flame when a QUEUE FULL message is received. Also,
do a gross hack which allows seemingly-broken quantum drives to function
with this driver.  The gross hack is to disable tagged queueing completely
when QUEUE FULL is received.  That costs performance on drives which
do tagged queueing properly and which return QUEUE FULL, but given the way
this driver works it's seems to be the only thing short of significant
recoding which will make it function with the quantum drives in question.
1999-10-08 20:43:45 +00:00
thorpej a339b2839b Have I mentioned how much I love this driver? Fix the code in the tagged
queueing support that decreases the number of openings on a device; it
previously assumed that a scsipi_link's `openings' were descreased as
commands were issued, which is not longer the case (`active' is increased).
1999-10-05 17:45:57 +00:00
thorpej 120e8cac48 Fix a botch when updating for the SCSIPI changes. 1999-10-05 00:29:41 +00:00
thorpej 63b8530b4e Update for SCSPI changes. 1999-09-30 23:04:39 +00:00
matt fd59bba7cb after bus_dmamem creating some memory, zero it out. This has stopped
my alpha from getting COMMAND FAILED on random boots.
1999-08-19 00:43:45 +00:00
tron 439a6c4942 Add missing prototype for read_tekram_eeprom() to make driver compile if
"options NCR_TEKRAM_EEPROM" is specified in the kernel configuration file.
Patch supplied by Hans Hoppe in PR kern/8141.
1999-08-04 20:51:31 +00:00
bouyer a81c366fed Bump MAX_START to 256, so that the ncr driver can work with more than 5
devices on the same bus. See PR kern/6347 for details.
1999-07-29 10:00:34 +00:00
thorpej b33907f299 Don't DMA the scsi command from or the sense data to the scsipi_xfer
directly.  That would require that we map the scsipi_xfer into DMA
space.  Instead, copy to/from the NCR CCB, which the script already
has to DMA to/from.  These copies are small, and don't seem to affect
performance.
1998-12-13 00:11:37 +00:00
thorpej 178fc3cc05 Step 3:
Use DMA maps for the actual data transfers.
1998-12-12 23:41:56 +00:00
thorpej 3cc30b3641 Step two:
Use DMA-safe memory for the script instances.  The most important thing
here is that is guarantees that the script is contiguous in DMA space.
1998-12-12 00:19:13 +00:00
thorpej 086b4b0bf1 Step one of bus_dma'ing the PCI NCR driver:
Separate the ncb (i.e. softc) members that are accessed by the script into
a separate structure.  Allocate one of these structures in DMA safe memory
using bus_dma, and change RELOC_SOFTC to use the DMA address of this
structure.
1998-12-11 23:21:11 +00:00
mjacob 74bc9f26d5 Update HBAs to incorporate the new max_lun property. 1998-12-05 19:43:33 +00:00
thorpej 3b068a6c78 Adapt to the new scsipi_adapter interface. 1998-11-19 21:53:32 +00:00
thorpej 29d472f53d Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter.  This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.
1998-10-10 00:28:28 +00:00
mjacob 07bb8331e8 Roll back to 1.71 version- too many unexplainable problems with 1.72. 1998-09-21 14:53:58 +00:00
mjacob 52588e4fde add more general probe to regular more operation stuff 1998-09-08 07:30:32 +00:00
veego ff2c3adddc Add some braces to stop the new egcs warnings. 1998-08-20 19:55:06 +00:00
eeh a2dd74ed79 Merge paddr_t changes into the main branch. 1998-08-13 02:10:37 +00:00
ross 920e7c7d5d Fix a race involving determination of pollmode. This is not known to be
associated with any observed lossage...it was just noticed while reading
ncr_start().

g/c some now-unreachable code produced by the earlier race condition fix.
1998-08-10 13:10:33 +00:00
ross 815f9f2445 1. Untangle preprocessor conditionals for sanity and {} balance
2. Fix a race between the first callout and the first non-polled ncr_start()
1998-08-08 00:14:08 +00:00
thorpej ea3a1d9c44 Nuke __BROKEN_INDIRECT_CONFIG. 1998-06-08 06:55:54 +00:00
matt d575ad31d0 Use PCI_REVISION and eliminate some pci_conf_reads 1998-05-28 13:51:09 +00:00
thorpej 2538ed1062 Use offsetof() from libkern.h 1998-01-28 02:23:04 +00:00
thorpej 06ce220790 Update for config changes. 1998-01-12 09:39:57 +00:00
perry 3979615b0d ncr_reg.h -> ncrreg.h per Dave Huang 1997-09-23 02:39:15 +00:00
perry 69fbaa747d updates from FreeBSD via Dave Huang <khym@bga.com> 1997-09-23 02:27:43 +00:00
bouyer 6f3bab1f59 Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
1997-08-27 11:22:52 +00:00
cjs 312218482a Add QUIRK_NOTAGS quirk to disable tagged command queuing for particular
drives. Add a quirk entry for HP C372x drives with QUIRK_NOTAGS. Also,
print quirks being used if quirks other than QUIRK_NOSYNC are being used.
1997-07-01 00:41:43 +00:00
mikel 7aa8facf27 end line after printing WIDE SCSI status; fixes PR kern 3505. 1997-04-17 07:21:14 +00:00
cgd 36949596f0 rename pci_map_register to pci_mapreg_map. The latter name is more
descriptive, and allows for a sane name for a function which just digs
the info out of the mapping register but doesn't do the mapping.
1997-04-13 20:14:20 +00:00
cgd 4c2cff7209 use pci_map_register(). map both mem and I/O spaces, preferring mem space
by default if it's usable, but falling back to I/O space if mem isn't usable.
If NCR_IOMAPPED is defined (default on the x86), prefer I/O space
then fall back to mem.  Also, clean up the various memory consistency checks
so that they can deal with run-time determination of whether or not the
device is to be memory- or I/O-mapped.
1997-04-13 19:58:17 +00:00
mycroft e481e52aa9 Fix a couple of splhigh()s that should be splbio(). 1997-03-04 21:42:32 +00:00