Commit Graph

174 Commits

Author SHA1 Message Date
fredb d19528e4e0 Adapt to MI ATA/wdc changes. Especially, now that the address of
each individual ATA register is in the attachment structure, we
can dispense with the custom bus_space mapping hack which set the
stride, then unset it for particular bus_space functions. (There
is really no stride; the data register is read and written to
consecutive bytes. The control register mappings just happen to
be separated by four bytes.) While we're here, de-__P(), and lose
a confusing shift.

This has been tested on Quadra 630. Reviewed by bouyer.
2003-12-14 15:31:23 +00:00
fredb 2ba4302402 Initialize some "might (not) be used uninitialized" variables. 2003-10-27 22:16:04 +00:00
bouyer b758d4deb3 Adapt for wdcattach() prototype change. 2003-10-08 11:11:06 +00:00
mycroft eefae40298 Hide the use of config_interrupts() in one place. 2003-09-25 19:29:48 +00:00
mycroft d40837608f 1) Use config_interrupts() to attach IDE and ATAPI drives. This eliminates
most polling.
2) Clean up some goofiness in pciide -- get rid of the whole "candisable" path
   (it's gratuitous) and simplify the code by calling pciide_map_compat_intr(),
   *_set_modes() and wdc_print_modes() from central locations.
3) Add a register writability and register ghost test to eliminate phantom
   drives more quickly.
2003-09-19 21:35:56 +00:00
lukem 4b2744bf35 __KERNEL_RCSID() 2003-07-15 02:43:09 +00:00
dsl d91455ce26 Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
2003-05-02 08:45:10 +00:00
thorpej 71cdc2eb5e Use PAGE_SIZE rather than NBPG. 2003-04-02 00:44:22 +00:00
jdolecek abc0ac3bc2 attempt to fix compilationg errors for printf formats due to 64bit daddr_t
adresses PR port-mac68k/20188 by Hauke Fath
2003-02-03 22:38:23 +00:00
wiz 1035faff1d writable, not writeable. 2003-01-06 20:30:28 +00:00
thorpej 72a2c87923 Use aprint_normal() for cfprint routines. 2003-01-01 01:34:45 +00:00
mrg 603098b9b5 implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
	- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
	when processing hw.diskstats, add the read&write bytes/transfers for
	the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail.  however, the next time this is
change it will not fail again.

this is just the kernel portion.
2002-11-01 11:31:50 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
chs 1c2419d28a merge the 12 copies of vm_machdep.c on the m68k platforms.
clean up some other stuff along the way, including:
 - use m68k/cacheops.*, remove duplicates from cpu.h.
 - centralize a few declarations in (all the copies of) cpu.h.
 - define M68K_VAC on platforms which have a VAC.
 - switch the sun platforms to the (now common) proc_trampoline().
 - do the phys_map thang on the sun platforms too, no reason not to.
2002-10-20 02:37:21 +00:00
jdolecek fc6049b9b7 replace the somewhat strange poll routine with standard nopoll() (a.k.a
seltrue())
2002-10-10 22:33:15 +00:00
jdolecek 47ae4d5c59 remove local declaration of iwm_cd and fd_cd for LKM case; it's superfluous
and doesn't even compile after latest autoconf changes
2002-10-02 20:35:28 +00:00
thorpej c5e91d447d Use CFATTACH_DECL(). 2002-10-02 04:55:47 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej 6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00
gehenna 70c867953d make this compile with _LKM. 2002-09-06 17:36:19 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
hannken ffd7a8c585 Convert to new device buffer queue interface.
Tested with help from Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
on Performa 600 and Quadra 700.
2002-08-29 14:15:37 +00:00
hannken 6243846e46 Get rid of error -66 (sector not found).
From Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
2002-08-29 09:26:23 +00:00
thorpej 66a9d33599 Don't use multi-line string literals. 2002-05-30 21:36:38 +00:00
shiba a26fd009c9 Add IDE drive support.
Note:
   (1) Character device major number chages to 49 from 48(in my original
       code). So it is necessary to rebuild device files.
   (2) Must use Booter 2.0.0a10 or later.
   (3) Default mode is cpu busy wait. It is defined by flags 0x1000.
       It will be more slow than before.
       No flags means hardware interrupt mode. But it might be able to
       get no interrupts.

Support machines:
   (1) Quadra 630 series
   (2) PowerBook 150

Non tested machine:
   (1) PowerBook 190 series

Approved by: briggs
2002-04-27 19:29:08 +00:00
briggs 41ec4fe6c2 Accept the bus_dma_tag_t for obio, too. 2002-04-10 05:13:09 +00:00
chs 8f0070db30 prepare for ELF:
- add "%" prefix to register names in assembly code.
 - use _C_LABEL() where necessary.
 - use packed structures where necessary to match the old ABI.
2001-11-20 03:19:41 +00:00
briggs fd5f7080b3 Correct operation of non-pseudo-DMA mode. Used on 660 & 840 AV models.
From Takeshi Shibagaki<ie9t-sbgk@asahi-net.or.jp>.
2001-11-18 05:22:32 +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
briggs 118221b2e6 Handle the TRPAD case a little better.
Also, if the so-called DMA operation is a write and ends without target-
complete set, count the data in the FIFO as residual and add that to the
amount in the counters.  Hauke Fath reports that this passes early testing
on his Quantum Viking.
2001-01-18 03:43:18 +00:00
briggs f7cf6d4afb Do not try to second-guess the ncr53c9x driver by setting *dmasize to 0
if it is 64k.  TCL and TCM will be set properly if we just leave it alone.
Not only that, the ncr53c9x driver issues TRPAD or TRANS based on this
value.  We do not want TRPAD in this case!
2000-12-29 21:31:44 +00:00
briggs 811d597c78 Rework the esp driver a little bit to improve performance. This requires
an ugly bit where we record the value of a2 while handling a "nofault" bus
error in locore.s in order to know how far the transaction got before a
disconnect (see esp.c comments for more details on this).
Also get rid of a loop (and delay()!) in the interrupt routine--hinted at
and researched by Chas Williams <chas@cmf.nrl.navy.mil>.
2000-12-29 17:23:31 +00:00
scottr fc6d3c5f48 Unmap the valkyrie register space when we're finished with it in
the match function.  It's not like we can save that state for later,
and we don't use it anyway.
2000-12-04 06:25:19 +00:00
scottr b21b6272fa Fix PR 11000: The esp driver needs two longwords in DAFB register space to
implement pseudo-DMA transfers with the SCSI controller.  This caused our
match to fail when we couldn't map the entire DAFB register/control space
for our own use.  Instead, we map only (about) what we will need in two
separate regions.

As a consequence we no longer do Turbo SCSI configuration here; indeed, it
may have caused us trouble later on if we actually changed the values
stored in those registers in the esp driver.
2000-12-04 06:23:36 +00:00
briggs d13747524c Fixup for bogus assumptions about bus_space_handle_t. 2000-07-30 21:40:49 +00:00
scottr da62d2ef12 Avoid attaching on the Mac TV, as this system seems to not be
completely backward compatible to the II-series sound hardware.
2000-07-02 21:10:14 +00:00
mrg 28d898391b remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-29 08:10:45 +00:00
mrg e185413725 remove redudant <vm/pmap.h> includes. <vm/pmap.h> -> <uvm/uvm_pmap.h> 2000-06-27 04:18:48 +00:00
simonb 889c658b5b Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes.  Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
2000-06-26 04:55:19 +00:00
nisimura 4371d91433 Have MI ncr53c9x_attach() the 2nd and 3rd arguments for scsipi_adater
and scsipi_device respectively, with size reduction of ncr53c9x_softc.
Specifying NULL instructs the driver to use default adapter and default
device codes. Every target port has ncr53c9x_attach(sc, NULL, NULL) anyway.
2000-06-05 07:59:50 +00:00
jdolecek c5d51d433e fix prototype for fd_mod_free() - should fix port-mac68k/10063 2000-05-27 10:25:15 +00:00
thorpej 071aed40ac A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well.  This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
2000-05-19 18:54:22 +00:00
jdolecek 2a0b424186 LKM fixes:
* fix a typo in callout_stop() call
* prototype fd_mod_init(), fd_mod_free() to avoid warnings
* include iwm_mod.h

Fix sent in port-mac68k/9787 by Dave Huang.
2000-04-05 11:37:13 +00:00
tsutsui 9100212ef0 Add a "sc_rev" member to ncr5380_softc and handle CXD1180 quirk
in MI ncr5380sbc.
2000-03-25 15:27:54 +00:00
thorpej b667a5a357 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 06:30:07 +00:00
mycroft 6780878550 Fix pasto in previous. 2000-03-18 16:14:57 +00:00
mycroft 0af581a1a1 Add a ncr5380_attach() routine which does part of the initialization, attaches
the scsibus, and does the addref/delref dance.
2000-03-18 16:13:22 +00:00
scottr d67bf4504d Turn off some noise during autoconfig on the IIfx/Q9x0, making it
conditional on the TRACE_CONFIG debugging flag.
2000-02-24 05:02:33 +00:00
scottr 8a00740789 Merge wscons work onto the main development branch. 2000-02-14 07:01:44 +00:00